2012-09-24 16:20:31 +00:00
|
|
|
/* packet-foundry.c
|
|
|
|
* Routines for the disassembly of Foundry LLC messages (currently
|
|
|
|
* Foundry Discovery Protocol - FDP only)
|
|
|
|
*
|
|
|
|
* Copyright 2012 Joerg Mayer (see AUTHORS file)
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2012-09-24 16:20:31 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
2014-08-07 12:36:30 +00:00
|
|
|
#include <epan/expert.h>
|
2012-09-24 16:20:31 +00:00
|
|
|
#include <epan/strutil.h>
|
|
|
|
#include "packet-llc.h"
|
|
|
|
#include <epan/oui.h>
|
|
|
|
|
2013-12-15 23:44:12 +00:00
|
|
|
void proto_register_fdp(void);
|
|
|
|
void proto_reg_handoff_fdp(void);
|
|
|
|
|
2012-09-24 16:20:31 +00:00
|
|
|
static int hf_llc_foundry_pid = -1;
|
|
|
|
|
|
|
|
static int proto_fdp = -1;
|
|
|
|
/* FDP header */
|
|
|
|
static int hf_fdp_version = -1;
|
|
|
|
static int hf_fdp_holdtime = -1;
|
|
|
|
static int hf_fdp_checksum = -1;
|
|
|
|
/* TLV header */
|
|
|
|
static int hf_fdp_tlv_type = -1;
|
|
|
|
static int hf_fdp_tlv_length = -1;
|
|
|
|
/* Unknown element */
|
|
|
|
static int hf_fdp_unknown = -1;
|
|
|
|
static int hf_fdp_unknown_data = -1;
|
2012-09-25 01:21:19 +00:00
|
|
|
/* Port Tag element */
|
|
|
|
static int hf_fdp_tag = -1;
|
|
|
|
static int hf_fdp_tag_native = -1;
|
|
|
|
static int hf_fdp_tag_type = -1;
|
|
|
|
static int hf_fdp_tag_unknown = -1;
|
|
|
|
/* VLAN Bitmap */
|
|
|
|
static int hf_fdp_vlanmap = -1;
|
|
|
|
static int hf_fdp_vlanmap_vlan = -1;
|
2012-09-24 16:20:31 +00:00
|
|
|
/* String element */
|
|
|
|
static int hf_fdp_string = -1;
|
|
|
|
static int hf_fdp_string_data = -1;
|
|
|
|
static int hf_fdp_string_text = -1;
|
|
|
|
/* Net? element */
|
|
|
|
static int hf_fdp_net = -1;
|
|
|
|
static int hf_fdp_net_unknown = -1;
|
|
|
|
static int hf_fdp_net_ip = -1;
|
|
|
|
static int hf_fdp_net_iplength = -1;
|
|
|
|
|
|
|
|
static gint ett_fdp = -1;
|
|
|
|
static gint ett_fdp_tlv_header = -1;
|
|
|
|
static gint ett_fdp_unknown = -1;
|
|
|
|
static gint ett_fdp_string = -1;
|
|
|
|
static gint ett_fdp_net = -1;
|
2012-09-25 01:21:19 +00:00
|
|
|
static gint ett_fdp_tag = -1;
|
|
|
|
static gint ett_fdp_vlanmap = -1;
|
2012-09-24 16:20:31 +00:00
|
|
|
|
2014-08-07 12:36:30 +00:00
|
|
|
static expert_field ei_fdp_tlv_length = EI_INIT;
|
|
|
|
|
2012-09-24 16:20:31 +00:00
|
|
|
#define PROTO_SHORT_NAME "FDP"
|
|
|
|
#define PROTO_LONG_NAME "Foundry Discovery Protocol"
|
|
|
|
|
|
|
|
static const value_string foundry_pid_vals[] = {
|
|
|
|
{ 0x2000, "FDP" },
|
|
|
|
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
FDP_TYPE_NAME = 1,
|
2012-09-25 01:21:19 +00:00
|
|
|
FDP_TYPE_NET = 2,
|
2012-09-24 16:20:31 +00:00
|
|
|
FDP_TYPE_PORT = 3,
|
|
|
|
FDP_TYPE_CAPABILITIES = 4,
|
|
|
|
FDP_TYPE_VERSION = 5,
|
|
|
|
FDP_TYPE_MODEL = 6,
|
2012-09-25 01:21:19 +00:00
|
|
|
FDP_TYPE_VLANMAP = 0x0101,
|
2013-07-15 21:37:55 +00:00
|
|
|
FDP_TYPE_TAG = 0x0102
|
2012-09-24 16:20:31 +00:00
|
|
|
} fdp_type_t;
|
|
|
|
|
|
|
|
static const value_string fdp_type_vals[] = {
|
|
|
|
{ FDP_TYPE_NAME, "DeviceID"},
|
|
|
|
{ FDP_TYPE_NET, "Net?"},
|
|
|
|
{ FDP_TYPE_PORT, "Interface"},
|
|
|
|
{ FDP_TYPE_CAPABILITIES, "Capabilities"},
|
|
|
|
{ FDP_TYPE_VERSION, "Version"},
|
|
|
|
{ FDP_TYPE_MODEL, "Platform"},
|
2012-09-25 01:21:19 +00:00
|
|
|
{ FDP_TYPE_VLANMAP, "VLAN-Bitmap"},
|
|
|
|
{ FDP_TYPE_TAG, "Tagging-Info"},
|
2012-09-24 16:20:31 +00:00
|
|
|
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_tlv_header(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, int length _U_, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_tree *tlv_tree;
|
|
|
|
guint16 tlv_type;
|
|
|
|
guint16 tlv_length;
|
|
|
|
|
|
|
|
tlv_type = tvb_get_ntohs(tvb, offset);
|
|
|
|
tlv_length = tvb_get_ntohs(tvb, offset + 2);
|
|
|
|
|
2014-06-26 02:59:50 +00:00
|
|
|
tlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
|
|
|
|
ett_fdp_tlv_header, NULL, "Length %d, type %d = %s",
|
2012-09-24 16:20:31 +00:00
|
|
|
tlv_length, tlv_type,
|
|
|
|
val_to_str(tlv_type, fdp_type_vals, "Unknown (%d)"));
|
|
|
|
|
|
|
|
proto_tree_add_uint(tlv_tree, hf_fdp_tlv_type, tvb, offset, 2, tlv_type);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_uint(tlv_tree, hf_fdp_tlv_length, tvb, offset, 2, tlv_length);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_string_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, proto_tree *tree, const char* type_string)
|
|
|
|
{
|
|
|
|
proto_item *string_item;
|
|
|
|
proto_tree *string_tree;
|
2016-06-26 14:52:37 +00:00
|
|
|
const guint8 *string_value;
|
2012-09-24 16:20:31 +00:00
|
|
|
|
|
|
|
string_item = proto_tree_add_protocol_format(tree, hf_fdp_string,
|
|
|
|
tvb, offset, length, "%s", type_string);
|
|
|
|
|
|
|
|
string_tree = proto_item_add_subtree(string_item, ett_fdp_string);
|
|
|
|
|
|
|
|
dissect_tlv_header(tvb, pinfo, offset, 4, string_tree);
|
|
|
|
offset += 4;
|
|
|
|
length -= 4;
|
|
|
|
|
2016-06-26 14:52:37 +00:00
|
|
|
proto_tree_add_item(string_tree, hf_fdp_string_data, tvb, offset, length, ENC_NA);
|
2021-07-16 15:36:34 +00:00
|
|
|
proto_tree_add_item_ret_string(string_tree, hf_fdp_string_text, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &string_value);
|
2012-09-24 16:20:31 +00:00
|
|
|
proto_item_append_text(string_item, ": \"%s\"",
|
2021-07-16 15:36:34 +00:00
|
|
|
format_text(pinfo->pool, string_value, strlen(string_value)));
|
2012-09-24 16:20:31 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_net_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *net_item;
|
|
|
|
proto_tree *net_tree;
|
|
|
|
|
|
|
|
net_item = proto_tree_add_protocol_format(tree, hf_fdp_net,
|
|
|
|
tvb, offset, length, "Net?");
|
|
|
|
|
|
|
|
net_tree = proto_item_add_subtree(net_item, ett_fdp_net);
|
|
|
|
|
|
|
|
dissect_tlv_header(tvb, pinfo, offset, 4, net_tree);
|
|
|
|
offset += 4;
|
|
|
|
length -= 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(net_tree, hf_fdp_net_unknown, tvb, offset, 7, ENC_NA);
|
|
|
|
offset += 7;
|
|
|
|
length -= 7;
|
|
|
|
|
|
|
|
/* Length of IP address block in bytes */
|
|
|
|
proto_tree_add_item(net_tree, hf_fdp_net_iplength, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
|
|
|
|
while (length >= 4) {
|
|
|
|
proto_tree_add_item(net_tree, hf_fdp_net_ip, tvb, offset, 4, ENC_NA);
|
|
|
|
offset += 4;
|
|
|
|
length -= 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-25 01:21:19 +00:00
|
|
|
static void
|
|
|
|
dissect_vlanmap_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *vlanmap_item;
|
|
|
|
proto_tree *vlanmap_tree;
|
|
|
|
guint vlan, voffset;
|
|
|
|
guint bitoffset, byteoffset;
|
|
|
|
|
|
|
|
vlanmap_item = proto_tree_add_protocol_format(tree, hf_fdp_vlanmap,
|
|
|
|
tvb, offset, length, "VLAN-Map");
|
|
|
|
|
|
|
|
vlanmap_tree = proto_item_add_subtree(vlanmap_item, ett_fdp_vlanmap);
|
|
|
|
|
|
|
|
dissect_tlv_header(tvb, pinfo, offset, 4, vlanmap_tree);
|
|
|
|
offset += 4;
|
|
|
|
length -= 4;
|
|
|
|
|
|
|
|
voffset = 1;
|
|
|
|
for (vlan = 1; vlan <= (guint)length*8; vlan++) {
|
|
|
|
byteoffset = (vlan - voffset) / 8;
|
|
|
|
bitoffset = (vlan - voffset) % 8;
|
|
|
|
if (tvb_get_guint8(tvb, offset + byteoffset) & (1 << bitoffset)) {
|
|
|
|
|
|
|
|
proto_tree_add_uint(vlanmap_tree, hf_fdp_vlanmap_vlan, tvb,
|
|
|
|
offset + byteoffset, 1, vlan);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_tag_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *tag_item;
|
|
|
|
proto_tree *tag_tree;
|
|
|
|
|
|
|
|
tag_item = proto_tree_add_protocol_format(tree, hf_fdp_tag,
|
|
|
|
tvb, offset, length, "Port tag");
|
|
|
|
|
|
|
|
tag_tree = proto_item_add_subtree(tag_item, ett_fdp_tag);
|
|
|
|
|
|
|
|
dissect_tlv_header(tvb, pinfo, offset, 4, tag_tree);
|
|
|
|
offset += 4;
|
|
|
|
length -= 4;
|
|
|
|
proto_tree_add_item(tag_tree, hf_fdp_tag_native, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
proto_tree_add_item(tag_tree, hf_fdp_tag_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
length -= 2;
|
|
|
|
proto_tree_add_item(tag_tree, hf_fdp_tag_unknown, tvb, offset, length, ENC_NA);
|
|
|
|
}
|
|
|
|
|
2012-09-24 16:20:31 +00:00
|
|
|
static void
|
|
|
|
dissect_unknown_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *unknown_item;
|
|
|
|
proto_tree *unknown_tree;
|
|
|
|
guint16 tlv_type;
|
|
|
|
|
|
|
|
tlv_type = tvb_get_ntohs(tvb, offset);
|
|
|
|
|
|
|
|
unknown_item = proto_tree_add_protocol_format(tree, hf_fdp_unknown,
|
|
|
|
tvb, offset, length, "Unknown element [%u]", tlv_type);
|
|
|
|
|
|
|
|
unknown_tree = proto_item_add_subtree(unknown_item, ett_fdp_unknown);
|
|
|
|
|
|
|
|
dissect_tlv_header(tvb, pinfo, offset, 4, unknown_tree);
|
|
|
|
offset += 4;
|
|
|
|
length -= 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(unknown_tree, hf_fdp_unknown_data, tvb, offset, length, ENC_NA);
|
|
|
|
}
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_fdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2012-09-24 16:20:31 +00:00
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *fdp_tree = NULL;
|
2012-10-18 15:55:52 +00:00
|
|
|
gint offset = 0;
|
2012-09-24 16:20:31 +00:00
|
|
|
guint16 tlv_type;
|
|
|
|
guint16 tlv_length;
|
2012-10-18 15:55:52 +00:00
|
|
|
gint data_length;
|
2012-09-24 16:20:31 +00:00
|
|
|
const char *type_string;
|
|
|
|
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, PROTO_SHORT_NAME ":");
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
data_length = tvb_reported_length_remaining(tvb, offset);
|
|
|
|
|
|
|
|
ti = proto_tree_add_item(tree, proto_fdp, tvb, offset, -1, ENC_NA);
|
|
|
|
fdp_tree = proto_item_add_subtree(ti, ett_fdp);
|
|
|
|
|
2014-12-13 17:52:20 +00:00
|
|
|
proto_tree_add_item(fdp_tree, hf_fdp_version, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2012-09-24 16:20:31 +00:00
|
|
|
offset += 1;
|
2014-12-13 17:52:20 +00:00
|
|
|
proto_tree_add_item(fdp_tree, hf_fdp_holdtime, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2012-09-24 16:20:31 +00:00
|
|
|
offset += 1;
|
2016-07-11 03:47:28 +00:00
|
|
|
proto_tree_add_checksum(fdp_tree, tvb, offset, hf_fdp_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
|
2012-09-24 16:20:31 +00:00
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Decode the individual TLVs */
|
|
|
|
while (offset < data_length) {
|
|
|
|
if (data_length - offset < 4) {
|
2014-08-07 12:36:30 +00:00
|
|
|
proto_tree_add_expert_format(fdp_tree, pinfo, &ei_fdp_tlv_length, tvb, offset, 4,
|
|
|
|
"Too few bytes left for TLV: %u (< 4)", data_length - offset);
|
2012-09-24 16:20:31 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
tlv_type = tvb_get_ntohs(tvb, offset);
|
|
|
|
tlv_length = tvb_get_ntohs(tvb, offset + 2);
|
|
|
|
|
|
|
|
if ((tlv_length < 4) || (tlv_length > (data_length - offset))) {
|
2014-08-07 12:36:30 +00:00
|
|
|
proto_tree_add_expert_format(fdp_tree, pinfo, &ei_fdp_tlv_length, tvb, offset, 0,
|
2012-09-24 16:20:31 +00:00
|
|
|
"TLV with invalid length: %u", tlv_length);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
type_string = val_to_str(tlv_type, fdp_type_vals, "[%u]");
|
2013-06-14 01:02:11 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", type_string);
|
2012-09-24 16:20:31 +00:00
|
|
|
|
|
|
|
switch (tlv_type) {
|
|
|
|
case FDP_TYPE_NAME:
|
|
|
|
case FDP_TYPE_PORT:
|
|
|
|
case FDP_TYPE_CAPABILITIES:
|
|
|
|
case FDP_TYPE_VERSION:
|
|
|
|
case FDP_TYPE_MODEL:
|
|
|
|
dissect_string_tlv(tvb, pinfo, offset, tlv_length, fdp_tree, type_string);
|
|
|
|
break;
|
|
|
|
case FDP_TYPE_NET:
|
|
|
|
dissect_net_tlv(tvb, pinfo, offset, tlv_length, fdp_tree);
|
|
|
|
break;
|
2012-09-25 01:21:19 +00:00
|
|
|
case FDP_TYPE_TAG:
|
|
|
|
dissect_tag_tlv(tvb, pinfo, offset, tlv_length, fdp_tree);
|
|
|
|
break;
|
|
|
|
case FDP_TYPE_VLANMAP:
|
|
|
|
dissect_vlanmap_tlv(tvb, pinfo, offset, tlv_length, fdp_tree);
|
|
|
|
break;
|
2012-09-24 16:20:31 +00:00
|
|
|
default:
|
|
|
|
dissect_unknown_tlv(tvb, pinfo, offset, tlv_length, fdp_tree);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
offset += tlv_length;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2012-09-24 16:20:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_fdp(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
|
|
|
|
/* FDP header */
|
|
|
|
{ &hf_fdp_version,
|
|
|
|
{ "Version?", "fdp.version", FT_UINT8, BASE_DEC, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_holdtime,
|
2014-09-19 01:18:34 +00:00
|
|
|
{ "Holdtime", "fdp.holdtime", FT_UINT8, BASE_DEC, NULL,
|
2012-09-24 16:20:31 +00:00
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_checksum,
|
|
|
|
{ "Checksum?", "fdp.checksum", FT_UINT16, BASE_HEX, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
/* TLV header */
|
|
|
|
{ &hf_fdp_tlv_type,
|
|
|
|
{ "TLV type", "fdp.tlv.type", FT_UINT16, BASE_DEC, VALS(fdp_type_vals),
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_tlv_length,
|
|
|
|
{ "TLV length", "fdp.tlv.length", FT_UINT16, BASE_DEC, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
/* Unknown element */
|
|
|
|
{ &hf_fdp_unknown,
|
|
|
|
{ "Unknown", "fdp.unknown", FT_PROTOCOL, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_unknown_data,
|
|
|
|
{ "Unknown", "fdp.unknown.data", FT_BYTES, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
/* String element */
|
|
|
|
{ &hf_fdp_string,
|
|
|
|
{ "DeviceID", "fdp.deviceid", FT_PROTOCOL, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_string_data,
|
|
|
|
{ "Data", "fdp.string.data", FT_BYTES, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_string_text,
|
|
|
|
{ "Text", "fdp.string.text", FT_STRING, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
/* Net? element */
|
|
|
|
{ &hf_fdp_net,
|
|
|
|
{ "Net?", "fdp.net", FT_PROTOCOL, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_net_unknown,
|
|
|
|
{ "Net Unknown?", "fdp.net.unknown", FT_BYTES, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_net_iplength,
|
|
|
|
{ "Net IP Bytes?", "fdp.net.iplength", FT_UINT16, BASE_DEC, NULL,
|
|
|
|
0x0, "Number of bytes carrying IP addresses", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_net_ip,
|
|
|
|
{ "Net IP Address?", "fdp.net.ip", FT_IPv4, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
2012-09-25 01:21:19 +00:00
|
|
|
/* VLAN Bitmap */
|
|
|
|
{ &hf_fdp_vlanmap,
|
|
|
|
{ "VLAN Map", "fdp.vlanmap", FT_PROTOCOL, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_vlanmap_vlan,
|
|
|
|
{ "VLAN", "fdp.vlanmap.vlan", FT_UINT16, BASE_DEC, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
/* Port Tag element */
|
|
|
|
{ &hf_fdp_tag,
|
|
|
|
{ "Tag", "fdp.tag", FT_PROTOCOL, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_tag_native,
|
|
|
|
{ "Native", "fdp.tag.native", FT_UINT16, BASE_DEC, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_tag_type,
|
|
|
|
{ "Type", "fdp.tag.type", FT_UINT16, BASE_HEX, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_fdp_tag_unknown,
|
|
|
|
{ "Unknown", "fdp.tag.unknown", FT_BYTES, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL }},
|
|
|
|
|
2014-09-19 01:56:44 +00:00
|
|
|
};
|
2016-03-13 11:51:45 +00:00
|
|
|
|
|
|
|
static hf_register_info oui_hf[] = {
|
|
|
|
{ &hf_llc_foundry_pid,
|
|
|
|
{ "PID", "llc.foundry_pid", FT_UINT16, BASE_HEX,
|
|
|
|
VALS(foundry_pid_vals), 0x0, NULL, HFILL }
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-09-24 16:20:31 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_fdp,
|
|
|
|
&ett_fdp_tlv_header,
|
|
|
|
&ett_fdp_unknown,
|
|
|
|
&ett_fdp_string,
|
2012-09-25 01:21:19 +00:00
|
|
|
&ett_fdp_net,
|
|
|
|
&ett_fdp_tag,
|
|
|
|
&ett_fdp_vlanmap,
|
2012-09-24 16:20:31 +00:00
|
|
|
};
|
|
|
|
|
2014-08-07 12:36:30 +00:00
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_fdp_tlv_length, { "fdp.tlv.length.invalid", PI_MALFORMED, PI_ERROR, "Invalid length", EXPFILL }},
|
|
|
|
};
|
|
|
|
|
|
|
|
expert_module_t* expert_fdp;
|
|
|
|
|
|
|
|
proto_fdp = proto_register_protocol(PROTO_LONG_NAME, PROTO_SHORT_NAME, "fdp");
|
|
|
|
|
|
|
|
proto_register_field_array(proto_fdp, hf, array_length(hf));
|
2012-09-24 16:20:31 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2014-08-07 12:36:30 +00:00
|
|
|
expert_fdp = expert_register_protocol(proto_fdp);
|
|
|
|
expert_register_field_array(expert_fdp, ei, array_length(ei));
|
2016-03-13 11:51:45 +00:00
|
|
|
|
|
|
|
llc_add_oui(OUI_FOUNDRY, "llc.foundry_pid", "LLC Foundry OUI PID", oui_hf, proto_fdp);
|
2012-09-24 16:20:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_fdp(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t fdp_handle;
|
|
|
|
|
2015-12-09 03:49:44 +00:00
|
|
|
fdp_handle = create_dissector_handle(dissect_fdp, proto_fdp);
|
2012-09-24 16:20:31 +00:00
|
|
|
dissector_add_uint("llc.foundry_pid", 0x2000, fdp_handle);
|
|
|
|
}
|
|
|
|
|
2014-09-19 01:56:44 +00:00
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2014-09-19 01:56:44 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 8
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
|
|
* :indentSize=8:tabSize=8:noTabs=false:
|
|
|
|
*/
|