tcpreplay_opts.def 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809
  1. /* $Id$ */
  2. /*
  3. * Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
  4. * Copyright (c) 2013-2024 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
  5. *
  6. * The Tcpreplay Suite of tools is free software: you can redistribute it
  7. * and/or modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation, either version 3 of the
  9. * License, or with the authors permission any later version.
  10. *
  11. * The Tcpreplay Suite is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with the Tcpreplay Suite. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. autogen definitions options;
  20. copyright = {
  21. date = "2000-2024";
  22. owner = "Aaron Turner and Fred Klassen";
  23. eaddr = "tcpreplay-users@lists.sourceforge.net";
  24. type = gpl;
  25. author = <<- EOText
  26. Copyright 2013-2024 Fred Klassen - AppNeta
  27. Copyright 2000-2012 Aaron Turner
  28. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  29. The latest version of this software is always available from:
  30. http://tcpreplay.appneta.com/
  31. EOText;
  32. };
  33. package = "tcpreplay";
  34. #ifdef TCPREPLAY_EDIT_MAN
  35. prog-name = "tcpreplay-edit";
  36. #else
  37. prog-name = "tcpreplay";
  38. #endif
  39. prog-title = "Replay network traffic stored in pcap files";
  40. long-opts;
  41. gnu-usage;
  42. help-value = "H";
  43. save-opts-value = "";
  44. load-opts-value = "";
  45. argument = "<pcap_file(s)> | <pcap_dir(s)>";
  46. config-header = "config.h";
  47. include = "#include \"defines.h\"\n"
  48. "#include \"tcpreplay.h\"\n"
  49. "#include \"tcpreplay_api.h\"\n"
  50. "#include \"common.h\"\n"
  51. "#include \"config.h\"\n"
  52. "#include <stdlib.h>\n"
  53. "#include <sys/types.h>\n"
  54. "#include <unistd.h>\n"
  55. "extern tcpreplay_t *ctx;";
  56. homerc = "$$/";
  57. #ifdef TCPREPLAY_EDIT
  58. #include tcpedit/tcpedit_opts.def
  59. #endif
  60. explain = <<- EOExplain
  61. tcpreplay is a tool for replaying network traffic from files saved with
  62. tcpdump or other tools which write pcap(3) files.
  63. EOExplain;
  64. detail = <<- EODetail
  65. The basic operation of tcpreplay is to resend all packets from the
  66. input file(s) at the speed at which they were recorded, or a specified
  67. data rate, up to as fast as the hardware is capable.
  68. Optionally, the traffic can be split between two interfaces, written to
  69. files, filtered and edited in various ways, providing the means to test
  70. firewalls, NIDS and other network devices.
  71. For more details, please see the Tcpreplay Manual at:
  72. http://tcpreplay.appneta.com
  73. EODetail;
  74. man-doc = <<- EOMan
  75. .SH "SIGNALS"
  76. tcpreplay understands the following signals:
  77. @enumerate
  78. @item @var{SIGUSR1}
  79. Suspend tcpreplay
  80. @item @var{SIGCONT}
  81. Restart tcpreplay
  82. @end enumerate
  83. .SH "SEE ALSO"
  84. tcpdump(1), tcpbridge(1), tcprewrite(1), tcpprep(1), tcpcapinfo(1)
  85. .SH "BUGS"
  86. tcpreplay can only send packets as fast as your computer's interface,
  87. processor, disk and system bus will allow.
  88. Packet timing at high speeds is a black art and very OS/CPU dependent.
  89. Replaying captured traffic may simulate odd or broken conditions on your
  90. network and cause all sorts of problems.
  91. In most cases, you can not replay traffic back to/at a server.
  92. Some operating systems by default do not allow for forging source MAC
  93. addresses. Please consult your operating system's documentation and the
  94. tcpreplay FAQ if you experience this issue.
  95. EOMan;
  96. flag = {
  97. ifdef = DEBUG;
  98. name = dbug;
  99. value = d;
  100. arg-type = number;
  101. max = 1;
  102. immediate;
  103. arg-range = "0->5";
  104. arg-default = 0;
  105. descrip = "Enable debugging output";
  106. doc = <<- EOText
  107. If configured with --enable-debug, then you can specify a verbosity
  108. level for debugging output. Higher numbers increase verbosity.
  109. EOText;
  110. };
  111. flag = {
  112. name = quiet;
  113. value = q;
  114. descrip = "Quiet mode";
  115. doc = "Print nothing except the statistics at the end of the run";
  116. };
  117. flag = {
  118. name = timer;
  119. value = T;
  120. arg-default = "gtod";
  121. max = 1;
  122. arg-type = string;
  123. descrip = "Select packet timing mode: select, ioport, gtod, nano";
  124. doc = <<- EOText
  125. Allows you to select the packet timing method to use:
  126. @enumerate
  127. @item nano
  128. - Use nanosleep() API
  129. @item select
  130. - Use select() API
  131. @item ioport
  132. - Write to the i386 IO Port 0x80
  133. @item gtod [default]
  134. - Use a gettimeofday() loop
  135. @end enumerate
  136. EOText;
  137. };
  138. flag = {
  139. name = maxsleep;
  140. arg-type = number;
  141. arg-default = 0;
  142. descrip = "Sleep for no more then X milliseconds between packets";
  143. doc = <<- EOText
  144. Set a limit for the maximum number of milliseconds that tcpreplay will sleep
  145. between packets. Effectively prevents long delays between packets without
  146. effecting the majority of packets. Default is disabled.
  147. EOText;
  148. };
  149. /* Verbose decoding via tcpdump */
  150. flag = {
  151. ifdef = ENABLE_VERBOSE;
  152. name = verbose;
  153. value = v;
  154. max = 1;
  155. immediate;
  156. descrip = "Print decoded packets via tcpdump to STDOUT";
  157. settable;
  158. doc = "";
  159. };
  160. flag = {
  161. ifdef = ENABLE_VERBOSE;
  162. name = decode;
  163. flags-must = verbose;
  164. value = A;
  165. arg-type = string;
  166. max = 1;
  167. descrip = "Arguments passed to tcpdump decoder";
  168. doc = <<- EOText
  169. When enabling verbose mode (@var{-v}) you may also specify one or more
  170. additional arguments to pass to @code{tcpdump} to modify the way packets
  171. are decoded. By default, -n and -l are used. Be sure to
  172. quote the arguments like: -A "-axxx" so that they are not interpreted
  173. by tcpreplay. Please see the tcpdump(1) man page for a complete list of
  174. options.
  175. EOText;
  176. };
  177. flag = {
  178. name = preload_pcap;
  179. value = K;
  180. descrip = "Preloads packets into RAM before sending";
  181. doc = <<- EOText
  182. This option loads the specified pcap(s) into RAM before starting to send in order
  183. to improve replay performance while introducing a startup performance hit.
  184. Preloading can be used with or without @var{--loop}. This option also suppresses
  185. flow statistics collection for every iteration, which can significantly reduce
  186. memory usage. Flow statistics are predicted based on options supplied and
  187. statistics collected from the first loop iteration.
  188. EOText;
  189. };
  190. /*
  191. * Output modifiers: -c
  192. */
  193. flag = {
  194. name = cachefile;
  195. value = c;
  196. arg-type = string;
  197. flags-cant = dualfile;
  198. flags-must = intf2;
  199. max = 1;
  200. descrip = "Split traffic via a tcpprep cache file";
  201. doc = <<- EOText
  202. If you have a pcap file you would like to use to send bi-directional
  203. traffic through a device (firewall, router, IDS, etc) then using tcpprep
  204. you can create a cachefile which tcpreplay will use to split the traffic
  205. across two network interfaces.
  206. EOText;
  207. };
  208. flag = {
  209. name = dualfile;
  210. value = 2;
  211. max = 1;
  212. flags-cant = cachefile;
  213. flags-must = intf2;
  214. descrip = "Replay two files at a time from a network tap";
  215. doc = <<- EOText
  216. If you captured network traffic using a network tap, then you can end up with
  217. two pcap files- one for each direction. This option will replay these two
  218. files at the same time, one on each interface and inter-mix them using the
  219. timestamps in each.
  220. EOText;
  221. };
  222. /*
  223. * Outputs: -i, -I
  224. */
  225. flag = {
  226. name = intf1;
  227. value = i;
  228. arg-type = string;
  229. max = 1;
  230. equivalence = intf1;
  231. must-set;
  232. descrip = "Client to server/RX/primary traffic output interface";
  233. doc = <<- EOText
  234. Required network interface used to send either all traffic or traffic which is
  235. marked as 'primary' via tcpprep. Primary traffic is usually client-to-server
  236. or inbound (RX) on khial virtual interfaces.
  237. EOText;
  238. };
  239. flag = {
  240. name = intf2;
  241. value = I;
  242. arg-type = string;
  243. max = 1;
  244. descrip = "Server to client/TX/secondary traffic output interface";
  245. doc = <<- EOText
  246. Optional network interface used to send traffic which is marked as 'secondary'
  247. via tcpprep. Secondary traffic is usually server-to-client or outbound
  248. (TX) on khial virtual interfaces. Generally, it only makes sense to use this
  249. option with --cachefile.
  250. EOText;
  251. };
  252. flag = {
  253. name = write;
  254. value = w;
  255. arg-type = string;
  256. max = 1;
  257. equivalence = intf1;
  258. flags-cant = intf2;
  259. descrip = "Pcap file to receive traffic outputs";
  260. doc = <<- EOText
  261. Optional pcap file name used to receive traffic.
  262. EOText;
  263. };
  264. flag = {
  265. name = include;
  266. arg-type = string;
  267. max = 1;
  268. descrip = "Send only selected packet numbers";
  269. flags-cant = exclude;
  270. flag-code = <<- EOInclude
  271. char *include;
  272. include = safe_strdup(OPT_ARG(INCLUDE));
  273. ctx->options->is_exclude = false;
  274. if (!parse_list(&ctx->options->list, include))
  275. errx(-1, "Unable to parse include/exclude rule: %s", OPT_ARG(INCLUDE));
  276. free(include);
  277. EOInclude;
  278. doc = <<- EOText
  279. Override default of processing all packets stored in the capture file and only
  280. send packets that are part of a supplied list of packet numbers.
  281. @example
  282. -x P:1-5,9,15,72-
  283. @end example
  284. would skip packets 1 through 5, the 9th and 15th packet, and packets 72 until the
  285. end of the file
  286. EOText;
  287. };
  288. flag = {
  289. name = exclude;
  290. arg-type = string;
  291. max = 1;
  292. descrip = "Send all but selected packet numbers";
  293. flags-cant = include;
  294. flag-code = <<- EOExclude
  295. char *exclude;
  296. exclude = safe_strdup(OPT_ARG(EXCLUDE));
  297. ctx->options->is_exclude = true;
  298. if (!parse_list(&ctx->options->list, exclude))
  299. errx(-1, "Unable to parse include/exclude rule: %s", OPT_ARG(EXCLUDE));
  300. free(exclude);
  301. EOExclude;
  302. doc = <<- EOText
  303. Override default of processing all packets stored in the capture file and only
  304. send packets that are NOT part of a supplied list of packet numbers.
  305. @example
  306. -x P:1-5,9,15,72-
  307. @end example
  308. would skip packets 1 through 5, the 9th and 15th packet, and packets 72 until the
  309. end of the file
  310. EOText;
  311. };
  312. flag = {
  313. ifdef = ENABLE_PCAP_FINDALLDEVS;
  314. name = listnics;
  315. descrip = "List available network interfaces and exit";
  316. immediate;
  317. doc = "";
  318. flag-code = <<- EOFlag
  319. interface_list_t *list = get_interface_list();
  320. list_interfaces(list);
  321. free(list);
  322. exit(0);
  323. EOFlag;
  324. };
  325. /*
  326. * Limits and loops: -l
  327. */
  328. flag = {
  329. name = loop;
  330. value = l;
  331. arg-type = number;
  332. arg-range = "0->";
  333. max = 1;
  334. descrip = "Loop through the capture file X times";
  335. arg-default = 1;
  336. doc = "";
  337. };
  338. flag = {
  339. name = loopdelay-ms;
  340. flags-cant = loopdelay-ns;
  341. flags-must = loop;
  342. arg-type = number;
  343. arg-range = "0->";
  344. descrip = "Delay between loops in milliseconds";
  345. arg-default = 0;
  346. doc = "";
  347. };
  348. flag = {
  349. name = loopdelay-ns;
  350. flags-cant = loopdelay-ms;
  351. flags-must = loop;
  352. arg-type = number;
  353. arg-range = "0->";
  354. descrip = "Delay between loops in nanoseconds";
  355. arg-default = 0;
  356. doc = <<- EOText
  357. By default, tcpreplay will use loop delay with microsecond accuracy (loopdelay-ms).
  358. In order to use loop delay with nanosecond accuracy you need to use nano packet timing mode.
  359. EOText;
  360. };
  361. flag = {
  362. name = pktlen;
  363. max = 1;
  364. descrip = "Override the snaplen and use the actual packet len";
  365. doc = <<- EOText
  366. By default, tcpreplay will send packets based on the size of the "snaplen"
  367. stored in the pcap file which is usually the correct thing to do. However,
  368. occasionally, tools will store more bytes then told to. By specifying this
  369. option, tcpreplay will ignore the snaplen field and instead try to send
  370. packets based on the original packet length. Bad things may happen if
  371. you specify this option.
  372. EOText;
  373. };
  374. flag = {
  375. name = limit;
  376. value = L;
  377. arg-type = number;
  378. max = 1;
  379. arg-default = -1;
  380. arg-range = "1->";
  381. descrip = "Limit the number of packets to send";
  382. doc = <<- EOText
  383. By default, tcpreplay will send all the packets. Alternatively, you can
  384. specify a maximum number of packets to send.
  385. EOText;
  386. };
  387. flag = {
  388. name = duration;
  389. arg-type = number;
  390. max = 1;
  391. arg-default = -1;
  392. arg-range = "1->";
  393. descrip = "Limit the number of seconds to send";
  394. doc = <<- EOText
  395. By default, tcpreplay will send all the packets. Alternatively, you can
  396. specify a maximum number of seconds to transmit.
  397. EOText;
  398. };
  399. /*
  400. * Replay speed modifiers: -m, -p, -r, -R, -o
  401. */
  402. /* note that this is really a float, but autoopts does not support float */
  403. flag = {
  404. name = multiplier;
  405. flags-cant = pps;
  406. flags-cant = mbps;
  407. flags-cant = oneatatime;
  408. flags-cant = topspeed;
  409. value = x;
  410. arg-type = string;
  411. max = 1;
  412. descrip = "Modify replay speed to a given multiple";
  413. doc = <<- EOText
  414. Specify a value to modify the packet replay speed.
  415. Examples:
  416. @example
  417. 2.0 will replay traffic at twice the speed captured
  418. 0.7 will replay traffic at 70% the speed captured
  419. @end example
  420. EOText;
  421. };
  422. flag = {
  423. name = pps;
  424. flags-cant = multiplier;
  425. flags-cant = mbps;
  426. flags-cant = oneatatime;
  427. flags-cant = topspeed;
  428. value = p;
  429. arg-type = string;
  430. max = 1;
  431. descrip = "Replay packets at a given packets/sec";
  432. doc = <<- EOText
  433. Specify a value to regulate the packet replay to a specific packet-per-second rate.
  434. Examples:
  435. @example
  436. 200 will replay traffic at 200 packets per second
  437. 0.25 will replay traffic at 15 packets per minute
  438. @end example
  439. EOText;
  440. };
  441. flag = {
  442. name = mbps;
  443. flags-cant = multiplier;
  444. flags-cant = pps;
  445. flags-cant = oneatatime;
  446. flags-cant = topspeed;
  447. value = M;
  448. arg-type = string;
  449. max = 1;
  450. descrip = "Replay packets at a given Mbps";
  451. doc = <<- EOText
  452. Specify a floating point value for the Mbps rate that tcpreplay
  453. should send packets at.
  454. EOText;
  455. };
  456. flag = {
  457. name = topspeed;
  458. flags-cant = mbps;
  459. flags-cant = multiplier;
  460. flags-cant = pps;
  461. flags-cant = oneatatime;
  462. value = t;
  463. descrip = "Replay packets as fast as possible";
  464. doc = "";
  465. };
  466. flag = {
  467. name = oneatatime;
  468. flags-cant = mbps;
  469. flags-cant = pps;
  470. flags-cant = multiplier;
  471. flags-cant = topspeed;
  472. value = o;
  473. descrip = "Replay one packet at a time for each user input";
  474. doc = <<- EOText
  475. Allows you to step through one or more packets at a time.
  476. EOText;
  477. };
  478. flag = {
  479. name = pps-multi;
  480. arg-type = number;
  481. flags-must = pps;
  482. arg-default = 1;
  483. arg-range = "1->";
  484. descrip = "Number of packets to send for each time interval";
  485. doc = <<- EOText
  486. When trying to send packets at very high rates, the time between each packet
  487. can be so short that it is impossible to accurately sleep for the required
  488. period of time. This option allows you to send multiple packets at a time,
  489. thus allowing for longer sleep times which can be more accurately implemented.
  490. EOText;
  491. };
  492. flag = {
  493. name = unique-ip;
  494. flags-must = loop;
  495. #ifdef TCPREPLAY_EDIT
  496. flags-cant = seed;
  497. flags-cant = fuzz-seed;
  498. #endif
  499. descrip = "Modify IP addresses each loop iteration to generate unique flows";
  500. doc = <<- EOText
  501. Ensure IPv4 and IPv6 packets will be unique for each @var{--loop} iteration.
  502. This is done in a way that will not alter packet CRC, and therefore will generally
  503. not affect performance. This option will significantly increase the flows/sec over
  504. generated over multiple loop iterations.
  505. EOText;
  506. };
  507. flag = {
  508. name = unique-ip-loops;
  509. flags-must = unique-ip;
  510. arg-type = string;
  511. max = 1;
  512. descrip = "Number of times to loop before assigning new unique ip";
  513. doc = <<- EOText
  514. Number of @var{--loop} iterations before a new unique IP is assigned. Default
  515. is 1. Assumes both @var{--loop} and @var{--unique-ip}.
  516. EOText;
  517. };
  518. flag = {
  519. ifdef = HAVE_NETMAP;
  520. name = netmap;
  521. descrip = "Write packets directly to netmap enabled network adapter";
  522. doc = <<- EOText
  523. This feature will detect netmap capable network drivers on Linux and BSD
  524. systems. If detected, the network driver is bypassed for the execution
  525. duration, and network buffers will be written to directly. This will allow
  526. you to achieve full line rates on commodity network adapters, similar to rates
  527. achieved by commercial network traffic generators. Note that bypassing the network
  528. driver will disrupt other applications connected through the test interface. See
  529. INSTALL for more information.
  530. This feature can also be enabled by specifying an interface as 'netmap:<intf>'
  531. or 'vale:<intf>. For example 'netmap:eth0' specifies netmap over interface eth0.
  532. EOText;
  533. };
  534. flag = {
  535. ifdef = HAVE_NETMAP;
  536. name = nm-delay;
  537. arg-type = number;
  538. arg-default = 10;
  539. descrip = "Netmap startup delay";
  540. doc = <<- EOText
  541. Number of seconds to delay after netmap is loaded. Required to ensure interfaces
  542. are fully up before netmap transmit. Requires netmap option. Default is 10 seconds.
  543. EOText;
  544. };
  545. flag = {
  546. name = no-flow-stats;
  547. descrip = "Suppress printing and tracking flow count, rates and expirations";
  548. doc = <<- EOText
  549. Suppress the collection and printing of flow statistics. This option may
  550. improve performance when not using @var{--preload-pcap} option, otherwise
  551. its only function is to suppress printing.
  552. The flow feature will track and print statistics of the flows being sent.
  553. A flow is loosely defined as a unique combination of a 5-tuple, i.e.
  554. source IP, destination IP, source port, destination port and protocol.
  555. If @var{--loop} is specified, the flows from one iteration to the next
  556. will not be unique, unless the packets are altered. Use @var{--unique-ip}
  557. or @var{tcpreplay-edit} to alter packets between iterations.
  558. EOText;
  559. };
  560. flag = {
  561. name = flow-expiry;
  562. arg-type = number;
  563. flags-cant = no-flow-stats;
  564. arg-default = 0;
  565. arg-range = "0->";
  566. descrip = "Number of inactive seconds before a flow is considered expired";
  567. doc = <<- EOText
  568. This option will track and report flow expirations based on the flow idle
  569. times. The timestamps within the pcap file are used to determine the expiry,
  570. not the actual timestamp of the packets are replayed. For example, a value of
  571. 30 suggests that if no traffic is seen on a flow for 30 seconds, any
  572. subsequent traffic would be considered a new flow, and thereby will increment
  573. the flows and flows per second (fps) statistics.
  574. This option can be used to optimize flow timeout settings for flow products.
  575. Setting the timeout low may lead to flows being dropped when in fact the flow
  576. is simply slow to respond. Configuring your flow timeouts too high may
  577. increase resources required by your flow product.
  578. Note that using this option while replaying at higher than original speeds
  579. can lead to inflated flows and fps counts.
  580. Default is 0 (no expiry) and a typical value is 30-120 seconds.
  581. EOText;
  582. };
  583. flag = {
  584. name = pid;
  585. value = P;
  586. descrip = "Print the PID of tcpreplay at startup";
  587. flag-code = <<- EOPid
  588. fprintf(stderr, "PID: %d\n", getpid());
  589. EOPid;
  590. doc = "";
  591. };
  592. flag = {
  593. name = stats;
  594. arg-type = number;
  595. arg-range = "0->";
  596. descrip = "Print statistics every X seconds, or every loop if '0'";
  597. doc = <<- EOText
  598. Note that timed delays are a "best effort" and long delays between
  599. sending packets may cause equally long delays between printing statistics.
  600. EOText;
  601. };
  602. flag = {
  603. name = suppress-warnings;
  604. value = W;
  605. immediate;
  606. descrip = "suppress printing warning messages";
  607. settable;
  608. doc = "";
  609. };
  610. flag = {
  611. ifdef = HAVE_LIBXDP;
  612. name = xdp;
  613. descrip = "Write packets directly to AF_XDP enabled network adapter";
  614. doc = <<- EOText
  615. This feature will detect AF_XDP capable network drivers on Linux systems
  616. that have 'libxdp-dev' and 'libbpf-dev' installed. If detected, the network
  617. stack is bypassed and packets are sent directly to an eBPF enabled driver directly.
  618. This will allow you to achieve full line rates on commodity network adapters, similar to rates
  619. achieved by commercial network traffic generators.
  620. EOText;
  621. };
  622. flag = {
  623. ifdef = HAVE_LIBXDP;
  624. name = xdp-batch-size;
  625. arg-type = number;
  626. arg-range = "1->4096";
  627. descrip = "The maximum number of packets that can be submitted to the AF_XDP TX ring at once";
  628. arg-default = 25;
  629. doc = "Higher values may improve performance at the cost of accuracy";
  630. };
  631. flag = {
  632. name = version;
  633. value = V;
  634. descrip = "Print version information";
  635. flag-code = <<- EOVersion
  636. fprintf(stderr, "tcpreplay version: %s (build %s)", VERSION, git_version());
  637. #ifdef DEBUG
  638. fprintf(stderr, " (debug)");
  639. #endif
  640. #ifdef TIMESTAMP_TRACE
  641. fprintf(stderr, " (timestamp-trace)");
  642. #endif
  643. fprintf(stderr, "\n");
  644. fprintf(stderr, "Copyright 2013-2024 by Fred Klassen <tcpreplay at appneta dot com> - AppNeta\n");
  645. fprintf(stderr, "Copyright 2000-2012 by Aaron Turner <aturner at synfin dot net>\n");
  646. fprintf(stderr, "The entire Tcpreplay Suite is licensed under the GPLv3\n");
  647. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  648. #ifdef HAVE_LIBDNET
  649. fprintf(stderr, "Compiled against libdnet: %s\n", LIBDNET_VERSION);
  650. #else
  651. fprintf(stderr, "Not compiled with libdnet.\n");
  652. #endif
  653. #ifdef HAVE_WINPCAP
  654. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  655. #elif defined HAVE_PF_RING_PCAP
  656. fprintf(stderr, "Compiled against PF_RING libpcap: %s\n", get_pcap_version());
  657. #else
  658. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  659. #endif
  660. #ifdef ENABLE_64BITS
  661. fprintf(stderr, "64 bit packet counters: enabled\n");
  662. #else
  663. fprintf(stderr, "64 bit packet counters: disabled\n");
  664. #endif
  665. #ifdef ENABLE_VERBOSE
  666. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  667. #else
  668. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  669. #endif
  670. #ifdef TCPREPLAY_EDIT
  671. fprintf(stderr, "Packet editing: enabled\n");
  672. #else
  673. fprintf(stderr, "Packet editing: disabled\n");
  674. #endif
  675. #ifdef ENABLE_FRAGROUTE
  676. fprintf(stderr, "Fragroute engine: enabled\n");
  677. #else
  678. fprintf(stderr, "Fragroute engine: disabled\n");
  679. #endif
  680. #if defined HAVE_NETMAP
  681. fprintf(stderr, "Default injection method: %s\n", sendpacket_get_method(NULL));
  682. #else
  683. fprintf(stderr, "Injection method: %s\n", sendpacket_get_method(NULL));
  684. #endif
  685. #ifdef HAVE_NETMAP
  686. fprintf(stderr, "Optional injection method: netmap\n");
  687. #else
  688. fprintf(stderr, "Not compiled with netmap\n");
  689. #endif
  690. #ifdef HAVE_LIBXDP
  691. fprintf(stderr, "Optional injection method: AF_XDP\n");
  692. #else
  693. fprintf(stderr, "Not compiled with AF_XDP\n");
  694. #endif
  695. exit(0);
  696. EOVersion;
  697. doc = "";
  698. };
  699. flag = {
  700. name = less-help;
  701. value = "h";
  702. immediate;
  703. descrip = "Display less usage information and exit";
  704. flag-code = <<- EOHelp
  705. USAGE(EXIT_FAILURE);
  706. EOHelp;
  707. doc = "";
  708. };