From 77d5cae4d45d1def8f41d4e89b705d2953858643 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 25 Apr 2016 17:56:51 +0200 Subject: trafgen: proto: Add ICMPv6 header generation 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 Signed-off-by: Tobias Klauser --- trafgen_l3.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'trafgen_l3.c') diff --git a/trafgen_l3.c b/trafgen_l3.c index 94c0755..cbdbe6c 100644 --- a/trafgen_l3.c +++ b/trafgen_l3.c @@ -126,6 +126,9 @@ static void ipv6_set_next_proto(struct proto_hdr *hdr, enum proto_id pid) uint8_t ip_proto; switch(pid) { + case PROTO_ICMP6: + ip_proto = IPPROTO_ICMPV6; + break; case PROTO_UDP: ip_proto = IPPROTO_UDP; break; -- cgit v1.2.3-54-g00ecf