From c09e06a6efaa94768660636a9c58ce9666e29d05 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 22 Apr 2016 16:55:31 +0200 Subject: trafgen: proto: Add IPv6 header generation Support for generating simple IPv6 headers using the 'ip6()/ipv6()' trafgen generation function. Fields supported: ver|version Version (default: 6) tc|tclass Traffic class (default: 0) fl|flow Flow Label (default: 0) len|length Payload length (calculated by default) nh|nexthdr Type of next header (default: 0) hl|hoplimit|ttl Hop Limit, TTL (default: 0) sa|saddr Source IPv6 address (default: device address) da|daddr Destination IPv6 address (default: 0:0:0:0:0:0:0:0) Examples: { eth(), ipv6(daddr=1:2:3:4:5:6:7:8) } { ipv6(tc=2, hl=3, daddr=::1) } { eth(), ipv6(nh=58, sa=2001:db8::, da=::1), 128, 0, 0x52, 0x03, 0, 0, 0, 0 } If not explicitely specified, the lower header is initialized as Ethernet. Signed-off-by: Tobias Klauser --- trafgen.8 | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'trafgen.8') diff --git a/trafgen.8 b/trafgen.8 index 300277b..c81fecb 100644 --- a/trafgen.8 +++ b/trafgen.8 @@ -424,7 +424,7 @@ destination MAC address is set to the broadcast address (ff:ff:ff:ff:ff:ff). - Explicit Congestion Notification (ECN) field (default: 0) .sp .B len|length -- Total length of header and data (calculated by default) +- Total length of header and payload (calculated by default) .sp .B id - IPv4 datagram identification (default: 0) @@ -461,6 +461,43 @@ By default, if the lower level header is Ethernet, its EtherType field is set to 0x0800 (IPv4). If the lower level header is IPv4, its protocol field is set to 0x4 (IP-in-IP). +.I IPv6 +: +.B ip6|ipv6(ver=, class=, flow= len=, +.B nexthdr=, hoplimit=, +.in +16 +.B da=, sa=) +.in -16 +.sp +.in +4 +.B ver|version +- Version field (default: 6) +.sp +.B tc|tclass +- Traffic class (default: 0) +.sp +.B fl|flow +- Flow label (default: 0) +.sp +.B len|length +- Payload length (calculated by default) +.sp +.B nh|nexthdr +- Type of next header, i.e. transport layer protocol number (default: 0) +.sp +.B hl|hoplimit|ttl +- Hop limit, i.e. time to live (default: 0) +.sp +.B sa|saddr +- Source IPv6 address (default: device IPv6 address) +.sp +.B da|daddr +- Destination IPv6 address (default: 0:0:0:0:0:0:0:0) +.in -4 +.sp +By default, if the lower level header is Ethernet, its EtherType field is set to +0x86DD (IPv6). + .I UDP : .B udp(sp=, dp=, len=, csum=) -- cgit v1.2.3-54-g00ecf