tcpedit_opts.def 7.2 KB

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