tcpedit_opts.def 6.9 KB

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