From 2ba202b8320cbec32520d347ac256c2b4caf0458 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 29 Jan 2016 14:12:01 +0100 Subject: 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 --- trafgen_l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'trafgen_l2.c') diff --git a/trafgen_l2.c b/trafgen_l2.c index 4bbeea1..e881b06 100644 --- a/trafgen_l2.c +++ b/trafgen_l2.c @@ -13,7 +13,7 @@ struct proto_field eth_fields[] = { { .id = ETH_DST_ADDR, .len = 6, }, { .id = ETH_SRC_ADDR, .len = 6, .offset = 6 }, - { .id = ETH_PROTO_ID, .len = 2, .offset = 12 }, + { .id = ETH_TYPE, .len = 2, .offset = 12 }, }; static void eth_header_init(struct proto_hdr *hdr) @@ -53,7 +53,7 @@ static void arp_header_init(struct proto_hdr *hdr) uint8_t bcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; proto_field_set_default_bytes(lower, ETH_DST_ADDR, bcast); - proto_field_set_default_be16(lower, ETH_PROTO_ID, ETH_P_ARP); + proto_field_set_default_be16(lower, ETH_TYPE, ETH_P_ARP); } proto_header_fields_add(hdr, arp_fields, array_size(arp_fields)); -- cgit v1.2.3-54-g00ecf