diff options
author | Guy Harris <gharris@sonic.net> | 2020-08-21 21:08:15 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-08-22 05:56:30 +0000 |
commit | f91e6535c2aa17466a06bcaf62f4019df5b2ee68 (patch) | |
tree | 83ceb12004d2c757cfc54b35290fd3ec356c99dc /epan/dissectors/packet-lldp.c | |
parent | 82a4968bc31b8fa85a3f45a583d8f7f71bd6737f (diff) |
lldp: show the Protocol Identity as bytes, not a text string.
Section D.2.4.3 "protocol identity" of IEEE 802.1Q-2018 says:
The protocol identity field shall contain the first n octets of the
protocol after the layer 2 addresses (i.e., for example, starting
with the EtherType field) that the sender would like to advertise.
Show it as FT_BYTES, not FT_STRINGZ.
Add a comment explaining that, and expand a comment to indicate what
specifications there are for LLDP and some Organizationally Specific
TLVs.
Change-Id: I8c41026379731d1c05134d6e7ad563227f9fbfde
Reviewed-on: https://code.wireshark.org/review/38229
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
Diffstat (limited to 'epan/dissectors/packet-lldp.c')
-rw-r--r-- | epan/dissectors/packet-lldp.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c index 25663c7240..a35e30825e 100644 --- a/epan/dissectors/packet-lldp.c +++ b/epan/dissectors/packet-lldp.c @@ -15,6 +15,12 @@ * August 2016 * Added Avaya IP Phone OUI, Uli Heilmeier <uh@heilmeier.eu> * + * IEEE 802.1AB + * + * IEEE 802.1Q for the 802.1 Organizationally Specific TLVs. + * + * TIA-1057 for TIA Organizationally Specific TLVs. + * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs @@ -2275,7 +2281,31 @@ dissect_ieee_802_1_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) if (tempByte > 0) { - proto_tree_add_item(tree, hf_ieee_802_1_proto_id, tvb, offset, tempByte, ENC_ASCII|ENC_NA); + /* + * Section D.2.4.3 "protocol identity" of IEEE + * 802.1Q-2018 says: + * + * The protocol identity field shall contain + * the first n octets of the protocol after + * the layer 2 addresses (i.e., for example, + * starting with the EtherType field) that the + * sender would like to advertise. + * + * What comes "after the layer 2 addresses" + * depends on the network type. For Ethernet, + * it's a type/length field, with, if it's a + * length field, an 802.2 LLC header, with, + * if that header specifies SNAP, a SNAP header + * following it. For other network types, it's + * just going to be an 802.2 LLC header (presumably, + * if the layer 2 addresses aren't immediately + * before the 802.2 header, this doesn't include + * the fields between the last layer 2 address + * and the 802.2 header). + * + * We currently just show it as a blob of bytes. + */ + proto_tree_add_item(tree, hf_ieee_802_1_proto_id, tvb, offset, tempByte, ENC_NA); offset += tempByte; } @@ -4944,7 +4974,7 @@ proto_register_lldp(void) NULL, 0x0, NULL, HFILL } }, { &hf_ieee_802_1_proto_id, - { "Protocol Identity", "lldp.ieee.802_1.proto.id", FT_STRINGZ, BASE_NONE, + { "Protocol Identity", "lldp.ieee.802_1.proto.id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ieee_802_1_aggregation_status, |