tcprewrite.1 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  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 "12 Mar 2019" "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 created by tools such as \fItcpdump(1)\fP and \fIwireshark(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 mappings 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]\-\-tcp\-sequence\f[]=\f\*[I-Font]number\f[]
  157. Change TCP Sequence (and ACK) numbers /w given seed.
  158. This option takes an integer number as its argument.
  159. The value of
  160. \f\*[I-Font]number\f[]
  161. is constrained to being:
  162. .in +4
  163. .nf
  164. .na
  165. greater than or equal to 1
  166. .fi
  167. .in -4
  168. The default
  169. \f\*[I-Font]number\f[]
  170. for this option is:
  171. .ti +4
  172. 0
  173. .sp
  174. Change all TCP sequence numbers, and related sequence-acknowledgement numbers.
  175. They will be shifted by a random amount based on the provided seed.
  176. .TP
  177. .NOP \f\*[B-Font]\-b\f[], \f\*[B-Font]\-\-skipbroadcast\f[]
  178. Skip rewriting broadcast/multicast IPv4/v6 addresses.
  179. .sp
  180. By default \--seed, \--pnat and \--endpoints will rewrite
  181. broadcast and multicast IPv4/v6 and MAC addresses. Setting this flag
  182. will keep broadcast/multicast IPv4/v6 and MAC addresses from being rewritten.
  183. .TP
  184. .NOP \f\*[B-Font]\-C\f[], \f\*[B-Font]\-\-fixcsum\f[]
  185. Force recalculation of IPv4/TCP/UDP header checksums.
  186. .sp
  187. Causes each IPv4/v6 packet to have their checksums recalculated and
  188. fixed. Automatically enabled for packets modified with \fB--seed\fP,
  189. \fB--pnat\fP, \fB--endpoints\fP or \fB--fixlen\fP.
  190. .TP
  191. .NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-mtu\f[]=\f\*[I-Font]number\f[]
  192. Override default MTU length (1500 bytes).
  193. This option may appear up to 1 times.
  194. This option takes an integer number as its argument.
  195. The value of
  196. \f\*[I-Font]number\f[]
  197. is constrained to being:
  198. .in +4
  199. .nf
  200. .na
  201. in the range 1 through MAXPACKET
  202. .fi
  203. .in -4
  204. .sp
  205. Override the default 1500 byte MTU size for determining the maximum padding length
  206. (--fixlen=pad) or when truncating (--mtu-trunc).
  207. .TP
  208. .NOP \f\*[B-Font]\-\-mtu\-trunc\f[]
  209. Truncate packets larger then specified MTU.
  210. This option may appear up to 1 times.
  211. .sp
  212. Similar to \--fixlen, this option will truncate data in packets from Layer 3 and above to be
  213. no larger then the MTU.
  214. .TP
  215. .NOP \f\*[B-Font]\-E\f[], \f\*[B-Font]\-\-efcs\f[]
  216. Remove Ethernet checksums (FCS) from end of frames.
  217. .sp
  218. Note, this option is pretty dangerous! We do not actually check to see if a FCS
  219. actually exists in the frame, we just blindly delete the last 4 bytes. Hence,
  220. you should only use this if you know know that your OS provides the FCS when
  221. reading raw packets.
  222. .TP
  223. .NOP \f\*[B-Font]\-\-ttl\f[]=\f\*[I-Font]string\f[]
  224. Modify the IPv4/v6 TTL/Hop Limit.
  225. .sp
  226. Allows you to modify the TTL/Hop Limit of all the IPv4/v6 packets. Specify a number to hard-code
  227. the value or +/-value to increase or decrease by the value provided (limited to 1-255).
  228. .sp
  229. Examples:
  230. .nf
  231. \--ttl=10
  232. \--ttl=+7
  233. \--ttl=-64
  234. .fi
  235. .TP
  236. .NOP \f\*[B-Font]\-\-tos\f[]=\f\*[I-Font]number\f[]
  237. Set the IPv4 TOS/DiffServ/ECN byte.
  238. This option may appear up to 1 times.
  239. This option takes an integer number as its argument.
  240. The value of
  241. \f\*[I-Font]number\f[]
  242. is constrained to being:
  243. .in +4
  244. .nf
  245. .na
  246. in the range 0 through 255
  247. .fi
  248. .in -4
  249. .sp
  250. Allows you to override the TOS (also known as DiffServ/ECN) value in IPv4.
  251. .TP
  252. .NOP \f\*[B-Font]\-\-tclass\f[]=\f\*[I-Font]number\f[]
  253. Set the IPv6 Traffic Class byte.
  254. This option may appear up to 1 times.
  255. This option takes an integer number as its argument.
  256. The value of
  257. \f\*[I-Font]number\f[]
  258. is constrained to being:
  259. .in +4
  260. .nf
  261. .na
  262. in the range 0 through 255
  263. .fi
  264. .in -4
  265. .sp
  266. Allows you to override the IPv6 Traffic Class field.
  267. .TP
  268. .NOP \f\*[B-Font]\-\-flowlabel\f[]=\f\*[I-Font]number\f[]
  269. Set the IPv6 Flow Label.
  270. This option may appear up to 1 times.
  271. This option takes an integer number as its argument.
  272. The value of
  273. \f\*[I-Font]number\f[]
  274. is constrained to being:
  275. .in +4
  276. .nf
  277. .na
  278. in the range 0 through 1048575
  279. .fi
  280. .in -4
  281. .sp
  282. Allows you to override the 20bit IPv6 Flow Label field. Has no effect on IPv4
  283. packets.
  284. .TP
  285. .NOP \f\*[B-Font]\-F\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-fixlen\f[]=\f\*[I-Font]string\f[]
  286. Pad or truncate packet data to match header length.
  287. This option may appear up to 1 times.
  288. .sp
  289. Packets may be truncated during capture if the snaplen is smaller then the
  290. packet. This option allows you to modify the packet to pad the packet back
  291. out to the size stored in the IPv4/v6 header or rewrite the IP header total length
  292. to reflect the stored packet length.
  293. .sp 1
  294. \fBpad\fP
  295. Truncated packets will be padded out so that the packet length matches the
  296. IPv4 total length
  297. .sp 1
  298. \fBtrunc\fP
  299. Truncated packets will have their IPv4 total length field rewritten to match
  300. the actual packet length
  301. .sp 1
  302. \fBdel\fP
  303. Delete the packet
  304. .TP
  305. .NOP \f\*[B-Font]\-\-fuzz\-seed\f[]=\f\*[I-Font]number\f[]
  306. Fuzz 1 in X packets. Edit bytes, length, or emulate packet drop.
  307. This option takes an integer number as its argument.
  308. The value of
  309. \f\*[I-Font]number\f[]
  310. is constrained to being:
  311. .in +4
  312. .nf
  313. .na
  314. greater than or equal to 0
  315. .fi
  316. .in -4
  317. The default
  318. \f\*[I-Font]number\f[]
  319. for this option is:
  320. .ti +4
  321. 0
  322. .sp
  323. This fuzzing was designed as to test layer 7 protocols such as voip protocols.
  324. It modifies randomly 1 out of X packets (where X = \fB--fuzz-factor\fP) in order
  325. for stateful protocols to cover more of their code. The random fuzzing actions
  326. focus on data start and end because it often is the part of the data application
  327. protocols base their decisions on.
  328. .sp
  329. Possible fuzzing actions list:
  330. * drop packet
  331. * reduce packet size
  332. * edit packet Bytes:
  333. * Not all Bytes have the same probability of appearance in real life.
  334. Replace with 0x00, 0xFF, or a random byte with equal likelihood.
  335. * Not all Bytes have the same significance in a packet.
  336. Replace the start, the end, or the middle of the packet with equal likelihood.
  337. * do nothing (7 out of 8 packets)
  338. .TP
  339. .NOP \f\*[B-Font]\-\-fuzz\-factor\f[]=\f\*[I-Font]number\f[]
  340. Set the Fuzz 1 in X packet ratio (default 1 in 8 packets).
  341. This option must appear in combination with the following options:
  342. fuzz-seed.
  343. This option takes an integer number as its argument.
  344. The value of
  345. \f\*[I-Font]number\f[]
  346. is constrained to being:
  347. .in +4
  348. .nf
  349. .na
  350. greater than or equal to 1
  351. .fi
  352. .in -4
  353. The default
  354. \f\*[I-Font]number\f[]
  355. for this option is:
  356. .ti +4
  357. 8
  358. .sp
  359. Sets the ratio of for \fB--fuzz-seed\fP option. By default this value is 8,
  360. which means 1 in 8 packets are modified by fuzzing. Note that this ratio is
  361. based on the random number generated by the supplied fuzz seed. Therefore by
  362. default you cannot expect that exactly every eighth packet will be modified.
  363. .TP
  364. .NOP \f\*[B-Font]\-\-skipl2broadcast\f[]
  365. Skip rewriting broadcast/multicast Layer 2 addresses.
  366. .sp
  367. By default, editing Layer 2 addresses will rewrite
  368. broadcast and multicast MAC addresses. Setting this flag
  369. will keep broadcast/multicast MAC addresses from being rewritten.
  370. .TP
  371. .NOP \f\*[B-Font]\-\-dlt\f[]=\f\*[I-Font]string\f[]
  372. Override output DLT encapsulation.
  373. This option may appear up to 1 times.
  374. .sp
  375. By default, no DLT (data link type) conversion will be made.
  376. To change the DLT type of the output pcap, select one of the following values:
  377. .sp 1
  378. \fBenet\fP
  379. Ethernet aka DLT_EN10MB
  380. .sp 1
  381. \fBhdlc\fP
  382. Cisco HDLC aka DLT_C_HDLC
  383. .sp 1
  384. \fBjnpr_ether\fP
  385. Juniper Ethernet DLT_C_JNPR_ETHER
  386. .sp 1
  387. \fBpppserial\fP
  388. PPP Serial aka DLT_PPP_SERIAL
  389. .sp 1
  390. \fBuser\fP
  391. User specified Layer 2 header and DLT type
  392. .br
  393. .TP
  394. .NOP \f\*[B-Font]\-\-enet\-dmac\f[]=\f\*[I-Font]string\f[]
  395. Override destination ethernet MAC addresses.
  396. This option may appear up to 1 times.
  397. .sp
  398. Takes a pair of comma deliminated ethernet MAC addresses which
  399. will replace the destination MAC address of outbound packets.
  400. The first MAC address will be used for the server to client traffic
  401. and the optional second MAC address will be used for the client
  402. to server traffic.
  403. .sp
  404. Example:
  405. .nf
  406. \--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66
  407. .fi
  408. .TP
  409. .NOP \f\*[B-Font]\-\-enet\-smac\f[]=\f\*[I-Font]string\f[]
  410. Override source ethernet MAC addresses.
  411. This option may appear up to 1 times.
  412. .sp
  413. Takes a pair of comma deliminated ethernet MAC addresses which
  414. will replace the source MAC address of outbound packets.
  415. The first MAC address will be used for the server to client traffic
  416. and the optional second MAC address will be used for the client
  417. to server traffic.
  418. .sp
  419. Example:
  420. .nf
  421. \--enet-smac=00:12:13:14:15:16,00:22:33:44:55:66
  422. .fi
  423. .TP
  424. .NOP \f\*[B-Font]\-\-enet\-subsmac\f[]=\f\*[I-Font]string\f[]
  425. Substitute MAC addresses.
  426. This option may appear up to 9999 times.
  427. .sp
  428. Allows you to rewrite ethernet MAC addresses of packets. It takes
  429. comma delimited pair or MACs address and rewrites all occurrences of
  430. the first MAC with the value of the second MAC.
  431. Example:
  432. .nf
  433. \--enet-subsmac=00:12:13:14:15:16,00:22:33:44:55:66
  434. .fi
  435. .TP
  436. .NOP \f\*[B-Font]\-\-enet\-mac\-seed\f[]=\f\*[I-Font]number\f[]
  437. Randomize MAC addresses.
  438. This option may appear up to 1 times.
  439. This option must not appear in combination with any of the following options:
  440. enet-smac, enet-dmac, enet-subsmac.
  441. This option takes an integer number as its argument.
  442. .sp
  443. Allows you to randomize ethernet MAC addresses of packets, mostly
  444. like what \fB--seed\fP option does for IPv4/IPv6 addresses.
  445. .TP
  446. .NOP \f\*[B-Font]\-\-enet\-mac\-seed\-keep\-bytes\f[]=\f\*[I-Font]number\f[]
  447. Randomize MAC addresses.
  448. This option may appear up to 1 times.
  449. This option must appear in combination with the following options:
  450. enet-mac-seed.
  451. This option takes an integer number as its argument.
  452. The value of
  453. \f\*[I-Font]number\f[]
  454. is constrained to being:
  455. .in +4
  456. .nf
  457. .na
  458. in the range 1 through 6
  459. .fi
  460. .in -4
  461. .sp
  462. Keep some bytes untouched when usinging \fB--enet-mac-seed\fP option.
  463. .TP
  464. .NOP \f\*[B-Font]\-\-enet\-vlan\f[]=\f\*[I-Font]string\f[]
  465. Specify ethernet 802.1q VLAN tag mode.
  466. This option may appear up to 1 times.
  467. .sp
  468. Allows you to rewrite ethernet frames to add a 802.1q header to standard 802.3
  469. ethernet headers or remove the 802.1q VLAN tag information.
  470. .sp 1
  471. \fBadd\fP
  472. Rewrites the existing 802.3 ethernet header as an 802.1q VLAN header
  473. .sp 1
  474. \fBdel\fP
  475. Rewrites the existing 802.1q VLAN header as an 802.3 ethernet header
  476. .TP
  477. .NOP \f\*[B-Font]\-\-enet\-vlan\-tag\f[]=\f\*[I-Font]number\f[]
  478. Specify the new ethernet 802.1q VLAN tag value.
  479. This option may appear up to 1 times.
  480. This option must appear in combination with the following options:
  481. enet-vlan.
  482. This option takes an integer number as its argument.
  483. The value of
  484. \f\*[I-Font]number\f[]
  485. is constrained to being:
  486. .in +4
  487. .nf
  488. .na
  489. in the range 0 through 4095
  490. .fi
  491. .in -4
  492. .sp
  493. .TP
  494. .NOP \f\*[B-Font]\-\-enet\-vlan\-cfi\f[]=\f\*[I-Font]number\f[]
  495. Specify the ethernet 802.1q VLAN CFI value.
  496. This option may appear up to 1 times.
  497. This option must appear in combination with the following options:
  498. enet-vlan.
  499. This option takes an integer number as its argument.
  500. The value of
  501. \f\*[I-Font]number\f[]
  502. is constrained to being:
  503. .in +4
  504. .nf
  505. .na
  506. in the range 0 through 1
  507. .fi
  508. .in -4
  509. .sp
  510. .TP
  511. .NOP \f\*[B-Font]\-\-enet\-vlan\-pri\f[]=\f\*[I-Font]number\f[]
  512. Specify the ethernet 802.1q VLAN priority.
  513. This option may appear up to 1 times.
  514. This option must appear in combination with the following options:
  515. enet-vlan.
  516. This option takes an integer number as its argument.
  517. The value of
  518. \f\*[I-Font]number\f[]
  519. is constrained to being:
  520. .in +4
  521. .nf
  522. .na
  523. in the range 0 through 7
  524. .fi
  525. .in -4
  526. .sp
  527. .TP
  528. .NOP \f\*[B-Font]\-\-hdlc\-control\f[]=\f\*[I-Font]number\f[]
  529. Specify HDLC control value.
  530. This option may appear up to 1 times.
  531. This option takes an integer number as its argument.
  532. .sp
  533. The Cisco HDLC header has a 1 byte "control" field. Apparently this should
  534. always be 0, but if you can use any 1 byte value.
  535. .TP
  536. .NOP \f\*[B-Font]\-\-hdlc\-address\f[]=\f\*[I-Font]number\f[]
  537. Specify HDLC address.
  538. This option may appear up to 1 times.
  539. This option takes an integer number as its argument.
  540. .sp
  541. The Cisco HDLC header has a 1 byte "address" field which has two valid
  542. values:
  543. .sp 1
  544. \fB0x0F\fP
  545. Unicast
  546. .sp 1
  547. \fB0xBF\fP
  548. Broadcast
  549. .br
  550. You can however specify any single byte value.
  551. .TP
  552. .NOP \f\*[B-Font]\-\-user\-dlt\f[]=\f\*[I-Font]number\f[]
  553. Set output file DLT type.
  554. This option may appear up to 1 times.
  555. This option takes an integer number as its argument.
  556. .sp
  557. Set the DLT value of the output pcap file.
  558. .TP
  559. .NOP \f\*[B-Font]\-\-user\-dlink\f[]=\f\*[I-Font]string\f[]
  560. Rewrite Data-Link layer with user specified data.
  561. This option may appear up to 2 times.
  562. .sp
  563. Provide a series of comma deliminated hex values which will be
  564. used to rewrite or create the Layer 2 header of the packets.
  565. The first instance of this argument will rewrite both server
  566. and client traffic, but if this argument is specified a second
  567. time, it will be used for the client traffic.
  568. .sp
  569. Example:
  570. .nf
  571. \--user-dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
  572. .fi
  573. .TP
  574. .NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-dbug\f[]=\f\*[I-Font]number\f[]
  575. Enable debugging output.
  576. This option may appear up to 1 times.
  577. This option takes an integer number as its argument.
  578. The value of
  579. \f\*[I-Font]number\f[]
  580. is constrained to being:
  581. .in +4
  582. .nf
  583. .na
  584. in the range 0 through 5
  585. .fi
  586. .in -4
  587. The default
  588. \f\*[I-Font]number\f[]
  589. for this option is:
  590. .ti +4
  591. 0
  592. .sp
  593. If configured with \--enable-debug, then you can specify a verbosity
  594. level for debugging output. Higher numbers increase verbosity.
  595. .TP
  596. .NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-infile\f[]=\f\*[I-Font]string\f[]
  597. Input pcap file to be processed.
  598. This option may appear up to 1 times.
  599. .sp
  600. .TP
  601. .NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-outfile\f[]=\f\*[I-Font]string\f[]
  602. Output pcap file.
  603. This option may appear up to 1 times.
  604. .sp
  605. .TP
  606. .NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-cachefile\f[]=\f\*[I-Font]string\f[]
  607. Split traffic via tcpprep cache file.
  608. This option may appear up to 1 times.
  609. .sp
  610. Use tcpprep cache file to split traffic based upon client/server relationships.
  611. .TP
  612. .NOP \f\*[B-Font]\-v\f[], \f\*[B-Font]\-\-verbose\f[]
  613. Print decoded packets via tcpdump to STDOUT.
  614. This option may appear up to 1 times.
  615. .sp
  616. .TP
  617. .NOP \f\*[B-Font]\-A\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-decode\f[]=\f\*[I-Font]string\f[]
  618. Arguments passed to tcpdump decoder.
  619. This option may appear up to 1 times.
  620. This option must appear in combination with the following options:
  621. verbose.
  622. .sp
  623. When enabling verbose mode (\fB-v\fP) you may also specify one or
  624. more additional arguments to pass to \fBtcpdump\fP to modify
  625. the way packets are decoded. By default, \-n and \-l are used.
  626. Be sure to quote the arguments so that they are not interpreted
  627. by tcprewrite. Please see the tcpdump(1) man page for a complete list of
  628. options.
  629. .TP
  630. .NOP \f\*[B-Font]\-\-fragroute\f[]=\f\*[I-Font]string\f[]
  631. Parse fragroute configuration file.
  632. This option may appear up to 1 times.
  633. .sp
  634. Enable advanced evasion techniques using the built-in fragroute(8)
  635. engine. See the fragroute(8) man page for more details. Important:
  636. tcprewrite does not support the delay, echo or print commands.
  637. .TP
  638. .NOP \f\*[B-Font]\-\-fragdir\f[]=\f\*[I-Font]string\f[]
  639. Which flows to apply fragroute to: c2s, s2c, both.
  640. This option may appear up to 1 times.
  641. This option must appear in combination with the following options:
  642. cachefile.
  643. .sp
  644. Apply the fragroute engine to packets going c2s, s2c or both when
  645. using a cache file.
  646. .TP
  647. .NOP \f\*[B-Font]\-\-skip\-soft\-errors\f[]
  648. Skip writing packets with soft errors.
  649. This option may appear up to 1 times.
  650. .sp
  651. In some cases, packets can not be decoded or the requested editing
  652. is not possible. Normally these packets are written to the output
  653. file unedited so that tcpprep cache files can still be used, but if
  654. you wish, these packets can be suppressed.
  655. .sp
  656. One example of this is 802.11 management frames which contain no data.
  657. .TP
  658. .NOP \f\*[B-Font]\-V\f[], \f\*[B-Font]\-\-version\f[]
  659. Print version information.
  660. .sp
  661. .TP
  662. .NOP \f\*[B-Font]\-h\f[], \f\*[B-Font]\-\-less\-help\f[]
  663. Display less usage information and exit.
  664. .sp
  665. .TP
  666. .NOP \f\*[B-Font]\-H\f[], \f\*[B-Font]\-\-help\f[]
  667. Display usage information and exit.
  668. .TP
  669. .NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
  670. Pass the extended usage information through a pager.
  671. .TP
  672. .NOP \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
  673. Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
  674. configuration file listed in the \fBOPTION PRESETS\fP section, below.
  675. The command will exit after updating the config file.
  676. .TP
  677. .NOP \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
  678. Load options from \fIcfgfile\fP.
  679. The \fIno-load-opts\fP form will disable the loading
  680. of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
  681. out of order.
  682. .PP
  683. .SH "OPTION PRESETS"
  684. Any option that is not marked as \fInot presettable\fP may be preset
  685. by loading values from configuration ("RC" or ".INI") file(s).
  686. The \fIhomerc\fP file is "\fI$$/\fP", unless that is a directory.
  687. In that case, the file "\fI.tcprewriterc\fP"
  688. is searched for within that directory.
  689. .SH "FILES"
  690. See \fBOPTION PRESETS\fP for configuration files.
  691. .SH "EXIT STATUS"
  692. One of the following exit values will be returned:
  693. .TP
  694. .NOP 0 " (EXIT_SUCCESS)"
  695. Successful program execution.
  696. .TP
  697. .NOP 1 " (EXIT_FAILURE)"
  698. The operation failed or the command syntax was not valid.
  699. .TP
  700. .NOP 66 " (EX_NOINPUT)"
  701. A specified configuration file could not be loaded.
  702. .TP
  703. .NOP 70 " (EX_SOFTWARE)"
  704. libopts had an internal operational error. Please report
  705. it to autogen-users@lists.sourceforge.net. Thank you.
  706. .PP
  707. .SH "AUTHORS"
  708. Copyright 2013-2018 Fred Klassen \- AppNeta
  709. Copyright 2000-2012 Aaron Turner
  710. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  711. The latest version of this software is always available from:
  712. http://tcpreplay.appneta.com/
  713. .SH "COPYRIGHT"
  714. Copyright (C) 2000-2018 Aaron Turner and Fred Klassen all rights reserved.
  715. This program is released under the terms of the GNU General Public License, version 3 or later.
  716. .SH "BUGS"
  717. Please send bug reports to: tcpreplay-users@lists.sourceforge.net
  718. .SH "NOTES"
  719. This manual page was \fIAutoGen\fP-erated from the \fBtcprewrite\fP
  720. option definitions.