tcpedit_opts.def 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. flag = {
  2. name = tcpedit;
  3. documentation;
  4. lib-name = tcpedit;
  5. };
  6. flag = {
  7. name = portmap;
  8. value = r;
  9. arg-type = string;
  10. max = 1;
  11. descrip = "Rewrite TCP/UDP ports";
  12. doc = <<- EOText
  13. Specify a list of comma delimited port mappingings consisting of
  14. colon delimited port number pairs. Each colon delimited port pair
  15. consists of the port to match followed by the port number to rewrite.
  16. Example:
  17. @example
  18. --portmap=80:8000,8080:80
  19. @end example
  20. EOText;
  21. };
  22. flag = {
  23. name = seed;
  24. value = s;
  25. arg-type = number;
  26. descrip = "Randomize src/dst IPv4/v6 addresses w/ given seed";
  27. max = 1;
  28. doc = <<- EOText
  29. Causes the source and destination IPv4/v6 addresses to be pseudo
  30. randomized but still maintain client/server relationships.
  31. Since the randomization is deterministic based on the seed,
  32. you can reuse the same seed value to recreate the traffic.
  33. EOText;
  34. };
  35. flag = {
  36. name = pnat;
  37. value = N;
  38. arg-type = string;
  39. max = 2;
  40. stack-arg;
  41. flags-cant = srcipmap;
  42. flass-cant = dstipmap;
  43. descrip = "Rewrite IPv4/v6 addresses using pseudo-NAT";
  44. doc = <<- EOText
  45. Takes a comma delimited series of colon delimited CIDR
  46. netblock pairs. Each netblock pair is evaluated in order against
  47. the IP addresses. If the IP address in the packet matches the
  48. first netblock, it is rewriten using the second netblock as a
  49. mask against the high order bits.
  50. IPv4 Example:
  51. @example
  52. --pnat=192.168.0.0/16:10.77.0.0/16,172.16.0.0/12:10.1.0.0/24
  53. @end example
  54. IPv6 Example:
  55. @example
  56. --pnat=[2001:db8::/32]:[dead::/16],[2001:db8::/32]:[::ffff:0:0/96]
  57. @end example
  58. EOText;
  59. };
  60. flag = {
  61. name = srcipmap;
  62. value = S;
  63. arg-type = string;
  64. max = 1;
  65. flags-cant = pnat;
  66. descrip = "Rewrite source IPv4/v6 addresses using pseudo-NAT";
  67. doc = <<- EOText
  68. Works just like the --pnat option, but only affects the source IP
  69. addresses in the IPv4/v6 header.
  70. EOText;
  71. };
  72. flag = {
  73. name = dstipmap;
  74. value = D;
  75. arg-type = string;
  76. max = 1;
  77. flags-cant = pnat;
  78. descrip = "Rewrite destination IPv4/v6 addresses using pseudo-NAT";
  79. doc = <<- EOText
  80. Works just like the --pnat option, but only affects the destination IP
  81. addresses in the IPv4/v6 header.
  82. EOText;
  83. };
  84. flag = {
  85. ifdef = HAVE_CACHEFILE_SUPPORT;
  86. name = endpoints;
  87. value = e;
  88. arg-type = string;
  89. max = 1;
  90. flags-must = cachefile;
  91. descrip = "Rewrite IP addresses to be between two endpoints";
  92. doc = <<- EOText
  93. Takes a pair of colon delimited IPv4/v6 addresses which will be used to rewrite
  94. all traffic to appear to be between the two IP's.
  95. IPv4 Example:
  96. @example
  97. --endpoints=172.16.0.1:172.16.0.2
  98. @end example
  99. IPv6 Example:
  100. @example
  101. --endpoints=[2001:db8::dead:beef]:[::ffff:0:0:ac:f:0:2]
  102. @end example
  103. EOText;
  104. };
  105. flag = {
  106. name = skipbroadcast;
  107. value = b;
  108. descrip = "Skip rewriting broadcast/multicast IPv4/v6 addresses";
  109. doc = <<- EOText
  110. By default --seed, --pnat and --endpoints will rewrite
  111. broadcast and multicast IPv4/v6 and MAC addresses. Setting this flag
  112. will keep broadcast/multicast IPv4/v6 and MAC addresses from being rewritten.
  113. EOText;
  114. };
  115. flag = {
  116. name = fixcsum;
  117. value = C;
  118. descrip = "Force recalculation of IPv4/TCP/UDP header checksums";
  119. doc = <<- EOText
  120. Causes each IPv4/v6 packet to have it's checksums recalcualted and
  121. fixed. Automatically enabled for packets modified with @samp{--seed},
  122. @samp{--pnat}, @samp{--endpoints} or @samp{--fixlen}.
  123. EOText;
  124. };
  125. flag = {
  126. name = mtu;
  127. value = m;
  128. arg-type = number;
  129. max = 1;
  130. arg-range = "1->MAXPACKET";
  131. default = DEFAULT_MTU;
  132. descrip = "Override default MTU length (1500 bytes)";
  133. doc = <<- EOText
  134. Override the default 1500 byte MTU size for determining the maximum padding length
  135. (--fixlen=pad) or when truncating (--mtu-trunc).
  136. EOText;
  137. };
  138. flag = {
  139. name = mtu-trunc;
  140. max = 1;
  141. descrip = "Truncate packets larger then specified MTU";
  142. doc = <<- EOText
  143. Similar to --fixlen, this option will truncate data in packets from Layer 3 and above to be
  144. no larger then the MTU.
  145. EOText;
  146. };
  147. flag = {
  148. name = efcs;
  149. value = E;
  150. descrip = "Remove Ethernet checksums (FCS) from end of frames";
  151. doc = <<- EOText
  152. Note, this option is pretty dangerous! We don't actually check to see if a FCS
  153. actually exists in the frame, we just blindly delete the last two bytes. Hence,
  154. you should only use this if you know know that your OS provides the FCS when
  155. reading raw packets.
  156. EOText;
  157. };
  158. flag = {
  159. name = ttl;
  160. descrip = "Modify the IPv4/v6 TTL/Hop Limit";
  161. arg-type = string;
  162. doc = <<- EOText
  163. Allows you to modify the TTL/Hop Limit of all the IPv4/v6 packets. Specify a number to hard-code
  164. the value or +/-value to increase or decrease by the value provided (limited to 1-255).
  165. Examples:
  166. @example
  167. --ttl=10
  168. --ttl=+7
  169. --ttl=-64
  170. @end example
  171. EOText;
  172. };
  173. flag = {
  174. name = tos;
  175. descrip = "Set the IPv4 TOS/DiffServ/ECN byte";
  176. arg-type = number;
  177. arg-range = "0->255";
  178. max = 1;
  179. doc = <<- EOText
  180. Allows you to override the TOS (also known as DiffServ/ECN) value in IPv4.
  181. EOText;
  182. };
  183. flag = {
  184. name = tclass;
  185. descrip = "Set the IPv6 Traffic Class byte";
  186. arg-type = number;
  187. arg-range = "0->255";
  188. max = 1;
  189. doc = <<- EOText
  190. Allows you to override the IPv6 Traffic Class field.
  191. EOText;
  192. };
  193. flag = {
  194. name = flowlabel;
  195. descrip = "Set the IPv6 Flow Label";
  196. arg-type = number;
  197. arg-range = "0->1048575";
  198. max = 1;
  199. doc = <<- EOText
  200. Allows you to override the 20bit IPv6 Flow Label field. Has no effect on IPv4
  201. packets.
  202. EOText;
  203. };
  204. flag = {
  205. name = fixlen;
  206. value = F;
  207. arg-type = string;
  208. descrip = "Pad or truncate packet data to match header length";
  209. max = 1;
  210. doc = <<- EOText
  211. Packets may be truncated during capture if the snaplen is smaller then the
  212. packet. This option allows you to modify the packet to pad the packet back
  213. out to the size stored in the IPv4/v6 header or rewrite the IP header total length
  214. to reflect the stored packet length.
  215. @table @bullet
  216. @item
  217. @var{pad}
  218. Truncated packets will be padded out so that the packet length matches the
  219. IPv4 total length
  220. @item
  221. @var{trunc}
  222. Truncated packets will have their IPv4 total length field rewritten to match
  223. the actual packet length
  224. @item
  225. @var{del}
  226. Delete the packet
  227. EOText;
  228. };
  229. #include plugins/dlt_stub.def