summaryrefslogtreecommitdiff
path: root/trafgen_l4.h
AgeCommit message (Collapse)AuthorFilesLines
2016-07-13trafgen: proto: Add ICMPv4 header generationVadim Kochan1-0/+10
Support for generating ICMPv4 headers using the 'icmp4()/icmpv4()' trafgen generation functions. Fields supported: type Set type field (default 0: Echo reply) Supported keywords: echorequest, echoreply code Set code field (default 0) csum Set checksum field (calculated by default) mtu Set mtu field for destination unreachable (default 0) seq Set sequence field (default 0) id Set identifier field (default 0) addr Set redirect address (default 0.0.0.0) Example (send ping request): { icmpv4(echorequest, seq=1, id=1326) } Signed-off-by: Vadim Kochan <vadim4j@gmail.com> [tk: squash commits, consistency between functionality and docu] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-04-25trafgen: proto: Add ICMPv6 header generationTobias Klauser1-0/+6
Support for generating simple ICMPv6 headers using the 'icmp6()/icmpv6()' trafgen generation function. Fields supported: mtype Message type (default: 0) Supported keywords: echorequest, echoreply code Code (default: 0) csum Message checksum (calculated by default) Examples: { eth(), ipv6(daddr=::1), icmpv6(echorequest), 42, 42, 0, 0 }' If not explicitely specified, the lower header is initialized as Ethernet. Suggested-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-02-01trafgen: parser: Add TCP header generation functionTobias Klauser1-0/+19
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: l4: Add UDP header generation logicVadim Kochan1-0/+13
Add trafgen_l4.c module with generation UDP header fields. UDP protocol generation logic automaticaly sets the protocol field of the lower level protocol to IPPROTO_UDP by default (if it is IPv4). Also checksum & length are calculated and set if it is not given by the user. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>