tcprewrite.1 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. .de1 NOP
  2. . it 1 an-trap
  3. . if \\n[.$] \,\\$*\/
  4. ..
  5. .ie t \
  6. .ds B-Font [CB]
  7. .ds I-Font [CI]
  8. .ds R-Font [CR]
  9. .el \
  10. .ds B-Font B
  11. .ds I-Font I
  12. .ds R-Font R
  13. .TH tcprewrite 1 "16 May 2017" "tcprewrite" "User Commands"
  14. .\"
  15. .\" DO NOT EDIT THIS FILE (in-mem file)
  16. .\"
  17. .\" It has been AutoGen-ed
  18. .\" From the definitions tcprewrite_opts.def
  19. .\" and the template file agman-cmd.tpl
  20. .SH NAME
  21. \f\*[B-Font]tcprewrite\fP
  22. \- Rewrite the packets in a pcap file.
  23. .SH SYNOPSIS
  24. \f\*[B-Font]tcprewrite\fP
  25. .\" Mixture of short (flag) options and long options
  26. [\f\*[B-Font]\-flags\f[]]
  27. [\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
  28. [\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
  29. .sp \n(Ppu
  30. .ne 2
  31. All arguments must be options.
  32. .sp \n(Ppu
  33. .ne 2
  34. .SH "DESCRIPTION"
  35. Tcprewrite is a tool to rewrite packets stored in \fIpcap(3)\fP file format,
  36. such as crated by tools such as \fItcpdump(1)\fP and \fIethereal(1)\fP.
  37. Once a pcap file has had it's packets rewritten, they can be replayed back
  38. out on the network using \fItcpreplay(1)\fP.
  39. .sp
  40. tcprewrite currently supports reading the following DLT types:
  41. .sp 1
  42. \fBDLT_C_HDLC\fP aka Cisco HDLC
  43. .sp 1
  44. \fBDLT_EN10MB\fP aka Ethernet
  45. .sp 1
  46. \fBDLT_LINUX_SLL\fP aka Linux Cooked Socket
  47. .sp 1
  48. \fBDLT_RAW\fP aka RAW IP
  49. .sp 1
  50. \fBDLT_NULL\fP aka BSD Loopback
  51. .sp 1
  52. \fBDLT_LOOP\fP aka OpenBSD Loopback
  53. .sp 1
  54. \fBDLT_IEEE802_11\fP aka 802.11a/b/g
  55. .sp 1
  56. \fBDLT_IEEE802_11_RADIO\fP aka 802.11a/b/g with Radiotap headers
  57. .sp 1
  58. \fBDLT_JUNIPER_ETHER\fP aka Juniper Encapsulated Ethernet
  59. .sp 1
  60. \fBDLT_PPP_SERIAL\fP aka PPP over Serial
  61. .sp
  62. Please see the \--dlt option for supported DLT types for writing.
  63. .sp
  64. The packet editing features of tcprewrite which distinguish between "client"
  65. and "server" traffic requires a tcpprep(1) cache file.
  66. .sp
  67. For more details, please see the Tcpreplay Manual at:
  68. http://tcpreplay.appneta.com
  69. .SH "OPTIONS"
  70. .SS ""
  71. .TP
  72. .NOP \f\*[B-Font]\-r\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-portmap\f[]=\f\*[I-Font]string\f[]
  73. Rewrite TCP/UDP ports.
  74. This option may appear up to 9999 times.
  75. .sp
  76. Specify a list of comma delimited port mappingings consisting of
  77. colon delimited port number pairs. Each colon delimited port pair
  78. consists of the port to match followed by the port number to rewrite.
  79. .sp
  80. Examples:
  81. .nf
  82. \--portmap=80:8000 \--portmap=8080:80 # 80->8000 and 8080->80
  83. \--portmap=8000,8080,88888:80 # 3 different ports become 80
  84. \--portmap=8000-8999:80 # ports 8000 to 8999 become 80
  85. .fi
  86. .TP
  87. .NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-seed\f[]=\f\*[I-Font]number\f[]
  88. Randomize src/dst IPv4/v6 addresses w/ given seed.
  89. This option may appear up to 1 times.
  90. This option must not appear in combination with any of the following options:
  91. fuzz-seed.
  92. This option takes an integer number as its argument.
  93. .sp
  94. Causes the source and destination IPv4/v6 addresses to be pseudo
  95. randomized but still maintain client/server relationships.
  96. Since the randomization is deterministic based on the seed,
  97. you can reuse the same seed value to recreate the traffic.
  98. .TP
  99. .NOP \f\*[B-Font]\-N\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-pnat\f[]=\f\*[I-Font]string\f[]
  100. Rewrite IPv4/v6 addresses using pseudo-NAT.
  101. This option may appear up to 2 times.
  102. This option must not appear in combination with any of the following options:
  103. srcipmap.
  104. .sp
  105. Takes a comma delimited series of colon delimited CIDR
  106. netblock pairs. Each netblock pair is evaluated in order against
  107. the IP addresses. If the IP address in the packet matches the
  108. first netblock, it is rewritten using the second netblock as a
  109. mask against the high order bits.
  110. .sp
  111. IPv4 Example:
  112. .nf
  113. \--pnat=192.168.0.0/16:10.77.0.0/16,172.16.0.0/12:10.1.0.0/24
  114. .fi
  115. IPv6 Example:
  116. .nf
  117. \--pnat=[2001:db8::/32]:[dead::/16],[2001:db8::/32]:[::ffff:0:0/96]
  118. .fi
  119. .TP
  120. .NOP \f\*[B-Font]\-S\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-srcipmap\f[]=\f\*[I-Font]string\f[]
  121. Rewrite source IPv4/v6 addresses using pseudo-NAT.
  122. This option may appear up to 1 times.
  123. This option must not appear in combination with any of the following options:
  124. pnat.
  125. .sp
  126. Works just like the \--pnat option, but only affects the source IP
  127. addresses in the IPv4/v6 header.
  128. .TP
  129. .NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-dstipmap\f[]=\f\*[I-Font]string\f[]
  130. Rewrite destination IPv4/v6 addresses using pseudo-NAT.
  131. This option may appear up to 1 times.
  132. This option must not appear in combination with any of the following options:
  133. pnat.
  134. .sp
  135. Works just like the \--pnat option, but only affects the destination IP
  136. addresses in the IPv4/v6 header.
  137. .TP
  138. .NOP \f\*[B-Font]\-e\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-endpoints\f[]=\f\*[I-Font]string\f[]
  139. Rewrite IP addresses to be between two endpoints.
  140. This option may appear up to 1 times.
  141. This option must appear in combination with the following options:
  142. cachefile.
  143. .sp
  144. Takes a pair of colon delimited IPv4/v6 addresses which will be used to rewrite
  145. all traffic to appear to be between the two IP addresses.
  146. .sp
  147. IPv4 Example:
  148. .nf
  149. \--endpoints=172.16.0.1:172.16.0.2
  150. .fi
  151. IPv6 Example:
  152. .nf
  153. \--endpoints=[2001:db8::dead:beef]:[::ffff:0:0:ac:f:0:2]
  154. .fi
  155. .TP
  156. .NOP \f\*[B-Font]\-b\f[], \f\*[B-Font]\-\-skipbroadcast\f[]
  157. Skip rewriting broadcast/multicast IPv4/v6 addresses.
  158. .sp
  159. By default \--seed, \--pnat and \--endpoints will rewrite
  160. broadcast and multicast IPv4/v6 and MAC addresses. Setting this flag
  161. will keep broadcast/multicast IPv4/v6 and MAC addresses from being rewritten.
  162. .TP
  163. .NOP \f\*[B-Font]\-C\f[], \f\*[B-Font]\-\-fixcsum\f[]
  164. Force recalculation of IPv4/TCP/UDP header checksums.
  165. .sp
  166. Causes each IPv4/v6 packet to have their checksums recalculated and
  167. fixed. Automatically enabled for packets modified with \fB--seed\fP,
  168. \fB--pnat\fP, \fB--endpoints\fP or \fB--fixlen\fP.
  169. .TP
  170. .NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-mtu\f[]=\f\*[I-Font]number\f[]
  171. Override default MTU length (1500 bytes).
  172. This option may appear up to 1 times.
  173. This option takes an integer number as its argument.
  174. The value of
  175. \f\*[I-Font]number\f[]
  176. is constrained to being:
  177. .in +4
  178. .nf
  179. .na
  180. in the range 1 through MAXPACKET
  181. .fi
  182. .in -4
  183. .sp
  184. Override the default 1500 byte MTU size for determining the maximum padding length
  185. (--fixlen=pad) or when truncating (--mtu-trunc).
  186. .TP
  187. .NOP \f\*[B-Font]\-\-mtu\-trunc\f[]
  188. Truncate packets larger then specified MTU.
  189. This option may appear up to 1 times.
  190. .sp
  191. Similar to \--fixlen, this option will truncate data in packets from Layer 3 and above to be
  192. no larger then the MTU.
  193. .TP
  194. .NOP \f\*[B-Font]\-E\f[], \f\*[B-Font]\-\-efcs\f[]
  195. Remove Ethernet checksums (FCS) from end of frames.
  196. .sp
  197. Note, this option is pretty dangerous! We do not actually check to see if a FCS
  198. actually exists in the frame, we just blindly delete the last 4 bytes. Hence,
  199. you should only use this if you know know that your OS provides the FCS when
  200. reading raw packets.
  201. .TP
  202. .NOP \f\*[B-Font]\-\-ttl\f[]=\f\*[I-Font]string\f[]
  203. Modify the IPv4/v6 TTL/Hop Limit.
  204. .sp
  205. Allows you to modify the TTL/Hop Limit of all the IPv4/v6 packets. Specify a number to hard-code
  206. the value or +/-value to increase or decrease by the value provided (limited to 1-255).
  207. .sp
  208. Examples:
  209. .nf
  210. \--ttl=10
  211. \--ttl=+7
  212. \--ttl=-64
  213. .fi
  214. .TP
  215. .NOP \f\*[B-Font]\-\-tos\f[]=\f\*[I-Font]number\f[]
  216. Set the IPv4 TOS/DiffServ/ECN byte.
  217. This option may appear up to 1 times.
  218. This option takes an integer number as its argument.
  219. The value of
  220. \f\*[I-Font]number\f[]
  221. is constrained to being:
  222. .in +4
  223. .nf
  224. .na
  225. in the range 0 through 255
  226. .fi
  227. .in -4
  228. .sp
  229. Allows you to override the TOS (also known as DiffServ/ECN) value in IPv4.
  230. .TP
  231. .NOP \f\*[B-Font]\-\-tclass\f[]=\f\*[I-Font]number\f[]
  232. Set the IPv6 Traffic Class byte.
  233. This option may appear up to 1 times.
  234. This option takes an integer number as its argument.
  235. The value of
  236. \f\*[I-Font]number\f[]
  237. is constrained to being:
  238. .in +4
  239. .nf
  240. .na
  241. in the range 0 through 255
  242. .fi
  243. .in -4
  244. .sp
  245. Allows you to override the IPv6 Traffic Class field.
  246. .TP
  247. .NOP \f\*[B-Font]\-\-flowlabel\f[]=\f\*[I-Font]number\f[]
  248. Set the IPv6 Flow Label.
  249. This option may appear up to 1 times.
  250. This option takes an integer number as its argument.
  251. The value of
  252. \f\*[I-Font]number\f[]
  253. is constrained to being:
  254. .in +4
  255. .nf
  256. .na
  257. in the range 0 through 1048575
  258. .fi
  259. .in -4
  260. .sp
  261. Allows you to override the 20bit IPv6 Flow Label field. Has no effect on IPv4
  262. packets.
  263. .TP
  264. .NOP \f\*[B-Font]\-F\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-fixlen\f[]=\f\*[I-Font]string\f[]
  265. Pad or truncate packet data to match header length.
  266. This option may appear up to 1 times.
  267. .sp
  268. Packets may be truncated during capture if the snaplen is smaller then the
  269. packet. This option allows you to modify the packet to pad the packet back
  270. out to the size stored in the IPv4/v6 header or rewrite the IP header total length
  271. to reflect the stored packet length.
  272. .sp 1
  273. \fBpad\fP
  274. Truncated packets will be padded out so that the packet length matches the
  275. IPv4 total length
  276. .sp 1
  277. \fBtrunc\fP
  278. Truncated packets will have their IPv4 total length field rewritten to match
  279. the actual packet length
  280. .sp 1
  281. \fBdel\fP
  282. Delete the packet
  283. .TP
  284. .NOP \f\*[B-Font]\-\-fuzz\-seed\f[]=\f\*[I-Font]number\f[]
  285. Fuzz 1 in X packets. Edit bytes, length, or emulate packet drop.
  286. This option takes an integer number as its argument.
  287. The value of
  288. \f\*[I-Font]number\f[]
  289. is constrained to being:
  290. .in +4
  291. .nf
  292. .na
  293. greater than or equal to 0
  294. .fi
  295. .in -4
  296. The default
  297. \f\*[I-Font]number\f[]
  298. for this option is:
  299. .ti +4
  300. 0
  301. .sp
  302. This fuzzing was designed as to test layer 7 protocols such as voip protocols.
  303. It modifies randomly 1 out of X packets (where X = \fB--fuzz-factor\fP) in order
  304. for stateful protocols to cover more of their code. The random fuzzing actions
  305. focus on data start and end because it often is the part of the data application
  306. protocols base their decisions on.
  307. .sp
  308. Possible fuzzing actions list:
  309. * drop packet
  310. * reduce packet size
  311. * edit packet Bytes:
  312. * Not all Bytes have the same probability of appearance in real life.
  313. Replace with 0x00, 0xFF, or a random byte with equal likelyhook
  314. * Not all Bytes have the same significance in a packet.
  315. Replace the start, the end, or the middle of the packet with equal likelihood.
  316. * do nothing (7 out of 8 packets)
  317. .TP
  318. .NOP \f\*[B-Font]\-\-fuzz\-factor\f[]=\f\*[I-Font]number\f[]
  319. Set the Fuzz 1 in X packet ratio (default 1 in 8 packets).
  320. This option must appear in combination with the following options:
  321. fuzz-seed.
  322. This option takes an integer number as its argument.
  323. The value of
  324. \f\*[I-Font]number\f[]
  325. is constrained to being:
  326. .in +4
  327. .nf
  328. .na
  329. greater than or equal to 1
  330. .fi
  331. .in -4
  332. The default
  333. \f\*[I-Font]number\f[]
  334. for this option is:
  335. .ti +4
  336. 8
  337. .sp
  338. Sets the ratio of for \fB--fuzz-seed\fP option. By default this value is 8,
  339. which means 1 in 8 packets are modified by fuzzing. Note that this ratio is
  340. based on the random number genereated by the supplied fuzz seed. Therefore by
  341. default you cannot expect that exactly every eighth packet will be modified.
  342. .TP
  343. .NOP \f\*[B-Font]\-\-skipl2broadcast\f[]
  344. Skip rewriting broadcast/multicast Layer 2 addresses.
  345. .sp
  346. By default, editing Layer 2 addresses will rewrite
  347. broadcast and multicast MAC addresses. Setting this flag
  348. will keep broadcast/multicast MAC addresses from being rewritten.
  349. .TP
  350. .NOP \f\*[B-Font]\-\-dlt\f[]=\f\*[I-Font]string\f[]
  351. Override output DLT encapsulation.
  352. This option may appear up to 1 times.
  353. .sp
  354. By default, no DLT (data link type) conversion will be made.
  355. To change the DLT type of the output pcap, select one of the following values:
  356. .sp 1
  357. \fBenet\fP
  358. Ethernet aka DLT_EN10MB
  359. .sp 1
  360. \fBhdlc\fP
  361. Cisco HDLC aka DLT_C_HDLC
  362. .sp 1
  363. \fBjnpr_ether\fP
  364. Juniper Ethernet DLT_C_JNPR_ETHER
  365. .sp 1
  366. \fBpppserial\fP
  367. PPP Serial aka DLT_PPP_SERIAL
  368. .sp 1
  369. \fBuser\fP
  370. User specified Layer 2 header and DLT type
  371. .br
  372. .TP
  373. .NOP \f\*[B-Font]\-\-enet\-dmac\f[]=\f\*[I-Font]string\f[]
  374. Override destination ethernet MAC addresses.
  375. This option may appear up to 1 times.
  376. .sp
  377. Takes a pair of comma deliminated ethernet MAC addresses which
  378. will replace the destination MAC address of outbound packets.
  379. The first MAC address will be used for the server to client traffic
  380. and the optional second MAC address will be used for the client
  381. to server traffic.
  382. .sp
  383. Example:
  384. .nf
  385. \--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66
  386. .fi
  387. .TP
  388. .NOP \f\*[B-Font]\-\-enet\-smac\f[]=\f\*[I-Font]string\f[]
  389. Override source ethernet MAC addresses.
  390. This option may appear up to 1 times.
  391. .sp
  392. Takes a pair of comma deliminated ethernet MAC addresses which
  393. will replace the source MAC address of outbound packets.
  394. The first MAC address will be used for the server to client traffic
  395. and the optional second MAC address will be used for the client
  396. to server traffic.
  397. .sp
  398. Example:
  399. .nf
  400. \--enet-smac=00:12:13:14:15:16,00:22:33:44:55:66
  401. .fi
  402. .TP
  403. .NOP \f\*[B-Font]\-\-enet\-subsmac\f[]=\f\*[I-Font]string\f[]
  404. Substitute MAC addresses.
  405. This option may appear up to 9999 times.
  406. .sp
  407. Allows you to rewrite ethernet MAC addresses of packets. It takes
  408. comma delimited pair or MACs address and rewrites all occurrences of
  409. the first MAC with the value of the second MAC.
  410. Example:
  411. .nf
  412. \--enet-subsmac=00:12:13:14:15:16,00:22:33:44:55:66
  413. .fi
  414. .TP
  415. .NOP \f\*[B-Font]\-\-enet\-mac\-seed\f[]=\f\*[I-Font]number\f[]
  416. Randomize MAC addresses.
  417. This option may appear up to 1 times.
  418. This option must not appear in combination with any of the following options:
  419. enet-smac, enet-dmac, enet-subsmac.
  420. This option takes an integer number as its argument.
  421. .sp
  422. Allows you to randomize ethernet MAC addresses of packets, mostly
  423. like what \fB--seed\fP option does for IPv4/IPv6 addresses.
  424. .TP
  425. .NOP \f\*[B-Font]\-\-enet\-mac\-seed\-keep\-bytes\f[]=\f\*[I-Font]number\f[]
  426. Randomize MAC addresses.
  427. This option may appear up to 1 times.
  428. This option must appear in combination with the following options:
  429. enet-mac-seed.
  430. This option takes an integer number as its argument.
  431. The value of
  432. \f\*[I-Font]number\f[]
  433. is constrained to being:
  434. .in +4
  435. .nf
  436. .na
  437. in the range 1 through 6
  438. .fi
  439. .in -4
  440. .sp
  441. Keep some bytes untouched when usinging \fB--enet-mac-seed\fP option.
  442. .TP
  443. .NOP \f\*[B-Font]\-\-enet\-vlan\f[]=\f\*[I-Font]string\f[]
  444. Specify ethernet 802.1q VLAN tag mode.
  445. This option may appear up to 1 times.
  446. .sp
  447. Allows you to rewrite ethernet frames to add a 802.1q header to standard 802.3
  448. ethernet headers or remove the 802.1q VLAN tag information.
  449. .sp 1
  450. \fBadd\fP
  451. Rewrites the existing 802.3 ethernet header as an 802.1q VLAN header
  452. .sp 1
  453. \fBdel\fP
  454. Rewrites the existing 802.1q VLAN header as an 802.3 ethernet header
  455. .TP
  456. .NOP \f\*[B-Font]\-\-enet\-vlan\-tag\f[]=\f\*[I-Font]number\f[]
  457. Specify the new ethernet 802.1q VLAN tag value.
  458. This option may appear up to 1 times.
  459. This option must appear in combination with the following options:
  460. enet-vlan.
  461. This option takes an integer number as its argument.
  462. The value of
  463. \f\*[I-Font]number\f[]
  464. is constrained to being:
  465. .in +4
  466. .nf
  467. .na
  468. in the range 0 through 4095
  469. .fi
  470. .in -4
  471. .sp
  472. .TP
  473. .NOP \f\*[B-Font]\-\-enet\-vlan\-cfi\f[]=\f\*[I-Font]number\f[]
  474. Specify the ethernet 802.1q VLAN CFI value.
  475. This option may appear up to 1 times.
  476. This option must appear in combination with the following options:
  477. enet-vlan.
  478. This option takes an integer number as its argument.
  479. The value of
  480. \f\*[I-Font]number\f[]
  481. is constrained to being:
  482. .in +4
  483. .nf
  484. .na
  485. in the range 0 through 1
  486. .fi
  487. .in -4
  488. .sp
  489. .TP
  490. .NOP \f\*[B-Font]\-\-enet\-vlan\-pri\f[]=\f\*[I-Font]number\f[]
  491. Specify the ethernet 802.1q VLAN priority.
  492. This option may appear up to 1 times.
  493. This option must appear in combination with the following options:
  494. enet-vlan.
  495. This option takes an integer number as its argument.
  496. The value of
  497. \f\*[I-Font]number\f[]
  498. is constrained to being:
  499. .in +4
  500. .nf
  501. .na
  502. in the range 0 through 7
  503. .fi
  504. .in -4
  505. .sp
  506. .TP
  507. .NOP \f\*[B-Font]\-\-hdlc\-control\f[]=\f\*[I-Font]number\f[]
  508. Specify HDLC control value.
  509. This option may appear up to 1 times.
  510. This option takes an integer number as its argument.
  511. .sp
  512. The Cisco HDLC header has a 1 byte "control" field. Apparently this should
  513. always be 0, but if you can use any 1 byte value.
  514. .TP
  515. .NOP \f\*[B-Font]\-\-hdlc\-address\f[]=\f\*[I-Font]number\f[]
  516. Specify HDLC address.
  517. This option may appear up to 1 times.
  518. This option takes an integer number as its argument.
  519. .sp
  520. The Cisco HDLC header has a 1 byte "address" field which has two valid
  521. values:
  522. .sp 1
  523. \fB0x0F\fP
  524. Unicast
  525. .sp 1
  526. \fB0xBF\fP
  527. Broadcast
  528. .br
  529. You can however specify any single byte value.
  530. .TP
  531. .NOP \f\*[B-Font]\-\-user\-dlt\f[]=\f\*[I-Font]number\f[]
  532. Set output file DLT type.
  533. This option may appear up to 1 times.
  534. This option takes an integer number as its argument.
  535. .sp
  536. Set the DLT value of the output pcap file.
  537. .TP
  538. .NOP \f\*[B-Font]\-\-user\-dlink\f[]=\f\*[I-Font]string\f[]
  539. Rewrite Data-Link layer with user specified data.
  540. This option may appear up to 2 times.
  541. .sp
  542. Provide a series of comma deliminated hex values which will be
  543. used to rewrite or create the Layer 2 header of the packets.
  544. The first instance of this argument will rewrite both server
  545. and client traffic, but if this argument is specified a second
  546. time, it will be used for the client traffic.
  547. .sp
  548. Example:
  549. .nf
  550. \--user-dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
  551. .fi
  552. .TP
  553. .NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-dbug\f[]=\f\*[I-Font]number\f[]
  554. Enable debugging output.
  555. This option may appear up to 1 times.
  556. This option takes an integer number as its argument.
  557. The value of
  558. \f\*[I-Font]number\f[]
  559. is constrained to being:
  560. .in +4
  561. .nf
  562. .na
  563. in the range 0 through 5
  564. .fi
  565. .in -4
  566. The default
  567. \f\*[I-Font]number\f[]
  568. for this option is:
  569. .ti +4
  570. 0
  571. .sp
  572. If configured with \--enable-debug, then you can specify a verbosity
  573. level for debugging output. Higher numbers increase verbosity.
  574. .TP
  575. .NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-infile\f[]=\f\*[I-Font]string\f[]
  576. Input pcap file to be processed.
  577. This option may appear up to 1 times.
  578. .sp
  579. .TP
  580. .NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-outfile\f[]=\f\*[I-Font]string\f[]
  581. Output pcap file.
  582. This option may appear up to 1 times.
  583. .sp
  584. .TP
  585. .NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-cachefile\f[]=\f\*[I-Font]string\f[]
  586. Split traffic via tcpprep cache file.
  587. This option may appear up to 1 times.
  588. .sp
  589. Use tcpprep cache file to split traffic based upon client/server relationships.
  590. .TP
  591. .NOP \f\*[B-Font]\-v\f[], \f\*[B-Font]\-\-verbose\f[]
  592. Print decoded packets via tcpdump to STDOUT.
  593. This option may appear up to 1 times.
  594. .sp
  595. .TP
  596. .NOP \f\*[B-Font]\-A\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-decode\f[]=\f\*[I-Font]string\f[]
  597. Arguments passed to tcpdump decoder.
  598. This option may appear up to 1 times.
  599. This option must appear in combination with the following options:
  600. verbose.
  601. .sp
  602. When enabling verbose mode (\fB-v\fP) you may also specify one or
  603. more additional arguments to pass to \fBtcpdump\fP to modify
  604. the way packets are decoded. By default, \-n and \-l are used.
  605. Be sure to quote the arguments so that they are not interpreted
  606. by tcprewrite. Please see the tcpdump(1) man page for a complete list of
  607. options.
  608. .TP
  609. .NOP \f\*[B-Font]\-\-fragroute\f[]=\f\*[I-Font]string\f[]
  610. Parse fragroute configuration file.
  611. This option may appear up to 1 times.
  612. .sp
  613. Enable advanced evasion techniques using the built-in fragroute(8)
  614. engine. See the fragroute(8) man page for more details. Important:
  615. tcprewrite does not support the delay, echo or print commands.
  616. .TP
  617. .NOP \f\*[B-Font]\-\-fragdir\f[]=\f\*[I-Font]string\f[]
  618. Which flows to apply fragroute to: c2s, s2c, both.
  619. This option may appear up to 1 times.
  620. This option must appear in combination with the following options:
  621. cachefile.
  622. .sp
  623. Apply the fragroute engine to packets going c2s, s2c or both when
  624. using a cache file.
  625. .TP
  626. .NOP \f\*[B-Font]\-\-skip\-soft\-errors\f[]
  627. Skip writing packets with soft errors.
  628. This option may appear up to 1 times.
  629. .sp
  630. In some cases, packets can not be decoded or the requested editing
  631. is not possible. Normally these packets are written to the output
  632. file unedited so that tcpprep cache files can still be used, but if
  633. you wish, these packets can be suppressed.
  634. .sp
  635. One example of this is 802.11 management frames which contain no data.
  636. .TP
  637. .NOP \f\*[B-Font]\-V\f[], \f\*[B-Font]\-\-version\f[]
  638. Print version information.
  639. .sp
  640. .TP
  641. .NOP \f\*[B-Font]\-h\f[], \f\*[B-Font]\-\-less\-help\f[]
  642. Display less usage information and exit.
  643. .sp
  644. .TP
  645. .NOP \f\*[B-Font]\-H\f[], \f\*[B-Font]\-\-help\f[]
  646. Display usage information and exit.
  647. .TP
  648. .NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
  649. Pass the extended usage information through a pager.
  650. .TP
  651. .NOP \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
  652. Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
  653. configuration file listed in the \fBOPTION PRESETS\fP section, below.
  654. The command will exit after updating the config file.
  655. .TP
  656. .NOP \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
  657. Load options from \fIcfgfile\fP.
  658. The \fIno-load-opts\fP form will disable the loading
  659. of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
  660. out of order.
  661. .PP
  662. .SH "OPTION PRESETS"
  663. Any option that is not marked as \fInot presettable\fP may be preset
  664. by loading values from configuration ("RC" or ".INI") file(s).
  665. The \fIhomerc\fP file is "\fI$$/\fP", unless that is a directory.
  666. In that case, the file "\fI.tcprewriterc\fP"
  667. is searched for within that directory.
  668. .SH "FILES"
  669. See \fBOPTION PRESETS\fP for configuration files.
  670. .SH "EXIT STATUS"
  671. One of the following exit values will be returned:
  672. .TP
  673. .NOP 0 " (EXIT_SUCCESS)"
  674. Successful program execution.
  675. .TP
  676. .NOP 1 " (EXIT_FAILURE)"
  677. The operation failed or the command syntax was not valid.
  678. .TP
  679. .NOP 66 " (EX_NOINPUT)"
  680. A specified configuration file could not be loaded.
  681. .TP
  682. .NOP 70 " (EX_SOFTWARE)"
  683. libopts had an internal operational error. Please report
  684. it to autogen-users@lists.sourceforge.net. Thank you.
  685. .PP
  686. .SH "AUTHORS"
  687. Copyright 2013-2017 Fred Klassen \- AppNeta
  688. Copyright 2000-2012 Aaron Turner
  689. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  690. The latest version of this software is always available from:
  691. http://tcpreplay.appneta.com/
  692. .SH "COPYRIGHT"
  693. Copyright (C) 2000-2017 Aaron Turner and Fred Klassen all rights reserved.
  694. This program is released under the terms of the GNU General Public License, version 3 or later.
  695. .SH "BUGS"
  696. Please send bug reports to: tcpreplay-users@lists.sourceforge.net
  697. .SH "NOTES"
  698. This manual page was \fIAutoGen\fP-erated from the \fBtcprewrite\fP
  699. option definitions.