2005-09-14 19:06:54 +00:00
|
|
|
/* packet-lldp.c
|
|
|
|
* Routines for LLDP dissection
|
|
|
|
* By Juan Gonzalez <juan.gonzalez@pikatech.com>
|
|
|
|
* Copyright 2005 MITEL
|
|
|
|
*
|
|
|
|
* July 2005
|
|
|
|
* Modified by: Brian Bogora <brian_bogora@mitel.com>
|
|
|
|
*
|
2005-09-20 22:49:54 +00:00
|
|
|
* $Id$
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2005-09-14 19:06:54 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2007-03-02 23:44:54 +00:00
|
|
|
*
|
2005-09-14 19:06:54 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-03-02 23:44:54 +00:00
|
|
|
*
|
2005-09-14 19:06:54 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2007-03-02 23:44:54 +00:00
|
|
|
*
|
2005-09-14 19:06:54 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 23:18:38 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2005-09-14 19:06:54 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
2005-09-15 08:57:51 +00:00
|
|
|
#include <epan/emem.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/etypes.h>
|
|
|
|
#include <epan/oui.h>
|
2006-01-28 23:18:19 +00:00
|
|
|
#include <epan/afn.h>
|
2012-04-13 22:26:35 +00:00
|
|
|
#include <epan/addr_resolv.h>
|
2012-02-28 08:04:24 +00:00
|
|
|
#include "packet-lldp.h"
|
2005-09-14 19:06:54 +00:00
|
|
|
|
2012-04-13 22:26:35 +00:00
|
|
|
/* Sub Dissector Tables */
|
2012-04-13 22:29:11 +00:00
|
|
|
static dissector_table_t oui_unique_code_table;
|
2012-04-13 22:26:35 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_lldp = -1;
|
|
|
|
static int hf_lldp_tlv_type = -1;
|
|
|
|
static int hf_lldp_tlv_len = -1;
|
|
|
|
static int hf_chassis_id_subtype = -1;
|
|
|
|
static int hf_chassis_id = -1;
|
|
|
|
static int hf_chassis_id_mac = -1;
|
|
|
|
static int hf_chassis_id_ip4 = -1;
|
|
|
|
static int hf_chassis_id_ip6 = -1;
|
|
|
|
static int hf_port_id_subtype = -1;
|
|
|
|
static int hf_port_id_mac = -1;
|
2006-01-23 22:13:08 +00:00
|
|
|
static int hf_lldp_network_address_family = -1;
|
2005-09-14 19:06:54 +00:00
|
|
|
static int hf_port_id_ip4 = -1;
|
|
|
|
static int hf_port_id_ip6 = -1;
|
|
|
|
static int hf_time_to_live = -1;
|
|
|
|
static int hf_mgn_addr_ipv4 = -1;
|
2005-09-15 04:08:53 +00:00
|
|
|
static int hf_mgn_addr_ipv6 = -1;
|
2005-09-14 19:06:54 +00:00
|
|
|
static int hf_mgn_addr_hex = -1;
|
|
|
|
static int hf_mgn_obj_id = -1;
|
|
|
|
static int hf_org_spc_oui = -1;
|
|
|
|
static int hf_ieee_802_1_subtype = -1;
|
|
|
|
static int hf_ieee_802_3_subtype = -1;
|
2011-05-07 14:50:36 +00:00
|
|
|
static int hf_ieee_802_1qbg_subtype = -1;
|
2005-09-14 19:06:54 +00:00
|
|
|
static int hf_media_tlv_subtype = -1;
|
2005-11-12 10:09:02 +00:00
|
|
|
static int hf_profinet_tlv_subtype = -1;
|
|
|
|
static int hf_profinet_class2_port_status = -1;
|
|
|
|
static int hf_profinet_class3_port_status = -1;
|
|
|
|
static int hf_profinet_port_rx_delay_local = -1;
|
|
|
|
static int hf_profinet_port_rx_delay_remote = -1;
|
|
|
|
static int hf_profinet_port_tx_delay_local = -1;
|
|
|
|
static int hf_profinet_port_tx_delay_remote = -1;
|
|
|
|
static int hf_profinet_cable_delay_local = -1;
|
2006-11-11 01:29:43 +00:00
|
|
|
static int hf_profinet_mrp_domain_uuid = -1;
|
|
|
|
static int hf_profinet_mrrt_port_status = -1;
|
2006-06-22 19:19:41 +00:00
|
|
|
static int hf_profinet_cm_mac = -1;
|
2006-11-17 22:38:34 +00:00
|
|
|
static int hf_profinet_master_source_address = -1;
|
|
|
|
static int hf_profinet_subdomain_uuid = -1;
|
|
|
|
static int hf_profinet_ir_data_uuid = -1;
|
2007-01-10 21:46:50 +00:00
|
|
|
static int hf_profinet_length_of_period_valid = -1;
|
|
|
|
static int hf_profinet_length_of_period_length = -1;
|
|
|
|
static int hf_profinet_red_period_begin_valid = -1;
|
|
|
|
static int hf_profinet_red_period_begin_offset = -1;
|
|
|
|
static int hf_profinet_orange_period_begin_valid = -1;
|
|
|
|
static int hf_profinet_orange_period_begin_offset = -1;
|
|
|
|
static int hf_profinet_green_period_begin_valid = -1;
|
|
|
|
static int hf_profinet_green_period_begin_offset = -1;
|
2011-01-16 21:32:39 +00:00
|
|
|
static int hf_cisco_subtype = -1;
|
2005-11-12 10:09:02 +00:00
|
|
|
static int hf_unknown_subtype = -1;
|
2012-04-13 22:26:35 +00:00
|
|
|
static int hf_unknown_subtype_content = -1;
|
2005-09-14 19:06:54 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
static gint ett_lldp = -1;
|
|
|
|
static gint ett_chassis_id = -1;
|
|
|
|
static gint ett_port_id = -1;
|
|
|
|
static gint ett_time_to_live = -1;
|
|
|
|
static gint ett_end_of_lldpdu = -1;
|
|
|
|
static gint ett_port_description = -1;
|
|
|
|
static gint ett_system_name = -1;
|
|
|
|
static gint ett_system_cap = -1;
|
|
|
|
static gint ett_system_cap_summary = -1;
|
|
|
|
static gint ett_system_cap_enabled = -1;
|
|
|
|
static gint ett_management_address = -1;
|
|
|
|
static gint ett_unknown_tlv = -1;
|
|
|
|
static gint ett_org_spc_tlv = -1;
|
|
|
|
static gint ett_port_vlan_flags = -1;
|
|
|
|
static gint ett_802_3_flags = -1;
|
2005-09-19 21:24:07 +00:00
|
|
|
static gint ett_802_3_autoneg_advertised = -1;
|
2005-09-14 19:06:54 +00:00
|
|
|
static gint ett_802_3_power = -1;
|
|
|
|
static gint ett_802_3_aggregation = -1;
|
2011-05-07 14:50:36 +00:00
|
|
|
static gint ett_802_1qbg_capabilities_flags = -1;
|
2005-09-14 19:06:54 +00:00
|
|
|
static gint ett_media_capabilities = -1;
|
2007-01-10 21:46:50 +00:00
|
|
|
static gint ett_profinet_period = -1;
|
2011-01-16 21:32:39 +00:00
|
|
|
static gint ett_cisco_fourwire_tlv = -1;
|
2005-09-14 19:06:54 +00:00
|
|
|
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string tlv_types[] = {
|
2006-01-23 22:13:08 +00:00
|
|
|
{ END_OF_LLDPDU_TLV_TYPE, "End of LLDPDU"},
|
|
|
|
{ CHASSIS_ID_TLV_TYPE, "Chassis Id"},
|
|
|
|
{ PORT_ID_TLV_TYPE, "Port Id"},
|
|
|
|
{ TIME_TO_LIVE_TLV_TYPE, "Time to Live"},
|
2005-09-15 04:08:53 +00:00
|
|
|
{ PORT_DESCRIPTION_TLV_TYPE, "Port Description"},
|
2006-01-23 22:13:08 +00:00
|
|
|
{ SYSTEM_NAME_TLV_TYPE, "System Name"},
|
2005-09-15 04:08:53 +00:00
|
|
|
{ SYSTEM_DESCRIPTION_TLV_TYPE, "System Description"},
|
|
|
|
{ SYSTEM_CAPABILITIES_TLV_TYPE, "System Capabilities"},
|
2006-01-23 22:13:08 +00:00
|
|
|
{ MANAGEMENT_ADDR_TLV_TYPE, "Management Address"},
|
2005-09-15 04:08:53 +00:00
|
|
|
{ ORGANIZATION_SPECIFIC_TLV_TYPE, "Organization Specific"},
|
2007-03-02 23:44:54 +00:00
|
|
|
{ 0, NULL}
|
2005-09-14 19:06:54 +00:00
|
|
|
};
|
|
|
|
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string chassis_id_subtypes[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "Reserved"},
|
|
|
|
{ 1, "Chassis component"},
|
|
|
|
{ 2, "Interface alias"},
|
|
|
|
{ 3, "Port component"},
|
|
|
|
{ 4, "MAC address"},
|
|
|
|
{ 5, "Network address"},
|
|
|
|
{ 6, "Interface name"},
|
|
|
|
{ 7, "Locally assigned"},
|
2007-03-02 23:44:54 +00:00
|
|
|
{ 0, NULL}
|
2005-09-14 19:06:54 +00:00
|
|
|
};
|
|
|
|
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string port_id_subtypes[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "Reserved"},
|
|
|
|
{ 1, "Interface alias"},
|
|
|
|
{ 2, "Port component"},
|
|
|
|
{ 3, "MAC address"},
|
|
|
|
{ 4, "Network address"},
|
|
|
|
{ 5, "Interface name"},
|
|
|
|
{ 6, "Agent circuit Id"},
|
|
|
|
{ 7, "Locally assigned"},
|
2007-03-02 23:44:54 +00:00
|
|
|
{ 0, NULL}
|
2005-09-14 19:06:54 +00:00
|
|
|
};
|
|
|
|
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string interface_subtype_values[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 1, "Unknown"},
|
|
|
|
{ 2, "ifIndex"},
|
|
|
|
{ 3, "System port number"},
|
2007-03-02 23:44:54 +00:00
|
|
|
{ 0, NULL}
|
2005-09-14 19:06:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* IEEE 802.1 Subtypes */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string ieee_802_1_subtypes[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0x01, "Port VLAN ID" },
|
|
|
|
{ 0x02, "Port and Protocol VLAN ID" },
|
|
|
|
{ 0x03, "VLAN Name" },
|
|
|
|
{ 0x04, "Protocol Identity" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* IEEE 802.3 Subtypes */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string ieee_802_3_subtypes[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0x01, "MAC/PHY Configuration/Status" },
|
|
|
|
{ 0x02, "Power Via MDI" },
|
2005-09-16 07:50:02 +00:00
|
|
|
{ 0x03, "Link Aggregation" },
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0x04, "Maximum Frame Size" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Media Subtypes */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string media_subtypes[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 1, "Media Capabilities" },
|
|
|
|
{ 2, "Network Policy" },
|
|
|
|
{ 3, "Location Identification" },
|
|
|
|
{ 4, "Extended Power-via-MDI" },
|
|
|
|
{ 5, "Inventory - Hardware Revision" },
|
|
|
|
{ 6, "Inventory - Firmware Revision" },
|
|
|
|
{ 7, "Inventory - Software Revision" },
|
|
|
|
{ 8, "Inventory - Serial Number" },
|
|
|
|
{ 9, "Inventory - Manufacturer Name" },
|
|
|
|
{ 10, "Inventory - Model Name" },
|
|
|
|
{ 11, "Inventory - Asset ID" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Media Class Values */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string media_class_values[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "Type Not Defined" },
|
|
|
|
{ 1, "Endpoint Class I" },
|
|
|
|
{ 2, "Endpoint Class II" },
|
|
|
|
{ 3, "Endpoint Class III" },
|
|
|
|
{ 4, "Network Connectivity" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Media Application Types */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string media_application_type[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "Reserved" },
|
|
|
|
{ 1, "Voice" },
|
|
|
|
{ 2, "Voice Signaling" },
|
|
|
|
{ 3, "Guest Voice" },
|
|
|
|
{ 4, "Guest Voice Signaling" },
|
|
|
|
{ 5, "Softphone Voice" },
|
|
|
|
{ 6, "Video Conferencing" },
|
|
|
|
{ 7, "Streaming Video" },
|
|
|
|
{ 8, "Video Signaling" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2005-11-12 10:09:02 +00:00
|
|
|
/* PROFINET subtypes */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string profinet_subtypes[] = {
|
2005-11-12 10:09:02 +00:00
|
|
|
{ 1, "Measured Delay Values" },
|
|
|
|
{ 2, "Port Status" },
|
|
|
|
{ 3, "Alias" },
|
2006-06-22 19:19:41 +00:00
|
|
|
{ 4, "MRP Port Status" },
|
|
|
|
{ 5, "Chassis MAC" },
|
2006-11-17 22:38:34 +00:00
|
|
|
{ 6, "PTCP Status" },
|
2005-11-12 10:09:02 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2011-01-16 21:32:39 +00:00
|
|
|
/* Cisco Subtypes */
|
|
|
|
static const value_string cisco_subtypes[] = {
|
|
|
|
{ 1, "Four-wire Power-via-MDI" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2009-10-22 07:10:05 +00:00
|
|
|
/* 802.3 Power Type */
|
|
|
|
static const value_string power_type_802_3[] = {
|
|
|
|
{ 0, "Type 2" },
|
|
|
|
{ 1, "Type 2" },
|
|
|
|
{ 2, "Type 1" },
|
|
|
|
{ 3, "Type 1" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Power Type */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string media_power_type[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "PSE Device" },
|
|
|
|
{ 1, "PD Device" },
|
2009-10-22 07:10:05 +00:00
|
|
|
{ 2, "PSE Device" },
|
|
|
|
{ 3, "PD Device" },
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Power Priority */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string media_power_priority[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "Unknown" },
|
|
|
|
{ 1, "Critical" },
|
|
|
|
{ 2, "High" },
|
|
|
|
{ 3, "Low" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Power Sources */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string media_power_pd_device[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "Unknown" },
|
|
|
|
{ 1, "PSE" },
|
|
|
|
{ 2, "Local" },
|
|
|
|
{ 3, "PSE and Local" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string media_power_pse_device[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "Unknown" },
|
|
|
|
{ 1, "Primary Power Source" },
|
|
|
|
{ 2, "Backup Power Source" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Location data format */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string location_data_format[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "Invalid " },
|
|
|
|
{ 1, "Coordinate-based LCI" },
|
|
|
|
{ 2, "Civic Address LCI" },
|
|
|
|
{ 3, "ECS ELIN" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Civic Address LCI - What field */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string civic_address_what_values[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "Location of the DHCP server" },
|
|
|
|
{ 1, "Location of the network element believed to be closest to the client" },
|
|
|
|
{ 2, "Location of the client"},
|
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Civic Address Type field */
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string civic_address_type_values[] = {
|
2005-09-14 19:06:54 +00:00
|
|
|
{ 0, "Language" },
|
|
|
|
{ 1, "National subdivisions (province, state, etc)" },
|
|
|
|
{ 2, "County, parish, district" },
|
|
|
|
{ 3, "City, township" },
|
|
|
|
{ 4, "City division, borough, ward" },
|
|
|
|
{ 5, "Neighborhood, block" },
|
|
|
|
{ 6, "Street" },
|
|
|
|
{ 16, "Leading street direction" },
|
|
|
|
{ 17, "Trailing street suffix" },
|
|
|
|
{ 18, "Street suffix" },
|
|
|
|
{ 19, "House number" },
|
|
|
|
{ 20, "House number suffix" },
|
|
|
|
{ 21, "Landmark or vanity address" },
|
|
|
|
{ 22, "Additional location information" },
|
|
|
|
{ 23, "Name" },
|
|
|
|
{ 24, "Postal/ZIP code" },
|
|
|
|
{ 25, "Building" },
|
|
|
|
{ 26, "Unit" },
|
|
|
|
{ 27, "Floor" },
|
|
|
|
{ 28, "Room number" },
|
|
|
|
{ 29, "Place type" },
|
|
|
|
{ 128, "Script" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-03-02 23:44:54 +00:00
|
|
|
/*
|
|
|
|
* Define the text strings for the LLDP 802.3 MAC/PHY Configuration/Status
|
2005-09-19 21:24:07 +00:00
|
|
|
* Operational MAU Type field.
|
2007-03-02 23:44:54 +00:00
|
|
|
*
|
|
|
|
* These values are taken from the DESCRIPTION field of the dot3MauType
|
2005-09-19 21:24:07 +00:00
|
|
|
* objects defined in RFC 3636 (or subsequent revisions).
|
|
|
|
*/
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2006-03-24 07:10:22 +00:00
|
|
|
static const value_string operational_mau_type_values[] = {
|
2005-09-19 21:24:07 +00:00
|
|
|
{ 1, "AUI - no internal MAU, view from AUI" },
|
|
|
|
{ 2, "10Base5 - thick coax MAU" },
|
|
|
|
{ 3, "Foirl - FOIRL MAU" },
|
|
|
|
{ 4, "10Base2 - thin coax MAU" },
|
|
|
|
{ 5, "10BaseT - UTP MAU" },
|
|
|
|
{ 6, "10BaseFP - passive fiber MAU" },
|
|
|
|
{ 7, "10BaseFB - sync fiber MAU" },
|
|
|
|
{ 8, "10BaseFL - async fiber MAU" },
|
|
|
|
{ 9, "10Broad36 - broadband DTE MAU" },
|
|
|
|
{ 10, "10BaseTHD - UTP MAU, half duplex mode" },
|
|
|
|
{ 11, "10BaseTFD - UTP MAU, full duplex mode" },
|
|
|
|
{ 12, "10BaseFLHD - async fiber MAU, half duplex mode" },
|
|
|
|
{ 13, "10BaseFLDF - async fiber MAU, full duplex mode" },
|
|
|
|
{ 14, "10BaseT4 - 4 pair category 3 UTP" },
|
|
|
|
{ 15, "100BaseTXHD - 2 pair category 5 UTP, half duplex mode" },
|
|
|
|
{ 16, "100BaseTXFD - 2 pair category 5 UTP, full duplex mode" },
|
|
|
|
{ 17, "100BaseFXHD - X fiber over PMT, half duplex mode" },
|
|
|
|
{ 18, "100BaseFXFD - X fiber over PMT, full duplex mode" },
|
|
|
|
{ 19, "100BaseT2HD - 2 pair category 3 UTP, half duplex mode" },
|
|
|
|
{ 20, "100BaseT2DF - 2 pair category 3 UTP, full duplex mode" },
|
|
|
|
{ 21, "1000BaseXHD - PCS/PMA, unknown PMD, half duplex mode" },
|
|
|
|
{ 22, "1000BaseXFD - PCS/PMA, unknown PMD, full duplex mode" },
|
|
|
|
{ 23, "1000BaseLXHD - Fiber over long-wavelength laser, half duplex mode" },
|
|
|
|
{ 24, "1000BaseLXFD - Fiber over long-wavelength laser, full duplex mode" },
|
|
|
|
{ 25, "1000BaseSXHD - Fiber over short-wavelength laser, half duplex mode" },
|
|
|
|
{ 26, "1000BaseSXFD - Fiber over short-wavelength laser, full duplex mode" },
|
|
|
|
{ 27, "1000BaseCXHD - Copper over 150-Ohm balanced cable, half duplex mode" },
|
|
|
|
{ 28, "1000BaseCXFD - Copper over 150-Ohm balanced cable, full duplex mode" },
|
|
|
|
{ 29, "1000BaseTHD - Four-pair Category 5 UTP, half duplex mode" },
|
|
|
|
{ 30, "1000BaseTFD - Four-pair Category 5 UTP, full duplex mode" },
|
|
|
|
{ 31, "10GigBaseX - X PCS/PMA, unknown PMD." },
|
|
|
|
{ 32, "10GigBaseLX4 - X fiber over WWDM optics" },
|
|
|
|
{ 33, "10GigBaseR - R PCS/PMA, unknown PMD." },
|
|
|
|
{ 34, "10GigBaseER - R fiber over 1550 nm optics" },
|
|
|
|
{ 35, "10GigBaseLR - R fiber over 1310 nm optics" },
|
|
|
|
{ 36, "10GigBaseSR - R fiber over 850 nm optics" },
|
|
|
|
{ 37, "10GigBaseW - W PCS/PMA, unknown PMD." },
|
|
|
|
{ 38, "10GigBaseEW - W fiber over 1550 nm optics" },
|
|
|
|
{ 39, "10GigBaseLW - W fiber over 1310 nm optics" },
|
|
|
|
{ 40, "10GigBaseSW - W fiber over 850 nm optics" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* System Capabilities */
|
|
|
|
#define SYSTEM_CAPABILITY_OTHER 0x0001
|
|
|
|
#define SYSTEM_CAPABILITY_REPEATER 0x0002
|
|
|
|
#define SYSTEM_CAPABILITY_BRIDGE 0x0004
|
|
|
|
#define SYSTEM_CAPABILITY_WLAN 0x0008
|
|
|
|
#define SYSTEM_CAPABILITY_ROUTER 0x0010
|
|
|
|
#define SYSTEM_CAPABILITY_TELEPHONE 0x0020
|
|
|
|
#define SYSTEM_CAPABILITY_DOCSIS 0x0040
|
|
|
|
#define SYSTEM_CAPABILITY_STATION 0x0080
|
|
|
|
|
|
|
|
/* Media Capabilities */
|
|
|
|
#define MEDIA_CAPABILITY_LLDP 0x0001
|
|
|
|
#define MEDIA_CAPABILITY_NETWORK_POLICY 0x0002
|
|
|
|
#define MEDIA_CAPABILITY_LOCATION_ID 0x0004
|
|
|
|
#define MEDIA_CAPABILITY_MDI_PSE 0x0008
|
|
|
|
#define MEDIA_CAPABILITY_MDI_PD 0x0010
|
|
|
|
#define MEDIA_CAPABILITY_INVENTORY 0x0020
|
|
|
|
|
2005-09-19 21:24:07 +00:00
|
|
|
/*
|
2007-03-02 23:44:54 +00:00
|
|
|
* Define constants for the LLDP 802.3 MAC/PHY Configuration/Status
|
|
|
|
* PMD Auto-Negotiation Advertised Capability field.
|
|
|
|
* These values are taken from the ifMauAutoNegCapAdvertisedBits
|
2005-09-19 21:24:07 +00:00
|
|
|
* object defined in RFC 3636.
|
|
|
|
*/
|
|
|
|
|
2006-03-24 07:10:22 +00:00
|
|
|
#define AUTONEG_OTHER 0x8000 /* bOther(0), -- other or unknown */
|
|
|
|
#define AUTONEG_10BASE_T 0x4000 /* b10baseT(1), -- 10BASE-T half duplex mode */
|
|
|
|
#define AUTONEG_10BASET_FD 0x2000 /* b10baseTFD(2), -- 10BASE-T full duplex mode */
|
|
|
|
#define AUTONEG_100BASE_T4 0x1000 /* b100baseT4(3), -- 100BASE-T4 */
|
|
|
|
#define AUTONEG_100BASE_TX 0x0800 /* b100baseTX(4), -- 100BASE-TX half duplex mode */
|
2005-09-19 21:24:07 +00:00
|
|
|
#define AUTONEG_100BASE_TXFD 0x0400 /* b100baseTXFD(5), -- 100BASE-TX full duplex mode */
|
2006-03-24 07:10:22 +00:00
|
|
|
#define AUTONEG_100BASE_T2 0x0200 /* b100baseT2(6), -- 100BASE-T2 half duplex mode */
|
2005-09-19 21:24:07 +00:00
|
|
|
#define AUTONEG_100BASE_T2FD 0x0100 /* b100baseT2FD(7), -- 100BASE-T2 full duplex mode */
|
2006-03-24 07:10:22 +00:00
|
|
|
#define AUTONEG_FDX_PAUSE 0x0080 /* bFdxPause(8), -- PAUSE for full-duplex links */
|
|
|
|
#define AUTONEG_FDX_APAUSE 0x0040 /* bFdxAPause(9), -- Asymmetric PAUSE for full-duplex links */
|
|
|
|
#define AUTONEG_FDX_SPAUSE 0x0020 /* bFdxSPause(10), -- Symmetric PAUSE for full-duplex links */
|
|
|
|
#define AUTONEG_FDX_BPAUSE 0x0010 /* bFdxBPause(11), -- Asymmetric and Symmetric PAUSE for full-duplex links */
|
|
|
|
#define AUTONEG_1000BASE_X 0x0008 /* b1000baseX(12), -- 1000BASE-X, -LX, -SX, -CX half duplex mode */
|
2005-09-19 21:24:07 +00:00
|
|
|
#define AUTONEG_1000BASE_XFD 0x0004 /* b1000baseXFD(13), -- 1000BASE-X, -LX, -SX, -CX full duplex mode */
|
2006-03-24 07:10:22 +00:00
|
|
|
#define AUTONEG_1000BASE_T 0x0002 /* b1000baseT(14), -- 1000BASE-T half duplex mode */
|
2005-09-19 21:24:07 +00:00
|
|
|
#define AUTONEG_1000BASE_TFD 0x0001 /* b1000baseTFD(15) -- 1000BASE-T full duplex mode */
|
|
|
|
|
2009-06-09 22:09:23 +00:00
|
|
|
/* Some vendors interpreted the standard to invert the bitorder:
|
|
|
|
* according to a IEEE ruling, this is now officially wrong.
|
|
|
|
* See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1455
|
|
|
|
* for all the gory details
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define INV_AUTONEG_OTHER 0x0001 /* bOther(0), -- other or unknown */
|
|
|
|
#define INV_AUTONEG_10BASE_T 0x0002 /* b10baseT(1), -- 10BASE-T half duplex mode */
|
|
|
|
#define INV_AUTONEG_10BASET_FD 0x0004 /* b10baseTFD(2), -- 10BASE-T full duplex mode */
|
|
|
|
#define INV_AUTONEG_100BASE_T4 0x0008 /* b100baseT4(3), -- 100BASE-T4 */
|
|
|
|
#define INV_AUTONEG_100BASE_TX 0x0010 /* b100baseTX(4), -- 100BASE-TX half duplex mode */
|
|
|
|
#define INV_AUTONEG_100BASE_TXFD 0x0020 /* b100baseTXFD(5), -- 100BASE-TX full duplex mode */
|
|
|
|
#define INV_AUTONEG_100BASE_T2 0x0040 /* b100baseT2(6), -- 100BASE-T2 half duplex mode */
|
|
|
|
#define INV_AUTONEG_100BASE_T2FD 0x0080 /* b100baseT2FD(7), -- 100BASE-T2 full duplex mode */
|
|
|
|
#define INV_AUTONEG_FDX_PAUSE 0x0100 /* bFdxPause(8), -- PAUSE for full-duplex links */
|
|
|
|
#define INV_AUTONEG_FDX_APAUSE 0x0200 /* bFdxAPause(9), -- Asymmetric PAUSE for full-duplex links */
|
|
|
|
#define INV_AUTONEG_FDX_SPAUSE 0x0400 /* bFdxSPause(10), -- Symmetric PAUSE for full-duplex links */
|
|
|
|
#define INV_AUTONEG_FDX_BPAUSE 0x0800 /* bFdxBPause(11), -- Asymmetric and Symmetric PAUSE for full-duplex links */
|
|
|
|
#define INV_AUTONEG_1000BASE_X 0x1000 /* b1000baseX(12), -- 1000BASE-X, -LX, -SX, -CX half duplex mode */
|
|
|
|
#define INV_AUTONEG_1000BASE_XFD 0x2000 /* b1000baseXFD(13), -- 1000BASE-X, -LX, -SX, -CX full duplex mode */
|
|
|
|
#define INV_AUTONEG_1000BASE_T 0x4000 /* b1000baseT(14), -- 1000BASE-T half duplex mode */
|
|
|
|
#define INV_AUTONEG_1000BASE_TFD 0x8000 /* b1000baseTFD(15) -- 1000BASE-T full duplex mode */
|
|
|
|
|
2011-05-07 14:50:36 +00:00
|
|
|
#define EVB_CAPA_STD 0x8000
|
|
|
|
#define EVB_CAPA_RR 0x4000
|
|
|
|
|
|
|
|
#define EVB_CAPA_RTE 0x0004
|
|
|
|
#define EVB_CAPA_ECP 0x0002
|
|
|
|
#define EVB_CAPA_VDP 0x0001
|
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
#define MAX_MAC_LEN 6
|
|
|
|
|
2005-11-12 10:09:02 +00:00
|
|
|
|
2010-10-10 23:28:40 +00:00
|
|
|
static const value_string profinet_port2_status_vals[] = {
|
2006-06-21 07:30:11 +00:00
|
|
|
{ 0, "OFF" },
|
|
|
|
{ 1, "SYNCDATA_LOADED" },
|
|
|
|
{ 2, "RTCLASS2_UP" },
|
2005-11-12 10:09:02 +00:00
|
|
|
{ 3, "Reserved" },
|
|
|
|
/* all other bits reserved */
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2010-10-10 23:28:40 +00:00
|
|
|
static const value_string profinet_port3_status_vals[] = {
|
2006-06-21 07:30:11 +00:00
|
|
|
{ 0, "OFF" },
|
|
|
|
{ 1, "IRDATA_LOADED" },
|
|
|
|
{ 2, "RTCLASS3_UP" },
|
|
|
|
{ 3, "RTCLASS3_DOWN" },
|
|
|
|
{ 4, "RTCLASS3_RUN" },
|
|
|
|
/* all other bits reserved */
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2010-10-10 23:28:40 +00:00
|
|
|
static const value_string profinet_mrrt_port_status_vals[] = {
|
2006-11-11 01:29:43 +00:00
|
|
|
{ 0, "OFF" },
|
|
|
|
{ 1, "MRRT_CONFIGURED" },
|
|
|
|
{ 2, "MRRT_UP" },
|
|
|
|
/* all other bits reserved */
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Calculate Latitude and Longitude string */
|
|
|
|
/*
|
|
|
|
Parameters:
|
|
|
|
option = 0 -> Latitude
|
|
|
|
option = 1 -> Longitude
|
|
|
|
*/
|
2005-09-15 08:57:51 +00:00
|
|
|
static gchar *
|
|
|
|
get_latitude_or_longitude(int option, guint64 value)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
guint64 tempValue = value;
|
2005-09-15 08:57:51 +00:00
|
|
|
gboolean negativeNum = FALSE;
|
2005-09-14 19:06:54 +00:00
|
|
|
guint32 integerPortion = 0;
|
2005-09-15 08:57:51 +00:00
|
|
|
const char *direction;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* The latitude and longitude are 34 bit fixed point value consisting
|
2007-03-02 23:44:54 +00:00
|
|
|
of 9 bits of integer and 25 bits of fraction.
|
2005-09-14 19:06:54 +00:00
|
|
|
When option is equal to 0, positive numbers are represent a location
|
|
|
|
north of the equator and negative (2s complement) numbers are south of the equator.
|
2007-03-02 23:44:54 +00:00
|
|
|
When option is equal to 1, positive values are east of the prime
|
2005-09-14 19:06:54 +00:00
|
|
|
meridian and negative (2s complement) numbers are west of the prime meridian.
|
|
|
|
*/
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 03:09:40 +00:00
|
|
|
if (value & G_GINT64_CONSTANT(0x0000000200000000))
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
/* Have a negative number (2s complement) */
|
2005-09-15 08:57:51 +00:00
|
|
|
negativeNum = TRUE;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempValue = ~value;
|
|
|
|
tempValue += 1;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get the integer portion */
|
2005-09-15 03:09:40 +00:00
|
|
|
integerPortion = (guint32)((tempValue & G_GINT64_CONSTANT(0x00000003FE000000)) >> 25);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Calculate decimal portion (using 25 bits for fraction) */
|
2005-09-15 03:09:40 +00:00
|
|
|
tempValue = (tempValue & G_GINT64_CONSTANT(0x0000000001FFFFFF))/33554432;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
if (option == 0)
|
|
|
|
{
|
|
|
|
/* Latitude - north/south directions */
|
2005-09-15 08:57:51 +00:00
|
|
|
if (negativeNum)
|
|
|
|
direction = "South";
|
2005-09-14 19:06:54 +00:00
|
|
|
else
|
2005-09-15 08:57:51 +00:00
|
|
|
direction = "North";
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Longitude - east/west directions */
|
2005-09-15 08:57:51 +00:00
|
|
|
if (negativeNum)
|
|
|
|
direction = "West";
|
2005-09-14 19:06:54 +00:00
|
|
|
else
|
2005-09-15 08:57:51 +00:00
|
|
|
direction = "East";
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2007-05-29 18:52:42 +00:00
|
|
|
return ep_strdup_printf("%u.%04" G_GINT64_MODIFIER "u degrees %s",
|
2005-09-15 08:57:51 +00:00
|
|
|
integerPortion, tempValue, direction);
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect Chassis Id TLV (Mandatory) */
|
|
|
|
static gint32
|
|
|
|
dissect_lldp_chassis_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset)
|
|
|
|
{
|
|
|
|
guint8 tempType;
|
|
|
|
guint16 tempShort;
|
|
|
|
guint32 tempLen = 0;
|
2005-09-23 10:39:58 +00:00
|
|
|
const char *strPtr=NULL;
|
2005-09-14 19:06:54 +00:00
|
|
|
guint8 incorrectLen = 0; /* incorrect length if 1 */
|
2009-10-05 16:52:59 +00:00
|
|
|
guint32 ip_addr = 0;
|
2005-09-15 04:08:53 +00:00
|
|
|
struct e_in6_addr ip6_addr;
|
2006-01-28 23:27:17 +00:00
|
|
|
guint8 addr_family = 0;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *chassis_tree = NULL;
|
|
|
|
proto_item *tf = NULL;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get tlv type */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, offset);
|
|
|
|
tempType = TLV_TYPE(tempShort);
|
|
|
|
if (tempType != CHASSIS_ID_TLV_TYPE)
|
|
|
|
{
|
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, 2, "Invalid Chassis ID (0x%02X)", tempType);
|
|
|
|
chassis_tree = proto_item_add_subtree(tf, ett_chassis_id);
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(chassis_tree, tvb, offset, 2, "%s Invalid Chassis ID (%u)",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempType, TLV_TYPE_MASK, 16, "", ""), tempType);
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv length */
|
|
|
|
tempLen = TLV_INFO_LEN(tempShort);
|
|
|
|
if (tempLen < 2)
|
|
|
|
{
|
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, 2, "Invalid Chassis ID Length (%u)", tempLen);
|
|
|
|
chassis_tree = proto_item_add_subtree(tf, ett_chassis_id);
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(chassis_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(chassis_tree, tvb, offset, 2, "%s Invalid Length: %u",
|
2005-09-15 05:22:20 +00:00
|
|
|
decode_boolean_bitfield(tempLen, TLV_INFO_LEN_MASK, 16, "", ""), tempLen);
|
2005-09-15 04:08:53 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv subtype */
|
|
|
|
tempType = tvb_get_guint8(tvb, (offset+2));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
switch (tempType)
|
|
|
|
{
|
|
|
|
case 4: /* MAC address */
|
|
|
|
{
|
|
|
|
if (tempLen != 7)
|
|
|
|
{
|
|
|
|
incorrectLen = 1; /* Invalid length */
|
|
|
|
break;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-03-03 03:09:21 +00:00
|
|
|
strPtr = tvb_ether_to_str(tvb, offset+3);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 5: /* Network address */
|
|
|
|
{
|
2006-01-23 22:13:08 +00:00
|
|
|
/* Get network address family */
|
|
|
|
addr_family = tvb_get_guint8(tvb,offset+3);
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Check for IPv4 or IPv6 */
|
2006-01-23 22:13:08 +00:00
|
|
|
switch(addr_family){
|
2006-01-28 23:18:19 +00:00
|
|
|
case AFNUM_INET:
|
2006-01-23 22:13:08 +00:00
|
|
|
if (tempLen == 6){
|
|
|
|
ip_addr = tvb_get_ipv4(tvb, (offset+4));
|
|
|
|
strPtr = ip_to_str((guint8 *)&ip_addr);
|
|
|
|
}else{
|
|
|
|
incorrectLen = 1; /* Invalid length */
|
|
|
|
}
|
|
|
|
break;
|
2006-01-28 23:18:19 +00:00
|
|
|
case AFNUM_INET6:
|
2006-01-23 22:13:08 +00:00
|
|
|
if (tempLen == 18){
|
|
|
|
tvb_get_ipv6(tvb, (offset+4), &ip6_addr);
|
|
|
|
strPtr = ip6_to_str(&ip6_addr);
|
|
|
|
}else{
|
|
|
|
incorrectLen = 1; /* Invalid length */
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
strPtr = tvb_bytes_to_str(tvb, (offset+4), (tempLen-2));
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2: /* Interface alias */
|
|
|
|
case 6: /* Interface name */
|
|
|
|
case 7: /* Locally assigned */
|
|
|
|
{
|
|
|
|
if (tempLen > 256)
|
|
|
|
{
|
|
|
|
incorrectLen = 1; /* Invalid length */
|
|
|
|
break;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 05:22:20 +00:00
|
|
|
strPtr = tvb_format_stringzpad(tvb, (offset+3), (tempLen-1));
|
2005-09-15 04:08:53 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1: /* Chassis component */
|
|
|
|
case 3: /* Port component */
|
|
|
|
{
|
|
|
|
if (tempLen > 256)
|
|
|
|
{
|
|
|
|
incorrectLen = 1; /* Invalid length */
|
|
|
|
break;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
strPtr = tvb_bytes_to_str(tvb, (offset+3), (tempLen-1));
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: /* Reserved types */
|
|
|
|
{
|
|
|
|
if (tempLen > 256)
|
|
|
|
{
|
|
|
|
incorrectLen = 1; /* Invalid length */
|
|
|
|
break;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
strPtr = "Reserved";
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
if (incorrectLen == 1)
|
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 04:08:53 +00:00
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, 2, "Invalid Chassis ID Length (%u)", tempLen);
|
|
|
|
chassis_tree = proto_item_add_subtree(tf, ett_chassis_id);
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(chassis_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(chassis_tree, tvb, offset, 2, "%s Invalid Length: %u",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempLen, TLV_INFO_LEN_MASK, 16, "", ""), tempLen);
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get chassis id subtype */
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(chassis_tree, hf_chassis_id_subtype, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
return -1;
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2005-09-15 04:08:53 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Chassis Id = %s ", strPtr);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
/* Set chassis tree */
|
2007-03-02 23:44:54 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "Chassis Subtype = %s",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(tempType, chassis_id_subtypes, "Reserved" ));
|
2005-09-15 04:08:53 +00:00
|
|
|
chassis_tree = proto_item_add_subtree(tf, ett_chassis_id);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(chassis_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(chassis_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get chassis id subtype */
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(chassis_tree, hf_chassis_id_subtype, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get chassis id */
|
|
|
|
switch (tempType)
|
|
|
|
{
|
|
|
|
case 4: /* MAC address */
|
2011-03-03 03:09:21 +00:00
|
|
|
proto_tree_add_item(chassis_tree, hf_chassis_id_mac, tvb, (offset+3), 6, ENC_NA);
|
2009-02-09 19:39:43 +00:00
|
|
|
proto_item_append_text(tf, ", Id: %s", strPtr);
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
case 5: /* Network address */
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(chassis_tree, hf_lldp_network_address_family, tvb, offset+3, 1, ENC_BIG_ENDIAN);
|
2006-01-23 22:13:08 +00:00
|
|
|
switch(addr_family){
|
2006-01-28 23:18:19 +00:00
|
|
|
case AFNUM_INET:
|
2006-01-23 22:13:08 +00:00
|
|
|
proto_tree_add_ipv4(chassis_tree, hf_chassis_id_ip4, tvb, (offset+4), 4, ip_addr);
|
|
|
|
break;
|
2006-01-28 23:18:19 +00:00
|
|
|
case AFNUM_INET6:
|
2006-01-23 22:13:08 +00:00
|
|
|
proto_tree_add_ipv6(chassis_tree, hf_chassis_id_ip6, tvb, (offset+4), 16, ip6_addr.bytes);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
proto_tree_add_text(chassis_tree, tvb, (offset+4), (tempLen-2), "Chassis Id: %s", strPtr);
|
|
|
|
break;
|
|
|
|
}
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
case 2: /* Interface alias */
|
|
|
|
case 6: /* Interface name */
|
|
|
|
case 7: /* Locally assigned */
|
2005-09-15 04:08:53 +00:00
|
|
|
proto_tree_add_text(chassis_tree, tvb, (offset+3), (tempLen-1), "Chassis Id: %s", strPtr);
|
2009-02-09 19:39:43 +00:00
|
|
|
proto_item_append_text(tf, ", Id: %s", strPtr);
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
case 1: /* Chassis component */
|
|
|
|
case 3: /* Port component */
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(chassis_tree, hf_chassis_id, tvb, (offset+3), (tempLen-1), ENC_NA);
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return (tempLen + 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect Port Id TLV (Mandatory) */
|
|
|
|
static gint32
|
|
|
|
dissect_lldp_port_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset)
|
|
|
|
{
|
|
|
|
guint8 tempType;
|
|
|
|
guint16 tempShort;
|
|
|
|
guint32 tempLen = 0;
|
2005-09-15 04:08:53 +00:00
|
|
|
const char *strPtr;
|
2009-10-05 16:52:59 +00:00
|
|
|
guint32 ip_addr = 0;
|
2005-09-15 04:08:53 +00:00
|
|
|
struct e_in6_addr ip6_addr;
|
2006-01-23 22:13:08 +00:00
|
|
|
guint8 addr_family = 0;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *port_tree = NULL;
|
|
|
|
proto_item *tf = NULL;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get tlv type */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, offset);
|
|
|
|
tempType = TLV_TYPE(tempShort);
|
|
|
|
if (tempType != PORT_ID_TLV_TYPE)
|
|
|
|
return -1;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv length and subtype */
|
|
|
|
tempLen = TLV_INFO_LEN(tempShort);
|
|
|
|
tempType = tvb_get_guint8(tvb, (offset+2));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get port id */
|
|
|
|
switch (tempType)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
case 3: /* MAC address */
|
|
|
|
{
|
|
|
|
if (tempLen != 7)
|
|
|
|
return -1; /* Invalid port id */
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-03-03 03:09:21 +00:00
|
|
|
strPtr = tvb_ether_to_str(tvb, offset+3);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 4: /* Network address */
|
|
|
|
{
|
2006-01-23 22:13:08 +00:00
|
|
|
/* Get network address family */
|
|
|
|
addr_family = tvb_get_guint8(tvb,offset+3);
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Check for IPv4 or IPv6 */
|
2006-01-23 22:13:08 +00:00
|
|
|
switch(addr_family){
|
2006-01-28 23:18:19 +00:00
|
|
|
case AFNUM_INET:
|
2006-01-23 22:13:08 +00:00
|
|
|
if (tempLen == 6){
|
|
|
|
ip_addr = tvb_get_ipv4(tvb, (offset+4));
|
|
|
|
strPtr = ip_to_str((guint8 *)&ip_addr);
|
|
|
|
}else{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
break;
|
2006-01-28 23:18:19 +00:00
|
|
|
case AFNUM_INET6:
|
2006-01-23 22:13:08 +00:00
|
|
|
if (tempLen == 18){
|
|
|
|
tvb_get_ipv6(tvb, (offset+4), &ip6_addr);
|
|
|
|
strPtr = ip6_to_str(&ip6_addr);
|
|
|
|
}else{
|
|
|
|
return -1; /* Invalid chassis id */
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
strPtr = tvb_bytes_to_str(tvb, (offset+4), (tempLen-2));
|
|
|
|
break;
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
2005-09-15 05:22:20 +00:00
|
|
|
strPtr = tvb_format_stringzpad(tvb, (offset+3), (tempLen-1));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "Port Id = %s ", strPtr);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
/* Set port tree */
|
2007-03-02 23:44:54 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "Port Subtype = %s",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(tempType, port_id_subtypes, "Unknown" ));
|
2005-09-15 04:08:53 +00:00
|
|
|
port_tree = proto_item_add_subtree(tf, ett_port_id);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(port_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(port_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get port id subtype */
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(port_tree, hf_port_id_subtype, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get port id */
|
2005-09-15 04:08:53 +00:00
|
|
|
/*proto_tree_add_text(port_tree, tvb, (offset+3), (tempLen-1), "Port Id: %s", strPtr);*/
|
2005-09-14 19:06:54 +00:00
|
|
|
switch (tempType)
|
|
|
|
{
|
|
|
|
case 3: /* MAC address */
|
2011-03-03 03:09:21 +00:00
|
|
|
proto_tree_add_item(port_tree, hf_port_id_mac, tvb, (offset+3), 6, ENC_NA);
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
case 4: /* Network address */
|
2007-03-02 23:44:54 +00:00
|
|
|
/* Network address
|
|
|
|
* networkAddress is an octet string that identifies a particular network address family
|
2006-01-23 22:13:08 +00:00
|
|
|
* and an associated network address that are encoded in network octet order.
|
|
|
|
*/
|
|
|
|
/* Network address family */
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(port_tree, hf_lldp_network_address_family, tvb, offset+3, 1, ENC_BIG_ENDIAN);
|
2006-01-23 22:13:08 +00:00
|
|
|
switch(addr_family){
|
2006-01-28 23:18:19 +00:00
|
|
|
case AFNUM_INET:
|
2006-01-23 22:13:08 +00:00
|
|
|
proto_tree_add_ipv4(port_tree, hf_port_id_ip4, tvb, (offset+4), 4, ip_addr);
|
|
|
|
break;
|
2006-01-28 23:18:19 +00:00
|
|
|
case AFNUM_INET6:
|
2006-01-23 22:13:08 +00:00
|
|
|
proto_tree_add_ipv6(port_tree, hf_port_id_ip6, tvb, (offset+4), 16, ip6_addr.bytes);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
proto_tree_add_text(port_tree, tvb, (offset+4), (tempLen-2), "Port Id: %s", strPtr);
|
|
|
|
break;
|
|
|
|
}
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-09-15 04:08:53 +00:00
|
|
|
proto_tree_add_text(port_tree, tvb, (offset+3), (tempLen-1), "Port Id: %s", strPtr);
|
2009-02-09 19:39:43 +00:00
|
|
|
proto_item_append_text(tf, ", Id: %s", strPtr);
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return (tempLen + 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect Time To Live TLV (Mandatory) */
|
|
|
|
static gint32
|
|
|
|
dissect_lldp_time_to_live(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset)
|
|
|
|
{
|
|
|
|
guint8 tempType;
|
|
|
|
guint16 tempShort;
|
|
|
|
guint32 tempLen = 0;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *time_to_live_tree = NULL;
|
|
|
|
proto_item *tf = NULL;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get tlv type */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, offset);
|
|
|
|
tempType = TLV_TYPE(tempShort);
|
|
|
|
if (tempType != TIME_TO_LIVE_TLV_TYPE)
|
|
|
|
return -1;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv length and seconds field */
|
|
|
|
tempLen = TLV_INFO_LEN(tempShort);
|
|
|
|
tempShort = tvb_get_ntohs(tvb, (offset+2));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2005-09-14 19:06:54 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "TTL = %u ", tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
/* Set port tree */
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "Time To Live = %u sec", tempShort);
|
|
|
|
time_to_live_tree = proto_item_add_subtree(tf, ett_time_to_live);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(time_to_live_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(time_to_live_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Display time to live information */
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(time_to_live_tree, hf_time_to_live, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return (tempLen + 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect End of LLDPDU TLV (Mandatory) */
|
2012-02-28 08:04:24 +00:00
|
|
|
gint32
|
2005-09-23 10:39:58 +00:00
|
|
|
dissect_lldp_end_of_lldpdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
guint16 tempLen;
|
|
|
|
guint16 tempShort;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *end_of_lldpdu_tree = NULL;
|
|
|
|
proto_item *tf = NULL;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get tlv type and length */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, offset);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv length */
|
|
|
|
tempLen = TLV_INFO_LEN(tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
/* Set port tree */
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "End of LLDPDU");
|
|
|
|
end_of_lldpdu_tree = proto_item_add_subtree(tf, ett_end_of_lldpdu);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(end_of_lldpdu_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(end_of_lldpdu_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return -1; /* Force the lldp dissector to terminate */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect Port Description TLV */
|
|
|
|
static gint32
|
2005-09-23 10:39:58 +00:00
|
|
|
dissect_lldp_port_desc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
guint16 tempShort;
|
|
|
|
guint32 tempLen = 0;
|
2005-09-15 04:08:53 +00:00
|
|
|
const char *strPtr;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *port_desc_tree = NULL;
|
|
|
|
proto_item *tf = NULL;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get tlv type and length */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, offset);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv length */
|
|
|
|
tempLen = TLV_INFO_LEN(tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
{
|
2005-09-15 05:22:20 +00:00
|
|
|
strPtr = tvb_format_stringzpad(tvb, (offset+2), tempLen);
|
2005-09-15 04:08:53 +00:00
|
|
|
|
|
|
|
/* Set port tree */
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "Port Description = %s", strPtr);
|
|
|
|
port_desc_tree = proto_item_add_subtree(tf, ett_port_description);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(port_desc_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(port_desc_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Display port description information */
|
2005-09-15 04:08:53 +00:00
|
|
|
proto_tree_add_text(port_desc_tree, tvb, (offset+2), tempLen, "Port Description: %s",
|
|
|
|
strPtr);
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return (tempLen + 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect System Name and description TLV */
|
|
|
|
static gint32
|
2005-09-23 10:39:58 +00:00
|
|
|
dissect_lldp_system_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
guint16 tempShort;
|
|
|
|
guint32 tempLen = 0;
|
|
|
|
guint8 tempType;
|
2005-09-15 04:08:53 +00:00
|
|
|
const char *strPtr;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *system_name_tree = NULL;
|
|
|
|
proto_item *tf = NULL;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get tlv type and length */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, offset);
|
|
|
|
tempType = TLV_TYPE(tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv length */
|
|
|
|
tempLen = TLV_INFO_LEN(tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
{
|
2005-09-15 05:22:20 +00:00
|
|
|
strPtr = tvb_format_stringzpad(tvb, (offset+2), tempLen);
|
2005-09-15 04:08:53 +00:00
|
|
|
|
|
|
|
/* Set system name tree */
|
2009-02-09 19:39:43 +00:00
|
|
|
if (tempType == SYSTEM_NAME_TLV_TYPE) {
|
2005-09-15 04:08:53 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "System Name = %s", strPtr);
|
2009-02-09 19:39:43 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "System Name = %s ", strPtr);
|
|
|
|
} else
|
2005-09-15 04:08:53 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "System Description = %s", strPtr);
|
|
|
|
system_name_tree = proto_item_add_subtree(tf, ett_system_name);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(system_name_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(system_name_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Display system name information */
|
2007-03-02 23:44:54 +00:00
|
|
|
proto_tree_add_text(system_name_tree, tvb, (offset+2), tempLen, "%s = %s",
|
2005-09-15 04:08:53 +00:00
|
|
|
((tempType == SYSTEM_NAME_TLV_TYPE) ? "System Name" : "System Description"),
|
|
|
|
strPtr);
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return (tempLen + 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect System Capabilities TLV */
|
|
|
|
static gint32
|
2005-09-23 10:39:58 +00:00
|
|
|
dissect_lldp_system_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
guint16 tempShort;
|
|
|
|
guint32 tempLen = 0;
|
|
|
|
guint16 tempCapability;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *system_capabilities_tree = NULL;
|
|
|
|
proto_tree *capabilities_summary_tree = NULL;
|
|
|
|
proto_tree *capabilities_enabled_tree = NULL;
|
|
|
|
proto_item *tf = NULL;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get tlv type and length */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, offset);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv length */
|
|
|
|
tempLen = TLV_INFO_LEN(tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get system capabilities */
|
|
|
|
tempCapability = tvb_get_ntohs(tvb, (offset+2));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
/* Set system capabilities tree */
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "Capabilities");
|
|
|
|
system_capabilities_tree = proto_item_add_subtree(tf, ett_system_cap);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(system_capabilities_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(system_capabilities_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Display system capability information */
|
|
|
|
tf = proto_tree_add_text(system_capabilities_tree, tvb, (offset+2), 2, "Capabilities: 0x%04x", tempCapability);
|
|
|
|
capabilities_summary_tree = proto_item_add_subtree(tf, ett_system_cap_summary);
|
|
|
|
/* Add capabilities to summary tree */
|
|
|
|
if (tempCapability & SYSTEM_CAPABILITY_OTHER)
|
|
|
|
proto_tree_add_text(capabilities_summary_tree, tvb, (offset+2), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempCapability, SYSTEM_CAPABILITY_OTHER,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Other", ""));
|
|
|
|
if (tempCapability & SYSTEM_CAPABILITY_REPEATER)
|
|
|
|
proto_tree_add_text(capabilities_summary_tree, tvb, (offset+2), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempCapability, SYSTEM_CAPABILITY_REPEATER,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Repeater", ""));
|
|
|
|
if (tempCapability & SYSTEM_CAPABILITY_BRIDGE)
|
|
|
|
proto_tree_add_text(capabilities_summary_tree, tvb, (offset+2), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempCapability, SYSTEM_CAPABILITY_BRIDGE,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Bridge", ""));
|
|
|
|
if (tempCapability & SYSTEM_CAPABILITY_WLAN)
|
|
|
|
proto_tree_add_text(capabilities_summary_tree, tvb, (offset+2), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempCapability, SYSTEM_CAPABILITY_WLAN,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "WLAN access point", ""));
|
|
|
|
if (tempCapability & SYSTEM_CAPABILITY_ROUTER)
|
|
|
|
proto_tree_add_text(capabilities_summary_tree, tvb, (offset+2), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempCapability, SYSTEM_CAPABILITY_ROUTER,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Router", ""));
|
|
|
|
if (tempCapability & SYSTEM_CAPABILITY_TELEPHONE)
|
|
|
|
proto_tree_add_text(capabilities_summary_tree, tvb, (offset+2), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempCapability, SYSTEM_CAPABILITY_TELEPHONE,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Telephone", ""));
|
|
|
|
if (tempCapability & SYSTEM_CAPABILITY_DOCSIS)
|
|
|
|
proto_tree_add_text(capabilities_summary_tree, tvb, (offset+2), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempCapability, SYSTEM_CAPABILITY_DOCSIS,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "DOCSIS cable device", ""));
|
|
|
|
if (tempCapability & SYSTEM_CAPABILITY_STATION)
|
|
|
|
proto_tree_add_text(capabilities_summary_tree, tvb, (offset+2), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempCapability, SYSTEM_CAPABILITY_STATION,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Station only", ""));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get enabled summary */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, (offset+4));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Display system capability information */
|
2005-09-14 19:06:54 +00:00
|
|
|
tf = proto_tree_add_text(system_capabilities_tree, tvb, (offset+4), 2, "Enabled Capabilities: 0x%04x", tempShort);
|
|
|
|
capabilities_enabled_tree = proto_item_add_subtree(tf, ett_system_cap_enabled);
|
|
|
|
/* Add capabilities to summary tree */
|
|
|
|
if (tempShort & SYSTEM_CAPABILITY_OTHER)
|
|
|
|
proto_tree_add_text(capabilities_enabled_tree, tvb, (offset+4), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempShort, SYSTEM_CAPABILITY_OTHER,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Other", ""));
|
|
|
|
if (tempShort & SYSTEM_CAPABILITY_REPEATER)
|
|
|
|
proto_tree_add_text(capabilities_enabled_tree, tvb, (offset+4), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempShort, SYSTEM_CAPABILITY_REPEATER,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Repeater", ""));
|
|
|
|
if (tempShort & SYSTEM_CAPABILITY_BRIDGE)
|
|
|
|
proto_tree_add_text(capabilities_enabled_tree, tvb, (offset+4), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempShort, SYSTEM_CAPABILITY_BRIDGE,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Bridge", ""));
|
|
|
|
if (tempShort & SYSTEM_CAPABILITY_WLAN)
|
|
|
|
proto_tree_add_text(capabilities_enabled_tree, tvb, (offset+4), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempShort, SYSTEM_CAPABILITY_WLAN,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "WLAN access point", ""));
|
|
|
|
if (tempShort & SYSTEM_CAPABILITY_ROUTER)
|
|
|
|
proto_tree_add_text(capabilities_enabled_tree, tvb, (offset+4), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempShort, SYSTEM_CAPABILITY_ROUTER,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Router", ""));
|
|
|
|
if (tempShort & SYSTEM_CAPABILITY_TELEPHONE)
|
|
|
|
proto_tree_add_text(capabilities_enabled_tree, tvb, (offset+4), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempShort, SYSTEM_CAPABILITY_TELEPHONE,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Telephone", ""));
|
|
|
|
if (tempShort & SYSTEM_CAPABILITY_DOCSIS)
|
|
|
|
proto_tree_add_text(capabilities_enabled_tree, tvb, (offset+4), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempShort, SYSTEM_CAPABILITY_DOCSIS,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "DOCSIS cable device", ""));
|
|
|
|
if (tempShort & SYSTEM_CAPABILITY_STATION)
|
|
|
|
proto_tree_add_text(capabilities_enabled_tree, tvb, (offset+4), 2, "%s",
|
2005-09-15 04:08:53 +00:00
|
|
|
decode_boolean_bitfield(tempShort, SYSTEM_CAPABILITY_STATION,
|
2005-09-14 19:06:54 +00:00
|
|
|
16, "Station only", ""));
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return (tempLen + 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect Management Address TLV */
|
|
|
|
static gint32
|
2005-09-23 10:39:58 +00:00
|
|
|
dissect_lldp_management_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
guint16 tempShort;
|
|
|
|
guint32 tempLen = 0;
|
|
|
|
guint8 tempByte;
|
|
|
|
guint8 stringLen = 0;
|
|
|
|
guint32 tempOffset = offset;
|
|
|
|
guint32 tempLong;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *system_mgm_addr = NULL;
|
|
|
|
proto_item *tf = NULL;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get tlv type and length */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv length */
|
|
|
|
tempLen = TLV_INFO_LEN(tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
/* Set system capabilities tree */
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, (tempLen + 2), "Management Address");
|
|
|
|
system_mgm_addr = proto_item_add_subtree(tf, ett_management_address);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(system_mgm_addr, hf_lldp_tlv_type, tvb, tempOffset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(system_mgm_addr, hf_lldp_tlv_len, tvb, tempOffset, 2, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset += 2;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get management address string length */
|
|
|
|
stringLen = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
proto_tree_add_text(system_mgm_addr, tvb, tempOffset, 1, "Address String Length: %u", stringLen);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get management address subtype */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
proto_tree_add_text(system_mgm_addr, tvb, tempOffset, 1, "Address Subtype: %s (%u)",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(tempByte, afn_vals, "Undefined"),
|
2005-09-14 19:06:54 +00:00
|
|
|
tempByte);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get address */
|
|
|
|
switch (tempByte)
|
|
|
|
{
|
2005-10-16 03:57:49 +00:00
|
|
|
/* XXX - Should we throw an exception if stringLen doesn't match our address length? */
|
2005-09-14 19:06:54 +00:00
|
|
|
case 1: /* IPv4 */
|
2011-10-10 00:39:31 +00:00
|
|
|
proto_tree_add_item(system_mgm_addr, hf_mgn_addr_ipv4, tvb, tempOffset, 4, ENC_BIG_ENDIAN);
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
case 2: /* IPv6 */
|
2011-10-10 00:39:31 +00:00
|
|
|
proto_tree_add_item(system_mgm_addr, hf_mgn_addr_ipv6, tvb, tempOffset, 16, ENC_NA);
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
2007-03-02 23:44:54 +00:00
|
|
|
default:
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(system_mgm_addr, hf_mgn_addr_hex, tvb, tempOffset, (stringLen-1), ENC_NA);
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset += (stringLen-1);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get interface numbering subtype */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
proto_tree_add_text(system_mgm_addr, tvb, tempOffset, 1, "Interface Subtype: %s (%u)",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(tempByte, interface_subtype_values, "Undefined"),
|
2005-09-14 19:06:54 +00:00
|
|
|
tempByte);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get interface number */
|
|
|
|
tempLong = tvb_get_ntohl(tvb, tempOffset);
|
|
|
|
proto_tree_add_text(system_mgm_addr, tvb, tempOffset, 4, "Interface Number: %u", tempLong);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset += 4;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get OID string length */
|
|
|
|
stringLen = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
proto_tree_add_text(system_mgm_addr, tvb, tempOffset, 1, "OID String Length: %u", stringLen);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
if (stringLen > 0)
|
|
|
|
{
|
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get OID identifier */
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(system_mgm_addr, hf_mgn_obj_id, tvb, tempOffset, stringLen, ENC_NA);
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return (tempLen + 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect IEEE 802.1 TLVs */
|
|
|
|
static void
|
2005-09-23 10:39:58 +00:00
|
|
|
dissect_ieee_802_1_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
guint8 subType;
|
|
|
|
guint8 tempByte;
|
|
|
|
guint16 tempShort;
|
|
|
|
guint32 tempOffset = offset;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *vlan_flags = NULL;
|
|
|
|
proto_item *tf = NULL;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get subtype */
|
|
|
|
subType = tvb_get_guint8(tvb, tempOffset);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
if (tree)
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(tree, hf_ieee_802_1_subtype, tvb, tempOffset, 1, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
switch (subType)
|
|
|
|
{
|
|
|
|
case 0x01: /* Port VLAN ID */
|
|
|
|
{
|
|
|
|
/* Get port vland id */
|
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
2005-09-19 21:24:07 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "Port VLAN Identifier: %u (0x%04X)", tempShort, tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0x02: /* Port and Protocol VLAN ID */
|
|
|
|
{
|
|
|
|
/* Get flags */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 1, "Flags: 0x%02x", tempByte);
|
|
|
|
vlan_flags = proto_item_add_subtree(tf, ett_port_vlan_flags);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get supported flag */
|
|
|
|
proto_tree_add_text(vlan_flags, tvb, tempOffset, 1, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 1 << 1, 8, "Port and Protocol VLAN: Supported",
|
2005-09-15 04:08:53 +00:00
|
|
|
"Port and Protocol VLAN: Not Supported"));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get enabled flag */
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(vlan_flags, tvb, tempOffset, 1, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 1 << 2, 8, "Port and Protocol VLAN: Enabled",
|
2005-09-15 04:08:53 +00:00
|
|
|
"Port and Protocol VLAN: Not Enabled"));
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get port and protocol vlan id */
|
2005-09-14 19:06:54 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
2005-09-19 21:24:07 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "Port and Protocol VLAN Identifier: %u (0x%04X)", tempShort, tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0x03: /* VLAN Name */
|
|
|
|
{
|
|
|
|
/* Get vlan id */
|
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
2005-09-19 21:24:07 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "VLAN Identifier: %u (0x%04X)", tempShort, tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset += 2;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get vlan name length */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "VLAN Name Length: %u", tempByte);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
if (tempByte > 0)
|
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 04:08:53 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tempByte, "VLAN Name: %s",
|
2005-09-15 05:22:20 +00:00
|
|
|
tvb_format_stringzpad(tvb, tempOffset, tempByte));
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0x04: /* Protocol ID */
|
|
|
|
{
|
|
|
|
/* Get protocal id length */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "Protocol Identity Length: %u", tempByte);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
if (tempByte > 0)
|
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 03:09:40 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tempByte, "Protocol Identity: %s",
|
2005-09-15 04:08:53 +00:00
|
|
|
tvb_bytes_to_str(tvb, tempOffset, tempByte));
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-05-07 14:50:36 +00:00
|
|
|
/* Dissect IEEE 802.1Qbg TLVs */
|
2012-04-13 22:26:35 +00:00
|
|
|
static void
|
|
|
|
dissect_oui_default_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
|
|
|
{
|
|
|
|
guint8 subType;
|
|
|
|
subType = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(tree, hf_unknown_subtype, tvb, offset, 1, subType);
|
|
|
|
proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, (offset+1), -1, ENC_NA);
|
|
|
|
}
|
|
|
|
|
2011-05-07 14:50:36 +00:00
|
|
|
static void
|
|
|
|
dissect_ieee_802_1qbg_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
|
|
|
{
|
|
|
|
guint8 subType;
|
|
|
|
guint8 tempByte;
|
|
|
|
guint16 tempShort;
|
|
|
|
guint32 tempOffset = offset;
|
|
|
|
|
|
|
|
proto_tree *evb_capabilities_subtree = NULL;
|
|
|
|
|
|
|
|
proto_item *tf = NULL;
|
|
|
|
subType = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
|
|
|
|
if (tree)
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(tree, hf_ieee_802_1qbg_subtype, tvb, tempOffset, 1, ENC_BIG_ENDIAN);
|
2011-05-07 14:50:36 +00:00
|
|
|
|
|
|
|
tempOffset++;
|
|
|
|
|
|
|
|
switch (subType) {
|
|
|
|
case 0x00:
|
|
|
|
/* Get EVB capabilities */
|
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree) {
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 2, "supported capabilities: 0x%04X", tempShort);
|
|
|
|
evb_capabilities_subtree = proto_item_add_subtree(tf, ett_802_1qbg_capabilities_flags);
|
|
|
|
|
|
|
|
if (tempShort & EVB_CAPA_STD)
|
|
|
|
proto_tree_add_text(evb_capabilities_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, EVB_CAPA_STD,
|
|
|
|
16, "standard bridging (STD)", ""));
|
|
|
|
|
|
|
|
if (tempShort & EVB_CAPA_RR)
|
|
|
|
proto_tree_add_text(evb_capabilities_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, EVB_CAPA_RR,
|
|
|
|
16, "reflective relay (RR)", ""));
|
|
|
|
|
|
|
|
if (tempShort & EVB_CAPA_RTE)
|
|
|
|
proto_tree_add_text(evb_capabilities_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, EVB_CAPA_RTE,
|
|
|
|
16, "retransmission timer exponent (RTE)", ""));
|
|
|
|
|
|
|
|
if (tempShort & EVB_CAPA_ECP)
|
|
|
|
proto_tree_add_text(evb_capabilities_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, EVB_CAPA_ECP,
|
|
|
|
16, "edge control protocol (ECP)", ""));
|
|
|
|
|
|
|
|
if (tempShort & EVB_CAPA_VDP)
|
|
|
|
proto_tree_add_text(evb_capabilities_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, EVB_CAPA_VDP,
|
|
|
|
16, "VSI discovery protocol (VDP)", ""));
|
|
|
|
}
|
|
|
|
|
|
|
|
tempOffset += 2;
|
|
|
|
|
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree) {
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 2, "configured capabilities: 0x%04X", tempShort);
|
|
|
|
evb_capabilities_subtree = proto_item_add_subtree(tf, ett_802_1qbg_capabilities_flags);
|
|
|
|
|
|
|
|
if (tempShort & EVB_CAPA_STD)
|
|
|
|
proto_tree_add_text(evb_capabilities_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, EVB_CAPA_STD,
|
|
|
|
16, "standard bridging (STD)", ""));
|
|
|
|
|
|
|
|
if (tempShort & EVB_CAPA_RR)
|
|
|
|
proto_tree_add_text(evb_capabilities_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, EVB_CAPA_RR,
|
|
|
|
16, "reflective relay (RR)", ""));
|
|
|
|
|
|
|
|
if (tempShort & EVB_CAPA_RTE)
|
|
|
|
proto_tree_add_text(evb_capabilities_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, EVB_CAPA_RTE,
|
|
|
|
16, "retransmission timer exponent (RTE)", ""));
|
|
|
|
|
|
|
|
if (tempShort & EVB_CAPA_ECP)
|
|
|
|
proto_tree_add_text(evb_capabilities_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, EVB_CAPA_ECP,
|
|
|
|
16, "edge control protocol (ECP)", ""));
|
|
|
|
|
|
|
|
if (tempShort & EVB_CAPA_VDP)
|
|
|
|
proto_tree_add_text(evb_capabilities_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, EVB_CAPA_VDP,
|
|
|
|
16, "VSI discovery protocol (VDP)", ""));
|
|
|
|
}
|
|
|
|
|
|
|
|
tempOffset += 2;
|
|
|
|
|
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree) {
|
2011-05-11 20:35:57 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "supported no. of VSIs: %04u", tempShort);
|
2011-05-07 14:50:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tempOffset += 2;
|
|
|
|
|
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree) {
|
2011-05-11 20:35:57 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "configured no. of VSIs: %04u", tempShort);
|
2011-05-07 14:50:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tempOffset += 2;
|
|
|
|
|
|
|
|
tempByte= tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree) {
|
2011-05-11 20:35:57 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "retransmission timer exponent: %02u", tempByte);
|
2011-05-07 14:50:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Dissect IEEE 802.3 TLVs */
|
|
|
|
static void
|
2012-04-13 22:26:35 +00:00
|
|
|
dissect_ieee_802_3_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
guint8 subType;
|
|
|
|
guint8 tempByte;
|
|
|
|
guint16 tempShort;
|
|
|
|
guint32 tempLong;
|
|
|
|
guint32 tempOffset = offset;
|
2012-04-13 22:26:35 +00:00
|
|
|
guint16 tlvLen = tvb_length(tvb)-offset;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *mac_phy_flags = NULL;
|
2005-09-19 21:24:07 +00:00
|
|
|
proto_tree *autoneg_advertised_subtree = NULL;
|
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_item *tf = NULL;
|
2012-05-03 14:35:55 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get subtype */
|
|
|
|
subType = tvb_get_guint8(tvb, tempOffset);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
if (tree)
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(tree, hf_ieee_802_3_subtype, tvb, tempOffset, 1, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
switch (subType)
|
|
|
|
{
|
|
|
|
case 0x01: /* MAC/PHY Configuration/Status */
|
|
|
|
{
|
|
|
|
/* Get auto-negotiation info */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 1, "Auto-Negotiation Support/Status: 0x%02x", tempByte);
|
|
|
|
mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_flags);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get supported flag */
|
|
|
|
proto_tree_add_text(mac_phy_flags, tvb, tempOffset, 1, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x01, 8, "Auto-Negotiation: Supported",
|
2005-09-15 04:08:53 +00:00
|
|
|
"Auto-Negotiation: Not Supported"));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get enabled flag */
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(mac_phy_flags, tvb, tempOffset, 1, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x02, 8, "Auto-Negotiation: Enabled",
|
2005-09-15 04:08:53 +00:00
|
|
|
"Auto-Negotiation: Not Enabled"));
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset++;
|
2005-09-19 21:24:07 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get pmd auto-negotiation advertised capability */
|
2005-09-14 19:06:54 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
2005-09-19 21:24:07 +00:00
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 2, "PMD Auto-Negotiation Advertised Capability: 0x%04X", tempShort);
|
|
|
|
autoneg_advertised_subtree = proto_item_add_subtree(tf, ett_802_3_autoneg_advertised);
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_1000BASE_TFD)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_1000BASE_TFD,
|
|
|
|
16, "1000BASE-T (full duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_1000BASE_T)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_1000BASE_T,
|
|
|
|
16, "1000BASE-T (half duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_1000BASE_XFD)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_1000BASE_XFD,
|
|
|
|
16, "1000BASE-X (-LX, -SX, -CX full duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_1000BASE_X)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_1000BASE_X,
|
|
|
|
16, "1000BASE-X (-LX, -SX, -CX half duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_FDX_BPAUSE)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_FDX_BPAUSE,
|
|
|
|
16, "Asymmetric and Symmetric PAUSE (for full-duplex links)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_FDX_SPAUSE)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_FDX_SPAUSE,
|
|
|
|
16, "Symmetric PAUSE (for full-duplex links)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_FDX_APAUSE)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_FDX_APAUSE,
|
|
|
|
16, "Asymmetric PAUSE (for full-duplex links)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_FDX_PAUSE)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_FDX_PAUSE,
|
|
|
|
16, "PAUSE (for full-duplex links)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_100BASE_T2FD)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_100BASE_T2FD,
|
|
|
|
16, "100BASE-T2 (full duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_100BASE_T2)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_100BASE_T2,
|
|
|
|
16, "100BASE-T2 (half duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_100BASE_TXFD)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_100BASE_TXFD,
|
|
|
|
16, "100BASE-TX (full duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_100BASE_TX)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_100BASE_TX,
|
|
|
|
16, "100BASE-TX (half duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_100BASE_T4)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_100BASE_T4,
|
|
|
|
16, "100BASE-T4", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_10BASET_FD)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_10BASET_FD,
|
|
|
|
16, "10BASE-T (full duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_10BASE_T)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_10BASE_T,
|
|
|
|
16, "10BASE-T (half duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & AUTONEG_OTHER)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, AUTONEG_OTHER,
|
|
|
|
16, "other or unknown", ""));
|
|
|
|
|
2009-06-09 22:09:23 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 2, "Same in inverse (wrong) bitorder");
|
|
|
|
autoneg_advertised_subtree = proto_item_add_subtree(tf, ett_802_3_autoneg_advertised);
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_1000BASE_TFD)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_1000BASE_TFD,
|
|
|
|
16, "1000BASE-T (full duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_1000BASE_T)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_1000BASE_T,
|
|
|
|
16, "1000BASE-T (half duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_1000BASE_XFD)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_1000BASE_XFD,
|
|
|
|
16, "1000BASE-X (-LX, -SX, -CX full duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_1000BASE_X)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_1000BASE_X,
|
|
|
|
16, "1000BASE-X (-LX, -SX, -CX half duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_FDX_BPAUSE)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_FDX_BPAUSE,
|
|
|
|
16, "Asymmetric and Symmetric PAUSE (for full-duplex links)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_FDX_SPAUSE)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_FDX_SPAUSE,
|
|
|
|
16, "Symmetric PAUSE (for full-duplex links)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_FDX_APAUSE)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_FDX_APAUSE,
|
|
|
|
16, "Asymmetric PAUSE (for full-duplex links)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_FDX_PAUSE)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_FDX_PAUSE,
|
|
|
|
16, "PAUSE (for full-duplex links)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_100BASE_T2FD)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_100BASE_T2FD,
|
|
|
|
16, "100BASE-T2 (full duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_100BASE_T2)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_100BASE_T2,
|
|
|
|
16, "100BASE-T2 (half duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_100BASE_TXFD)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_100BASE_TXFD,
|
|
|
|
16, "100BASE-TX (full duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_100BASE_TX)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_100BASE_TX,
|
|
|
|
16, "100BASE-TX (half duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_100BASE_T4)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_100BASE_T4,
|
|
|
|
16, "100BASE-T4", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_10BASET_FD)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_10BASET_FD,
|
|
|
|
16, "10BASE-T (full duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_10BASE_T)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_10BASE_T,
|
|
|
|
16, "10BASE-T (half duplex mode)", ""));
|
|
|
|
|
|
|
|
if (tempShort & INV_AUTONEG_OTHER)
|
|
|
|
proto_tree_add_text(autoneg_advertised_subtree, tvb, (offset+2), 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, INV_AUTONEG_OTHER,
|
|
|
|
16, "other or unknown", ""));
|
|
|
|
|
2005-09-19 21:24:07 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset += 2;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get operational MAU type */
|
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
2005-09-19 21:24:07 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "Operational MAU Type: %s (0x%04X)",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(tempShort,operational_mau_type_values,"Unknown"),
|
2005-09-19 21:24:07 +00:00
|
|
|
tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset += 2;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0x02: /* MDI Power Support */
|
|
|
|
{
|
2009-10-22 07:10:05 +00:00
|
|
|
const char *strPtr;
|
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get MDI power support info */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 1, "MDI Power Support: 0x%02x", tempByte);
|
|
|
|
mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_power);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get port class */
|
|
|
|
proto_tree_add_text(mac_phy_flags, tvb, tempOffset, 1, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x01, 8, "Port Class: PSE",
|
2005-09-15 04:08:53 +00:00
|
|
|
"Port Class: PD"));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get PSE MDI power support */
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(mac_phy_flags, tvb, tempOffset, 1, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x02, 8, "PSE MDI Power: Supported",
|
2005-09-15 04:08:53 +00:00
|
|
|
"PSE MDI Power: Not Supported"));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get PSE MDI power state */
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(mac_phy_flags, tvb, tempOffset, 1, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x04, 8, "PSE MDI Power Enabled: Yes",
|
2005-09-15 04:08:53 +00:00
|
|
|
"PSE MDI Power Enabled: No"));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get PSE pairs control ability */
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(mac_phy_flags, tvb, tempOffset, 1, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x08, 8, "PSE Pairs Control Ability: Yes",
|
2005-09-15 04:08:53 +00:00
|
|
|
"PSE Pairs Control Ability: No"));
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get PSE power pair */
|
2005-09-14 19:06:54 +00:00
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "PSE Power Pair: %u", tempByte);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get power class */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "Power Class: %u", tempByte);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-01-31 22:31:05 +00:00
|
|
|
if (tlvLen == 4)
|
|
|
|
break;
|
|
|
|
|
2009-10-22 07:10:05 +00:00
|
|
|
/* Get first byte */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
|
|
|
|
/* Determine power type */
|
|
|
|
subType = ((tempByte & 0xC0) >> 6);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %s %s",
|
|
|
|
decode_boolean_bitfield(tempByte, 0xC0, 8, "Power Type:", "Power Type:"),
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(subType, power_type_802_3, "Unknown"),
|
|
|
|
val_to_str_const(subType, media_power_type, "Unknown"));
|
2009-10-22 07:10:05 +00:00
|
|
|
|
|
|
|
/* Determine power source */
|
|
|
|
switch (subType)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
case 2:
|
|
|
|
{
|
|
|
|
subType = ((tempByte & 0x30) >> 4);
|
2012-08-10 22:55:02 +00:00
|
|
|
strPtr = val_to_str_const(subType, media_power_pse_device, "Reserved");
|
2009-10-22 07:10:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
case 3:
|
|
|
|
{
|
|
|
|
subType = ((tempByte & 0x30) >> 4);
|
2012-08-10 22:55:02 +00:00
|
|
|
strPtr = val_to_str_const(subType, media_power_pd_device, "Reserved");
|
2009-10-22 07:10:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
strPtr = "Unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %s",
|
|
|
|
decode_boolean_bitfield(tempByte, 0x30, 8, "Power Source:", "Power Source:"),
|
|
|
|
strPtr);
|
|
|
|
|
|
|
|
/* Determine power priority */
|
|
|
|
subType = (tempByte & 0x0F);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %s",
|
|
|
|
decode_boolean_bitfield(tempByte, 0x0F, 8, "Power Priority:", "Power Priority:"),
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(subType, media_power_priority, "Reserved"));
|
2009-10-22 07:10:05 +00:00
|
|
|
|
|
|
|
tempOffset++;
|
|
|
|
|
2011-01-16 21:32:39 +00:00
|
|
|
/* Power Value: 1 to 510 expected */
|
2009-10-22 07:10:05 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "PD Requested Power Value: %u.%u Watt", tempShort/10, tempShort%10);
|
|
|
|
|
|
|
|
tempOffset+=2;
|
|
|
|
|
2011-01-16 21:32:39 +00:00
|
|
|
/* Power Value: 1 to 510 expected */
|
2009-10-22 07:10:05 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "PSE Allocated Power Value: %u.%u Watt", tempShort/10, tempShort%10);
|
|
|
|
|
|
|
|
tempOffset+=2;
|
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0x03: /* Link Aggregation */
|
|
|
|
{
|
|
|
|
/* Get aggregation status */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 1, "Aggregation Status: 0x%02x", tempByte);
|
|
|
|
mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_aggregation);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get aggregation capability */
|
|
|
|
proto_tree_add_text(mac_phy_flags, tvb, tempOffset, 1, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x01, 8, "Aggregation Capability: Yes",
|
2005-09-15 04:08:53 +00:00
|
|
|
"Aggregation Capability: No"));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get aggregation status */
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(mac_phy_flags, tvb, tempOffset, 1, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x02, 8, "Aggregation Status: Enabled",
|
2005-09-15 04:08:53 +00:00
|
|
|
"Aggregation Status: Not Enabled"));
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get aggregated port id */
|
2005-09-14 19:06:54 +00:00
|
|
|
tempLong = tvb_get_ntohl(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 4, "Aggregated Port Id: %u", tempLong);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset += 4;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0x04: /* Maximum Frame Size */
|
|
|
|
{
|
|
|
|
/* Get maximum frame size */
|
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "Maximum Frame Size: %u", tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset += 2;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
|
|
|
break;
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect Media TLVs */
|
|
|
|
static void
|
2012-04-13 22:26:35 +00:00
|
|
|
dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
guint32 tempOffset = offset;
|
2012-04-13 22:26:35 +00:00
|
|
|
guint16 tlvLen = tvb_length(tvb)-offset;
|
2005-09-14 19:06:54 +00:00
|
|
|
guint8 subType;
|
|
|
|
guint16 tempShort;
|
|
|
|
guint16 tempVLAN;
|
|
|
|
guint8 tempByte;
|
|
|
|
guint32 tempLong;
|
2005-09-15 03:09:40 +00:00
|
|
|
const char *strPtr;
|
2005-09-14 19:06:54 +00:00
|
|
|
guint32 LCI_Length;
|
|
|
|
guint64 temp64bit = 0;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *media_flags = NULL;
|
|
|
|
proto_item *tf = NULL;
|
|
|
|
/* Get subtype */
|
|
|
|
subType = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(tree, hf_media_tlv_subtype, tvb, tempOffset, 1, ENC_BIG_ENDIAN);
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
2005-09-15 05:22:20 +00:00
|
|
|
tlvLen--;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
switch (subType)
|
|
|
|
{
|
|
|
|
case 1: /* LLDP-MED Capabilities */
|
|
|
|
{
|
|
|
|
/* Get capabilities */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen < 2)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "TLV too short");
|
|
|
|
return;
|
|
|
|
}
|
2005-09-14 19:06:54 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 2, "Capabilities: 0x%04x", tempShort);
|
|
|
|
media_flags = proto_item_add_subtree(tf, ett_media_capabilities);
|
|
|
|
if (tempShort & MEDIA_CAPABILITY_LLDP)
|
|
|
|
proto_tree_add_text(media_flags, tvb, tempOffset, 2, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempShort, MEDIA_CAPABILITY_LLDP, 16,
|
2005-09-15 04:08:53 +00:00
|
|
|
"LLDP-MED Capabilities", ""));
|
2005-09-14 19:06:54 +00:00
|
|
|
if (tempShort & MEDIA_CAPABILITY_NETWORK_POLICY)
|
|
|
|
proto_tree_add_text(media_flags, tvb, tempOffset, 2, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempShort, MEDIA_CAPABILITY_NETWORK_POLICY, 16,
|
2005-09-15 04:08:53 +00:00
|
|
|
"Network Policy", ""));
|
|
|
|
if (tempShort & MEDIA_CAPABILITY_LOCATION_ID)
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(media_flags, tvb, tempOffset, 2, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempShort, MEDIA_CAPABILITY_LOCATION_ID, 16,
|
2005-09-15 04:08:53 +00:00
|
|
|
"Location Identification", ""));
|
|
|
|
if (tempShort & MEDIA_CAPABILITY_MDI_PSE)
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(media_flags, tvb, tempOffset, 2, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempShort, MEDIA_CAPABILITY_MDI_PSE, 16,
|
2005-09-15 04:08:53 +00:00
|
|
|
"Extended Power via MDI-PSE", ""));
|
|
|
|
if (tempShort & MEDIA_CAPABILITY_MDI_PD)
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(media_flags, tvb, tempOffset, 2, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempShort, MEDIA_CAPABILITY_MDI_PD, 16,
|
2005-09-15 04:08:53 +00:00
|
|
|
"Extended Power via MDI-PD", ""));
|
|
|
|
if (tempShort & MEDIA_CAPABILITY_INVENTORY)
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree_add_text(media_flags, tvb, tempOffset, 2, "%s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempShort, MEDIA_CAPABILITY_INVENTORY, 16,
|
2005-09-15 04:08:53 +00:00
|
|
|
"Inventory", ""));
|
|
|
|
}
|
|
|
|
tempOffset += 2;
|
2005-09-15 05:22:20 +00:00
|
|
|
tlvLen -= 2;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get Class type */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen < 1)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "TLV too short");
|
|
|
|
return;
|
|
|
|
}
|
2005-09-15 04:08:53 +00:00
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
2012-08-10 22:55:02 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "Class Type: %s", val_to_str_const(tempByte, media_class_values, "Unknown"));
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset++;
|
2005-09-15 05:22:20 +00:00
|
|
|
tlvLen--;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2: /* Network Policy */
|
|
|
|
{
|
|
|
|
/* Get application type */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen < 1)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "TLV too short");
|
|
|
|
return;
|
|
|
|
}
|
2005-09-14 19:06:54 +00:00
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
2008-12-17 00:08:38 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "Application Type: %s (%u)",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(tempByte, media_application_type, "Unknown"), tempByte);
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset++;
|
2005-09-15 05:22:20 +00:00
|
|
|
tlvLen--;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get flags */
|
2005-12-16 16:37:03 +00:00
|
|
|
if (tlvLen < 2)
|
2005-09-15 05:22:20 +00:00
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "TLV too short");
|
|
|
|
return;
|
|
|
|
}
|
2005-12-16 16:37:03 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Unknown policy flag */
|
|
|
|
if (tree)
|
2005-12-16 16:37:03 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, 0x8000, 16,"Policy: Unknown", "Policy: Defined"));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Tagged flag */
|
|
|
|
if (tree)
|
2005-12-16 16:37:03 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "%s",
|
|
|
|
decode_boolean_bitfield(tempShort, 0x4000, 16,"Tagged: Yes", "Tagged: No"));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get vlan id */
|
|
|
|
tempVLAN = (tempShort & 0x1FFE) >> 1;
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "%s %u",
|
|
|
|
decode_boolean_bitfield(tempShort, 0x1FFE, 16, "VLAN Id:", "VLAN Id:"), tempVLAN);
|
|
|
|
tempOffset++;
|
2005-09-15 05:22:20 +00:00
|
|
|
tlvLen--;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get L2 priority */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen < 1)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "TLV too short");
|
|
|
|
return;
|
|
|
|
}
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "%s %u",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempShort, 0x01C0, 16, "L2 Priority:", "L2 Priority:"),
|
2005-09-15 04:08:53 +00:00
|
|
|
((tempShort & 0x01C0) >> 6));
|
|
|
|
tempOffset++;
|
2005-09-15 05:22:20 +00:00
|
|
|
tlvLen--;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get DSCP value */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %u",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x3F, 8, "DSCP Value:", "DSCP Value:"),
|
2005-09-15 04:08:53 +00:00
|
|
|
(tempByte & 0x3F));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 3: /* Location Identification */
|
|
|
|
{
|
|
|
|
/* Get location data format */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen < 1)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "TLV too short");
|
|
|
|
return;
|
|
|
|
}
|
2005-09-15 04:08:53 +00:00
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
2007-03-02 23:44:54 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "Location Data Format: %s (%u)",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(tempByte, location_data_format, "Unknown"), tempByte);
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset++;
|
2005-09-15 05:22:20 +00:00
|
|
|
tlvLen--;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
switch (tempByte)
|
|
|
|
{
|
|
|
|
case 1: /* Coordinate-based LCI */
|
|
|
|
{
|
2005-09-15 08:57:51 +00:00
|
|
|
/*
|
|
|
|
* See RFC 3825.
|
|
|
|
* XXX - should this be handled by the BOOTP
|
|
|
|
* dissector, and exported to us?
|
|
|
|
*/
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen < 16)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
2005-09-15 05:22:20 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "TLV too short");
|
2005-09-15 04:08:53 +00:00
|
|
|
return;
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get latitude resolution */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
2005-09-15 04:08:53 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %u",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0xFC, 8, "Latitude Resolution:", "Latitude Resolution:"),
|
2005-09-15 04:08:53 +00:00
|
|
|
((tempByte & 0xFC) >> 2));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get latitude */
|
|
|
|
temp64bit = tvb_get_ntoh64(tvb, tempOffset);
|
|
|
|
temp64bit = (temp64bit & G_GINT64_CONSTANT(0x03FFFFFFFF000000)) >> 24;
|
|
|
|
if (tree)
|
2007-05-29 18:52:42 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 5, "Latitude: %s (0x%16" G_GINT64_MODIFIER "X)",
|
2005-09-15 08:57:51 +00:00
|
|
|
get_latitude_or_longitude(0, temp64bit),
|
|
|
|
temp64bit);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset += 5;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get longitude resolution */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %u",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0xFC, 8, "Longitude Resolution:", "Longitude Resolution:"),
|
2005-09-15 04:08:53 +00:00
|
|
|
((tempByte & 0xFC) >> 2));
|
2005-09-15 03:09:40 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get longitude */
|
|
|
|
temp64bit = tvb_get_ntoh64(tvb, tempOffset);
|
|
|
|
temp64bit = (temp64bit & G_GINT64_CONSTANT(0x03FFFFFFFF000000)) >> 24;
|
2005-09-15 08:57:51 +00:00
|
|
|
;
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
2007-05-29 18:52:42 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 5, "Longitude: %s (0x%16" G_GINT64_MODIFIER "X)",
|
2005-09-15 08:57:51 +00:00
|
|
|
get_latitude_or_longitude(1,temp64bit),
|
|
|
|
temp64bit);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset += 5;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Altitude Type */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 1, "%s",
|
|
|
|
decode_boolean_bitfield(tempByte, 0xF0, 8, "Altitude Type: ", "Altitude Type: "));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
switch ((tempByte >> 4))
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
proto_item_append_text(tf, "Meters (1)");
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
proto_item_append_text(tf, "Floors (2)");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
proto_item_append_text(tf, " Unknown (%u)", (tempByte >> 4));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get Altitude Resolution */
|
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "%s %u",
|
|
|
|
decode_boolean_bitfield(tempShort, 0x0FC0, 16, "Altitude Resolution: ", "Altitude Type: "),
|
|
|
|
((tempShort & 0x0FC0) >> 6));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get Altitude */
|
|
|
|
tempLong = (tvb_get_ntohl(tvb, tempOffset) & 0x03FFFFFFF);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 4, "Altitude: 0x%08X", tempLong);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset += 4;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get datum */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
2007-03-02 23:44:54 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "Datum: %u", tempByte);
|
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2: /* Civic Address LCI */
|
|
|
|
{
|
2005-09-15 08:57:51 +00:00
|
|
|
/*
|
|
|
|
* See draft-ietf-geopriv-dhcp-civil-07.
|
|
|
|
* XXX - should this be handled by the BOOTP
|
|
|
|
* dissector, and exported to us?
|
|
|
|
*/
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen < 1)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "TLV too short");
|
|
|
|
return;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get LCI length */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
2005-09-15 05:22:20 +00:00
|
|
|
tlvLen--;
|
|
|
|
if (tempByte > tlvLen)
|
2005-09-15 04:08:53 +00:00
|
|
|
{
|
|
|
|
if (tree)
|
2007-03-02 23:44:54 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "LCI Length: %u (greater than TLV length)", tempByte);
|
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
return;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
2007-03-02 23:44:54 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "LCI Length: %u", tempByte);
|
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
LCI_Length = (guint32)tempByte;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get what value */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (LCI_Length < 1)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "LCI Length too short");
|
|
|
|
return;
|
|
|
|
}
|
2005-09-14 19:06:54 +00:00
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "What: %s (%u)",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(tempByte,civic_address_what_values,"Unknown"),
|
2005-09-14 19:06:54 +00:00
|
|
|
tempByte);
|
|
|
|
tempOffset++;
|
|
|
|
LCI_Length--;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get country code */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (LCI_Length < 2)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "LCI Length too short");
|
|
|
|
return;
|
|
|
|
}
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "Country: %s",
|
|
|
|
tvb_format_text(tvb, tempOffset, 2));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset += 2;
|
|
|
|
LCI_Length -= 2;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
while (LCI_Length > 0)
|
|
|
|
{
|
|
|
|
/* Get CA Type */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (LCI_Length < 1)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "LCI Length too short");
|
|
|
|
return;
|
|
|
|
}
|
2005-09-14 19:06:54 +00:00
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "CA Type: %s (%u)",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(tempByte,civic_address_type_values,"Unknown"),
|
2005-09-14 19:06:54 +00:00
|
|
|
tempByte);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
|
|
|
LCI_Length--;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get CA Length */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (LCI_Length < 1)
|
|
|
|
{
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 0, "LCI Length too short");
|
|
|
|
return;
|
|
|
|
}
|
2005-09-14 19:06:54 +00:00
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "CA Length: %u", tempByte);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset++;
|
|
|
|
LCI_Length--;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Make sure the CA value is within the specified length */
|
|
|
|
if (tempByte > LCI_Length)
|
|
|
|
return;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
if (tempByte > 0)
|
|
|
|
{
|
|
|
|
/* Get CA Value */
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tempByte, "CA Value: %s",
|
2005-09-15 05:22:20 +00:00
|
|
|
tvb_format_stringzpad(tvb, tempOffset, tempByte));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
tempOffset += tempByte;
|
|
|
|
LCI_Length -= tempByte;
|
|
|
|
}
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 3: /* ECS ELIN */
|
|
|
|
{
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen > 0)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 05:22:20 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tlvLen, "ELIN: %s",
|
|
|
|
tvb_format_stringzpad(tvb, tempOffset, tlvLen));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 4: /* Extended Power-via-MDI */
|
|
|
|
{
|
|
|
|
/* Get first byte */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Determine power type */
|
|
|
|
subType = ((tempByte & 0xC0) >> 6);
|
|
|
|
if (tree)
|
2005-09-15 04:08:53 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0xC0, 8, "Power Type:", "Power Type:"),
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(subType, media_power_type, "Unknown"));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
|
|
|
/* Determine power source */
|
2005-09-15 04:08:53 +00:00
|
|
|
switch (subType)
|
|
|
|
{
|
2005-09-14 19:06:54 +00:00
|
|
|
case 0:
|
|
|
|
{
|
|
|
|
subType = ((tempByte & 0x30) >> 4);
|
2012-08-10 22:55:02 +00:00
|
|
|
strPtr = val_to_str_const(subType, media_power_pse_device, "Reserved");
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
{
|
|
|
|
subType = ((tempByte & 0x30) >> 4);
|
2012-08-10 22:55:02 +00:00
|
|
|
strPtr = val_to_str_const(subType, media_power_pd_device, "Reserved");
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
2005-09-15 03:09:40 +00:00
|
|
|
strPtr = "Unknown";
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
2005-09-15 04:08:53 +00:00
|
|
|
}
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x30, 8, "Power Source:", "Power Source:"),
|
2005-09-15 04:08:53 +00:00
|
|
|
strPtr);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Determine power priority */
|
|
|
|
subType = (tempByte & 0x0F);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 1, "%s %s",
|
2007-03-02 23:44:54 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x0F, 8, "Power Priority:", "Power Priority:"),
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(subType, media_power_priority, "Reserved"));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
tempOffset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2009-06-15 14:59:08 +00:00
|
|
|
/* Power Value: 0 to 102.3 Watts (0.1 W increments) */
|
2009-06-09 16:51:04 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, tempOffset) * 100;
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
2009-06-09 16:51:04 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, 2, "Power Value: %u mW", tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 5: /* Hardware Revision */
|
|
|
|
{
|
|
|
|
/* Figure out the length of the hardware revision field */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen > 0)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 05:22:20 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tlvLen, "Hardware Revision: %s",
|
|
|
|
tvb_format_stringzpad(tvb, tempOffset, tlvLen));
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 6: /* Firmware Revision */
|
|
|
|
{
|
|
|
|
/* Figure out the length of the firmware revision field */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen > 0)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 05:22:20 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tlvLen, "Firmware Revision: %s",
|
|
|
|
tvb_format_stringzpad(tvb, tempOffset, tlvLen));
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 7: /* Software Revision */
|
|
|
|
{
|
|
|
|
/* Figure out the length of the software revision field */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen > 0)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 05:22:20 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tlvLen, "Software Revision: %s",
|
|
|
|
tvb_format_stringzpad(tvb, tempOffset, tlvLen));
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 8: /* Serial Number */
|
|
|
|
{
|
|
|
|
/* Figure out the length of the serial number field */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen > 0)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 05:22:20 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tlvLen, "Serial Number: %s",
|
|
|
|
tvb_format_stringzpad(tvb, tempOffset, tlvLen));
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 9: /* Manufacturer Name */
|
|
|
|
{
|
|
|
|
/* Figure out the length of the manufacturer name field */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen > 0)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 05:22:20 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tlvLen, "Manufacturer Name: %s",
|
|
|
|
tvb_format_stringzpad(tvb, tempOffset, tlvLen));
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 10: /* Model Name */
|
|
|
|
{
|
|
|
|
/* Figure out the length of the model name field */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen > 0)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 05:22:20 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tlvLen, "Model Name: %s",
|
|
|
|
tvb_format_stringzpad(tvb, tempOffset, tlvLen));
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 11: /* Asset ID */
|
|
|
|
{
|
|
|
|
/* Figure out the length of the asset id field */
|
2005-09-15 05:22:20 +00:00
|
|
|
if (tlvLen > 0)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
if (tree)
|
2005-09-15 05:22:20 +00:00
|
|
|
proto_tree_add_text(tree, tvb, tempOffset, tlvLen, "Asset ID: %s",
|
|
|
|
tvb_format_stringzpad(tvb, tempOffset, tlvLen));
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-11-12 10:09:02 +00:00
|
|
|
|
2007-01-10 21:46:50 +00:00
|
|
|
static guint32
|
|
|
|
dissect_profinet_period(tvbuff_t *tvb, proto_tree *tree, guint32 offset, const gchar *name, int hf_valid, int hf_value)
|
|
|
|
{
|
|
|
|
guint32 period;
|
|
|
|
proto_tree *period_tree;
|
|
|
|
proto_item *period_item;
|
|
|
|
|
|
|
|
|
|
|
|
period = tvb_get_ntohl(tvb, offset);
|
|
|
|
|
|
|
|
period_item = proto_tree_add_text(tree, tvb, offset, 4, "%s: %s, %uns",
|
|
|
|
name, (period & 0x80000000) ? "Valid" : "Invalid", period & 0x7FFFFFFF);
|
|
|
|
period_tree = proto_item_add_subtree(period_item, ett_profinet_period);
|
|
|
|
|
|
|
|
proto_tree_add_uint(period_tree, hf_valid, tvb, offset, 4, period);
|
|
|
|
proto_tree_add_uint(period_tree, hf_value, tvb, offset, 4, period);
|
|
|
|
offset+=4;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2005-11-12 10:09:02 +00:00
|
|
|
|
|
|
|
/* Dissect PROFINET TLVs */
|
|
|
|
static void
|
2012-04-13 22:26:35 +00:00
|
|
|
dissect_profinet_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
2005-11-12 10:09:02 +00:00
|
|
|
{
|
|
|
|
guint8 subType;
|
|
|
|
proto_item *tf = NULL;
|
|
|
|
guint16 class2_PortStatus;
|
|
|
|
guint16 class3_PortStatus;
|
|
|
|
guint32 port_rx_delay_local;
|
|
|
|
guint32 port_rx_delay_remote;
|
|
|
|
guint32 port_tx_delay_local;
|
|
|
|
guint32 port_tx_delay_remote;
|
|
|
|
guint32 cable_delay_local;
|
2006-11-11 01:29:43 +00:00
|
|
|
e_guid_t * uuid;
|
|
|
|
guint16 mrrt_PortStatus;
|
2005-11-12 10:09:02 +00:00
|
|
|
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-11-12 10:09:02 +00:00
|
|
|
/* Get subtype */
|
|
|
|
subType = tvb_get_guint8(tvb, offset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_uint(tree, hf_profinet_tlv_subtype, tvb, offset, 1, subType);
|
|
|
|
offset++;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-11-12 10:09:02 +00:00
|
|
|
switch (subType)
|
|
|
|
{
|
2007-03-03 09:30:15 +00:00
|
|
|
case 1: /* LLDP_PNIO_DELAY */
|
2005-11-12 10:09:02 +00:00
|
|
|
{
|
|
|
|
port_rx_delay_local = tvb_get_ntohl(tvb, offset);
|
|
|
|
tf = proto_tree_add_uint(tree, hf_profinet_port_rx_delay_local, tvb, offset, 4, port_rx_delay_local);
|
|
|
|
if(port_rx_delay_local) {
|
|
|
|
proto_item_append_text(tf, "ns");
|
|
|
|
} else {
|
|
|
|
proto_item_append_text(tf, " (unknown)");
|
|
|
|
}
|
|
|
|
offset+=4;
|
|
|
|
port_rx_delay_remote = tvb_get_ntohl(tvb, offset);
|
|
|
|
tf = proto_tree_add_uint(tree, hf_profinet_port_rx_delay_remote, tvb, offset, 4, port_rx_delay_remote);
|
|
|
|
if(port_rx_delay_remote) {
|
|
|
|
proto_item_append_text(tf, "ns");
|
|
|
|
} else {
|
|
|
|
proto_item_append_text(tf, " (unknown)");
|
|
|
|
}
|
|
|
|
offset+=4;
|
|
|
|
port_tx_delay_local = tvb_get_ntohl(tvb, offset);
|
|
|
|
tf = proto_tree_add_uint(tree, hf_profinet_port_tx_delay_local, tvb, offset, 4, port_tx_delay_local);
|
|
|
|
if(port_tx_delay_local) {
|
|
|
|
proto_item_append_text(tf, "ns");
|
|
|
|
} else {
|
|
|
|
proto_item_append_text(tf, " (unknown)");
|
|
|
|
}
|
|
|
|
offset+=4;
|
|
|
|
port_tx_delay_remote = tvb_get_ntohl(tvb, offset);
|
|
|
|
tf = proto_tree_add_uint(tree, hf_profinet_port_tx_delay_remote, tvb, offset, 4, port_tx_delay_remote);
|
|
|
|
if(port_tx_delay_remote) {
|
|
|
|
proto_item_append_text(tf, "ns");
|
|
|
|
} else {
|
|
|
|
proto_item_append_text(tf, " (unknown)");
|
|
|
|
}
|
|
|
|
offset+=4;
|
|
|
|
cable_delay_local = tvb_get_ntohl(tvb, offset);
|
|
|
|
tf = proto_tree_add_uint(tree, hf_profinet_cable_delay_local, tvb, offset, 4, cable_delay_local);
|
|
|
|
if(cable_delay_local) {
|
|
|
|
proto_item_append_text(tf, "ns");
|
|
|
|
} else {
|
|
|
|
proto_item_append_text(tf, " (unknown)");
|
|
|
|
}
|
|
|
|
offset+=4;
|
|
|
|
break;
|
|
|
|
}
|
2007-03-03 09:30:15 +00:00
|
|
|
case 2: /* LLDP_PNIO_PORTSTATUS */
|
2005-11-12 10:09:02 +00:00
|
|
|
{
|
|
|
|
class2_PortStatus = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_uint(tree, hf_profinet_class2_port_status, tvb, offset, 2, class2_PortStatus);
|
|
|
|
offset+=2;
|
|
|
|
class3_PortStatus = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_uint(tree, hf_profinet_class3_port_status, tvb, offset, 2, class3_PortStatus);
|
|
|
|
offset+=2;
|
|
|
|
break;
|
|
|
|
}
|
2007-03-03 09:30:15 +00:00
|
|
|
/*case 3:*/ /* XXX - LLDP_PNIO_ALIAS */
|
|
|
|
case 4: /* LLDP_PNIO_MRPPORTSTATUS */
|
2006-11-11 01:29:43 +00:00
|
|
|
{
|
|
|
|
/* DomainUUID */
|
|
|
|
tvb_get_ntohguid (tvb, offset, (e_guid_t *) &uuid);
|
|
|
|
proto_tree_add_guid(tree, hf_profinet_mrp_domain_uuid, tvb, offset, 16, (e_guid_t *) &uuid);
|
|
|
|
offset += 16;
|
|
|
|
|
|
|
|
/* MRRT PortStatus */
|
|
|
|
mrrt_PortStatus = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_uint(tree, hf_profinet_mrrt_port_status, tvb, offset, 2, mrrt_PortStatus);
|
|
|
|
offset+=2;
|
|
|
|
break;
|
|
|
|
}
|
2007-03-03 09:30:15 +00:00
|
|
|
case 5: /* LLDP_PNIO_CHASSIS_MAC */
|
2006-06-22 19:19:41 +00:00
|
|
|
{
|
2011-01-16 03:57:12 +00:00
|
|
|
proto_tree_add_item(tree, hf_profinet_cm_mac, tvb, offset, 6, ENC_NA);
|
2006-06-22 19:19:41 +00:00
|
|
|
offset += 6;
|
|
|
|
break;
|
2006-11-17 22:38:34 +00:00
|
|
|
}
|
2007-03-03 09:30:15 +00:00
|
|
|
case 6: /* LLDP_PNIO_PTCPSTATUS */
|
2006-11-17 22:38:34 +00:00
|
|
|
{
|
|
|
|
/* MasterSourceAddress */
|
2011-01-16 03:57:12 +00:00
|
|
|
proto_tree_add_item(tree, hf_profinet_master_source_address, tvb, offset, 6, ENC_NA);
|
2006-11-17 22:38:34 +00:00
|
|
|
offset += 6;
|
|
|
|
/* SubdomainUUID */
|
|
|
|
tvb_get_ntohguid (tvb, offset, (e_guid_t *) &uuid);
|
|
|
|
proto_tree_add_guid(tree, hf_profinet_subdomain_uuid, tvb, offset, 16, (e_guid_t *) &uuid);
|
|
|
|
offset += 16;
|
2007-01-10 21:46:50 +00:00
|
|
|
/* IRDataUUID */
|
2006-11-17 22:38:34 +00:00
|
|
|
tvb_get_ntohguid (tvb, offset, (e_guid_t *) &uuid);
|
|
|
|
proto_tree_add_guid(tree, hf_profinet_ir_data_uuid, tvb, offset, 16, (e_guid_t *) &uuid);
|
|
|
|
offset += 16;
|
2007-01-10 21:46:50 +00:00
|
|
|
/* LengthOfPeriod */
|
|
|
|
offset = dissect_profinet_period(tvb, tree, offset, "LengthOfPeriod",
|
|
|
|
hf_profinet_length_of_period_valid, hf_profinet_length_of_period_length);
|
|
|
|
/* RedPeriodBegin */
|
|
|
|
offset = dissect_profinet_period(tvb, tree, offset, "RedPeriodBegin",
|
|
|
|
hf_profinet_red_period_begin_valid, hf_profinet_red_period_begin_offset);
|
|
|
|
/* OrangePeriodBegin */
|
|
|
|
offset = dissect_profinet_period(tvb, tree, offset, "OrangePeriodBegin",
|
|
|
|
hf_profinet_orange_period_begin_valid, hf_profinet_orange_period_begin_offset);
|
|
|
|
/* GreenPeriodBegin */
|
|
|
|
offset = dissect_profinet_period(tvb, tree, offset, "GreenPeriodBegin",
|
|
|
|
hf_profinet_green_period_begin_valid, hf_profinet_green_period_begin_offset);
|
2006-11-17 22:38:34 +00:00
|
|
|
break;
|
2006-06-22 19:19:41 +00:00
|
|
|
}
|
2005-11-12 10:09:02 +00:00
|
|
|
default:
|
2012-04-13 22:26:35 +00:00
|
|
|
proto_tree_add_item(tree, hf_unknown_subtype, tvb, offset, -1, ENC_NA);
|
2005-11-12 10:09:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-16 21:32:39 +00:00
|
|
|
/* Dissect Cisco OUI TLVs */
|
|
|
|
static void
|
|
|
|
dissect_cisco_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
|
|
|
{
|
|
|
|
guint8 subType;
|
|
|
|
guint8 tempByte;
|
|
|
|
guint32 tempOffset = offset;
|
|
|
|
|
|
|
|
proto_tree *fourwire_data = NULL;
|
|
|
|
proto_item *tf = NULL;
|
|
|
|
|
|
|
|
/* Get subtype */
|
|
|
|
subType = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(tree, hf_cisco_subtype, tvb, tempOffset, 1, ENC_BIG_ENDIAN);
|
2011-01-16 21:32:39 +00:00
|
|
|
|
|
|
|
tempOffset++;
|
|
|
|
|
|
|
|
switch (subType)
|
|
|
|
{
|
|
|
|
case 0x01: /* Four-Wire Power-via-MDI TLV */
|
|
|
|
tempByte = tvb_get_guint8(tvb, tempOffset);
|
|
|
|
if (tree) {
|
|
|
|
tf = proto_tree_add_text(tree, tvb, tempOffset, 1, "Four-Wire Power-via-MDI: 0x%02x", tempByte);
|
|
|
|
fourwire_data = proto_item_add_subtree(tf, ett_cisco_fourwire_tlv);
|
|
|
|
|
|
|
|
proto_tree_add_text(fourwire_data, tvb, tempOffset, 1, "%s",
|
2011-03-03 03:09:21 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x01, 8,
|
|
|
|
"PSE Four-Wire PoE Supported",
|
2011-01-16 21:32:39 +00:00
|
|
|
"PSE Four-Wire PoE Not Supported"));
|
|
|
|
|
|
|
|
proto_tree_add_text(fourwire_data, tvb, tempOffset, 1, "%s",
|
2011-03-03 03:09:21 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x02, 8,
|
|
|
|
"PD Spare Pair Architecture Shared",
|
2011-01-16 21:32:39 +00:00
|
|
|
"PD Spare Pair Architecture Independent"));
|
|
|
|
|
|
|
|
proto_tree_add_text(fourwire_data, tvb, tempOffset, 1, "%s",
|
2011-03-03 03:09:21 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x04, 8,
|
|
|
|
"PD Request Spare Pair PoE On",
|
2011-01-16 21:32:39 +00:00
|
|
|
"PD Request Spare Pair PoE Off"));
|
|
|
|
|
|
|
|
proto_tree_add_text(fourwire_data, tvb, tempOffset, 1, "%s",
|
2011-03-03 03:09:21 +00:00
|
|
|
decode_boolean_bitfield(tempByte, 0x08, 8,
|
|
|
|
"PSE Spare Pair PoE On",
|
2011-01-16 21:32:39 +00:00
|
|
|
"PSE Spare Pair PoE Off"));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(tree, hf_unknown_subtype, tvb, offset, 1, ENC_NA);
|
2011-01-16 21:32:39 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2005-11-12 10:09:02 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Dissect Organizational Specific TLV */
|
|
|
|
static gint32
|
|
|
|
dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset)
|
|
|
|
{
|
|
|
|
guint16 tempLen;
|
|
|
|
guint16 tempShort;
|
2012-04-13 22:26:35 +00:00
|
|
|
guint32 oui, tLength = tvb_length(tvb);
|
2005-09-14 19:06:54 +00:00
|
|
|
guint8 subType;
|
2005-09-15 08:57:51 +00:00
|
|
|
const char *ouiStr;
|
|
|
|
const char *subTypeStr;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *org_tlv_tree = NULL;
|
|
|
|
proto_item *tf = NULL;
|
|
|
|
/* Get tlv type and length */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, offset);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv length */
|
|
|
|
tempLen = TLV_INFO_LEN(tempShort);
|
|
|
|
/* Get OUI value */
|
|
|
|
oui = tvb_get_ntoh24(tvb, (offset+2));
|
|
|
|
subType = tvb_get_guint8(tvb, (offset+5));
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2012-04-13 22:29:11 +00:00
|
|
|
/* check for registered dissectors for the OUI If none found continue, else call dissector */
|
|
|
|
if( dissector_try_uint(oui_unique_code_table, oui, tvb, pinfo, tree) ) {
|
2012-04-13 22:26:35 +00:00
|
|
|
return tLength;
|
|
|
|
}
|
|
|
|
/* maintain previous OUI names. If not included, look in manuf database for OUI */
|
2012-08-10 22:55:02 +00:00
|
|
|
ouiStr = val_to_str_const(oui, tlv_oui_subtype_vals, "Unknown");
|
2012-04-13 22:26:35 +00:00
|
|
|
if (strcmp(ouiStr, "Unknown")==0) {
|
|
|
|
ouiStr = uint_get_manuf_name_if_known(oui);
|
|
|
|
if(ouiStr==NULL) ouiStr="Unknown";
|
|
|
|
}
|
2005-09-15 04:08:53 +00:00
|
|
|
switch(oui)
|
|
|
|
{
|
2005-09-15 05:22:20 +00:00
|
|
|
case OUI_IEEE_802_1:
|
2005-11-12 10:09:02 +00:00
|
|
|
subTypeStr = val_to_str(subType, ieee_802_1_subtypes, "Unknown subtype 0x%x");
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
case OUI_IEEE_802_3:
|
2005-11-12 10:09:02 +00:00
|
|
|
subTypeStr = val_to_str(subType, ieee_802_3_subtypes, "Unknown subtype 0x%x");
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
case OUI_MEDIA_ENDPOINT:
|
2005-11-12 10:09:02 +00:00
|
|
|
subTypeStr = val_to_str(subType, media_subtypes, "Unknown subtype 0x%x");
|
|
|
|
break;
|
|
|
|
case OUI_PROFINET:
|
|
|
|
subTypeStr = val_to_str(subType, profinet_subtypes, "Reserved (0x%x)");
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
2011-01-16 21:32:39 +00:00
|
|
|
case OUI_CISCO_2:
|
|
|
|
subTypeStr = val_to_str(subType, cisco_subtypes, "Unknown subtype (0x%x)");
|
|
|
|
break;
|
2011-05-07 14:50:36 +00:00
|
|
|
case OUI_IEEE_802_1QBG:
|
|
|
|
subTypeStr = val_to_str(subType, ieee_802_1qbg_subtypes, "Unknown subtype 0x%x");
|
|
|
|
break;
|
2005-09-14 19:06:54 +00:00
|
|
|
default:
|
2012-04-13 22:26:35 +00:00
|
|
|
subTypeStr = ep_strdup_printf("Unknown (%d)",subType);
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
2005-09-15 04:08:53 +00:00
|
|
|
}
|
|
|
|
if (tree)
|
|
|
|
{
|
2012-04-13 22:26:35 +00:00
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, tLength, "%s - %s", ouiStr, subTypeStr);
|
2005-09-15 04:08:53 +00:00
|
|
|
org_tlv_tree = proto_item_add_subtree(tf, ett_org_spc_tlv);
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(org_tlv_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2005-09-15 05:22:20 +00:00
|
|
|
}
|
|
|
|
if (tempLen < 4)
|
|
|
|
{
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_uint_format(org_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2,
|
|
|
|
tempShort, "TLV Length: %u (too short, must be >= 4)", tempLen);
|
2012-04-13 22:26:35 +00:00
|
|
|
return tLength;
|
2005-09-15 05:22:20 +00:00
|
|
|
}
|
|
|
|
if (tree)
|
|
|
|
{
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(org_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Display organizational unique id */
|
2012-04-13 22:26:35 +00:00
|
|
|
proto_tree_add_uint(org_tlv_tree, hf_org_spc_oui, tvb, (offset + 2), 3, oui);
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
switch (oui)
|
|
|
|
{
|
|
|
|
case OUI_IEEE_802_1:
|
2012-04-13 22:26:35 +00:00
|
|
|
dissect_ieee_802_1_tlv(tvb, pinfo, org_tlv_tree, (offset + 5));
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
case OUI_IEEE_802_3:
|
2012-04-13 22:26:35 +00:00
|
|
|
dissect_ieee_802_3_tlv(tvb, pinfo, org_tlv_tree, (offset + 5));
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
|
|
|
case OUI_MEDIA_ENDPOINT:
|
2012-04-13 22:26:35 +00:00
|
|
|
dissect_media_tlv(tvb, pinfo, org_tlv_tree, (offset + 5));
|
2005-09-14 19:06:54 +00:00
|
|
|
break;
|
2005-11-12 10:09:02 +00:00
|
|
|
case OUI_PROFINET:
|
2012-04-13 22:26:35 +00:00
|
|
|
dissect_profinet_tlv(tvb, pinfo, org_tlv_tree, (offset + 5));
|
2005-11-12 10:09:02 +00:00
|
|
|
break;
|
2011-01-16 21:32:39 +00:00
|
|
|
case OUI_CISCO_2:
|
2012-04-13 22:26:35 +00:00
|
|
|
dissect_cisco_tlv(tvb, pinfo, org_tlv_tree, (offset + 5));
|
2011-01-16 21:32:39 +00:00
|
|
|
break;
|
2011-05-07 14:50:36 +00:00
|
|
|
case OUI_IEEE_802_1QBG:
|
2012-04-13 22:26:35 +00:00
|
|
|
dissect_ieee_802_1qbg_tlv(tvb, pinfo, org_tlv_tree, (offset + 5));
|
2011-05-07 14:50:36 +00:00
|
|
|
break;
|
2005-11-12 10:09:02 +00:00
|
|
|
default:
|
2012-04-13 22:26:35 +00:00
|
|
|
dissect_oui_default_tlv(tvb, pinfo, org_tlv_tree, (offset + 5));
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2012-04-13 22:26:35 +00:00
|
|
|
return offset + tvb_length(tvb);
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect Unknown TLV */
|
|
|
|
static gint32
|
2005-09-23 10:39:58 +00:00
|
|
|
dissect_lldp_unknown_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
|
|
|
guint16 tempLen;
|
|
|
|
guint16 tempShort;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
proto_tree *unknown_tlv_tree = NULL;
|
|
|
|
proto_item *tf = NULL;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get tlv type and length */
|
2005-09-15 04:08:53 +00:00
|
|
|
tempShort = tvb_get_ntohs(tvb, offset);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
/* Get tlv length */
|
|
|
|
tempLen = TLV_INFO_LEN(tempShort);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "Unknown TLV");
|
|
|
|
unknown_tlv_tree = proto_item_add_subtree(tf, ett_unknown_tlv);
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(unknown_tlv_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(unknown_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return (tempLen + 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Dissect LLDP packets */
|
|
|
|
static void
|
|
|
|
dissect_lldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *lldp_tree = NULL;
|
2012-04-13 22:26:35 +00:00
|
|
|
tvbuff_t *new_tvb = NULL;
|
2005-09-14 19:06:54 +00:00
|
|
|
guint32 offset = 0;
|
|
|
|
gint32 rtnValue = 0;
|
|
|
|
guint16 tempShort;
|
|
|
|
guint8 tempType;
|
|
|
|
gboolean reachedEnd = FALSE;
|
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LLDP");
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Clear the information column on summary display */
|
2009-08-09 08:14:59 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2005-09-14 19:06:54 +00:00
|
|
|
|
2007-03-02 23:44:54 +00:00
|
|
|
if (tree)
|
2005-09-14 19:06:54 +00:00
|
|
|
{
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_lldp, tvb, offset, -1, ENC_NA);
|
2005-09-14 19:06:54 +00:00
|
|
|
lldp_tree = proto_item_add_subtree(ti, ett_lldp);
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get chassis id tlv */
|
|
|
|
rtnValue = dissect_lldp_chassis_id(tvb, pinfo, lldp_tree, offset);
|
|
|
|
if (rtnValue < 0)
|
|
|
|
{
|
2009-08-09 07:01:26 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Invalid Chassis ID TLV");
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
offset += rtnValue;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get port id tlv */
|
|
|
|
rtnValue = dissect_lldp_port_id(tvb, pinfo, lldp_tree, offset);
|
|
|
|
if (rtnValue < 0)
|
|
|
|
{
|
2009-08-09 07:01:26 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Invalid Port ID TLV");
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
offset += rtnValue;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Get time to live tlv */
|
|
|
|
rtnValue = dissect_lldp_time_to_live(tvb, pinfo, lldp_tree, offset);
|
|
|
|
if (rtnValue < 0)
|
|
|
|
{
|
2009-08-09 07:01:26 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Invalid Time-to-Live TLV");
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
return;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
offset += rtnValue;
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Dissect optional tlv's until end-of-lldpdu is reached */
|
|
|
|
while (!reachedEnd)
|
|
|
|
{
|
|
|
|
tempShort = tvb_get_ntohs(tvb, offset);
|
2005-09-15 04:08:53 +00:00
|
|
|
tempType = TLV_TYPE(tempShort);
|
2012-04-13 22:26:35 +00:00
|
|
|
/* pass only TLV to dissectors, Zero offset (point to front of tlv) */
|
|
|
|
new_tvb = tvb_new_subset(tvb, offset, TLV_INFO_LEN(tempShort)+2, TLV_INFO_LEN(tempShort)+2);
|
2005-09-15 04:08:53 +00:00
|
|
|
switch (tempType)
|
|
|
|
{
|
|
|
|
case CHASSIS_ID_TLV_TYPE:
|
2012-04-13 22:26:35 +00:00
|
|
|
rtnValue = dissect_lldp_chassis_id(new_tvb, pinfo, lldp_tree, 0);
|
2005-09-15 04:08:53 +00:00
|
|
|
rtnValue = -1; /* Duplicate chassis id tlv */
|
2009-08-09 07:01:26 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Duplicate Chassis ID TLV");
|
2005-09-15 04:08:53 +00:00
|
|
|
break;
|
|
|
|
case PORT_ID_TLV_TYPE:
|
2012-04-13 22:26:35 +00:00
|
|
|
rtnValue = dissect_lldp_port_id(new_tvb, pinfo, lldp_tree, 0);
|
2005-09-15 04:08:53 +00:00
|
|
|
rtnValue = -1; /* Duplicate port id tlv */
|
2009-08-09 07:01:26 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Duplicate Port ID TLV");
|
2005-09-15 04:08:53 +00:00
|
|
|
break;
|
|
|
|
case TIME_TO_LIVE_TLV_TYPE:
|
2012-04-13 22:26:35 +00:00
|
|
|
rtnValue = dissect_lldp_time_to_live(new_tvb, pinfo, lldp_tree, 0);
|
2005-09-15 04:08:53 +00:00
|
|
|
rtnValue = -1; /* Duplicate time-to-live tlv */
|
2009-08-09 07:01:26 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Duplicate Time-To-Live TLV");
|
2005-09-15 04:08:53 +00:00
|
|
|
break;
|
|
|
|
case END_OF_LLDPDU_TLV_TYPE:
|
2012-04-13 22:26:35 +00:00
|
|
|
rtnValue = dissect_lldp_end_of_lldpdu(new_tvb, pinfo, lldp_tree, 0);
|
2005-09-15 04:08:53 +00:00
|
|
|
break;
|
|
|
|
case PORT_DESCRIPTION_TLV_TYPE:
|
2012-04-13 22:26:35 +00:00
|
|
|
rtnValue = dissect_lldp_port_desc(new_tvb, pinfo, lldp_tree, 0);
|
2005-09-15 04:08:53 +00:00
|
|
|
break;
|
|
|
|
case SYSTEM_NAME_TLV_TYPE:
|
|
|
|
case SYSTEM_DESCRIPTION_TLV_TYPE:
|
2012-04-13 22:26:35 +00:00
|
|
|
rtnValue = dissect_lldp_system_name(new_tvb, pinfo, lldp_tree, 0);
|
2005-09-15 04:08:53 +00:00
|
|
|
break;
|
|
|
|
case SYSTEM_CAPABILITIES_TLV_TYPE:
|
2012-04-13 22:26:35 +00:00
|
|
|
rtnValue = dissect_lldp_system_capabilities(new_tvb, pinfo, lldp_tree, 0);
|
2005-09-15 04:08:53 +00:00
|
|
|
break;
|
|
|
|
case MANAGEMENT_ADDR_TLV_TYPE:
|
2012-04-13 22:26:35 +00:00
|
|
|
rtnValue = dissect_lldp_management_address(new_tvb, pinfo, lldp_tree, 0);
|
2005-09-15 04:08:53 +00:00
|
|
|
break;
|
|
|
|
case ORGANIZATION_SPECIFIC_TLV_TYPE:
|
2012-04-13 22:26:35 +00:00
|
|
|
rtnValue = dissect_organizational_specific_tlv(new_tvb, pinfo, lldp_tree, 0);
|
2005-09-15 04:08:53 +00:00
|
|
|
break;
|
|
|
|
default:
|
2012-04-13 22:26:35 +00:00
|
|
|
rtnValue = dissect_lldp_unknown_tlv(new_tvb, pinfo, lldp_tree, 0);
|
2005-09-15 04:08:53 +00:00
|
|
|
break;
|
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-15 04:08:53 +00:00
|
|
|
if (rtnValue < 0)
|
|
|
|
reachedEnd = TRUE;
|
|
|
|
else
|
|
|
|
offset += rtnValue;
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
|
|
|
|
2006-05-21 04:49:01 +00:00
|
|
|
/* Register the protocol with Wireshark */
|
2005-09-14 19:06:54 +00:00
|
|
|
void
|
|
|
|
proto_register_lldp(void)
|
2005-09-15 04:08:53 +00:00
|
|
|
{
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Setup list of header fields */
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_lldp_tlv_type,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "TLV Type", "lldp.tlv.type", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(tlv_types), TLV_TYPE_MASK, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_lldp_tlv_len,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "TLV Length", "lldp.tlv.len", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, TLV_INFO_LEN_MASK, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_chassis_id_subtype,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Chassis Id Subtype", "lldp.chassis.subtype", FT_UINT8, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(chassis_id_subtypes), 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_chassis_id,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Chassis Id", "lldp.chassis.id", FT_BYTES, BASE_NONE,
|
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_chassis_id_mac,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Chassis Id", "lldp.chassis.id.mac", FT_ETHER, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_chassis_id_ip4,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Chassis Id", "lldp.chassis.id.ip4", FT_IPv4, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_chassis_id_ip6,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Chassis Id", "lldp.chassis.id.ip6", FT_IPv6, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_port_id_subtype,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Port Id Subtype", "lldp.port.subtype", FT_UINT8, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(port_id_subtypes), 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_port_id_mac,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Port Id", "lldp.port.id.mac", FT_ETHER, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
2006-01-23 22:13:08 +00:00
|
|
|
{ &hf_lldp_network_address_family,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Network Address family", "lldp.network_address.subtype", FT_UINT8, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(afn_vals), 0, NULL, HFILL }
|
2006-01-23 22:13:08 +00:00
|
|
|
},
|
2005-09-14 19:06:54 +00:00
|
|
|
{ &hf_port_id_ip4,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Port Id", "lldp.port.id.ip4", FT_IPv4, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_port_id_ip6,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Port Id", "lldp.port.id.ip6", FT_IPv6, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_time_to_live,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Seconds", "lldp.time_to_live", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_mgn_addr_ipv4,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Management Address", "lldp.mgn.addr.ip4", FT_IPv4, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
2005-09-15 04:08:53 +00:00
|
|
|
{ &hf_mgn_addr_ipv6,
|
2007-03-02 23:44:54 +00:00
|
|
|
{ "Management Address", "lldp.mgn.addr.ip6", FT_IPv6, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-15 04:08:53 +00:00
|
|
|
},
|
2005-09-14 19:06:54 +00:00
|
|
|
{ &hf_mgn_addr_hex,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Management Address", "lldp.mgn.addr.hex", FT_BYTES, BASE_NONE,
|
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_mgn_obj_id,
|
2012-04-13 22:26:35 +00:00
|
|
|
{ "Object Identifier", "lldp.mgn.obj.id", FT_OID, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
2006-01-23 22:13:08 +00:00
|
|
|
{ &hf_org_spc_oui,
|
2011-05-07 14:50:36 +00:00
|
|
|
{ "Organization Unique Code", "lldp.orgtlv.oui", FT_UINT24, BASE_HEX,
|
2012-04-13 22:26:35 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_ieee_802_1_subtype,
|
2011-05-07 14:50:36 +00:00
|
|
|
{ "IEEE 802.1 Subtype", "lldp.ieee.802_1.subtype", FT_UINT8, BASE_HEX,
|
|
|
|
VALS(ieee_802_1_subtypes), 0x0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_ieee_802_3_subtype,
|
2011-05-07 14:50:36 +00:00
|
|
|
{ "IEEE 802.3 Subtype", "lldp.ieee.802_3.subtype", FT_UINT8, BASE_HEX,
|
|
|
|
VALS(ieee_802_3_subtypes), 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_ieee_802_1qbg_subtype,
|
|
|
|
{ "IEEE 802.1Qbg Subtype", "lldp.ieee.802_1qbg.subtype", FT_UINT8, BASE_HEX,
|
|
|
|
VALS(ieee_802_1qbg_subtypes), 0x0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_media_tlv_subtype,
|
|
|
|
{ "Media Subtype", "lldp.media.subtype", FT_UINT8, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(media_subtypes), 0x0, NULL, HFILL }
|
2005-09-14 19:06:54 +00:00
|
|
|
},
|
2005-11-12 10:09:02 +00:00
|
|
|
{ &hf_profinet_tlv_subtype,
|
|
|
|
{ "Subtype", "lldp.profinet.subtype", FT_UINT8, BASE_HEX,
|
|
|
|
VALS(profinet_subtypes), 0x0, "PROFINET Subtype", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_profinet_port_rx_delay_local,
|
|
|
|
{ "Port RX Delay Local", "lldp.profinet.port_rx_delay_local", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2005-11-12 10:09:02 +00:00
|
|
|
},
|
|
|
|
{ &hf_profinet_port_rx_delay_remote,
|
|
|
|
{ "Port RX Delay Remote", "lldp.profinet.port_rx_delay_remote", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2005-11-12 10:09:02 +00:00
|
|
|
},
|
|
|
|
{ &hf_profinet_port_tx_delay_local,
|
|
|
|
{ "Port TX Delay Local", "lldp.profinet.port_tx_delay_local", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2005-11-12 10:09:02 +00:00
|
|
|
},
|
|
|
|
{ &hf_profinet_port_tx_delay_remote,
|
|
|
|
{ "Port TX Delay Remote", "lldp.profinet.port_tx_delay_remote", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2005-11-12 10:09:02 +00:00
|
|
|
},
|
|
|
|
{ &hf_profinet_cable_delay_local,
|
|
|
|
{ "Port Cable Delay Local", "lldp.profinet.cable_delay_local", FT_UINT32, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2005-11-12 10:09:02 +00:00
|
|
|
},
|
|
|
|
{ &hf_profinet_class2_port_status,
|
|
|
|
{ "RTClass2 Port Status", "lldp.profinet.rtc2_port_status", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(profinet_port2_status_vals), 0x0, NULL, HFILL }
|
2005-11-12 10:09:02 +00:00
|
|
|
},
|
|
|
|
{ &hf_profinet_class3_port_status,
|
|
|
|
{ "RTClass3 Port Status", "lldp.profinet.rtc3_port_status", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(profinet_port3_status_vals), 0x0, NULL, HFILL }
|
2005-11-12 10:09:02 +00:00
|
|
|
},
|
2006-11-11 01:29:43 +00:00
|
|
|
{ &hf_profinet_mrp_domain_uuid,
|
|
|
|
{ "MRP DomainUUID", "lldp.profinet.mrp_domain_uuid", FT_GUID, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2006-11-11 01:29:43 +00:00
|
|
|
},
|
|
|
|
{ &hf_profinet_mrrt_port_status,
|
|
|
|
{ "MRRT PortStatus", "lldp.profinet.mrrt_port_status", FT_UINT16, BASE_HEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(profinet_mrrt_port_status_vals), 0x0, NULL, HFILL }
|
2006-11-11 01:29:43 +00:00
|
|
|
},
|
2006-06-22 19:19:41 +00:00
|
|
|
{ &hf_profinet_cm_mac,
|
2006-12-05 08:07:00 +00:00
|
|
|
{ "CMMacAdd", "lldp.profinet.cm_mac_add", FT_ETHER, BASE_NONE,
|
2006-06-22 19:19:41 +00:00
|
|
|
NULL, 0x0, "CMResponderMacAdd or CMInitiatorMacAdd", HFILL }
|
|
|
|
},
|
2006-11-17 22:38:34 +00:00
|
|
|
{ &hf_profinet_master_source_address,
|
|
|
|
{ "MasterSourceAddress", "lldp.profinet.master_source_address", FT_ETHER, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2006-11-17 22:38:34 +00:00
|
|
|
},
|
|
|
|
{ &hf_profinet_subdomain_uuid,
|
|
|
|
{ "SubdomainUUID", "lldp.profinet.subdomain_uuid", FT_GUID, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2006-11-17 22:38:34 +00:00
|
|
|
},
|
|
|
|
{ &hf_profinet_ir_data_uuid,
|
|
|
|
{ "IRDataUUID", "lldp.profinet.ir_data_uuid", FT_GUID, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2006-11-17 22:38:34 +00:00
|
|
|
},
|
2007-01-10 21:46:50 +00:00
|
|
|
{ &hf_profinet_length_of_period_valid,
|
|
|
|
{ "LengthOfPeriod.Valid", "lldp.profinet.length_of_period_valid", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x80000000, "Length field is valid/invalid", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_profinet_length_of_period_length,
|
|
|
|
{ "LengthOfPeriod.Length", "lldp.profinet.length_of_period_length", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x7FFFFFFF, "Duration of a cycle in nanoseconds", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_profinet_red_period_begin_valid,
|
|
|
|
{ "RedPeriodBegin.Valid", "lldp.profinet.red_period_begin_valid", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x80000000, "Offset field is valid/invalid", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_profinet_red_period_begin_offset,
|
|
|
|
{ "RedPeriodBegin.Offset", "lldp.profinet.red_period_begin_offset", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x7FFFFFFF, "RT_CLASS_3 period, offset to cycle begin in nanoseconds", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_profinet_orange_period_begin_valid,
|
|
|
|
{ "OrangePeriodBegin.Valid", "lldp.profinet.orange_period_begin_valid", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x80000000, "Offset field is valid/invalid", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_profinet_orange_period_begin_offset,
|
|
|
|
{ "OrangePeriodBegin.Offset","lldp.profinet.orange_period_begin_offset", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x7FFFFFFF, "RT_CLASS_2 period, offset to cycle begin in nanoseconds", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_profinet_green_period_begin_valid,
|
|
|
|
{ "GreenPeriodBegin.Valid", "lldp.profinet.green_period_begin_valid", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x80000000, "Offset field is valid/invalid", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_profinet_green_period_begin_offset,
|
|
|
|
{ "GreenPeriodBegin.Offset", "lldp.profinet.green_period_begin_offset", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0x7FFFFFFF, "Unrestricted period, offset to cycle begin in nanoseconds", HFILL }
|
|
|
|
},
|
2011-01-16 21:32:39 +00:00
|
|
|
{ &hf_cisco_subtype,
|
|
|
|
{ "Cisco Subtype", "lldp.cisco.subtype", FT_UINT8, BASE_HEX,
|
|
|
|
VALS(cisco_subtypes), 0x0, NULL, HFILL }
|
|
|
|
},
|
2005-11-12 10:09:02 +00:00
|
|
|
{ &hf_unknown_subtype,
|
2012-04-13 22:26:35 +00:00
|
|
|
{ "Unknown Subtype","lldp.unknown_subtype", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_unknown_subtype_content,
|
|
|
|
{ "Unknown Subtype Content","lldp.unknown_subtype.content", FT_BYTES, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }
|
2005-11-12 10:09:02 +00:00
|
|
|
},
|
2005-09-14 19:06:54 +00:00
|
|
|
};
|
2007-03-02 23:44:54 +00:00
|
|
|
|
2005-09-14 19:06:54 +00:00
|
|
|
/* Setup protocol subtree array */
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_lldp,
|
|
|
|
&ett_chassis_id,
|
|
|
|
&ett_port_id,
|
|
|
|
&ett_time_to_live,
|
|
|
|
&ett_end_of_lldpdu,
|
|
|
|
&ett_port_description,
|
|
|
|
&ett_system_name,
|
|
|
|
&ett_system_cap,
|
|
|
|
&ett_system_cap_summary,
|
|
|
|
&ett_system_cap_enabled,
|
|
|
|
&ett_management_address,
|
|
|
|
&ett_unknown_tlv,
|
|
|
|
&ett_org_spc_tlv,
|
|
|
|
&ett_port_vlan_flags,
|
|
|
|
&ett_802_3_flags,
|
2005-09-19 21:24:07 +00:00
|
|
|
&ett_802_3_autoneg_advertised,
|
2005-09-14 19:06:54 +00:00
|
|
|
&ett_802_3_power,
|
|
|
|
&ett_802_3_aggregation,
|
2011-05-07 14:50:36 +00:00
|
|
|
&ett_802_1qbg_capabilities_flags,
|
2005-09-14 19:06:54 +00:00
|
|
|
&ett_media_capabilities,
|
2011-01-16 21:32:39 +00:00
|
|
|
&ett_profinet_period,
|
|
|
|
&ett_cisco_fourwire_tlv
|
2005-09-14 19:06:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Register the protocol name and description */
|
|
|
|
proto_lldp = proto_register_protocol("Link Layer Discovery Protocol", "LLDP", "lldp");
|
|
|
|
|
|
|
|
/* Required function calls to register the header fields and subtrees used */
|
|
|
|
proto_register_field_array(proto_lldp, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2012-04-13 22:29:11 +00:00
|
|
|
oui_unique_code_table = register_dissector_table("lldp.orgtlv.oui", "LLDP OUI", FT_UINT24, BASE_HEX );
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_lldp(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t lldp_handle;
|
|
|
|
|
|
|
|
lldp_handle = create_dissector_handle(dissect_lldp,proto_lldp);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ethertype", ETHERTYPE_LLDP, lldp_handle);
|
2005-09-14 19:06:54 +00:00
|
|
|
}
|