diff options
author | Vadim Kochan <vadim4j@gmail.com> | 2016-04-30 17:39:15 +0300 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-07-11 09:50:52 +0200 |
commit | 7304939f0249945c8d63043a80a94f80f13ecf2e (patch) | |
tree | acf2ec1692db5544d98b35daa63a53870abcf303 | |
parent | 14c81587037b03554819972f9b3965712cacd0f1 (diff) |
trafgen: parser: Split [e]type to separate keywords
Split [e]type to separate 'type' & 'etype' keywords,
the reason is that 'type' might be used in other protocol
headers (e.g. ICMP).
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | trafgen_lexer.l | 3 | ||||
-rw-r--r-- | trafgen_parser.y | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/trafgen_lexer.l b/trafgen_lexer.l index eb438a8..3eda22a 100644 --- a/trafgen_lexer.l +++ b/trafgen_lexer.l @@ -115,7 +115,8 @@ ip6_addr (({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?:)?({a_hex}?: /* Ethernet */ "daddr"|"da" { return K_DADDR; } "saddr"|"sa" { return K_SADDR; } -[e]?"type" { return K_ETYPE; } +"etype" { return K_ETYPE; } +"type" { return K_TYPE; } /* VLAN (802.1Q & 802.1ad) */ "tpid" { return K_TPID; } diff --git a/trafgen_parser.y b/trafgen_parser.y index bf57f47..19b26e6 100644 --- a/trafgen_parser.y +++ b/trafgen_parser.y @@ -352,7 +352,7 @@ static void proto_add(enum proto_id pid) %token K_COMMENT K_FILL K_RND K_SEQINC K_SEQDEC K_DRND K_DINC K_DDEC K_WHITE %token K_CPU K_CSUMIP K_CSUMUDP K_CSUMTCP K_CSUMUDP6 K_CSUMTCP6 K_CONST8 K_CONST16 K_CONST32 K_CONST64 -%token K_DADDR K_SADDR K_ETYPE +%token K_DADDR K_SADDR K_ETYPE K_TYPE %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 @@ -615,6 +615,7 @@ eth_param_list eth_type : K_ETYPE { } + | K_TYPE { } | K_PROT { } ; |