diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-05-25 19:11:46 +0100 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2017-05-28 14:52:10 +0000 |
commit | 3ae77557af651938c34c752f62531a6b4c8e1309 (patch) | |
tree | 2828a33a785529bc975737f3962eccfd75d43f52 /epan | |
parent | cf93801276c654ccb34f47ac12bf962e2ca569db (diff) |
RADIUS: Add Vendor ID, Vendor Type and Vendor Length fields
Change-Id: I241bfb5d77374d8dd1428fb550d9e913a2d3570a
Reviewed-on: https://code.wireshark.org/review/21756
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-radius.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c index 9ea178e4a6..32bbc9b3a9 100644 --- a/epan/dissectors/packet-radius.c +++ b/epan/dissectors/packet-radius.c @@ -187,6 +187,9 @@ static int hf_radius_eap_fragment = -1; static int hf_radius_avp = -1; static int hf_radius_avp_length = -1; static int hf_radius_avp_type = -1; +static int hf_radius_avp_vendor_id = -1; +static int hf_radius_avp_vendor_type = -1; +static int hf_radius_avp_vendor_len = -1; static int hf_radius_avp_extended_type = -1; static int hf_radius_avp_extended_more = -1; static int hf_radius_3gpp_ms_tmime_zone = -1; @@ -1475,6 +1478,7 @@ dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo, tvbuff_t *tv proto_tree *vendor_tree; gint max_offset = offset + avp_length; const gchar *vendor_str; + int vendor_offset; /* XXX TODO: handle 2 byte codes for USR */ @@ -1498,14 +1502,20 @@ dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo, tvbuff_t *tv vendor_tree = proto_item_add_subtree(avp_item, vendor->ett); - proto_tree_add_item(vendor_tree, hf_radius_avp_type, tvb, avp_offset_start, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(vendor_tree, hf_radius_avp_length, tvb, avp_offset_start+1, 1, ENC_BIG_ENDIAN); + vendor_offset = avp_offset_start; + proto_tree_add_item(vendor_tree, hf_radius_avp_type, tvb, vendor_offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(vendor_tree, hf_radius_avp_length, tvb, vendor_offset+1, 1, ENC_BIG_ENDIAN); + vendor_offset += 2; if (avp_is_extended) { - proto_tree_add_item(vendor_tree, hf_radius_avp_extended_type, tvb, avp_offset_start+2, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(vendor_tree, hf_radius_avp_extended_type, tvb, vendor_offset, 1, ENC_BIG_ENDIAN); + vendor_offset += 1; } if (RADIUS_ATTR_TYPE_IS_EXTENDED_LONG(avp_type0)) { - proto_tree_add_item(vendor_tree, hf_radius_avp_extended_more, tvb, avp_offset_start+3, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(vendor_tree, hf_radius_avp_extended_more, tvb, vendor_offset, 1, ENC_BIG_ENDIAN); + vendor_offset += 1; } + proto_tree_add_uint_format_value(vendor_tree, hf_radius_avp_vendor_id, tvb, vendor_offset, 4, vendor_id, "%s (%u)", vendor_str, vendor_id); + vendor_offset += 4; while (offset < max_offset) { guint32 avp_vsa_type; @@ -1582,6 +1592,13 @@ dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo, tvbuff_t *tv avp_vsa_len+avp_vsa_header_len, dictionary_entry->name, avp_vsa_type); } + proto_tree_add_item(avp_tree, hf_radius_avp_vendor_type, tvb, vendor_offset, 1, ENC_BIG_ENDIAN); + vendor_offset += 1; + if (!avp_is_extended) { + proto_tree_add_item(avp_tree, hf_radius_avp_vendor_len, tvb, vendor_offset, 1, ENC_BIG_ENDIAN); + /* vendor_offset += 1; */ + } + if (show_length) { avp_len_item = proto_tree_add_uint(avp_tree, dictionary_entry->hf_len, @@ -2636,6 +2653,15 @@ register_radius_fields(const char *unused _U_) { &hf_radius_avp_type, { "AVP Type", "radius.avp.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_radius_avp_vendor_id, + { "AVP Vendor ID", "radius.avp.vendor_id", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_radius_avp_vendor_type, + { "VSA Type", "radius.avp.vendor_type", FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_radius_avp_vendor_len, + { "VSA Length", "radius.avp.vendor_len", FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, { &hf_radius_avp_extended_type, { "AVP Extended Type", "radius.avp.extended_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, |