summaryrefslogtreecommitdiff
path: root/trafgen.8
AgeCommit message (Collapse)AuthorFilesLines
2016-02-02trafgen: man: Add help for VLAN header functionVadim Kochan1-0/+29
Add usage, syntax & parameters description for 'vlan()' function. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-02-01trafgen: parser: Add TCP header generation functionTobias Klauser1-0/+59
Add a function 'tcp()' to generate TCP headers from the trafgen configuration language. Fields supported: sp|sport TCP source port (default 0) dp|dport TCP destination port (default 0) seq Sequence number (default: 0) aseq|ackseq Acknowledgement number (default 0) doff|hlen Header length/data offset (default: 5) cwr Congestion Window Reduced flag (default: 0) ece|ecn ECN-Echo flag (default: 0) urg Urgent flag (default: 0) ack Acknowledgement flag (default: 0) psh Push flag (default: 0) rst Reset flag (default: 0) syn Synchronize flag (default: 0) fin Finish flag (default: 0) win|window Receive window size (default: 0) csum Checksum field (calculated automatically) urgptr Urgent pointer (default: 0) Example (SYN on port 80/http): { tcp(dport=80, syn, window=5840) } Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-01-29trafgen: parser: Support "etype"/"type" keywords for EthertypeTobias Klauser1-2/+2
The IEEE 802.3 standard commonly refers to the field specifying the upper layer protocol as Ethertype, not protocol. Thus, also support the keywords "etype" and "type" for this field. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-01-29man: trafgen: Remove double wordTobias Klauser1-2/+2
s/packet packet/packet/ Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-01-29trafgen: man: Add help for Ethernet, ARP, IPv4, UDP headersVadim Kochan1-0/+168
Add description (basic syntax, proto header fields) for newer added proto headers: Ethernet, ARP, IPv4, UDP. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> [tk: reworded and reformatted a few parts] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-01-05trafgen: Fix typo of kbit in usage and manpageTobias Klauser1-1/+1
Use 'kbit' instead of kBit in usage and manpage to actually reflect what trafgen expects. Fixes: 9ece0fe02096 ("trafgen: Add option to specify packets sending rate") Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-01-05trafgen: Add option to specify packets sending rateVadim Kochan1-0/+4
Added -b,--rate option in units of: pps/B/kB/MB/kBit/Mbit/Gbit/KiB/MiB/GiB to specify rate at which packets will be sent. Similarly to -t,--gap option the packets will be sent in slow mode with 1 CPU. Tested with ifpps. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2015-12-17trafgen: Added option to pass macro/define for C preprocessorVadim Kochan1-0/+4
Add -D,--define option which allows to pass multiple macro/defines which can be used in trafgen script (e.g. by #ifdef ). Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2015-11-09trafgen: Allow to build packet from command lineVadim Kochan1-1/+7
Craft packet directly from command line with same syntax as for conf file. It might be as first step to extend current syntax with specific proto fields. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2015-10-13trafgen: Add checksum helpers for TCP/UDP over IPv6Tobias Klauser1-0/+2
Add the csumudp6 and csumtcp6 helper functions in order to simplify checksum generation for TCP/UDP packets sent over IPv6. trafgen example for TCP over IPv6: { /* MAC Destination */ fill(0xff, 6), /* MAC Source */ 0x00, 0x02, 0xb3, drnd(3), /* IPv6 Protocol */ c16(0x86DD), /* Version, Traffic Class, Flow Label */ 0b01100000, c8(0), c16(0), /* Payload Length */ c16(54), /* Next Header (TCP) */ c8(6), /* Hop Limit */ c8(64), /* Source IPv6 */ 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0xac, 0x6f, 0xff, 0xfe, 0xa4, 0x12, 0xe3, /* Destination IPv6 */ 0xfe, 0x80, 0x82, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xff, 0xfe, 0x00, 0x06, 0xde, /* TCP Source Port */ c16(55042), /* TCP Destination Port */ c16(55043), /* TCP Sequence Number */ drnd(4), /* TCP Ackn. Number */ c32(0), /* TCP Header length + TCP SYN/ECN Flag */ c16((8 << 12) | (1 << 1) | (1 << 6)) /* Window Size */ c16(16), /* TCP Checksum (offset IPv6, offset TCP) */ csumtcp6(14, 54), /* TCP Options */ 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a, 0x06, 0x91, 0x68, 0x7d, 0x06, 0x91, 0x68, 0x6f, /* Data blob */ "foobar!", } Suggested-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2014-08-21trafgen: add option to not adjust system socket mem during testrunJesper Dangaard Brouer1-0/+9
The default behavior of trafgen is to boost the systems default socket memory limits during a testrun. This behaviour does not always result in improved performance, because this will stress the kernels SLAB allocators unnecessary. Introducing an option "--no-sock-mem" that instruct trafgen to not perform any socket memory adjustments. Fixes: #130 Acked-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2014-05-03doc: Fix typos in mausezahn and trafgen manpagesKartik Mistry1-1/+1
Fixed typos in mausezahn.8 and trafgen.8 [tklauser: Slightly edited commit message] Signed-off-by: Kartik Mistry <kartik.mistry@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2014-04-30trafgen: Don't expose -k/--kernel-pull anymore and warn if it still usedTobias Klauser1-5/+0
The -k/--kernel-pull option got useless with commit c139e80 ("trafgen: remove timer-based trigger model"). Instead of entirely removing it and thus possibly breaking people's scripts, still accept it as an option, but warn the user about it. We might want to remove the option in a future release. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2014-03-14man: manpage warning fixesKartik Mistry1-2/+1
Usage: man --warnings -E UTF-8 -l -Tutf8 -Z foo.8 > /dev/null Signed-off-by: Kartik Mistry <kartik.mistry@gmail.com>
2013-12-12trafgen: take advantage of PACKET_QDISC_BYPASS sock optionJesper Dangaard Brouer1-0/+6
Since Linux 3.14, the kernel supports a socket option PACKET_QDISC_BYPASS, which trafgen enables by default. That allow us to bypass the kernels normal qdisc (traffic control) layer. An option -q, --qdisc-path is added to allow enabling the qdisc path explicity, useful for testing purposes. This will be avail in kernels >= 3.14 via commit d346a3fae3 (packet: introduce PACKET_QDISC_BYPASS socket option). Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2013-11-25trafgen: inherit netsniff-ng's -H -Q optionsDaniel Borkmann1-0/+9
Also make these options available to trafgen. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-10-15trafgen: set interpacket gap in time units (s/ms/us/ns)Jon Schipp1-9/+11
Add ability to set IGP in time units in seconds, milliseconds, microseconds, and nanoseconds by appending a postfix to --gap e.g. --gap 100ms. Also, update the man page and trafgen.zsh to reflect the changes. [Fix whitespaces, coding style and minor wording changes -- tklauser] Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-29man: Align synopsis with other sectionsTobias Klauser1-1/+1
In all the tools' man pages the synopsis line is indented by one space with respect to the text in the sections above and below. Remove the space to have consistent alignment. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-13trafgen: switch for skipping cpu time statistics on exitDaniel Borkmann1-0/+3
For systems with >8 CPUs it might be i) annoying or ii) uninteresting to print CPU time statistics. So introduce a switch that can skip this at exit. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-17man: add colophon to the end of each document.Daniel Borkmann1-0/+4
Add a colophon to the end of each man page. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-15trafgen: fix checksumming in trafgen example configDaniel Borkmann1-1/+1
Took quite a while to git bisect the cause for the wrong TCP checksum in the -e example. It turned out that commit bf43e1993c7037 ("trafgen: lexer: return original string if no shellcode") "broke" it, since before that commit the TCP checksum from -e example was correct and afterwards not anymore. Well, it didn't break it. What was happening here is that with this fix above, the packet got 1 byte longer since the first character of the example string is not omitted anymore, therefore the checksum got wrong. Fix this by fixing the IP total length of the packet in the -e and man page example. The UDP example from the man page still works well if csumudp() is used, so not affected of this. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-14man: trafgen: fix remaining `` occurencesDaniel Borkmann1-23/+23
That's the last man page where `` occurs, so fix this up by making it consistentlt '' as the rest of all man pages. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-30man: manpages hyphen and spelling mistakesKartik Mistry1-4/+4
Some fixes all over, part 1. Signed-off-by: Kartik Mistry <kartik@debian.org> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-27man: minor: trafgen: add .PPs and modify BUGS sectionDaniel Borkmann1-81/+82
Minor change in BUGS section to bring it up to date. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-23man: trafgen: corrections and various edits to manual pageJon Schipp1-16/+16
Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-15man: trafgen: Minor fixesTobias Klauser1-13/+14
Replace "on default" by "by default", make it a bit more clear what the seed in the -E/--seed option is for and mention exit after display of information on --version and --help. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-15man: trafgen: Complete documentation for option -p/--cppTobias Klauser1-1/+3
Add complete description of the commandline option -p/--cpp to the manpage. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-10man: trafgen: update documentation for hex, bin formsDaniel Borkmann1-2/+2
Also update examples for the man-page. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-05misc: move file to source rootDaniel Borkmann1-0/+445
Only have Makefile specific folders in the project root where the binaries are stored, the rest should be part of the repository root. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>