summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-04-30 17:39:16 +0300
committerTobias Klauser <tklauser@distanz.ch>2016-07-11 09:51:44 +0200
commite6fcf1f0f2c58cf38fad98d1d8b00a3b7ebd3070 (patch)
treee5b98e0092208bd639da6055d765cb5c262c0915
parent7304939f0249945c8d63043a80a94f80f13ecf2e (diff)
trafgen: parser: Replace 'mtype' by 'type'
After splitting etype & type to different tokens it is possible to use 'type' for ICMP type field which is used by RFC. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--trafgen.84
-rw-r--r--trafgen_lexer.l1
-rw-r--r--trafgen_parser.y8
3 files changed, 6 insertions, 7 deletions
diff --git a/trafgen.8 b/trafgen.8
index 3075daa..b011276 100644
--- a/trafgen.8
+++ b/trafgen.8
@@ -500,11 +500,11 @@ By default, if the lower level header is Ethernet, its EtherType field is set to
.I ICMPv6
:
-.B icmp6|icmpv6(mtype=<number>, echorequest, echoreply, code=<number>,
+.B icmp6|icmpv6(type=<number>, echorequest, echoreply, code=<number>,
.B csum=<number>)
.sp
.in +4
-.B mtype
+.B type
- Message type (default: 0)
.sp
.B code
diff --git a/trafgen_lexer.l b/trafgen_lexer.l
index 3eda22a..87db504 100644
--- a/trafgen_lexer.l
+++ b/trafgen_lexer.l
@@ -163,7 +163,6 @@ ip6_addr (({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?:
"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; }
diff --git a/trafgen_parser.y b/trafgen_parser.y
index 19b26e6..adb7f5e 100644
--- a/trafgen_parser.y
+++ b/trafgen_parser.y
@@ -356,7 +356,7 @@ static void proto_add(enum proto_id pid)
%token K_OPER K_SHA K_SPA K_THA K_TPA K_REQUEST K_REPLY K_PTYPE K_HTYPE
%token K_PROT K_TTL K_DSCP K_ECN K_TOS K_LEN K_ID K_FLAGS K_FRAG K_IHL K_VER K_CSUM K_DF K_MF
%token K_FLOW K_NEXT_HDR K_HOP_LIMIT
-%token K_MTYPE K_CODE K_ECHO_REQUEST K_ECHO_REPLY
+%token K_CODE K_ECHO_REQUEST K_ECHO_REPLY
%token K_SPORT K_DPORT
%token K_SEQ K_ACK_SEQ K_DOFF K_CWR K_ECE K_URG K_ACK K_PSH K_RST K_SYN K_FIN K_WINDOW K_URG_PTR
%token K_TPID K_TCI K_PCP K_DEI K_1Q K_1AD
@@ -827,13 +827,13 @@ icmp6_param_list
;
icmp6_field
- : K_MTYPE skip_white '=' skip_white number
+ : K_TYPE skip_white '=' skip_white number
{ proto_field_set_u8(hdr, ICMPV6_TYPE, $5); }
- | K_MTYPE skip_white '=' K_ECHO_REQUEST
+ | K_TYPE skip_white '=' K_ECHO_REQUEST
{ proto_field_set_u8(hdr, ICMPV6_TYPE, ICMPV6_ECHO_REQUEST); }
| K_ECHO_REQUEST
{ proto_field_set_u8(hdr, ICMPV6_TYPE, ICMPV6_ECHO_REQUEST); }
- | K_MTYPE skip_white '=' K_ECHO_REPLY
+ | K_TYPE skip_white '=' K_ECHO_REPLY
{ proto_field_set_u8(hdr, ICMPV6_TYPE, ICMPV6_ECHO_REPLY); }
| K_ECHO_REPLY
{ proto_field_set_u8(hdr, ICMPV6_TYPE, ICMPV6_ECHO_REPLY); }