aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorEliot Lear <lear@cisco.com>2017-10-22 11:35:33 +0200
committerMichael Mann <mmann78@netscape.net>2017-10-22 14:14:48 +0000
commitb91089befc50b838853f1f2b7b0bdad51537aaf3 (patch)
tree50e71f7558805cac41c4a309a9c20a72d68518e5 /epan
parentb913bcc13a9a6213902691a8d73bba1427ab407b (diff)
Add IANA arc and first entry (MUDURL) for lldp.
PCAP file: https://github.com/the-tcpdump-group/tcpdump/blob/master/tests/lldp_mudurl.pcap Change-Id: If1f4946f8a8ade44dbab33a877bf7449f9ea2a6f Reviewed-on: https://code.wireshark.org/review/23982 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-lldp.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c
index 28c2b8ce69..f8575f0a70 100644
--- a/epan/dissectors/packet-lldp.c
+++ b/epan/dissectors/packet-lldp.c
@@ -392,6 +392,8 @@ static int hf_avaya_ipphone_mask = -1;
static int hf_avaya_ipphone_gateway = -1;
static int hf_unknown_subtype = -1;
static int hf_unknown_subtype_content = -1;
+static int hf_iana_subtype = -1;
+static int hf_iana_mudurl = -1;
/* Initialize the subtree pointers */
static gint ett_lldp = -1;
@@ -691,6 +693,14 @@ static const value_string avaya_dot1q_subtypes[] = {
{ 0, NULL }
};
+/* IANA Subtypes */
+static const value_string iana_subtypes[] = {
+ { 1, "Manufacturer Usage Description URL" },
+ { 0, NULL }
+};
+
+
+
/* 802.3 Power Class */
static const value_string power_class_802_3[] = {
{ 1, "0" },
@@ -3618,6 +3628,34 @@ dissect_avaya_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint
}
}
+/* Dissect IANA OUI TLVs */
+static void
+dissect_iana_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
+{
+ guint16 msg_len;
+ guint8 subType;
+
+ /* Get subtype */
+ subType = tvb_get_guint8(tvb, offset);
+
+ proto_tree_add_item(tree, hf_iana_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset++;
+
+ msg_len=tvb_reported_length_remaining(tvb, offset);
+ switch (subType)
+ {
+ case 0x01: /* MUDURL */
+ if ( msg_len > 0 )
+ proto_tree_add_item(tree, hf_iana_mudurl, tvb, offset, msg_len, ENC_ASCII|ENC_NA);
+ break;
+
+ default:
+ proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA);
+ break;
+ }
+}
+
+
/* Dissect Organizational Specific TLV */
static gint32
dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, profinet_lldp_column_info *pn_lldp_column_info)
@@ -3768,6 +3806,9 @@ dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tre
case OUI_AVAYA:
subTypeStr = val_to_str(subType, avaya_subtypes, "Unknown subtype (0x%x)");
break;
+ case OUI_IANA:
+ subTypeStr = val_to_str(subType, iana_subtypes, "Unknown subtype (0x%x)");
+ break;
default:
subTypeStr = wmem_strdup_printf(wmem_packet_scope(), "Unknown (%d)",subType);
break;
@@ -3816,6 +3857,10 @@ dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tre
case OUI_AVAYA:
dissect_avaya_tlv(tvb, pinfo, org_tlv_tree, (offset + 5));
break;
+ case OUI_IANA:
+ dissect_iana_tlv(tvb, pinfo, org_tlv_tree, (offset + 5));
+ break;
+
default:
dissect_oui_default_tlv(tvb, pinfo, org_tlv_tree, (offset + 5));
}
@@ -5275,6 +5320,14 @@ proto_register_lldp(void)
{ "Gateway IP", "lldp.avaya.ipphone.gateway", FT_IPv4, BASE_NONE,
NULL, 0x0, NULL, HFILL }
},
+ { &hf_iana_subtype,
+ { "IANA Subtype", "lldp.iana.subtype", FT_UINT8, BASE_HEX,
+ VALS(iana_subtypes), 0x0, NULL, HFILL }
+ },
+ { &hf_iana_mudurl,
+ { "Manufacturer Usage Description URL", "lldp.iana.mudurl", FT_STRING, BASE_NONE,
+ NULL, 0x0, NULL, HFILL }
+ },
{ &hf_unknown_subtype,
{ "Unknown Subtype","lldp.unknown_subtype", FT_UINT8, BASE_DEC,
NULL, 0x0, NULL, HFILL }