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_lexer.l | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'trafgen_lexer.l') diff --git a/trafgen_lexer.l b/trafgen_lexer.l index a093ac1..eb438a8 100644 --- a/trafgen_lexer.l +++ b/trafgen_lexer.l @@ -161,6 +161,12 @@ ip6_addr (({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?: "nh"|"nexthdr" { return K_NEXT_HDR; } "hl"|"hoplimit" { return K_HOP_LIMIT; } + /* ICMPv6 */ +"mtype" { return K_MTYPE; } +"code" { return K_CODE; } +"echorequest" { return K_ECHO_REQUEST; } +"echoreply" { return K_ECHO_REPLY; } + /* UDP */ "sp"|"sport" { return K_SPORT; } "dp"|"dport" { return K_DPORT; } @@ -186,6 +192,7 @@ ip6_addr (({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?: "arp" { return K_ARP; } "ip4"|"ipv4" { return K_IP4; } "ip6"|"ipv6" { return K_IP6; } +"icmp6"|"icmpv6" { return K_ICMP6; } "udp" { return K_UDP; } "tcp" { return K_TCP; } -- cgit v1.2.3-54-g00ecf