summaryrefslogtreecommitdiff
path: root/trafgen_parser.y
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-01-29 14:12:01 +0100
committerTobias Klauser <tklauser@distanz.ch>2016-01-29 14:19:47 +0100
commit2ba202b8320cbec32520d347ac256c2b4caf0458 (patch)
tree1e1be887468c3a4d5a769f5d1f838537fff86d0c /trafgen_parser.y
parent56ce71c166cdfeab7cb503d538fd176ec4548e05 (diff)
trafgen: parser: Support "etype"/"type" keywords for Ethertype
The IEEE 802.3 standard commonly refers to the field specifying the upper layer protocol as Ethertype, not protocol. Thus, also support the keywords "etype" and "type" for this field. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_parser.y')
-rw-r--r--trafgen_parser.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/trafgen_parser.y b/trafgen_parser.y
index 9ec09b1..71f88d8 100644
--- a/trafgen_parser.y
+++ b/trafgen_parser.y
@@ -350,9 +350,9 @@ 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_PROT
+%token K_DADDR K_SADDR K_ETYPE
%token K_OPER K_SHA K_SPA K_THA K_TPA K_REQUEST K_REPLY K_PTYPE K_HTYPE
-%token 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_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_SPORT K_DPORT
%token K_ETH
@@ -603,8 +603,8 @@ eth_field
{ proto_field_set_bytes(hdr, ETH_DST_ADDR, $5); }
| K_SADDR skip_white '=' skip_white mac
{ proto_field_set_bytes(hdr, ETH_SRC_ADDR, $5); }
- | K_PROT skip_white '=' skip_white number
- { proto_field_set_be16(hdr, ETH_PROTO_ID, $5); }
+ | K_ETYPE skip_white '=' skip_white number
+ { proto_field_set_be16(hdr, ETH_TYPE, $5); }
;
arp_proto