diff options
author | Bill Meier <wmeier@newsguy.com> | 2014-11-25 00:43:06 -0500 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2014-11-25 18:53:22 +0000 |
commit | e2132f9b152a5ba59ddf484b144c71c7d2447206 (patch) | |
tree | 5460825c45b8c08783eac20e86fae1bc5a9874eb /epan/dissectors/packet-openflow_v4.c | |
parent | 20153980ebe4a54824dd3558685d1e7994190398 (diff) |
openflow: Minor changes
- Remove unneeded/undefined forward declarations;
- Create/use some extended value-strings;
- Do some whitespace changes.
Change-Id: I7961864f0e404e141d2887584751116011f8d941
Reviewed-on: https://code.wireshark.org/review/5490
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Diffstat (limited to 'epan/dissectors/packet-openflow_v4.c')
-rw-r--r-- | epan/dissectors/packet-openflow_v4.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/epan/dissectors/packet-openflow_v4.c b/epan/dissectors/packet-openflow_v4.c index 9e7868bd33..e946f61e42 100644 --- a/epan/dissectors/packet-openflow_v4.c +++ b/epan/dissectors/packet-openflow_v4.c @@ -27,13 +27,12 @@ #include "config.h" #include <glib.h> +#include <epan/packet.h> #include <epan/etypes.h> #include <epan/expert.h> #include <epan/ipproto.h> -#include <epan/packet.h> void proto_register_openflow_v4(void); -void proto_reg_handoff_openflow_v4(void); static dissector_handle_t eth_withoutfcs_handle; @@ -795,6 +794,7 @@ static const value_string openflow_v4_type_values[] = { { OFPT_METER_MOD, "OFPT_METER_MOD" }, { 0, NULL } }; +static value_string_ext openflow_v4_type_values_ext = VALUE_STRING_EXT_INIT(openflow_v4_type_values); static int dissect_openflow_header_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_) @@ -946,6 +946,7 @@ static const value_string openflow_v4_oxm_basic_field_values[] = { { 39, "OFPXMT_OFB_IPV6_EXTHDR" }, { 0, NULL } }; +static value_string_ext openflow_v4_oxm_basic_field_values_ext = VALUE_STRING_EXT_INIT(openflow_v4_oxm_basic_field_values); #define OXM_FIELD_MASK 0xfe #define OXM_FIELD_OFFSET 1 @@ -4557,7 +4558,7 @@ dissect_openflow_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d length = tvb_get_ntohs(tvb, 2); col_append_fstr(pinfo->cinfo, COL_INFO, "Type: %s", - val_to_str_const(type, openflow_v4_type_values, "Unknown message type")); + val_to_str_ext_const(type, &openflow_v4_type_values_ext, "Unknown message type")); /* Create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_openflow_v4, tvb, 0, -1, ENC_NA); @@ -4676,7 +4677,7 @@ proto_register_openflow_v4(void) }, { &hf_openflow_v4_type, { "Type", "openflow_v4.type", - FT_UINT8, BASE_DEC, VALS(openflow_v4_type_values), 0x0, + FT_UINT8, BASE_DEC | BASE_EXT_STRING, &openflow_v4_type_values_ext, 0x0, NULL, HFILL } }, { &hf_openflow_v4_xid, @@ -4701,7 +4702,7 @@ proto_register_openflow_v4(void) }, { &hf_openflow_v4_oxm_field_basic, { "Field", "openflow_v4.oxm.field", - FT_UINT8, BASE_DEC, VALS(openflow_v4_oxm_basic_field_values), 0x0, + FT_UINT8, BASE_DEC | BASE_EXT_STRING, &openflow_v4_oxm_basic_field_values_ext, 0x0, NULL, HFILL } }, { &hf_openflow_v4_oxm_hm, |