RADIUS: Enhance display of Egress-VLAN-Name

Bug:11894
Change-Id: I397219153dcd9932d899c681ac70323380ebd738
Reviewed-on: https://code.wireshark.org/review/12674
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2015-12-16 10:32:31 +01:00 committed by Anders Broman
parent f342fdcdb8
commit 022968d17b
1 changed files with 31 additions and 4 deletions

View File

@ -163,6 +163,9 @@ static int hf_radius_egress_vlanid_tag = -1;
static int hf_radius_egress_vlanid_pad = -1;
static int hf_radius_egress_vlanid = -1;
static int hf_radius_egress_vlan_name_tag = -1;
static int hf_radius_egress_vlan_name = -1;
static gint ett_radius = -1;
static gint ett_radius_avp = -1;
@ -784,7 +787,7 @@ dissect_radius_3gpp_ms_tmime_zone(proto_tree* tree, tvbuff_t* tvb, packet_info*
}
static const value_string egress_vlanid_tag_vals[] = {
static const value_string egress_vlan_tag_vals[] = {
{ 0x31, "Tagged"},
{ 0x32, "Untagged"},
{ 0, NULL}
@ -802,8 +805,25 @@ static const gchar *dissect_rfc4675_egress_vlanid(proto_tree* tree, tvbuff_t* tv
proto_tree_add_item(tree, hf_radius_egress_vlanid, tvb, 0, 4, ENC_BIG_ENDIAN);
vlanid = tvb_get_ntohl(tvb, 0);
return wmem_strdup_printf(wmem_packet_scope(), "%s Vlan ID: %u",
val_to_str_const( ((vlanid&0xFF000000)>>24), egress_vlanid_tag_vals, "Unknown"), vlanid&0xFFF);
return wmem_strdup_printf(wmem_packet_scope(), "%s, Vlan ID: %u",
val_to_str_const( ((vlanid&0xFF000000)>>24), egress_vlan_tag_vals, "Unknown"), vlanid&0xFFF);
}
static const gchar *dissect_rfc4675_egress_vlan_name(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo _U_) {
int len;
guint8 tag;
len = tvb_reported_length(tvb);
if (len < 2)
return "[wrong length for Egress-VLAN-Name ]";
proto_tree_add_item(tree, hf_radius_egress_vlan_name_tag, tvb, 0, 1, ENC_BIG_ENDIAN);
tag = tvb_get_guint8(tvb, 0);
len -= 1;
proto_tree_add_item(tree, hf_radius_egress_vlan_name, tvb, 1, len, ENC_ASCII|ENC_NA);
return wmem_strdup_printf(wmem_packet_scope(), "%s, Vlan Name: %s",
val_to_str_const( tag, egress_vlan_tag_vals, "Unknown"), tvb_get_string_enc(wmem_packet_scope(),tvb, 1, len, ENC_ASCII|ENC_NA));
}
static void
@ -2385,7 +2405,7 @@ static void register_radius_fields(const char* unused _U_) {
{ "AVP", "radius.avp", FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
{ &hf_radius_egress_vlanid_tag,
{ "Tag", "radius.egress_vlanid_tag", FT_UINT32, BASE_HEX, VALS(egress_vlanid_tag_vals), 0xFF000000,
{ "Tag", "radius.egress_vlanid_tag", FT_UINT32, BASE_HEX, VALS(egress_vlan_tag_vals), 0xFF000000,
NULL, HFILL }},
{ &hf_radius_egress_vlanid_pad,
{ "Pad", "radius.egress_vlanid_pad", FT_UINT32, BASE_HEX, NULL, 0x00FFF000,
@ -2393,6 +2413,12 @@ static void register_radius_fields(const char* unused _U_) {
{ &hf_radius_egress_vlanid,
{ "Vlan ID", "radius.egress_vlanid", FT_UINT32, BASE_DEC, NULL, 0x00000FFF,
NULL, HFILL }},
{ &hf_radius_egress_vlan_name_tag,
{ "Tag", "radius.egress_vlan_name_tag", FT_UINT8, BASE_HEX, VALS(egress_vlan_tag_vals), 0x0,
NULL, HFILL }},
{ &hf_radius_egress_vlan_name,
{ "Vlan Name", "radius.egress_vlan_name", FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
{ &hf_radius_3gpp_ms_tmime_zone,
{ "Timezone", "radius.3gpp_ms_tmime_zone", FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
@ -2469,6 +2495,7 @@ static void register_radius_fields(const char* unused _U_) {
radius_register_avp_dissector(0,14,dissect_login_ip_host);
radius_register_avp_dissector(0,23,dissect_framed_ipx_network);
radius_register_avp_dissector(0,56,dissect_rfc4675_egress_vlanid);
radius_register_avp_dissector(0,58,dissect_rfc4675_egress_vlan_name);
radius_register_avp_dissector(VENDOR_COSINE,5,dissect_cosine_vpvc);
/*