From 35e4233314f93ffa283cc4b6b050d7a59ca9f062 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Wed, 2 Nov 2016 09:47:48 +0100 Subject: [PATCH] Openflow (v4/v5): Add vOXM vlan mask field Bug: 12979 Change-Id: I7f0e806081704dfeaf40ce1e4e41271ffd5e3023 Reviewed-on: https://code.wireshark.org/review/18618 Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-openflow_v4.c | 10 ++++++++++ epan/dissectors/packet-openflow_v5.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/epan/dissectors/packet-openflow_v4.c b/epan/dissectors/packet-openflow_v4.c index c621115d4f..f5e8d7f4c2 100644 --- a/epan/dissectors/packet-openflow_v4.c +++ b/epan/dissectors/packet-openflow_v4.c @@ -62,6 +62,7 @@ static int hf_openflow_v4_oxm_mask = -1; static int hf_openflow_v4_oxm_mask_etheraddr = -1; static int hf_openflow_v4_oxm_mask_ipv4addr = -1; static int hf_openflow_v4_oxm_mask_ipv6addr = -1; +static int hf_openflow_v4_oxm_mask_vlan = -1; static int hf_openflow_v4_match_type = -1; static int hf_openflow_v4_match_length = -1; static int hf_openflow_v4_match_pad = -1; @@ -1043,6 +1044,10 @@ dissect_openflow_oxm_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_vlan_present, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_vlan_vid, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; + if (oxm_hm) { + proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_mask_vlan, tvb, offset, 2, ENC_NA); + offset+=2; + } break; case OFPXMT_OFB_IP_PROTO: @@ -4807,6 +4812,11 @@ proto_register_openflow_v4(void) FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_openflow_v4_oxm_mask_vlan, + { "Mask", "openflow_v4.oxm.vlan_mask", + FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, { &hf_openflow_v4_match_type, { "Type", "openflow_v4.match.type", FT_UINT16, BASE_DEC, VALS(openflow_v4_match_type_values), 0x0, diff --git a/epan/dissectors/packet-openflow_v5.c b/epan/dissectors/packet-openflow_v5.c index 9359beb279..bbb561275e 100644 --- a/epan/dissectors/packet-openflow_v5.c +++ b/epan/dissectors/packet-openflow_v5.c @@ -62,6 +62,7 @@ static int hf_openflow_v5_oxm_mask = -1; static int hf_openflow_v5_oxm_mask_etheraddr = -1; static int hf_openflow_v5_oxm_mask_ipv4addr = -1; static int hf_openflow_v5_oxm_mask_ipv6addr = -1; +static int hf_openflow_v5_oxm_mask_vlan = -1; static int hf_openflow_v5_match_type = -1; static int hf_openflow_v5_match_length = -1; static int hf_openflow_v5_match_pad = -1; @@ -1198,6 +1199,10 @@ dissect_openflow_oxm_v5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_tree_add_item(oxm_tree, hf_openflow_v5_oxm_value_vlan_present, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(oxm_tree, hf_openflow_v5_oxm_value_vlan_vid, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; + if (oxm_hm) { + proto_tree_add_item(oxm_tree, hf_openflow_v5_oxm_mask_vlan, tvb, offset, 2, ENC_NA); + offset+=2; + } break; case OFPXMT_OFB_IP_PROTO: @@ -6136,6 +6141,11 @@ proto_register_openflow_v5(void) FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_openflow_v5_oxm_mask_vlan, + { "Mask", "openflow_v5.oxm.vlan_mask", + FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, { &hf_openflow_v5_match_type, { "Type", "openflow_v5.match.type", FT_UINT16, BASE_DEC, VALS(openflow_v5_match_type_values), 0x0,