tcpedit_opts.def 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. flag = {
  2. name = tcpedit;
  3. documentation;
  4. lib-name = tcpedit;
  5. };
  6. #ifndef TCPEDIT_MAC_DISABLE
  7. flag = {
  8. name = dmac;
  9. value = D;
  10. arg-type = string;
  11. max = 1;
  12. descrip = "Rewrite destination MAC addresses";
  13. doc = <<- EOText
  14. Takes a pair of comma deliminated ethernet MAC addresses which
  15. will replace the destination MAC address of outbound packets.
  16. The first MAC address will be used for the server traffic
  17. and the optional second MAC address will be used for the client
  18. traffic.
  19. Example:
  20. @example
  21. --dmac=00:12:13:14:15:16,00:22:33:44:55:66
  22. @end example
  23. EOText;
  24. };
  25. flag = {
  26. name = smac;
  27. value = S;
  28. arg-type = string;
  29. max = 1;
  30. descrip = "Rewrite source MAC addresses";
  31. doc = <<- EOText
  32. Takes a pair of comma deliminated ethernet MAC addresses which
  33. will replace the source MAC address of outbound packets.
  34. The first MAC address will be used for the server traffic
  35. and the optional second MAC address will be used for the client traffic.
  36. Example:
  37. @example
  38. --smac=00:12:13:14:15:16,00:22:33:44:55:66
  39. @end example
  40. EOText;
  41. };
  42. #endif
  43. #ifndef TCPEDIT_PROTO_DISABLE
  44. flag = {
  45. name = proto;
  46. value = P;
  47. arg-type = number;
  48. max = 1;
  49. descrip = "Override L2 protocol type for DLT_RAW";
  50. arg-range = "0->65535";
  51. doc = <<- EOText
  52. By default, pcap files encapsulated using DLT_RAW will have their protocol
  53. set to ETHERTYPE_IP (0x0800).
  54. EOText;
  55. };
  56. #endif
  57. #ifndef TCPEDIT_DLINK_DISABLE
  58. flag = {
  59. name = dlink;
  60. value = l;
  61. arg-type = string;
  62. max = 2;
  63. stack-arg;
  64. descrip = "Rewrite Data-Link layer with specified data";
  65. doc = <<- EOText
  66. Provide a series of comma deliminated hex values which will be
  67. used to rewrite or create the Layer 2 header of the packets.
  68. The first instance of this argument will rewrite both server
  69. and client traffic, but if this argument is specified a second
  70. time, it will be used for the client traffic.
  71. Example:
  72. @example
  73. --dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
  74. @end example
  75. EOText;
  76. };
  77. #endif
  78. #ifndef TCPEDIT_PORTMAP_DISABLE
  79. flag = {
  80. name = portmap;
  81. value = r;
  82. arg-type = string;
  83. max = 1;
  84. descrip = "Rewrite TCP/UDP ports";
  85. doc = <<- EOText
  86. Specify a list of comma delimited port mappingings consisting of
  87. colon delimited port number pairs. Each colon delimited port pair
  88. consists of the port to match followed by the port number to rewrite.
  89. Example:
  90. @example
  91. --portmap=80:8000,8080:80
  92. @end example
  93. EOText;
  94. };
  95. #endif
  96. #ifndef TCPEDIT_SEED_DISABLE
  97. flag = {
  98. name = seed;
  99. value = s;
  100. arg-type = number;
  101. descrip = "Randomize src/dst IP addresses w/ given seed";
  102. max = 1;
  103. doc = <<- EOText
  104. Causes the source and destination IP addresses to be pseudo
  105. randomized but still maintain client/server relationships.
  106. Since the randomization is deterministic based on the seed,
  107. you can reuse the same seed value to recreate the traffic.
  108. EOText;
  109. };
  110. #endif
  111. #ifndef TCPEDIT_PNAT_DISABLE
  112. flag = {
  113. name = pnat;
  114. value = N;
  115. arg-type = string;
  116. max = 2;
  117. stack-arg;
  118. descrip = "Rewrite IP addresses using pseudo-NAT";
  119. doc = <<- EOText
  120. Takes a comma delimited series of colon delimited CIDR
  121. netblock pairs. Each netblock pair is evaluated in order against
  122. the IP addresses. If the IP address in the packet matches the
  123. first netblock, it is rewriten using the second netblock as a
  124. mask against the high order bits.
  125. Example:
  126. @example
  127. --pnat=192.168.0.0/16:10.77.0.0/16,172.16.0.0/12:10.1.0.0/24
  128. @end example
  129. EOText;
  130. };
  131. #endif
  132. #ifndef TCPEDIT_ENDPOINTS_DISABLE
  133. flag = {
  134. name = endpoints;
  135. value = e;
  136. arg-type = string;
  137. max = 1;
  138. flags-must = cachefile;
  139. descrip = "Rewrite IP addresses to be between two endpoints";
  140. doc = <<- EOText
  141. Takes a pair of colon delimited IP addresses which will be used to rewrite
  142. all traffic to appear to be between the two IP's.
  143. Example:
  144. @example
  145. --endpoints=172.16.0.1:172.16.0.2
  146. @end example
  147. EOText;
  148. };
  149. #endif
  150. #ifndef TCPEDIT_SKIP_BROADCAST_DISABLE
  151. flag = {
  152. name = skipbroadcast;
  153. value = b;
  154. descrip = "Skip rewriting broadcast/multicast IP's";
  155. doc = <<- EOText
  156. By default, --dmac, --smac, --seed, --pnat and --endpoints will rewrite
  157. broadcast and multicast IP and MAC addresses. Setting this flag
  158. will keep broadcast/multicast IP and MAC addresses from being rewritten.
  159. EOText;
  160. };
  161. #endif
  162. #ifndef TCPEDIT_FIXCSUM_DISABLE
  163. flag = {
  164. name = fixcsum;
  165. value = C;
  166. descrip = "Force recalculation of IP/TCP/UDP checksums";
  167. doc = <<- EOText
  168. Causes each IP packet to have it's checksums recalcualted and
  169. fixed. Automatically enabled for packets modified with @samp{--seed},
  170. @samp{--pnat}, @samp{--endpoints} or @samp{--fixlen}.
  171. EOText;
  172. };
  173. #endif
  174. #ifndef TCPEDIT_MTU_DISABLE
  175. flag = {
  176. name = mtu;
  177. value = m;
  178. arg-type = number;
  179. max = 1;
  180. arg-range = "1->MAXPACKET";
  181. default = DEFAULT_MTU;
  182. descrip = "Override default MTU length (1500 bytes)";
  183. doc = <<- EOText
  184. Override the default 1500 byte MTU size for determining the maximum padding length.
  185. EOText;
  186. };
  187. #endif
  188. #if ENABLE_EFCS
  189. #ifndef TCPEDIT_EFCS_DISABLE
  190. flag = {
  191. name = efcs;
  192. value = E;
  193. descrip = "Remove Ethernet checksums (FCS) from end of frames";
  194. doc = <<- EOText
  195. EOText;
  196. };
  197. #endif
  198. #endif
  199. #ifndef TCPEDIT_FIXLEN_DISABLE
  200. flag = {
  201. name = fixlen;
  202. value = F;
  203. arg-type = string;
  204. descrip = "Pad or truncate packet data to match header length";
  205. max = 1;
  206. doc = <<- EOText
  207. Packets may be truncated during capture if the snaplen is smaller then the
  208. packet. This option allows you to modify the packet to pad the packet back
  209. out to the size stored in the IPv4 header or rewrite the IP header total length
  210. to reflect the stored packet length.
  211. @table @bullet
  212. @item
  213. @var{pad}
  214. Truncated packets will be padded out so that the packet length matches the
  215. IPv4 total length
  216. @item
  217. @var{trunc}
  218. Truncated packets will have their IPv4 total length field rewritten to match
  219. the actual packet length
  220. @item
  221. @var{del}
  222. Delete the packet
  223. EOText;
  224. };
  225. #endif
  226. #ifndef TCPEDIT_VLAN_DISABLE
  227. /* rewrite 802.1q vlan tags */
  228. flag = {
  229. name = vlan;
  230. value = T;
  231. max = 1;
  232. descrip = "Specify 802.1q VLAN tag mode";
  233. arg-type = string;
  234. doc = <<- EOText
  235. Allows you to rewrite ethernet frames to add a 802.1q header to standard 802.3
  236. ethernet headers or remove the 802.1q VLAN tag information.
  237. @table @bullet
  238. @item
  239. @var{add}
  240. Rewrites the existing 802.3 ethernet header as an 802.1q VLAN header
  241. @item
  242. @var{del}
  243. Rewrites the existing 802.1q VLAN header as an 802.3 ethernet header
  244. EOText;
  245. };
  246. flag = {
  247. name = vlan_tag;
  248. value = t;
  249. max = 1;
  250. descrip = "Specify the new 802.1q VLAN tag value";
  251. arg-type = number;
  252. flags-must = vlan;
  253. arg-range = "0->4095"; /* VID's are 12bit unsigned int's */
  254. doc = "";
  255. };
  256. flag = {
  257. name = vlan_cfi;
  258. value = f;
  259. max = 1;
  260. descrip = "Specify the 802.1q VLAN CFI value";
  261. arg-type = number;
  262. flags-must = vlan;
  263. arg-range = "0->1"; /* one bit */
  264. doc = "";
  265. };
  266. flag = {
  267. name = vlan_pri;
  268. value = p;
  269. max = 1;
  270. descrip = "Specify the 802.1q VLAN priority";
  271. flags-must = vlan;
  272. arg-type = number;
  273. arg-range = "0->7"; /* one byte */
  274. doc = "";
  275. };
  276. #endif