epan/dissectors/pidl/samr/samr.cnf cnf_dissect_lsa_BinaryString => lsarpc_dissect_str...
[wireshark-sm.git] / epan / dissectors / packet-lldp.c
blob0674178f992edd801574d07d830feb7521895e6e
1 /* packet-lldp.c
2 * Routines for LLDP dissection
3 * By Juan Gonzalez <juan.gonzalez@pikatech.com>
4 * Copyright 2005 MITEL
6 * July 2005
7 * Modified by: Brian Bogora <brian_bogora@mitel.com>
9 * October 2014
10 * Modified by:
11 * Hans-Christian Goeckeritz <hans.christian.goeckeritz@gmx.de>
12 * Gregor Miernik <gregor.miernik@hytec.de>
13 * Expansion of dissector for Hytec-OUI
15 * August 2016
16 * Added Avaya IP Phone OUI, Uli Heilmeier <uh@heilmeier.eu>
18 * IEEE 802.1AB
20 * IEEE 802.1Q for the 802.1 Organizationally Specific TLVs.
22 * TIA-1057 for TIA Organizationally Specific TLVs.
24 * Wireshark - Network traffic analyzer
25 * By Gerald Combs <gerald@wireshark.org>
26 * Copyright 1998 Gerald Combs
28 * SPDX-License-Identifier: GPL-2.0-or-later
31 #include "config.h"
33 #include <epan/packet.h>
34 #include <epan/etypes.h>
35 #include <epan/afn.h>
36 #include <epan/addr_resolv.h>
37 #include <epan/expert.h>
38 #include <epan/prefs.h>
39 #include <epan/tfs.h>
40 #include <epan/unit_strings.h>
42 #include <wsutil/array.h>
43 #include <epan/oui.h>
45 #include "packet-enip.h"
47 #define DEFAULT_COLUMN_INFO 1
48 #define PROFINET_SPECIAL_COLUMN_INFO 2
50 /* Structure for general station information */
51 typedef struct _profinet_lldp_column_info {
52 /* general information */
53 char *chassis_id_mac;
54 char *chassis_id_locally_assigned;
55 char *port_id_locally_assigned;
56 bool is_nos_assigned;
57 bool is_port_id_assigned;
58 }profinet_lldp_column_info;
60 static int column_info_selection = DEFAULT_COLUMN_INFO;
61 static bool assume_unrecognized_tlv = false;
63 static dissector_handle_t lldp_handle;
65 void proto_register_lldp(void);
66 void proto_reg_handoff_lldp(void);
68 static int hf_ex_avaya_tlv_subtype;
69 static int hf_ex_avaya_hmac_shi;
70 static int hf_ex_avaya_element_type;
71 static int hf_ex_avaya_state;
72 static int hf_ex_avaya_vlan;
73 static int hf_ex_avaya_mgnt_vlan;
74 static int hf_ex_avaya_rsvd;
75 static int hf_ex_avaya_system_id;
76 static int hf_ex_avaya_status;
77 static int hf_ex_avaya_i_sid;
79 static int hf_ex_avaya2_tlv_subtype;
80 static int hf_ex_avaya2_fabric_connect;
81 static int hf_ex_avaya2_fabric_numbvlans;
82 static int hf_ex_avaya2_fabric_bvlanid;
83 static int hf_ex_avaya2_fabric_sysidlength;
84 static int hf_ex_avaya2_fabric_sysid;
86 /* Sub Dissector Tables */
87 static dissector_table_t oui_unique_code_table;
89 /* Initialize the protocol and registered fields */
90 static int proto_lldp;
91 static int hf_lldp_tlv_type;
92 static int hf_lldp_tlv_len;
93 static int hf_lldp_tlv_system_cap;
94 static int hf_lldp_tlv_system_cap_other;
95 static int hf_lldp_tlv_system_cap_repeater;
96 static int hf_lldp_tlv_system_cap_bridge;
97 static int hf_lldp_tlv_system_cap_wlan_access_pt;
98 static int hf_lldp_tlv_system_cap_router;
99 static int hf_lldp_tlv_system_cap_telephone;
100 static int hf_lldp_tlv_system_cap_docsis_cable_device;
101 static int hf_lldp_tlv_system_cap_station_only;
102 static int hf_lldp_tlv_system_cap_cvlan_component;
103 static int hf_lldp_tlv_system_cap_svlan_component;
104 static int hf_lldp_tlv_system_cap_tpmr_component;
105 static int hf_lldp_tlv_system_name;
106 static int hf_lldp_tlv_system_desc;
107 static int hf_lldp_tlv_enable_system_cap;
108 static int hf_lldp_tlv_enable_system_cap_other;
109 static int hf_lldp_tlv_enable_system_cap_repeater;
110 static int hf_lldp_tlv_enable_system_cap_bridge;
111 static int hf_lldp_tlv_enable_system_cap_wlan_access_pt;
112 static int hf_lldp_tlv_enable_system_cap_router;
113 static int hf_lldp_tlv_enable_system_cap_telephone;
114 static int hf_lldp_tlv_enable_system_cap_docsis_cable_device;
115 static int hf_lldp_tlv_enable_system_cap_station_only;
116 static int hf_lldp_tlv_enable_system_cap_cvlan_component;
117 static int hf_lldp_tlv_enable_system_cap_svlan_component;
118 static int hf_lldp_tlv_enable_system_cap_tpmr_component;
119 static int hf_chassis_id_subtype;
120 static int hf_chassis_id;
121 static int hf_chassis_id_mac;
122 static int hf_chassis_id_ip4;
123 static int hf_chassis_id_ip6;
124 static int hf_port_id_subtype;
125 static int hf_port_id;
126 static int hf_port_desc;
127 static int hf_port_id_mac;
128 static int hf_lldp_network_address_family;
129 static int hf_port_id_ip4;
130 static int hf_port_id_ip6;
131 static int hf_time_to_live;
132 static int hf_pdu_type;
133 static int hf_mgn_address_len;
134 static int hf_mgn_address_subtype;
135 static int hf_mgn_addr_ipv4;
136 static int hf_mgn_addr_ipv6;
137 static int hf_mgn_addr_hex;
138 static int hf_mgn_interface_subtype;
139 static int hf_mgn_interface_number;
140 static int hf_mgn_oid_len;
141 static int hf_mgn_obj_id;
142 static int hf_org_spc_oui;
143 static int hf_dcbx_type;
144 static int hf_dcbx_tlv_type;
145 static int hf_dcbx_tlv_len;
146 static int hf_dcbx_tlv_oper_version;
147 static int hf_dcbx_tlv_max_version;
148 static int hf_dcbx_control_sequence;
149 static int hf_dcbx_control_ack;
150 static int hf_dcbx_feature_flag_enabled;
151 static int hf_dcbx_feature_flag_error;
152 static int hf_dcbx_feature_flag_willing;
153 static int hf_dcbx_feature_subtype;
154 static int hf_dcbx_feature_pgid_reserved;
155 static int hf_dcbx_feature_pgid_prio_0;
156 static int hf_dcbx_feature_pgid_prio_1;
157 static int hf_dcbx_feature_pgid_prio_2;
158 static int hf_dcbx_feature_pgid_prio_3;
159 static int hf_dcbx_feature_pgid_prio_4;
160 static int hf_dcbx_feature_pgid_prio_5;
161 static int hf_dcbx_feature_pgid_prio_6;
162 static int hf_dcbx_feature_pgid_prio_7;
163 static int hf_dcbx_feature_pg_per_0;
164 static int hf_dcbx_feature_pg_per_1;
165 static int hf_dcbx_feature_pg_per_2;
166 static int hf_dcbx_feature_pg_per_3;
167 static int hf_dcbx_feature_pg_per_4;
168 static int hf_dcbx_feature_pg_per_5;
169 static int hf_dcbx_feature_pg_per_6;
170 static int hf_dcbx_feature_pg_per_7;
171 static int hf_dcbx_feature_pg_numtcs;
172 static int hf_dcbx_feature_pfc_prio0;
173 static int hf_dcbx_feature_pfc_prio1;
174 static int hf_dcbx_feature_pfc_prio2;
175 static int hf_dcbx_feature_pfc_prio3;
176 static int hf_dcbx_feature_pfc_prio4;
177 static int hf_dcbx_feature_pfc_prio5;
178 static int hf_dcbx_feature_pfc_prio6;
179 static int hf_dcbx_feature_pfc_prio7;
180 static int hf_dcbx_feature_pfc_numtcs;
181 static int hf_dcbx_feature_app_proto;
182 static int hf_dcbx_feature_app_selector;
183 static int hf_dcbx_feature_app_oui;
184 static int hf_dcbx_feature_app_prio;
185 static int hf_dcbx_feature_flag_llink_type;
186 static int hf_ieee_802_1_subtype;
187 static int hf_ieee_802_1_port_and_vlan_id_flag;
188 static int hf_ieee_802_1_port_and_vlan_id_flag_supported;
189 static int hf_ieee_802_1_port_and_vlan_id_flag_enabled;
190 static int hf_ieee_802_1_port_vlan_id;
191 static int hf_ieee_802_1_port_proto_vlan_id;
192 static int hf_ieee_802_1_vlan_id;
193 static int hf_ieee_802_1_vlan_name_length;
194 static int hf_ieee_802_1_vlan_name;
195 static int hf_ieee_802_1_proto_id_length;
196 static int hf_ieee_802_1_proto_id;
197 static int hf_ieee_802_1_aggregation_status;
198 static int hf_ieee_802_1_aggregation_status_cap;
199 static int hf_ieee_802_1_aggregation_status_enabled;
200 static int hf_ieee_802_1_aggregation_status_porttype;
201 static int hf_ieee_802_1_aggregated_port_id;
202 static int hf_ieee_8021qau_cnpv_prio0;
203 static int hf_ieee_8021qau_cnpv_prio1;
204 static int hf_ieee_8021qau_cnpv_prio2;
205 static int hf_ieee_8021qau_cnpv_prio3;
206 static int hf_ieee_8021qau_cnpv_prio4;
207 static int hf_ieee_8021qau_cnpv_prio5;
208 static int hf_ieee_8021qau_cnpv_prio6;
209 static int hf_ieee_8021qau_cnpv_prio7;
210 static int hf_ieee_8021qau_ready_prio0;
211 static int hf_ieee_8021qau_ready_prio1;
212 static int hf_ieee_8021qau_ready_prio2;
213 static int hf_ieee_8021qau_ready_prio3;
214 static int hf_ieee_8021qau_ready_prio4;
215 static int hf_ieee_8021qau_ready_prio5;
216 static int hf_ieee_8021qau_ready_prio6;
217 static int hf_ieee_8021qau_ready_prio7;
218 static int hf_ieee_8021az_feature_flag_willing;
219 static int hf_ieee_8021az_feature_flag_cbs;
220 static int hf_ieee_8021az_maxtcs;
221 static int hf_ieee_8021az_tsa_class0;
222 static int hf_ieee_8021az_tsa_class1;
223 static int hf_ieee_8021az_tsa_class2;
224 static int hf_ieee_8021az_tsa_class3;
225 static int hf_ieee_8021az_tsa_class4;
226 static int hf_ieee_8021az_tsa_class5;
227 static int hf_ieee_8021az_tsa_class6;
228 static int hf_ieee_8021az_tsa_class7;
229 static int hf_ieee_8021az_feature_flag_mbc;
230 static int hf_ieee_8021az_pfc_numtcs;
231 static int hf_ieee_8021az_app_reserved;
232 static int hf_ieee_8021az_app_prio;
233 static int hf_ieee_8021az_app_selector;
234 static int hf_ieee_802_3_subtype;
235 static int hf_ieee_802_3_mac_phy_auto_neg_status;
236 static int hf_ieee_802_3_mac_phy_auto_neg_status_supported;
237 static int hf_ieee_802_3_mac_phy_auto_neg_status_enabled;
238 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps;
239 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_tfd;
240 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_t;
241 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_xfd;
242 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_x;
243 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_bpause;
244 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_spause;
245 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_apause;
246 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_pause;
247 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t2fd;
248 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t2;
249 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_txfd;
250 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_tx;
251 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t4;
252 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_10base_tfd;
253 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_10base_t;
254 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_other;
255 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_tfd;
256 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_t;
257 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_xfd;
258 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_x;
259 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_bpause;
260 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_spause;
261 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_apause;
262 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_pause;
263 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t2fd;
264 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t2;
265 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_txfd;
266 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_tx;
267 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t4;
268 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_10base_tfd;
269 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_10base_t;
270 static int hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_other;
271 static int hf_ieee_802_3_pmd_mau_type;
272 static int hf_ieee_802_3_mdi_power_support;
273 static int hf_ieee_802_3_mdi_power_support_port_class;
274 static int hf_ieee_802_3_mdi_power_support_pse_power_support;
275 static int hf_ieee_802_3_mdi_power_support_pse_power_enabled;
276 static int hf_ieee_802_3_mdi_power_support_pse_pairs;
277 static int hf_ieee_802_3_mdi_power_pse_pair;
278 static int hf_ieee_802_3_mdi_power_class;
279 static int hf_ieee_802_3_mdi_power_type;
280 static int hf_ieee_802_3_mdi_power_source;
281 static int hf_ieee_802_3_mdi_power_pd4pid;
282 static int hf_ieee_802_3_mdi_power_priority;
283 static int hf_ieee_802_3_mdi_requested_power;
284 static int hf_ieee_802_3_mdi_allocated_power;
286 static int hf_ieee_802_3_bt_ds_pd_requested_power_value_mode_a;
287 static int hf_ieee_802_3_bt_ds_pd_requested_power_value_mode_b;
288 static int hf_ieee_802_3_bt_ds_pse_allocated_power_value_alt_a;
289 static int hf_ieee_802_3_bt_ds_pse_allocated_power_value_alt_b;
290 static int hf_ieee_802_3_bt_power_status;
291 static int hf_ieee_802_3_bt_pse_powering_status;
292 static int hf_ieee_802_3_bt_pd_powered_status;
293 static int hf_ieee_802_3_bt_pse_power_pairs_ext;
294 static int hf_ieee_802_3_bt_ds_pwr_class_ext_a;
295 static int hf_ieee_802_3_bt_ds_pwr_class_ext_b;
296 static int hf_ieee_802_3_bt_pwr_class_ext;
297 static int hf_ieee_802_3_bt_system_setup;
298 static int hf_ieee_802_3_bt_power_type_ext;
299 static int hf_ieee_802_3_bt_power_pd_load;
300 static int hf_ieee_802_3_bt_pse_maximum_available_power_value;
301 static int hf_ieee_802_3_bt_autoclass;
302 static int hf_ieee_802_3_bt_pse_autoclass_support;
303 static int hf_ieee_802_3_bt_autoclass_completed;
304 static int hf_ieee_802_3_bt_autoclass_request;
305 static int hf_ieee_802_3_bt_autoclass_reserved;
306 static int hf_ieee_802_3_bt_power_down;
307 static int hf_ieee_802_3_bt_power_down_request;
308 static int hf_ieee_802_3_bt_power_down_time;
309 static int hf_ieee_802_3_aggregation_status;
310 static int hf_ieee_802_3_aggregation_status_cap;
311 static int hf_ieee_802_3_aggregation_status_enabled;
312 static int hf_ieee_802_3_aggregated_port_id;
313 static int hf_ieee_802_3_max_frame_size;
314 static int hf_ieee_802_3_eee_transmit;
315 static int hf_ieee_802_3_eee_receive;
316 static int hf_ieee_802_3_eee_fallback_receive;
317 static int hf_ieee_802_3_eee_echo_transmit;
318 static int hf_ieee_802_3_eee_echo_receive;
319 static int hf_ieee_802_1qbg_subtype;
320 static int hf_ieee_802_1qbg_evb_support_caps;
321 static int hf_ieee_802_1qbg_evb_support_caps_std;
322 static int hf_ieee_802_1qbg_evb_support_caps_rr;
323 static int hf_ieee_802_1qbg_evb_support_caps_rte;
324 static int hf_ieee_802_1qbg_evb_support_caps_ecp;
325 static int hf_ieee_802_1qbg_evb_support_caps_vdp;
326 static int hf_ieee_802_1qbg_evb_configure_caps;
327 static int hf_ieee_802_1qbg_evb_configure_caps_std;
328 static int hf_ieee_802_1qbg_evb_configure_caps_rr;
329 static int hf_ieee_802_1qbg_evb_configure_caps_rte;
330 static int hf_ieee_802_1qbg_evb_configure_caps_ecp;
331 static int hf_ieee_802_1qbg_evb_configure_caps_vdp;
332 static int hf_ieee_802_1qbg_evb_supported_vsi;
333 static int hf_ieee_802_1qbg_evb_configured_vsi;
334 static int hf_ieee_802_1qbg_evb_retrans_timer;
335 static int hf_ieee_802_3br_aec;
336 static int hf_ieee_802_3br_aec_support;
337 static int hf_ieee_802_3br_aec_enable;
338 static int hf_ieee_802_3br_aec_active;
339 static int hf_ieee_802_3br_aec_addfragsize;
340 static int hf_ieee_802_3br_aec_reserved;
341 static int hf_media_tlv_subtype;
342 static int hf_media_tlv_subtype_caps;
343 static int hf_media_tlv_subtype_caps_llpd;
344 static int hf_media_tlv_subtype_caps_network_policy;
345 static int hf_media_tlv_subtype_caps_location_id;
346 static int hf_media_tlv_subtype_caps_mdi_pse;
347 static int hf_media_tlv_subtype_caps_mid_pd;
348 static int hf_media_tlv_subtype_caps_inventory;
349 static int hf_media_tlv_subtype_class;
350 static int hf_media_application_type;
351 static int hf_media_policy_flag;
352 static int hf_media_tag_flag;
353 static int hf_media_vlan_id;
354 static int hf_media_l2_prio;
355 static int hf_media_dscp;
356 static int hf_media_loc_data_format;
357 static int hf_media_loc_lat_resolution;
358 static int hf_media_loc_lat;
359 static int hf_media_loc_long_resolution;
360 static int hf_media_loc_long;
361 static int hf_media_loc_alt_type;
362 static int hf_media_loc_alt_resolution;
363 static int hf_media_loc_alt;
364 static int hf_media_loc_ver;
365 static int hf_media_loc_reserved;
366 static int hf_media_loc_datum;
367 static int hf_media_civic_lci_length;
368 static int hf_media_civic_what;
369 static int hf_media_civic_country;
370 static int hf_media_civic_addr_type;
371 static int hf_media_civic_addr_len;
372 static int hf_media_civic_addr_value;
373 static int hf_media_ecs;
374 static int hf_media_power_type;
375 static int hf_media_power_source;
376 static int hf_media_power_priority;
377 static int hf_media_power_value;
378 static int hf_media_hardware;
379 static int hf_media_firmware;
380 static int hf_media_software;
381 static int hf_media_sn;
382 static int hf_media_manufacturer;
383 static int hf_media_model;
384 static int hf_media_asset;
385 static int hf_profinet_tlv_subtype;
386 static int hf_profinet_class2_port_status;
387 static int hf_profinet_class3_port_status;
388 static int hf_profinet_class3_port_status_Fragmentation;
389 static int hf_profinet_class3_port_status_reserved;
390 static int hf_profinet_class3_port_status_PreambleLength;
391 static int hf_profinet_port_rx_delay_local;
392 static int hf_profinet_port_rx_delay_remote;
393 static int hf_profinet_port_tx_delay_local;
394 static int hf_profinet_port_tx_delay_remote;
395 static int hf_profinet_cable_delay_local;
396 static int hf_profinet_mrp_domain_uuid;
397 static int hf_profinet_tsn_domain_uuid;
398 static int hf_profinet_tsn_nme_management_addr;
399 static int hf_profinet_tsn_nme_management_addr_str_length;
400 static int hf_profinet_tsn_nme_management_addr_subtype;
401 static int hf_profinet_tsn_nme_name_uuid;
402 static int hf_profinet_tsn_nme_parameter_uuid;
403 static int hf_profinet_time_domain_number;
404 static int hf_profinet_time_domain_uuid;
405 static int hf_profinet_time_domain_master_identity;
406 static int hf_profinet_mrrt_port_status;
407 static int hf_profinet_cm_mac;
408 static int hf_profinet_master_source_address;
409 static int hf_profinet_subdomain_uuid;
410 static int hf_profinet_ir_data_uuid;
411 static int hf_profinet_length_of_period_valid;
412 static int hf_profinet_length_of_period_length;
413 static int hf_profinet_red_period_begin_valid;
414 static int hf_profinet_red_period_begin_offset;
415 static int hf_profinet_orange_period_begin_valid;
416 static int hf_profinet_orange_period_begin_offset;
417 static int hf_profinet_green_period_begin_valid;
418 static int hf_profinet_green_period_begin_offset;
419 static int hf_cisco_subtype;
420 static int hf_cisco_upoe;
421 static int hf_cisco_upoe_supported;
422 static int hf_cisco_upoe_altb_detection;
423 static int hf_cisco_upoe_req_spare_pair;
424 static int hf_cisco_upoe_pse_spare_pair_oper;
425 static int hf_cisco_aci_portstate;
426 static int hf_cisco_aci_noderole;
427 static int hf_cisco_aci_nodeid;
428 static int hf_cisco_aci_spinelevel;
429 static int hf_cisco_aci_podid;
430 static int hf_cisco_aci_fabricname;
431 static int hf_cisco_aci_apiclist;
432 static int hf_cisco_aci_apicid;
433 static int hf_cisco_aci_apicipv4;
434 static int hf_cisco_aci_apicuuid;
435 static int hf_cisco_aci_nodeip;
436 static int hf_cisco_aci_portrole;
437 static int hf_cisco_aci_version;
438 static int hf_cisco_aci_fabricvlan;
439 static int hf_cisco_aci_serialno;
440 static int hf_cisco_aci_model;
441 static int hf_cisco_aci_nodename;
442 static int hf_cisco_aci_portmode;
443 static int hf_cisco_aci_authcookie;
444 static int hf_cisco_aci_apicmode;
445 static int hf_cisco_aci_fabricid;
446 static int hf_hytec_tlv_subtype;
447 static int hf_hytec_group;
448 static int hf_hytec_identifier;
449 static int hf_hytec_transceiver_vendor_product_revision;
450 static int hf_hytec_single_mode;
451 static int hf_hytec_multi_mode_50;
452 static int hf_hytec_multi_mode_62_5;
453 static int hf_hytec_tx_current_output_power;
454 static int hf_hytec_rx_current_input_power;
455 static int hf_hytec_rx_input_snr;
456 static int hf_hytec_lineloss;
457 static int hf_hytec_mac_trace_request;
458 static int hf_hytec_trace_mac_address;
459 static int hf_hytec_request_mac_address;
460 static int hf_hytec_maximum_depth;
461 static int hf_hytec_mac_trace_reply;
462 static int hf_hytec_answering_mac_address;
463 static int hf_hytec_actual_depth;
464 static int hf_hytec_name_of_replying_device;
465 static int hf_hytec_outgoing_port_name;
466 static int hf_hytec_ipv4_address_of_replying_device;
467 static int hf_hytec_end_of_trace;
468 static int hf_hytec_ipv6_address_of_replying_device;
469 static int hf_hytec_incoming_port_name;
470 static int hf_hytec_trace_identifier;
471 static int hf_hytec_invalid_object_data;
472 static int hf_hytec_unknown_identifier_content;
473 static int hf_avaya_subtype;
474 static int hf_avaya_poe;
475 static int hf_avaya_call_server;
476 static int hf_avaya_cna_server;
477 static int hf_avaya_file_server;
478 static int hf_avaya_dot1q;
479 static int hf_avaya_ipphone;
480 static int hf_avaya_ipphone_ip;
481 static int hf_avaya_ipphone_mask;
482 static int hf_avaya_ipphone_gateway;
483 static int hf_unknown_subtype;
484 static int hf_unknown_subtype_content;
485 static int hf_subtype_content_remaining;
486 static int hf_iana_subtype;
487 static int hf_iana_mudurl;
488 static int hf_onos_subtype;
489 static int hf_onos_chassis;
490 static int hf_onos_port;
491 static int hf_onos_ttl;
493 /* Initialize the subtree pointers */
494 static int ett_lldp;
495 static int ett_chassis_id;
496 static int ett_port_id;
497 static int ett_time_to_live;
498 static int ett_end_of_lldpdu;
499 static int ett_port_description;
500 static int ett_system_name;
501 static int ett_system_desc;
502 static int ett_system_cap;
503 static int ett_system_cap_summary;
504 static int ett_system_cap_enabled;
505 static int ett_management_address;
506 static int ett_unknown_tlv;
507 static int ett_org_spc_def;
508 static int ett_org_spc_dcbx_cin;
509 static int ett_org_spc_dcbx_cee;
510 static int ett_org_spc_dcbx_cee_1;
511 static int ett_org_spc_dcbx_cee_2;
512 static int ett_org_spc_dcbx_cee_3;
513 static int ett_org_spc_dcbx_cee_4;
514 static int ett_org_spc_dcbx_cin_6;
515 static int ett_org_spc_dcbx_cee_app;
516 static int ett_org_spc_ieee_802_1_1;
517 static int ett_org_spc_ieee_802_1_2;
518 static int ett_org_spc_ieee_802_1_3;
519 static int ett_org_spc_ieee_802_1_4;
520 static int ett_org_spc_ieee_802_1_8;
521 static int ett_org_spc_ieee_802_1_9;
522 static int ett_org_spc_ieee_802_1_a;
523 static int ett_org_spc_ieee_802_1_b;
524 static int ett_org_spc_ieee_802_1_c;
525 static int ett_org_spc_ieee_dcbx_app;
527 static int ett_org_spc_ieee_802_3_1;
528 static int ett_org_spc_ieee_802_3_2;
529 static int ett_org_spc_ieee_802_3_3;
530 static int ett_org_spc_ieee_802_3_4;
531 static int ett_org_spc_ieee_802_3_5;
532 static int ett_org_spc_ieee_802_3_7;
534 static int ett_org_spc_media_1;
535 static int ett_org_spc_media_2;
536 static int ett_org_spc_media_3;
537 static int ett_org_spc_media_4;
538 static int ett_org_spc_media_5;
539 static int ett_org_spc_media_6;
540 static int ett_org_spc_media_7;
541 static int ett_org_spc_media_8;
542 static int ett_org_spc_media_9;
543 static int ett_org_spc_media_10;
544 static int ett_org_spc_media_11;
546 static int ett_ex_avayaSubTypes_11;
547 static int ett_ex_avayaSubTypes_12;
548 static int ett_ex_avaya2SubTypes_4;
549 static int ett_org_spc_ProfinetSubTypes_1;
550 static int ett_org_spc_ProfinetSubTypes_2;
551 static int ett_org_spc_ProfinetSubTypes_3;
552 static int ett_org_spc_ProfinetSubTypes_4;
553 static int ett_org_spc_ProfinetSubTypes_5;
554 static int ett_org_spc_ProfinetSubTypes_6;
555 static int ett_org_spc_tlv;
556 static int ett_port_vlan_flags;
557 static int ett_802_3_flags;
558 static int ett_802_3_autoneg_advertised;
559 static int ett_802_3_power;
560 static int ett_802_3_bt_power;
561 static int ett_802_3_bt_system_setup;
562 static int ett_802_3_bt_autoclass;
563 static int ett_802_3_bt_power_down;
564 static int ett_802_3_aggregation;
565 static int ett_802_1_aggregation;
566 static int ett_802_1qbg_capabilities_flags;
567 static int ett_802_3br_capabilities_flags;
568 static int ett_media_capabilities;
569 static int ett_profinet_period;
570 static int ett_cisco_upoe_tlv;
571 static int ett_avaya_ipphone_tlv;
572 static int ett_org_spc_hytec_subtype_transceiver;
573 static int ett_org_spc_hytec_subtype_trace;
574 static int ett_org_spc_hytec_trace_request;
575 static int ett_org_spc_hytec_trace_reply;
577 static expert_field ei_lldp_bad_length;
578 static expert_field ei_lldp_bad_length_excess;
579 static expert_field ei_lldp_shutdown_excess_tlv;
580 static expert_field ei_lldp_bad_type;
581 static expert_field ei_lldp_tlv_deprecated;
583 /* TLV Types */
584 #define END_OF_LLDPDU_TLV_TYPE 0x00
585 #define CHASSIS_ID_TLV_TYPE 0x01 /* Mandatory */
586 #define PORT_ID_TLV_TYPE 0x02 /* Mandatory */
587 #define TIME_TO_LIVE_TLV_TYPE 0x03 /* Mandatory */
588 #define PORT_DESCRIPTION_TLV_TYPE 0x04
589 #define SYSTEM_NAME_TLV_TYPE 0x05
590 #define SYSTEM_DESCRIPTION_TLV_TYPE 0x06
591 #define SYSTEM_CAPABILITIES_TLV_TYPE 0x07
592 #define MANAGEMENT_ADDR_TLV_TYPE 0x08
593 #define ORGANIZATION_SPECIFIC_TLV_TYPE 0x7F
595 /* Masks */
596 #define TLV_TYPE_MASK 0xFE00
597 #define TLV_TYPE(value) (((value) & TLV_TYPE_MASK) >> 9)
598 #define TLV_INFO_LEN_MASK 0x01FF
599 #define TLV_INFO_LEN(value) ((value) & TLV_INFO_LEN_MASK)
601 static const value_string tlv_types[] = {
602 { END_OF_LLDPDU_TLV_TYPE, "End of LLDPDU"},
603 { CHASSIS_ID_TLV_TYPE, "Chassis Id"},
604 { PORT_ID_TLV_TYPE, "Port Id"},
605 { TIME_TO_LIVE_TLV_TYPE, "Time to Live"},
606 { PORT_DESCRIPTION_TLV_TYPE, "Port Description"},
607 { SYSTEM_NAME_TLV_TYPE, "System Name"},
608 { SYSTEM_DESCRIPTION_TLV_TYPE, "System Description"},
609 { SYSTEM_CAPABILITIES_TLV_TYPE, "System Capabilities"},
610 { MANAGEMENT_ADDR_TLV_TYPE, "Management Address"},
611 { ORGANIZATION_SPECIFIC_TLV_TYPE, "Organization Specific"},
612 { 0, NULL}
615 static const value_string chassis_id_subtypes[] = {
616 { 0, "Reserved"},
617 { 1, "Chassis component"},
618 { 2, "Interface alias"},
619 { 3, "Port component"},
620 { 4, "MAC address"},
621 { 5, "Network address"},
622 { 6, "Interface name"},
623 { 7, "Locally assigned"},
624 { 0, NULL}
627 static const value_string porttype_values[] = {
628 { 0, "Not specified"},
629 { 1, "From aggregation port"},
630 { 2, "From aggregator"},
631 { 3, "From single-port aggregator"},
632 { 0, NULL}
635 static const value_string port_id_subtypes[] = {
636 { 0, "Reserved"},
637 { 1, "Interface alias"},
638 { 2, "Port component"},
639 { 3, "MAC address"},
640 { 4, "Network address"},
641 { 5, "Interface name"},
642 { 6, "Agent circuit Id"},
643 { 7, "Locally assigned"},
644 { 0, NULL}
647 static const value_string interface_subtype_values[] = {
648 { 1, "Unknown"},
649 { 2, "ifIndex"},
650 { 3, "System port number"},
651 { 0, NULL}
654 static const value_string dcbx_protocol_types[] = {
655 { 0x01, "1.0 CIN" },
656 { 0x02, "1.01 CEE" },
657 { 0, NULL }
660 static const value_string dcbx_subtypes[] = {
661 { 0x01, "DCBx Control" },
662 { 0x02, "Priority Groups" },
663 { 0x03, "Priority-Based Flow Control" },
664 { 0x04, "Application Protocol" },
665 { 0x06, "Logical Link Down" },
666 { 0, NULL }
669 static const value_string dcbx_app_selector[] = {
670 { 0, "EtherType" },
671 { 1, "Socket Number" },
672 { 0, NULL }
675 static const value_string dcbx_app_types[] = {
676 { 0xcbc, "iSCSI" },
677 { 0x8906, "FCoE" },
678 { 0x8914, "FiP" },
679 { 0, NULL }
682 static const value_string dcbx_llink_types[] = {
683 { 0x0, "FCoE Status" },
684 { 0x1, "LAN Status" },
685 { 0, NULL }
688 /* IEEE 802.1 Subtypes */
689 static const value_string ieee_802_1_subtypes[] = {
690 { 0x01, "Port VLAN ID" }, /* 802.1Q - D.2.1 */
691 { 0x02, "Port and Protocol VLAN ID" }, /* 802.1Q - D.2.2 */
692 { 0x03, "VLAN Name" }, /* 802.1Q - D.2.3 */
693 { 0x04, "Protocol Identity" }, /* 802.1Q - D.2.4 */
694 { 0x05, "VID Usage Digest" }, /* 802.1Q - D.2.5 */
695 { 0x06, "Management VID" }, /* 802.1Q - D.2.6 */
696 { 0x07, "Link Aggregation" }, /* 802.1Q - D.2.7 */
697 { 0x08, "Congestion Notification" }, /* 802.1Q - D.2.8 */
698 { 0x09, "ETS Configuration" }, /* 802.1Q - D.2.9 */
699 { 0x0A, "ETS Recommendation" }, /* 802.1Q - D.2.10 */
700 { 0x0B, "Priority Flow Control Configuration" },/* 802.1Q - D.2.11 */
701 { 0x0C, "Application Protocol" }, /* 802.1Q - D.2.12 */
702 { 0x0D, "EVB" }, /* 802.1Q - D.2.13 */
703 { 0x0E, "CDCP" }, /* 802.1Q - D.2.14 */
704 { 0x0F, "Port extension" }, /* 802.1BR - B.2 */
705 { 0x10, "Application VLAN" }, /* 802.1Q - D.2.15 */
706 { 0x11, "LRP ECP Discovery" }, /* 802.1CS - C.2.1 */
707 { 0x12, "LRP TCP Discovery" }, /* 802.1CS - C.2.2 */
708 { 0x13, "Congestion Isolation" }, /* 802.1Qcz - D.2.15 */
709 { 0x14, "Topology Recognition" }, /* 802.1Qcz - D.2.16 */
710 { 0, NULL }
713 static const value_string dcbx_ieee_8021az_tsa[] = {
714 { 0, "Strict Priority" },
715 { 1, "Credit-Based Shaper" },
716 { 2, "Enhanced Transmission Selection" },
717 /* All other bits Reserved */
718 { 255, "Vendor Specific Algorithm" },
719 { 0, NULL }
722 static const value_string dcbx_ieee_8021az_sf[] = {
723 { 0, "Reserved" },
724 { 1, "Default or Ethertype" },
725 { 2, "Port over TCP/SCTP" },
726 { 3, "Port over UDP/DCCP" },
727 { 4, "Port over TCP/SCTP/UDP/DCCP" },
728 { 5, "Reserved" },
729 { 6, "Reserved" },
730 { 7, "Reserved" },
731 { 0, NULL }
734 /* IEEE 802.3 Subtypes */
735 static const value_string ieee_802_3_subtypes[] = {
736 { 0x01, "MAC/PHY Configuration/Status" },
737 { 0x02, "Power Via MDI" },
738 { 0x03, "Link Aggregation" },
739 { 0x04, "Maximum Frame Size" },
740 { 0x05, "EEE (Energy-Efficient Ethernet)" },
741 { 0x07, "IEEE 802.3br Additional Ethernet capabilities" },
742 { 0, NULL }
745 /* Media Subtypes */
746 static const value_string media_subtypes[] = {
747 { 1, "Media Capabilities" },
748 { 2, "Network Policy" },
749 { 3, "Location Identification" },
750 { 4, "Extended Power-via-MDI" },
751 { 5, "Inventory - Hardware Revision" },
752 { 6, "Inventory - Firmware Revision" },
753 { 7, "Inventory - Software Revision" },
754 { 8, "Inventory - Serial Number" },
755 { 9, "Inventory - Manufacturer Name" },
756 { 10, "Inventory - Model Name" },
757 { 11, "Inventory - Asset ID" },
758 { 0, NULL }
761 /* Media Class Values */
762 static const value_string media_class_values[] = {
763 { 0, "Type Not Defined" },
764 { 1, "Endpoint Class I" },
765 { 2, "Endpoint Class II" },
766 { 3, "Endpoint Class III" },
767 { 4, "Network Connectivity" },
768 { 0, NULL }
771 /* Media Application Types */
772 static const value_string media_application_type[] = {
773 { 0, "Reserved" },
774 { 1, "Voice" },
775 { 2, "Voice Signaling" },
776 { 3, "Guest Voice" },
777 { 4, "Guest Voice Signaling" },
778 { 5, "Softphone Voice" },
779 { 6, "Video Conferencing" },
780 { 7, "Streaming Video" },
781 { 8, "Video Signaling" },
782 { 0, NULL }
785 /* PROFINET subtypes */
786 static const value_string profinet_subtypes[] = {
787 { 1, "Measured Delay Values" },
788 { 2, "Port Status" },
789 { 3, "Alias" },
790 { 4, "MRP Port Status" },
791 { 5, "Chassis MAC" },
792 { 6, "PTCP Status" },
793 { 7, "MauType Extension" },
794 { 8, "MRPIC Port Status" },
795 { 9, "TSN Domain"},
796 { 10, "TSN NME Management Address"},
797 { 11, "TSN NME Name UUID"},
798 { 12, "TSN NME Parameter UUID"},
799 { 13, "AS Working Clock"},
800 { 14, "AS Global Time"},
801 { 0, NULL }
803 /* extreme avaya ap subtypes */
804 #define EX_AVAYA_SUBTYPE_ELEMENT_TLV 11
805 #define EX_AVAYA_SUBTYPE_ASSIGNMENT_TLV 12
806 static const value_string ex_avaya_subtypes[] = {
807 { EX_AVAYA_SUBTYPE_ELEMENT_TLV, "Extreme Fabric Attach Element TLV" },
808 { EX_AVAYA_SUBTYPE_ASSIGNMENT_TLV, "Extreme Fabric Attach Assignment TLV" },
809 { 0, NULL }
812 /* extreme avaya2 (fabric) subtypes */
813 #define EX_AVAYA2_SUBTYPE_ZTFv2_FC_TLV 4
814 static const value_string ex_avaya2_subtypes[] = {
815 { EX_AVAYA2_SUBTYPE_ZTFv2_FC_TLV, "Extreme Zero Touch Fabric v2 Fabric Connect TLV" },
816 { 0, NULL }
819 /* ONOS subtypes */
820 /* https://github.com/opennetworkinglab/onos/blob/master/utils/misc/src/main/java/org/onlab/packet/LLDP.java */
821 #define ONOS_CHASSIS_TLV_TYPE 1
822 #define ONOS_PORT_TLV_TYPE 2
823 #define ONOS_TTL_TLV_TYPE 3
824 static const value_string onos_subtypes[] = {
825 { ONOS_CHASSIS_TLV_TYPE, "ONOS Chassis" },
826 { ONOS_PORT_TLV_TYPE, "ONOS Port" },
827 { ONOS_TTL_TLV_TYPE, "ONOS TTL" },
828 { 0, NULL }
832 /* Cisco Subtypes */
833 static const value_string cisco_subtypes[] = {
834 /* UPOE: https://www.cisco.com/c/dam/en/us/solutions/collateral/workforce-experience/digital-building/digital-building-partner-guide.pdf */
835 { 0x01, "4-wire Power-via-MDI (UPOE)" },
836 /* ACI */
837 { 0xc9, "ACI Port State" },
838 { 0xca, "ACI Node Role" },
839 { 0xcb, "ACI Node ID" },
840 { 0xcc, "ACI Spine Level" },
841 { 0xcd, "ACI Pod ID" },
842 { 0xce, "ACI Fabric Name" },
843 { 0xcf, "ACI Appliance Vector" },
844 { 0xd0, "ACI Node IP" },
845 { 0xd1, "ACI Port Role" },
846 { 0xd2, "ACI Firmware Version" },
847 { 0xd3, "ACI Infra VLAN" },
848 { 0xd4, "ACI Serial Number" },
849 { 0xd6, "ACI Model" },
850 { 0xd7, "ACI Node Name" },
851 { 0xd8, "ACI Port Mode" },
852 { 0xd9, "ACI Authentication Cookie" },
853 { 0xda, "ACI APIC-Mode" },
854 { 0xdb, "ACI Fabric ID" },
855 { 0, NULL }
858 static const true_false_string tfs_desired_not_desired = { "Desired", "Not Desired" };
860 static const value_string cisco_portstate_vals[] = {
861 { 1, "In Service" },
862 { 2, "Out of Service" },
863 { 0, NULL }
866 static const value_string cisco_portrole_vals[] = {
867 { 1, "Active" },
868 { 2, "Backup" },
869 { 0, NULL }
871 static const value_string cisco_portmode_vals[] = {
872 { 0, "Normal" },
873 { 1, "Recovery Mode" },
874 { 0, NULL }
877 /* Guessing here, the output of apic show commands only has leaf and spine, and
878 those values are leaf=2, spine=3 (off by 1) */
879 static const value_string cisco_noderole_vals[] = {
880 { 0, "APIC" },
881 { 1, "Leaf" },
882 { 2, "Spine" },
883 { 3, "vLeaf" },
884 { 0, NULL }
887 static const value_string cisco_apicmode_vals[] = {
888 { 0, "Active" },
889 { 1, "Standby" },
890 { 0, NULL }
893 /* Avaya Subtypes */
894 static const value_string avaya_subtypes[] = {
895 { 1, "PoE Conservation Level Support" },
896 { 3, "Call Server IP Address" },
897 { 4, "IP Phone Addresses" },
898 { 5, "CNA Server IP Address" },
899 { 6, "File Server" },
900 { 7, "802.1Q Framing" },
901 { 0, NULL }
904 /* Avaya 802.1Q Framing Subtypes */
905 static const value_string avaya_dot1q_subtypes[] = {
906 { 1, "Tagging" },
907 { 2, "No Tagging" },
908 { 0, NULL }
911 /* IANA Subtypes */
912 static const value_string iana_subtypes[] = {
913 { 1, "Manufacturer Usage Description URL" },
914 { 0, NULL }
919 /* 802.3 Power Class */
920 static const value_string power_class_802_3[] = {
921 { 1, "0" },
922 { 2, "1" },
923 { 3, "2" },
924 { 4, "3" },
925 { 5, "4" },
926 { 0, NULL }
929 /* 802.3bt Extended Power Class */
930 static const value_string power_class_ext_802_3_bt[] = {
931 { 1, "Class 1" },
932 { 2, "Class 2" },
933 { 3, "Class 3" },
934 { 4, "Class 4" },
935 { 5, "Class 5" },
936 { 6, "Class 6" },
937 { 7, "Class 7" },
938 { 8, "Class 8" },
939 { 15, "Dual signature" },
940 { 0, NULL }
943 /* 802.3 Power Pair */
944 static const value_string power_pair_802_3[] = {
945 { 1, "Signal" },
946 { 2, "Spare" },
947 { 0, NULL }
950 /* 802.3bt extended powering pairs */
951 static const value_string power_pairs_ext_802_3_bt[] = {
952 { 0, "Ignore" },
953 { 1, "Alternative A" },
954 { 2, "Alternative B" },
955 { 3, "Both alternatives" },
956 { 0, NULL }
959 /* 802.3 Power Type */
960 static const value_string power_type_802_3[] = {
961 { 0, "Type 2 PSE Device" },
962 { 1, "Type 2 PD Device" },
963 { 2, "Type 1 PSE Device" },
964 { 3, "Type 1 PD Device" },
965 { 0, NULL }
968 /* 802.3bt Extended Power Type */
969 static const value_string power_type_ext_802_3_bt[] = {
970 { 0, "Type 3 PSE Device" },
971 { 1, "Type 4 PSE Device" },
972 { 2, "Type 3 single-signature PD Device" },
973 { 3, "Type 3 dual-signature PD Device" },
974 { 4, "Type 4 single-signature PD Device" },
975 { 5, "Type 4 dual-signature PD Device" },
976 { 6, "Reserved/Ignore" },
977 { 7, "Reserved/Ignore" },
978 { 0, NULL }
981 /* 802.3bt Dual-signature Extended Power Class Mode A|B */
982 static const value_string power_type_ext_mode_ab_802_3_bt[] = {
983 { 0, "Reserved/Ignore" },
984 { 1, "Class 1" },
985 { 2, "Class 2" },
986 { 3, "Class 3" },
987 { 4, "Class 4" },
988 { 5, "Class 5" },
989 { 6, "Reserved/Ignore" },
990 { 7, "Single-signature or 2-pair PD" },
991 { 0, NULL }
994 /* 802.3bt extended PSE powering status */
995 static const value_string pse_powering_status_802_3_bt[] = {
996 { 0, "Ignore" },
997 { 1, "2-pair" },
998 { 2, "4-pair single-signature" },
999 { 3, "4-pair dual-signature" },
1000 { 0, NULL }
1003 /* 802.3bt extended PD powering status */
1004 static const value_string pd_powered_status_802_3_bt[] = {
1005 { 0, "Ignore" },
1006 { 1, "Single-signature PD" },
1007 { 2, "2-pair dual-signature PD" },
1008 { 3, "4-pair dual-signature PD" },
1009 { 0, NULL }
1012 static const true_false_string tfs_ieee_802_3_pse_pd = { "PSE", "PD" };
1013 static const true_false_string tfs_ieee_802_3_pd_load = { "Isolated", "Not isolated" };
1014 static const true_false_string tfs_unknown_defined = { "Unknown", "Defined" };
1016 /* Power Type */
1017 static const value_string media_power_type[] = {
1018 { 0, "PSE Device" },
1019 { 1, "PD Device" },
1020 { 2, "PSE Device" },
1021 { 3, "PD Device" },
1022 { 0, NULL }
1025 /* Power Priority */
1026 static const value_string media_power_priority[] = {
1027 { 0, "Unknown" },
1028 { 1, "Critical" },
1029 { 2, "High" },
1030 { 3, "Low" },
1031 { 0, NULL }
1034 /* Power Sources */
1035 static const value_string media_power_pd_device[] = {
1036 { 0, "Unknown" },
1037 { 1, "PSE" },
1038 { 2, "Local" },
1039 { 3, "PSE and Local" },
1040 { 0, NULL }
1042 static const value_string media_power_pse_device[] = {
1043 { 0, "Unknown" },
1044 { 1, "Primary Power Source" },
1045 { 2, "Backup Power Source" },
1046 { 0, NULL }
1049 /* Location data format */
1050 static const value_string location_data_format[] = {
1051 { 0, "Invalid " },
1052 { 1, "Coordinate-based LCI" },
1053 { 2, "Civic Address LCI" },
1054 { 3, "ECS ELIN" },
1055 { 0, NULL }
1058 /* Altitude Type */
1059 static const value_string altitude_type[] = {
1060 { 1, "Meters" },
1061 { 2, "Floors" },
1062 { 0, NULL }
1065 /* Datum Type */
1066 static const value_string datum_type_values[] = {
1067 { 1, "WGS84" },
1068 { 2, "NAD83 (Latitude, Longitude) + NAVD88" },
1069 { 3, "NAD83 (Latitude, Longitude) + MLLW" },
1070 { 0, NULL }
1073 /* Civic Address LCI - What field */
1074 static const value_string civic_address_what_values[] = {
1075 { 0, "Location of the DHCP server" },
1076 { 1, "Location of the network element believed to be closest to the client" },
1077 { 2, "Location of the client"},
1078 { 0, NULL}
1081 /* Civic Address Type field */
1082 static const value_string civic_address_type_values[] = {
1083 { 0, "Language" },
1084 { 1, "National subdivisions (province, state, etc)" },
1085 { 2, "County, parish, district" },
1086 { 3, "City, township" },
1087 { 4, "City division, borough, ward" },
1088 { 5, "Neighborhood, block" },
1089 { 6, "Street" },
1090 { 16, "Leading street direction" },
1091 { 17, "Trailing street suffix" },
1092 { 18, "Street suffix" },
1093 { 19, "House number" },
1094 { 20, "House number suffix" },
1095 { 21, "Landmark or vanity address" },
1096 { 22, "Additional location information" },
1097 { 23, "Name" },
1098 { 24, "Postal/ZIP code" },
1099 { 25, "Building" },
1100 { 26, "Unit" },
1101 { 27, "Floor" },
1102 { 28, "Room number" },
1103 { 29, "Place type" },
1104 { 128, "Script" },
1105 { 0, NULL }
1109 * Define the text strings for the LLDP 802.3 MAC/PHY Configuration/Status
1110 * Operational MAU Type field.
1112 * These values are taken from the DESCRIPTION field of the dot3MauType
1113 * objects defined in RFC 4836
1116 /* from rfc 4836 dot3MauType */
1117 static const value_string operational_mau_type_values[] = {
1118 { 0, "other or unknown" },
1119 /* rfc 1515 values */
1120 { 1, "AUI - no internal MAU, view from AUI" },
1121 { 2, "10Base5 - thick coax MAU" },
1122 { 3, "Foirl - FOIRL MAU" },
1123 { 4, "10Base2 - thin coax MAU" },
1124 { 5, "10BaseT - UTP MAU" },
1125 { 6, "10BaseFP - passive fiber MAU" },
1126 { 7, "10BaseFB - sync fiber MAU" },
1127 { 8, "10BaseFL - async fiber MAU" },
1128 { 9, "10Broad36 - broadband DTE MAU" },
1129 /* rfc 2239 updates */
1130 { 10, "10BaseTHD - UTP MAU, half duplex mode" },
1131 { 11, "10BaseTFD - UTP MAU, full duplex mode" },
1132 { 12, "10BaseFLHD - async fiber MAU, half duplex mode" },
1133 { 13, "10BaseFLDF - async fiber MAU, full duplex mode" },
1134 { 14, "10BaseT4 - 4 pair category 3 UTP" },
1135 { 15, "100BaseTXHD - 2 pair category 5 UTP, half duplex mode" },
1136 { 16, "100BaseTXFD - 2 pair category 5 UTP, full duplex mode" },
1137 { 17, "100BaseFXHD - X fiber over PMT, half duplex mode" },
1138 { 18, "100BaseFXFD - X fiber over PMT, full duplex mode" },
1139 { 19, "100BaseT2HD - 2 pair category 3 UTP, half duplex mode" },
1140 { 20, "100BaseT2DF - 2 pair category 3 UTP, full duplex mode" },
1141 /* rfc 2668 updates */
1142 { 21, "1000BaseXHD - PCS/PMA, unknown PMD, half duplex mode" },
1143 { 22, "1000BaseXFD - PCS/PMA, unknown PMD, full duplex mode" },
1144 { 23, "1000BaseLXHD - Fiber over long-wavelength laser, half duplex mode" },
1145 { 24, "1000BaseLXFD - Fiber over long-wavelength laser, full duplex mode" },
1146 { 25, "1000BaseSXHD - Fiber over short-wavelength laser, half duplex mode" },
1147 { 26, "1000BaseSXFD - Fiber over short-wavelength laser, full duplex mode" },
1148 { 27, "1000BaseCXHD - Copper over 150-Ohm balanced cable, half duplex mode" },
1149 { 28, "1000BaseCXFD - Copper over 150-Ohm balanced cable, full duplex mode" },
1150 { 29, "1000BaseTHD - Four-pair Category 5 UTP, half duplex mode" },
1151 { 30, "1000BaseTFD - Four-pair Category 5 UTP, full duplex mode" },
1152 /* rfc 3636 updates */
1153 { 31, "10GigBaseX - X PCS/PMA, unknown PMD." },
1154 { 32, "10GigBaseLX4 - X fiber over WWDM optics" },
1155 { 33, "10GigBaseR - R PCS/PMA, unknown PMD." },
1156 { 34, "10GigBaseER - R fiber over 1550 nm optics" },
1157 { 35, "10GigBaseLR - R fiber over 1310 nm optics" },
1158 { 36, "10GigBaseSR - R fiber over 850 nm optics" },
1159 { 37, "10GigBaseW - W PCS/PMA, unknown PMD." },
1160 { 38, "10GigBaseEW - W fiber over 1550 nm optics" },
1161 { 39, "10GigBaseLW - W fiber over 1310 nm optics" },
1162 { 40, "10GigBaseSW - W fiber over 850 nm optics" },
1163 /* rfc 4836 updates */
1164 { 41, "10GBASE-CX4 - X copper over 8 pair 100-Ohm balanced cable" },
1165 { 42, "2BASE-TL - Voice grade UTP copper, up to 2700m, optional PAF" },
1166 { 43, "10PASS-TS - Voice grade UTP copper, up to 750m, optional PAF" },
1167 { 44, "100BASE-BX10D - One single-mode fiber OLT, long wavelength, 10km" },
1168 { 45, "100BASE-BX10U - One single-mode fiber ONU, long wavelength, 10km" },
1169 { 46, "100BASE-LX10 - One single-mode fiber ONU, long wavelength, 10km" },
1170 { 47, "1000BASE-BX10D - One single-mode fiber OLT, long wavelength, 10km" },
1171 { 48, "1000BASE-BX10U - One single-mode fiber ONU, long wavelength, 10km" },
1172 { 49, "1000BASE-LX10 - Two single-mode fiber, long wavelength, 10km" },
1173 { 50, "1000BASE-PX10D - One single-mode fiber EPON OLT, 10km" },
1174 { 51, "1000BASE-PX10U - One single-mode fiber EPON ONU, 10km" },
1175 { 52, "1000BASE-PX20D - One single-mode fiber EPON OLT, 20km" },
1176 { 53, "1000BASE-PX20U - One single-mode fiber EPON ONU, 20km" },
1177 { 0, NULL }
1180 /* Hytec Masks */
1181 #define HYTEC_GROUP_MASK 0xE0
1182 #define HYTEC_GROUP_MASK_OFFSET 0
1183 #define HYTEC_GROUP_MASK_SIZE 3
1184 #define HYTEC_IDENTIFIER_MASK 0x1F
1185 #define HYTEC_IDENTIFIER_MASK_OFFSET HYTEC_GROUP_MASK_SIZE
1186 #define HYTEC_IDENTIFIER_MASK_SIZE 5
1188 /* Hytec Subtypes */
1189 #define HYTEC_SUBTYPE__TRANSCEIVER 1
1190 #define HYTEC_SUBTYPE__TRACE 2
1192 /* Hytec Transceiver Groups */
1193 #define HYTEC_TRANSG__TRANCEIVER_IDENTIFIER 1
1194 #define HYTEC_TRANSG__TRANSCEIVER_BRIDGEABLE_DISTANCE 2
1195 #define HYTEC_TRANSG__MEASUREMENT_DATA 3
1197 /* Hytec Trace Groups */
1198 #define HYTEC_TRACEG__MAC_TRACE 1
1200 /* Hytec Transceiver Identifiers */
1201 #define HYTEC_TID__VENDOR_PRODUCT_REVISION 1
1203 #define HYTEC_TID__VENDOR_PRODUCT_REVISION_STR "Transceiver vendor, product and revision"
1205 /* Hytec Transceiver Bridgeable Distance Values */
1206 #define HYTEC_TBD__SINGLE_MODE 1
1207 #define HYTEC_TBD__MULTI_MODE_50 2
1208 #define HYTEC_TBD__MULTI_MODE_62_5 3
1210 #define HYTEC_TBD__SINGLE_MODE_STR "Single mode (9/125 um)"
1211 #define HYTEC_TBD__MULTI_MODE_50_STR "Multi mode (50/125 um)"
1212 #define HYTEC_TBD__MULTI_MODE_62_5_STR "Multi mode (62.5/125 um)"
1215 /* Hytec Measurement Data Values */
1216 #define HYTEC_MD__TX_CURRENT_OUTPUT_POWER 1
1217 #define HYTEC_MD__RX_CURRENT_INPUT_POWER 2
1218 #define HYTEC_MD__RX_INPUT_SNR 3
1219 #define HYTEC_MD__LINELOSS 4
1221 #define HYTEC_MD__TX_CURRENT_OUTPUT_POWER_STR "Tx current output power"
1222 #define HYTEC_MD__RX_CURRENT_INPUT_POWER_STR "Rx current input power"
1223 #define HYTEC_MD__RX_INPUT_SNR_STR "Rx input SNR"
1224 #define HYTEC_MD__LINELOSS_STR "Lineloss"
1227 /* Hytec MAC Trace Values */
1228 #define HYTEC_MC__MAC_TRACE_REQUEST 1
1229 #define HYTEC_MC__MAC_TRACE_REPLY 2
1230 #define HYTEC_MC__NAME_OF_REPLYING_DEVICE 3
1231 #define HYTEC_MC__OUTGOING_PORT_NAME 4
1232 #define HYTEC_MC__IPV4_ADDRESS_OF_REPLYING_DEVICE 5
1233 #define HYTEC_MC__END_OF_TRACE 6
1234 #define HYTEC_MC__IPV6_ADDRESS_OF_REPLYING_DEVICE 7
1235 #define HYTEC_MC__INCOMING_PORT_NAME 8
1236 #define HYTEC_MC__TRACE_IDENTIFIER 9
1238 #define HYTEC_MC__MAC_TRACE_REQUEST_STR "MAC Trace Request"
1239 #define HYTEC_MC__MAC_TRACE_REPLY_STR "MAC Trace Reply"
1240 #define HYTEC_MC__NAME_OF_REPLYING_DEVICE_STR "Name of replying device"
1241 #define HYTEC_MC__OUTGOING_PORT_NAME_STR "Outgoing port name"
1242 #define HYTEC_MC__IPV4_ADDRESS_OF_REPLYING_DEVICE_STR "IPv4 address of replying device"
1243 #define HYTEC_MC__END_OF_TRACE_STR "End of Trace"
1244 #define HYTEC_MC__IPV6_ADDRESS_OF_REPLYING_DEVICE_STR "IPv6 address of replying device"
1245 #define HYTEC_MC__INCOMING_PORT_NAME_STR "Incoming port name"
1246 #define HYTEC_MC__TRACE_IDENTIFIER_STR "Trace identifier"
1249 static const value_string hytec_subtypes[] = {
1250 {HYTEC_SUBTYPE__TRANSCEIVER, "Transceiver"},
1251 {HYTEC_SUBTYPE__TRACE, "Trace"},
1252 {0, NULL}
1255 static const value_string hytec_transceiver_groups[] = {
1256 {HYTEC_TRANSG__TRANCEIVER_IDENTIFIER, "Transceiver identifier"},
1257 {HYTEC_TRANSG__TRANSCEIVER_BRIDGEABLE_DISTANCE, "Transceiver bridgeable distance"},
1258 {HYTEC_TRANSG__MEASUREMENT_DATA, "Measurement data"},
1259 {0, NULL}
1262 static const value_string hytec_trace_groups[] = {
1263 {HYTEC_TRACEG__MAC_TRACE, "MAC Trace"},
1264 {0, NULL}
1267 static const value_string hytec_tid[] = {
1268 {HYTEC_TID__VENDOR_PRODUCT_REVISION, HYTEC_TID__VENDOR_PRODUCT_REVISION_STR},
1269 {0, NULL}
1272 static const value_string hytec_tbd[] = {
1273 {HYTEC_TBD__SINGLE_MODE, HYTEC_TBD__SINGLE_MODE_STR},
1274 {HYTEC_TBD__MULTI_MODE_50, HYTEC_TBD__MULTI_MODE_50_STR},
1275 {HYTEC_TBD__MULTI_MODE_62_5, HYTEC_TBD__MULTI_MODE_62_5_STR},
1276 {0, NULL}
1279 static const value_string hytec_md[] = {
1280 {HYTEC_MD__TX_CURRENT_OUTPUT_POWER, HYTEC_MD__TX_CURRENT_OUTPUT_POWER_STR},
1281 {HYTEC_MD__RX_CURRENT_INPUT_POWER, HYTEC_MD__RX_CURRENT_INPUT_POWER_STR},
1282 {HYTEC_MD__RX_INPUT_SNR, HYTEC_MD__RX_INPUT_SNR_STR},
1283 {HYTEC_MD__LINELOSS, HYTEC_MD__LINELOSS_STR},
1284 {0, NULL}
1287 static const value_string hytec_mc[] = {
1288 {HYTEC_MC__MAC_TRACE_REQUEST, HYTEC_MC__MAC_TRACE_REQUEST_STR},
1289 {HYTEC_MC__MAC_TRACE_REPLY, HYTEC_MC__MAC_TRACE_REPLY_STR},
1290 {HYTEC_MC__NAME_OF_REPLYING_DEVICE, HYTEC_MC__NAME_OF_REPLYING_DEVICE_STR},
1291 {HYTEC_MC__OUTGOING_PORT_NAME, HYTEC_MC__OUTGOING_PORT_NAME_STR},
1292 {HYTEC_MC__IPV4_ADDRESS_OF_REPLYING_DEVICE, HYTEC_MC__IPV4_ADDRESS_OF_REPLYING_DEVICE_STR},
1293 {HYTEC_MC__END_OF_TRACE, HYTEC_MC__END_OF_TRACE_STR},
1294 {HYTEC_MC__IPV6_ADDRESS_OF_REPLYING_DEVICE, HYTEC_MC__IPV6_ADDRESS_OF_REPLYING_DEVICE_STR},
1295 {HYTEC_MC__INCOMING_PORT_NAME, HYTEC_MC__INCOMING_PORT_NAME_STR},
1296 {HYTEC_MC__TRACE_IDENTIFIER, HYTEC_MC__TRACE_IDENTIFIER_STR},
1297 {0, NULL}
1301 /* System Capabilities */
1302 #define SYSTEM_CAPABILITY_OTHER 0x0001
1303 #define SYSTEM_CAPABILITY_REPEATER 0x0002
1304 #define SYSTEM_CAPABILITY_BRIDGE 0x0004
1305 #define SYSTEM_CAPABILITY_WLAN 0x0008
1306 #define SYSTEM_CAPABILITY_ROUTER 0x0010
1307 #define SYSTEM_CAPABILITY_TELEPHONE 0x0020
1308 #define SYSTEM_CAPABILITY_DOCSIS 0x0040
1309 #define SYSTEM_CAPABILITY_STATION 0x0080
1310 #define SYSTEM_CAPABILITY_CVLAN 0x0100
1311 #define SYSTEM_CAPABILITY_SVLAN 0x0200
1312 #define SYSTEM_CAPABILITY_TPMR 0x0400
1314 /* Media Capabilities */
1315 #define MEDIA_CAPABILITY_LLDP 0x0001
1316 #define MEDIA_CAPABILITY_NETWORK_POLICY 0x0002
1317 #define MEDIA_CAPABILITY_LOCATION_ID 0x0004
1318 #define MEDIA_CAPABILITY_MDI_PSE 0x0008
1319 #define MEDIA_CAPABILITY_MDI_PD 0x0010
1320 #define MEDIA_CAPABILITY_INVENTORY 0x0020
1323 * Define constants for the LLDP 802.3 MAC/PHY Configuration/Status
1324 * PMD Auto-Negotiation Advertised Capability field.
1325 * These values are taken from the ifMauAutoNegCapAdvertisedBits
1326 * object defined in RFC 3636.
1329 #define AUTONEG_OTHER 0x8000 /* bOther(0), -- other or unknown */
1330 #define AUTONEG_10BASE_T 0x4000 /* b10baseT(1), -- 10BASE-T half duplex mode */
1331 #define AUTONEG_10BASET_FD 0x2000 /* b10baseTFD(2), -- 10BASE-T full duplex mode */
1332 #define AUTONEG_100BASE_T4 0x1000 /* b100baseT4(3), -- 100BASE-T4 */
1333 #define AUTONEG_100BASE_TX 0x0800 /* b100baseTX(4), -- 100BASE-TX half duplex mode */
1334 #define AUTONEG_100BASE_TXFD 0x0400 /* b100baseTXFD(5), -- 100BASE-TX full duplex mode */
1335 #define AUTONEG_100BASE_T2 0x0200 /* b100baseT2(6), -- 100BASE-T2 half duplex mode */
1336 #define AUTONEG_100BASE_T2FD 0x0100 /* b100baseT2FD(7), -- 100BASE-T2 full duplex mode */
1337 #define AUTONEG_FDX_PAUSE 0x0080 /* bFdxPause(8), -- PAUSE for full-duplex links */
1338 #define AUTONEG_FDX_APAUSE 0x0040 /* bFdxAPause(9), -- Asymmetric PAUSE for full-duplex links */
1339 #define AUTONEG_FDX_SPAUSE 0x0020 /* bFdxSPause(10), -- Symmetric PAUSE for full-duplex links */
1340 #define AUTONEG_FDX_BPAUSE 0x0010 /* bFdxBPause(11), -- Asymmetric and Symmetric PAUSE for full-duplex links */
1341 #define AUTONEG_1000BASE_X 0x0008 /* b1000baseX(12), -- 1000BASE-X, -LX, -SX, -CX half duplex mode */
1342 #define AUTONEG_1000BASE_XFD 0x0004 /* b1000baseXFD(13), -- 1000BASE-X, -LX, -SX, -CX full duplex mode */
1343 #define AUTONEG_1000BASE_T 0x0002 /* b1000baseT(14), -- 1000BASE-T half duplex mode */
1344 #define AUTONEG_1000BASE_TFD 0x0001 /* b1000baseTFD(15) -- 1000BASE-T full duplex mode */
1346 /* Some vendors interpreted the standard to invert the bitorder:
1347 * according to a IEEE ruling, this is now officially wrong.
1348 * See https://gitlab.com/wireshark/wireshark/-/issues/1455
1349 * for all the gory details
1352 #define INV_AUTONEG_OTHER 0x0001 /* bOther(0), -- other or unknown */
1353 #define INV_AUTONEG_10BASE_T 0x0002 /* b10baseT(1), -- 10BASE-T half duplex mode */
1354 #define INV_AUTONEG_10BASET_FD 0x0004 /* b10baseTFD(2), -- 10BASE-T full duplex mode */
1355 #define INV_AUTONEG_100BASE_T4 0x0008 /* b100baseT4(3), -- 100BASE-T4 */
1356 #define INV_AUTONEG_100BASE_TX 0x0010 /* b100baseTX(4), -- 100BASE-TX half duplex mode */
1357 #define INV_AUTONEG_100BASE_TXFD 0x0020 /* b100baseTXFD(5), -- 100BASE-TX full duplex mode */
1358 #define INV_AUTONEG_100BASE_T2 0x0040 /* b100baseT2(6), -- 100BASE-T2 half duplex mode */
1359 #define INV_AUTONEG_100BASE_T2FD 0x0080 /* b100baseT2FD(7), -- 100BASE-T2 full duplex mode */
1360 #define INV_AUTONEG_FDX_PAUSE 0x0100 /* bFdxPause(8), -- PAUSE for full-duplex links */
1361 #define INV_AUTONEG_FDX_APAUSE 0x0200 /* bFdxAPause(9), -- Asymmetric PAUSE for full-duplex links */
1362 #define INV_AUTONEG_FDX_SPAUSE 0x0400 /* bFdxSPause(10), -- Symmetric PAUSE for full-duplex links */
1363 #define INV_AUTONEG_FDX_BPAUSE 0x0800 /* bFdxBPause(11), -- Asymmetric and Symmetric PAUSE for full-duplex links */
1364 #define INV_AUTONEG_1000BASE_X 0x1000 /* b1000baseX(12), -- 1000BASE-X, -LX, -SX, -CX half duplex mode */
1365 #define INV_AUTONEG_1000BASE_XFD 0x2000 /* b1000baseXFD(13), -- 1000BASE-X, -LX, -SX, -CX full duplex mode */
1366 #define INV_AUTONEG_1000BASE_T 0x4000 /* b1000baseT(14), -- 1000BASE-T half duplex mode */
1367 #define INV_AUTONEG_1000BASE_TFD 0x8000 /* b1000baseTFD(15) -- 1000BASE-T full duplex mode */
1369 #define EVB_CAPA_STD 0x8000
1370 #define EVB_CAPA_RR 0x4000
1372 #define EVB_CAPA_RTE 0x0004
1373 #define EVB_CAPA_ECP 0x0002
1374 #define EVB_CAPA_VDP 0x0001
1376 /* IEEE 802.3br Additional Ethernet Capabilities flags */
1377 #define IEEE_802_3BR_AEC_SUPPORT 0x0001
1378 #define IEEE_802_3BR_AEC_ENABLE 0x0002
1379 #define IEEE_802_3BR_AEC_ACTIVE 0x0004
1380 #define IEEE_802_3BR_AEC_ADDFRAGSIZE 0x0018
1381 #define IEEE_802_3BR_AEC_RESERVED 0xFFE0
1383 #define MAX_MAC_LEN 6
1386 static const value_string profinet_port2_status_vals[] = {
1387 { 0, "OFF" },
1388 { 1, "SYNCDATA_LOADED" },
1389 { 2, "RTCLASS2_UP" },
1390 { 3, "Reserved" },
1391 /* all other bits reserved */
1392 { 0, NULL }
1395 static const value_string profinet_port3_status_vals[] = {
1396 { 0, "OFF" },
1397 { 1, "reserved" },
1398 { 2, "RTCLASS3_UP" },
1399 { 3, "RTCLASS3_DOWN" },
1400 { 4, "RTCLASS3_RUN" },
1401 /* all other bits reserved */
1402 { 0, NULL }
1405 static const value_string profinet_port3_status_PreambleLength[] = {
1406 { 0, "Seven octets" },
1407 { 1, "One octet" },
1408 { 0, NULL }
1410 static const value_string profinet_mrrt_port_status_vals[] = {
1411 { 0, "OFF" },
1412 { 1, "MRRT_CONFIGURED" },
1413 { 2, "MRRT_UP" },
1414 /* all other bits reserved */
1415 { 0, NULL }
1417 static const value_string profinet_time_domain_number_vals[] = {
1418 { 0x0000, "Global Time" },
1419 { 0x0001, "Global Time Redundant" },
1420 { 0x0020, "Working Clock" },
1421 { 0x0021, "Working Clock Redundant" },
1422 { 0, NULL }
1425 /* IEEE 802.1Qbg Subtypes */
1426 static const value_string ieee_802_1qbg_subtypes[] = {
1427 { 0x00, "EVB" },
1428 { 0x01, "CDCP" },
1429 { 0x02, "VDP" },
1430 { 0, NULL }
1433 static const unit_name_string units_m = { " m", NULL };
1435 static void
1436 mdi_power_base(char *buf, uint32_t value) {
1437 snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u. Watt", value/10, value%10);
1440 static void
1441 media_power_base(char *buf, uint32_t value) {
1442 snprintf(buf, ITEM_LABEL_LENGTH, "%u mW", value * 100);
1445 // Get absolute 2's complement value
1446 // Returns true if the value is negative (so if
1447 // it returns false, there is no conversion).
1448 // bitSize: number of bits of the variable.
1449 static bool
1450 get2sComplementAbsoluteValue(uint64_t * value, unsigned bitSize){
1451 const uint64_t signMask = INT64_C(0x1) << (bitSize - 1);
1453 uint64_t signedMask = INT64_C(0x1) << bitSize;
1454 signedMask--;
1455 signedMask = ~signedMask;
1457 if(*value & signMask){
1458 *value |= signedMask; // sign propagation
1460 // Convert to absolute value
1461 *value = ~(*value);
1462 (*value)++;
1463 return true;
1465 return false;
1468 static uint64_t
1469 getUint64MaskedValue(uint64_t value, unsigned bitSize){
1470 uint64_t mask = INT64_C(0x1) << bitSize;
1471 mask--;
1472 return value & mask;
1475 static uint64_t
1476 pow10_uint64(int exponent){
1477 uint64_t val = 1;
1479 while(exponent > 0){
1480 val *= 10;
1481 exponent--;
1484 while(exponent < 0){
1485 val /= 10;
1486 exponent++;
1488 return val;
1491 // Decode uint fractional variable
1492 static uint64_t
1493 convertFractionalToFixedSizeDecimal(uint64_t value, unsigned fractionalBitSize, unsigned numberOfDigitToDisplay){
1494 const uint64_t resolution = INT64_C(0x1) << fractionalBitSize;
1495 // => 0x02000000 for 25-bits
1496 // => 0x00000100 for 8-bits
1498 const uint64_t fractionalPortionMask = resolution - 1;
1499 value &= fractionalPortionMask;
1501 // Maximum value for numberOfDigitToDisplay is :
1502 // log10(INT64_C(0xFFFFFFFFFFFFFFFF) / fractionalPortionMask);
1503 // => if result is stored in 32-bits, numberOfDigitToDisplay max = 9
1504 const uint64_t displayMultiplier = pow10_uint64(numberOfDigitToDisplay);
1505 value *= displayMultiplier;
1506 uint64_t moduloValue = value % resolution;
1507 value /= resolution;
1508 if(moduloValue >= (resolution/2)){
1509 value++; // rounded value
1512 return value;
1516 /* Calculate Latitude and Longitude string */
1518 Parameters:
1519 option = 0 -> Latitude
1520 option = 1 -> Longitude
1522 static void
1523 get_latitude_or_longitude(char *buf, int option, uint64_t unmasked_value)
1525 /* The latitude and longitude are 34 bit fixed point value consisting
1526 of 9 bits of integer and 25 bits of fraction.
1527 When option is equal to 0, positive numbers are represent a location
1528 north of the equator and negative (2s complement) numbers are south of the equator.
1529 When option is equal to 1, positive values are east of the prime
1530 meridian and negative (2s complement) numbers are west of the prime meridian.
1531 Longitude values outside the range of -180 to 180 decimal degrees or latitude values
1532 outside the range of -90 to 90 degrees MUST be considered invalid.
1534 const unsigned variableBitSize = 34;
1535 const unsigned fractionalBitSize = 25;
1536 const uint64_t maxlatitude = (INT64_C(0x1) << fractionalBitSize) * INT64_C(90); // 90 degrees
1537 const uint64_t maxlongitude = (INT64_C(0x1) << fractionalBitSize) * INT64_C(180); // 180 degrees
1539 uint64_t masked_value = getUint64MaskedValue(unmasked_value, variableBitSize); // get 34-bit value
1541 // Get absolute value of a 34-bit 2's variable
1542 // => value is 33-bit
1543 uint64_t absolute_value = masked_value;
1544 bool isNegative = get2sComplementAbsoluteValue(&absolute_value, variableBitSize);
1546 // Get unsigned integer 8-bit value
1547 uint32_t integerPortion = (uint32_t)(absolute_value >> fractionalBitSize);
1549 // Get fractional 25-bit value
1550 const unsigned numberOfDigitToDisplay = 4;
1551 uint64_t fixedSizeDecimal = convertFractionalToFixedSizeDecimal(absolute_value, fractionalBitSize, numberOfDigitToDisplay);
1553 const char *direction;
1554 const char *err_str = "";
1555 if (option == 0){
1556 // Latitude - north/south directions
1557 if (isNegative){
1558 direction = "South";
1559 } else {
1560 direction = "North";
1562 if(absolute_value > maxlatitude){
1563 err_str = "[Error: value > 90 degrees] ";
1565 } else {
1566 // Longitude - east/west directions
1567 if (isNegative){
1568 direction = "West";
1569 } else {
1570 direction = "East";
1572 if(absolute_value > maxlongitude){
1573 err_str = "[Error: value > 180 degrees] ";
1577 const uint64_t fractionalMask = (INT64_C(0x1) << fractionalBitSize) - 1;
1579 // %04 correspond to numberOfDigitToDisplay
1580 snprintf(buf, ITEM_LABEL_LENGTH, "%s%u.%04" PRIu64 " degrees %s (0x%010" PRIX64 " - %u-bit integer part 0x%04" PRIX64 " / %u-bit fractional part 0x%08" PRIX64 ")",
1581 err_str,
1582 integerPortion, fixedSizeDecimal, direction, masked_value,
1583 variableBitSize - fractionalBitSize, masked_value >> fractionalBitSize,
1584 fractionalBitSize, masked_value & fractionalMask
1588 static void
1589 latitude_base(char *buf, uint64_t value) {
1590 get_latitude_or_longitude(buf, 0, value);
1593 static void
1594 longitude_base(char *buf, uint64_t value) {
1595 get_latitude_or_longitude(buf, 1, value);
1598 static void
1599 altitude_base(char *buf, uint32_t unmasked_value) {
1600 // RFC6225
1601 // Altitude: A 30-bit value defined by the AType field.
1602 // In some cases, the altitude of the location might not be provided.
1603 // An Altitude Type value of zero indicates that the altitude is not
1604 // given to the client. In this case, the Altitude and Altitude
1605 // Uncertainty fields can contain any value and MUST be ignored.
1607 // If the Altitude Type has a value of one, altitude is measured in
1608 // meters, in relation to the zero set by the vertical datum. For AType
1609 // = 1, the altitude value is expressed as a 30-bit, fixed-point, two's
1610 // complement integer with 22 integer bits and 8 fractional bits.
1612 // A value of two for Altitude Type indicates that the altitude value is
1613 // measured in floors. Since altitude in meters may not be known within
1614 // a building, a floor indication may be more useful. For AType = 2,
1615 // the altitude value is expressed as a 30-bit, fixed-point, two's
1616 // complement integer with 22 integer bits and 8 fractional bits.
1618 // the altitude resolution (AltRes) value encodes the number of
1619 // high-order altitude bits that should be considered valid.
1620 // Values above 30 (decimal) are undefined and reserved.
1622 const unsigned variableBitSize = 30;
1623 const unsigned fractionalBitSize = 8;
1625 uint64_t masked_value = getUint64MaskedValue(unmasked_value, variableBitSize); // get 30-bit value
1627 // Get absolute value of a 30-bit 2's variable
1628 // => value is 29-bit
1629 uint64_t absolute_value = masked_value;
1630 bool isNegative = get2sComplementAbsoluteValue(&absolute_value, variableBitSize);
1632 // Get unsigned integer 8-bit value
1633 uint32_t integerPortion = (uint32_t)(absolute_value >> fractionalBitSize);
1635 // Get fractional 8-bit value
1636 const unsigned numberOfDigitToDisplay = 4;
1637 uint64_t fixedSizeDecimal = convertFractionalToFixedSizeDecimal(absolute_value, fractionalBitSize, numberOfDigitToDisplay);
1639 const char * sign;
1640 if (isNegative){
1641 sign = "-";
1642 } else {
1643 sign = "+";
1647 const uint64_t fractionalMask = (INT64_C(0x1) << fractionalBitSize) - 1;
1649 // %04 correspond to numberOfDigitToDisplay
1650 snprintf(buf, ITEM_LABEL_LENGTH, "%s%u.%04" PRIu64 " (0x%08" PRIX64 " - %u-bit integer part 0x%06" PRIX64 " / %u-bit fractional part 0x%02" PRIX64 ")",
1651 sign, integerPortion, fixedSizeDecimal, masked_value,
1652 variableBitSize - fractionalBitSize, masked_value >> fractionalBitSize,
1653 fractionalBitSize, masked_value & fractionalMask
1657 static void
1658 latitude_or_longitude_resolution(char *buf, uint8_t value) {
1659 // formula, where x is the encoded integer value:
1660 // Uncertainty = 2 ^ ( 8 - x )
1662 int32_t masked_value = value & 0x3F;
1663 double resolution = 1.0;
1664 int32_t i = 8 - masked_value;
1665 while(i > 0){
1666 resolution *= 2.0;
1667 i--;
1669 while(i < 0){
1670 resolution /= 2.0;
1671 i++;
1674 const char *err_str = "";
1675 if(masked_value > 34){
1676 err_str = "[Error: value > 34] ";
1677 } else if(masked_value < 2){
1678 err_str = "[Warning: value < 2] ";
1681 snprintf(buf, ITEM_LABEL_LENGTH, "%s%lE degrees (%" PRIi32 ")", err_str, resolution, masked_value);
1684 static void
1685 altitude_resolution(char *buf, uint8_t value) {
1686 // The encoded altitude of 000000000000000010000110110011 decodes to
1687 // 33.69921875. The encoded uncertainty of 15 gives a value of 64;
1688 // therefore, the final uncertainty is 33.69921875 +/- 64 (or the range
1689 // from -30.30078125 to 97.69921875).
1690 // The amount of altitude uncertainty can be determined by the following
1691 // formula, where x is the encoded integer value:
1692 // Uncertainty = 2 ^ ( 21 - x )
1693 // = 2 ^ ( 21 - 15 ) = 2 ^ 6 = 64
1695 int32_t masked_value = value & 0x3F;
1696 double resolution = 1.0;
1697 int32_t i = 21 - masked_value;
1698 while(i > 0){
1699 resolution *= 2.0;
1700 i--;
1702 while(i < 0){
1703 resolution /= 2.0;
1704 i++;
1707 const char *err_str = "";
1708 if(masked_value > 30){
1709 err_str = "[Error: value > 34] ";
1710 } else if(masked_value < 2){
1711 err_str = "[Warning: value < 2] ";
1714 snprintf(buf, ITEM_LABEL_LENGTH, "%s%lf (%" PRIi32 ")", err_str, resolution, masked_value);
1718 /* Dissect Chassis Id TLV (Mandatory) */
1719 static int32_t
1720 dissect_lldp_chassis_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset,
1721 profinet_lldp_column_info *pn_lldp_column_info)
1723 uint8_t tlvsubType;
1724 uint16_t tempShort;
1725 uint32_t dataLen = 0;
1726 const char *strPtr=NULL;
1727 const char *idType=NULL;
1728 uint8_t addr_family = 0;
1730 proto_tree *chassis_tree = NULL;
1731 proto_item *tf = NULL, *lf = NULL;
1733 /* Get tlv type */
1734 tempShort = tvb_get_ntohs(tvb, offset);
1735 tlvsubType = TLV_TYPE(tempShort);
1736 if (tlvsubType != CHASSIS_ID_TLV_TYPE)
1738 proto_tree_add_expert_format(tree, pinfo, &ei_lldp_bad_type , tvb, offset, TLV_INFO_LEN(tempShort),
1739 "Invalid TLV type (0x%02X), expected ChassisID type (0x%02X)", tlvsubType, CHASSIS_ID_TLV_TYPE);
1741 return -1;
1744 /* Get tlv length */
1745 dataLen = TLV_INFO_LEN(tempShort);
1746 /* Get tlv subtype */
1747 tlvsubType = tvb_get_uint8(tvb, (offset+2));
1749 /* Set chassis tree */
1750 chassis_tree = proto_tree_add_subtree_format(tree, tvb, offset, (dataLen + 2), ett_chassis_id, &tf, "Chassis Subtype = %s",
1751 val_to_str_const(tlvsubType, chassis_id_subtypes, "Reserved" ));
1753 proto_tree_add_item(chassis_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1754 lf = proto_tree_add_item(chassis_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1756 offset += 2;
1758 if (dataLen < 2)
1760 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length,
1761 "Invalid Chassis ID Length (%u), expected > (2)", dataLen);
1763 return -1;
1766 /* Get chassis id subtype */
1767 proto_tree_add_item(chassis_tree, hf_chassis_id_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
1769 offset++;
1771 switch (tlvsubType)
1773 case 4: /* MAC address */
1775 if (dataLen != 7)
1777 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length,
1778 "Invalid Chassis ID Length (%u) for Type (%s), expected (7)", dataLen, val_to_str_const(tlvsubType, chassis_id_subtypes, ""));
1779 return -1;
1782 idType="MA";
1783 strPtr = tvb_ether_to_str(pinfo->pool, tvb, offset);
1784 proto_tree_add_item(chassis_tree, hf_chassis_id_mac, tvb, offset, 6, ENC_NA);
1785 pn_lldp_column_info->chassis_id_mac = wmem_strdup(pinfo->pool, strPtr);
1786 offset += (dataLen - 1);
1787 break;
1789 case 5: /* Network address */
1791 /* Get network address family */
1792 proto_tree_add_item(chassis_tree, hf_lldp_network_address_family, tvb, offset, 1, ENC_BIG_ENDIAN);
1793 addr_family = tvb_get_uint8(tvb,offset);
1795 offset++;
1797 idType="NA";
1799 /* Check for IPv4 or IPv6 */
1800 switch(addr_family){
1801 case AFNUM_INET:
1802 if (dataLen == 6){
1803 strPtr = tvb_ip_to_str(pinfo->pool, tvb, offset);
1804 }else{
1805 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length,
1806 "Invalid Chassis ID Length (%u) for Type (%s, %s), expected (6)", dataLen, val_to_str_const(tlvsubType, chassis_id_subtypes, ""), val_to_str_const(addr_family, afn_vals, ""));
1807 return -1;
1810 proto_tree_add_item(chassis_tree, hf_chassis_id_ip4, tvb, offset, 4, ENC_BIG_ENDIAN);
1812 break;
1813 case AFNUM_INET6:
1814 if (dataLen == 18){
1815 strPtr = tvb_ip6_to_str(pinfo->pool, tvb, offset);
1816 }else{
1817 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length,
1818 "Invalid Chassis ID Length (%u) for Type (%s, %s), expected (18)", dataLen, val_to_str_const(tlvsubType, chassis_id_subtypes, ""), val_to_str_const(addr_family, afn_vals, ""));
1819 return -1;
1822 proto_tree_add_item(chassis_tree, hf_chassis_id_ip6, tvb, offset, 16, ENC_NA);
1824 break;
1825 default:
1826 strPtr = tvb_bytes_to_str(pinfo->pool, tvb, offset, (dataLen-2));
1827 proto_tree_add_item(chassis_tree, hf_chassis_id, tvb, offset, (dataLen-2), ENC_NA);
1829 break;
1832 offset += (dataLen - 2);
1833 break;
1835 case 1: /* Chassis component */
1836 case 2: /* Interface alias */
1837 case 3: /* Port component */
1838 case 6: /* Interface name */
1839 case 7: /* Locally assigned */
1840 default:
1842 if (dataLen > 256)
1844 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length_excess,
1845 "Invalid Chassis ID Length (%u) for Type (%s), expected < (256)", dataLen, val_to_str_const(tlvsubType, chassis_id_subtypes, ""));
1846 return -1;
1849 switch(tlvsubType)
1851 case 2: /* Interface alias */
1852 idType="IA";
1853 strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1));
1854 break;
1855 case 6: /* Interface name */
1856 idType="IN";
1857 strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1));
1858 break;
1859 case 7: /* Locally assigned */
1860 idType="LA";
1861 strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen-1));
1862 pn_lldp_column_info->chassis_id_locally_assigned = wmem_strdup(pinfo->pool, strPtr);
1863 break;
1864 case 1: /* Chassis component */
1865 idType="CC";
1866 strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1));
1867 break;
1868 case 3: /* Port component */
1869 idType="PC";
1870 strPtr = tvb_bytes_to_str(pinfo->pool, tvb, offset, (dataLen-1));
1872 break;
1873 default:
1874 idType="Rs";
1875 strPtr = "Reserved";
1877 break;
1880 proto_tree_add_item(chassis_tree, hf_chassis_id, tvb, offset, (dataLen-1), ENC_NA);
1882 offset += (dataLen - 1);
1883 break;
1887 if (column_info_selection == DEFAULT_COLUMN_INFO)
1889 col_append_fstr(pinfo->cinfo, COL_INFO, "%s/%s ", idType, strPtr);
1891 proto_item_append_text(tf, ", Id: %s", strPtr);
1893 return offset;
1896 /* Dissect Port Id TLV (Mandatory) */
1897 static int32_t
1898 dissect_lldp_port_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset,
1899 profinet_lldp_column_info *pn_lldp_column_info)
1901 uint8_t tlvsubType;
1902 uint16_t tempShort;
1903 uint32_t dataLen = 0;
1904 const char *strPtr=NULL;
1905 const char *idType=NULL;
1906 uint8_t addr_family = 0;
1908 proto_tree *port_tree = NULL;
1909 proto_item *tf = NULL, *lf = NULL;
1911 /* Get tlv type */
1912 tempShort = tvb_get_ntohs(tvb, offset);
1913 tlvsubType = TLV_TYPE(tempShort);
1914 if (tlvsubType != PORT_ID_TLV_TYPE)
1916 proto_tree_add_expert_format(tree, pinfo, &ei_lldp_bad_type , tvb, offset, TLV_INFO_LEN(tempShort),
1917 "Invalid Port ID (0x%02X), expected (0x%02X)", tlvsubType, PORT_ID_TLV_TYPE);
1919 return -1;
1922 /* Get tlv length and subtype */
1923 dataLen = TLV_INFO_LEN(tempShort);
1924 tlvsubType = tvb_get_uint8(tvb, (offset+2));
1926 /* Set port tree */
1927 port_tree = proto_tree_add_subtree_format(tree, tvb, offset, (dataLen + 2), ett_port_id, &tf, "Port Subtype = %s",
1928 val_to_str_const(tlvsubType, port_id_subtypes, "Unknown" ));
1930 proto_tree_add_item(port_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1931 lf = proto_tree_add_item(port_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1933 offset += 2;
1935 if (dataLen < 2) {
1936 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length,
1937 "Invalid Port ID Length (%u), expected > (2)", dataLen);
1939 return -1;
1942 /* Get port id subtype */
1943 proto_tree_add_item(port_tree, hf_port_id_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
1945 offset++;
1947 switch (tlvsubType)
1949 case 3: /* MAC address */
1950 if (dataLen != 7)
1952 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length,
1953 "Invalid Port ID Length (%u) for Type (%s), expected (7)", dataLen, val_to_str_const(tlvsubType, port_id_subtypes, ""));
1954 return -1;
1957 idType = "MA";
1958 strPtr = tvb_ether_to_str(pinfo->pool, tvb, offset);
1959 proto_tree_add_item(port_tree, hf_port_id_mac, tvb, offset, 6, ENC_NA);
1961 offset += (dataLen - 1);
1962 break;
1963 case 4: /* Network address */
1964 /* Get network address family */
1965 addr_family = tvb_get_uint8(tvb,offset);
1966 proto_tree_add_item(port_tree, hf_lldp_network_address_family, tvb, offset, 1, ENC_BIG_ENDIAN);
1968 offset++;
1970 idType = "NA";
1972 /* Check for IPv4 or IPv6 */
1973 switch(addr_family){
1974 case AFNUM_INET:
1975 if (dataLen == 6){
1976 strPtr = tvb_ip_to_str(pinfo->pool, tvb, offset);
1977 }else{
1978 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length,
1979 "Invalid Port ID Length (%u) for Type (%s, %s), expected (6)", dataLen, val_to_str_const(tlvsubType, port_id_subtypes, ""), val_to_str_const(addr_family, afn_vals, ""));
1980 return -1;
1983 proto_tree_add_item(port_tree, hf_port_id_ip4, tvb, offset, 4, ENC_BIG_ENDIAN);
1985 break;
1986 case AFNUM_INET6:
1987 if (dataLen == 18){
1988 strPtr = tvb_ip6_to_str(pinfo->pool, tvb, offset);
1989 }else{
1990 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length,
1991 "Invalid Port ID Length (%u) for Type (%s, %s), expected (18)", dataLen, val_to_str_const(tlvsubType, port_id_subtypes, ""), val_to_str_const(addr_family, afn_vals, ""));
1992 return -1;
1995 proto_tree_add_item(port_tree, hf_port_id_ip6, tvb, offset, 16, ENC_NA);
1997 break;
1998 default:
1999 strPtr = tvb_bytes_to_str(pinfo->pool, tvb, offset, (dataLen-2));
2000 proto_tree_add_item(port_tree, hf_port_id, tvb, offset, (dataLen-2), ENC_ASCII);
2002 break;
2005 offset += (dataLen - 2);
2006 break;
2007 case 1: /* Interface alias */
2008 case 2: /* Port Component */
2009 case 5: /* Interface name */
2010 case 6: /* Agent circuit ID */
2011 case 7: /* Locally assigned */
2012 default:
2013 if (dataLen > 256)
2015 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length_excess,
2016 "Invalid Port ID Length (%u) for Type (%s), expected < (256)", dataLen, val_to_str_const(tlvsubType, port_id_subtypes, ""));
2017 return -1;
2020 switch (tlvsubType)
2022 case 1: /* Interface alias */
2023 idType = "IA";
2024 strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1));
2025 break;
2026 case 2: /* Port component */
2027 idType = "PC";
2028 strPtr = tvb_bytes_to_str(pinfo->pool, tvb, offset, (dataLen-1));
2029 break;
2030 case 5: /* Interface name */
2031 idType = "IN";
2032 strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1));
2033 break;
2034 case 6: /* Agent circuit ID */
2035 idType = "AC";
2036 strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1));
2037 break;
2038 case 7: /* Locally assigned */
2039 idType = "LA";
2040 strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen-1));
2041 pn_lldp_column_info->port_id_locally_assigned = wmem_strdup(pinfo->pool, strPtr);
2042 break;
2043 default:
2044 idType = "Rs";
2045 strPtr = "Reserved";
2046 break;
2049 proto_tree_add_item(port_tree, hf_port_id, tvb, offset, (dataLen-1), ENC_ASCII);
2051 offset += (dataLen - 1);
2052 break;
2054 if (column_info_selection == DEFAULT_COLUMN_INFO)
2056 col_append_fstr(pinfo->cinfo, COL_INFO, "%s/%s ", idType, strPtr);
2058 proto_item_append_text(tf, ", Id: %s", strPtr);
2060 return offset;
2063 /* Dissect Time To Live TLV (Mandatory) */
2064 static int32_t
2065 dissect_lldp_time_to_live(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset, uint16_t *isShutdown)
2067 uint8_t tlvsubType;
2068 uint16_t tempShort;
2069 uint32_t dataLen = 0;
2071 proto_tree *time_to_live_tree;
2072 proto_item *ti;
2074 /* Get tlv type */
2075 tempShort = tvb_get_ntohs(tvb, offset);
2076 tlvsubType = TLV_TYPE(tempShort);
2077 if (tlvsubType != TIME_TO_LIVE_TLV_TYPE)
2078 return -1;
2080 /* Get tlv length and seconds field */
2081 dataLen = TLV_INFO_LEN(tempShort);
2082 tempShort = tvb_get_ntohs(tvb, (offset+2));
2083 *isShutdown = !tempShort;
2085 /* LLDPDU types: IEEE 802.1AB-2016 9.1.2 */
2086 if (tempShort != 0) {
2087 time_to_live_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2,
2088 ett_time_to_live, NULL, "Time To Live = %u sec", tempShort);
2089 ti = proto_tree_add_none_format(time_to_live_tree, hf_pdu_type, tvb, offset, dataLen + 2, "Normal LLDPDU");
2090 proto_item_set_generated(ti);
2091 } else {
2092 time_to_live_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2,
2093 ett_time_to_live, NULL, "Discard all info for this MSAP (Time To Live = 0)");
2094 ti = proto_tree_add_none_format(time_to_live_tree, hf_pdu_type, tvb, offset, dataLen + 2, "Shutdown LLDPDU");
2095 proto_item_set_generated(ti);
2098 proto_tree_add_item(time_to_live_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2099 proto_tree_add_item(time_to_live_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2100 offset += 2;
2102 /* Display time to live information */
2103 proto_tree_add_item(time_to_live_tree, hf_time_to_live, tvb, offset, 2, ENC_BIG_ENDIAN);
2104 offset += 2;
2106 if (column_info_selection == DEFAULT_COLUMN_INFO) {
2107 if (tempShort != 0) {
2108 col_append_fstr(pinfo->cinfo, COL_INFO, "%u ", tempShort);
2109 } else {
2110 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", "0 (Shutdown LLDPDU)");
2114 return offset;
2117 /* Dissect End of LLDPDU TLV */
2118 /* As of 802.1ab-2016 LLDP is defective by design. The End of LLDPDU was changed from its
2119 * previously mandatory state to optional. With nothing to indicate the length of the entire LLDPDU
2120 * and no marker to indicate the end of the LLDPDU there are now cases where it is not possible to
2121 * affirmatively determine that an LLDPDU has ended. Depending on where a capture is collected,
2122 * additional data may follow the LLDPDU (FCS, diagnostic trailers, non-zero padding, etc...)
2124 static int32_t
2125 dissect_lldp_end_of_lldpdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset)
2127 uint8_t tlvType;
2128 uint16_t dataLen;
2129 uint16_t tempShort;
2131 proto_tree *end_of_lldpdu_tree, *lf;
2133 /* Get tlv type and length */
2134 tempShort = tvb_get_ntohs(tvb, offset);
2135 tlvType = TLV_TYPE(tempShort);
2137 /* Get tlv length */
2138 dataLen = TLV_INFO_LEN(tempShort);
2140 /* Set port tree */
2141 end_of_lldpdu_tree = proto_tree_add_subtree(tree, tvb, offset, (dataLen + 2), ett_end_of_lldpdu, NULL, "End of LLDPDU");
2143 proto_tree_add_item(end_of_lldpdu_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2144 lf = proto_tree_add_item(end_of_lldpdu_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2145 if (dataLen > 0)
2147 /* Either a corrupt / bad End of LLDPDU, or the start of something after an LLDPDU
2148 * without an End of LLDPDU TLV.
2149 * Add EI pointing out possible invalid End of LLDP, but do not consume bytes.
2150 * Any trailer, FCS, etc starting with 0x00 or 0x01 would be interpreted as an
2151 * End of LLDPDU. Chances are better that they belong to another dissector vs.
2152 * being a malformed End of LLDPDU (or other TLV).
2154 * It may be reasonable to add pref to consume the bytes anyway
2157 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length_excess,
2158 "Invalid Length (%u) for Type (%s), expected (0)", dataLen, val_to_str_const(tlvType, tlv_types, ""));
2159 return -1;
2162 offset += 2;
2163 return offset;
2166 /* Dissect Port Description TLV */
2167 static int32_t
2168 dissect_lldp_port_desc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset)
2170 uint16_t tempShort;
2171 uint32_t dataLen = 0;
2172 const char *strPtr;
2174 proto_tree *port_desc_tree;
2176 /* Get tlv type and length */
2177 tempShort = tvb_get_ntohs(tvb, offset);
2179 /* Get tlv length */
2180 dataLen = TLV_INFO_LEN(tempShort);
2182 strPtr = tvb_format_stringzpad(pinfo->pool, tvb, (offset+2), dataLen);
2184 /* Set port tree */
2185 port_desc_tree = proto_tree_add_subtree_format(tree, tvb, offset, (dataLen + 2),
2186 ett_port_description, NULL, "Port Description = %s", strPtr);
2188 proto_tree_add_item(port_desc_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2189 proto_tree_add_item(port_desc_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2191 offset += 2;
2192 /* Display port description information */
2193 proto_tree_add_item(port_desc_tree, hf_port_desc, tvb, offset, dataLen, ENC_ASCII);
2195 offset += dataLen;
2197 return offset;
2200 /* Dissect System Name and description TLV */
2201 static int32_t
2202 dissect_lldp_system_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset)
2204 uint16_t tempShort;
2205 uint32_t dataLen = 0;
2206 uint8_t tlvsubType;
2207 const char *strPtr;
2209 proto_tree *system_subtree;
2211 /* Get tlv type and length */
2212 tempShort = tvb_get_ntohs(tvb, offset);
2213 tlvsubType = TLV_TYPE(tempShort);
2215 /* Get tlv length */
2216 dataLen = TLV_INFO_LEN(tempShort);
2218 strPtr = tvb_format_stringzpad(pinfo->pool, tvb, (offset+2), dataLen);
2220 /* Set system name tree */
2221 if (tlvsubType == SYSTEM_NAME_TLV_TYPE) {
2222 system_subtree = proto_tree_add_subtree_format(tree, tvb, offset, (dataLen + 2),
2223 ett_system_name, NULL, "System Name = %s", strPtr);
2224 if (column_info_selection == DEFAULT_COLUMN_INFO)
2226 col_append_fstr(pinfo->cinfo, COL_INFO, "SysN=%s ", strPtr);
2228 } else {
2229 system_subtree = proto_tree_add_subtree_format(tree, tvb, offset, (dataLen + 2),
2230 ett_system_desc, NULL, "System Description = %s", strPtr);
2231 if (column_info_selection == DEFAULT_COLUMN_INFO)
2233 col_append_fstr(pinfo->cinfo, COL_INFO, "SysD=%s ", strPtr);
2237 proto_tree_add_item(system_subtree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2238 proto_tree_add_item(system_subtree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2240 offset +=2;
2242 /* Display system name information */
2243 if (tlvsubType == SYSTEM_NAME_TLV_TYPE)
2244 proto_tree_add_item(system_subtree, hf_lldp_tlv_system_name, tvb, offset, dataLen, ENC_ASCII);
2245 else
2246 proto_tree_add_item(system_subtree, hf_lldp_tlv_system_desc, tvb, offset, dataLen, ENC_ASCII);
2248 offset += dataLen;
2250 return offset;
2253 /* Dissect System Capabilities TLV */
2254 static int32_t
2255 dissect_lldp_system_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset)
2257 uint16_t tempShort;
2258 uint32_t dataLen = 0;
2260 proto_tree *system_capabilities_tree;
2261 proto_tree *capabilities_summary_tree;
2262 proto_tree *capabilities_enabled_tree;
2263 proto_item *tf;
2265 /* Get tlv type and length */
2266 tempShort = tvb_get_ntohs(tvb, offset);
2268 /* Get tlv length */
2269 dataLen = TLV_INFO_LEN(tempShort);
2271 /* Set system capabilities tree */
2272 system_capabilities_tree = proto_tree_add_subtree(tree, tvb, offset, (dataLen + 2), ett_system_cap, NULL, "Capabilities");
2274 proto_tree_add_item(system_capabilities_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2275 proto_tree_add_item(system_capabilities_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2277 offset += 2;
2278 /* Display system capability information */
2279 tf = proto_tree_add_item(system_capabilities_tree, hf_lldp_tlv_system_cap, tvb, offset, 2, ENC_BIG_ENDIAN);
2280 capabilities_summary_tree = proto_item_add_subtree(tf, ett_system_cap_summary);
2282 /* Add capabilities to summary tree */
2283 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_other, tvb, offset, 2, ENC_BIG_ENDIAN);
2284 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_repeater, tvb, offset, 2, ENC_BIG_ENDIAN);
2285 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_bridge, tvb, offset, 2, ENC_BIG_ENDIAN);
2286 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_wlan_access_pt, tvb, offset, 2, ENC_BIG_ENDIAN);
2287 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_router, tvb, offset, 2, ENC_BIG_ENDIAN);
2288 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_telephone, tvb, offset, 2, ENC_BIG_ENDIAN);
2289 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_docsis_cable_device, tvb, offset, 2, ENC_BIG_ENDIAN);
2290 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_station_only, tvb, offset, 2, ENC_BIG_ENDIAN);
2291 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_cvlan_component, tvb, offset, 2, ENC_BIG_ENDIAN);
2292 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_svlan_component, tvb, offset, 2, ENC_BIG_ENDIAN);
2293 proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_tpmr_component, tvb, offset, 2, ENC_BIG_ENDIAN);
2295 offset += 2;
2296 /* Get enabled summary */
2298 /* Display system capability information */
2299 tf = proto_tree_add_item(system_capabilities_tree, hf_lldp_tlv_enable_system_cap, tvb, offset, 2, ENC_BIG_ENDIAN);
2300 capabilities_enabled_tree = proto_item_add_subtree(tf, ett_system_cap_enabled);
2301 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_other, tvb, offset, 2, ENC_BIG_ENDIAN);
2302 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_repeater, tvb, offset, 2, ENC_BIG_ENDIAN);
2303 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_bridge, tvb, offset, 2, ENC_BIG_ENDIAN);
2304 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_wlan_access_pt, tvb, offset, 2, ENC_BIG_ENDIAN);
2305 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_router, tvb, offset, 2, ENC_BIG_ENDIAN);
2306 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_telephone, tvb, offset, 2, ENC_BIG_ENDIAN);
2307 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_docsis_cable_device, tvb, offset, 2, ENC_BIG_ENDIAN);
2308 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_station_only, tvb, offset, 2, ENC_BIG_ENDIAN);
2309 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_cvlan_component, tvb, offset, 2, ENC_BIG_ENDIAN);
2310 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_svlan_component, tvb, offset, 2, ENC_BIG_ENDIAN);
2311 proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_tpmr_component, tvb, offset, 2, ENC_BIG_ENDIAN);
2313 offset += 2;
2315 return offset;
2318 /* Dissect Management Address TLV */
2319 static int32_t
2320 dissect_lldp_management_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset)
2322 uint16_t tempShort;
2323 uint32_t dataLen = 0;
2324 uint8_t subtypeByte;
2325 uint8_t stringLen = 0;
2327 proto_tree *system_mgm_addr;
2329 /* Get tlv type and length */
2330 tempShort = tvb_get_ntohs(tvb, offset);
2332 /* Get tlv length */
2333 dataLen = TLV_INFO_LEN(tempShort);
2335 /* Set system capabilities tree */
2336 system_mgm_addr = proto_tree_add_subtree(tree, tvb, offset, (dataLen + 2), ett_management_address, NULL, "Management Address");
2338 proto_tree_add_item(system_mgm_addr, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2339 proto_tree_add_item(system_mgm_addr, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2341 offset += 2;
2343 /* Get management address string length */
2344 stringLen = tvb_get_uint8(tvb, offset);
2345 proto_tree_add_item(system_mgm_addr, hf_mgn_address_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2347 offset++;
2349 /* Get management address subtype */
2350 subtypeByte = tvb_get_uint8(tvb, offset);
2351 proto_tree_add_item(system_mgm_addr, hf_mgn_address_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
2353 offset++;
2355 /* Get address */
2356 switch (subtypeByte)
2358 /* XXX - Should we throw an exception if stringLen doesn't match our address length? */
2359 case 1: /* IPv4 */
2360 proto_tree_add_item(system_mgm_addr, hf_mgn_addr_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
2361 break;
2362 case 2: /* IPv6 */
2363 proto_tree_add_item(system_mgm_addr, hf_mgn_addr_ipv6, tvb, offset, 16, ENC_NA);
2364 break;
2365 default:
2366 proto_tree_add_item(system_mgm_addr, hf_mgn_addr_hex, tvb, offset, (stringLen-1), ENC_NA);
2367 break;
2370 offset += (stringLen-1);
2372 /* Get interface numbering subtype */
2373 proto_tree_add_item(system_mgm_addr, hf_mgn_interface_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
2375 offset++;
2377 /* Get interface number */
2378 proto_tree_add_item(system_mgm_addr, hf_mgn_interface_number, tvb, offset, 4, ENC_BIG_ENDIAN);
2380 offset += 4;
2382 /* Get OID string length */
2383 stringLen = tvb_get_uint8(tvb, offset);
2384 proto_tree_add_item(system_mgm_addr, hf_mgn_oid_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2386 offset++;
2388 if (stringLen > 0)
2390 /* Get OID identifier */
2391 proto_tree_add_item(system_mgm_addr, hf_mgn_obj_id, tvb, offset, stringLen, ENC_NA);
2393 offset += stringLen;
2396 return offset;
2399 /* Dissect DCBX TLVs */
2400 static void
2401 dissect_dcbx_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
2403 uint8_t subType;
2404 uint32_t offset = 0;
2405 uint8_t priomaskByte, prioCounter, appCount = 0;
2406 uint16_t dataLen;
2407 uint16_t tempShort;
2409 proto_tree *subtlv_tree = NULL;
2410 proto_tree *apptlv_tree = NULL;
2412 proto_tree_add_item(tree, hf_dcbx_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2414 offset++;
2416 /* One org specific OUI holds many DCBx TLVs */
2417 while (tvb_reported_length_remaining(tvb, offset) && tree) {
2419 tempShort = tvb_get_ntohs(tvb, offset);
2421 /* Get TLV type & len. Actual TLV len = len + 2 */
2422 subType = TLV_TYPE(tempShort);
2423 dataLen = TLV_INFO_LEN(tempShort);
2425 /* Write out common header fields first */
2426 switch (subType)
2428 case 0x1: /* Control */
2429 subtlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2,
2430 ett_org_spc_dcbx_cee_1, NULL, "%s TLV", val_to_str_const(subType, dcbx_subtypes, "Unknown"));
2431 break;
2432 case 0x2: /* Priority Groups */
2433 subtlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2,
2434 ett_org_spc_dcbx_cee_2, NULL, "%s TLV", val_to_str_const(subType, dcbx_subtypes, "Unknown"));
2435 break;
2436 case 0x3: /* PFC */
2437 subtlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2,
2438 ett_org_spc_dcbx_cee_3, NULL, "%s TLV", val_to_str_const(subType, dcbx_subtypes, "Unknown"));
2439 break;
2440 case 0x4: /* Application */
2441 subtlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2,
2442 ett_org_spc_dcbx_cee_4, NULL, "%s TLV", val_to_str_const(subType, dcbx_subtypes, "Unknown"));
2443 break;
2444 case 0x6: /* Logical Link Down */
2445 subtlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2,
2446 ett_org_spc_dcbx_cin_6, NULL, "%s TLV", val_to_str_const(subType, dcbx_subtypes, "Unknown"));
2447 break;
2449 proto_tree_add_item(subtlv_tree, hf_dcbx_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2450 proto_tree_add_item(subtlv_tree, hf_dcbx_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2452 offset +=2;
2454 proto_tree_add_item(subtlv_tree, hf_dcbx_tlv_oper_version, tvb, offset, 1, ENC_BIG_ENDIAN);
2456 offset++;
2458 proto_tree_add_item(subtlv_tree, hf_dcbx_tlv_max_version, tvb, offset, 1, ENC_BIG_ENDIAN);
2460 offset++;
2462 if (subType == 0x1) {
2463 /* Specific to Control TLV */
2464 proto_tree_add_item(subtlv_tree, hf_dcbx_control_sequence, tvb, offset, 4, ENC_BIG_ENDIAN);
2466 offset +=4;
2468 proto_tree_add_item(subtlv_tree, hf_dcbx_control_ack, tvb, offset, 4, ENC_BIG_ENDIAN);
2470 offset +=4;
2471 } else {
2472 /* Common to all feature TLVs */
2473 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_flag_enabled, tvb, offset, 1, ENC_BIG_ENDIAN);
2474 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_flag_willing, tvb, offset, 1, ENC_BIG_ENDIAN);
2475 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_flag_error, tvb, offset, 1, ENC_BIG_ENDIAN);
2477 offset++;
2479 /* Unused field, no connection to SubType used to identify TLVs */
2480 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
2482 offset++;
2484 switch(subType)
2486 case 0x2: /* Priority Groups */
2488 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_0, tvb, offset, 2, ENC_BIG_ENDIAN);
2489 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_1, tvb, offset, 2, ENC_BIG_ENDIAN);
2490 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_2, tvb, offset, 2, ENC_BIG_ENDIAN);
2491 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_3, tvb, offset, 2, ENC_BIG_ENDIAN);
2493 offset +=2;
2495 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_4, tvb, offset, 2, ENC_BIG_ENDIAN);
2496 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_5, tvb, offset, 2, ENC_BIG_ENDIAN);
2497 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_6, tvb, offset, 2, ENC_BIG_ENDIAN);
2498 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_7, tvb, offset, 2, ENC_BIG_ENDIAN);
2500 offset +=2;
2502 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_0, tvb, offset, 1, ENC_BIG_ENDIAN);
2504 offset++;
2506 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_1, tvb, offset, 1, ENC_BIG_ENDIAN);
2508 offset++;
2510 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_2, tvb, offset, 1, ENC_BIG_ENDIAN);
2512 offset++;
2514 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_3, tvb, offset, 1, ENC_BIG_ENDIAN);
2516 offset++;
2518 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_4, tvb, offset, 1, ENC_BIG_ENDIAN);
2520 offset++;
2522 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_5, tvb, offset, 1, ENC_BIG_ENDIAN);
2524 offset++;
2526 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_6, tvb, offset, 1, ENC_BIG_ENDIAN);
2528 offset++;
2530 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_7, tvb, offset, 1, ENC_BIG_ENDIAN);
2532 offset++;
2534 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_numtcs, tvb, offset, 1, ENC_BIG_ENDIAN);
2536 offset++;
2538 break;
2540 case 0x3: /* PFC */
2542 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio0, tvb, offset, 1, ENC_BIG_ENDIAN);
2543 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio1, tvb, offset, 1, ENC_BIG_ENDIAN);
2544 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio2, tvb, offset, 1, ENC_BIG_ENDIAN);
2545 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio3, tvb, offset, 1, ENC_BIG_ENDIAN);
2546 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio4, tvb, offset, 1, ENC_BIG_ENDIAN);
2547 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio5, tvb, offset, 1, ENC_BIG_ENDIAN);
2548 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio6, tvb, offset, 1, ENC_BIG_ENDIAN);
2549 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio7, tvb, offset, 1, ENC_BIG_ENDIAN);
2551 offset++;
2553 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_numtcs, tvb, offset, 1, ENC_BIG_ENDIAN);
2555 offset++;
2557 break;
2559 case 0x4: /* Application */
2561 /* One App TLV can hold 4 byte header & multiple apps, each app takes 6 bytes */
2562 appCount = (dataLen - 4)/6;
2564 while(appCount--) {
2565 tempShort = tvb_get_ntohs(tvb, offset);
2567 apptlv_tree = proto_tree_add_subtree_format(subtlv_tree, tvb, offset, 6,
2568 ett_org_spc_dcbx_cee_app, NULL, "%s Application",
2569 val_to_str_const(tempShort, dcbx_app_types, "Unknown"));
2571 proto_tree_add_item(apptlv_tree, hf_dcbx_feature_app_proto, tvb, offset, 2, ENC_BIG_ENDIAN);
2573 offset += 2;
2575 proto_tree_add_item(apptlv_tree, hf_dcbx_feature_app_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
2576 proto_tree_add_item(apptlv_tree, hf_dcbx_feature_app_selector, tvb, offset, 3, ENC_BIG_ENDIAN);
2578 offset += 3;
2580 priomaskByte = tvb_get_uint8(tvb, offset);
2582 for (prioCounter = 0; prioCounter < 8; prioCounter++)
2583 if(priomaskByte & (0x1 << prioCounter)) {
2584 proto_tree_add_uint(apptlv_tree, hf_dcbx_feature_app_prio, tvb, offset, 1, prioCounter);
2585 break;
2588 offset++;
2590 break;
2592 case 0x6: /* Logical Link Down */
2594 proto_tree_add_item(subtlv_tree, hf_dcbx_feature_flag_llink_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2596 offset++;
2598 break;
2605 return;
2608 /* Dissect IEEE 802.1 TLVs */
2609 static int
2610 dissect_ieee_802_1_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
2612 uint8_t subType;
2613 uint32_t offset = 0;
2614 uint8_t tempByte;
2615 uint16_t dcbApp, appCount;
2617 proto_tree *vlan_flags_tree = NULL;
2618 proto_tree *mac_phy_flags = NULL;
2619 proto_tree *apptlv_tree = NULL;
2620 proto_item *tf = NULL;
2622 /* Get subtype */
2623 subType = tvb_get_uint8(tvb, offset);
2625 proto_tree_add_item(tree, hf_ieee_802_1_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
2627 offset++;
2629 switch (subType)
2631 case 0x01: /* Port VLAN ID */
2633 proto_tree_add_item(tree, hf_ieee_802_1_port_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2635 offset +=2;
2637 break;
2639 case 0x02: /* Port and Protocol VLAN ID */
2641 /* Get flags */
2642 tf = proto_tree_add_item(tree, hf_ieee_802_1_port_and_vlan_id_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
2643 vlan_flags_tree = proto_item_add_subtree(tf, ett_port_vlan_flags);
2645 proto_tree_add_item(vlan_flags_tree, hf_ieee_802_1_port_and_vlan_id_flag_supported, tvb, offset, 1, ENC_BIG_ENDIAN);
2646 proto_tree_add_item(vlan_flags_tree, hf_ieee_802_1_port_and_vlan_id_flag_enabled, tvb, offset, 1, ENC_BIG_ENDIAN);
2648 offset++;
2650 proto_tree_add_item(tree, hf_ieee_802_1_port_proto_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2652 offset +=2;
2654 break;
2656 case 0x03: /* VLAN Name */
2658 proto_tree_add_item(tree, hf_ieee_802_1_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2660 offset += 2;
2662 /* Get vlan name length */
2663 tempByte = tvb_get_uint8(tvb, offset);
2664 proto_tree_add_item(tree, hf_ieee_802_1_vlan_name_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2666 offset++;
2668 if (tempByte > 0)
2670 proto_tree_add_item(tree, hf_ieee_802_1_vlan_name, tvb, offset, tempByte, ENC_ASCII);
2672 offset += tempByte;
2675 break;
2677 case 0x04: /* Protocol ID */
2679 /* Get protocol id length */
2680 tempByte = tvb_get_uint8(tvb, offset);
2681 proto_tree_add_item(tree, hf_ieee_802_1_proto_id_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2683 offset++;
2685 if (tempByte > 0)
2688 * Section D.2.4.3 "protocol identity" of IEEE
2689 * 802.1Q-2018 says:
2691 * The protocol identity field shall contain
2692 * the first n octets of the protocol after
2693 * the layer 2 addresses (i.e., for example,
2694 * starting with the EtherType field) that the
2695 * sender would like to advertise.
2697 * What comes "after the layer 2 addresses"
2698 * depends on the network type. For Ethernet,
2699 * it's a type/length field, with, if it's a
2700 * length field, an 802.2 LLC header, with,
2701 * if that header specifies SNAP, a SNAP header
2702 * following it. For other network types, it's
2703 * just going to be an 802.2 LLC header (presumably,
2704 * if the layer 2 addresses aren't immediately
2705 * before the 802.2 header, this doesn't include
2706 * the fields between the last layer 2 address
2707 * and the 802.2 header).
2709 * We currently just show it as a blob of bytes.
2711 proto_tree_add_item(tree, hf_ieee_802_1_proto_id, tvb, offset, tempByte, ENC_NA);
2713 offset += tempByte;
2716 break;
2718 case 0x07: /* Link Aggregation */
2720 /* Get protocol id length */
2721 tf = proto_tree_add_item(tree, hf_ieee_802_1_aggregation_status, tvb, offset, 1, ENC_BIG_ENDIAN);
2722 mac_phy_flags = proto_item_add_subtree(tf, ett_802_1_aggregation);
2723 proto_tree_add_item(mac_phy_flags, hf_ieee_802_1_aggregation_status_cap, tvb, offset, 1, ENC_BIG_ENDIAN);
2724 proto_tree_add_item(mac_phy_flags, hf_ieee_802_1_aggregation_status_enabled, tvb, offset, 1, ENC_BIG_ENDIAN);
2725 proto_tree_add_item(mac_phy_flags, hf_ieee_802_1_aggregation_status_porttype, tvb, offset, 1, ENC_BIG_ENDIAN);
2727 offset++;
2729 /* Get aggregated port id */
2730 proto_tree_add_item(tree, hf_ieee_802_1_aggregated_port_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2732 offset+=4;
2733 break;
2735 case 0x8: /* Congestion Notification */
2737 /* Per-Priority CNPV Indicators */
2738 proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio0, tvb, offset, 1, ENC_BIG_ENDIAN);
2739 proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio1, tvb, offset, 1, ENC_BIG_ENDIAN);
2740 proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio2, tvb, offset, 1, ENC_BIG_ENDIAN);
2741 proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio3, tvb, offset, 1, ENC_BIG_ENDIAN);
2742 proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio4, tvb, offset, 1, ENC_BIG_ENDIAN);
2743 proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio5, tvb, offset, 1, ENC_BIG_ENDIAN);
2744 proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio6, tvb, offset, 1, ENC_BIG_ENDIAN);
2745 proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio7, tvb, offset, 1, ENC_BIG_ENDIAN);
2747 offset++;
2749 /* Per-Priority Ready Indicators */
2750 proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio0, tvb, offset, 1, ENC_BIG_ENDIAN);
2751 proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio1, tvb, offset, 1, ENC_BIG_ENDIAN);
2752 proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio2, tvb, offset, 1, ENC_BIG_ENDIAN);
2753 proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio3, tvb, offset, 1, ENC_BIG_ENDIAN);
2754 proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio4, tvb, offset, 1, ENC_BIG_ENDIAN);
2755 proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio5, tvb, offset, 1, ENC_BIG_ENDIAN);
2756 proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio6, tvb, offset, 1, ENC_BIG_ENDIAN);
2757 proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio7, tvb, offset, 1, ENC_BIG_ENDIAN);
2759 offset++;
2761 break;
2763 case 0x9: /* ETS Configuration */
2765 proto_tree_add_item(tree, hf_ieee_8021az_feature_flag_willing, tvb, offset, 1, ENC_BIG_ENDIAN);
2766 proto_tree_add_item(tree, hf_ieee_8021az_feature_flag_cbs, tvb, offset, 1, ENC_BIG_ENDIAN);
2768 tempByte = (tvb_get_uint8(tvb, offset) & 0x7);
2769 /* 0 implies 8 traffic classes supported */
2770 proto_tree_add_uint_format_value(tree, hf_ieee_8021az_maxtcs, tvb, offset, 1, tempByte, "%u (0x%X)", tempByte ? tempByte : 8, tempByte);
2772 offset++;
2774 /* Priority Assignment Table */
2775 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_0, tvb, offset, 2, ENC_BIG_ENDIAN);
2776 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_1, tvb, offset, 2, ENC_BIG_ENDIAN);
2777 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_2, tvb, offset, 2, ENC_BIG_ENDIAN);
2778 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_3, tvb, offset, 2, ENC_BIG_ENDIAN);
2780 offset +=2;
2782 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_4, tvb, offset, 2, ENC_BIG_ENDIAN);
2783 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_5, tvb, offset, 2, ENC_BIG_ENDIAN);
2784 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_6, tvb, offset, 2, ENC_BIG_ENDIAN);
2785 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_7, tvb, offset, 2, ENC_BIG_ENDIAN);
2787 offset +=2;
2789 /* TC Bandwidth Table */
2790 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_0, tvb, offset, 1, ENC_BIG_ENDIAN);
2792 offset++;
2794 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_1, tvb, offset, 1, ENC_BIG_ENDIAN);
2796 offset++;
2798 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_2, tvb, offset, 1, ENC_BIG_ENDIAN);
2800 offset++;
2802 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_3, tvb, offset, 1, ENC_BIG_ENDIAN);
2804 offset++;
2806 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_4, tvb, offset, 1, ENC_BIG_ENDIAN);
2808 offset++;
2810 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_5, tvb, offset, 1, ENC_BIG_ENDIAN);
2812 offset++;
2814 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_6, tvb, offset, 1, ENC_BIG_ENDIAN);
2816 offset++;
2818 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_7, tvb, offset, 1, ENC_BIG_ENDIAN);
2820 offset++;
2822 /* TSA Assignment Table */
2823 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class0, tvb, offset, 1, ENC_BIG_ENDIAN);
2825 offset++;
2827 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class1, tvb, offset, 1, ENC_BIG_ENDIAN);
2829 offset++;
2831 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class2, tvb, offset, 1, ENC_BIG_ENDIAN);
2833 offset++;
2835 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class3, tvb, offset, 1, ENC_BIG_ENDIAN);
2837 offset++;
2839 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class4, tvb, offset, 1, ENC_BIG_ENDIAN);
2841 offset++;
2843 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class5, tvb, offset, 1, ENC_BIG_ENDIAN);
2845 offset++;
2847 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class6, tvb, offset, 1, ENC_BIG_ENDIAN);
2849 offset++;
2851 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class7, tvb, offset, 1, ENC_BIG_ENDIAN);
2853 offset++;
2855 break;
2857 case 0xA: /* ETS Recommendation */
2859 proto_tree_add_item(tree, hf_dcbx_feature_pgid_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2861 offset++;
2863 /* Priority Assignment Table */
2864 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_0, tvb, offset, 2, ENC_BIG_ENDIAN);
2865 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_1, tvb, offset, 2, ENC_BIG_ENDIAN);
2866 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_2, tvb, offset, 2, ENC_BIG_ENDIAN);
2867 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_3, tvb, offset, 2, ENC_BIG_ENDIAN);
2869 offset +=2;
2871 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_4, tvb, offset, 2, ENC_BIG_ENDIAN);
2872 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_5, tvb, offset, 2, ENC_BIG_ENDIAN);
2873 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_6, tvb, offset, 2, ENC_BIG_ENDIAN);
2874 proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_7, tvb, offset, 2, ENC_BIG_ENDIAN);
2876 offset +=2;
2878 /* TC Bandwidth Table */
2879 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_0, tvb, offset, 1, ENC_BIG_ENDIAN);
2881 offset++;
2883 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_1, tvb, offset, 1, ENC_BIG_ENDIAN);
2885 offset++;
2887 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_2, tvb, offset, 1, ENC_BIG_ENDIAN);
2889 offset++;
2891 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_3, tvb, offset, 1, ENC_BIG_ENDIAN);
2893 offset++;
2895 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_4, tvb, offset, 1, ENC_BIG_ENDIAN);
2897 offset++;
2899 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_5, tvb, offset, 1, ENC_BIG_ENDIAN);
2901 offset++;
2903 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_6, tvb, offset, 1, ENC_BIG_ENDIAN);
2905 offset++;
2907 proto_tree_add_item(tree, hf_dcbx_feature_pg_per_7, tvb, offset, 1, ENC_BIG_ENDIAN);
2909 offset++;
2911 /* TSA Assignment Table */
2912 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class0, tvb, offset, 1, ENC_BIG_ENDIAN);
2914 offset++;
2916 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class1, tvb, offset, 1, ENC_BIG_ENDIAN);
2918 offset++;
2920 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class2, tvb, offset, 1, ENC_BIG_ENDIAN);
2922 offset++;
2924 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class3, tvb, offset, 1, ENC_BIG_ENDIAN);
2926 offset++;
2928 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class4, tvb, offset, 1, ENC_BIG_ENDIAN);
2930 offset++;
2932 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class5, tvb, offset, 1, ENC_BIG_ENDIAN);
2934 offset++;
2936 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class6, tvb, offset, 1, ENC_BIG_ENDIAN);
2938 offset++;
2940 proto_tree_add_item(tree, hf_ieee_8021az_tsa_class7, tvb, offset, 1, ENC_BIG_ENDIAN);
2942 offset++;
2944 break;
2946 case 0xB: /* PFC Configuration */
2948 proto_tree_add_item(tree, hf_ieee_8021az_feature_flag_willing, tvb, offset, 1, ENC_BIG_ENDIAN);
2949 proto_tree_add_item(tree, hf_ieee_8021az_feature_flag_mbc, tvb, offset, 1, ENC_BIG_ENDIAN);
2950 proto_tree_add_item(tree, hf_ieee_8021az_pfc_numtcs, tvb, offset, 1, ENC_BIG_ENDIAN);
2952 offset++;
2954 proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio0, tvb, offset, 1, ENC_BIG_ENDIAN);
2955 proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio1, tvb, offset, 1, ENC_BIG_ENDIAN);
2956 proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio2, tvb, offset, 1, ENC_BIG_ENDIAN);
2957 proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio3, tvb, offset, 1, ENC_BIG_ENDIAN);
2958 proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio4, tvb, offset, 1, ENC_BIG_ENDIAN);
2959 proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio5, tvb, offset, 1, ENC_BIG_ENDIAN);
2960 proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio6, tvb, offset, 1, ENC_BIG_ENDIAN);
2961 proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio7, tvb, offset, 1, ENC_BIG_ENDIAN);
2963 offset++;
2965 break;
2967 case 0xC: /* Application Priority */
2969 proto_tree_add_item(tree, hf_ieee_8021az_app_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2971 offset++;
2973 appCount = tvb_reported_length_remaining(tvb, offset)/3;
2975 while(appCount--) {
2976 dcbApp = tvb_get_ntohs(tvb, offset + 1);
2978 apptlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3,
2979 ett_org_spc_ieee_dcbx_app, NULL, "%s Application",
2980 val_to_str_const(dcbApp, dcbx_app_types, "Unknown"));
2982 proto_tree_add_item(apptlv_tree, hf_ieee_8021az_app_prio, tvb, offset, 1, ENC_BIG_ENDIAN);
2983 proto_tree_add_item(apptlv_tree, hf_ieee_8021az_app_selector, tvb, offset, 1, ENC_BIG_ENDIAN);
2985 offset++;
2987 proto_tree_add_item(apptlv_tree, hf_dcbx_feature_app_proto, tvb, offset, 2, ENC_BIG_ENDIAN);
2989 offset += 2;
2991 break;
2995 return offset;
2998 /* Dissect IEEE 802.1Qbg TLVs */
2999 static void
3000 dissect_oui_default_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
3002 proto_tree_add_item(tree, hf_unknown_subtype, tvb, 0, 1, ENC_BIG_ENDIAN);
3003 if (tvb_captured_length_remaining(tvb, 1) > 0) {
3004 proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, 1, -1, ENC_NA);
3008 static void
3009 dissect_ieee_802_1qbg_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
3011 uint8_t subType;
3012 uint32_t offset = 0;
3014 proto_tree *evb_capabilities_subtree = NULL;
3016 proto_item *tf = NULL;
3017 subType = tvb_get_uint8(tvb, offset);
3019 proto_tree_add_item(tree, hf_ieee_802_1qbg_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
3021 offset++;
3023 switch (subType) {
3024 case 0x00:
3025 /* Get EVB capabilities */
3026 tf = proto_tree_add_item(tree, hf_ieee_802_1qbg_evb_support_caps, tvb, offset, 2, ENC_BIG_ENDIAN);
3027 evb_capabilities_subtree = proto_item_add_subtree(tf, ett_802_1qbg_capabilities_flags);
3029 proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_support_caps_std, tvb, offset, 2, ENC_BIG_ENDIAN);
3030 proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_support_caps_rr, tvb, offset, 2, ENC_BIG_ENDIAN);
3031 proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_support_caps_rte, tvb, offset, 2, ENC_BIG_ENDIAN);
3032 proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_support_caps_ecp, tvb, offset, 2, ENC_BIG_ENDIAN);
3033 proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_support_caps_vdp, tvb, offset, 2, ENC_BIG_ENDIAN);
3035 offset += 2;
3037 tf = proto_tree_add_item(tree, hf_ieee_802_1qbg_evb_configure_caps, tvb, offset, 2, ENC_BIG_ENDIAN);
3038 evb_capabilities_subtree = proto_item_add_subtree(tf, ett_802_1qbg_capabilities_flags);
3040 proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_configure_caps_std, tvb, offset, 2, ENC_BIG_ENDIAN);
3041 proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_configure_caps_rr, tvb, offset, 2, ENC_BIG_ENDIAN);
3042 proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_configure_caps_rte, tvb, offset, 2, ENC_BIG_ENDIAN);
3043 proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_configure_caps_ecp, tvb, offset, 2, ENC_BIG_ENDIAN);
3044 proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_configure_caps_vdp, tvb, offset, 2, ENC_BIG_ENDIAN);
3046 offset += 2;
3048 proto_tree_add_item(tree, hf_ieee_802_1qbg_evb_supported_vsi, tvb, offset, 2, ENC_BIG_ENDIAN);
3050 offset += 2;
3052 proto_tree_add_item(tree, hf_ieee_802_1qbg_evb_configured_vsi, tvb, offset, 2, ENC_BIG_ENDIAN);
3054 offset += 2;
3056 proto_tree_add_item(tree, hf_ieee_802_1qbg_evb_retrans_timer, tvb, offset, 1, ENC_BIG_ENDIAN);
3058 break;
3061 return;
3065 /* Dissect extreme avaya ap tlv*/
3066 static int
3067 dissect_extreme_avaya_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint16_t dataLen)
3069 uint8_t subType;
3070 uint32_t i, loopCount;
3071 uint32_t offset = 0;
3074 Element TLV:
3075 ___________________________________________________________________________________________________________________________
3076 | TLV Type | TLV Length | Avaya OUI | Subtype | HMAC-SHA Digest | Element Type | State | Mgmt. VLAN | Rsvd | System ID |
3077 ----------------------------------------------------------------------------------------------------------------------------
3078 | 7 bits | 9 bits | 3 octets | 1 octet | 32 octets | 6 bits | 6 bits | 12 bits | 1 octet | 10 octets |
3079 ----------------------------------------------------------------------------------------------------------------------------
3081 Assignment TLV:
3082 __________________________________________________________________________________________________________
3083 | TLV Type | TLV Length | Avaya OUI | Subtype | HMAC-SHA Digest | Assignment Status | VLAN | I-SID |
3084 ----------------------------------------------------------------------------------------------------------
3085 | 7 bits | 9 bits | 3 octets | 1 octet | 32 octets | 4 bits | 12 bits | 3 octets |
3086 ----------------------------------------------------------------------------------------------------------
3089 /* Get subtype */
3090 subType = tvb_get_uint8(tvb, offset);
3091 proto_tree_add_item(tree, hf_ex_avaya_tlv_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
3092 offset++;
3093 switch (subType)
3095 case EX_AVAYA_SUBTYPE_ELEMENT_TLV: /* Element TLV */
3097 proto_tree_add_item(tree, hf_ex_avaya_hmac_shi, tvb, offset, 32, ENC_NA);
3098 offset+=32;
3099 proto_tree_add_item(tree, hf_ex_avaya_element_type, tvb, offset, 3, ENC_BIG_ENDIAN);
3100 proto_tree_add_item(tree, hf_ex_avaya_state, tvb, offset, 3, ENC_BIG_ENDIAN);
3101 proto_tree_add_item(tree, hf_ex_avaya_mgnt_vlan, tvb, offset, 3, ENC_BIG_ENDIAN);
3102 offset+=3;
3103 proto_tree_add_item(tree, hf_ex_avaya_rsvd, tvb, offset, 1, ENC_BIG_ENDIAN);
3104 offset+=1;
3105 proto_tree_add_item(tree, hf_ex_avaya_system_id, tvb, offset, 10, ENC_NA);
3106 offset+=10;
3107 break;
3109 case EX_AVAYA_SUBTYPE_ASSIGNMENT_TLV: /* Assignment TLV */
3111 loopCount = (dataLen - 36) / 5;
3112 proto_tree_add_item(tree, hf_ex_avaya_hmac_shi, tvb, offset, 32, ENC_NA);
3113 offset+=32;
3114 for ( i=0; i < loopCount; i++)
3116 proto_tree_add_item(tree, hf_ex_avaya_status, tvb, offset, 2, ENC_BIG_ENDIAN);
3117 proto_tree_add_item(tree, hf_ex_avaya_vlan, tvb, offset, 2, ENC_BIG_ENDIAN);
3118 offset+=2;
3119 proto_tree_add_item(tree, hf_ex_avaya_i_sid, tvb, offset, 3, ENC_BIG_ENDIAN);
3120 offset+=3;
3122 break;
3125 return offset;
3128 /* Dissect extreme avaya ap tlv*/
3129 static int
3130 dissect_extreme_avaya2_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
3132 uint8_t subType;
3133 uint32_t numbvlans, sysidlength;
3134 uint32_t offset = 0;
3137 Fabric TLV:
3138 _________________________________________________________________________________________________
3139 | TLV Type | TLV Length | Avaya OUI | Subtype | Num. BVLANs | BVLAN-ID*N | SysID Len | Sysid |
3140 -------------------------------------------------------------------------------------------------
3141 | 7 bits | 9 bits | 3 octets | 1 octet | 1 octet | 2 octets*N | 1 octet | octets*N |
3142 -------------------------------------------------------------------------------------------------
3145 /* Get subtype */
3146 subType = tvb_get_uint8(tvb, offset);
3147 proto_tree_add_item(tree, hf_ex_avaya2_tlv_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
3148 offset++;
3149 switch (subType) {
3150 case EX_AVAYA2_SUBTYPE_ZTFv2_FC_TLV: /* Zero Touch Fabric v2 Fabric Connect TLV */
3151 proto_tree_add_item(tree, hf_ex_avaya2_fabric_connect, tvb, offset, 1, ENC_NA);
3152 offset++;
3153 proto_tree_add_item_ret_uint(tree, hf_ex_avaya2_fabric_numbvlans, tvb, offset, 1, ENC_NA, &numbvlans);
3154 offset++;
3155 while (numbvlans--) {
3156 proto_tree_add_item(tree, hf_ex_avaya2_fabric_bvlanid, tvb, offset, 2, ENC_BIG_ENDIAN);
3157 offset += 2;
3159 proto_tree_add_item_ret_uint(tree, hf_ex_avaya2_fabric_sysidlength, tvb, offset, 1, ENC_NA, &sysidlength);
3160 offset++;
3161 proto_tree_add_item(tree, hf_ex_avaya2_fabric_sysid, tvb, offset, sysidlength, ENC_NA);
3162 offset += sysidlength;
3163 break;
3165 return offset;
3168 /* Dissect IEEE 802.3 TLVs */
3169 static int
3170 dissect_ieee_802_3_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
3172 uint8_t subType;
3173 uint32_t offset = 0;
3174 uint8_t tempByte;
3175 uint16_t tlvLen = tvb_reported_length(tvb)-offset;
3177 proto_tree *mac_phy_flags = NULL;
3178 proto_tree *autoneg_advertised_subtree = NULL;
3180 proto_item *tf = NULL, *subitem;
3182 /* Get subtype */
3183 subType = tvb_get_uint8(tvb, offset);
3185 subitem = proto_tree_add_item(tree, hf_ieee_802_3_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
3187 offset++;
3189 switch (subType)
3191 case 0x01: /* MAC/PHY Configuration/Status */
3193 /* Get auto-negotiation info */
3194 tf = proto_tree_add_item(tree, hf_ieee_802_3_mac_phy_auto_neg_status, tvb, offset, 1, ENC_BIG_ENDIAN);
3195 mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_flags);
3197 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mac_phy_auto_neg_status_supported, tvb, offset, 1, ENC_BIG_ENDIAN);
3198 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mac_phy_auto_neg_status_enabled, tvb, offset, 1, ENC_BIG_ENDIAN);
3200 offset++;
3202 /* Get pmd auto-negotiation advertised capability */
3203 tf = proto_tree_add_item(tree, hf_ieee_802_3_pmd_auto_neg_advertised_caps, tvb, offset, 2, ENC_BIG_ENDIAN);
3204 autoneg_advertised_subtree = proto_item_add_subtree(tf, ett_802_3_autoneg_advertised);
3206 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_tfd, tvb, offset, 2, ENC_BIG_ENDIAN);
3207 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_t, tvb, offset, 2, ENC_BIG_ENDIAN);
3208 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_xfd, tvb, offset, 2, ENC_BIG_ENDIAN);
3209 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_x, tvb, offset, 2, ENC_BIG_ENDIAN);
3210 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_bpause, tvb, offset, 2, ENC_BIG_ENDIAN);
3211 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_spause, tvb, offset, 2, ENC_BIG_ENDIAN);
3212 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_apause, tvb, offset, 2, ENC_BIG_ENDIAN);
3213 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_pause, tvb, offset, 2, ENC_BIG_ENDIAN);
3214 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t2fd, tvb, offset, 2, ENC_BIG_ENDIAN);
3215 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t2, tvb, offset, 2, ENC_BIG_ENDIAN);
3216 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_txfd, tvb, offset, 2, ENC_BIG_ENDIAN);
3217 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_tx, tvb, offset, 2, ENC_BIG_ENDIAN);
3218 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t4, tvb, offset, 2, ENC_BIG_ENDIAN);
3219 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_10base_tfd, tvb, offset, 2, ENC_BIG_ENDIAN);
3220 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_10base_t, tvb, offset, 2, ENC_BIG_ENDIAN);
3221 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_other, tvb, offset, 2, ENC_BIG_ENDIAN);
3223 autoneg_advertised_subtree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_802_3_autoneg_advertised, NULL, "Same in inverse (wrong) bitorder");
3225 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_tfd, tvb, offset, 2, ENC_BIG_ENDIAN);
3226 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_t, tvb, offset, 2, ENC_BIG_ENDIAN);
3227 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_xfd, tvb, offset, 2, ENC_BIG_ENDIAN);
3228 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_x, tvb, offset, 2, ENC_BIG_ENDIAN);
3229 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_bpause, tvb, offset, 2, ENC_BIG_ENDIAN);
3230 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_spause, tvb, offset, 2, ENC_BIG_ENDIAN);
3231 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_apause, tvb, offset, 2, ENC_BIG_ENDIAN);
3232 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_pause, tvb, offset, 2, ENC_BIG_ENDIAN);
3233 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t2fd, tvb, offset, 2, ENC_BIG_ENDIAN);
3234 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t2, tvb, offset, 2, ENC_BIG_ENDIAN);
3235 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_txfd, tvb, offset, 2, ENC_BIG_ENDIAN);
3236 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_tx, tvb, offset, 2, ENC_BIG_ENDIAN);
3237 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t4, tvb, offset, 2, ENC_BIG_ENDIAN);
3238 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_10base_tfd, tvb, offset, 2, ENC_BIG_ENDIAN);
3239 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_10base_t, tvb, offset, 2, ENC_BIG_ENDIAN);
3240 proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_other, tvb, offset, 2, ENC_BIG_ENDIAN);
3242 offset += 2;
3244 /* Get operational MAU type */
3245 proto_tree_add_item(tree, hf_ieee_802_3_pmd_mau_type, tvb, offset, 2, ENC_BIG_ENDIAN);
3247 offset += 2;
3249 break;
3251 case 0x02: /* MDI Power Support */
3253 /* Get MDI power support info */
3254 tf = proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_support, tvb, offset, 1, ENC_BIG_ENDIAN);
3255 mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_power);
3257 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mdi_power_support_port_class, tvb, offset, 1, ENC_BIG_ENDIAN);
3258 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mdi_power_support_pse_power_support, tvb, offset, 1, ENC_BIG_ENDIAN);
3259 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mdi_power_support_pse_power_enabled, tvb, offset, 1, ENC_BIG_ENDIAN);
3260 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mdi_power_support_pse_pairs, tvb, offset, 1, ENC_BIG_ENDIAN);
3262 offset++;
3264 /* Get PSE power pair */
3265 proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_pse_pair, tvb, offset, 1, ENC_BIG_ENDIAN);
3267 offset++;
3269 /* Get power class */
3270 proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_class, tvb, offset, 1, ENC_BIG_ENDIAN);
3272 offset++;
3274 if (tlvLen == 4)
3275 break;
3277 /* Get first byte */
3278 tempByte = tvb_get_uint8(tvb, offset);
3280 /* Determine power type */
3281 subType = ((tempByte & 0xC0) >> 6);
3282 proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3284 tf = proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_source, tvb, offset, 1, ENC_BIG_ENDIAN);
3286 /* Determine power source subtype */
3287 switch (subType)
3289 case 0:
3290 case 2:
3292 subType = ((tempByte & 0x30) >> 4);
3293 proto_item_append_text(tf, " %s", val_to_str_const(subType, media_power_pse_device, "Reserved"));
3295 break;
3297 case 1:
3298 case 3:
3300 subType = ((tempByte & 0x30) >> 4);
3301 proto_item_append_text(tf, " %s", val_to_str_const(subType, media_power_pd_device, "Reserved"));
3303 break;
3305 default:
3307 proto_item_append_text(tf, " %s", "Unknown");
3309 break;
3313 /* Determine PD 4PID flag */
3314 proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_pd4pid, tvb, offset, 1, ENC_BIG_ENDIAN);
3316 /* Determine power priority */
3317 proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
3319 offset++;
3321 /* Power Value: 1 to 510 expected */
3322 proto_tree_add_item(tree, hf_ieee_802_3_mdi_requested_power, tvb, offset, 2, ENC_BIG_ENDIAN);
3324 offset+=2;
3326 /* Power Value: 1 to 510 expected */
3327 proto_tree_add_item(tree, hf_ieee_802_3_mdi_allocated_power, tvb, offset, 2, ENC_BIG_ENDIAN);
3329 offset+=2;
3331 if (tlvLen == 26) { /* 802.3BT TLV Extensions */
3332 proto_tree_add_item(tree, hf_ieee_802_3_bt_ds_pd_requested_power_value_mode_a, tvb, offset, 2, ENC_BIG_ENDIAN);
3333 offset+=2;
3335 proto_tree_add_item(tree, hf_ieee_802_3_bt_ds_pd_requested_power_value_mode_b, tvb, offset, 2, ENC_BIG_ENDIAN);
3336 offset+=2;
3338 proto_tree_add_item(tree, hf_ieee_802_3_bt_ds_pse_allocated_power_value_alt_a, tvb, offset, 2, ENC_BIG_ENDIAN);
3339 offset+=2;
3341 proto_tree_add_item(tree, hf_ieee_802_3_bt_ds_pse_allocated_power_value_alt_b, tvb, offset, 2, ENC_BIG_ENDIAN);
3342 offset+=2;
3344 tf = proto_tree_add_item(tree, hf_ieee_802_3_bt_power_status, tvb, offset, 2, ENC_BIG_ENDIAN);
3345 mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_bt_power);
3347 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_pse_powering_status, tvb, offset, 2, ENC_BIG_ENDIAN);
3348 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_pd_powered_status, tvb, offset, 2, ENC_BIG_ENDIAN);
3349 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_pse_power_pairs_ext, tvb, offset, 2, ENC_BIG_ENDIAN);
3350 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_ds_pwr_class_ext_a, tvb, offset, 2, ENC_BIG_ENDIAN);
3351 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_ds_pwr_class_ext_b, tvb, offset, 2, ENC_BIG_ENDIAN);
3352 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_pwr_class_ext, tvb, offset, 2, ENC_BIG_ENDIAN);
3353 offset+=2;
3355 tf = proto_tree_add_item(tree, hf_ieee_802_3_bt_system_setup, tvb, offset, 1, ENC_BIG_ENDIAN);
3356 mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_bt_system_setup);
3358 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_power_type_ext, tvb, offset, 1, ENC_BIG_ENDIAN);
3359 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_power_pd_load, tvb, offset, 1, ENC_BIG_ENDIAN);
3360 offset+=1;
3362 proto_tree_add_item(tree, hf_ieee_802_3_bt_pse_maximum_available_power_value, tvb, offset, 2, ENC_BIG_ENDIAN);
3363 offset+=2;
3365 tf = proto_tree_add_item(tree, hf_ieee_802_3_bt_autoclass, tvb, offset, 1, ENC_BIG_ENDIAN);
3366 mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_bt_autoclass);
3368 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_pse_autoclass_support, tvb, offset, 1, ENC_BIG_ENDIAN);
3369 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_autoclass_completed, tvb, offset, 1, ENC_BIG_ENDIAN);
3370 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_autoclass_request, tvb, offset, 1, ENC_BIG_ENDIAN);
3371 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_autoclass_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
3372 offset+=1;
3374 tf = proto_tree_add_item(tree, hf_ieee_802_3_bt_power_down, tvb, offset, 3, ENC_BIG_ENDIAN);
3375 mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_bt_power_down);
3377 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_power_down_request, tvb, offset, 3, ENC_BIG_ENDIAN);
3378 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_power_down_time, tvb, offset, 3, ENC_BIG_ENDIAN);
3379 offset+=3;
3381 break;
3383 case 0x03: /* Link Aggregation */
3385 /* Get aggregation status */
3386 expert_add_info(pinfo, subitem, &ei_lldp_tlv_deprecated);
3387 tf = proto_tree_add_item(tree, hf_ieee_802_3_aggregation_status, tvb, offset, 1, ENC_BIG_ENDIAN);
3388 mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_aggregation);
3389 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_aggregation_status_cap, tvb, offset, 1, ENC_BIG_ENDIAN);
3390 proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_aggregation_status_enabled, tvb, offset, 1, ENC_BIG_ENDIAN);
3392 offset++;
3394 /* Get aggregated port id */
3395 proto_tree_add_item(tree, hf_ieee_802_3_aggregated_port_id, tvb, offset, 4, ENC_BIG_ENDIAN);
3397 offset+=4;
3398 break;
3400 case 0x04: /* Maximum Frame Size */
3402 /* Get maximum frame size */
3403 proto_tree_add_item(tree, hf_ieee_802_3_max_frame_size, tvb, offset, 2, ENC_BIG_ENDIAN);
3405 offset+=2;
3406 break;
3408 case 0x05: /* Energy-Efficient Ethernet */
3410 proto_tree_add_item(tree, hf_ieee_802_3_eee_transmit, tvb, offset, 2, ENC_BIG_ENDIAN);
3411 offset+=2;
3413 proto_tree_add_item(tree, hf_ieee_802_3_eee_receive, tvb, offset, 2, ENC_BIG_ENDIAN);
3414 offset+=2;
3416 proto_tree_add_item(tree, hf_ieee_802_3_eee_fallback_receive, tvb, offset, 2, ENC_BIG_ENDIAN);
3417 offset+=2;
3419 proto_tree_add_item(tree, hf_ieee_802_3_eee_echo_transmit, tvb, offset, 2, ENC_BIG_ENDIAN);
3420 offset+=2;
3422 proto_tree_add_item(tree, hf_ieee_802_3_eee_echo_receive, tvb, offset, 2, ENC_BIG_ENDIAN);
3423 offset+=2;
3425 break;
3427 case 0x07: /* IEEE 802.3br Frame Preemption Protocol */
3429 static int * const preemption_capabilities[] = {
3430 &hf_ieee_802_3br_aec_support,
3431 &hf_ieee_802_3br_aec_enable,
3432 &hf_ieee_802_3br_aec_active,
3433 &hf_ieee_802_3br_aec_addfragsize,
3434 &hf_ieee_802_3br_aec_reserved,
3435 NULL
3438 /* Get Additional Ethernet Capabilities */
3439 proto_tree_add_bitmask(tree, tvb, offset, hf_ieee_802_3br_aec, ett_802_3br_capabilities_flags, preemption_capabilities, ENC_BIG_ENDIAN);
3440 offset+=2;
3441 break;
3445 if(tvb_reported_length_remaining(tvb, offset)) {
3446 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length_excess, tvb, offset, -1);
3448 return offset;
3451 /* Dissect Media TLVs */
3452 static void
3453 dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3455 uint16_t tlvLen = tvb_reported_length(tvb);
3456 uint8_t subType;
3457 uint32_t offset = 0;
3458 uint8_t tempByte;
3459 uint32_t LCI_Length;
3461 proto_tree *media_flags = NULL;
3462 proto_item *tf = NULL;
3463 /* Get subtype */
3464 subType = tvb_get_uint8(tvb, offset);
3465 proto_tree_add_item(tree, hf_media_tlv_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
3466 offset++;
3467 tlvLen--;
3469 switch (subType)
3471 case 1: /* LLDP-MED Capabilities */
3473 /* Get capabilities */
3474 if (tlvLen < 2)
3476 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen);
3477 return;
3480 tf = proto_tree_add_item(tree, hf_media_tlv_subtype_caps, tvb, offset, 2, ENC_BIG_ENDIAN);
3481 media_flags = proto_item_add_subtree(tf, ett_media_capabilities);
3482 proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_llpd, tvb, offset, 2, ENC_BIG_ENDIAN);
3483 proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_network_policy, tvb, offset, 2, ENC_BIG_ENDIAN);
3484 proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_location_id, tvb, offset, 2, ENC_BIG_ENDIAN);
3485 proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_mdi_pse, tvb, offset, 2, ENC_BIG_ENDIAN);
3486 proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_mid_pd, tvb, offset, 2, ENC_BIG_ENDIAN);
3487 proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_inventory, tvb, offset, 2, ENC_BIG_ENDIAN);
3489 offset += 2;
3490 tlvLen -= 2;
3492 /* Get Class type */
3493 if (tlvLen < 1)
3495 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen);
3496 return;
3499 proto_tree_add_item(tree, hf_media_tlv_subtype_class, tvb, offset, 1, ENC_BIG_ENDIAN);
3501 offset++;
3502 tlvLen--;
3504 break;
3506 case 2: /* Network Policy */
3508 /* Get application type */
3509 if (tlvLen < 1)
3511 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen);
3512 return;
3515 proto_tree_add_item(tree, hf_media_application_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3517 offset++;
3518 tlvLen--;
3520 /* Get flags */
3521 if (tlvLen < 3)
3523 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen);
3524 return;
3527 proto_tree_add_item(tree, hf_media_policy_flag, tvb, offset, 3, ENC_BIG_ENDIAN);
3528 proto_tree_add_item(tree, hf_media_tag_flag, tvb, offset, 3, ENC_BIG_ENDIAN);
3530 /* Get vlan id */
3531 proto_tree_add_item(tree, hf_media_vlan_id, tvb, offset, 3, ENC_BIG_ENDIAN);
3534 /* Get L2 priority */
3536 proto_tree_add_item(tree, hf_media_l2_prio, tvb, offset, 3, ENC_BIG_ENDIAN);
3538 /* Get DSCP value */
3539 proto_tree_add_item(tree, hf_media_dscp, tvb, offset, 3, ENC_BIG_ENDIAN);
3541 break;
3543 case 3: /* Location Identification */
3545 /* Get location data format */
3546 if (tlvLen < 1)
3548 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen);
3549 return;
3552 tempByte = tvb_get_uint8(tvb, offset);
3553 proto_tree_add_item(tree, hf_media_loc_data_format, tvb, offset, 1, ENC_BIG_ENDIAN);
3555 offset++;
3556 tlvLen--;
3558 switch (tempByte)
3560 case 1: /* Coordinate-based LCI */
3563 * See RFC 6225 (obsoletes RFC 3825).
3564 * XXX - should this be handled by the BOOTP
3565 * dissector, and exported to us?
3567 if (tlvLen < 16)
3569 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen);
3570 return;
3573 /* Get latitude resolution */
3574 proto_tree_add_item(tree, hf_media_loc_lat_resolution, tvb, offset, 1, ENC_BIG_ENDIAN);
3576 /* Get latitude */
3577 proto_tree_add_item(tree, hf_media_loc_lat, tvb, offset, 5, ENC_BIG_ENDIAN);
3579 offset += 5;
3581 /* Get longitude resolution */
3582 proto_tree_add_item(tree, hf_media_loc_long_resolution, tvb, offset, 1, ENC_BIG_ENDIAN);
3584 /* Get longitude */
3585 proto_tree_add_item(tree, hf_media_loc_long, tvb, offset, 5, ENC_BIG_ENDIAN);
3587 offset += 5;
3589 /* Altitude Type */
3590 proto_tree_add_item(tree, hf_media_loc_alt_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3592 /* Get Altitude Resolution */
3593 proto_tree_add_item(tree, hf_media_loc_alt_resolution, tvb, offset, 2, ENC_BIG_ENDIAN);
3595 offset++;
3597 /* Get Altitude */
3598 proto_tree_add_item(tree, hf_media_loc_alt, tvb, offset, 4, ENC_BIG_ENDIAN);
3600 offset += 4;
3602 /* Get Ver */
3603 proto_tree_add_item(tree, hf_media_loc_ver, tvb, offset, 1, ENC_BIG_ENDIAN);
3605 /* Get reserved */
3606 proto_tree_add_item(tree, hf_media_loc_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
3608 /* Get datum */
3609 proto_tree_add_item(tree, hf_media_loc_datum, tvb, offset, 1, ENC_BIG_ENDIAN);
3611 offset++;
3613 break;
3615 case 2: /* Civic Address LCI */
3618 * See draft-ietf-geopriv-dhcp-civil-07.
3619 * XXX - should this be handled by the BOOTP
3620 * dissector, and exported to us?
3622 if (tlvLen < 1)
3624 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen);
3625 return;
3628 /* Get LCI length */
3629 tempByte = tvb_get_uint8(tvb, offset);
3630 tlvLen--;
3631 if (tempByte > tlvLen)
3633 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length_excess , tvb, offset, tlvLen);
3635 return;
3638 proto_tree_add_item(tree, hf_media_civic_lci_length, tvb, offset, 1 , ENC_BIG_ENDIAN);
3640 LCI_Length = (uint32_t)tempByte;
3642 offset++;
3644 /* Get what value */
3645 if (LCI_Length < 1)
3647 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen);
3648 return;
3651 proto_tree_add_item(tree, hf_media_civic_what, tvb, offset, 1, ENC_BIG_ENDIAN);
3653 offset++;
3654 LCI_Length--;
3656 /* Get country code */
3657 if (LCI_Length < 2)
3659 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen);
3660 return;
3663 proto_tree_add_item(tree, hf_media_civic_country, tvb, offset, 2, ENC_ASCII);
3665 offset += 2;
3666 LCI_Length -= 2;
3668 while (LCI_Length > 0)
3670 /* Get CA Type */
3671 proto_tree_add_item(tree, hf_media_civic_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3673 offset++;
3674 LCI_Length--;
3676 /* Get CA Length */
3677 if (LCI_Length < 1)
3679 proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen);
3680 return;
3682 tempByte = tvb_get_uint8(tvb, offset);
3684 proto_tree_add_item(tree, hf_media_civic_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3686 offset++;
3687 LCI_Length--;
3689 /* Make sure the CA value is within the specified length */
3690 if (tempByte > LCI_Length)
3691 return;
3693 if (tempByte > 0)
3695 /* Get CA Value */
3696 proto_tree_add_item(tree, hf_media_civic_addr_value, tvb, offset, tempByte, ENC_ASCII);
3698 offset += tempByte;
3699 LCI_Length -= tempByte;
3703 break;
3705 case 3: /* ECS ELIN */
3707 if (tlvLen > 0)
3709 proto_tree_add_item(tree, hf_media_ecs, tvb, offset, tlvLen, ENC_ASCII);
3712 break;
3716 break;
3718 case 4: /* Extended Power-via-MDI */
3720 /* Get first byte */
3721 tempByte = tvb_get_uint8(tvb, offset);
3723 /* Determine power type */
3724 subType = ((tempByte & 0xC0) >> 6);
3725 proto_tree_add_item(tree, hf_media_power_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3727 tf = proto_tree_add_item(tree, hf_media_power_source, tvb, offset, 1, ENC_BIG_ENDIAN);
3729 /* Determine power source */
3730 switch (subType)
3732 case 0:
3734 subType = ((tempByte & 0x30) >> 4);
3735 proto_item_append_text(tf, " %s", val_to_str_const(subType, media_power_pse_device, "Reserved"));
3737 break;
3739 case 1:
3741 subType = ((tempByte & 0x30) >> 4);
3742 proto_item_append_text(tf, " %s", val_to_str_const(subType, media_power_pd_device, "Reserved"));
3744 break;
3746 default:
3748 proto_item_append_text(tf, " %s", "Unknown");
3749 break;
3753 /* Determine power priority */
3754 proto_tree_add_item(tree, hf_media_power_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
3756 offset++;
3758 /* Power Value: 0 to 102.3 Watts (0.1 W increments) */
3759 proto_tree_add_item(tree, hf_media_power_value, tvb, offset, 2, ENC_BIG_ENDIAN);
3761 break;
3763 case 5: /* Hardware Revision */
3765 /* Figure out the length of the hardware revision field */
3766 if (tlvLen > 0)
3768 proto_tree_add_item(tree, hf_media_hardware, tvb, offset, tlvLen, ENC_ASCII|ENC_NA);
3771 break;
3773 case 6: /* Firmware Revision */
3775 /* Figure out the length of the firmware revision field */
3776 if (tlvLen > 0)
3778 proto_tree_add_item(tree, hf_media_firmware, tvb, offset, tlvLen, ENC_ASCII|ENC_NA);
3781 break;
3783 case 7: /* Software Revision */
3785 /* Figure out the length of the software revision field */
3786 if (tlvLen > 0)
3788 proto_tree_add_item(tree, hf_media_software, tvb, offset, tlvLen, ENC_ASCII|ENC_NA);
3791 break;
3793 case 8: /* Serial Number */
3795 /* Figure out the length of the serial number field */
3796 if (tlvLen > 0)
3798 proto_tree_add_item(tree, hf_media_sn, tvb, offset, tlvLen, ENC_ASCII|ENC_NA);
3801 break;
3803 case 9: /* Manufacturer Name */
3805 /* Figure out the length of the manufacturer name field */
3806 if (tlvLen > 0)
3808 proto_tree_add_item(tree, hf_media_manufacturer, tvb, offset, tlvLen, ENC_ASCII|ENC_NA);
3811 break;
3813 case 10: /* Model Name */
3815 /* Figure out the length of the model name field */
3816 if (tlvLen > 0)
3818 proto_tree_add_item(tree, hf_media_model, tvb, offset, tlvLen, ENC_ASCII|ENC_NA);
3821 break;
3823 case 11: /* Asset ID */
3825 /* Figure out the length of the asset id field */
3826 if (tlvLen > 0)
3828 proto_tree_add_item(tree, hf_media_asset, tvb, offset, tlvLen, ENC_ASCII|ENC_NA);
3831 break;
3835 return;
3839 static uint32_t
3840 dissect_profinet_period(tvbuff_t *tvb, proto_tree *tree, uint32_t offset, const char *name, int hf_valid, int hf_value)
3842 uint32_t period;
3843 proto_tree *period_tree;
3845 period = tvb_get_ntohl(tvb, offset);
3847 period_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_profinet_period, NULL, "%s: %s, %uns",
3848 name, (period & 0x80000000) ? "Valid" : "Invalid", period & 0x7FFFFFFF);
3850 proto_tree_add_uint(period_tree, hf_valid, tvb, offset, 4, period);
3851 proto_tree_add_uint(period_tree, hf_value, tvb, offset, 4, period);
3852 offset+=4;
3854 return offset;
3857 static void
3858 select_source_of_name_of_station
3859 (packet_info *pinfo _U_, profinet_lldp_column_info *pn_lldp_column_info)
3861 if (pn_lldp_column_info->chassis_id_locally_assigned != NULL)
3863 pn_lldp_column_info->is_nos_assigned = true;
3864 col_append_fstr(pinfo->cinfo, COL_INFO, "NoS = %s ", pn_lldp_column_info->chassis_id_locally_assigned);
3866 else
3868 if (pn_lldp_column_info->chassis_id_mac != NULL)
3870 pn_lldp_column_info->is_nos_assigned = true;
3871 col_append_fstr(pinfo->cinfo, COL_INFO, "NoS = %s ", pn_lldp_column_info->chassis_id_mac);
3876 static void
3877 set_name_of_station_for_profinet_specialized_column_info
3878 (packet_info *pinfo _U_, profinet_lldp_column_info *pn_lldp_column_info)
3880 const char *delimForProfinetv23 = ".";
3881 char* foundDot = NULL;
3882 char* tokenPortId = NULL;
3883 char* tokenNameOfStation = NULL;
3884 char* lldpPortIdCombinedWithNameOfStation = NULL;
3886 if (pn_lldp_column_info->is_nos_assigned != true)
3888 if (pn_lldp_column_info->port_id_locally_assigned != NULL)
3890 foundDot = strstr(pn_lldp_column_info->port_id_locally_assigned, delimForProfinetv23);
3891 if (foundDot != NULL)
3893 pn_lldp_column_info->is_nos_assigned = true;
3894 pn_lldp_column_info->is_port_id_assigned = true;
3895 lldpPortIdCombinedWithNameOfStation = wmem_strdup(pinfo->pool, pn_lldp_column_info->port_id_locally_assigned);
3896 tokenPortId = strtok(lldpPortIdCombinedWithNameOfStation, delimForProfinetv23);
3897 tokenNameOfStation = strtok(NULL, delimForProfinetv23);
3898 col_append_fstr(pinfo->cinfo, COL_INFO, "NoS = %s ", tokenNameOfStation);
3899 col_append_fstr(pinfo->cinfo, COL_INFO, "Port Id = %s ", tokenPortId);
3901 else
3903 select_source_of_name_of_station(pinfo, pn_lldp_column_info);
3906 else
3908 select_source_of_name_of_station(pinfo, pn_lldp_column_info);
3913 static void
3914 set_port_id_for_profinet_specialized_column_info
3915 (packet_info *pinfo _U_, profinet_lldp_column_info *pn_lldp_column_info)
3917 if (pn_lldp_column_info->is_port_id_assigned != true)
3919 if (pn_lldp_column_info->port_id_locally_assigned != NULL)
3921 pn_lldp_column_info->is_port_id_assigned = true;
3922 col_append_fstr(pinfo->cinfo, COL_INFO, "Port Id = %s ", pn_lldp_column_info->port_id_locally_assigned);
3927 /* Dissect PROFINET TLVs */
3928 static void
3929 dissect_profinet_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, profinet_lldp_column_info *pn_lldp_column_info)
3931 uint8_t subType;
3932 uint32_t offset = 0;
3933 proto_item *tf = NULL;
3934 uint32_t class3_PortStatus;
3935 uint32_t port_rx_delay_local;
3936 uint32_t port_rx_delay_remote;
3937 uint32_t port_tx_delay_local;
3938 uint32_t port_tx_delay_remote;
3939 uint32_t cable_delay_local;
3942 /* Get subtype */
3943 subType = tvb_get_uint8(tvb, offset);
3944 proto_tree_add_uint(tree, hf_profinet_tlv_subtype, tvb, offset, 1, subType);
3945 offset++;
3947 if (column_info_selection == PROFINET_SPECIAL_COLUMN_INFO)
3949 set_name_of_station_for_profinet_specialized_column_info(pinfo, pn_lldp_column_info);
3950 set_port_id_for_profinet_specialized_column_info(pinfo, pn_lldp_column_info);
3953 switch (subType)
3955 case 1: /* LLDP_PNIO_DELAY */
3957 port_rx_delay_local = tvb_get_ntohl(tvb, offset);
3958 tf = proto_tree_add_uint(tree, hf_profinet_port_rx_delay_local, tvb, offset, 4, port_rx_delay_local);
3959 if(port_rx_delay_local) {
3960 proto_item_append_text(tf, "ns");
3961 } else {
3962 proto_item_append_text(tf, " (unknown)");
3964 offset+=4;
3965 port_rx_delay_remote = tvb_get_ntohl(tvb, offset);
3966 tf = proto_tree_add_uint(tree, hf_profinet_port_rx_delay_remote, tvb, offset, 4, port_rx_delay_remote);
3967 if(port_rx_delay_remote) {
3968 proto_item_append_text(tf, "ns");
3969 } else {
3970 proto_item_append_text(tf, " (unknown)");
3972 offset+=4;
3973 port_tx_delay_local = tvb_get_ntohl(tvb, offset);
3974 tf = proto_tree_add_uint(tree, hf_profinet_port_tx_delay_local, tvb, offset, 4, port_tx_delay_local);
3975 if(port_tx_delay_local) {
3976 proto_item_append_text(tf, "ns");
3977 } else {
3978 proto_item_append_text(tf, " (unknown)");
3980 offset+=4;
3981 port_tx_delay_remote = tvb_get_ntohl(tvb, offset);
3982 tf = proto_tree_add_uint(tree, hf_profinet_port_tx_delay_remote, tvb, offset, 4, port_tx_delay_remote);
3983 if(port_tx_delay_remote) {
3984 proto_item_append_text(tf, "ns");
3985 } else {
3986 proto_item_append_text(tf, " (unknown)");
3988 offset+=4;
3989 cable_delay_local = tvb_get_ntohl(tvb, offset);
3990 tf = proto_tree_add_uint(tree, hf_profinet_cable_delay_local, tvb, offset, 4, cable_delay_local);
3991 if(cable_delay_local) {
3992 proto_item_append_text(tf, "ns");
3993 } else {
3994 proto_item_append_text(tf, " (unknown)");
3996 /*offset+=4;*/
3997 break;
3999 case 2: /* LLDP_PNIO_PORTSTATUS */
4001 proto_tree_add_item(tree, hf_profinet_class2_port_status, tvb, offset, 2, ENC_BIG_ENDIAN);
4002 offset+=2;
4003 proto_tree_add_item_ret_uint(tree, hf_profinet_class3_port_status, tvb, offset, 2, ENC_BIG_ENDIAN, &class3_PortStatus);
4004 proto_tree_add_item(tree, hf_profinet_class3_port_status_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
4005 proto_tree_add_item(tree, hf_profinet_class3_port_status_Fragmentation, tvb, offset, 2, ENC_BIG_ENDIAN);
4006 proto_tree_add_item(tree, hf_profinet_class3_port_status_PreambleLength, tvb, offset, 2, ENC_BIG_ENDIAN);
4008 col_append_fstr(pinfo->cinfo, COL_INFO, "RTClass3 Port Status = %s", val_to_str(class3_PortStatus, profinet_port3_status_vals, "Unknown %d"));
4009 /*offset+=2;*/
4010 break;
4012 /*case 3:*/ /* XXX - LLDP_PNIO_ALIAS */
4013 case 4: /* LLDP_PNIO_MRPPORTSTATUS */
4015 /* DomainUUID */
4016 proto_tree_add_item(tree, hf_profinet_mrp_domain_uuid, tvb, offset, 16, ENC_BIG_ENDIAN);
4017 offset += 16;
4019 /* MRRT PortStatus */
4020 proto_tree_add_item(tree, hf_profinet_mrrt_port_status, tvb, offset, 2, ENC_BIG_ENDIAN);
4021 /*offset+=2;*/
4022 break;
4024 case 5: /* LLDP_PNIO_CHASSIS_MAC */
4026 proto_tree_add_item(tree, hf_profinet_cm_mac, tvb, offset, 6, ENC_NA);
4027 /*offset += 6;*/
4028 break;
4030 case 6: /* LLDP_PNIO_PTCPSTATUS */
4032 /* MasterSourceAddress */
4033 proto_tree_add_item(tree, hf_profinet_master_source_address, tvb, offset, 6, ENC_NA);
4034 offset += 6;
4035 /* SubdomainUUID */
4036 proto_tree_add_item(tree, hf_profinet_subdomain_uuid, tvb, offset, 16, ENC_BIG_ENDIAN);
4037 offset += 16;
4038 /* IRDataUUID */
4039 proto_tree_add_item(tree, hf_profinet_ir_data_uuid, tvb, offset, 16, ENC_BIG_ENDIAN);
4040 offset += 16;
4041 /* LengthOfPeriod */
4042 offset = dissect_profinet_period(tvb, tree, offset, "LengthOfPeriod",
4043 hf_profinet_length_of_period_valid, hf_profinet_length_of_period_length);
4044 /* RedPeriodBegin */
4045 offset = dissect_profinet_period(tvb, tree, offset, "RedPeriodBegin",
4046 hf_profinet_red_period_begin_valid, hf_profinet_red_period_begin_offset);
4047 /* OrangePeriodBegin */
4048 offset = dissect_profinet_period(tvb, tree, offset, "OrangePeriodBegin",
4049 hf_profinet_orange_period_begin_valid, hf_profinet_orange_period_begin_offset);
4050 /* GreenPeriodBegin */
4051 /*offset = */dissect_profinet_period(tvb, tree, offset, "GreenPeriodBegin",
4052 hf_profinet_green_period_begin_valid, hf_profinet_green_period_begin_offset);
4053 break;
4055 case 9: /* LLDP_PNIO_TSNDOMAIN */
4057 /* DomainUUID */
4058 proto_tree_add_item(tree, hf_profinet_tsn_domain_uuid, tvb, offset, 16, ENC_BIG_ENDIAN);
4059 /*offset += 16;*/
4060 break;
4062 case 10: /* LLDP_PNIO_TSNNMEManagementAddr */
4064 uint8_t management_string_length = 0;
4065 management_string_length = tvb_get_uint8(tvb, offset);
4067 /* Management Address String Length */
4068 proto_tree_add_item(tree, hf_profinet_tsn_nme_management_addr_str_length, tvb, offset, 1, ENC_BIG_ENDIAN);
4069 offset += 1;
4071 /* Management Address Subtype */
4072 proto_tree_add_item(tree, hf_profinet_tsn_nme_management_addr_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
4073 offset += 1;
4074 management_string_length -= 1;
4076 /* Management Address */
4077 proto_tree_add_item(tree, hf_profinet_tsn_nme_management_addr, tvb, offset, management_string_length, ENC_NA);
4078 /*offset += management_string_length;*/
4079 break;
4081 case 11: /* LLDP_PNIO_TSNNMENameUUID */
4083 /* TSNNMENameUUID */
4084 proto_tree_add_item(tree, hf_profinet_tsn_nme_name_uuid, tvb, offset, 16, ENC_BIG_ENDIAN);
4085 /*offset += 16;*/
4086 break;
4088 case 12: /* LLDP_PNIO_TSNNMEParameterUUID */
4090 /* NMEParameterUUID */
4091 proto_tree_add_item(tree, hf_profinet_tsn_nme_parameter_uuid, tvb, offset, 16, ENC_BIG_ENDIAN);
4092 /*offset += 16;*/
4093 break;
4095 case 13: /* LLDP_PNIO_TSNTimeDomain */
4097 /*TimeDomainNumber*/
4098 proto_tree_add_item(tree, hf_profinet_time_domain_number, tvb, offset, 2, ENC_BIG_ENDIAN);
4099 offset += 2;
4101 /*TimeDomainUUID*/
4102 proto_tree_add_item(tree, hf_profinet_time_domain_uuid, tvb, offset, 16, ENC_BIG_ENDIAN);
4103 offset += 16;
4105 /*TimeDomainMasterIdentity*/
4106 proto_tree_add_item(tree, hf_profinet_time_domain_master_identity, tvb, offset, 8, ENC_NA);
4107 /*offset += 8;*/
4108 break;
4110 default:
4111 proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA);
4115 /* Dissect Cisco OUI TLVs */
4116 static void
4117 dissect_cisco_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
4119 uint8_t subType;
4120 uint32_t offset = 0;
4121 unsigned length = tvb_reported_length(tvb);
4123 proto_tree *upoe_data = NULL;
4124 proto_item *tf = NULL;
4125 proto_item *parent_item = proto_tree_get_parent(tree);
4127 if (tree == NULL) return;
4129 /* Get subtype */
4130 subType = tvb_get_uint8(tvb, offset);
4132 proto_tree_add_item(tree, hf_cisco_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
4133 offset++;
4134 length--;
4136 switch (subType)
4138 /* UPOE */
4139 case 0x01:
4140 tf = proto_tree_add_item(tree, hf_cisco_upoe, tvb, offset, 1, ENC_BIG_ENDIAN);
4141 upoe_data = proto_item_add_subtree(tf, ett_cisco_upoe_tlv);
4142 proto_tree_add_item(upoe_data, hf_cisco_upoe_supported, tvb, offset, 1, ENC_BIG_ENDIAN);
4143 proto_tree_add_item(upoe_data, hf_cisco_upoe_altb_detection, tvb, offset, 1, ENC_BIG_ENDIAN);
4144 proto_tree_add_item(upoe_data, hf_cisco_upoe_req_spare_pair, tvb, offset, 1, ENC_BIG_ENDIAN);
4145 proto_tree_add_item(upoe_data, hf_cisco_upoe_pse_spare_pair_oper, tvb, offset, 1, ENC_BIG_ENDIAN);
4146 offset++;
4147 length--;
4148 break;
4149 /* ACI */
4150 case 0xc9: // 201 port-state, uint8
4151 tf = proto_tree_add_item(tree, hf_cisco_aci_portstate, tvb, offset, length, ENC_NA);
4152 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4153 offset++;
4154 length--;
4155 break;
4156 case 0xca: // 202 node-role, uint8
4157 tf = proto_tree_add_item(tree, hf_cisco_aci_noderole, tvb, offset, length, ENC_NA);
4158 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4159 offset++;
4160 length--;
4161 break;
4162 case 0xcb: // 203 node-id, uint32
4163 tf = proto_tree_add_item(tree, hf_cisco_aci_nodeid, tvb, offset, length, ENC_BIG_ENDIAN);
4164 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4165 offset += 4;
4166 length -= 4;
4167 break;
4168 case 0xcc: // 204 spine-level, uint8
4169 tf = proto_tree_add_item(tree, hf_cisco_aci_spinelevel, tvb, offset, length, ENC_NA);
4170 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4171 offset++;
4172 length--;
4173 break;
4174 case 0xcd: // 205 pod-id, uint16
4175 tf = proto_tree_add_item(tree, hf_cisco_aci_podid, tvb, offset, 2, ENC_BIG_ENDIAN);
4176 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4177 offset += 2;
4178 length -= 2;
4179 break;
4180 case 0xce: // 206 fabric-name, string
4181 tf = proto_tree_add_item(tree, hf_cisco_aci_fabricname, tvb, offset, length, ENC_ASCII);
4182 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4183 offset += length;
4184 length -= length;
4185 break;
4186 case 0xcf: // 207 av (id, ip, uuid) (uint8, ipv4, string)
4187 proto_tree_add_item(tree, hf_cisco_aci_apiclist, tvb, offset, length, ENC_NA);
4188 while (length > 0) {
4189 tf = proto_tree_add_item(tree, hf_cisco_aci_apicid, tvb, offset, 1, ENC_NA);
4190 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4191 offset++;
4192 length--;
4193 proto_tree_add_item(tree, hf_cisco_aci_apicipv4, tvb, offset, 4, ENC_NA);
4194 offset += 4;
4195 length -= 4;
4196 proto_tree_add_item(tree, hf_cisco_aci_apicuuid, tvb, offset, 36, ENC_ASCII);
4197 offset += 36;
4198 length -= 36;
4200 break;
4201 case 0xd0: // 208 node-ip, ipv4
4202 tf = proto_tree_add_item(tree, hf_cisco_aci_nodeip, tvb, offset, length, ENC_NA);
4203 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4204 offset += 4;
4205 length -= 4;
4206 break;
4207 case 0xd1: // 209 port-role, uint8
4208 tf = proto_tree_add_item(tree, hf_cisco_aci_portrole, tvb, offset, length, ENC_NA);
4209 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4210 offset++;
4211 length--;
4212 break;
4213 case 0xd2: // 210 fw-ver, string
4214 tf = proto_tree_add_item(tree, hf_cisco_aci_version, tvb, offset, length, ENC_ASCII);
4215 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4216 offset += length;
4217 length -= length;
4218 break;
4219 case 0xd3: // 211 infra-vlan, uint16
4220 tf = proto_tree_add_item(tree, hf_cisco_aci_fabricvlan, tvb, offset, 2, ENC_BIG_ENDIAN);
4221 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4222 offset += 2;
4223 length -= 2;
4224 break;
4225 case 0xd4: // 212 serial-number, string
4226 tf = proto_tree_add_item(tree, hf_cisco_aci_serialno, tvb, offset, length, ENC_ASCII);
4227 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4228 offset += length;
4229 length -= length;
4230 break;
4231 #if 0
4232 case 0xd5: // 213 unused
4233 break;
4234 #endif
4235 case 0xd6: // 214 model, string
4236 tf = proto_tree_add_item(tree, hf_cisco_aci_model, tvb, offset, length, ENC_ASCII);
4237 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4238 offset += length;
4239 length -= length;
4240 break;
4241 case 0xd7: // 215 name, string
4242 tf = proto_tree_add_item(tree, hf_cisco_aci_nodename, tvb, offset, length, ENC_ASCII);
4243 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4244 offset += length;
4245 length -= length;
4246 break;
4247 case 0xd8: // 216 port-mode, uint16
4248 tf = proto_tree_add_item(tree, hf_cisco_aci_portmode, tvb, offset, length, ENC_BIG_ENDIAN);
4249 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4250 offset += 2;
4251 length -= 2;
4252 break;
4253 case 0xd9: // 217 authenticate-cookie, bytes
4254 tf = proto_tree_add_item(tree, hf_cisco_aci_authcookie, tvb, offset, length, ENC_NA);
4255 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4256 offset += length;
4257 length -= length;
4258 break;
4259 case 0xda: // 218 standby-apic, uint8
4260 tf = proto_tree_add_item(tree, hf_cisco_aci_apicmode, tvb, offset, length, ENC_NA);
4261 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4262 offset++;
4263 length--;
4264 break;
4265 case 0xdb: // 219 fabric-id, uint16
4266 tf = proto_tree_add_item(tree, hf_cisco_aci_fabricid, tvb, offset, length, ENC_BIG_ENDIAN);
4267 proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf));
4268 offset += 2;
4269 length -= 2;
4270 break;
4271 default:
4272 if (length > 0) {
4273 proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, length, ENC_NA);
4274 offset += length;
4275 length -= length;
4277 break;
4279 if (length > 0) {
4280 proto_tree_add_item(tree, hf_subtype_content_remaining, tvb, offset, length, ENC_NA);
4284 /* Dissect OUI HytecGer-TLV's */
4285 static void
4286 dissect_hytec_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
4288 uint8_t subtype, group, identifier;
4289 int32_t bit_offset, msg_len, expected_data_length, maximum_data_length, temp_int32;
4290 proto_tree *hytec_data = NULL;
4291 proto_item *tf = NULL;
4292 proto_item *group_proto_item, *identifier_proto_item;
4293 float float_value = 0.0f;
4294 uint32_t offset = 0;
4296 subtype = tvb_get_uint8(tvb, offset);
4297 proto_tree_add_uint(tree, hf_hytec_tlv_subtype, tvb, offset, 1, subtype);
4298 offset++;
4300 /* get the group and identifier of the chosen subtype */
4301 bit_offset = (int32_t)(offset *8);
4302 group = tvb_get_bits8(tvb, bit_offset + HYTEC_GROUP_MASK_OFFSET, HYTEC_GROUP_MASK_SIZE);
4303 identifier = tvb_get_bits8(tvb, bit_offset + HYTEC_IDENTIFIER_MASK_OFFSET, HYTEC_IDENTIFIER_MASK_SIZE);
4305 group_proto_item = proto_tree_add_item(tree, hf_hytec_group, tvb, offset, 1, ENC_BIG_ENDIAN);
4306 identifier_proto_item = proto_tree_add_item(tree, hf_hytec_identifier, tvb, offset, 1, ENC_BIG_ENDIAN);
4307 proto_item_append_text(identifier_proto_item, " ("); /* a group dependent identifier description will be appended */
4309 offset++;
4310 msg_len = tvb_reported_length_remaining(tvb, offset);
4312 switch (subtype)
4314 case HYTEC_SUBTYPE__TRANSCEIVER: /* Transceiver-Subtype */
4315 proto_item_append_text(group_proto_item, " (%s)", val_to_str_const(group, hytec_transceiver_groups, "Unknown" ));
4317 switch (group)
4319 case HYTEC_TRANSG__TRANCEIVER_IDENTIFIER:
4320 proto_item_append_text(identifier_proto_item, "%s", val_to_str_const(identifier, hytec_tid, "Unknown"));
4322 switch (identifier)
4324 case HYTEC_TID__VENDOR_PRODUCT_REVISION:
4325 maximum_data_length = 64;
4326 if(0 < msg_len && msg_len <= maximum_data_length)
4327 proto_tree_add_item(tree, hf_hytec_transceiver_vendor_product_revision, tvb, offset, msg_len, ENC_ASCII);
4328 else
4329 { /* unexpected length */
4330 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) is beyond valid range (1-%d)", val_to_str_const(identifier, hytec_tid, ""), msg_len, maximum_data_length);
4331 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4333 break;
4334 default: proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA); /* unknown identifier */
4335 } /* switch (identifier) */
4337 break;
4338 case HYTEC_TRANSG__TRANSCEIVER_BRIDGEABLE_DISTANCE:
4339 expected_data_length = 4;
4340 proto_item_append_text(identifier_proto_item, "%s", val_to_str_const(identifier, hytec_tbd, "Unknown"));
4342 switch (identifier)
4344 case HYTEC_TBD__SINGLE_MODE:
4345 if(msg_len == expected_data_length)
4347 proto_tree_add_item(tree, hf_hytec_single_mode, tvb, offset, msg_len, ENC_BIG_ENDIAN);
4349 else
4350 { /* unexpected length */
4351 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_tbd, ""), msg_len, expected_data_length);
4352 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4354 break;
4355 case HYTEC_TBD__MULTI_MODE_50:
4356 if(msg_len == expected_data_length)
4358 proto_tree_add_item(tree, hf_hytec_multi_mode_50, tvb, offset, msg_len, ENC_BIG_ENDIAN);
4360 else
4361 { /* unexpected length */
4362 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_tbd, ""), msg_len, expected_data_length);
4363 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4365 break;
4366 case HYTEC_TBD__MULTI_MODE_62_5:
4367 if(msg_len == expected_data_length)
4369 proto_tree_add_item(tree, hf_hytec_multi_mode_62_5, tvb, offset, msg_len, ENC_BIG_ENDIAN);
4371 else
4372 { /* unexpected length */
4373 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_tbd, ""), msg_len, expected_data_length);
4374 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4376 break;
4377 default: proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA); /* unknown identifier */
4378 } /* switch (identifier) */
4379 break;
4380 case HYTEC_TRANSG__MEASUREMENT_DATA:
4381 expected_data_length = 4;
4382 proto_item_append_text(identifier_proto_item, "%s", val_to_str_const(identifier, hytec_md, "Unknown"));
4384 switch (identifier)
4386 case HYTEC_MD__TX_CURRENT_OUTPUT_POWER:
4387 if(msg_len == expected_data_length)
4389 temp_int32 = tvb_get_ntohil(tvb, offset);
4390 float_value = (float) 0.1 * (float) temp_int32;
4391 proto_tree_add_float(tree, hf_hytec_tx_current_output_power, tvb, offset, msg_len, float_value);
4393 else
4394 { /* unexpected length */
4395 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_md, ""), msg_len, expected_data_length);
4396 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4398 break;
4399 case HYTEC_MD__RX_CURRENT_INPUT_POWER:
4400 if(msg_len == expected_data_length)
4402 temp_int32 = tvb_get_ntohil(tvb, offset);
4403 float_value = (float) 0.1 * (float) temp_int32;
4404 proto_tree_add_float(tree, hf_hytec_rx_current_input_power, tvb, offset, msg_len, float_value);
4406 else
4407 { /* unexpected length */
4408 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_md, ""), msg_len, expected_data_length);
4409 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4411 break;
4412 case HYTEC_MD__RX_INPUT_SNR:
4413 if(msg_len == expected_data_length)
4415 temp_int32 = tvb_get_ntohil(tvb, offset);
4416 if(temp_int32 < 0) float_value = (float)-1.0 * (float)((~temp_int32) >> 8);
4417 else float_value = (float) (temp_int32 >> 8);
4418 float_value += (float)(temp_int32 & 0xFF) * (float)0.00390625; /* 0.00390625 == 0.5 ^ 8 */
4419 proto_tree_add_float(tree, hf_hytec_rx_input_snr, tvb, offset, msg_len, float_value);
4421 else
4422 { /* unexpected length */
4423 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_md, ""), msg_len, expected_data_length);
4424 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4426 break;
4427 case HYTEC_MD__LINELOSS:
4428 if(msg_len == expected_data_length)
4430 temp_int32 = tvb_get_ntohil(tvb, offset);
4431 if(temp_int32 < 0) float_value = (float)-1.0 * (float)((~temp_int32) >> 8);
4432 else float_value = (float) (temp_int32 >> 8);
4433 float_value += (float)(temp_int32 & 0xFF) * (float)0.00390625; /* 0.5 ^ 8 */
4434 proto_tree_add_float(tree, hf_hytec_lineloss, tvb, offset, msg_len, float_value);
4436 else
4437 { /* unexpected length */
4438 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_md, ""), msg_len, expected_data_length);
4439 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4441 break;
4442 default: proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA); /* unknown identifier */
4443 } /* switch (identifier) */
4444 break;
4445 default: /* unknown group */
4446 /* identifier considered also unknown */
4447 proto_item_append_text(identifier_proto_item, "Unknown");
4448 proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA);
4449 } /* switch (group) */
4450 break;
4451 case HYTEC_SUBTYPE__TRACE: /* Trace-Subtype */
4452 proto_item_append_text(group_proto_item, " (%s)", val_to_str_const(group, hytec_trace_groups, "Unknown"));
4454 switch (group)
4456 case HYTEC_TRACEG__MAC_TRACE:
4457 proto_item_append_text(identifier_proto_item, "%s", val_to_str_const(identifier, hytec_mc, "Unknown"));
4459 switch (identifier)
4461 case HYTEC_MC__MAC_TRACE_REQUEST:
4462 expected_data_length = 13;
4463 if(msg_len == expected_data_length)
4465 tf = proto_tree_add_item(tree, hf_hytec_mac_trace_request, tvb, offset, -1, ENC_NA);
4466 hytec_data = proto_item_add_subtree(tf, ett_org_spc_hytec_trace_request);
4467 proto_tree_add_item(hytec_data, hf_hytec_trace_mac_address, tvb, offset, 6, ENC_NA);
4468 offset += 6;
4469 proto_tree_add_item(hytec_data, hf_hytec_request_mac_address, tvb, offset, 6, ENC_NA);
4470 offset += 6;
4471 proto_tree_add_item(hytec_data, hf_hytec_maximum_depth, tvb, offset, 1, ENC_BIG_ENDIAN);
4472 /*offset += 1;*/
4474 else
4475 { /* unexpected length */
4476 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_mc, ""), msg_len, expected_data_length);
4477 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4479 break;
4480 case HYTEC_MC__MAC_TRACE_REPLY:
4481 expected_data_length = 13;
4482 if(msg_len == expected_data_length)
4484 tf = proto_tree_add_item(tree, hf_hytec_mac_trace_reply, tvb, offset, -1, ENC_NA);
4485 hytec_data = proto_item_add_subtree(tf, ett_org_spc_hytec_trace_reply);
4486 proto_tree_add_item(hytec_data, hf_hytec_trace_mac_address, tvb, offset, 6, ENC_NA);
4487 offset += 6;
4488 proto_tree_add_item(hytec_data, hf_hytec_answering_mac_address, tvb, offset, 6, ENC_NA);
4489 offset += 6;
4490 proto_tree_add_item(hytec_data, hf_hytec_actual_depth, tvb, offset, 1, ENC_BIG_ENDIAN);
4491 /*offset += 1;*/
4493 else
4494 { /* unexpected length */
4495 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_mc, ""), msg_len, expected_data_length);
4496 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4498 break;
4499 case HYTEC_MC__NAME_OF_REPLYING_DEVICE:
4500 maximum_data_length = 64;
4501 if(0 < msg_len && msg_len <= maximum_data_length) proto_tree_add_item(tree, hf_hytec_name_of_replying_device, tvb, offset, msg_len, ENC_ASCII);
4502 else
4503 { /* unexpected length */
4504 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) is beyond valid range (1-%d)", val_to_str_const(identifier, hytec_mc, ""), msg_len, maximum_data_length);
4505 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4507 break;
4508 case HYTEC_MC__OUTGOING_PORT_NAME:
4509 maximum_data_length = 64;
4510 if(0 < msg_len && msg_len <= maximum_data_length) proto_tree_add_item(tree, hf_hytec_outgoing_port_name, tvb, offset, msg_len, ENC_ASCII);
4511 else
4512 { /* unexpected length */
4513 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) is beyond valid range (1-%d)", val_to_str_const(identifier, hytec_mc, ""), msg_len, maximum_data_length);
4514 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4516 break;
4517 case HYTEC_MC__IPV4_ADDRESS_OF_REPLYING_DEVICE:
4518 expected_data_length = 4;
4519 if(msg_len == expected_data_length) proto_tree_add_item(tree, hf_hytec_ipv4_address_of_replying_device, tvb, offset, msg_len, ENC_NA);
4520 else
4521 { /* unexpected length */
4522 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_mc, ""), msg_len, expected_data_length);
4523 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4525 break;
4526 case HYTEC_MC__END_OF_TRACE:
4527 expected_data_length = 1;
4528 if(msg_len == expected_data_length) proto_tree_add_item(tree, hf_hytec_end_of_trace, tvb, offset, msg_len, ENC_BIG_ENDIAN);
4529 else
4530 { /* unexpected length */
4531 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_mc, ""), msg_len, expected_data_length);
4532 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4534 break;
4535 case HYTEC_MC__IPV6_ADDRESS_OF_REPLYING_DEVICE:
4536 expected_data_length = 16;
4537 if(msg_len == expected_data_length) proto_tree_add_item(tree, hf_hytec_ipv6_address_of_replying_device, tvb, offset, msg_len, ENC_NA);
4538 else
4539 { /* unexpected length */
4540 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_mc, ""), msg_len, expected_data_length);
4541 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4543 break;
4544 case HYTEC_MC__INCOMING_PORT_NAME:
4545 maximum_data_length = 64;
4546 if(0 < msg_len && msg_len <= maximum_data_length) proto_tree_add_item(tree, hf_hytec_incoming_port_name, tvb, offset, msg_len, ENC_ASCII);
4547 else
4548 { /* unexpected length */
4549 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) is beyond valid range (1-%d)", val_to_str_const(identifier, hytec_mc, ""), msg_len, maximum_data_length);
4550 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4552 break;
4553 case HYTEC_MC__TRACE_IDENTIFIER:
4554 expected_data_length = 4;
4555 if(msg_len == expected_data_length) proto_tree_add_item(tree, hf_hytec_trace_identifier, tvb, offset, msg_len, ENC_BIG_ENDIAN);
4556 else
4557 { /* unexpected length */
4558 expert_add_info_format(pinfo, tree, &ei_lldp_bad_length, "%s length (%d) != expected length (%d)", val_to_str_const(identifier, hytec_mc, ""), msg_len, expected_data_length);
4559 if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX);
4561 break;
4562 default: proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA); /* unknown identifier */
4563 } /* switch (identifier) */
4564 break;
4565 default: /* unknown group */
4566 /* identifier considered also unknown */
4567 proto_item_append_text(identifier_proto_item, "Unknown");
4568 proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA);
4569 } /* switch (group) */
4570 break;
4571 default: /* unknown subtype */
4572 proto_item_append_text(group_proto_item, " (Unknown)");
4573 proto_item_append_text(identifier_proto_item, "Unknown");
4574 proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA);
4575 break;
4576 } /* switch (subtype) */
4578 proto_item_append_text(identifier_proto_item, ")");
4581 /* Dissect Avaya OUI TLVs */
4582 static void
4583 dissect_avaya_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
4585 uint8_t subType;
4586 uint32_t offset = 0;
4588 proto_tree *avaya_data = NULL;
4589 proto_item *tf = NULL;
4591 /* Get subtype */
4592 subType = tvb_get_uint8(tvb, offset);
4594 proto_tree_add_item(tree, hf_avaya_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
4596 offset++;
4598 switch (subType)
4600 case 0x01: /* PoE Conservation Level Support */
4602 proto_tree_add_item(tree, hf_avaya_poe, tvb, offset, 7, ENC_NA);
4603 break;
4605 case 0x03: /* Call Server IP Address */
4607 proto_tree_add_item(tree, hf_avaya_call_server, tvb, offset, 4, ENC_NA);
4608 break;
4610 case 0x04: /* IP Phone Addresses */
4612 tf = proto_tree_add_item(tree, hf_avaya_ipphone, tvb, offset, 12, ENC_NA);
4613 avaya_data = proto_item_add_subtree(tf, ett_avaya_ipphone_tlv);
4614 proto_tree_add_item(avaya_data, hf_avaya_ipphone_ip, tvb, offset, 4, ENC_NA);
4615 proto_tree_add_item(avaya_data, hf_avaya_ipphone_mask, tvb, offset+4, 4, ENC_NA);
4616 proto_tree_add_item(avaya_data, hf_avaya_ipphone_gateway, tvb, offset+8, 4, ENC_NA);
4617 break;
4619 case 0x05: /* CNA Server IP Address */
4621 proto_tree_add_item(tree, hf_avaya_cna_server, tvb, offset, 4, ENC_NA);
4622 break;
4624 case 0x06: /* File Server */
4626 proto_tree_add_item(tree, hf_avaya_file_server, tvb, offset, 4, ENC_NA);
4627 break;
4629 case 0x07: /* 802.1Q Framing */
4631 proto_tree_add_item(tree, hf_avaya_dot1q, tvb, offset, 1, ENC_NA);
4632 break;
4634 default:
4635 proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA);
4636 break;
4640 /* Dissect IANA OUI TLVs */
4641 static void
4642 dissect_iana_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
4644 uint16_t msg_len;
4645 uint8_t subType;
4646 uint32_t offset = 0;
4648 /* Get subtype */
4649 subType = tvb_get_uint8(tvb, offset);
4651 proto_tree_add_item(tree, hf_iana_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
4652 offset++;
4654 msg_len=tvb_reported_length_remaining(tvb, offset);
4655 switch (subType)
4657 case 0x01: /* MUDURL */
4658 if ( msg_len > 0 )
4659 proto_tree_add_item(tree, hf_iana_mudurl, tvb, offset, msg_len, ENC_ASCII);
4660 break;
4662 default:
4663 proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA);
4664 break;
4668 static void
4669 dissect_onos_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
4671 uint16_t msg_len;
4672 uint32_t subType;
4673 uint32_t offset = 0;
4675 proto_tree_add_item_ret_uint(tree, hf_onos_subtype, tvb, offset, 1, ENC_BIG_ENDIAN, &subType);
4676 offset++;
4678 msg_len=tvb_reported_length_remaining(tvb, offset);
4679 switch (subType)
4681 case ONOS_CHASSIS_TLV_TYPE:
4682 proto_tree_add_item(tree, hf_onos_chassis, tvb, offset, msg_len, ENC_ASCII);
4683 break;
4684 case ONOS_PORT_TLV_TYPE:
4685 proto_tree_add_item(tree, hf_onos_port, tvb, offset, msg_len, ENC_ASCII);
4686 break;
4687 case ONOS_TTL_TLV_TYPE:
4688 proto_tree_add_item(tree, hf_onos_ttl, tvb, offset, msg_len, ENC_NA);
4689 break;
4690 default:
4691 proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA);
4692 break;
4697 /* Dissect Organizational Specific TLV */
4698 static int32_t
4699 dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset, profinet_lldp_column_info *pn_lldp_column_info)
4701 uint16_t dataLen;
4702 uint16_t tempShort;
4703 int tempTree;
4704 uint32_t oui, tLength = tvb_reported_length(tvb);
4705 uint8_t subType;
4706 tvbuff_t *vendor_tvb;
4707 const char *ouiStr;
4708 const char *subTypeStr;
4710 proto_tree *org_tlv_tree = NULL;
4711 proto_item *lf = NULL;
4712 /* Get tlv type and length */
4713 tempShort = tvb_get_ntohs(tvb, offset);
4715 /* Get tlv length */
4716 dataLen = TLV_INFO_LEN(tempShort);
4717 /* Get OUI value */
4718 oui = tvb_get_ntoh24(tvb, (offset+2));
4719 subType = tvb_get_uint8(tvb, (offset+5));
4721 /* check for registered dissectors for the OUI If none found continue, else call dissector */
4722 if( dissector_try_uint(oui_unique_code_table, oui, tvb, pinfo, tree) ) {
4723 return tLength;
4725 /* Look in manuf database for OUI */
4726 ouiStr = uint_get_manuf_name_if_known(oui);
4727 if(ouiStr==NULL) ouiStr="Unknown";
4729 /* Set a default value */
4730 tempTree = ett_org_spc_ProfinetSubTypes_1;
4731 switch(oui)
4733 case OUI_DCBX:
4734 subTypeStr = val_to_str(subType, dcbx_protocol_types, "Unknown subtype (0x%x)");
4735 switch(subType)
4737 case 1: tempTree = ett_org_spc_dcbx_cin;
4738 break;
4739 case 2: tempTree = ett_org_spc_dcbx_cee;
4740 break;
4742 break;
4743 case OUI_IEEE_802_1:
4744 subTypeStr = val_to_str(subType, ieee_802_1_subtypes, "Unknown subtype 0x%x");
4745 switch(subType)
4747 case 0x1: tempTree = ett_org_spc_ieee_802_1_1;
4748 break;
4749 case 0x2: tempTree = ett_org_spc_ieee_802_1_2;
4750 break;
4751 case 0x3: tempTree = ett_org_spc_ieee_802_1_3;
4752 break;
4753 case 0x4: tempTree = ett_org_spc_ieee_802_1_4;
4754 break;
4755 case 0x8: tempTree = ett_org_spc_ieee_802_1_8;
4756 break;
4757 case 0x9: tempTree = ett_org_spc_ieee_802_1_9;
4758 break;
4759 case 0xa: tempTree = ett_org_spc_ieee_802_1_a;
4760 break;
4761 case 0xb: tempTree = ett_org_spc_ieee_802_1_b;
4762 break;
4763 case 0xc: tempTree = ett_org_spc_ieee_802_1_c;
4764 break;
4766 break;
4767 case OUI_IEEE_802_3:
4768 subTypeStr = val_to_str(subType, ieee_802_3_subtypes, "Unknown subtype 0x%x");
4769 switch(subType)
4771 case 1: tempTree = ett_org_spc_ieee_802_3_1;
4772 break;
4773 case 2: tempTree = ett_org_spc_ieee_802_3_2;
4774 break;
4775 case 3: tempTree = ett_org_spc_ieee_802_3_3;
4776 break;
4777 case 4: tempTree = ett_org_spc_ieee_802_3_4;
4778 break;
4779 case 5: tempTree = ett_org_spc_ieee_802_3_5;
4780 break;
4781 case 7: tempTree = ett_org_spc_ieee_802_3_7;
4782 break;
4784 break;
4785 case OUI_MEDIA_ENDPOINT:
4786 subTypeStr = val_to_str(subType, media_subtypes, "Unknown subtype 0x%x");
4787 switch(subType)
4789 case 1: tempTree = ett_org_spc_media_1;
4790 break;
4791 case 2: tempTree = ett_org_spc_media_2;
4792 break;
4793 case 3: tempTree = ett_org_spc_media_3;
4794 break;
4795 case 4: tempTree = ett_org_spc_media_4;
4796 break;
4797 case 5: tempTree = ett_org_spc_media_5;
4798 break;
4799 case 6: tempTree = ett_org_spc_media_6;
4800 break;
4801 case 7: tempTree = ett_org_spc_media_7;
4802 break;
4803 case 8: tempTree = ett_org_spc_media_8;
4804 break;
4805 case 9: tempTree = ett_org_spc_media_9;
4806 break;
4807 case 10: tempTree = ett_org_spc_media_10;
4808 break;
4809 case 11: tempTree = ett_org_spc_media_11;
4810 break;
4812 break;
4813 case OUI_PROFINET:
4814 subTypeStr = val_to_str(subType, profinet_subtypes, "Reserved (0x%x)");
4815 switch(subType)
4817 case 1: tempTree = ett_org_spc_ProfinetSubTypes_1;
4818 break;
4819 case 2: tempTree = ett_org_spc_ProfinetSubTypes_2;
4820 break;
4821 case 3: tempTree = ett_org_spc_ProfinetSubTypes_3;
4822 break;
4823 case 4: tempTree = ett_org_spc_ProfinetSubTypes_4;
4824 break;
4825 case 5: tempTree = ett_org_spc_ProfinetSubTypes_5;
4826 break;
4827 case 6: tempTree = ett_org_spc_ProfinetSubTypes_6;
4828 break;
4830 break;
4831 case OUI_CISCO_2:
4832 subTypeStr = val_to_str(subType, cisco_subtypes, "Unknown subtype (0x%x)");
4833 break;
4834 case OUI_IEEE_802_1QBG:
4835 subTypeStr = val_to_str(subType, ieee_802_1qbg_subtypes, "Unknown subtype 0x%x");
4836 break;
4837 case OUI_AVAYA_EXTREME:
4838 subTypeStr = val_to_str(subType, ex_avaya_subtypes, "Unknown subtype 0x%x");
4839 switch(subType)
4841 case EX_AVAYA_SUBTYPE_ELEMENT_TLV: tempTree = ett_ex_avayaSubTypes_11;
4842 break;
4843 case EX_AVAYA_SUBTYPE_ASSIGNMENT_TLV: tempTree = ett_ex_avayaSubTypes_12;
4844 break;
4846 break;
4847 case OUI_AVAYA_EXTREME2:
4848 subTypeStr = val_to_str(subType, ex_avaya2_subtypes, "Unknown subtype 0x%x");
4849 switch(subType)
4851 case EX_AVAYA2_SUBTYPE_ZTFv2_FC_TLV: tempTree = ett_ex_avaya2SubTypes_4;
4852 break;
4854 break;
4855 case OUI_HYTEC_GER:
4856 subTypeStr = val_to_str(subType, hytec_subtypes, "Unknown subtype (0x%x)");
4857 switch(subType)
4859 case HYTEC_SUBTYPE__TRANSCEIVER: tempTree = ett_org_spc_hytec_subtype_transceiver;
4860 break;
4861 case HYTEC_SUBTYPE__TRACE: tempTree = ett_org_spc_hytec_subtype_trace;
4862 break;
4864 break;
4865 case OUI_AVAYA:
4866 subTypeStr = val_to_str(subType, avaya_subtypes, "Unknown subtype (0x%x)");
4867 break;
4868 case OUI_IANA:
4869 subTypeStr = val_to_str(subType, iana_subtypes, "Unknown subtype (0x%x)");
4870 break;
4871 case OUI_ONOS:
4872 subTypeStr = val_to_str(subType, onos_subtypes, "Unknown subtype (0x%x)");
4873 break;
4874 case OUI_ODVA:
4875 subTypeStr = val_to_str(subType, lldp_cip_subtypes, "Unknown subtype (0x%x)");
4876 break;
4877 default:
4878 subTypeStr = wmem_strdup_printf(pinfo->pool, "Unknown (%d)",subType);
4879 break;
4882 org_tlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, tLength, tempTree, NULL, "%s - %s", ouiStr, subTypeStr);
4883 proto_tree_add_item(org_tlv_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
4885 lf = proto_tree_add_item(org_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
4886 if (dataLen < 4)
4888 expert_add_info_format(pinfo, lf, &ei_lldp_bad_length,
4889 "TLV length (%u) too short, must be >=4)", dataLen);
4890 return tLength;
4893 /* Display organizational unique id */
4894 proto_tree_add_uint(org_tlv_tree, hf_org_spc_oui, tvb, offset + 2, 3, oui);
4896 /* Try to make sure we don't overrun the sub-tlvs */
4897 vendor_tvb = tvb_new_subset_length(tvb, offset + 5, dataLen - 3);
4899 switch (oui)
4901 case OUI_DCBX:
4902 dissect_dcbx_tlv(vendor_tvb, pinfo, org_tlv_tree);
4903 break;
4904 case OUI_IEEE_802_1:
4905 dissect_ieee_802_1_tlv(vendor_tvb, pinfo, org_tlv_tree);
4906 break;
4907 case OUI_IEEE_802_3:
4908 dissect_ieee_802_3_tlv(vendor_tvb, pinfo, org_tlv_tree);
4909 break;
4910 case OUI_MEDIA_ENDPOINT:
4911 dissect_media_tlv(vendor_tvb, pinfo, org_tlv_tree);
4912 break;
4913 case OUI_PROFINET:
4914 dissect_profinet_tlv(vendor_tvb, pinfo, org_tlv_tree, pn_lldp_column_info);
4915 break;
4916 case OUI_CISCO_2:
4917 dissect_cisco_tlv(vendor_tvb, pinfo, org_tlv_tree);
4918 break;
4919 case OUI_IEEE_802_1QBG:
4920 dissect_ieee_802_1qbg_tlv(vendor_tvb, pinfo, org_tlv_tree);
4921 break;
4922 case OUI_HYTEC_GER:
4923 dissect_hytec_tlv(vendor_tvb, pinfo, org_tlv_tree);
4924 break;
4925 case OUI_AVAYA:
4926 dissect_avaya_tlv(vendor_tvb, pinfo, org_tlv_tree);
4927 break;
4928 case OUI_IANA:
4929 dissect_iana_tlv(vendor_tvb, pinfo, org_tlv_tree);
4930 break;
4931 case OUI_AVAYA_EXTREME:
4932 dissect_extreme_avaya_tlv(vendor_tvb, pinfo, org_tlv_tree, dataLen );
4933 break;
4934 case OUI_AVAYA_EXTREME2:
4935 dissect_extreme_avaya2_tlv(vendor_tvb, pinfo, org_tlv_tree);
4936 break;
4937 case OUI_ONOS:
4938 dissect_onos_tlv(vendor_tvb, pinfo, org_tlv_tree);
4939 break;
4940 case OUI_ODVA:
4941 dissect_lldp_cip_tlv(vendor_tvb, pinfo, org_tlv_tree);
4942 break;
4943 default:
4944 dissect_oui_default_tlv(vendor_tvb, pinfo, org_tlv_tree);
4947 return offset + tvb_reported_length(tvb);
4950 /* Dissect Unknown TLV */
4951 static int32_t
4952 dissect_lldp_unknown_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset)
4954 uint16_t dataLen;
4955 uint16_t tempShort;
4957 proto_tree *unknown_tlv_tree;
4959 /* Get tlv type and length */
4960 tempShort = tvb_get_ntohs(tvb, offset);
4962 /* Get tlv length */
4963 dataLen = TLV_INFO_LEN(tempShort);
4965 unknown_tlv_tree = proto_tree_add_subtree(tree, tvb, offset, (dataLen + 2), ett_unknown_tlv, NULL, "Unknown TLV");
4967 proto_tree_add_item(unknown_tlv_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
4968 proto_tree_add_item(unknown_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
4970 offset += 2;
4971 /* Adjust for unknown data */
4972 offset += dataLen;
4974 return offset;
4978 /* Dissect LLDP packets */
4979 static int
4980 dissect_lldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4982 proto_item *ti;
4983 proto_tree *lldp_tree = NULL;
4984 tvbuff_t *new_tvb = NULL;
4985 uint32_t offset = 0;
4986 uint16_t isShutdown;
4987 int32_t rtnValue = 0;
4988 uint16_t tempShort;
4989 uint8_t tlvType;
4990 uint32_t tvbLen;
4991 profinet_lldp_column_info *pn_lldp_column_info = NULL;
4992 col_set_str(pinfo->cinfo, COL_PROTOCOL, "LLDP");
4994 /* Clear the information column on summary display */
4995 col_clear(pinfo->cinfo, COL_INFO);
4997 ti = proto_tree_add_item(tree, proto_lldp, tvb, offset, -1, ENC_NA);
4998 lldp_tree = proto_item_add_subtree(ti, ett_lldp);
5000 // Maybe add an explicit field for the type of the destination mac address?
5002 // IEEE 802.1AB-2016, Table 7-2—Support for MAC addresses in different systems
5003 // Address | C-VLAN Bridge | S-VLAN Bridge | TPMR Bridge | End station
5004 // ------------------------------------------+---------------+----------------+---------------+-------------
5005 // 01-80-C2-00-00-0E Nearest bridge | Mandatory | Mandatory | Mandatory | Mandatory
5006 // 01-80-C2-00-00-03 Nearest non-TPMR bridge | Mandatory | Mandatory | Not permitted | Recommended
5007 // 01-80-C2-00-00-00 Nearest Customer Bridge | Mandatory | Not permitted | Not permitted | Recommended
5008 // Any other group MAC address | Permitted | Permitted | Permitted | Permitted
5009 // Any individual MAC address | Permitted | Permitted | Permitted | Permitted
5011 /* Get chassis id tlv */
5012 tempShort = tvb_get_ntohs(tvb, offset);
5013 new_tvb = tvb_new_subset_length(tvb, offset, TLV_INFO_LEN(tempShort)+2);
5015 /* allocation */
5016 pn_lldp_column_info = wmem_new0(pinfo->pool, profinet_lldp_column_info);
5018 rtnValue = dissect_lldp_chassis_id(new_tvb, pinfo, lldp_tree, 0, pn_lldp_column_info);
5019 if (rtnValue < 0)
5021 col_set_str(pinfo->cinfo, COL_INFO, "Invalid Chassis ID TLV");
5022 return tvb_captured_length(tvb);
5025 offset += rtnValue;
5027 /* Get port id tlv */
5028 tempShort = tvb_get_ntohs(tvb, offset);
5029 new_tvb = tvb_new_subset_length(tvb, offset, TLV_INFO_LEN(tempShort)+2);
5031 rtnValue = dissect_lldp_port_id(new_tvb, pinfo, lldp_tree, 0, pn_lldp_column_info);
5032 if (rtnValue < 0)
5034 col_set_str(pinfo->cinfo, COL_INFO, "Invalid Port ID TLV");
5035 return tvb_captured_length(tvb);
5038 offset += rtnValue;
5040 /* Get time to live tlv */
5041 tempShort = tvb_get_ntohs(tvb, offset);
5042 new_tvb = tvb_new_subset_length(tvb, offset, TLV_INFO_LEN(tempShort)+2);
5044 rtnValue = dissect_lldp_time_to_live(new_tvb, pinfo, lldp_tree, 0, &isShutdown);
5045 if (rtnValue < 0)
5047 col_set_str(pinfo->cinfo, COL_INFO, "Invalid Time-to-Live TLV");
5048 return tvb_captured_length(tvb);
5051 offset += rtnValue;
5053 tvbLen = tvb_captured_length(tvb);
5054 /* Dissect optional tlv info that contained in data packets */
5055 while (offset < tvbLen)
5057 tempShort = tvb_get_ntohs(tvb, offset);
5058 tlvType = TLV_TYPE(tempShort);
5059 /* pass single TLV to dissectors, Zero offset (point to front of tlv) */
5060 new_tvb = tvb_new_subset_length(tvb, offset, TLV_INFO_LEN(tempShort)+2);
5061 switch (tlvType)
5063 case CHASSIS_ID_TLV_TYPE:
5064 dissect_lldp_chassis_id(new_tvb, pinfo, lldp_tree, 0, pn_lldp_column_info);
5065 rtnValue = -1; /* Duplicate chassis id tlv */
5066 if (column_info_selection == DEFAULT_COLUMN_INFO)
5068 col_set_str(pinfo->cinfo, COL_INFO, "Duplicate Chassis ID TLV");
5070 break;
5071 case PORT_ID_TLV_TYPE:
5072 dissect_lldp_port_id(new_tvb, pinfo, lldp_tree, 0, pn_lldp_column_info);
5073 rtnValue = -1; /* Duplicate port id tlv */
5074 if (column_info_selection == DEFAULT_COLUMN_INFO)
5076 col_set_str(pinfo->cinfo, COL_INFO, "Duplicate Port ID TLV");
5078 break;
5079 case TIME_TO_LIVE_TLV_TYPE:
5080 dissect_lldp_time_to_live(new_tvb, pinfo, lldp_tree, 0, &isShutdown);
5081 rtnValue = -1; /* Duplicate time-to-live tlv */
5082 if (column_info_selection == DEFAULT_COLUMN_INFO)
5084 col_set_str(pinfo->cinfo, COL_INFO, "Duplicate Time-To-Live TLV");
5086 break;
5087 case END_OF_LLDPDU_TLV_TYPE:
5088 rtnValue = dissect_lldp_end_of_lldpdu(new_tvb, pinfo, lldp_tree, 0);
5089 break;
5090 case PORT_DESCRIPTION_TLV_TYPE:
5091 rtnValue = dissect_lldp_port_desc(new_tvb, pinfo, lldp_tree, 0);
5092 break;
5093 case SYSTEM_NAME_TLV_TYPE:
5094 case SYSTEM_DESCRIPTION_TLV_TYPE:
5095 rtnValue = dissect_lldp_system_name(new_tvb, pinfo, lldp_tree, 0);
5096 break;
5097 case SYSTEM_CAPABILITIES_TLV_TYPE:
5098 rtnValue = dissect_lldp_system_capabilities(new_tvb, pinfo, lldp_tree, 0);
5099 break;
5100 case MANAGEMENT_ADDR_TLV_TYPE:
5101 rtnValue = dissect_lldp_management_address(new_tvb, pinfo, lldp_tree, 0);
5102 break;
5103 case ORGANIZATION_SPECIFIC_TLV_TYPE:
5104 rtnValue = dissect_organizational_specific_tlv(new_tvb, pinfo, lldp_tree, 0, pn_lldp_column_info);
5105 break;
5106 default:
5107 if (!assume_unrecognized_tlv
5108 || tempShort > tvb_reported_length_remaining(tvb, offset)) {
5109 /* Probably not an LLDP LTV */
5110 rtnValue = -1;
5112 else {
5113 rtnValue = dissect_lldp_unknown_tlv(new_tvb, pinfo, lldp_tree, 0);
5115 break;
5118 // Shutdown PDU: Verify that only ChassisID, PortID, TTL and optionally END TLVs are present
5119 if (isShutdown && tlvType != END_OF_LLDPDU_TLV_TYPE)
5121 proto_tree_add_expert_format(tree, pinfo, &ei_lldp_shutdown_excess_tlv , tvb, offset, TLV_INFO_LEN(tempShort),
5122 "TLV type 0x%02X not allowed in Shutdown PDU", tlvType);
5125 if (rtnValue < 0) {
5126 break;
5128 else
5129 offset += rtnValue;
5131 /* Terminate the LLDP dissector after reaching the END_OF_LLDPDU */
5132 if (tlvType == END_OF_LLDPDU_TLV_TYPE) {
5133 break;
5137 set_actual_length(tvb, offset);
5138 proto_item_set_len(ti, offset);
5139 return tvb_captured_length(tvb);
5142 /* Register the protocol with Wireshark */
5143 void
5144 proto_register_lldp(void)
5146 module_t *lldp_module;
5147 expert_module_t *expert_lldp;
5149 /* Setup list of header fields */
5150 static hf_register_info hf[] = {
5151 { &hf_lldp_tlv_type,
5152 { "TLV Type", "lldp.tlv.type", FT_UINT16, BASE_DEC,
5153 VALS(tlv_types), TLV_TYPE_MASK, NULL, HFILL }
5155 { &hf_lldp_tlv_len,
5156 { "TLV Length", "lldp.tlv.len", FT_UINT16, BASE_DEC,
5157 NULL, TLV_INFO_LEN_MASK, NULL, HFILL }
5159 { &hf_lldp_tlv_system_cap,
5160 { "Capabilities", "lldp.tlv.system_cap", FT_UINT16, BASE_HEX,
5161 NULL, 0, NULL, HFILL }
5163 { &hf_lldp_tlv_system_cap_other,
5164 { "Other", "lldp.tlv.system_cap.other", FT_BOOLEAN, 16,
5165 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_OTHER, NULL, HFILL }
5167 { &hf_lldp_tlv_system_cap_repeater,
5168 { "Repeater", "lldp.tlv.system_cap.repeater", FT_BOOLEAN, 16,
5169 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_REPEATER, NULL, HFILL }
5171 { &hf_lldp_tlv_system_cap_bridge,
5172 { "Bridge", "lldp.tlv.system_cap.bridge", FT_BOOLEAN, 16,
5173 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_BRIDGE, NULL, HFILL }
5175 { &hf_lldp_tlv_system_cap_wlan_access_pt,
5176 { "WLAN access point", "lldp.tlv.system_cap.wlan_access_pt", FT_BOOLEAN, 16,
5177 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_WLAN, NULL, HFILL }
5179 { &hf_lldp_tlv_system_cap_router,
5180 { "Router", "lldp.tlv.system_cap.router", FT_BOOLEAN, 16,
5181 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_ROUTER, NULL, HFILL }
5183 { &hf_lldp_tlv_system_cap_telephone,
5184 { "Telephone", "lldp.tlv.system_cap.telephone", FT_BOOLEAN, 16,
5185 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_TELEPHONE, NULL, HFILL }
5187 { &hf_lldp_tlv_system_cap_docsis_cable_device,
5188 { "DOCSIS cable device", "lldp.tlv.system_cap.docsis_cable_device", FT_BOOLEAN, 16,
5189 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_DOCSIS, NULL, HFILL }
5191 { &hf_lldp_tlv_system_cap_station_only,
5192 { "Station only", "lldp.tlv.system_cap.station_only", FT_BOOLEAN, 16,
5193 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_STATION, NULL, HFILL }
5195 { &hf_lldp_tlv_system_cap_cvlan_component,
5196 { "C-VLAN component", "lldp.tlv.system_cap.cvlan", FT_BOOLEAN, 16,
5197 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_CVLAN, NULL, HFILL }
5199 { &hf_lldp_tlv_system_cap_svlan_component,
5200 { "S-VLAN component", "lldp.tlv.system_cap.svlan", FT_BOOLEAN, 16,
5201 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_SVLAN, NULL, HFILL }
5203 { &hf_lldp_tlv_system_cap_tpmr_component,
5204 { "TPMR component", "lldp.tlv.system_cap.tpmr", FT_BOOLEAN, 16,
5205 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_TPMR, NULL, HFILL }
5207 { &hf_lldp_tlv_system_name,
5208 { "System Name", "lldp.tlv.system.name", FT_STRING, BASE_NONE,
5209 NULL, 0, NULL, HFILL }
5211 { &hf_lldp_tlv_system_desc,
5212 { "System Description", "lldp.tlv.system.desc", FT_STRING, BASE_NONE,
5213 NULL, 0, NULL, HFILL }
5215 { &hf_lldp_tlv_enable_system_cap,
5216 { "Enabled Capabilities", "lldp.tlv.enable_system_cap", FT_UINT16, BASE_HEX,
5217 NULL, 0, NULL, HFILL }
5219 { &hf_lldp_tlv_enable_system_cap_other,
5220 { "Other", "lldp.tlv.enable_system_cap.other", FT_BOOLEAN, 16,
5221 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_OTHER, NULL, HFILL }
5223 { &hf_lldp_tlv_enable_system_cap_repeater,
5224 { "Repeater", "lldp.tlv.enable_system_cap.repeater", FT_BOOLEAN, 16,
5225 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_REPEATER, NULL, HFILL }
5227 { &hf_lldp_tlv_enable_system_cap_bridge,
5228 { "Bridge", "lldp.tlv.enable_system_cap.bridge", FT_BOOLEAN, 16,
5229 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_BRIDGE, NULL, HFILL }
5231 { &hf_lldp_tlv_enable_system_cap_wlan_access_pt,
5232 { "WLAN access point", "lldp.tlv.enable_system_cap.wlan_access_pt", FT_BOOLEAN, 16,
5233 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_WLAN, NULL, HFILL }
5235 { &hf_lldp_tlv_enable_system_cap_router,
5236 { "Router", "lldp.tlv.enable_system_cap.router", FT_BOOLEAN, 16,
5237 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_ROUTER, NULL, HFILL }
5239 { &hf_lldp_tlv_enable_system_cap_telephone,
5240 { "Telephone", "lldp.tlv.enable_system_cap.telephone", FT_BOOLEAN, 16,
5241 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_TELEPHONE, NULL, HFILL }
5243 { &hf_lldp_tlv_enable_system_cap_docsis_cable_device,
5244 { "DOCSIS cable device", "lldp.tlv.enable_system_cap.docsis_cable_device", FT_BOOLEAN, 16,
5245 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_DOCSIS, NULL, HFILL }
5247 { &hf_lldp_tlv_enable_system_cap_station_only,
5248 { "Station only", "lldp.tlv.enable_system_cap.station_only", FT_BOOLEAN, 16,
5249 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_STATION, NULL, HFILL }
5251 { &hf_lldp_tlv_enable_system_cap_cvlan_component,
5252 { "C-VLAN component", "lldp.tlv.enable_system_cap.cvlan", FT_BOOLEAN, 16,
5253 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_CVLAN, NULL, HFILL }
5255 { &hf_lldp_tlv_enable_system_cap_svlan_component,
5256 { "S-VLAN component", "lldp.tlv.enable_system_cap.svlan", FT_BOOLEAN, 16,
5257 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_SVLAN, NULL, HFILL }
5259 { &hf_lldp_tlv_enable_system_cap_tpmr_component,
5260 { "TPMR component", "lldp.tlv.enable_system_cap.tpmr", FT_BOOLEAN, 16,
5261 TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_TPMR, NULL, HFILL }
5263 { &hf_chassis_id_subtype,
5264 { "Chassis Id Subtype", "lldp.chassis.subtype", FT_UINT8, BASE_DEC,
5265 VALS(chassis_id_subtypes), 0, NULL, HFILL }
5267 { &hf_chassis_id,
5268 { "Chassis Id", "lldp.chassis.id", FT_BYTES, BASE_NONE,
5269 NULL, 0, NULL, HFILL }
5271 { &hf_chassis_id_mac,
5272 { "Chassis Id", "lldp.chassis.id.mac", FT_ETHER, BASE_NONE,
5273 NULL, 0, NULL, HFILL }
5275 { &hf_chassis_id_ip4,
5276 { "Chassis Id", "lldp.chassis.id.ip4", FT_IPv4, BASE_NONE,
5277 NULL, 0, NULL, HFILL }
5279 { &hf_chassis_id_ip6,
5280 { "Chassis Id", "lldp.chassis.id.ip6", FT_IPv6, BASE_NONE,
5281 NULL, 0, NULL, HFILL }
5283 { &hf_port_id_subtype,
5284 { "Port Id Subtype", "lldp.port.subtype", FT_UINT8, BASE_DEC,
5285 VALS(port_id_subtypes), 0, NULL, HFILL }
5287 { &hf_port_id,
5288 { "Port Id", "lldp.port.id", FT_STRING, BASE_NONE,
5289 NULL, 0, NULL, HFILL }
5291 { &hf_port_desc,
5292 { "Port Description", "lldp.port.desc", FT_STRING, BASE_NONE,
5293 NULL, 0, NULL, HFILL }
5295 { &hf_port_id_mac,
5296 { "Port Id", "lldp.port.id.mac", FT_ETHER, BASE_NONE,
5297 NULL, 0, NULL, HFILL }
5299 { &hf_lldp_network_address_family,
5300 { "Network Address family", "lldp.network_address.subtype", FT_UINT8, BASE_DEC,
5301 VALS(afn_vals), 0, NULL, HFILL }
5303 { &hf_port_id_ip4,
5304 { "Port Id", "lldp.port.id.ip4", FT_IPv4, BASE_NONE,
5305 NULL, 0, NULL, HFILL }
5307 { &hf_port_id_ip6,
5308 { "Port Id", "lldp.port.id.ip6", FT_IPv6, BASE_NONE,
5309 NULL, 0, NULL, HFILL }
5311 { &hf_time_to_live,
5312 { "Seconds", "lldp.time_to_live", FT_UINT16, BASE_DEC,
5313 NULL, 0, NULL, HFILL }
5315 { &hf_pdu_type,
5316 { "PDU Type", "lldp.pdu_type", FT_NONE, BASE_NONE,
5317 NULL, 0, NULL, HFILL }
5320 { &hf_mgn_address_len,
5321 { "Address String Length", "lldp.mgn.address.len", FT_UINT8, BASE_DEC,
5322 NULL, 0, NULL, HFILL }
5324 { &hf_mgn_address_subtype,
5325 { "Address Subtype", "lldp.mgn.address.subtype", FT_UINT8, BASE_DEC,
5326 VALS(afn_vals), 0, "Undefined", HFILL }
5328 { &hf_mgn_addr_ipv4,
5329 { "Management Address", "lldp.mgn.addr.ip4", FT_IPv4, BASE_NONE,
5330 NULL, 0, NULL, HFILL }
5332 { &hf_mgn_addr_ipv6,
5333 { "Management Address", "lldp.mgn.addr.ip6", FT_IPv6, BASE_NONE,
5334 NULL, 0, NULL, HFILL }
5336 { &hf_mgn_addr_hex,
5337 { "Management Address", "lldp.mgn.addr.hex", FT_BYTES, BASE_NONE,
5338 NULL, 0, NULL, HFILL }
5340 { &hf_mgn_interface_subtype,
5341 { "Interface Subtype", "lldp.mgn.interface.subtype", FT_UINT8, BASE_DEC,
5342 VALS(interface_subtype_values), 0, "Undefined", HFILL }
5344 { &hf_mgn_interface_number,
5345 { "Interface Number", "lldp.mgn.interface.number", FT_UINT32, BASE_DEC,
5346 NULL, 0, NULL, HFILL }
5348 { &hf_mgn_oid_len,
5349 { "OID String Length", "lldp.mgn.obj.len", FT_UINT8, BASE_DEC,
5350 NULL, 0, NULL, HFILL }
5352 { &hf_mgn_obj_id,
5353 { "Object Identifier", "lldp.mgn.obj.id", FT_OID, BASE_NONE,
5354 NULL, 0, NULL, HFILL }
5356 { &hf_org_spc_oui,
5357 { "Organization Unique Code", "lldp.orgtlv.oui", FT_UINT24, BASE_OUI,
5358 NULL, 0x0, NULL, HFILL }
5360 { &hf_dcbx_type,
5361 { "DCBx Protocol", "lldp.dcbx.proto", FT_UINT8, BASE_HEX,
5362 VALS(dcbx_protocol_types), 0x0, NULL, HFILL }
5364 { &hf_dcbx_tlv_type,
5365 { "DCBx TLV Type", "lldp.dcbx.type", FT_UINT16, BASE_DEC,
5366 VALS(dcbx_subtypes), TLV_TYPE_MASK, NULL, HFILL }
5368 { &hf_dcbx_tlv_len,
5369 { "DCBx TLV Length", "lldp.dcbx.len", FT_UINT16, BASE_DEC,
5370 NULL, TLV_INFO_LEN_MASK, NULL, HFILL }
5372 { &hf_dcbx_tlv_oper_version,
5373 { "Operating Version", "lldp.dcbx.version", FT_UINT8, BASE_HEX,
5374 VALS(dcbx_protocol_types), 0x0, "Unknown", HFILL }
5376 { &hf_dcbx_tlv_max_version,
5377 { "Max Version", "lldp.dcbx.max_version", FT_UINT8, BASE_HEX,
5378 VALS(dcbx_protocol_types), 0x0, "Unknown", HFILL }
5380 { &hf_dcbx_control_sequence,
5381 { "Sequence No", "lldp.dcbx.control.seq", FT_UINT32, BASE_DEC,
5382 NULL, 0, NULL, HFILL }
5384 { &hf_dcbx_control_ack,
5385 { "Ack No", "lldp.dcbx.control.ack", FT_UINT32, BASE_DEC,
5386 NULL, 0, NULL, HFILL }
5388 { &hf_dcbx_feature_flag_enabled,
5389 { "Feature", "lldp.dcbx.feature.enabled", FT_BOOLEAN , 8,
5390 TFS(&tfs_enabled_disabled), 0x80, NULL, HFILL }
5392 { &hf_dcbx_feature_flag_willing,
5393 { "Willing", "lldp.dcbx.feature.willing", FT_BOOLEAN , 8,
5394 TFS(&tfs_yes_no), 0x40, NULL, HFILL }
5396 { &hf_dcbx_feature_flag_error,
5397 { "Error", "lldp.dcbx.feature.error", FT_BOOLEAN , 8,
5398 TFS(&tfs_set_notset), 0x20, NULL, HFILL }
5400 { &hf_dcbx_feature_subtype,
5401 { "Subtype", "lldp.dcbx.feature.subtype", FT_UINT8, BASE_HEX,
5402 NULL, 0, NULL, HFILL }
5404 { &hf_dcbx_feature_pgid_reserved,
5405 { "Reserved", "lldp.dcbx.feature.pg.reserved", FT_UINT8, BASE_HEX,
5406 NULL, 0xFE, NULL, HFILL }
5408 { &hf_dcbx_feature_pgid_prio_0,
5409 { "PGID for Prio 0", "lldp.dcbx.feature.pg.pgid_prio0", FT_UINT16, BASE_DEC,
5410 NULL, 0xF000, NULL, HFILL }
5412 { &hf_dcbx_feature_pgid_prio_1,
5413 { "PGID for Prio 1", "lldp.dcbx.feature.pg.pgid_prio1", FT_UINT16, BASE_DEC,
5414 NULL, 0x0F00, NULL, HFILL }
5416 { &hf_dcbx_feature_pgid_prio_2,
5417 { "PGID for Prio 2", "lldp.dcbx.feature.pg.pgid_prio2", FT_UINT16, BASE_DEC,
5418 NULL, 0x00F0, NULL, HFILL }
5420 { &hf_dcbx_feature_pgid_prio_3,
5421 { "PGID for Prio 3", "lldp.dcbx.feature.pg.pgid_prio3", FT_UINT16, BASE_DEC,
5422 NULL, 0x000F, NULL, HFILL }
5424 { &hf_dcbx_feature_pgid_prio_4,
5425 { "PGID for Prio 4", "lldp.dcbx.feature.pg.pgid_prio4", FT_UINT16, BASE_DEC,
5426 NULL, 0xF000, NULL, HFILL }
5428 { &hf_dcbx_feature_pgid_prio_5,
5429 { "PGID for Prio 5", "lldp.dcbx.feature.pg.pgid_prio5", FT_UINT16, BASE_DEC,
5430 NULL, 0x0F00, NULL, HFILL }
5432 { &hf_dcbx_feature_pgid_prio_6,
5433 { "PGID for Prio 6", "lldp.dcbx.feature.pg.pgid_prio6", FT_UINT16, BASE_DEC,
5434 NULL, 0x00F0, NULL, HFILL }
5436 { &hf_dcbx_feature_pgid_prio_7,
5437 { "PGID for Prio 7", "lldp.dcbx.feature.pg.pgid_prio7", FT_UINT16, BASE_DEC,
5438 NULL, 0x000F, NULL, HFILL }
5440 { &hf_dcbx_feature_pg_per_0,
5441 { "Bandwidth for PGID 0", "lldp.dcbx.feature.pg.per0", FT_UINT8, BASE_DEC,
5442 NULL, 0, NULL, HFILL }
5444 { &hf_dcbx_feature_pg_per_1,
5445 { "Bandwidth for PGID 1", "lldp.dcbx.feature.pg.per1", FT_UINT8, BASE_DEC,
5446 NULL, 0, NULL, HFILL }
5448 { &hf_dcbx_feature_pg_per_2,
5449 { "Bandwidth for PGID 2", "lldp.dcbx.feature.pg.per2", FT_UINT8, BASE_DEC,
5450 NULL, 0, NULL, HFILL }
5452 { &hf_dcbx_feature_pg_per_3,
5453 { "Bandwidth for PGID 3", "lldp.dcbx.feature.pg.per3", FT_UINT8, BASE_DEC,
5454 NULL, 0, NULL, HFILL }
5456 { &hf_dcbx_feature_pg_per_4,
5457 { "Bandwidth for PGID 4", "lldp.dcbx.feature.pg.per4", FT_UINT8, BASE_DEC,
5458 NULL, 0, NULL, HFILL }
5460 { &hf_dcbx_feature_pg_per_5,
5461 { "Bandwidth for PGID 5", "lldp.dcbx.feature.pg.per5", FT_UINT8, BASE_DEC,
5462 NULL, 0, NULL, HFILL }
5464 { &hf_dcbx_feature_pg_per_6,
5465 { "Bandwidth for PGID 6", "lldp.dcbx.feature.pg.per6", FT_UINT8, BASE_DEC,
5466 NULL, 0, NULL, HFILL }
5468 { &hf_dcbx_feature_pg_per_7,
5469 { "Bandwidth for PGID 7", "lldp.dcbx.feature.pg.per7", FT_UINT8, BASE_DEC,
5470 NULL, 0, NULL, HFILL }
5472 { &hf_dcbx_feature_pg_numtcs,
5473 { "Number of Traffic Classes Supported", "lldp.dcbx.feature.pg.numtcs", FT_UINT8, BASE_HEX,
5474 NULL, 0, NULL, HFILL }
5476 { &hf_dcbx_feature_pfc_prio0,
5477 { "PFC for Priority 0", "lldp.dcbx.feature.pfc.prio0", FT_BOOLEAN, 8,
5478 TFS(&tfs_enabled_disabled), 0x1, NULL, HFILL }
5480 { &hf_dcbx_feature_pfc_prio1,
5481 { "PFC for Priority 1", "lldp.dcbx.feature.pfc.prio1", FT_BOOLEAN, 8,
5482 TFS(&tfs_enabled_disabled), 0x2, NULL, HFILL }
5484 { &hf_dcbx_feature_pfc_prio2,
5485 { "PFC for Priority 2", "lldp.dcbx.feature.pfc.prio2", FT_BOOLEAN, 8,
5486 TFS(&tfs_enabled_disabled), 0x4, NULL, HFILL }
5488 { &hf_dcbx_feature_pfc_prio3,
5489 { "PFC for Priority 3", "lldp.dcbx.feature.pfc.prio3", FT_BOOLEAN, 8,
5490 TFS(&tfs_enabled_disabled), 0x8, NULL, HFILL }
5492 { &hf_dcbx_feature_pfc_prio4,
5493 { "PFC for Priority 4", "lldp.dcbx.feature.pfc.prio4", FT_BOOLEAN, 8,
5494 TFS(&tfs_enabled_disabled), 0x10, NULL, HFILL }
5496 { &hf_dcbx_feature_pfc_prio5,
5497 { "PFC for Priority 5", "lldp.dcbx.feature.pfc.prio5", FT_BOOLEAN, 8,
5498 TFS(&tfs_enabled_disabled), 0x20, NULL, HFILL }
5500 { &hf_dcbx_feature_pfc_prio6,
5501 { "PFC for Priority 6", "lldp.dcbx.feature.pfc.prio6", FT_BOOLEAN, 8,
5502 TFS(&tfs_enabled_disabled), 0x40, NULL, HFILL }
5504 { &hf_dcbx_feature_pfc_prio7,
5505 { "PFC for Priority 7", "lldp.dcbx.feature.pfc.prio7", FT_BOOLEAN, 8,
5506 TFS(&tfs_enabled_disabled), 0x80, NULL, HFILL }
5508 { &hf_dcbx_feature_pfc_numtcs,
5509 { "Number of Traffic Classes Supported", "lldp.dcbx.feature.pfc.numtcs", FT_UINT8, BASE_HEX,
5510 NULL, 0, NULL, HFILL }
5512 { &hf_dcbx_feature_app_proto,
5513 { "Application Protocol Id", "lldp.dcbx.feature.app.proto", FT_UINT16, BASE_HEX,
5514 NULL, 0, NULL, HFILL }
5516 { &hf_dcbx_feature_app_selector,
5517 { "Selector Field", "lldp.dcbx.feature.app.sf", FT_UINT24, BASE_DEC,
5518 VALS(dcbx_app_selector), 0x3 << 16, NULL, HFILL }
5520 { &hf_dcbx_feature_app_oui,
5521 { "Application OUI", "lldp.dcbx.feature.app.oui", FT_UINT24, BASE_HEX,
5522 NULL, ~(0x3 << 16), NULL, HFILL }
5524 { &hf_dcbx_feature_app_prio,
5525 { "Application Priority", "lldp.dcbx.feature.app.prio", FT_UINT8, BASE_DEC,
5526 NULL, 0x0, NULL, HFILL }
5528 { &hf_dcbx_feature_flag_llink_type,
5529 { "Logical Link Down Type", "lldp.dcbx.feature.llink.type", FT_UINT8, BASE_HEX,
5530 VALS(dcbx_llink_types), 0x80, NULL, HFILL }
5532 { &hf_ieee_802_1_subtype,
5533 { "IEEE 802.1 Subtype", "lldp.ieee.802_1.subtype", FT_UINT8, BASE_HEX,
5534 VALS(ieee_802_1_subtypes), 0x0, NULL, HFILL }
5536 { &hf_ieee_802_1_port_and_vlan_id_flag,
5537 { "Flags", "lldp.ieee.802_1.port_and_vlan_id_flag", FT_UINT8, BASE_HEX,
5538 NULL, 0x0, NULL, HFILL }
5540 { &hf_ieee_802_1_port_and_vlan_id_flag_supported,
5541 { "Port and Protocol VLAN", "lldp.ieee.802_1.port_and_vlan_id_flag.supported", FT_BOOLEAN, 8,
5542 TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }
5544 { &hf_ieee_802_1_port_and_vlan_id_flag_enabled,
5545 { "Port and Protocol VLAN", "lldp.ieee.802_1.port_and_vlan_id_flag.enabled", FT_BOOLEAN, 8,
5546 TFS(&tfs_enabled_disabled), 0x04, NULL, HFILL }
5548 { &hf_ieee_802_1_port_vlan_id,
5549 { "Port VLAN Identifier", "lldp.ieee.802_1.port_vlan.id", FT_UINT16, BASE_DEC_HEX,
5550 NULL, 0x0, NULL, HFILL }
5552 { &hf_ieee_802_1_port_proto_vlan_id,
5553 { "Port and Protocol VLAN Identifier", "lldp.ieee.802_1.port_proto_vlan.id", FT_UINT16, BASE_DEC_HEX,
5554 NULL, 0x0, NULL, HFILL }
5556 { &hf_ieee_802_1_vlan_id,
5557 { "VLAN Identifier", "lldp.ieee.802_1.vlan.id", FT_UINT16, BASE_DEC_HEX,
5558 NULL, 0x0, NULL, HFILL }
5560 { &hf_ieee_802_1_vlan_name_length,
5561 { "VLAN Name Length", "lldp.ieee.802_1.vlan.name_len", FT_UINT8, BASE_DEC,
5562 NULL, 0x0, NULL, HFILL }
5564 { &hf_ieee_802_1_vlan_name,
5565 { "VLAN Name", "lldp.ieee.802_1.vlan.name", FT_STRINGZ, BASE_NONE,
5566 NULL, 0x0, NULL, HFILL }
5568 { &hf_ieee_802_1_proto_id_length,
5569 { "Protocol Identity Length", "lldp.ieee.802_1.proto.id_length", FT_UINT8, BASE_DEC,
5570 NULL, 0x0, NULL, HFILL }
5572 { &hf_ieee_802_1_proto_id,
5573 { "Protocol Identity", "lldp.ieee.802_1.proto.id", FT_BYTES, BASE_NONE,
5574 NULL, 0x0, NULL, HFILL }
5576 { &hf_ieee_802_1_aggregation_status,
5577 { "Aggregation Status", "lldp.ieee.802_1.aggregation_status", FT_UINT8, BASE_HEX,
5578 NULL, 0x0, NULL, HFILL }
5580 { &hf_ieee_802_1_aggregation_status_cap,
5581 { "Aggregation Capability", "lldp.ieee.802_1.aggregation_status.cap", FT_BOOLEAN, 8,
5582 TFS(&tfs_yes_no), 0x01, NULL, HFILL }
5584 { &hf_ieee_802_1_aggregation_status_enabled,
5585 { "Aggregation Status", "lldp.ieee.802_1.aggregation_status.enabled", FT_BOOLEAN, 8,
5586 TFS(&tfs_enabled_disabled), 0x02, NULL, HFILL }
5588 { &hf_ieee_802_1_aggregation_status_porttype,
5589 { "Aggregation Status", "lldp.ieee.802_1.aggregation_status.porttype", FT_UINT8, BASE_DEC,
5590 VALS(porttype_values), 0x0c, NULL, HFILL }
5592 { &hf_ieee_802_1_aggregated_port_id,
5593 { "Aggregated Port Id", "lldp.ieee.802_1.aggregated_port_id", FT_UINT32, BASE_DEC,
5594 NULL, 0, NULL, HFILL }
5596 { &hf_ieee_8021qau_cnpv_prio0,
5597 { "Priority 0 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio0", FT_BOOLEAN, 8,
5598 TFS(&tfs_enabled_disabled), 0x01, NULL, HFILL }
5600 { &hf_ieee_8021qau_cnpv_prio1,
5601 { "Priority 1 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio1", FT_BOOLEAN, 8,
5602 TFS(&tfs_enabled_disabled), 0x02, NULL, HFILL }
5604 { &hf_ieee_8021qau_cnpv_prio2,
5605 { "Priority 2 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio2", FT_BOOLEAN, 8,
5606 TFS(&tfs_enabled_disabled), 0x04, NULL, HFILL }
5608 { &hf_ieee_8021qau_cnpv_prio3,
5609 { "Priority 3 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio3", FT_BOOLEAN, 8,
5610 TFS(&tfs_enabled_disabled), 0x08, NULL, HFILL }
5612 { &hf_ieee_8021qau_cnpv_prio4,
5613 { "Priority 4 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio4", FT_BOOLEAN, 8,
5614 TFS(&tfs_enabled_disabled), 0x10, NULL, HFILL }
5616 { &hf_ieee_8021qau_cnpv_prio5,
5617 { "Priority 5 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio5", FT_BOOLEAN, 8,
5618 TFS(&tfs_enabled_disabled), 0x20, NULL, HFILL }
5620 { &hf_ieee_8021qau_cnpv_prio6,
5621 { "Priority 6 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio6", FT_BOOLEAN, 8,
5622 TFS(&tfs_enabled_disabled), 0x40, NULL, HFILL }
5624 { &hf_ieee_8021qau_cnpv_prio7,
5625 { "Priority 7 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio7", FT_BOOLEAN, 8,
5626 TFS(&tfs_enabled_disabled), 0x80, NULL, HFILL }
5628 { &hf_ieee_8021qau_ready_prio0,
5629 { "Priority 0 Ready Indicator", "lldp.ieee.802_1qau.ready.prio0", FT_BOOLEAN, 8,
5630 TFS(&tfs_set_notset), 0x01, NULL, HFILL }
5632 { &hf_ieee_8021qau_ready_prio1,
5633 { "Priority 1 Ready Indicator", "lldp.ieee.802_1qau.ready.prio1", FT_BOOLEAN, 8,
5634 TFS(&tfs_set_notset), 0x02, NULL, HFILL }
5636 { &hf_ieee_8021qau_ready_prio2,
5637 { "Priority 2 Ready Indicator", "lldp.ieee.802_1qau.ready.prio2", FT_BOOLEAN, 8,
5638 TFS(&tfs_set_notset), 0x04, NULL, HFILL }
5640 { &hf_ieee_8021qau_ready_prio3,
5641 { "Priority 3 Ready Indicator", "lldp.ieee.802_1qau.ready.prio3", FT_BOOLEAN, 8,
5642 TFS(&tfs_set_notset), 0x08, NULL, HFILL }
5644 { &hf_ieee_8021qau_ready_prio4,
5645 { "Priority 4 Ready Indicator", "lldp.ieee.802_1qau.ready.prio4", FT_BOOLEAN, 8,
5646 TFS(&tfs_set_notset), 0x10, NULL, HFILL }
5648 { &hf_ieee_8021qau_ready_prio5,
5649 { "Priority 5 Ready Indicator", "lldp.ieee.802_1qau.ready.prio5", FT_BOOLEAN, 8,
5650 TFS(&tfs_set_notset), 0x20, NULL, HFILL }
5652 { &hf_ieee_8021qau_ready_prio6,
5653 { "Priority 6 Ready Indicator", "lldp.ieee.802_1qau.ready.prio6", FT_BOOLEAN, 8,
5654 TFS(&tfs_set_notset), 0x40, NULL, HFILL }
5656 { &hf_ieee_8021qau_ready_prio7,
5657 { "Priority 7 Ready Indicator", "lldp.ieee.802_1qau.ready.prio7", FT_BOOLEAN, 8,
5658 TFS(&tfs_set_notset), 0x80, NULL, HFILL }
5660 { &hf_ieee_8021az_feature_flag_willing,
5661 { "Willing", "lldp.dcbx.ieee.willing", FT_BOOLEAN , 8,
5662 TFS(&tfs_yes_no), 0x80, NULL, HFILL }
5664 { &hf_ieee_8021az_feature_flag_cbs,
5665 { "Credit-Based Shaper", "lldp.dcbx.ieee.ets.cbs", FT_BOOLEAN, 8,
5666 TFS(&tfs_supported_not_supported), 0x40, NULL, HFILL }
5668 { &hf_ieee_8021az_maxtcs,
5669 { "Maximum Number of Traffic Classes", "lldp.dcbx.ieee.ets.maxtcs", FT_UINT8, BASE_DEC,
5670 NULL, 0x7, NULL, HFILL }
5672 { &hf_ieee_8021az_tsa_class0,
5673 { "TSA for Traffic Class 0", "lldp.dcbx.ieee.ets.tsa0", FT_UINT8, BASE_DEC,
5674 VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL }
5676 { &hf_ieee_8021az_tsa_class1,
5677 { "TSA for Traffic Class 1", "lldp.dcbx.ieee.ets.tsa1", FT_UINT8, BASE_DEC,
5678 VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL }
5680 { &hf_ieee_8021az_tsa_class2,
5681 { "TSA for Traffic Class 2", "lldp.dcbx.ieee.ets.tsa2", FT_UINT8, BASE_DEC,
5682 VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL }
5684 { &hf_ieee_8021az_tsa_class3,
5685 { "TSA for Traffic Class 3", "lldp.dcbx.ieee.ets.tsa3", FT_UINT8, BASE_DEC,
5686 VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL }
5688 { &hf_ieee_8021az_tsa_class4,
5689 { "TSA for Traffic Class 4", "lldp.dcbx.ieee.ets.tsa4", FT_UINT8, BASE_DEC,
5690 VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL }
5692 { &hf_ieee_8021az_tsa_class5,
5693 { "TSA for Traffic Class 5", "lldp.dcbx.ieee.ets.tsa5", FT_UINT8, BASE_DEC,
5694 VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL }
5696 { &hf_ieee_8021az_tsa_class6,
5697 { "TSA for Traffic Class 6", "lldp.dcbx.ieee.ets.tsa6", FT_UINT8, BASE_DEC,
5698 VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL }
5700 { &hf_ieee_8021az_tsa_class7,
5701 { "TSA for Traffic Class 7", "lldp.dcbx.ieee.ets.tsa7", FT_UINT8, BASE_DEC,
5702 VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL }
5704 { &hf_ieee_8021az_feature_flag_mbc,
5705 { "MACsec Bypass Capability", "lldp.dcbx.ieee.pfc.mbc", FT_BOOLEAN, 8,
5706 TFS(&tfs_capable_not_capable), 0x40, NULL, HFILL }
5708 { &hf_ieee_8021az_pfc_numtcs,
5709 { "Max PFC Enabled Traffic Classes", "lldp.dcbx.ieee.pfc.numtcs", FT_UINT8, BASE_DEC,
5710 NULL, 0xF, NULL, HFILL }
5712 { &hf_ieee_8021az_app_reserved,
5713 { "Reserved", "lldp.dcbx.ieee.app.reserved", FT_UINT8, BASE_HEX,
5714 NULL, 0x0, NULL, HFILL }
5716 { &hf_ieee_8021az_app_prio,
5717 { "Application Priority", "lldp.dcbx.ieee.app.prio", FT_UINT8, BASE_DEC,
5718 NULL, 0xE0, NULL, HFILL }
5720 { &hf_ieee_8021az_app_selector,
5721 { "Application Selector", "lldp.dcbx.iee.app.sf", FT_UINT8, BASE_DEC,
5722 VALS(dcbx_ieee_8021az_sf), 0x7, NULL, HFILL }
5724 { &hf_ieee_802_3_subtype,
5725 { "IEEE 802.3 Subtype", "lldp.ieee.802_3.subtype", FT_UINT8, BASE_HEX,
5726 VALS(ieee_802_3_subtypes), 0x0, NULL, HFILL }
5728 { &hf_ieee_802_3_mac_phy_auto_neg_status,
5729 { "Auto-Negotiation Support/Status", "lldp.ieee.802_3.mac_phy_auto_neg_status", FT_UINT8, BASE_HEX,
5730 NULL, 0x0, NULL, HFILL }
5732 { &hf_ieee_802_3_mac_phy_auto_neg_status_supported,
5733 { "Auto-Negotiation", "lldp.ieee.802_3.mac_phy_auto_neg_status.supported", FT_BOOLEAN, 8,
5734 TFS(&tfs_supported_not_supported), 0x01, NULL, HFILL }
5736 { &hf_ieee_802_3_mac_phy_auto_neg_status_enabled,
5737 { "Auto-Negotiation", "lldp.ieee.802_3.mac_phy_auto_neg_status.enabled", FT_BOOLEAN, 8,
5738 TFS(&tfs_enabled_disabled), 0x02, NULL, HFILL }
5740 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps,
5741 { "PMD Auto-Negotiation Advertised Capability", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps", FT_UINT16, BASE_HEX,
5742 NULL, 0x0, NULL, HFILL }
5744 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_tfd,
5745 { "1000BASE-T (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.1000base_tfd", FT_BOOLEAN, 16,
5746 TFS(&tfs_capable_not_capable), AUTONEG_1000BASE_TFD, NULL, HFILL }
5748 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_t,
5749 { "1000BASE-T (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.1000base_t", FT_BOOLEAN, 16,
5750 TFS(&tfs_capable_not_capable), AUTONEG_1000BASE_T, NULL, HFILL }
5752 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_xfd,
5753 { "1000BASE-X (-LX, -SX, -CX full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.1000base_xfd", FT_BOOLEAN, 16,
5754 TFS(&tfs_capable_not_capable), AUTONEG_1000BASE_XFD, NULL, HFILL }
5756 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_x,
5757 { "1000BASE-X (-LX, -SX, -CX half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.1000base_x", FT_BOOLEAN, 16,
5758 TFS(&tfs_capable_not_capable), AUTONEG_1000BASE_X, NULL, HFILL }
5760 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_bpause,
5761 { "Asymmetric and Symmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.fdx_bpause", FT_BOOLEAN, 16,
5762 TFS(&tfs_capable_not_capable), AUTONEG_FDX_BPAUSE, NULL, HFILL }
5764 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_spause,
5765 { "Symmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.fdx_spause", FT_BOOLEAN, 16,
5766 TFS(&tfs_capable_not_capable), AUTONEG_FDX_SPAUSE, NULL, HFILL }
5768 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_apause,
5769 { "Asymmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.fdx_apause", FT_BOOLEAN, 16,
5770 TFS(&tfs_capable_not_capable), AUTONEG_FDX_APAUSE, NULL, HFILL }
5772 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_pause,
5773 { "PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.fdx_pause", FT_BOOLEAN, 16,
5774 TFS(&tfs_capable_not_capable), AUTONEG_FDX_PAUSE, NULL, HFILL }
5776 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t2fd,
5777 { "100BASE-T2 (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.100base_t2fd", FT_BOOLEAN, 16,
5778 TFS(&tfs_capable_not_capable), AUTONEG_100BASE_T2FD, NULL, HFILL }
5780 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t2,
5781 { "100BASE-T2 (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.100base_t2", FT_BOOLEAN, 16,
5782 TFS(&tfs_capable_not_capable), AUTONEG_100BASE_T2, NULL, HFILL }
5784 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_txfd,
5785 { "100BASE-TX (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.100base_txfd", FT_BOOLEAN, 16,
5786 TFS(&tfs_capable_not_capable), AUTONEG_100BASE_TXFD, NULL, HFILL }
5788 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_tx,
5789 { "100BASE-TX (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.100base_tx", FT_BOOLEAN, 16,
5790 TFS(&tfs_capable_not_capable), AUTONEG_100BASE_TX, NULL, HFILL }
5792 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t4,
5793 { "100BASE-T4", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.100base_t4", FT_BOOLEAN, 16,
5794 TFS(&tfs_capable_not_capable), AUTONEG_100BASE_T4, NULL, HFILL }
5796 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_10base_tfd,
5797 { "10BASE-T (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.10base_tfd", FT_BOOLEAN, 16,
5798 TFS(&tfs_capable_not_capable), AUTONEG_10BASET_FD, NULL, HFILL }
5800 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_10base_t,
5801 { "10BASE-T (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.10base_t", FT_BOOLEAN, 16,
5802 TFS(&tfs_capable_not_capable), AUTONEG_10BASE_T, NULL, HFILL }
5804 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_other,
5805 { "Other or unknown", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.other", FT_BOOLEAN, 16,
5806 TFS(&tfs_capable_not_capable), AUTONEG_OTHER, NULL, HFILL }
5808 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_tfd,
5809 { "1000BASE-T (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.1000base_tfd", FT_BOOLEAN, 16,
5810 TFS(&tfs_capable_not_capable), INV_AUTONEG_1000BASE_TFD, NULL, HFILL }
5812 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_t,
5813 { "1000BASE-T (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.1000base_t", FT_BOOLEAN, 16,
5814 TFS(&tfs_capable_not_capable), INV_AUTONEG_1000BASE_T, NULL, HFILL }
5816 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_xfd,
5817 { "1000BASE-X (-LX, -SX, -CX full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.1000base_xfd", FT_BOOLEAN, 16,
5818 TFS(&tfs_capable_not_capable), INV_AUTONEG_1000BASE_XFD, NULL, HFILL }
5820 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_x,
5821 { "1000BASE-X (-LX, -SX, -CX half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.1000base_x", FT_BOOLEAN, 16,
5822 TFS(&tfs_capable_not_capable), INV_AUTONEG_1000BASE_X, NULL, HFILL }
5824 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_bpause,
5825 { "Asymmetric and Symmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.fdx_bpause", FT_BOOLEAN, 16,
5826 TFS(&tfs_capable_not_capable), INV_AUTONEG_FDX_BPAUSE, NULL, HFILL }
5828 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_spause,
5829 { "Symmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.fdx_spause", FT_BOOLEAN, 16,
5830 TFS(&tfs_capable_not_capable), INV_AUTONEG_FDX_SPAUSE, NULL, HFILL }
5832 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_apause,
5833 { "Asymmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.fdx_apause", FT_BOOLEAN, 16,
5834 TFS(&tfs_capable_not_capable), INV_AUTONEG_FDX_APAUSE, NULL, HFILL }
5836 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_pause,
5837 { "PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.fdx_pause", FT_BOOLEAN, 16,
5838 TFS(&tfs_capable_not_capable), INV_AUTONEG_FDX_PAUSE, NULL, HFILL }
5840 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t2fd,
5841 { "100BASE-T2 (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.100base_t2fd", FT_BOOLEAN, 16,
5842 TFS(&tfs_capable_not_capable), INV_AUTONEG_100BASE_T2FD, NULL, HFILL }
5844 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t2,
5845 { "100BASE-T2 (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.100base_t2", FT_BOOLEAN, 16,
5846 TFS(&tfs_capable_not_capable), INV_AUTONEG_100BASE_T2, NULL, HFILL }
5848 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_txfd,
5849 { "100BASE-TX (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.100base_txfd", FT_BOOLEAN, 16,
5850 TFS(&tfs_capable_not_capable), INV_AUTONEG_100BASE_TXFD, NULL, HFILL }
5852 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_tx,
5853 { "100BASE-TX (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.100base_tx", FT_BOOLEAN, 16,
5854 TFS(&tfs_capable_not_capable), INV_AUTONEG_100BASE_TX, NULL, HFILL }
5856 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t4,
5857 { "100BASE-T4", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.100base_t4", FT_BOOLEAN, 16,
5858 TFS(&tfs_capable_not_capable), INV_AUTONEG_100BASE_T4, NULL, HFILL }
5860 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_10base_tfd,
5861 { "10BASE-T (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.10base_tfd", FT_BOOLEAN, 16,
5862 TFS(&tfs_capable_not_capable), INV_AUTONEG_10BASET_FD, NULL, HFILL }
5864 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_10base_t,
5865 { "10BASE-T (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.10base_t", FT_BOOLEAN, 16,
5866 TFS(&tfs_capable_not_capable), INV_AUTONEG_10BASE_T, NULL, HFILL }
5868 { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_other,
5869 { "Other or unknown", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.other", FT_BOOLEAN, 16,
5870 TFS(&tfs_capable_not_capable), INV_AUTONEG_OTHER, NULL, HFILL }
5872 { &hf_ieee_802_3_pmd_mau_type,
5873 { "Operational MAU Type", "lldp.ieee.802_3.pmd_mau_type", FT_UINT16, BASE_HEX,
5874 VALS(operational_mau_type_values), 0x0, "Unknown", HFILL }
5876 { &hf_ieee_802_3_mdi_power_support,
5877 { "MDI Power Support", "lldp.ieee.802_3.mdi_power_support", FT_UINT8, BASE_HEX,
5878 NULL, 0x0, NULL, HFILL }
5880 { &hf_ieee_802_3_mdi_power_support_port_class,
5881 { "Port Class", "lldp.ieee.802_3.mdi_power_support.port_class", FT_BOOLEAN, 8,
5882 TFS(&tfs_ieee_802_3_pse_pd), 0x01, NULL, HFILL }
5884 { &hf_ieee_802_3_mdi_power_support_pse_power_support,
5885 { "PSE MDI Power", "lldp.ieee.802_3.mdi_power_support.supported", FT_BOOLEAN, 8,
5886 TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }
5888 { &hf_ieee_802_3_mdi_power_support_pse_power_enabled,
5889 { "PSE MDI Power", "lldp.ieee.802_3.mdi_power_support.enabled", FT_BOOLEAN, 8,
5890 TFS(&tfs_enabled_disabled), 0x04, NULL, HFILL }
5892 { &hf_ieee_802_3_mdi_power_support_pse_pairs,
5893 { "PSE Pairs Control Ability", "lldp.ieee.802_3.mdi_power_support.pse_pairs", FT_BOOLEAN, 8,
5894 TFS(&tfs_yes_no), 0x08, NULL, HFILL }
5896 { &hf_ieee_802_3_mdi_power_pse_pair,
5897 { "PSE Power Pair", "lldp.ieee.802_3.mdi_pse_pair", FT_UINT8, BASE_DEC,
5898 VALS(power_pair_802_3), 0x0, NULL, HFILL }
5900 { &hf_ieee_802_3_mdi_power_class,
5901 { "Power Class", "lldp.ieee.802_3.mdi_power_class", FT_UINT8, BASE_DEC,
5902 VALS(power_class_802_3), 0x0, NULL, HFILL }
5904 { &hf_ieee_802_3_mdi_power_type,
5905 { "Power Type", "lldp.ieee.802_3.mdi_power_type", FT_UINT8, BASE_DEC,
5906 VALS(power_type_802_3), 0xC0, "Unknown", HFILL }
5908 { &hf_ieee_802_3_mdi_power_source,
5909 { "Power Source", "lldp.ieee.802_3.mdi_power_source", FT_UINT8, BASE_DEC,
5910 NULL, 0x30, NULL, HFILL }
5912 { &hf_ieee_802_3_mdi_power_priority,
5913 { "Power Priority", "lldp.ieee.802_3.mdi_power_priority", FT_UINT8, BASE_DEC,
5914 VALS(media_power_priority), 0x03, NULL, HFILL }
5916 { &hf_ieee_802_3_mdi_power_pd4pid,
5917 { "PD 4PID", "lldp.ieee.802_3.mdi_power_pd4pid", FT_BOOLEAN, 8,
5918 TFS(&tfs_supported_not_supported), 0x4, NULL, HFILL }
5920 { &hf_ieee_802_3_mdi_requested_power,
5921 { "PD Requested Power Value", "lldp.ieee.802_3.mdi_pde_requested", FT_UINT16, BASE_CUSTOM,
5922 CF_FUNC(mdi_power_base), 0, NULL, HFILL }
5924 { &hf_ieee_802_3_mdi_allocated_power,
5925 { "PSE Allocated Power Value", "lldp.ieee.802_3.mdi_pse_allocated", FT_UINT16, BASE_CUSTOM,
5926 CF_FUNC(mdi_power_base), 0, NULL, HFILL }
5928 { &hf_ieee_802_3_bt_ds_pd_requested_power_value_mode_a,
5929 { "DS PD Requested Power Value Mode A", "lldp.ieee.802_3.bt_ds_pd_requested_power_value_mode_a", FT_UINT16, BASE_CUSTOM,
5930 CF_FUNC(mdi_power_base), 0, NULL, HFILL }
5932 { &hf_ieee_802_3_bt_ds_pd_requested_power_value_mode_b,
5933 { "DS PD Requested Power Value Mode B", "lldp.ieee.802_3.bt_ds_pd_requested_power_value_mode_b", FT_UINT16, BASE_CUSTOM,
5934 CF_FUNC(mdi_power_base), 0, NULL, HFILL }
5936 { &hf_ieee_802_3_bt_ds_pse_allocated_power_value_alt_a,
5937 { "DS PSE Allocated Power Value Alt A", "lldp.ieee.802_3.bt_ds_pse_allocated_power_value_alt_a", FT_UINT16, BASE_CUSTOM,
5938 CF_FUNC(mdi_power_base), 0, NULL, HFILL }
5940 { &hf_ieee_802_3_bt_ds_pse_allocated_power_value_alt_b,
5941 { "DS PSE Allocated Power Value Alt B", "lldp.ieee.802_3.bt_ds_pse_allocated_power_value_alt_b", FT_UINT16, BASE_CUSTOM,
5942 CF_FUNC(mdi_power_base), 0, NULL, HFILL }
5944 { &hf_ieee_802_3_bt_power_status,
5945 { "Power Status", "lldp.ieee.802_3.bt_power_status", FT_UINT16, BASE_HEX,
5946 NULL, 0, NULL, HFILL }
5948 { &hf_ieee_802_3_bt_pse_powering_status,
5949 { "PSE Powering Status", "lldp.ieee.802_3.bt_pse_powering_status", FT_UINT16, BASE_DEC,
5950 VALS(pse_powering_status_802_3_bt), 0xC000, NULL, HFILL }
5952 { &hf_ieee_802_3_bt_pd_powered_status,
5953 { "PD Powered Status", "lldp.ieee.802_3.bt_pd_powered_status", FT_UINT16, BASE_DEC,
5954 VALS(pd_powered_status_802_3_bt), 0x3000, NULL, HFILL }
5956 { &hf_ieee_802_3_bt_pse_power_pairs_ext,
5957 { "PSE Power Pairs ext", "lldp.ieee.802_3.bt_pse_power_pairs_ext", FT_UINT16, BASE_DEC,
5958 VALS(power_pairs_ext_802_3_bt), 0x0C00, NULL, HFILL }
5960 { &hf_ieee_802_3_bt_ds_pwr_class_ext_a,
5961 { "DS Pwr Class Ext A", "lldp.ieee.802_3.bt_ds_pwr_class_ext_a", FT_UINT16, BASE_DEC,
5962 VALS(power_type_ext_mode_ab_802_3_bt), 0x0380, NULL, HFILL }
5964 { &hf_ieee_802_3_bt_ds_pwr_class_ext_b,
5965 { "DS Pwr Class Ext B", "lldp.ieee.802_3.bt_ds_pwr_class_ext_b", FT_UINT16, BASE_DEC,
5966 VALS(power_type_ext_mode_ab_802_3_bt), 0x0070, NULL, HFILL }
5968 { &hf_ieee_802_3_bt_pwr_class_ext,
5969 { "Pwr Class Ext", "lldp.ieee.802_3.bt_pwr_class_ext_", FT_UINT16, BASE_DEC,
5970 VALS(power_class_ext_802_3_bt), 0x000F, NULL, HFILL }
5972 { &hf_ieee_802_3_bt_system_setup,
5973 { "System Setup", "lldp.ieee.802_3.bt_system_setup", FT_UINT8, BASE_HEX,
5974 NULL, 0, NULL, HFILL }
5976 { &hf_ieee_802_3_bt_power_type_ext,
5977 { "Power Type Ext", "lldp.ieee.802_3.bt_power_type_ext", FT_UINT8, BASE_DEC,
5978 VALS(power_type_ext_802_3_bt), 0x0E, NULL, HFILL }
5980 { &hf_ieee_802_3_bt_power_pd_load,
5981 { "PD Load", "lldp.ieee.802_3.bt_power.pd_load", FT_BOOLEAN, 8,
5982 TFS(&tfs_ieee_802_3_pd_load), 0x1, NULL, HFILL }
5984 { &hf_ieee_802_3_bt_pse_maximum_available_power_value,
5985 { "PSE Maximum Available Power Value", "lldp.ieee.802_3.bt_pse_maximum_available_power_value", FT_UINT16, BASE_CUSTOM,
5986 CF_FUNC(mdi_power_base), 0, NULL, HFILL }
5988 { &hf_ieee_802_3_bt_autoclass,
5989 { "Autoclass", "lldp.ieee.802_3.bt_autoclass", FT_UINT8, BASE_HEX,
5990 NULL, 0, NULL, HFILL }
5992 { &hf_ieee_802_3_bt_pse_autoclass_support,
5993 { "PSE Autoclass support", "lldp.ieee.802_3.bt_pse_autoclass_support", FT_UINT8, BASE_DEC,
5994 NULL, 0x04, NULL, HFILL }
5996 { &hf_ieee_802_3_bt_autoclass_completed,
5997 { "Autoclass Completed", "lldp.ieee.802_3.bt_autoclass_completed", FT_UINT8, BASE_DEC,
5998 NULL, 0x02, NULL, HFILL }
6000 { &hf_ieee_802_3_bt_autoclass_request,
6001 { "Autoclass Request", "lldp.ieee.802_3.bt_autoclass_request", FT_UINT8, BASE_DEC,
6002 NULL, 0x01, NULL, HFILL }
6004 { &hf_ieee_802_3_bt_autoclass_reserved,
6005 { "Autoclass Reserved", "lldp.ieee.802_3.bt_autoclass_reserved", FT_UINT8, BASE_HEX,
6006 NULL, 0xF8, NULL, HFILL }
6008 { &hf_ieee_802_3_bt_power_down,
6009 { "Power down", "lldp.ieee.802_3.bt_power_down", FT_UINT24, BASE_HEX,
6010 NULL, 0, NULL, HFILL }
6012 { &hf_ieee_802_3_bt_power_down_request,
6013 { "Power down request", "lldp.ieee.802_3.bt_power_down_request", FT_UINT24, BASE_DEC,
6014 NULL, 0xFC0000, NULL, HFILL }
6016 { &hf_ieee_802_3_bt_power_down_time,
6017 { "Power down time", "lldp.ieee.802_3.bt_power_down_time", FT_UINT24, BASE_DEC,
6018 NULL, 0x03FFFF, NULL, HFILL }
6020 { &hf_ieee_802_3_aggregation_status,
6021 { "Aggregation Status", "lldp.ieee.802_3.aggregation_status", FT_UINT8, BASE_HEX,
6022 NULL, 0x0, NULL, HFILL }
6024 { &hf_ieee_802_3_aggregation_status_cap,
6025 { "Aggregation Capability", "lldp.ieee.802_3.aggregation_status.cap", FT_BOOLEAN, 8,
6026 TFS(&tfs_yes_no), 0x01, NULL, HFILL }
6028 { &hf_ieee_802_3_aggregation_status_enabled,
6029 { "Aggregation Status", "lldp.ieee.802_3.aggregation_status.enabled", FT_BOOLEAN, 8,
6030 TFS(&tfs_enabled_disabled), 0x02, NULL, HFILL }
6032 { &hf_ieee_802_3_aggregated_port_id,
6033 { "Aggregated Port Id", "lldp.ieee.802_3.aggregated_port_id", FT_UINT32, BASE_DEC,
6034 NULL, 0, NULL, HFILL }
6036 { &hf_ieee_802_3_max_frame_size,
6037 { "Maximum Frame Size", "lldp.ieee.802_3.max_frame_size", FT_UINT16, BASE_DEC,
6038 NULL, 0, NULL, HFILL }
6040 { &hf_ieee_802_3_eee_transmit,
6041 { "Transmit", "lldp.ieee.802_3.eee.transmit", FT_UINT16, BASE_DEC,
6042 NULL, 0, NULL, HFILL }
6044 { &hf_ieee_802_3_eee_receive,
6045 { "Receive", "lldp.ieee.802_3.eee.receive", FT_UINT16, BASE_DEC,
6046 NULL, 0, NULL, HFILL }
6048 { &hf_ieee_802_3_eee_fallback_receive,
6049 { "Fallback Receive", "lldp.ieee.802_3.eee.fallback_receive", FT_UINT16, BASE_DEC,
6050 NULL, 0, NULL, HFILL }
6052 { &hf_ieee_802_3_eee_echo_transmit,
6053 { "Echo Transmit", "lldp.ieee.802_3.eee.echo_transmit", FT_UINT16, BASE_DEC,
6054 NULL, 0, NULL, HFILL }
6056 { &hf_ieee_802_3_eee_echo_receive,
6057 { "Echo Receive", "lldp.ieee.802_3.eee.echo_receive", FT_UINT16, BASE_DEC,
6058 NULL, 0, NULL, HFILL }
6060 { &hf_ieee_802_1qbg_subtype,
6061 { "IEEE 802.1Qbg Subtype", "lldp.ieee.802_1qbg.subtype", FT_UINT8, BASE_HEX,
6062 VALS(ieee_802_1qbg_subtypes), 0x0, NULL, HFILL }
6064 { &hf_ieee_802_1qbg_evb_support_caps,
6065 { "Supported capabilities", "lldp.ieee.802_1qbg.evb_support_caps", FT_UINT16, BASE_HEX,
6066 NULL, 0x0, NULL, HFILL }
6068 { &hf_ieee_802_1qbg_evb_support_caps_std,
6069 { "Standard bridging (STD)", "lldp.ieee.802_1qbg.evb_support_caps.std", FT_BOOLEAN, 16,
6070 TFS(&tfs_capable_not_capable), EVB_CAPA_STD, NULL, HFILL }
6072 { &hf_ieee_802_1qbg_evb_support_caps_rr,
6073 { "Reflective relay (RR)", "lldp.ieee.802_1qbg.evb_support_caps.rr", FT_BOOLEAN, 16,
6074 TFS(&tfs_capable_not_capable), EVB_CAPA_RR, NULL, HFILL }
6076 { &hf_ieee_802_1qbg_evb_support_caps_rte,
6077 { "Retransmission timer exponent (RTE)", "lldp.ieee.802_1qbg.evb_support_caps.rte", FT_BOOLEAN, 16,
6078 TFS(&tfs_capable_not_capable), EVB_CAPA_RTE, NULL, HFILL }
6080 { &hf_ieee_802_1qbg_evb_support_caps_ecp,
6081 { "Edge control protocol (ECP)", "lldp.ieee.802_1qbg.evb_support_caps.ecp", FT_BOOLEAN, 16,
6082 TFS(&tfs_capable_not_capable), EVB_CAPA_ECP, NULL, HFILL }
6084 { &hf_ieee_802_1qbg_evb_support_caps_vdp,
6085 { "VSI discovery protocol (VDP)", "lldp.ieee.802_1qbg.evb_support_caps.vdp", FT_BOOLEAN, 16,
6086 TFS(&tfs_capable_not_capable), EVB_CAPA_VDP, NULL, HFILL }
6088 { &hf_ieee_802_1qbg_evb_configure_caps,
6089 { "Configured capabilities", "lldp.ieee.802_1qbg.evb_configure_caps", FT_UINT16, BASE_HEX,
6090 NULL, 0x0, NULL, HFILL }
6092 { &hf_ieee_802_1qbg_evb_configure_caps_std,
6093 { "Standard bridging (STD)", "lldp.ieee.802_1qbg.evb_configure_caps.std", FT_BOOLEAN, 16,
6094 TFS(&tfs_capable_not_capable), EVB_CAPA_STD, NULL, HFILL }
6096 { &hf_ieee_802_1qbg_evb_configure_caps_rr,
6097 { "Reflective relay (RR)", "lldp.ieee.802_1qbg.evb_configure_caps.rr", FT_BOOLEAN, 16,
6098 TFS(&tfs_capable_not_capable), EVB_CAPA_RR, NULL, HFILL }
6100 { &hf_ieee_802_1qbg_evb_configure_caps_rte,
6101 { "Retransmission timer exponent (RTE)", "lldp.ieee.802_1qbg.evb_configure_caps.rte", FT_BOOLEAN, 16,
6102 TFS(&tfs_capable_not_capable), EVB_CAPA_RTE, NULL, HFILL }
6104 { &hf_ieee_802_1qbg_evb_configure_caps_ecp,
6105 { "Edge control protocol (ECP)", "lldp.ieee.802_1qbg.evb_configure_caps.ecp", FT_BOOLEAN, 16,
6106 TFS(&tfs_capable_not_capable), EVB_CAPA_ECP, NULL, HFILL }
6108 { &hf_ieee_802_1qbg_evb_configure_caps_vdp,
6109 { "VSI discovery protocol (VDP)", "lldp.ieee.802_1qbg.evb_configure_caps.vdp", FT_BOOLEAN, 16,
6110 TFS(&tfs_capable_not_capable), EVB_CAPA_VDP, NULL, HFILL }
6112 { &hf_ieee_802_1qbg_evb_supported_vsi,
6113 { "Supported No of VSIs", "lldp.ieee.802_1qbg.evb_supported_vsi", FT_UINT16, BASE_DEC,
6114 NULL, 0x0, NULL, HFILL }
6116 { &hf_ieee_802_1qbg_evb_configured_vsi,
6117 { "Configured No of VSIs", "lldp.ieee.802_1qbg.evb_configured_vsi", FT_UINT16, BASE_DEC,
6118 NULL, 0x0, NULL, HFILL }
6120 { &hf_ieee_802_1qbg_evb_retrans_timer,
6121 { "Retransmission timer exponent", "lldp.ieee.802_1qbg.evb_retrans_timer", FT_UINT8, BASE_DEC,
6122 NULL, 0x0, NULL, HFILL }
6124 { &hf_ieee_802_3br_aec,
6125 { "Additional Ethernet Capabilities", "lldp.ieee.802_3br.eac", FT_UINT16, BASE_HEX,
6126 NULL, 0x0, NULL, HFILL }
6128 { &hf_ieee_802_3br_aec_support,
6129 { "Preemption capabilities support", "lldp.ieee.802_3br.aec.support", FT_BOOLEAN, 16,
6130 TFS(&tfs_supported_not_supported), IEEE_802_3BR_AEC_SUPPORT, NULL, HFILL }
6132 { &hf_ieee_802_3br_aec_enable,
6133 { "Preemption capabilities enable", "lldp.ieee.802_3br.aec.enable", FT_BOOLEAN, 16,
6134 TFS(&tfs_enabled_disabled), IEEE_802_3BR_AEC_ENABLE, NULL, HFILL }
6136 { &hf_ieee_802_3br_aec_active,
6137 { "Preemption capabilities active", "lldp.ieee.802_3br.aec.active", FT_BOOLEAN, 16,
6138 TFS(&tfs_active_inactive), IEEE_802_3BR_AEC_ACTIVE, NULL, HFILL }
6140 { &hf_ieee_802_3br_aec_addfragsize,
6141 { "Additional Fragment Size", "lldp.ieee.802_3br.aec.addfragsize", FT_UINT16, BASE_DEC,
6142 NULL, IEEE_802_3BR_AEC_ADDFRAGSIZE, NULL, HFILL }
6144 { &hf_ieee_802_3br_aec_reserved,
6145 { "Reserved", "lldp.ieee.802_3br.aec.reserved", FT_UINT16, BASE_HEX,
6146 NULL, IEEE_802_3BR_AEC_RESERVED, NULL, HFILL }
6148 { &hf_media_tlv_subtype,
6149 { "Media Subtype", "lldp.media.subtype", FT_UINT8, BASE_HEX,
6150 VALS(media_subtypes), 0x0, NULL, HFILL }
6152 { &hf_media_tlv_subtype_caps,
6153 { "Capabilities", "lldp.media.subtype.caps", FT_UINT16, BASE_HEX,
6154 NULL, 0x0, NULL, HFILL }
6156 { &hf_media_tlv_subtype_caps_llpd,
6157 { "LLDP-MED Capabilities", "lldp.media.subtype.caps.llpd", FT_BOOLEAN, 16,
6158 TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_LLDP, NULL, HFILL }
6160 { &hf_media_tlv_subtype_caps_network_policy,
6161 { "Network Policy", "lldp.media.subtype.caps.network_policy", FT_BOOLEAN, 16,
6162 TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_NETWORK_POLICY, NULL, HFILL }
6164 { &hf_media_tlv_subtype_caps_location_id,
6165 { "Location Identification", "lldp.media.subtype.caps.location_id", FT_BOOLEAN, 16,
6166 TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_LOCATION_ID, NULL, HFILL }
6168 { &hf_media_tlv_subtype_caps_mdi_pse,
6169 { "Extended Power via MDI-PSE", "lldp.media.subtype.caps.mdi_pse", FT_BOOLEAN, 16,
6170 TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_MDI_PSE, NULL, HFILL }
6172 { &hf_media_tlv_subtype_caps_mid_pd,
6173 { "Extended Power via MDI-PD", "lldp.media.subtype.caps.mid_pd", FT_BOOLEAN, 16,
6174 TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_MDI_PD, NULL, HFILL }
6176 { &hf_media_tlv_subtype_caps_inventory,
6177 { "Inventory", "lldp.media.subtype.caps.inventory", FT_BOOLEAN, 16,
6178 TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_INVENTORY, NULL, HFILL }
6180 { &hf_media_tlv_subtype_class,
6181 { "Class Type", "lldp.media.subtype.class", FT_UINT8, BASE_DEC,
6182 VALS(media_class_values), 0x0, "Unknown", HFILL }
6184 { &hf_media_application_type,
6185 { "Application Type", "lldp.media.app_type", FT_UINT8, BASE_DEC,
6186 VALS(media_application_type), 0x0, "Unknown", HFILL }
6188 { &hf_media_policy_flag,
6189 { "Policy", "lldp.media.policy_flag", FT_BOOLEAN, 24,
6190 TFS(&tfs_unknown_defined), 0x800000, NULL, HFILL }
6192 { &hf_media_tag_flag,
6193 { "Tagged", "lldp.media.tag_flag", FT_BOOLEAN, 24,
6194 TFS(&tfs_yes_no), 0x400000, NULL, HFILL }
6196 { &hf_media_vlan_id,
6197 { "VLAN Id", "lldp.media.vlan_id", FT_UINT24, BASE_DEC,
6198 NULL, 0x1FFE00, NULL, HFILL }
6200 { &hf_media_l2_prio,
6201 { "L2 Priority", "lldp.media.l2_prio", FT_UINT24, BASE_DEC,
6202 NULL, 0x0001C0, NULL, HFILL }
6204 { &hf_media_dscp,
6205 { "DSCP Priority", "lldp.media.dscp", FT_UINT24, BASE_DEC,
6206 NULL, 0x00003F, NULL, HFILL }
6208 { &hf_media_loc_data_format,
6209 { "Location Data Format", "lldp.media.loc.data_format", FT_UINT8, BASE_DEC,
6210 VALS(location_data_format), 0x0, NULL, HFILL }
6212 { &hf_media_loc_lat_resolution,
6213 { "Latitude Resolution", "lldp.media.loc.lat_resolution", FT_UINT8, BASE_CUSTOM,
6214 CF_FUNC(latitude_or_longitude_resolution), 0xFC, NULL, HFILL }
6216 { &hf_media_loc_lat,
6217 { "Latitude", "lldp.media.loc.latitude", FT_UINT40, BASE_CUSTOM,
6218 CF_FUNC(latitude_base), 0x0, NULL, HFILL }
6220 { &hf_media_loc_long_resolution,
6221 { "Longitude Resolution", "lldp.media.loc.long_resolution", FT_UINT8, BASE_CUSTOM,
6222 CF_FUNC(latitude_or_longitude_resolution), 0xFC, NULL, HFILL }
6224 { &hf_media_loc_long,
6225 { "Longitude", "lldp.media.loc.longitude", FT_UINT40, BASE_CUSTOM,
6226 CF_FUNC(longitude_base), 0x0, NULL, HFILL }
6228 { &hf_media_loc_alt_type,
6229 { "Altitude Type", "lldp.media.loc.alt_type", FT_UINT8, BASE_DEC,
6230 VALS(altitude_type), 0xF0, "Unknown", HFILL }
6232 { &hf_media_loc_alt_resolution,
6233 { "Altitude Resolution", "lldp.media.loc.alt_resolution", FT_UINT16, BASE_CUSTOM,
6234 CF_FUNC(altitude_resolution), 0x0FC0, NULL, HFILL }
6236 { &hf_media_loc_alt,
6237 { "Altitude", "lldp.media.loc.altitude", FT_UINT32, BASE_CUSTOM,
6238 CF_FUNC(altitude_base), 0x0, NULL, HFILL }
6240 { &hf_media_loc_ver,
6241 { "Ver", "lldp.media.loc.ver", FT_UINT8, BASE_DEC,
6242 NULL, 0xC0, NULL, HFILL }
6244 { &hf_media_loc_reserved,
6245 { "Reserved", "lldp.media.loc.reserved", FT_UINT8, BASE_DEC,
6246 NULL, 0x38, NULL, HFILL }
6248 { &hf_media_loc_datum,
6249 { "Datum", "lldp.media.loc.datum", FT_UINT8, BASE_DEC,
6250 VALS(datum_type_values), 0x07, NULL, HFILL }
6252 { &hf_media_civic_lci_length,
6253 { "LCI Length", "lldp.media.civic.length", FT_UINT8, BASE_DEC,
6254 NULL, 0x0, NULL, HFILL }
6256 { &hf_media_civic_what,
6257 { "What", "lldp.media.civic.what", FT_UINT8, BASE_DEC,
6258 VALS(civic_address_what_values), 0x0, "Unknown", HFILL }
6260 { &hf_media_civic_country,
6261 { "Country", "lldp.media.civic.country", FT_STRING, BASE_NONE,
6262 NULL, 0x0, NULL, HFILL }
6264 { &hf_media_civic_addr_type,
6265 { "CA Type", "lldp.media.civic.type", FT_UINT8, BASE_DEC,
6266 VALS(civic_address_type_values), 0x0, "Unknown", HFILL }
6268 { &hf_media_civic_addr_len,
6269 { "CA Length", "lldp.media.civic.addr_length", FT_UINT8, BASE_DEC,
6270 NULL, 0x0, NULL, HFILL }
6272 { &hf_media_civic_addr_value,
6273 { "CA Value", "lldp.media.civic.value", FT_STRINGZ, BASE_NONE,
6274 NULL, 0x0, NULL, HFILL }
6276 { &hf_media_ecs,
6277 { "ELIN", "lldp.media.ecs", FT_STRINGZ, BASE_NONE,
6278 NULL, 0x0, NULL, HFILL }
6280 { &hf_media_power_type,
6281 { "Power Type", "lldp.media.power.type", FT_UINT8, BASE_DEC,
6282 VALS(media_power_type), 0xC0, "Unknown", HFILL }
6284 { &hf_media_power_source,
6285 { "Power Source", "lldp.media.power.source", FT_UINT8, BASE_DEC,
6286 NULL, 0x30, NULL, HFILL }
6288 { &hf_media_power_priority,
6289 { "Power Priority", "lldp.media.power.prio", FT_UINT8, BASE_DEC,
6290 VALS(media_power_priority), 0x0F, "Reserved", HFILL }
6292 { &hf_media_power_value,
6293 { "Power Value", "lldp.media.power.value", FT_UINT16, BASE_CUSTOM,
6294 CF_FUNC(media_power_base), 0x0, NULL, HFILL }
6296 { &hf_media_hardware,
6297 { "Hardware Revision", "lldp.media.hardware", FT_STRINGZPAD, BASE_NONE,
6298 NULL, 0x0, NULL, HFILL }
6300 { &hf_media_firmware,
6301 { "Firmware Revision", "lldp.media.firmware", FT_STRINGZPAD, BASE_NONE,
6302 NULL, 0x0, NULL, HFILL }
6304 { &hf_media_software,
6305 { "Software Revision", "lldp.media.software", FT_STRINGZPAD, BASE_NONE,
6306 NULL, 0x0, NULL, HFILL }
6308 { &hf_media_sn,
6309 { "Serial Number", "lldp.media.sn", FT_STRINGZPAD, BASE_NONE,
6310 NULL, 0x0, NULL, HFILL }
6312 { &hf_media_manufacturer,
6313 { "Manufacturer Name", "lldp.media.manufacturer", FT_STRINGZPAD, BASE_NONE,
6314 NULL, 0x0, NULL, HFILL }
6316 { &hf_media_model,
6317 { "Model Name", "lldp.media.model", FT_STRINGZPAD, BASE_NONE,
6318 NULL, 0x0, NULL, HFILL }
6320 { &hf_media_asset,
6321 { "Asset ID", "lldp.media.asset", FT_STRINGZPAD, BASE_NONE,
6322 NULL, 0x0, NULL, HFILL }
6324 { &hf_profinet_tlv_subtype,
6325 { "Subtype", "lldp.profinet.subtype", FT_UINT8, BASE_HEX,
6326 VALS(profinet_subtypes), 0x0, "PROFINET Subtype", HFILL }
6328 { &hf_profinet_port_rx_delay_local,
6329 { "Port RX Delay Local", "lldp.profinet.port_rx_delay_local", FT_UINT32, BASE_DEC,
6330 NULL, 0x0, NULL, HFILL }
6332 { &hf_profinet_port_rx_delay_remote,
6333 { "Port RX Delay Remote", "lldp.profinet.port_rx_delay_remote", FT_UINT32, BASE_DEC,
6334 NULL, 0x0, NULL, HFILL }
6336 { &hf_profinet_port_tx_delay_local,
6337 { "Port TX Delay Local", "lldp.profinet.port_tx_delay_local", FT_UINT32, BASE_DEC,
6338 NULL, 0x0, NULL, HFILL }
6340 { &hf_profinet_port_tx_delay_remote,
6341 { "Port TX Delay Remote", "lldp.profinet.port_tx_delay_remote", FT_UINT32, BASE_DEC,
6342 NULL, 0x0, NULL, HFILL }
6344 { &hf_profinet_cable_delay_local,
6345 { "Port Cable Delay Local", "lldp.profinet.cable_delay_local", FT_UINT32, BASE_DEC,
6346 NULL, 0x0, NULL, HFILL }
6348 { &hf_profinet_class2_port_status,
6349 { "RTClass2 Port Status", "lldp.profinet.rtc2_port_status", FT_UINT16, BASE_HEX,
6350 VALS(profinet_port2_status_vals), 0x0, NULL, HFILL }
6352 { &hf_profinet_class3_port_status,
6353 { "RTClass3 Port Status", "lldp.profinet.rtc3_port_status", FT_UINT16, BASE_HEX,
6354 VALS(profinet_port3_status_vals), 0x07, NULL, HFILL }
6356 /* class3_port state got some new BITs */
6357 { &hf_profinet_class3_port_status_Fragmentation,
6358 { "RTClass3_PortStatus.Fragmentation", "lldp.profinet.rtc3_port_status.fragmentation", FT_BOOLEAN, 16,
6359 TFS(&tfs_on_off), 0x1000, NULL, HFILL }
6361 { &hf_profinet_class3_port_status_reserved,
6362 { "RTClass3_PortStatus.reserved", "lldp.profinet.rtc3_port_status.reserved", FT_UINT16, BASE_HEX,
6363 NULL, 0x0FF8, "reserved", HFILL }
6365 { &hf_profinet_class3_port_status_PreambleLength,
6366 { "RTClass3_PortStatus.PreambleLength", "lldp.profinet.rtc3_port_status.preambleLength", FT_UINT16, BASE_HEX,
6367 VALS(profinet_port3_status_PreambleLength), 0x2000, NULL, HFILL }
6369 { &hf_profinet_mrp_domain_uuid,
6370 { "MRP DomainUUID", "lldp.profinet.mrp_domain_uuid", FT_GUID, BASE_NONE,
6371 NULL, 0x0, NULL, HFILL }
6373 { &hf_profinet_tsn_domain_uuid,
6374 { "TSN DomainUUID", "lldp.profinet.tsn_domain_uuid", FT_GUID, BASE_NONE,
6375 NULL, 0x0, NULL, HFILL }
6377 { &hf_profinet_tsn_nme_management_addr,
6378 { "TSN NME Management Address", "lldp.profinet.tsn_nme_management_addr", FT_BYTES, BASE_NONE,
6379 NULL, 0x0, NULL, HFILL }
6381 { &hf_profinet_tsn_nme_management_addr_str_length,
6382 { "TSN NME Management Address String Length", "lldp.profinet.tsn_nme_management_addr_str_length", FT_UINT8, BASE_HEX,
6383 NULL, 0x0, NULL, HFILL }
6385 { &hf_profinet_tsn_nme_management_addr_subtype,
6386 { "TSN NME Management Address Subtype", "lldp.profinet.tsn_nme_management_addr_subtype", FT_UINT8, BASE_HEX,
6387 NULL, 0x0, NULL, HFILL }
6389 { &hf_profinet_tsn_nme_name_uuid,
6390 { "TSN NME Name UUID", "lldp.profinet.tsn_nme_name_uuid", FT_GUID, BASE_NONE,
6391 NULL, 0x0, NULL, HFILL }
6393 { &hf_profinet_tsn_nme_parameter_uuid,
6394 { "TSN NME Parameter UUID", "lldp.profinet.tsn_nme_parameter_uuid", FT_GUID, BASE_NONE,
6395 NULL, 0x0, NULL, HFILL }
6397 { &hf_profinet_time_domain_number,
6398 { "Time Domain Number", "lldp.profinet.time_domain_number", FT_UINT16, BASE_HEX,
6399 VALS(profinet_time_domain_number_vals), 0x0, NULL, HFILL }
6401 { &hf_profinet_time_domain_uuid,
6402 { "Time Domain UUID", "lldp.profinet.time_domain_uuid", FT_GUID, BASE_NONE,
6403 NULL, 0x0, NULL, HFILL }
6405 { &hf_profinet_time_domain_master_identity,
6406 { "Time Domain Master Identity", "lldp.profinet.time_domain_master_identity", FT_BYTES, BASE_NONE,
6407 0x0, 0x0, NULL, HFILL }
6409 { &hf_profinet_mrrt_port_status,
6410 { "MRRT PortStatus", "lldp.profinet.mrrt_port_status", FT_UINT16, BASE_HEX,
6411 VALS(profinet_mrrt_port_status_vals), 0x0, NULL, HFILL }
6413 { &hf_profinet_cm_mac,
6414 { "CMMacAdd", "lldp.profinet.cm_mac_add", FT_ETHER, BASE_NONE,
6415 NULL, 0x0, "CMResponderMacAdd or CMInitiatorMacAdd", HFILL }
6417 { &hf_profinet_master_source_address,
6418 { "MasterSourceAddress", "lldp.profinet.master_source_address", FT_ETHER, BASE_NONE,
6419 NULL, 0x0, NULL, HFILL }
6421 { &hf_profinet_subdomain_uuid,
6422 { "SubdomainUUID", "lldp.profinet.subdomain_uuid", FT_GUID, BASE_NONE,
6423 NULL, 0x0, NULL, HFILL }
6425 { &hf_profinet_ir_data_uuid,
6426 { "IRDataUUID", "lldp.profinet.ir_data_uuid", FT_GUID, BASE_NONE,
6427 NULL, 0x0, NULL, HFILL }
6429 { &hf_profinet_length_of_period_valid,
6430 { "LengthOfPeriod.Valid", "lldp.profinet.length_of_period_valid", FT_UINT32, BASE_DEC,
6431 NULL, 0x80000000, "Length field is valid/invalid", HFILL }
6433 { &hf_profinet_length_of_period_length,
6434 { "LengthOfPeriod.Length", "lldp.profinet.length_of_period_length", FT_UINT32, BASE_DEC,
6435 NULL, 0x7FFFFFFF, "Duration of a cycle in nanoseconds", HFILL }
6437 { &hf_profinet_red_period_begin_valid,
6438 { "RedPeriodBegin.Valid", "lldp.profinet.red_period_begin_valid", FT_UINT32, BASE_DEC,
6439 NULL, 0x80000000, "Offset field is valid/invalid", HFILL }
6441 { &hf_profinet_red_period_begin_offset,
6442 { "RedPeriodBegin.Offset", "lldp.profinet.red_period_begin_offset", FT_UINT32, BASE_DEC,
6443 NULL, 0x7FFFFFFF, "RT_CLASS_3 period, offset to cycle begin in nanoseconds", HFILL }
6445 { &hf_profinet_orange_period_begin_valid,
6446 { "OrangePeriodBegin.Valid", "lldp.profinet.orange_period_begin_valid", FT_UINT32, BASE_DEC,
6447 NULL, 0x80000000, "Offset field is valid/invalid", HFILL }
6449 { &hf_profinet_orange_period_begin_offset,
6450 { "OrangePeriodBegin.Offset","lldp.profinet.orange_period_begin_offset", FT_UINT32, BASE_DEC,
6451 NULL, 0x7FFFFFFF, "RT_CLASS_2 period, offset to cycle begin in nanoseconds", HFILL }
6453 { &hf_profinet_green_period_begin_valid,
6454 { "GreenPeriodBegin.Valid", "lldp.profinet.green_period_begin_valid", FT_UINT32, BASE_DEC,
6455 NULL, 0x80000000, "Offset field is valid/invalid", HFILL }
6457 { &hf_profinet_green_period_begin_offset,
6458 { "GreenPeriodBegin.Offset", "lldp.profinet.green_period_begin_offset", FT_UINT32, BASE_DEC,
6459 NULL, 0x7FFFFFFF, "Unrestricted period, offset to cycle begin in nanoseconds", HFILL }
6461 /* Cisco generic */
6462 { &hf_cisco_subtype,
6463 { "Cisco Subtype", "lldp.cisco.subtype", FT_UINT8, BASE_HEX,
6464 VALS(cisco_subtypes), 0x0, NULL, HFILL }
6466 { &hf_cisco_upoe,
6467 { "UPOE Capabilities", "lldp.cisco.upoe", FT_UINT8, BASE_HEX,
6468 NULL, 0x0, "PSE/PD Capabilities", HFILL }
6470 { &hf_cisco_upoe_supported,
6471 { "UPOE Supported", "lldp.cisco.upoe.supported", FT_BOOLEAN, 8,
6472 TFS(&tfs_yes_no), 0x01, "UPOE (4-pair POE) Supported", HFILL }
6474 { &hf_cisco_upoe_altb_detection,
6475 { "ALT-B Detection required", "lldp.cisco.upoe.altb_detection_required", FT_BOOLEAN, 8,
6476 TFS(&tfs_yes_no), 0x02, "ALT-B pair Detection/Classification Required", HFILL }
6478 { &hf_cisco_upoe_req_spare_pair,
6479 { "PD Request Spare Pair PoE", "lldp.cisco.upoe.pd_altb_desired", FT_BOOLEAN, 8,
6480 TFS(&tfs_desired_not_desired), 0x04, "PD ALT-B Pair Desired", HFILL }
6482 { &hf_cisco_upoe_pse_spare_pair_oper,
6483 { "PSE Spare Pair PoE", "lldp.cisco.upoe.pse_altb_oper", FT_BOOLEAN, 8,
6484 TFS(&tfs_enabled_disabled), 0x08, "PSE ALT-B Pair Operational State", HFILL }
6486 /* Cisco ACI */
6487 { &hf_cisco_aci_portstate,
6488 { "Port State", "lldp.cisco.portstate", FT_UINT8, BASE_NONE,
6489 VALS(cisco_portstate_vals), 0x0, NULL, HFILL }
6491 { &hf_cisco_aci_noderole,
6492 { "Node Role", "lldp.cisco.noderole", FT_UINT8, BASE_DEC,
6493 VALS(cisco_noderole_vals), 0x0, NULL, HFILL }
6495 { &hf_cisco_aci_nodeid,
6496 { "Node ID", "lldp.cisco.nodeid", FT_UINT32, BASE_DEC,
6497 NULL, 0x0, NULL, HFILL }
6499 { &hf_cisco_aci_spinelevel,
6500 { "Spine Level", "lldp.cisco.spinelevel", FT_UINT8, BASE_DEC,
6501 NULL, 0x0, NULL, HFILL }
6503 { &hf_cisco_aci_podid,
6504 { "Pod ID", "lldp.cisco.podid", FT_UINT16, BASE_DEC,
6505 NULL, 0x0, NULL, HFILL }
6507 { &hf_cisco_aci_fabricname,
6508 { "Fabric Name", "lldp.cisco.fabricname", FT_STRING, BASE_NONE,
6509 NULL, 0x0, NULL, HFILL }
6511 { &hf_cisco_aci_apiclist,
6512 { "Appliance Vector", "lldp.cisco.apiclist", FT_BYTES, BASE_NONE,
6513 NULL, 0x0, NULL, HFILL }
6515 { &hf_cisco_aci_apicid,
6516 { "APIC ID", "lldp.cisco.apicid", FT_UINT8, BASE_DEC,
6517 NULL, 0x0, NULL, HFILL }
6519 { &hf_cisco_aci_apicipv4,
6520 { "APIC IPv4", "lldp.cisco.apicipv4", FT_IPv4, BASE_NONE,
6521 NULL, 0x0, NULL, HFILL }
6523 { &hf_cisco_aci_apicuuid,
6524 { "APIC UUID", "lldp.cisco.apicuuid", FT_STRING, BASE_NONE,
6525 NULL, 0x0, NULL, HFILL }
6527 { &hf_cisco_aci_nodeip,
6528 { "Node IP", "lldp.cisco.nodeip", FT_IPv4, BASE_NONE,
6529 NULL, 0x0, NULL, HFILL }
6531 { &hf_cisco_aci_portrole,
6532 { "Port Role", "lldp.cisco.portrole", FT_UINT8, BASE_NONE,
6533 VALS(cisco_portrole_vals), 0x0, NULL, HFILL }
6535 { &hf_cisco_aci_version,
6536 { "Version", "lldp.cisco.version", FT_STRING, BASE_NONE,
6537 NULL, 0x0, NULL, HFILL }
6539 { &hf_cisco_aci_fabricvlan,
6540 { "Fabric VLAN", "lldp.cisco.fabricvlan", FT_UINT16, BASE_DEC,
6541 NULL, 0x0, NULL, HFILL }
6543 { &hf_cisco_aci_serialno,
6544 { "Serial No", "lldp.cisco.serialno", FT_STRING, BASE_NONE,
6545 NULL, 0x0, NULL, HFILL }
6547 { &hf_cisco_aci_model,
6548 { "Model", "lldp.cisco.model", FT_STRING, BASE_NONE,
6549 NULL, 0x0, NULL, HFILL }
6551 { &hf_cisco_aci_nodename,
6552 { "Node Name", "lldp.cisco.nodename", FT_STRING, BASE_NONE,
6553 NULL, 0x0, NULL, HFILL }
6555 { &hf_cisco_aci_portmode,
6556 { "Port Mode", "lldp.cisco.portmode", FT_UINT8, BASE_NONE,
6557 VALS(cisco_portmode_vals), 0x0, NULL, HFILL }
6559 { &hf_cisco_aci_authcookie,
6560 { "Authentication Cookie", "lldp.cisco.authcookie", FT_BYTES, BASE_NONE,
6561 NULL, 0x0, NULL, HFILL }
6563 { &hf_cisco_aci_apicmode,
6564 { "APIC Mode", "lldp.cisco.apicmode", FT_UINT8, BASE_DEC,
6565 VALS(cisco_apicmode_vals), 0x0, NULL, HFILL }
6567 { &hf_cisco_aci_fabricid,
6568 { "Fabric ID", "lldp.cisco.fabricd", FT_UINT16, BASE_DEC,
6569 NULL, 0x0, NULL, HFILL }
6571 /* Hytec */
6572 { &hf_hytec_tlv_subtype,
6573 { "Hytec Subtype", "lldp.hytec.tlv_subtype", FT_UINT8, BASE_DEC,
6574 VALS(hytec_subtypes), 0x0, NULL, HFILL }
6576 { &hf_hytec_group,
6577 { "Group", "lldp.hytec.group", FT_UINT8, BASE_DEC,
6578 NULL, HYTEC_GROUP_MASK, NULL, HFILL }
6580 { &hf_hytec_identifier,
6581 { "Identifier", "lldp.hytec.identifier", FT_UINT8, BASE_DEC,
6582 NULL, HYTEC_IDENTIFIER_MASK, NULL, HFILL }
6584 { &hf_hytec_transceiver_vendor_product_revision,
6585 { HYTEC_TID__VENDOR_PRODUCT_REVISION_STR, "lldp.hytec.transceiver_vendor_product_revision", FT_STRING, BASE_NONE,
6586 NULL, 0x0, NULL, HFILL }
6588 { &hf_hytec_single_mode,
6589 { HYTEC_TBD__SINGLE_MODE_STR, "lldp.hytec.single_mode", FT_UINT32, BASE_DEC|BASE_UNIT_STRING,
6590 UNS(&units_m), 0x0, NULL, HFILL}
6592 { &hf_hytec_multi_mode_50,
6593 { HYTEC_TBD__MULTI_MODE_50_STR, "lldp.hytec.multi_mode_50", FT_UINT32, BASE_DEC|BASE_UNIT_STRING,
6594 UNS(&units_m), 0x0, NULL, HFILL}
6596 { &hf_hytec_multi_mode_62_5,
6597 { HYTEC_TBD__MULTI_MODE_62_5_STR, "lldp.hytec.multi_mode_62_5", FT_UINT32, BASE_DEC|BASE_UNIT_STRING,
6598 UNS(&units_m), 0x0, NULL, HFILL}
6600 { &hf_hytec_tx_current_output_power,
6601 { HYTEC_MD__TX_CURRENT_OUTPUT_POWER_STR, "lldp.hytec.tx_current_output_power", FT_FLOAT, BASE_NONE|BASE_UNIT_STRING,
6602 UNS(&units_microwatts), 0x0, NULL, HFILL}
6604 { &hf_hytec_rx_current_input_power,
6605 { HYTEC_MD__RX_CURRENT_INPUT_POWER_STR, "lldp.hytec.rx_current_input_power", FT_FLOAT, BASE_NONE|BASE_UNIT_STRING,
6606 UNS(&units_microwatts), 0x0, NULL, HFILL}
6608 { &hf_hytec_rx_input_snr,
6609 { HYTEC_MD__RX_INPUT_SNR_STR, "lldp.hytec.rx_input_snr", FT_FLOAT, BASE_NONE|BASE_UNIT_STRING,
6610 UNS(&units_decibels), 0x0, NULL, HFILL}
6612 { &hf_hytec_lineloss,
6613 { HYTEC_MD__LINELOSS_STR, "lldp.hytec.lineloss", FT_FLOAT, BASE_NONE|BASE_UNIT_STRING,
6614 UNS(&units_decibels), 0x0, NULL, HFILL}
6616 { &hf_hytec_mac_trace_request,
6617 { HYTEC_MC__MAC_TRACE_REQUEST_STR, "lldp.hytec.mac_trace_request", FT_NONE, BASE_NONE,
6618 NULL, 0x0, NULL, HFILL}
6620 { &hf_hytec_trace_mac_address,
6621 { "Trace MAC address", "lldp.hytec.trace_mac_address", FT_ETHER, BASE_NONE,
6622 NULL, 0x0, NULL, HFILL}
6624 { &hf_hytec_request_mac_address,
6625 { "Requester's MAC address", "lldp.hytec.requesters_mac_address", FT_ETHER, BASE_NONE,
6626 NULL, 0x0, NULL, HFILL}
6628 { &hf_hytec_maximum_depth,
6629 { "Maximum depth", "lldp.hytec.maximum_depth", FT_UINT8, BASE_DEC,
6630 NULL, 0x0, NULL, HFILL}
6632 { &hf_hytec_mac_trace_reply,
6633 { HYTEC_MC__MAC_TRACE_REPLY_STR, "lldp.hytec.mac_trace_reply", FT_NONE, BASE_NONE,
6634 NULL, 0x0, NULL, HFILL}
6636 { &hf_hytec_answering_mac_address,
6637 { "Answering MAC address", "lldp.hytec.answering_mac_address", FT_ETHER, BASE_NONE,
6638 NULL, 0x0, NULL, HFILL}
6640 { &hf_hytec_actual_depth,
6641 { "Actual depth", "lldp.hytec.actual_depth", FT_UINT8, BASE_DEC,
6642 NULL, 0x0, NULL, HFILL}
6644 { &hf_hytec_name_of_replying_device,
6645 { HYTEC_MC__NAME_OF_REPLYING_DEVICE_STR, "lldp.hytec.name_of_replying_device", FT_STRING, BASE_NONE,
6646 NULL, 0x0, NULL, HFILL}
6648 { &hf_hytec_outgoing_port_name,
6649 { HYTEC_MC__OUTGOING_PORT_NAME_STR, "lldp.hytec.outgoing_port_name", FT_STRING, BASE_NONE,
6650 NULL, 0x0, NULL, HFILL}
6652 { &hf_hytec_ipv4_address_of_replying_device,
6653 { HYTEC_MC__IPV4_ADDRESS_OF_REPLYING_DEVICE_STR, "lldp.hytec.ipv4_address_of_replying_device", FT_IPv4, BASE_NONE,
6654 NULL, 0x0, NULL, HFILL}
6656 { &hf_hytec_end_of_trace,
6657 { HYTEC_MC__END_OF_TRACE_STR, "lldp.hytec.end_of_trace", FT_UINT8, BASE_HEX,
6658 NULL, 0x0, NULL, HFILL}
6660 { &hf_hytec_ipv6_address_of_replying_device,
6661 { HYTEC_MC__IPV6_ADDRESS_OF_REPLYING_DEVICE_STR, "lldp.hytec.ipv6_address_of_replying_device", FT_IPv6, BASE_NONE,
6662 NULL, 0x0, NULL, HFILL}
6664 { &hf_hytec_incoming_port_name,
6665 { HYTEC_MC__INCOMING_PORT_NAME_STR, "lldp.hytec.incoming_port_name", FT_STRING, BASE_NONE,
6666 NULL, 0x0, NULL, HFILL}
6668 { &hf_hytec_trace_identifier,
6669 { HYTEC_MC__TRACE_IDENTIFIER_STR, "lldp.hytec.trace_identifier", FT_UINT32, BASE_HEX,
6670 NULL, 0x0, NULL, HFILL}
6672 { &hf_hytec_invalid_object_data,
6673 { "Invalid object data", "lldp.hytec.invalid_object_data", FT_BYTES, BASE_NONE,
6674 NULL, 0x0, NULL, HFILL }
6676 { &hf_hytec_unknown_identifier_content,
6677 { "Unknown Identifier Content","lldp.hytec.unknown_identifier_content", FT_BYTES, BASE_NONE,
6678 NULL, 0x0, NULL, HFILL }
6680 { &hf_avaya_subtype,
6681 { "Avaya Subtype", "lldp.avaya.subtype", FT_UINT8, BASE_HEX,
6682 VALS(avaya_subtypes), 0x0, NULL, HFILL }
6684 { &hf_avaya_poe,
6685 { "PoE Conservation Level Support", "lldp.avaya.poe", FT_BYTES, BASE_NONE,
6686 NULL, 0x0, NULL, HFILL }
6688 { &hf_avaya_call_server,
6689 { "Call Server IP Address", "lldp.avaya.callserver", FT_IPv4, BASE_NONE,
6690 NULL, 0x0, NULL, HFILL }
6692 { &hf_avaya_cna_server,
6693 { "CNA Server IP Address", "lldp.avaya.cnaserver", FT_IPv4, BASE_NONE,
6694 NULL, 0x0, NULL, HFILL }
6696 { &hf_avaya_file_server,
6697 { "File Server", "lldp.avaya.fileserver", FT_IPv4, BASE_NONE,
6698 NULL, 0x0, NULL, HFILL }
6700 { &hf_avaya_dot1q,
6701 { "802.1Q Framing", "lldp.avaya.dot1q", FT_UINT8, BASE_HEX,
6702 VALS(avaya_dot1q_subtypes), 0x0, NULL, HFILL }
6704 { &hf_avaya_ipphone,
6705 { "IP Phone Addresses", "lldp.avaya.ipphone", FT_BYTES, BASE_NONE,
6706 NULL, 0x0, NULL, HFILL }
6708 { &hf_avaya_ipphone_ip,
6709 { "IP Address", "lldp.avaya.ipphone.ip", FT_IPv4, BASE_NONE,
6710 NULL, 0x0, NULL, HFILL }
6712 { &hf_avaya_ipphone_mask,
6713 { "Subnet Mask", "lldp.avaya.ipphone.mask", FT_IPv4, BASE_NONE,
6714 NULL, 0x0, NULL, HFILL }
6716 { &hf_avaya_ipphone_gateway,
6717 { "Gateway IP", "lldp.avaya.ipphone.gateway", FT_IPv4, BASE_NONE,
6718 NULL, 0x0, NULL, HFILL }
6720 { &hf_iana_subtype,
6721 { "IANA Subtype", "lldp.iana.subtype", FT_UINT8, BASE_HEX,
6722 VALS(iana_subtypes), 0x0, NULL, HFILL }
6724 { &hf_iana_mudurl,
6725 { "Manufacturer Usage Description URL", "lldp.iana.mudurl", FT_STRING, BASE_NONE,
6726 NULL, 0x0, NULL, HFILL }
6728 { &hf_onos_subtype,
6729 { "ONOS Subtype", "lldp.onos.subtype", FT_UINT8, BASE_HEX,
6730 VALS(onos_subtypes), 0x0, NULL, HFILL }
6732 { &hf_onos_chassis,
6733 { "Chassis", "lldp.onos.chassis", FT_STRING, BASE_NONE,
6734 NULL, 0x0, NULL, HFILL }
6736 { &hf_onos_port,
6737 { "Port", "lldp.onos.port", FT_STRING, BASE_NONE,
6738 NULL, 0x0, NULL, HFILL }
6740 { &hf_onos_ttl,
6741 { "ttl", "lldp.onos.ttl", FT_UINT32, BASE_DEC,
6742 NULL, 0x0, NULL, HFILL }
6744 { &hf_unknown_subtype,
6745 { "Unknown Subtype","lldp.unknown_subtype", FT_UINT8, BASE_DEC,
6746 NULL, 0x0, NULL, HFILL }
6748 { &hf_unknown_subtype_content,
6749 { "Unknown Subtype Content","lldp.unknown_subtype.content", FT_BYTES, BASE_NONE,
6750 NULL, 0x0, NULL, HFILL }
6752 { &hf_subtype_content_remaining,
6753 { "Subtype Unknown Trailing Bytes","lldp.subtype.content_remaining", FT_BYTES, BASE_NONE,
6754 NULL, 0x0, NULL, HFILL }
6756 { &hf_ex_avaya_tlv_subtype,
6757 { "Subtype", "lldp.extreme_avaya_ap.subtype", FT_UINT8, BASE_DEC,
6758 VALS(ex_avaya_subtypes), 0x0, NULL, HFILL }
6760 { &hf_ex_avaya_hmac_shi,
6761 { "HMAC-SHA Digest", "lldp.extreme_avaya_ap.hmac_sha_digest", FT_BYTES, BASE_NONE,
6762 NULL, 0x0, NULL, HFILL }
6764 { &hf_ex_avaya_element_type,
6765 { "Element Type", "lldp.extreme_avaya_ap.element_type", FT_UINT24, BASE_DEC,
6766 NULL, 0xfc0000, NULL, HFILL }
6768 { &hf_ex_avaya_state,
6769 { "State", "lldp.extreme_avaya_ap.state", FT_UINT24, BASE_DEC,
6770 NULL, 0x03f000, NULL, HFILL }
6772 { &hf_ex_avaya_mgnt_vlan,
6773 { "Mgmt VLAN", "lldp.extreme_avaya_ap.mgnt_vlan", FT_UINT24, BASE_DEC,
6774 NULL, 0x000fff, NULL, HFILL }
6776 { &hf_ex_avaya_vlan,
6777 { "VLAN", "lldp.extreme_avaya_ap.vlan", FT_UINT16, BASE_DEC,
6778 NULL, 0x0fff, NULL, HFILL }
6780 { &hf_ex_avaya_rsvd,
6781 { "Reserved", "lldp.extreme_avaya_ap.rsvd", FT_UINT8, BASE_DEC,
6782 NULL, 0x0, NULL, HFILL }
6784 { &hf_ex_avaya_system_id,
6785 { "System ID", "lldp.extreme_avaya_ap.system_id", FT_BYTES, SEP_COLON,
6786 NULL, 0x0, NULL, HFILL }
6788 { &hf_ex_avaya_status,
6789 { "Assignment Status", "lldp.extreme_avaya_ap.status", FT_UINT16, BASE_DEC,
6790 NULL, 0xf000, NULL, HFILL }
6792 { &hf_ex_avaya_i_sid,
6793 { "I-SID", "lldp.extreme_avaya_ap.i_sid", FT_UINT24, BASE_DEC,
6794 NULL, 0x0, NULL, HFILL }
6796 { &hf_ex_avaya2_tlv_subtype,
6797 { "Subtype", "lldp.extreme_avaya.fabric.subtype", FT_UINT8, BASE_DEC,
6798 VALS(ex_avaya2_subtypes), 0x0, NULL, HFILL }
6800 { &hf_ex_avaya2_fabric_connect,
6801 { "FC Capability", "lldp.extreme_avaya.fabric.fabric_connect", FT_BOOLEAN, BASE_NONE,
6802 TFS(&tfs_enabled_disabled), 0x0, "Fabric Connect aka auto-sense", HFILL }
6804 { &hf_ex_avaya2_fabric_numbvlans,
6805 { "Number B-VLANs", "lldp.extreme_avaya.fabric.numbvlans", FT_UINT8, BASE_DEC,
6806 NULL, 0x0, NULL, HFILL }
6808 { &hf_ex_avaya2_fabric_bvlanid,
6809 { "B-VLAN ID", "lldp.extreme_avaya.fabric.bvlanid", FT_UINT16, BASE_DEC,
6810 NULL, 0x0, NULL, HFILL }
6812 { &hf_ex_avaya2_fabric_sysidlength,
6813 { "SysID Length", "lldp.extreme_avaya.fabric.sysidlength", FT_UINT8, BASE_DEC,
6814 NULL, 0x0, NULL, HFILL }
6816 { &hf_ex_avaya2_fabric_sysid,
6817 { "System ID", "lldp.extreme_avaya.fabric.sysid", FT_SYSTEM_ID, BASE_NONE,
6818 NULL, 0x0, NULL, HFILL }
6822 /* Setup protocol subtree array */
6823 static int *ett[] = {
6824 &ett_lldp,
6825 &ett_chassis_id,
6826 &ett_port_id,
6827 &ett_time_to_live,
6828 &ett_end_of_lldpdu,
6829 &ett_port_description,
6830 &ett_system_name,
6831 &ett_system_desc,
6832 &ett_system_cap,
6833 &ett_system_cap_summary,
6834 &ett_system_cap_enabled,
6835 &ett_management_address,
6836 &ett_unknown_tlv,
6837 &ett_org_spc_tlv,
6838 &ett_org_spc_def,
6839 &ett_org_spc_dcbx_cin,
6840 &ett_org_spc_dcbx_cee,
6841 &ett_org_spc_dcbx_cee_1,
6842 &ett_org_spc_dcbx_cee_2,
6843 &ett_org_spc_dcbx_cee_3,
6844 &ett_org_spc_dcbx_cee_4,
6845 &ett_org_spc_dcbx_cin_6,
6846 &ett_org_spc_dcbx_cee_app,
6847 &ett_org_spc_ieee_802_1_1,
6848 &ett_org_spc_ieee_802_1_2,
6849 &ett_org_spc_ieee_802_1_3,
6850 &ett_org_spc_ieee_802_1_4,
6851 &ett_org_spc_ieee_802_1_8,
6852 &ett_org_spc_ieee_802_1_9,
6853 &ett_org_spc_ieee_802_1_a,
6854 &ett_org_spc_ieee_802_1_b,
6855 &ett_org_spc_ieee_802_1_c,
6856 &ett_org_spc_ieee_dcbx_app,
6857 &ett_org_spc_ieee_802_3_1,
6858 &ett_org_spc_ieee_802_3_2,
6859 &ett_org_spc_ieee_802_3_3,
6860 &ett_org_spc_ieee_802_3_4,
6861 &ett_org_spc_ieee_802_3_5,
6862 &ett_org_spc_ieee_802_3_7,
6863 &ett_org_spc_media_1,
6864 &ett_org_spc_media_2,
6865 &ett_org_spc_media_3,
6866 &ett_org_spc_media_4,
6867 &ett_org_spc_media_5,
6868 &ett_org_spc_media_6,
6869 &ett_org_spc_media_7,
6870 &ett_org_spc_media_8,
6871 &ett_org_spc_media_9,
6872 &ett_org_spc_media_10,
6873 &ett_org_spc_media_11,
6874 &ett_org_spc_ProfinetSubTypes_1,
6875 &ett_org_spc_ProfinetSubTypes_2,
6876 &ett_org_spc_ProfinetSubTypes_3,
6877 &ett_org_spc_ProfinetSubTypes_4,
6878 &ett_org_spc_ProfinetSubTypes_5,
6879 &ett_org_spc_ProfinetSubTypes_6,
6880 &ett_port_vlan_flags,
6881 &ett_802_3_flags,
6882 &ett_802_3_autoneg_advertised,
6883 &ett_802_3_power,
6884 &ett_802_3_bt_power,
6885 &ett_802_3_bt_system_setup,
6886 &ett_802_3_bt_autoclass,
6887 &ett_802_3_bt_power_down,
6888 &ett_802_3_aggregation,
6889 &ett_802_1_aggregation,
6890 &ett_802_1qbg_capabilities_flags,
6891 &ett_802_3br_capabilities_flags,
6892 &ett_media_capabilities,
6893 &ett_profinet_period,
6894 &ett_cisco_upoe_tlv,
6895 &ett_avaya_ipphone_tlv,
6896 &ett_org_spc_hytec_subtype_transceiver,
6897 &ett_org_spc_hytec_subtype_trace,
6898 &ett_org_spc_hytec_trace_request,
6899 &ett_org_spc_hytec_trace_reply,
6900 &ett_ex_avayaSubTypes_11,
6901 &ett_ex_avayaSubTypes_12,
6902 &ett_ex_avaya2SubTypes_4
6905 static ei_register_info ei[] = {
6906 { &ei_lldp_bad_length, { "lldp.incorrect_length", PI_MALFORMED, PI_WARN, "Invalid length, too short", EXPFILL }},
6907 { &ei_lldp_bad_length_excess, { "lldp.excess_length", PI_MALFORMED, PI_WARN, "Invalid length, greater than expected", EXPFILL }},
6908 { &ei_lldp_shutdown_excess_tlv, { "lldp.excess_tlv", PI_MALFORMED, PI_WARN, "Excess TLV in Shutdown PDU", EXPFILL }},
6909 { &ei_lldp_bad_type, { "lldp.bad_type", PI_MALFORMED, PI_WARN, "Incorrect type", EXPFILL }},
6910 { &ei_lldp_tlv_deprecated, { "lldp.tlv_deprecated", PI_PROTOCOL, PI_WARN, "TLV has been deprecated", EXPFILL }},
6913 static const enum_val_t column_info_options[] = {
6914 { "default_column_info", "Default Column Info", DEFAULT_COLUMN_INFO },
6915 { "profinet_special_column_info", "PROFINET Special Column Info", PROFINET_SPECIAL_COLUMN_INFO },
6916 { NULL, NULL, 0 }
6919 /* Register the protocol name and description */
6920 proto_lldp = proto_register_protocol("Link Layer Discovery Protocol", "LLDP", "lldp");
6921 lldp_handle = register_dissector("lldp", dissect_lldp, proto_lldp);
6923 /* Register preferences */
6924 lldp_module = prefs_register_protocol(proto_lldp, NULL);
6926 prefs_register_enum_preference(lldp_module,
6927 "column_info_selection",
6928 "Select Column Info Display Style",
6929 "Which Information will be showed at Column Information is decided by the selection",
6930 &column_info_selection,
6931 column_info_options,
6932 false);
6934 prefs_register_bool_preference(lldp_module,
6935 "assume_unrecognized_tlv",
6936 "Assume unrecognized TLV",
6937 "If checked, assume an unrecognized TLV type should be consumed and treated as an LLDP TLV. Otherwise, end LLDP dissection.",
6938 &assume_unrecognized_tlv);
6940 /* Required function calls to register the header fields and subtrees used */
6941 proto_register_field_array(proto_lldp, hf, array_length(hf));
6942 proto_register_subtree_array(ett, array_length(ett));
6943 oui_unique_code_table = register_dissector_table("lldp.orgtlv.oui", "LLDP OUI", proto_lldp, FT_UINT24, BASE_HEX );
6945 expert_lldp = expert_register_protocol(proto_lldp);
6946 expert_register_field_array(expert_lldp, ei, array_length(ei));
6949 void
6950 proto_reg_handoff_lldp(void)
6952 dissector_add_uint("ethertype", ETHERTYPE_LLDP, lldp_handle);
6953 dissector_add_uint("ethertype", ETHERTYPE_ONOS, lldp_handle);
6957 * Editor modelines - https://www.wireshark.org/tools/modelines.html
6959 * Local variables:
6960 * c-basic-offset: 8
6961 * tab-width: 8
6962 * indent-tabs-mode: t
6963 * End:
6965 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
6966 * :indentSize=8:tabSize=8:noTabs=false: