tcpedit_opts.def 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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 IP addresses w/ given seed";
  27. max = 1;
  28. doc = <<- EOText
  29. Causes the source and destination IP 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 IP 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. 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. EOText;
  55. };
  56. flag = {
  57. name = srcipmap;
  58. value = S;
  59. arg-type = string;
  60. max = 1;
  61. flags-cant = pnat;
  62. descrip = "Rewrite source IP addresses using pseudo-NAT";
  63. doc = <<- EOText
  64. Works just like the --pnat option, but only affects the source IP
  65. addresses in the IPv4 header.
  66. EOText;
  67. };
  68. flag = {
  69. name = dstipmap;
  70. value = D;
  71. arg-type = string;
  72. max = 1;
  73. flags-cant = pnat;
  74. descrip = "Rewrite destination IP addresses using pseudo-NAT";
  75. doc = <<- EOText
  76. Works just like the --pnat option, but only affects the destination IP
  77. addresses in the IPv4 header.
  78. EOText;
  79. };
  80. flag = {
  81. ifdef = HAVE_CACHEFILE_SUPPORT;
  82. name = endpoints;
  83. value = e;
  84. arg-type = string;
  85. max = 1;
  86. flags-must = cachefile;
  87. descrip = "Rewrite IP addresses to be between two endpoints";
  88. doc = <<- EOText
  89. Takes a pair of colon delimited IP addresses which will be used to rewrite
  90. all traffic to appear to be between the two IP's.
  91. Example:
  92. @example
  93. --endpoints=172.16.0.1:172.16.0.2
  94. @end example
  95. EOText;
  96. };
  97. flag = {
  98. name = skipbroadcast;
  99. value = b;
  100. descrip = "Skip rewriting broadcast/multicast IP's";
  101. doc = <<- EOText
  102. By default --seed, --pnat and --endpoints will rewrite
  103. broadcast and multicast IP and MAC addresses. Setting this flag
  104. will keep broadcast/multicast IP and MAC addresses from being rewritten.
  105. EOText;
  106. };
  107. flag = {
  108. name = fixcsum;
  109. value = C;
  110. descrip = "Force recalculation of IP/TCP/UDP checksums";
  111. doc = <<- EOText
  112. Causes each IP packet to have it's checksums recalcualted and
  113. fixed. Automatically enabled for packets modified with @samp{--seed},
  114. @samp{--pnat}, @samp{--endpoints} or @samp{--fixlen}.
  115. EOText;
  116. };
  117. flag = {
  118. name = mtu;
  119. value = m;
  120. arg-type = number;
  121. max = 1;
  122. arg-range = "1->MAXPACKET";
  123. default = DEFAULT_MTU;
  124. descrip = "Override default MTU length (1500 bytes)";
  125. doc = <<- EOText
  126. Override the default 1500 byte MTU size for determining the maximum padding length
  127. (--fixlen=pad) or when truncating (--mtu-trunc).
  128. EOText;
  129. };
  130. flag = {
  131. name = mtu-trunc;
  132. max = 1;
  133. descrip = "Truncate packets larger then specified MTU";
  134. doc = <<- EOText
  135. Similar to --fixlen, this option will truncate data in packets from Layer 3 and above to be
  136. no larger then the MTU.
  137. EOText;
  138. };
  139. flag = {
  140. name = efcs;
  141. value = E;
  142. descrip = "Remove Ethernet checksums (FCS) from end of frames";
  143. doc = <<- EOText
  144. Note, this option is pretty dangerous! We don't actually check to see if a FCS
  145. actually exists in the frame, we just blindly delete the last two bytes. Hence,
  146. you should only use this if you know know that your OS provides the FCS when
  147. reading raw packets.
  148. EOText;
  149. };
  150. flag = {
  151. name = ttl;
  152. descrip = "Modify the IPv4 TTL";
  153. arg-type = string;
  154. doc = <<- EOText
  155. Allows you to modify the TTL of all the IPv4 packets. Specify a number to hard-code
  156. the value or +/-value to increase or decrease by the value provided (limited to 1-255).
  157. Examples:
  158. @example
  159. --ttl=10
  160. --ttl=+7
  161. --ttl=-64
  162. @end example
  163. EOText;
  164. };
  165. flag = {
  166. name = tos;
  167. descrip = "Set the IPv4 TOS/DiffServ/ECN byte";
  168. arg-type = number;
  169. arg-range = "0->255";
  170. max = 1;
  171. doc = <<- EOText
  172. Allows you to override the TOS (also known as DiffServ/ECN) value in IPv4 packets.
  173. EOText;
  174. };
  175. flag = {
  176. name = fixlen;
  177. value = F;
  178. arg-type = string;
  179. descrip = "Pad or truncate packet data to match header length";
  180. max = 1;
  181. doc = <<- EOText
  182. Packets may be truncated during capture if the snaplen is smaller then the
  183. packet. This option allows you to modify the packet to pad the packet back
  184. out to the size stored in the IPv4 header or rewrite the IP header total length
  185. to reflect the stored packet length.
  186. @table @bullet
  187. @item
  188. @var{pad}
  189. Truncated packets will be padded out so that the packet length matches the
  190. IPv4 total length
  191. @item
  192. @var{trunc}
  193. Truncated packets will have their IPv4 total length field rewritten to match
  194. the actual packet length
  195. @item
  196. @var{del}
  197. Delete the packet
  198. EOText;
  199. };
  200. #include plugins/dlt_stub.def