/src/wireshark/epan/dissectors/packet-lldp.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* packet-lldp.c |
2 | | * Routines for LLDP dissection |
3 | | * By Juan Gonzalez <juan.gonzalez@pikatech.com> |
4 | | * Copyright 2005 MITEL |
5 | | * |
6 | | * July 2005 |
7 | | * Modified by: Brian Bogora <brian_bogora@mitel.com> |
8 | | * |
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 |
14 | | * |
15 | | * August 2016 |
16 | | * Added Avaya IP Phone OUI, Uli Heilmeier <uh@heilmeier.eu> |
17 | | * |
18 | | * IEEE 802.1AB |
19 | | * |
20 | | * IEEE 802.1Q for the 802.1 Organizationally Specific TLVs. |
21 | | * |
22 | | * TIA-1057 for TIA Organizationally Specific TLVs. |
23 | | * |
24 | | * Wireshark - Network traffic analyzer |
25 | | * By Gerald Combs <gerald@wireshark.org> |
26 | | * Copyright 1998 Gerald Combs |
27 | | * |
28 | | * SPDX-License-Identifier: GPL-2.0-or-later |
29 | | */ |
30 | | |
31 | | #include "config.h" |
32 | | |
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> |
41 | | |
42 | | #include <wsutil/array.h> |
43 | | #include <epan/oui.h> |
44 | | |
45 | | #include "packet-enip.h" |
46 | | |
47 | 15 | #define DEFAULT_COLUMN_INFO 1 |
48 | 14 | #define PROFINET_SPECIAL_COLUMN_INFO 2 |
49 | | |
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; |
59 | | |
60 | | static int column_info_selection = DEFAULT_COLUMN_INFO; |
61 | | static bool assume_unrecognized_tlv = false; |
62 | | |
63 | | static dissector_handle_t lldp_handle; |
64 | | |
65 | | void proto_register_lldp(void); |
66 | | void proto_reg_handoff_lldp(void); |
67 | | |
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; |
78 | | |
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; |
85 | | |
86 | | /* Sub Dissector Tables */ |
87 | | static dissector_table_t oui_unique_code_table; |
88 | | |
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; |
285 | | |
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; |
492 | | |
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; |
526 | | |
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; |
533 | | |
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; |
545 | | |
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; |
576 | | |
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; |
582 | | |
583 | | /* TLV Types */ |
584 | 0 | #define END_OF_LLDPDU_TLV_TYPE 0x00 |
585 | 13 | #define CHASSIS_ID_TLV_TYPE 0x01 /* Mandatory */ |
586 | 2 | #define PORT_ID_TLV_TYPE 0x02 /* Mandatory */ |
587 | 0 | #define TIME_TO_LIVE_TLV_TYPE 0x03 /* Mandatory */ |
588 | 0 | #define PORT_DESCRIPTION_TLV_TYPE 0x04 |
589 | 0 | #define SYSTEM_NAME_TLV_TYPE 0x05 |
590 | 0 | #define SYSTEM_DESCRIPTION_TLV_TYPE 0x06 |
591 | 0 | #define SYSTEM_CAPABILITIES_TLV_TYPE 0x07 |
592 | 0 | #define MANAGEMENT_ADDR_TLV_TYPE 0x08 |
593 | 0 | #define ORGANIZATION_SPECIFIC_TLV_TYPE 0x7F |
594 | | |
595 | | /* Masks */ |
596 | 36 | #define TLV_TYPE_MASK 0xFE00 |
597 | 8 | #define TLV_TYPE(value) (((value) & TLV_TYPE_MASK) >> 9) |
598 | 54 | #define TLV_INFO_LEN_MASK 0x01FF |
599 | 26 | #define TLV_INFO_LEN(value) ((value) & TLV_INFO_LEN_MASK) |
600 | | |
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} |
613 | | }; |
614 | | |
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} |
625 | | }; |
626 | | |
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} |
633 | | }; |
634 | | |
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} |
645 | | }; |
646 | | |
647 | | static const value_string interface_subtype_values[] = { |
648 | | { 1, "Unknown"}, |
649 | | { 2, "ifIndex"}, |
650 | | { 3, "System port number"}, |
651 | | { 0, NULL} |
652 | | }; |
653 | | |
654 | | static const value_string dcbx_protocol_types[] = { |
655 | | { 0x01, "1.0 CIN" }, |
656 | | { 0x02, "1.01 CEE" }, |
657 | | { 0, NULL } |
658 | | }; |
659 | | |
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 } |
667 | | }; |
668 | | |
669 | | static const value_string dcbx_app_selector[] = { |
670 | | { 0, "EtherType" }, |
671 | | { 1, "Socket Number" }, |
672 | | { 0, NULL } |
673 | | }; |
674 | | |
675 | | static const value_string dcbx_app_types[] = { |
676 | | { 0xcbc, "iSCSI" }, |
677 | | { 0x8906, "FCoE" }, |
678 | | { 0x8914, "FiP" }, |
679 | | { 0, NULL } |
680 | | }; |
681 | | |
682 | | static const value_string dcbx_llink_types[] = { |
683 | | { 0x0, "FCoE Status" }, |
684 | | { 0x1, "LAN Status" }, |
685 | | { 0, NULL } |
686 | | }; |
687 | | |
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 } |
711 | | }; |
712 | | |
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 } |
720 | | }; |
721 | | |
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 } |
732 | | }; |
733 | | |
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 } |
743 | | }; |
744 | | |
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 } |
759 | | }; |
760 | | |
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 } |
769 | | }; |
770 | | |
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 } |
783 | | }; |
784 | | |
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 } |
802 | | }; |
803 | | /* extreme avaya ap subtypes */ |
804 | 0 | #define EX_AVAYA_SUBTYPE_ELEMENT_TLV 11 |
805 | 0 | #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 } |
810 | | }; |
811 | | |
812 | | /* extreme avaya2 (fabric) subtypes */ |
813 | 0 | #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 } |
817 | | }; |
818 | | |
819 | | /* ONOS subtypes */ |
820 | | /* https://github.com/opennetworkinglab/onos/blob/master/utils/misc/src/main/java/org/onlab/packet/LLDP.java */ |
821 | 0 | #define ONOS_CHASSIS_TLV_TYPE 1 |
822 | 0 | #define ONOS_PORT_TLV_TYPE 2 |
823 | 0 | #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 } |
829 | | }; |
830 | | |
831 | | |
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 } |
856 | | }; |
857 | | |
858 | | static const true_false_string tfs_desired_not_desired = { "Desired", "Not Desired" }; |
859 | | |
860 | | static const value_string cisco_portstate_vals[] = { |
861 | | { 1, "In Service" }, |
862 | | { 2, "Out of Service" }, |
863 | | { 0, NULL } |
864 | | }; |
865 | | |
866 | | static const value_string cisco_portrole_vals[] = { |
867 | | { 1, "Active" }, |
868 | | { 2, "Backup" }, |
869 | | { 0, NULL } |
870 | | }; |
871 | | static const value_string cisco_portmode_vals[] = { |
872 | | { 0, "Normal" }, |
873 | | { 1, "Recovery Mode" }, |
874 | | { 0, NULL } |
875 | | }; |
876 | | |
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 } |
885 | | }; |
886 | | |
887 | | static const value_string cisco_apicmode_vals[] = { |
888 | | { 0, "Active" }, |
889 | | { 1, "Standby" }, |
890 | | { 0, NULL } |
891 | | }; |
892 | | |
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 } |
902 | | }; |
903 | | |
904 | | /* Avaya 802.1Q Framing Subtypes */ |
905 | | static const value_string avaya_dot1q_subtypes[] = { |
906 | | { 1, "Tagging" }, |
907 | | { 2, "No Tagging" }, |
908 | | { 0, NULL } |
909 | | }; |
910 | | |
911 | | /* IANA Subtypes */ |
912 | | static const value_string iana_subtypes[] = { |
913 | | { 1, "Manufacturer Usage Description URL" }, |
914 | | { 0, NULL } |
915 | | }; |
916 | | |
917 | | |
918 | | |
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 } |
927 | | }; |
928 | | |
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 } |
941 | | }; |
942 | | |
943 | | /* 802.3 Power Pair */ |
944 | | static const value_string power_pair_802_3[] = { |
945 | | { 1, "Signal" }, |
946 | | { 2, "Spare" }, |
947 | | { 0, NULL } |
948 | | }; |
949 | | |
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 } |
957 | | }; |
958 | | |
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 } |
966 | | }; |
967 | | |
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 } |
979 | | }; |
980 | | |
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 } |
992 | | }; |
993 | | |
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 } |
1001 | | }; |
1002 | | |
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 } |
1010 | | }; |
1011 | | |
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" }; |
1015 | | |
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 } |
1023 | | }; |
1024 | | |
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 } |
1032 | | }; |
1033 | | |
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 } |
1041 | | }; |
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 } |
1047 | | }; |
1048 | | |
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 } |
1056 | | }; |
1057 | | |
1058 | | /* Altitude Type */ |
1059 | | static const value_string altitude_type[] = { |
1060 | | { 1, "Meters" }, |
1061 | | { 2, "Floors" }, |
1062 | | { 0, NULL } |
1063 | | }; |
1064 | | |
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 } |
1071 | | }; |
1072 | | |
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} |
1079 | | }; |
1080 | | |
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 } |
1106 | | }; |
1107 | | |
1108 | | /* |
1109 | | * Define the text strings for the LLDP 802.3 MAC/PHY Configuration/Status |
1110 | | * Operational MAU Type field. |
1111 | | * |
1112 | | * These values are taken from the DESCRIPTION field of the dot3MauType |
1113 | | * objects defined in RFC 4836 |
1114 | | */ |
1115 | | |
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 } |
1178 | | }; |
1179 | | |
1180 | | /* Hytec Masks */ |
1181 | 14 | #define HYTEC_GROUP_MASK 0xE0 |
1182 | 0 | #define HYTEC_GROUP_MASK_OFFSET 0 |
1183 | 0 | #define HYTEC_GROUP_MASK_SIZE 3 |
1184 | 14 | #define HYTEC_IDENTIFIER_MASK 0x1F |
1185 | 0 | #define HYTEC_IDENTIFIER_MASK_OFFSET HYTEC_GROUP_MASK_SIZE |
1186 | 0 | #define HYTEC_IDENTIFIER_MASK_SIZE 5 |
1187 | | |
1188 | | /* Hytec Subtypes */ |
1189 | 0 | #define HYTEC_SUBTYPE__TRANSCEIVER 1 |
1190 | 0 | #define HYTEC_SUBTYPE__TRACE 2 |
1191 | | |
1192 | | /* Hytec Transceiver Groups */ |
1193 | 0 | #define HYTEC_TRANSG__TRANCEIVER_IDENTIFIER 1 |
1194 | 0 | #define HYTEC_TRANSG__TRANSCEIVER_BRIDGEABLE_DISTANCE 2 |
1195 | 0 | #define HYTEC_TRANSG__MEASUREMENT_DATA 3 |
1196 | | |
1197 | | /* Hytec Trace Groups */ |
1198 | 0 | #define HYTEC_TRACEG__MAC_TRACE 1 |
1199 | | |
1200 | | /* Hytec Transceiver Identifiers */ |
1201 | 0 | #define HYTEC_TID__VENDOR_PRODUCT_REVISION 1 |
1202 | | |
1203 | 14 | #define HYTEC_TID__VENDOR_PRODUCT_REVISION_STR "Transceiver vendor, product and revision" |
1204 | | |
1205 | | /* Hytec Transceiver Bridgeable Distance Values */ |
1206 | 0 | #define HYTEC_TBD__SINGLE_MODE 1 |
1207 | 0 | #define HYTEC_TBD__MULTI_MODE_50 2 |
1208 | 0 | #define HYTEC_TBD__MULTI_MODE_62_5 3 |
1209 | | |
1210 | 14 | #define HYTEC_TBD__SINGLE_MODE_STR "Single mode (9/125 um)" |
1211 | 14 | #define HYTEC_TBD__MULTI_MODE_50_STR "Multi mode (50/125 um)" |
1212 | 14 | #define HYTEC_TBD__MULTI_MODE_62_5_STR "Multi mode (62.5/125 um)" |
1213 | | |
1214 | | |
1215 | | /* Hytec Measurement Data Values */ |
1216 | 0 | #define HYTEC_MD__TX_CURRENT_OUTPUT_POWER 1 |
1217 | 0 | #define HYTEC_MD__RX_CURRENT_INPUT_POWER 2 |
1218 | 0 | #define HYTEC_MD__RX_INPUT_SNR 3 |
1219 | 0 | #define HYTEC_MD__LINELOSS 4 |
1220 | | |
1221 | 14 | #define HYTEC_MD__TX_CURRENT_OUTPUT_POWER_STR "Tx current output power" |
1222 | 14 | #define HYTEC_MD__RX_CURRENT_INPUT_POWER_STR "Rx current input power" |
1223 | 14 | #define HYTEC_MD__RX_INPUT_SNR_STR "Rx input SNR" |
1224 | 14 | #define HYTEC_MD__LINELOSS_STR "Lineloss" |
1225 | | |
1226 | | |
1227 | | /* Hytec MAC Trace Values */ |
1228 | 0 | #define HYTEC_MC__MAC_TRACE_REQUEST 1 |
1229 | 0 | #define HYTEC_MC__MAC_TRACE_REPLY 2 |
1230 | 0 | #define HYTEC_MC__NAME_OF_REPLYING_DEVICE 3 |
1231 | 0 | #define HYTEC_MC__OUTGOING_PORT_NAME 4 |
1232 | 0 | #define HYTEC_MC__IPV4_ADDRESS_OF_REPLYING_DEVICE 5 |
1233 | 0 | #define HYTEC_MC__END_OF_TRACE 6 |
1234 | 0 | #define HYTEC_MC__IPV6_ADDRESS_OF_REPLYING_DEVICE 7 |
1235 | 0 | #define HYTEC_MC__INCOMING_PORT_NAME 8 |
1236 | 0 | #define HYTEC_MC__TRACE_IDENTIFIER 9 |
1237 | | |
1238 | 14 | #define HYTEC_MC__MAC_TRACE_REQUEST_STR "MAC Trace Request" |
1239 | 14 | #define HYTEC_MC__MAC_TRACE_REPLY_STR "MAC Trace Reply" |
1240 | 14 | #define HYTEC_MC__NAME_OF_REPLYING_DEVICE_STR "Name of replying device" |
1241 | 14 | #define HYTEC_MC__OUTGOING_PORT_NAME_STR "Outgoing port name" |
1242 | 14 | #define HYTEC_MC__IPV4_ADDRESS_OF_REPLYING_DEVICE_STR "IPv4 address of replying device" |
1243 | 14 | #define HYTEC_MC__END_OF_TRACE_STR "End of Trace" |
1244 | 14 | #define HYTEC_MC__IPV6_ADDRESS_OF_REPLYING_DEVICE_STR "IPv6 address of replying device" |
1245 | 14 | #define HYTEC_MC__INCOMING_PORT_NAME_STR "Incoming port name" |
1246 | 14 | #define HYTEC_MC__TRACE_IDENTIFIER_STR "Trace identifier" |
1247 | | |
1248 | | |
1249 | | static const value_string hytec_subtypes[] = { |
1250 | | {HYTEC_SUBTYPE__TRANSCEIVER, "Transceiver"}, |
1251 | | {HYTEC_SUBTYPE__TRACE, "Trace"}, |
1252 | | {0, NULL} |
1253 | | }; |
1254 | | |
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} |
1260 | | }; |
1261 | | |
1262 | | static const value_string hytec_trace_groups[] = { |
1263 | | {HYTEC_TRACEG__MAC_TRACE, "MAC Trace"}, |
1264 | | {0, NULL} |
1265 | | }; |
1266 | | |
1267 | | static const value_string hytec_tid[] = { |
1268 | | {HYTEC_TID__VENDOR_PRODUCT_REVISION, HYTEC_TID__VENDOR_PRODUCT_REVISION_STR}, |
1269 | | {0, NULL} |
1270 | | }; |
1271 | | |
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} |
1277 | | }; |
1278 | | |
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} |
1285 | | }; |
1286 | | |
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} |
1298 | | }; |
1299 | | |
1300 | | |
1301 | | /* System Capabilities */ |
1302 | 28 | #define SYSTEM_CAPABILITY_OTHER 0x0001 |
1303 | 28 | #define SYSTEM_CAPABILITY_REPEATER 0x0002 |
1304 | 28 | #define SYSTEM_CAPABILITY_BRIDGE 0x0004 |
1305 | 28 | #define SYSTEM_CAPABILITY_WLAN 0x0008 |
1306 | 28 | #define SYSTEM_CAPABILITY_ROUTER 0x0010 |
1307 | 28 | #define SYSTEM_CAPABILITY_TELEPHONE 0x0020 |
1308 | 28 | #define SYSTEM_CAPABILITY_DOCSIS 0x0040 |
1309 | 28 | #define SYSTEM_CAPABILITY_STATION 0x0080 |
1310 | 28 | #define SYSTEM_CAPABILITY_CVLAN 0x0100 |
1311 | 28 | #define SYSTEM_CAPABILITY_SVLAN 0x0200 |
1312 | 28 | #define SYSTEM_CAPABILITY_TPMR 0x0400 |
1313 | | |
1314 | | /* Media Capabilities */ |
1315 | 14 | #define MEDIA_CAPABILITY_LLDP 0x0001 |
1316 | 14 | #define MEDIA_CAPABILITY_NETWORK_POLICY 0x0002 |
1317 | 14 | #define MEDIA_CAPABILITY_LOCATION_ID 0x0004 |
1318 | 14 | #define MEDIA_CAPABILITY_MDI_PSE 0x0008 |
1319 | 14 | #define MEDIA_CAPABILITY_MDI_PD 0x0010 |
1320 | 14 | #define MEDIA_CAPABILITY_INVENTORY 0x0020 |
1321 | | |
1322 | | /* |
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. |
1327 | | */ |
1328 | | |
1329 | 14 | #define AUTONEG_OTHER 0x8000 /* bOther(0), -- other or unknown */ |
1330 | 14 | #define AUTONEG_10BASE_T 0x4000 /* b10baseT(1), -- 10BASE-T half duplex mode */ |
1331 | 14 | #define AUTONEG_10BASET_FD 0x2000 /* b10baseTFD(2), -- 10BASE-T full duplex mode */ |
1332 | 14 | #define AUTONEG_100BASE_T4 0x1000 /* b100baseT4(3), -- 100BASE-T4 */ |
1333 | 14 | #define AUTONEG_100BASE_TX 0x0800 /* b100baseTX(4), -- 100BASE-TX half duplex mode */ |
1334 | 14 | #define AUTONEG_100BASE_TXFD 0x0400 /* b100baseTXFD(5), -- 100BASE-TX full duplex mode */ |
1335 | 14 | #define AUTONEG_100BASE_T2 0x0200 /* b100baseT2(6), -- 100BASE-T2 half duplex mode */ |
1336 | 14 | #define AUTONEG_100BASE_T2FD 0x0100 /* b100baseT2FD(7), -- 100BASE-T2 full duplex mode */ |
1337 | 14 | #define AUTONEG_FDX_PAUSE 0x0080 /* bFdxPause(8), -- PAUSE for full-duplex links */ |
1338 | 14 | #define AUTONEG_FDX_APAUSE 0x0040 /* bFdxAPause(9), -- Asymmetric PAUSE for full-duplex links */ |
1339 | 14 | #define AUTONEG_FDX_SPAUSE 0x0020 /* bFdxSPause(10), -- Symmetric PAUSE for full-duplex links */ |
1340 | 14 | #define AUTONEG_FDX_BPAUSE 0x0010 /* bFdxBPause(11), -- Asymmetric and Symmetric PAUSE for full-duplex links */ |
1341 | 14 | #define AUTONEG_1000BASE_X 0x0008 /* b1000baseX(12), -- 1000BASE-X, -LX, -SX, -CX half duplex mode */ |
1342 | 14 | #define AUTONEG_1000BASE_XFD 0x0004 /* b1000baseXFD(13), -- 1000BASE-X, -LX, -SX, -CX full duplex mode */ |
1343 | 14 | #define AUTONEG_1000BASE_T 0x0002 /* b1000baseT(14), -- 1000BASE-T half duplex mode */ |
1344 | 14 | #define AUTONEG_1000BASE_TFD 0x0001 /* b1000baseTFD(15) -- 1000BASE-T full duplex mode */ |
1345 | | |
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 |
1350 | | */ |
1351 | | |
1352 | 14 | #define INV_AUTONEG_OTHER 0x0001 /* bOther(0), -- other or unknown */ |
1353 | 14 | #define INV_AUTONEG_10BASE_T 0x0002 /* b10baseT(1), -- 10BASE-T half duplex mode */ |
1354 | 14 | #define INV_AUTONEG_10BASET_FD 0x0004 /* b10baseTFD(2), -- 10BASE-T full duplex mode */ |
1355 | 14 | #define INV_AUTONEG_100BASE_T4 0x0008 /* b100baseT4(3), -- 100BASE-T4 */ |
1356 | 14 | #define INV_AUTONEG_100BASE_TX 0x0010 /* b100baseTX(4), -- 100BASE-TX half duplex mode */ |
1357 | 14 | #define INV_AUTONEG_100BASE_TXFD 0x0020 /* b100baseTXFD(5), -- 100BASE-TX full duplex mode */ |
1358 | 14 | #define INV_AUTONEG_100BASE_T2 0x0040 /* b100baseT2(6), -- 100BASE-T2 half duplex mode */ |
1359 | 14 | #define INV_AUTONEG_100BASE_T2FD 0x0080 /* b100baseT2FD(7), -- 100BASE-T2 full duplex mode */ |
1360 | 14 | #define INV_AUTONEG_FDX_PAUSE 0x0100 /* bFdxPause(8), -- PAUSE for full-duplex links */ |
1361 | 14 | #define INV_AUTONEG_FDX_APAUSE 0x0200 /* bFdxAPause(9), -- Asymmetric PAUSE for full-duplex links */ |
1362 | 14 | #define INV_AUTONEG_FDX_SPAUSE 0x0400 /* bFdxSPause(10), -- Symmetric PAUSE for full-duplex links */ |
1363 | 14 | #define INV_AUTONEG_FDX_BPAUSE 0x0800 /* bFdxBPause(11), -- Asymmetric and Symmetric PAUSE for full-duplex links */ |
1364 | 14 | #define INV_AUTONEG_1000BASE_X 0x1000 /* b1000baseX(12), -- 1000BASE-X, -LX, -SX, -CX half duplex mode */ |
1365 | 14 | #define INV_AUTONEG_1000BASE_XFD 0x2000 /* b1000baseXFD(13), -- 1000BASE-X, -LX, -SX, -CX full duplex mode */ |
1366 | 14 | #define INV_AUTONEG_1000BASE_T 0x4000 /* b1000baseT(14), -- 1000BASE-T half duplex mode */ |
1367 | 14 | #define INV_AUTONEG_1000BASE_TFD 0x8000 /* b1000baseTFD(15) -- 1000BASE-T full duplex mode */ |
1368 | | |
1369 | 28 | #define EVB_CAPA_STD 0x8000 |
1370 | 28 | #define EVB_CAPA_RR 0x4000 |
1371 | | |
1372 | 28 | #define EVB_CAPA_RTE 0x0004 |
1373 | 28 | #define EVB_CAPA_ECP 0x0002 |
1374 | 28 | #define EVB_CAPA_VDP 0x0001 |
1375 | | |
1376 | | /* IEEE 802.3br Additional Ethernet Capabilities flags */ |
1377 | 14 | #define IEEE_802_3BR_AEC_SUPPORT 0x0001 |
1378 | 14 | #define IEEE_802_3BR_AEC_ENABLE 0x0002 |
1379 | 14 | #define IEEE_802_3BR_AEC_ACTIVE 0x0004 |
1380 | 14 | #define IEEE_802_3BR_AEC_ADDFRAGSIZE 0x0018 |
1381 | 14 | #define IEEE_802_3BR_AEC_RESERVED 0xFFE0 |
1382 | | |
1383 | | #define MAX_MAC_LEN 6 |
1384 | | |
1385 | | |
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 } |
1393 | | }; |
1394 | | |
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 } |
1403 | | }; |
1404 | | |
1405 | | static const value_string profinet_port3_status_PreambleLength[] = { |
1406 | | { 0, "Seven octets" }, |
1407 | | { 1, "One octet" }, |
1408 | | { 0, NULL } |
1409 | | }; |
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 } |
1416 | | }; |
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 } |
1423 | | }; |
1424 | | |
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 } |
1431 | | }; |
1432 | | |
1433 | | static void |
1434 | 0 | mdi_power_base(char *buf, uint32_t value) { |
1435 | 0 | snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u. Watt", value/10, value%10); |
1436 | 0 | } |
1437 | | |
1438 | | static void |
1439 | 0 | media_power_base(char *buf, uint32_t value) { |
1440 | 0 | snprintf(buf, ITEM_LABEL_LENGTH, "%u mW", value * 100); |
1441 | 0 | } |
1442 | | |
1443 | | // Get absolute 2's complement value |
1444 | | // Returns true if the value is negative (so if |
1445 | | // it returns false, there is no conversion). |
1446 | | // bitSize: number of bits of the variable. |
1447 | | static bool |
1448 | 0 | get2sComplementAbsoluteValue(uint64_t * value, unsigned bitSize){ |
1449 | 0 | const uint64_t signMask = INT64_C(0x1) << (bitSize - 1); |
1450 | |
|
1451 | 0 | uint64_t signedMask = INT64_C(0x1) << bitSize; |
1452 | 0 | signedMask--; |
1453 | 0 | signedMask = ~signedMask; |
1454 | |
|
1455 | 0 | if(*value & signMask){ |
1456 | 0 | *value |= signedMask; // sign propagation |
1457 | | |
1458 | | // Convert to absolute value |
1459 | 0 | *value = ~(*value); |
1460 | 0 | (*value)++; |
1461 | 0 | return true; |
1462 | 0 | } |
1463 | 0 | return false; |
1464 | 0 | } |
1465 | | |
1466 | | static uint64_t |
1467 | 0 | getUint64MaskedValue(uint64_t value, unsigned bitSize){ |
1468 | 0 | uint64_t mask = INT64_C(0x1) << bitSize; |
1469 | 0 | mask--; |
1470 | 0 | return value & mask; |
1471 | 0 | } |
1472 | | |
1473 | | static uint64_t |
1474 | 0 | pow10_uint64(int exponent){ |
1475 | 0 | uint64_t val = 1; |
1476 | |
|
1477 | 0 | while(exponent > 0){ |
1478 | 0 | val *= 10; |
1479 | 0 | exponent--; |
1480 | 0 | } |
1481 | |
|
1482 | 0 | while(exponent < 0){ |
1483 | 0 | val /= 10; |
1484 | 0 | exponent++; |
1485 | 0 | } |
1486 | 0 | return val; |
1487 | 0 | } |
1488 | | |
1489 | | // Decode uint fractional variable |
1490 | | static uint64_t |
1491 | 0 | convertFractionalToFixedSizeDecimal(uint64_t value, unsigned fractionalBitSize, unsigned numberOfDigitToDisplay){ |
1492 | 0 | const uint64_t resolution = INT64_C(0x1) << fractionalBitSize; |
1493 | | // => 0x02000000 for 25-bits |
1494 | | // => 0x00000100 for 8-bits |
1495 | |
|
1496 | 0 | const uint64_t fractionalPortionMask = resolution - 1; |
1497 | 0 | value &= fractionalPortionMask; |
1498 | | |
1499 | | // Maximum value for numberOfDigitToDisplay is : |
1500 | | // log10(INT64_C(0xFFFFFFFFFFFFFFFF) / fractionalPortionMask); |
1501 | | // => if result is stored in 32-bits, numberOfDigitToDisplay max = 9 |
1502 | 0 | const uint64_t displayMultiplier = pow10_uint64(numberOfDigitToDisplay); |
1503 | 0 | value *= displayMultiplier; |
1504 | 0 | uint64_t moduloValue = value % resolution; |
1505 | 0 | value /= resolution; |
1506 | 0 | if(moduloValue >= (resolution/2)){ |
1507 | 0 | value++; // rounded value |
1508 | 0 | } |
1509 | |
|
1510 | 0 | return value; |
1511 | 0 | } |
1512 | | |
1513 | | |
1514 | | /* Calculate Latitude and Longitude string */ |
1515 | | /* |
1516 | | Parameters: |
1517 | | option = 0 -> Latitude |
1518 | | option = 1 -> Longitude |
1519 | | */ |
1520 | | static void |
1521 | | get_latitude_or_longitude(char *buf, int option, uint64_t unmasked_value) |
1522 | 0 | { |
1523 | | /* The latitude and longitude are 34 bit fixed point value consisting |
1524 | | of 9 bits of integer and 25 bits of fraction. |
1525 | | When option is equal to 0, positive numbers are represent a location |
1526 | | north of the equator and negative (2s complement) numbers are south of the equator. |
1527 | | When option is equal to 1, positive values are east of the prime |
1528 | | meridian and negative (2s complement) numbers are west of the prime meridian. |
1529 | | Longitude values outside the range of -180 to 180 decimal degrees or latitude values |
1530 | | outside the range of -90 to 90 degrees MUST be considered invalid. |
1531 | | */ |
1532 | 0 | const unsigned variableBitSize = 34; |
1533 | 0 | const unsigned fractionalBitSize = 25; |
1534 | 0 | const uint64_t maxlatitude = (INT64_C(0x1) << fractionalBitSize) * INT64_C(90); // 90 degrees |
1535 | 0 | const uint64_t maxlongitude = (INT64_C(0x1) << fractionalBitSize) * INT64_C(180); // 180 degrees |
1536 | |
|
1537 | 0 | uint64_t masked_value = getUint64MaskedValue(unmasked_value, variableBitSize); // get 34-bit value |
1538 | | |
1539 | | // Get absolute value of a 34-bit 2's variable |
1540 | | // => value is 33-bit |
1541 | 0 | uint64_t absolute_value = masked_value; |
1542 | 0 | bool isNegative = get2sComplementAbsoluteValue(&absolute_value, variableBitSize); |
1543 | | |
1544 | | // Get unsigned integer 8-bit value |
1545 | 0 | uint32_t integerPortion = (uint32_t)(absolute_value >> fractionalBitSize); |
1546 | | |
1547 | | // Get fractional 25-bit value |
1548 | 0 | const unsigned numberOfDigitToDisplay = 4; |
1549 | 0 | uint64_t fixedSizeDecimal = convertFractionalToFixedSizeDecimal(absolute_value, fractionalBitSize, numberOfDigitToDisplay); |
1550 | |
|
1551 | 0 | const char *direction; |
1552 | 0 | const char *err_str = ""; |
1553 | 0 | if (option == 0){ |
1554 | | // Latitude - north/south directions |
1555 | 0 | if (isNegative){ |
1556 | 0 | direction = "South"; |
1557 | 0 | } else { |
1558 | 0 | direction = "North"; |
1559 | 0 | } |
1560 | 0 | if(absolute_value > maxlatitude){ |
1561 | 0 | err_str = "[Error: value > 90 degrees] "; |
1562 | 0 | } |
1563 | 0 | } else { |
1564 | | // Longitude - east/west directions |
1565 | 0 | if (isNegative){ |
1566 | 0 | direction = "West"; |
1567 | 0 | } else { |
1568 | 0 | direction = "East"; |
1569 | 0 | } |
1570 | 0 | if(absolute_value > maxlongitude){ |
1571 | 0 | err_str = "[Error: value > 180 degrees] "; |
1572 | 0 | } |
1573 | 0 | } |
1574 | |
|
1575 | 0 | const uint64_t fractionalMask = (INT64_C(0x1) << fractionalBitSize) - 1; |
1576 | | |
1577 | | // %04 correspond to numberOfDigitToDisplay |
1578 | 0 | 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 ")", |
1579 | 0 | err_str, |
1580 | 0 | integerPortion, fixedSizeDecimal, direction, masked_value, |
1581 | 0 | variableBitSize - fractionalBitSize, masked_value >> fractionalBitSize, |
1582 | 0 | fractionalBitSize, masked_value & fractionalMask |
1583 | 0 | ); |
1584 | 0 | } |
1585 | | |
1586 | | static void |
1587 | 0 | latitude_base(char *buf, uint64_t value) { |
1588 | 0 | get_latitude_or_longitude(buf, 0, value); |
1589 | 0 | } |
1590 | | |
1591 | | static void |
1592 | 0 | longitude_base(char *buf, uint64_t value) { |
1593 | 0 | get_latitude_or_longitude(buf, 1, value); |
1594 | 0 | } |
1595 | | |
1596 | | static void |
1597 | 0 | altitude_base(char *buf, uint32_t unmasked_value) { |
1598 | | // RFC6225 |
1599 | | // Altitude: A 30-bit value defined by the AType field. |
1600 | | // In some cases, the altitude of the location might not be provided. |
1601 | | // An Altitude Type value of zero indicates that the altitude is not |
1602 | | // given to the client. In this case, the Altitude and Altitude |
1603 | | // Uncertainty fields can contain any value and MUST be ignored. |
1604 | | // |
1605 | | // If the Altitude Type has a value of one, altitude is measured in |
1606 | | // meters, in relation to the zero set by the vertical datum. For AType |
1607 | | // = 1, the altitude value is expressed as a 30-bit, fixed-point, two's |
1608 | | // complement integer with 22 integer bits and 8 fractional bits. |
1609 | | // |
1610 | | // A value of two for Altitude Type indicates that the altitude value is |
1611 | | // measured in floors. Since altitude in meters may not be known within |
1612 | | // a building, a floor indication may be more useful. For AType = 2, |
1613 | | // the altitude value is expressed as a 30-bit, fixed-point, two's |
1614 | | // complement integer with 22 integer bits and 8 fractional bits. |
1615 | | // |
1616 | | // the altitude resolution (AltRes) value encodes the number of |
1617 | | // high-order altitude bits that should be considered valid. |
1618 | | // Values above 30 (decimal) are undefined and reserved. |
1619 | |
|
1620 | 0 | const unsigned variableBitSize = 30; |
1621 | 0 | const unsigned fractionalBitSize = 8; |
1622 | |
|
1623 | 0 | uint64_t masked_value = getUint64MaskedValue(unmasked_value, variableBitSize); // get 30-bit value |
1624 | | |
1625 | | // Get absolute value of a 30-bit 2's variable |
1626 | | // => value is 29-bit |
1627 | 0 | uint64_t absolute_value = masked_value; |
1628 | 0 | bool isNegative = get2sComplementAbsoluteValue(&absolute_value, variableBitSize); |
1629 | | |
1630 | | // Get unsigned integer 8-bit value |
1631 | 0 | uint32_t integerPortion = (uint32_t)(absolute_value >> fractionalBitSize); |
1632 | | |
1633 | | // Get fractional 8-bit value |
1634 | 0 | const unsigned numberOfDigitToDisplay = 4; |
1635 | 0 | uint64_t fixedSizeDecimal = convertFractionalToFixedSizeDecimal(absolute_value, fractionalBitSize, numberOfDigitToDisplay); |
1636 | |
|
1637 | 0 | const char * sign; |
1638 | 0 | if (isNegative){ |
1639 | 0 | sign = "-"; |
1640 | 0 | } else { |
1641 | 0 | sign = "+"; |
1642 | 0 | } |
1643 | | |
1644 | |
|
1645 | 0 | const uint64_t fractionalMask = (INT64_C(0x1) << fractionalBitSize) - 1; |
1646 | | |
1647 | | // %04 correspond to numberOfDigitToDisplay |
1648 | 0 | 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 ")", |
1649 | 0 | sign, integerPortion, fixedSizeDecimal, masked_value, |
1650 | 0 | variableBitSize - fractionalBitSize, masked_value >> fractionalBitSize, |
1651 | 0 | fractionalBitSize, masked_value & fractionalMask |
1652 | 0 | ); |
1653 | 0 | } |
1654 | | |
1655 | | static void |
1656 | 0 | latitude_or_longitude_resolution(char *buf, uint8_t value) { |
1657 | | // formula, where x is the encoded integer value: |
1658 | | // Uncertainty = 2 ^ ( 8 - x ) |
1659 | |
|
1660 | 0 | int32_t masked_value = value & 0x3F; |
1661 | 0 | double resolution = 1.0; |
1662 | 0 | int32_t i = 8 - masked_value; |
1663 | 0 | while(i > 0){ |
1664 | 0 | resolution *= 2.0; |
1665 | 0 | i--; |
1666 | 0 | } |
1667 | 0 | while(i < 0){ |
1668 | 0 | resolution /= 2.0; |
1669 | 0 | i++; |
1670 | 0 | } |
1671 | |
|
1672 | 0 | const char *err_str = ""; |
1673 | 0 | if(masked_value > 34){ |
1674 | 0 | err_str = "[Error: value > 34] "; |
1675 | 0 | } else if(masked_value < 2){ |
1676 | 0 | err_str = "[Warning: value < 2] "; |
1677 | 0 | } |
1678 | |
|
1679 | 0 | snprintf(buf, ITEM_LABEL_LENGTH, "%s%lE degrees (%" PRIi32 ")", err_str, resolution, masked_value); |
1680 | 0 | } |
1681 | | |
1682 | | static void |
1683 | 0 | altitude_resolution(char *buf, uint8_t value) { |
1684 | | // The encoded altitude of 000000000000000010000110110011 decodes to |
1685 | | // 33.69921875. The encoded uncertainty of 15 gives a value of 64; |
1686 | | // therefore, the final uncertainty is 33.69921875 +/- 64 (or the range |
1687 | | // from -30.30078125 to 97.69921875). |
1688 | | // The amount of altitude uncertainty can be determined by the following |
1689 | | // formula, where x is the encoded integer value: |
1690 | | // Uncertainty = 2 ^ ( 21 - x ) |
1691 | | // = 2 ^ ( 21 - 15 ) = 2 ^ 6 = 64 |
1692 | |
|
1693 | 0 | int32_t masked_value = value & 0x3F; |
1694 | 0 | double resolution = 1.0; |
1695 | 0 | int32_t i = 21 - masked_value; |
1696 | 0 | while(i > 0){ |
1697 | 0 | resolution *= 2.0; |
1698 | 0 | i--; |
1699 | 0 | } |
1700 | 0 | while(i < 0){ |
1701 | 0 | resolution /= 2.0; |
1702 | 0 | i++; |
1703 | 0 | } |
1704 | |
|
1705 | 0 | const char *err_str = ""; |
1706 | 0 | if(masked_value > 30){ |
1707 | 0 | err_str = "[Error: value > 34] "; |
1708 | 0 | } else if(masked_value < 2){ |
1709 | 0 | err_str = "[Warning: value < 2] "; |
1710 | 0 | } |
1711 | |
|
1712 | 0 | snprintf(buf, ITEM_LABEL_LENGTH, "%s%lf (%" PRIi32 ")", err_str, resolution, masked_value); |
1713 | 0 | } |
1714 | | |
1715 | | |
1716 | | /* Dissect Chassis Id TLV (Mandatory) */ |
1717 | | static int32_t |
1718 | | dissect_lldp_chassis_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset, |
1719 | | profinet_lldp_column_info *pn_lldp_column_info) |
1720 | 7 | { |
1721 | 7 | uint8_t tlvsubType; |
1722 | 7 | uint16_t tempShort; |
1723 | 7 | uint32_t dataLen = 0; |
1724 | 7 | const char *strPtr=NULL; |
1725 | 7 | const char *idType=NULL; |
1726 | 7 | uint8_t addr_family = 0; |
1727 | | |
1728 | 7 | proto_tree *chassis_tree = NULL; |
1729 | 7 | proto_item *tf = NULL, *lf = NULL; |
1730 | | |
1731 | | /* Get tlv type */ |
1732 | 7 | tempShort = tvb_get_ntohs(tvb, offset); |
1733 | 7 | tlvsubType = TLV_TYPE(tempShort); |
1734 | 7 | if (tlvsubType != CHASSIS_ID_TLV_TYPE) |
1735 | 6 | { |
1736 | 6 | proto_tree_add_expert_format(tree, pinfo, &ei_lldp_bad_type , tvb, offset, TLV_INFO_LEN(tempShort), |
1737 | 6 | "Invalid TLV type (0x%02X), expected ChassisID type (0x%02X)", tlvsubType, CHASSIS_ID_TLV_TYPE); |
1738 | | |
1739 | 6 | return -1; |
1740 | 6 | } |
1741 | | |
1742 | | /* Get tlv length */ |
1743 | 1 | dataLen = TLV_INFO_LEN(tempShort); |
1744 | | /* Get tlv subtype */ |
1745 | 1 | tlvsubType = tvb_get_uint8(tvb, (offset+2)); |
1746 | | |
1747 | | /* Set chassis tree */ |
1748 | 1 | chassis_tree = proto_tree_add_subtree_format(tree, tvb, offset, (dataLen + 2), ett_chassis_id, &tf, "Chassis Subtype = %s", |
1749 | 1 | val_to_str_const(tlvsubType, chassis_id_subtypes, "Reserved" )); |
1750 | | |
1751 | 1 | proto_tree_add_item(chassis_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
1752 | 1 | lf = proto_tree_add_item(chassis_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
1753 | | |
1754 | 1 | offset += 2; |
1755 | | |
1756 | 1 | if (dataLen < 2) |
1757 | 0 | { |
1758 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, |
1759 | 0 | "Invalid Chassis ID Length (%u), expected > (2)", dataLen); |
1760 | |
|
1761 | 0 | return -1; |
1762 | 0 | } |
1763 | | |
1764 | | /* Get chassis id subtype */ |
1765 | 1 | proto_tree_add_item(chassis_tree, hf_chassis_id_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
1766 | | |
1767 | 1 | offset++; |
1768 | | |
1769 | 1 | switch (tlvsubType) |
1770 | 1 | { |
1771 | 0 | case 4: /* MAC address */ |
1772 | 0 | { |
1773 | 0 | if (dataLen != 7) |
1774 | 0 | { |
1775 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, |
1776 | 0 | "Invalid Chassis ID Length (%u) for Type (%s), expected (7)", dataLen, val_to_str_const(tlvsubType, chassis_id_subtypes, "")); |
1777 | 0 | return -1; |
1778 | 0 | } |
1779 | | |
1780 | 0 | idType="MA"; |
1781 | 0 | strPtr = tvb_ether_to_str(pinfo->pool, tvb, offset); |
1782 | 0 | proto_tree_add_item(chassis_tree, hf_chassis_id_mac, tvb, offset, 6, ENC_NA); |
1783 | 0 | pn_lldp_column_info->chassis_id_mac = wmem_strdup(pinfo->pool, strPtr); |
1784 | 0 | offset += (dataLen - 1); |
1785 | 0 | break; |
1786 | 0 | } |
1787 | 0 | case 5: /* Network address */ |
1788 | 0 | { |
1789 | | /* Get network address family */ |
1790 | 0 | proto_tree_add_item(chassis_tree, hf_lldp_network_address_family, tvb, offset, 1, ENC_BIG_ENDIAN); |
1791 | 0 | addr_family = tvb_get_uint8(tvb,offset); |
1792 | |
|
1793 | 0 | offset++; |
1794 | |
|
1795 | 0 | idType="NA"; |
1796 | | |
1797 | | /* Check for IPv4 or IPv6 */ |
1798 | 0 | switch(addr_family){ |
1799 | 0 | case AFNUM_INET: |
1800 | 0 | if (dataLen == 6){ |
1801 | 0 | strPtr = tvb_ip_to_str(pinfo->pool, tvb, offset); |
1802 | 0 | }else{ |
1803 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, |
1804 | 0 | "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, "")); |
1805 | 0 | return -1; |
1806 | 0 | } |
1807 | | |
1808 | 0 | proto_tree_add_item(chassis_tree, hf_chassis_id_ip4, tvb, offset, 4, ENC_BIG_ENDIAN); |
1809 | |
|
1810 | 0 | break; |
1811 | 0 | case AFNUM_INET6: |
1812 | 0 | if (dataLen == 18){ |
1813 | 0 | strPtr = tvb_ip6_to_str(pinfo->pool, tvb, offset); |
1814 | 0 | }else{ |
1815 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, |
1816 | 0 | "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, "")); |
1817 | 0 | return -1; |
1818 | 0 | } |
1819 | | |
1820 | 0 | proto_tree_add_item(chassis_tree, hf_chassis_id_ip6, tvb, offset, 16, ENC_NA); |
1821 | |
|
1822 | 0 | break; |
1823 | 0 | default: |
1824 | 0 | strPtr = tvb_bytes_to_str(pinfo->pool, tvb, offset, (dataLen-2)); |
1825 | 0 | proto_tree_add_item(chassis_tree, hf_chassis_id, tvb, offset, (dataLen-2), ENC_NA); |
1826 | |
|
1827 | 0 | break; |
1828 | 0 | } |
1829 | | |
1830 | 0 | offset += (dataLen - 2); |
1831 | 0 | break; |
1832 | 0 | } |
1833 | 0 | case 1: /* Chassis component */ |
1834 | 0 | case 2: /* Interface alias */ |
1835 | 0 | case 3: /* Port component */ |
1836 | 0 | case 6: /* Interface name */ |
1837 | 0 | case 7: /* Locally assigned */ |
1838 | 1 | default: |
1839 | 1 | { |
1840 | 1 | if (dataLen > 256) |
1841 | 0 | { |
1842 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length_excess, |
1843 | 0 | "Invalid Chassis ID Length (%u) for Type (%s), expected < (256)", dataLen, val_to_str_const(tlvsubType, chassis_id_subtypes, "")); |
1844 | 0 | return -1; |
1845 | 0 | } |
1846 | | |
1847 | 1 | switch(tlvsubType) |
1848 | 1 | { |
1849 | 0 | case 2: /* Interface alias */ |
1850 | 0 | idType="IA"; |
1851 | 0 | strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1)); |
1852 | 0 | break; |
1853 | 0 | case 6: /* Interface name */ |
1854 | 0 | idType="IN"; |
1855 | 0 | strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1)); |
1856 | 0 | break; |
1857 | 0 | case 7: /* Locally assigned */ |
1858 | 0 | idType="LA"; |
1859 | 0 | strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen-1)); |
1860 | 0 | pn_lldp_column_info->chassis_id_locally_assigned = wmem_strdup(pinfo->pool, strPtr); |
1861 | 0 | break; |
1862 | 0 | case 1: /* Chassis component */ |
1863 | 0 | idType="CC"; |
1864 | 0 | strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1)); |
1865 | 0 | break; |
1866 | 0 | case 3: /* Port component */ |
1867 | 0 | idType="PC"; |
1868 | 0 | strPtr = tvb_bytes_to_str(pinfo->pool, tvb, offset, (dataLen-1)); |
1869 | |
|
1870 | 0 | break; |
1871 | 1 | default: |
1872 | 1 | idType="Rs"; |
1873 | 1 | strPtr = "Reserved"; |
1874 | | |
1875 | 1 | break; |
1876 | 1 | } |
1877 | | |
1878 | 1 | proto_tree_add_item(chassis_tree, hf_chassis_id, tvb, offset, (dataLen-1), ENC_NA); |
1879 | | |
1880 | 1 | offset += (dataLen - 1); |
1881 | 1 | break; |
1882 | 1 | } |
1883 | 1 | } |
1884 | | |
1885 | 1 | if (column_info_selection == DEFAULT_COLUMN_INFO) |
1886 | 1 | { |
1887 | 1 | col_append_fstr(pinfo->cinfo, COL_INFO, "%s/%s ", idType, strPtr); |
1888 | 1 | } |
1889 | 1 | proto_item_append_text(tf, ", Id: %s", strPtr); |
1890 | | |
1891 | 1 | return offset; |
1892 | 1 | } |
1893 | | |
1894 | | /* Dissect Port Id TLV (Mandatory) */ |
1895 | | static int32_t |
1896 | | dissect_lldp_port_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset, |
1897 | | profinet_lldp_column_info *pn_lldp_column_info) |
1898 | 1 | { |
1899 | 1 | uint8_t tlvsubType; |
1900 | 1 | uint16_t tempShort; |
1901 | 1 | uint32_t dataLen = 0; |
1902 | 1 | const char *strPtr=NULL; |
1903 | 1 | const char *idType=NULL; |
1904 | 1 | uint8_t addr_family = 0; |
1905 | | |
1906 | 1 | proto_tree *port_tree = NULL; |
1907 | 1 | proto_item *tf = NULL, *lf = NULL; |
1908 | | |
1909 | | /* Get tlv type */ |
1910 | 1 | tempShort = tvb_get_ntohs(tvb, offset); |
1911 | 1 | tlvsubType = TLV_TYPE(tempShort); |
1912 | 1 | if (tlvsubType != PORT_ID_TLV_TYPE) |
1913 | 1 | { |
1914 | 1 | proto_tree_add_expert_format(tree, pinfo, &ei_lldp_bad_type , tvb, offset, TLV_INFO_LEN(tempShort), |
1915 | 1 | "Invalid Port ID (0x%02X), expected (0x%02X)", tlvsubType, PORT_ID_TLV_TYPE); |
1916 | | |
1917 | 1 | return -1; |
1918 | 1 | } |
1919 | | |
1920 | | /* Get tlv length and subtype */ |
1921 | 0 | dataLen = TLV_INFO_LEN(tempShort); |
1922 | 0 | tlvsubType = tvb_get_uint8(tvb, (offset+2)); |
1923 | | |
1924 | | /* Set port tree */ |
1925 | 0 | port_tree = proto_tree_add_subtree_format(tree, tvb, offset, (dataLen + 2), ett_port_id, &tf, "Port Subtype = %s", |
1926 | 0 | val_to_str_const(tlvsubType, port_id_subtypes, "Unknown" )); |
1927 | |
|
1928 | 0 | proto_tree_add_item(port_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
1929 | 0 | lf = proto_tree_add_item(port_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
1930 | |
|
1931 | 0 | offset += 2; |
1932 | |
|
1933 | 0 | if (dataLen < 2) { |
1934 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, |
1935 | 0 | "Invalid Port ID Length (%u), expected > (2)", dataLen); |
1936 | |
|
1937 | 0 | return -1; |
1938 | 0 | } |
1939 | | |
1940 | | /* Get port id subtype */ |
1941 | 0 | proto_tree_add_item(port_tree, hf_port_id_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
1942 | |
|
1943 | 0 | offset++; |
1944 | |
|
1945 | 0 | switch (tlvsubType) |
1946 | 0 | { |
1947 | 0 | case 3: /* MAC address */ |
1948 | 0 | if (dataLen != 7) |
1949 | 0 | { |
1950 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, |
1951 | 0 | "Invalid Port ID Length (%u) for Type (%s), expected (7)", dataLen, val_to_str_const(tlvsubType, port_id_subtypes, "")); |
1952 | 0 | return -1; |
1953 | 0 | } |
1954 | | |
1955 | 0 | idType = "MA"; |
1956 | 0 | strPtr = tvb_ether_to_str(pinfo->pool, tvb, offset); |
1957 | 0 | proto_tree_add_item(port_tree, hf_port_id_mac, tvb, offset, 6, ENC_NA); |
1958 | |
|
1959 | 0 | offset += (dataLen - 1); |
1960 | 0 | break; |
1961 | 0 | case 4: /* Network address */ |
1962 | | /* Get network address family */ |
1963 | 0 | addr_family = tvb_get_uint8(tvb,offset); |
1964 | 0 | proto_tree_add_item(port_tree, hf_lldp_network_address_family, tvb, offset, 1, ENC_BIG_ENDIAN); |
1965 | |
|
1966 | 0 | offset++; |
1967 | |
|
1968 | 0 | idType = "NA"; |
1969 | | |
1970 | | /* Check for IPv4 or IPv6 */ |
1971 | 0 | switch(addr_family){ |
1972 | 0 | case AFNUM_INET: |
1973 | 0 | if (dataLen == 6){ |
1974 | 0 | strPtr = tvb_ip_to_str(pinfo->pool, tvb, offset); |
1975 | 0 | }else{ |
1976 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, |
1977 | 0 | "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, "")); |
1978 | 0 | return -1; |
1979 | 0 | } |
1980 | | |
1981 | 0 | proto_tree_add_item(port_tree, hf_port_id_ip4, tvb, offset, 4, ENC_BIG_ENDIAN); |
1982 | |
|
1983 | 0 | break; |
1984 | 0 | case AFNUM_INET6: |
1985 | 0 | if (dataLen == 18){ |
1986 | 0 | strPtr = tvb_ip6_to_str(pinfo->pool, tvb, offset); |
1987 | 0 | }else{ |
1988 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, |
1989 | 0 | "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, "")); |
1990 | 0 | return -1; |
1991 | 0 | } |
1992 | | |
1993 | 0 | proto_tree_add_item(port_tree, hf_port_id_ip6, tvb, offset, 16, ENC_NA); |
1994 | |
|
1995 | 0 | break; |
1996 | 0 | default: |
1997 | 0 | strPtr = tvb_bytes_to_str(pinfo->pool, tvb, offset, (dataLen-2)); |
1998 | 0 | proto_tree_add_item(port_tree, hf_port_id, tvb, offset, (dataLen-2), ENC_ASCII); |
1999 | |
|
2000 | 0 | break; |
2001 | 0 | } |
2002 | | |
2003 | 0 | offset += (dataLen - 2); |
2004 | 0 | break; |
2005 | 0 | case 1: /* Interface alias */ |
2006 | 0 | case 2: /* Port Component */ |
2007 | 0 | case 5: /* Interface name */ |
2008 | 0 | case 6: /* Agent circuit ID */ |
2009 | 0 | case 7: /* Locally assigned */ |
2010 | 0 | default: |
2011 | 0 | if (dataLen > 256) |
2012 | 0 | { |
2013 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length_excess, |
2014 | 0 | "Invalid Port ID Length (%u) for Type (%s), expected < (256)", dataLen, val_to_str_const(tlvsubType, port_id_subtypes, "")); |
2015 | 0 | return -1; |
2016 | 0 | } |
2017 | | |
2018 | 0 | switch (tlvsubType) |
2019 | 0 | { |
2020 | 0 | case 1: /* Interface alias */ |
2021 | 0 | idType = "IA"; |
2022 | 0 | strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1)); |
2023 | 0 | break; |
2024 | 0 | case 2: /* Port component */ |
2025 | 0 | idType = "PC"; |
2026 | 0 | strPtr = tvb_bytes_to_str(pinfo->pool, tvb, offset, (dataLen-1)); |
2027 | 0 | break; |
2028 | 0 | case 5: /* Interface name */ |
2029 | 0 | idType = "IN"; |
2030 | 0 | strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1)); |
2031 | 0 | break; |
2032 | 0 | case 6: /* Agent circuit ID */ |
2033 | 0 | idType = "AC"; |
2034 | 0 | strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen - 1)); |
2035 | 0 | break; |
2036 | 0 | case 7: /* Locally assigned */ |
2037 | 0 | idType = "LA"; |
2038 | 0 | strPtr = tvb_format_stringzpad(pinfo->pool, tvb, offset, (dataLen-1)); |
2039 | 0 | pn_lldp_column_info->port_id_locally_assigned = wmem_strdup(pinfo->pool, strPtr); |
2040 | 0 | break; |
2041 | 0 | default: |
2042 | 0 | idType = "Rs"; |
2043 | 0 | strPtr = "Reserved"; |
2044 | 0 | break; |
2045 | 0 | } |
2046 | | |
2047 | 0 | proto_tree_add_item(port_tree, hf_port_id, tvb, offset, (dataLen-1), ENC_ASCII); |
2048 | |
|
2049 | 0 | offset += (dataLen - 1); |
2050 | 0 | break; |
2051 | 0 | } |
2052 | 0 | if (column_info_selection == DEFAULT_COLUMN_INFO) |
2053 | 0 | { |
2054 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "%s/%s ", idType, strPtr); |
2055 | 0 | } |
2056 | 0 | proto_item_append_text(tf, ", Id: %s", strPtr); |
2057 | |
|
2058 | 0 | return offset; |
2059 | 0 | } |
2060 | | |
2061 | | /* Dissect Time To Live TLV (Mandatory) */ |
2062 | | static int32_t |
2063 | | dissect_lldp_time_to_live(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset, uint16_t *isShutdown) |
2064 | 0 | { |
2065 | 0 | uint8_t tlvsubType; |
2066 | 0 | uint16_t tempShort; |
2067 | 0 | uint32_t dataLen = 0; |
2068 | |
|
2069 | 0 | proto_tree *time_to_live_tree; |
2070 | 0 | proto_item *ti; |
2071 | | |
2072 | | /* Get tlv type */ |
2073 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
2074 | 0 | tlvsubType = TLV_TYPE(tempShort); |
2075 | 0 | if (tlvsubType != TIME_TO_LIVE_TLV_TYPE) |
2076 | 0 | return -1; |
2077 | | |
2078 | | /* Get tlv length and seconds field */ |
2079 | 0 | dataLen = TLV_INFO_LEN(tempShort); |
2080 | 0 | tempShort = tvb_get_ntohs(tvb, (offset+2)); |
2081 | 0 | *isShutdown = !tempShort; |
2082 | | |
2083 | | /* LLDPDU types: IEEE 802.1AB-2016 9.1.2 */ |
2084 | 0 | if (tempShort != 0) { |
2085 | 0 | time_to_live_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2, |
2086 | 0 | ett_time_to_live, NULL, "Time To Live = %u sec", tempShort); |
2087 | 0 | ti = proto_tree_add_none_format(time_to_live_tree, hf_pdu_type, tvb, offset, dataLen + 2, "Normal LLDPDU"); |
2088 | 0 | proto_item_set_generated(ti); |
2089 | 0 | } else { |
2090 | 0 | time_to_live_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2, |
2091 | 0 | ett_time_to_live, NULL, "Discard all info for this MSAP (Time To Live = 0)"); |
2092 | 0 | ti = proto_tree_add_none_format(time_to_live_tree, hf_pdu_type, tvb, offset, dataLen + 2, "Shutdown LLDPDU"); |
2093 | 0 | proto_item_set_generated(ti); |
2094 | 0 | } |
2095 | |
|
2096 | 0 | proto_tree_add_item(time_to_live_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
2097 | 0 | proto_tree_add_item(time_to_live_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
2098 | 0 | offset += 2; |
2099 | | |
2100 | | /* Display time to live information */ |
2101 | 0 | proto_tree_add_item(time_to_live_tree, hf_time_to_live, tvb, offset, 2, ENC_BIG_ENDIAN); |
2102 | 0 | offset += 2; |
2103 | |
|
2104 | 0 | if (column_info_selection == DEFAULT_COLUMN_INFO) { |
2105 | 0 | if (tempShort != 0) { |
2106 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "%u ", tempShort); |
2107 | 0 | } else { |
2108 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", "0 (Shutdown LLDPDU)"); |
2109 | 0 | } |
2110 | 0 | } |
2111 | |
|
2112 | 0 | return offset; |
2113 | 0 | } |
2114 | | |
2115 | | /* Dissect End of LLDPDU TLV */ |
2116 | | /* As of 802.1ab-2016 LLDP is defective by design. The End of LLDPDU was changed from its |
2117 | | * previously mandatory state to optional. With nothing to indicate the length of the entire LLDPDU |
2118 | | * and no marker to indicate the end of the LLDPDU there are now cases where it is not possible to |
2119 | | * affirmatively determine that an LLDPDU has ended. Depending on where a capture is collected, |
2120 | | * additional data may follow the LLDPDU (FCS, diagnostic trailers, non-zero padding, etc...) |
2121 | | */ |
2122 | | static int32_t |
2123 | | dissect_lldp_end_of_lldpdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset) |
2124 | 0 | { |
2125 | 0 | uint8_t tlvType; |
2126 | 0 | uint16_t dataLen; |
2127 | 0 | uint16_t tempShort; |
2128 | |
|
2129 | 0 | proto_tree *end_of_lldpdu_tree, *lf; |
2130 | | |
2131 | | /* Get tlv type and length */ |
2132 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
2133 | 0 | tlvType = TLV_TYPE(tempShort); |
2134 | | |
2135 | | /* Get tlv length */ |
2136 | 0 | dataLen = TLV_INFO_LEN(tempShort); |
2137 | | |
2138 | | /* Set port tree */ |
2139 | 0 | end_of_lldpdu_tree = proto_tree_add_subtree(tree, tvb, offset, (dataLen + 2), ett_end_of_lldpdu, NULL, "End of LLDPDU"); |
2140 | |
|
2141 | 0 | proto_tree_add_item(end_of_lldpdu_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
2142 | 0 | lf = proto_tree_add_item(end_of_lldpdu_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
2143 | 0 | if (dataLen > 0) |
2144 | 0 | { |
2145 | | /* Either a corrupt / bad End of LLDPDU, or the start of something after an LLDPDU |
2146 | | * without an End of LLDPDU TLV. |
2147 | | * Add EI pointing out possible invalid End of LLDP, but do not consume bytes. |
2148 | | * Any trailer, FCS, etc starting with 0x00 or 0x01 would be interpreted as an |
2149 | | * End of LLDPDU. Chances are better that they belong to another dissector vs. |
2150 | | * being a malformed End of LLDPDU (or other TLV). |
2151 | | * |
2152 | | * It may be reasonable to add pref to consume the bytes anyway |
2153 | | */ |
2154 | |
|
2155 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length_excess, |
2156 | 0 | "Invalid Length (%u) for Type (%s), expected (0)", dataLen, val_to_str_const(tlvType, tlv_types, "")); |
2157 | 0 | return -1; |
2158 | 0 | } |
2159 | | |
2160 | 0 | offset += 2; |
2161 | 0 | return offset; |
2162 | 0 | } |
2163 | | |
2164 | | /* Dissect Port Description TLV */ |
2165 | | static int32_t |
2166 | | dissect_lldp_port_desc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset) |
2167 | 0 | { |
2168 | 0 | uint16_t tempShort; |
2169 | 0 | uint32_t dataLen = 0; |
2170 | 0 | const char *strPtr; |
2171 | |
|
2172 | 0 | proto_tree *port_desc_tree; |
2173 | | |
2174 | | /* Get tlv type and length */ |
2175 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
2176 | | |
2177 | | /* Get tlv length */ |
2178 | 0 | dataLen = TLV_INFO_LEN(tempShort); |
2179 | |
|
2180 | 0 | strPtr = tvb_format_stringzpad(pinfo->pool, tvb, (offset+2), dataLen); |
2181 | | |
2182 | | /* Set port tree */ |
2183 | 0 | port_desc_tree = proto_tree_add_subtree_format(tree, tvb, offset, (dataLen + 2), |
2184 | 0 | ett_port_description, NULL, "Port Description = %s", strPtr); |
2185 | |
|
2186 | 0 | proto_tree_add_item(port_desc_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
2187 | 0 | proto_tree_add_item(port_desc_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
2188 | |
|
2189 | 0 | offset += 2; |
2190 | | /* Display port description information */ |
2191 | 0 | proto_tree_add_item(port_desc_tree, hf_port_desc, tvb, offset, dataLen, ENC_ASCII); |
2192 | |
|
2193 | 0 | offset += dataLen; |
2194 | |
|
2195 | 0 | return offset; |
2196 | 0 | } |
2197 | | |
2198 | | /* Dissect System Name and description TLV */ |
2199 | | static int32_t |
2200 | | dissect_lldp_system_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset) |
2201 | 0 | { |
2202 | 0 | uint16_t tempShort; |
2203 | 0 | uint32_t dataLen = 0; |
2204 | 0 | uint8_t tlvsubType; |
2205 | 0 | const char *strPtr; |
2206 | |
|
2207 | 0 | proto_tree *system_subtree; |
2208 | | |
2209 | | /* Get tlv type and length */ |
2210 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
2211 | 0 | tlvsubType = TLV_TYPE(tempShort); |
2212 | | |
2213 | | /* Get tlv length */ |
2214 | 0 | dataLen = TLV_INFO_LEN(tempShort); |
2215 | |
|
2216 | 0 | strPtr = tvb_format_stringzpad(pinfo->pool, tvb, (offset+2), dataLen); |
2217 | | |
2218 | | /* Set system name tree */ |
2219 | 0 | if (tlvsubType == SYSTEM_NAME_TLV_TYPE) { |
2220 | 0 | system_subtree = proto_tree_add_subtree_format(tree, tvb, offset, (dataLen + 2), |
2221 | 0 | ett_system_name, NULL, "System Name = %s", strPtr); |
2222 | 0 | if (column_info_selection == DEFAULT_COLUMN_INFO) |
2223 | 0 | { |
2224 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "SysN=%s ", strPtr); |
2225 | 0 | } |
2226 | 0 | } else { |
2227 | 0 | system_subtree = proto_tree_add_subtree_format(tree, tvb, offset, (dataLen + 2), |
2228 | 0 | ett_system_desc, NULL, "System Description = %s", strPtr); |
2229 | 0 | if (column_info_selection == DEFAULT_COLUMN_INFO) |
2230 | 0 | { |
2231 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "SysD=%s ", strPtr); |
2232 | 0 | } |
2233 | 0 | } |
2234 | |
|
2235 | 0 | proto_tree_add_item(system_subtree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
2236 | 0 | proto_tree_add_item(system_subtree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
2237 | |
|
2238 | 0 | offset +=2; |
2239 | | |
2240 | | /* Display system name information */ |
2241 | 0 | if (tlvsubType == SYSTEM_NAME_TLV_TYPE) |
2242 | 0 | proto_tree_add_item(system_subtree, hf_lldp_tlv_system_name, tvb, offset, dataLen, ENC_ASCII); |
2243 | 0 | else |
2244 | 0 | proto_tree_add_item(system_subtree, hf_lldp_tlv_system_desc, tvb, offset, dataLen, ENC_ASCII); |
2245 | |
|
2246 | 0 | offset += dataLen; |
2247 | |
|
2248 | 0 | return offset; |
2249 | 0 | } |
2250 | | |
2251 | | /* Dissect System Capabilities TLV */ |
2252 | | static int32_t |
2253 | | dissect_lldp_system_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset) |
2254 | 0 | { |
2255 | 0 | uint16_t tempShort; |
2256 | 0 | uint32_t dataLen = 0; |
2257 | |
|
2258 | 0 | proto_tree *system_capabilities_tree; |
2259 | 0 | proto_tree *capabilities_summary_tree; |
2260 | 0 | proto_tree *capabilities_enabled_tree; |
2261 | 0 | proto_item *tf; |
2262 | | |
2263 | | /* Get tlv type and length */ |
2264 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
2265 | | |
2266 | | /* Get tlv length */ |
2267 | 0 | dataLen = TLV_INFO_LEN(tempShort); |
2268 | | |
2269 | | /* Set system capabilities tree */ |
2270 | 0 | system_capabilities_tree = proto_tree_add_subtree(tree, tvb, offset, (dataLen + 2), ett_system_cap, NULL, "Capabilities"); |
2271 | |
|
2272 | 0 | proto_tree_add_item(system_capabilities_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
2273 | 0 | proto_tree_add_item(system_capabilities_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
2274 | |
|
2275 | 0 | offset += 2; |
2276 | | /* Display system capability information */ |
2277 | 0 | tf = proto_tree_add_item(system_capabilities_tree, hf_lldp_tlv_system_cap, tvb, offset, 2, ENC_BIG_ENDIAN); |
2278 | 0 | capabilities_summary_tree = proto_item_add_subtree(tf, ett_system_cap_summary); |
2279 | | |
2280 | | /* Add capabilities to summary tree */ |
2281 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_other, tvb, offset, 2, ENC_BIG_ENDIAN); |
2282 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_repeater, tvb, offset, 2, ENC_BIG_ENDIAN); |
2283 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_bridge, tvb, offset, 2, ENC_BIG_ENDIAN); |
2284 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_wlan_access_pt, tvb, offset, 2, ENC_BIG_ENDIAN); |
2285 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_router, tvb, offset, 2, ENC_BIG_ENDIAN); |
2286 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_telephone, tvb, offset, 2, ENC_BIG_ENDIAN); |
2287 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_docsis_cable_device, tvb, offset, 2, ENC_BIG_ENDIAN); |
2288 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_station_only, tvb, offset, 2, ENC_BIG_ENDIAN); |
2289 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_cvlan_component, tvb, offset, 2, ENC_BIG_ENDIAN); |
2290 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_svlan_component, tvb, offset, 2, ENC_BIG_ENDIAN); |
2291 | 0 | proto_tree_add_item(capabilities_summary_tree, hf_lldp_tlv_system_cap_tpmr_component, tvb, offset, 2, ENC_BIG_ENDIAN); |
2292 | |
|
2293 | 0 | offset += 2; |
2294 | | /* Get enabled summary */ |
2295 | | |
2296 | | /* Display system capability information */ |
2297 | 0 | tf = proto_tree_add_item(system_capabilities_tree, hf_lldp_tlv_enable_system_cap, tvb, offset, 2, ENC_BIG_ENDIAN); |
2298 | 0 | capabilities_enabled_tree = proto_item_add_subtree(tf, ett_system_cap_enabled); |
2299 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_other, tvb, offset, 2, ENC_BIG_ENDIAN); |
2300 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_repeater, tvb, offset, 2, ENC_BIG_ENDIAN); |
2301 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_bridge, tvb, offset, 2, ENC_BIG_ENDIAN); |
2302 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_wlan_access_pt, tvb, offset, 2, ENC_BIG_ENDIAN); |
2303 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_router, tvb, offset, 2, ENC_BIG_ENDIAN); |
2304 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_telephone, tvb, offset, 2, ENC_BIG_ENDIAN); |
2305 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_docsis_cable_device, tvb, offset, 2, ENC_BIG_ENDIAN); |
2306 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_station_only, tvb, offset, 2, ENC_BIG_ENDIAN); |
2307 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_cvlan_component, tvb, offset, 2, ENC_BIG_ENDIAN); |
2308 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_svlan_component, tvb, offset, 2, ENC_BIG_ENDIAN); |
2309 | 0 | proto_tree_add_item(capabilities_enabled_tree, hf_lldp_tlv_enable_system_cap_tpmr_component, tvb, offset, 2, ENC_BIG_ENDIAN); |
2310 | |
|
2311 | 0 | offset += 2; |
2312 | |
|
2313 | 0 | return offset; |
2314 | 0 | } |
2315 | | |
2316 | | /* Dissect Management Address TLV */ |
2317 | | static int32_t |
2318 | | dissect_lldp_management_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset) |
2319 | 0 | { |
2320 | 0 | uint16_t tempShort; |
2321 | 0 | uint32_t dataLen = 0; |
2322 | 0 | uint8_t subtypeByte; |
2323 | 0 | uint8_t stringLen = 0; |
2324 | |
|
2325 | 0 | proto_tree *system_mgm_addr; |
2326 | | |
2327 | | /* Get tlv type and length */ |
2328 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
2329 | | |
2330 | | /* Get tlv length */ |
2331 | 0 | dataLen = TLV_INFO_LEN(tempShort); |
2332 | | |
2333 | | /* Set system capabilities tree */ |
2334 | 0 | system_mgm_addr = proto_tree_add_subtree(tree, tvb, offset, (dataLen + 2), ett_management_address, NULL, "Management Address"); |
2335 | |
|
2336 | 0 | proto_tree_add_item(system_mgm_addr, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
2337 | 0 | proto_tree_add_item(system_mgm_addr, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
2338 | |
|
2339 | 0 | offset += 2; |
2340 | | |
2341 | | /* Get management address string length */ |
2342 | 0 | stringLen = tvb_get_uint8(tvb, offset); |
2343 | 0 | proto_tree_add_item(system_mgm_addr, hf_mgn_address_len, tvb, offset, 1, ENC_BIG_ENDIAN); |
2344 | |
|
2345 | 0 | offset++; |
2346 | | |
2347 | | /* Get management address subtype */ |
2348 | 0 | subtypeByte = tvb_get_uint8(tvb, offset); |
2349 | 0 | proto_tree_add_item(system_mgm_addr, hf_mgn_address_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
2350 | |
|
2351 | 0 | offset++; |
2352 | | |
2353 | | /* Get address */ |
2354 | 0 | switch (subtypeByte) |
2355 | 0 | { |
2356 | | /* XXX - Should we throw an exception if stringLen doesn't match our address length? */ |
2357 | 0 | case 1: /* IPv4 */ |
2358 | 0 | proto_tree_add_item(system_mgm_addr, hf_mgn_addr_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); |
2359 | 0 | break; |
2360 | 0 | case 2: /* IPv6 */ |
2361 | 0 | proto_tree_add_item(system_mgm_addr, hf_mgn_addr_ipv6, tvb, offset, 16, ENC_NA); |
2362 | 0 | break; |
2363 | 0 | default: |
2364 | 0 | proto_tree_add_item(system_mgm_addr, hf_mgn_addr_hex, tvb, offset, (stringLen-1), ENC_NA); |
2365 | 0 | break; |
2366 | 0 | } |
2367 | | |
2368 | 0 | offset += (stringLen-1); |
2369 | | |
2370 | | /* Get interface numbering subtype */ |
2371 | 0 | proto_tree_add_item(system_mgm_addr, hf_mgn_interface_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
2372 | |
|
2373 | 0 | offset++; |
2374 | | |
2375 | | /* Get interface number */ |
2376 | 0 | proto_tree_add_item(system_mgm_addr, hf_mgn_interface_number, tvb, offset, 4, ENC_BIG_ENDIAN); |
2377 | |
|
2378 | 0 | offset += 4; |
2379 | | |
2380 | | /* Get OID string length */ |
2381 | 0 | stringLen = tvb_get_uint8(tvb, offset); |
2382 | 0 | proto_tree_add_item(system_mgm_addr, hf_mgn_oid_len, tvb, offset, 1, ENC_BIG_ENDIAN); |
2383 | |
|
2384 | 0 | offset++; |
2385 | |
|
2386 | 0 | if (stringLen > 0) |
2387 | 0 | { |
2388 | | /* Get OID identifier */ |
2389 | 0 | proto_tree_add_item(system_mgm_addr, hf_mgn_obj_id, tvb, offset, stringLen, ENC_NA); |
2390 | |
|
2391 | 0 | offset += stringLen; |
2392 | 0 | } |
2393 | |
|
2394 | 0 | return offset; |
2395 | 0 | } |
2396 | | |
2397 | | /* Dissect DCBX TLVs */ |
2398 | | static void |
2399 | | dissect_dcbx_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
2400 | 0 | { |
2401 | 0 | uint8_t subType; |
2402 | 0 | uint32_t offset = 0; |
2403 | 0 | uint8_t priomaskByte, prioCounter, appCount = 0; |
2404 | 0 | uint16_t dataLen; |
2405 | 0 | uint16_t tempShort; |
2406 | |
|
2407 | 0 | proto_tree *subtlv_tree = NULL; |
2408 | 0 | proto_tree *apptlv_tree = NULL; |
2409 | |
|
2410 | 0 | proto_tree_add_item(tree, hf_dcbx_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
2411 | |
|
2412 | 0 | offset++; |
2413 | | |
2414 | | /* One org specific OUI holds many DCBx TLVs */ |
2415 | 0 | while (tvb_reported_length_remaining(tvb, offset) && tree) { |
2416 | |
|
2417 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
2418 | | |
2419 | | /* Get TLV type & len. Actual TLV len = len + 2 */ |
2420 | 0 | subType = TLV_TYPE(tempShort); |
2421 | 0 | dataLen = TLV_INFO_LEN(tempShort); |
2422 | | |
2423 | | /* Write out common header fields first */ |
2424 | 0 | switch (subType) |
2425 | 0 | { |
2426 | 0 | case 0x1: /* Control */ |
2427 | 0 | subtlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2, |
2428 | 0 | ett_org_spc_dcbx_cee_1, NULL, "%s TLV", val_to_str_const(subType, dcbx_subtypes, "Unknown")); |
2429 | 0 | break; |
2430 | 0 | case 0x2: /* Priority Groups */ |
2431 | 0 | subtlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2, |
2432 | 0 | ett_org_spc_dcbx_cee_2, NULL, "%s TLV", val_to_str_const(subType, dcbx_subtypes, "Unknown")); |
2433 | 0 | break; |
2434 | 0 | case 0x3: /* PFC */ |
2435 | 0 | subtlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2, |
2436 | 0 | ett_org_spc_dcbx_cee_3, NULL, "%s TLV", val_to_str_const(subType, dcbx_subtypes, "Unknown")); |
2437 | 0 | break; |
2438 | 0 | case 0x4: /* Application */ |
2439 | 0 | subtlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2, |
2440 | 0 | ett_org_spc_dcbx_cee_4, NULL, "%s TLV", val_to_str_const(subType, dcbx_subtypes, "Unknown")); |
2441 | 0 | break; |
2442 | 0 | case 0x6: /* Logical Link Down */ |
2443 | 0 | subtlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, dataLen + 2, |
2444 | 0 | ett_org_spc_dcbx_cin_6, NULL, "%s TLV", val_to_str_const(subType, dcbx_subtypes, "Unknown")); |
2445 | 0 | break; |
2446 | 0 | } |
2447 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
2448 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
2449 | |
|
2450 | 0 | offset +=2; |
2451 | |
|
2452 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_tlv_oper_version, tvb, offset, 1, ENC_BIG_ENDIAN); |
2453 | |
|
2454 | 0 | offset++; |
2455 | |
|
2456 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_tlv_max_version, tvb, offset, 1, ENC_BIG_ENDIAN); |
2457 | |
|
2458 | 0 | offset++; |
2459 | |
|
2460 | 0 | if (subType == 0x1) { |
2461 | | /* Specific to Control TLV */ |
2462 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_control_sequence, tvb, offset, 4, ENC_BIG_ENDIAN); |
2463 | |
|
2464 | 0 | offset +=4; |
2465 | |
|
2466 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_control_ack, tvb, offset, 4, ENC_BIG_ENDIAN); |
2467 | |
|
2468 | 0 | offset +=4; |
2469 | 0 | } else { |
2470 | | /* Common to all feature TLVs */ |
2471 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_flag_enabled, tvb, offset, 1, ENC_BIG_ENDIAN); |
2472 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_flag_willing, tvb, offset, 1, ENC_BIG_ENDIAN); |
2473 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_flag_error, tvb, offset, 1, ENC_BIG_ENDIAN); |
2474 | |
|
2475 | 0 | offset++; |
2476 | | |
2477 | | /* Unused field, no connection to SubType used to identify TLVs */ |
2478 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
2479 | |
|
2480 | 0 | offset++; |
2481 | |
|
2482 | 0 | switch(subType) |
2483 | 0 | { |
2484 | 0 | case 0x2: /* Priority Groups */ |
2485 | 0 | { |
2486 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_0, tvb, offset, 2, ENC_BIG_ENDIAN); |
2487 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_1, tvb, offset, 2, ENC_BIG_ENDIAN); |
2488 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_2, tvb, offset, 2, ENC_BIG_ENDIAN); |
2489 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_3, tvb, offset, 2, ENC_BIG_ENDIAN); |
2490 | |
|
2491 | 0 | offset +=2; |
2492 | |
|
2493 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_4, tvb, offset, 2, ENC_BIG_ENDIAN); |
2494 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_5, tvb, offset, 2, ENC_BIG_ENDIAN); |
2495 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_6, tvb, offset, 2, ENC_BIG_ENDIAN); |
2496 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pgid_prio_7, tvb, offset, 2, ENC_BIG_ENDIAN); |
2497 | |
|
2498 | 0 | offset +=2; |
2499 | |
|
2500 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_0, tvb, offset, 1, ENC_BIG_ENDIAN); |
2501 | |
|
2502 | 0 | offset++; |
2503 | |
|
2504 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_1, tvb, offset, 1, ENC_BIG_ENDIAN); |
2505 | |
|
2506 | 0 | offset++; |
2507 | |
|
2508 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_2, tvb, offset, 1, ENC_BIG_ENDIAN); |
2509 | |
|
2510 | 0 | offset++; |
2511 | |
|
2512 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_3, tvb, offset, 1, ENC_BIG_ENDIAN); |
2513 | |
|
2514 | 0 | offset++; |
2515 | |
|
2516 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_4, tvb, offset, 1, ENC_BIG_ENDIAN); |
2517 | |
|
2518 | 0 | offset++; |
2519 | |
|
2520 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_5, tvb, offset, 1, ENC_BIG_ENDIAN); |
2521 | |
|
2522 | 0 | offset++; |
2523 | |
|
2524 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_6, tvb, offset, 1, ENC_BIG_ENDIAN); |
2525 | |
|
2526 | 0 | offset++; |
2527 | |
|
2528 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_per_7, tvb, offset, 1, ENC_BIG_ENDIAN); |
2529 | |
|
2530 | 0 | offset++; |
2531 | |
|
2532 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pg_numtcs, tvb, offset, 1, ENC_BIG_ENDIAN); |
2533 | |
|
2534 | 0 | offset++; |
2535 | |
|
2536 | 0 | break; |
2537 | 0 | } |
2538 | 0 | case 0x3: /* PFC */ |
2539 | 0 | { |
2540 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio0, tvb, offset, 1, ENC_BIG_ENDIAN); |
2541 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio1, tvb, offset, 1, ENC_BIG_ENDIAN); |
2542 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio2, tvb, offset, 1, ENC_BIG_ENDIAN); |
2543 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio3, tvb, offset, 1, ENC_BIG_ENDIAN); |
2544 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio4, tvb, offset, 1, ENC_BIG_ENDIAN); |
2545 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio5, tvb, offset, 1, ENC_BIG_ENDIAN); |
2546 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio6, tvb, offset, 1, ENC_BIG_ENDIAN); |
2547 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_prio7, tvb, offset, 1, ENC_BIG_ENDIAN); |
2548 | |
|
2549 | 0 | offset++; |
2550 | |
|
2551 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_pfc_numtcs, tvb, offset, 1, ENC_BIG_ENDIAN); |
2552 | |
|
2553 | 0 | offset++; |
2554 | |
|
2555 | 0 | break; |
2556 | 0 | } |
2557 | 0 | case 0x4: /* Application */ |
2558 | 0 | { |
2559 | | /* One App TLV can hold 4 byte header & multiple apps, each app takes 6 bytes */ |
2560 | 0 | appCount = (dataLen - 4)/6; |
2561 | |
|
2562 | 0 | while(appCount--) { |
2563 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
2564 | |
|
2565 | 0 | apptlv_tree = proto_tree_add_subtree_format(subtlv_tree, tvb, offset, 6, |
2566 | 0 | ett_org_spc_dcbx_cee_app, NULL, "%s Application", |
2567 | 0 | val_to_str_const(tempShort, dcbx_app_types, "Unknown")); |
2568 | |
|
2569 | 0 | proto_tree_add_item(apptlv_tree, hf_dcbx_feature_app_proto, tvb, offset, 2, ENC_BIG_ENDIAN); |
2570 | |
|
2571 | 0 | offset += 2; |
2572 | |
|
2573 | 0 | proto_tree_add_item(apptlv_tree, hf_dcbx_feature_app_oui, tvb, offset, 3, ENC_BIG_ENDIAN); |
2574 | 0 | proto_tree_add_item(apptlv_tree, hf_dcbx_feature_app_selector, tvb, offset, 3, ENC_BIG_ENDIAN); |
2575 | |
|
2576 | 0 | offset += 3; |
2577 | |
|
2578 | 0 | priomaskByte = tvb_get_uint8(tvb, offset); |
2579 | |
|
2580 | 0 | for (prioCounter = 0; prioCounter < 8; prioCounter++) |
2581 | 0 | if(priomaskByte & (0x1 << prioCounter)) { |
2582 | 0 | proto_tree_add_uint(apptlv_tree, hf_dcbx_feature_app_prio, tvb, offset, 1, prioCounter); |
2583 | 0 | break; |
2584 | 0 | } |
2585 | |
|
2586 | 0 | offset++; |
2587 | 0 | } |
2588 | 0 | break; |
2589 | 0 | } |
2590 | 0 | case 0x6: /* Logical Link Down */ |
2591 | 0 | { |
2592 | 0 | proto_tree_add_item(subtlv_tree, hf_dcbx_feature_flag_llink_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
2593 | |
|
2594 | 0 | offset++; |
2595 | |
|
2596 | 0 | break; |
2597 | 0 | } |
2598 | 0 | } |
2599 | 0 | } |
2600 | |
|
2601 | 0 | } |
2602 | | |
2603 | 0 | return; |
2604 | 0 | } |
2605 | | |
2606 | | /* Dissect IEEE 802.1 TLVs */ |
2607 | | static int |
2608 | | dissect_ieee_802_1_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
2609 | 0 | { |
2610 | 0 | uint8_t subType; |
2611 | 0 | uint32_t offset = 0; |
2612 | 0 | uint8_t tempByte; |
2613 | 0 | uint16_t dcbApp, appCount; |
2614 | |
|
2615 | 0 | proto_tree *vlan_flags_tree = NULL; |
2616 | 0 | proto_tree *mac_phy_flags = NULL; |
2617 | 0 | proto_tree *apptlv_tree = NULL; |
2618 | 0 | proto_item *tf = NULL; |
2619 | | |
2620 | | /* Get subtype */ |
2621 | 0 | subType = tvb_get_uint8(tvb, offset); |
2622 | |
|
2623 | 0 | proto_tree_add_item(tree, hf_ieee_802_1_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
2624 | |
|
2625 | 0 | offset++; |
2626 | |
|
2627 | 0 | switch (subType) |
2628 | 0 | { |
2629 | 0 | case 0x01: /* Port VLAN ID */ |
2630 | 0 | { |
2631 | 0 | proto_tree_add_item(tree, hf_ieee_802_1_port_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN); |
2632 | |
|
2633 | 0 | offset +=2; |
2634 | |
|
2635 | 0 | break; |
2636 | 0 | } |
2637 | 0 | case 0x02: /* Port and Protocol VLAN ID */ |
2638 | 0 | { |
2639 | | /* Get flags */ |
2640 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_1_port_and_vlan_id_flag, tvb, offset, 1, ENC_BIG_ENDIAN); |
2641 | 0 | vlan_flags_tree = proto_item_add_subtree(tf, ett_port_vlan_flags); |
2642 | |
|
2643 | 0 | proto_tree_add_item(vlan_flags_tree, hf_ieee_802_1_port_and_vlan_id_flag_supported, tvb, offset, 1, ENC_BIG_ENDIAN); |
2644 | 0 | proto_tree_add_item(vlan_flags_tree, hf_ieee_802_1_port_and_vlan_id_flag_enabled, tvb, offset, 1, ENC_BIG_ENDIAN); |
2645 | |
|
2646 | 0 | offset++; |
2647 | |
|
2648 | 0 | proto_tree_add_item(tree, hf_ieee_802_1_port_proto_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN); |
2649 | |
|
2650 | 0 | offset +=2; |
2651 | |
|
2652 | 0 | break; |
2653 | 0 | } |
2654 | 0 | case 0x03: /* VLAN Name */ |
2655 | 0 | { |
2656 | 0 | proto_tree_add_item(tree, hf_ieee_802_1_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN); |
2657 | |
|
2658 | 0 | offset += 2; |
2659 | | |
2660 | | /* Get vlan name length */ |
2661 | 0 | tempByte = tvb_get_uint8(tvb, offset); |
2662 | 0 | proto_tree_add_item(tree, hf_ieee_802_1_vlan_name_length, tvb, offset, 1, ENC_BIG_ENDIAN); |
2663 | |
|
2664 | 0 | offset++; |
2665 | |
|
2666 | 0 | if (tempByte > 0) |
2667 | 0 | { |
2668 | 0 | proto_tree_add_item(tree, hf_ieee_802_1_vlan_name, tvb, offset, tempByte, ENC_ASCII); |
2669 | |
|
2670 | 0 | offset += tempByte; |
2671 | 0 | } |
2672 | |
|
2673 | 0 | break; |
2674 | 0 | } |
2675 | 0 | case 0x04: /* Protocol ID */ |
2676 | 0 | { |
2677 | | /* Get protocol id length */ |
2678 | 0 | tempByte = tvb_get_uint8(tvb, offset); |
2679 | 0 | proto_tree_add_item(tree, hf_ieee_802_1_proto_id_length, tvb, offset, 1, ENC_BIG_ENDIAN); |
2680 | |
|
2681 | 0 | offset++; |
2682 | |
|
2683 | 0 | if (tempByte > 0) |
2684 | 0 | { |
2685 | | /* |
2686 | | * Section D.2.4.3 "protocol identity" of IEEE |
2687 | | * 802.1Q-2018 says: |
2688 | | * |
2689 | | * The protocol identity field shall contain |
2690 | | * the first n octets of the protocol after |
2691 | | * the layer 2 addresses (i.e., for example, |
2692 | | * starting with the EtherType field) that the |
2693 | | * sender would like to advertise. |
2694 | | * |
2695 | | * What comes "after the layer 2 addresses" |
2696 | | * depends on the network type. For Ethernet, |
2697 | | * it's a type/length field, with, if it's a |
2698 | | * length field, an 802.2 LLC header, with, |
2699 | | * if that header specifies SNAP, a SNAP header |
2700 | | * following it. For other network types, it's |
2701 | | * just going to be an 802.2 LLC header (presumably, |
2702 | | * if the layer 2 addresses aren't immediately |
2703 | | * before the 802.2 header, this doesn't include |
2704 | | * the fields between the last layer 2 address |
2705 | | * and the 802.2 header). |
2706 | | * |
2707 | | * We currently just show it as a blob of bytes. |
2708 | | */ |
2709 | 0 | proto_tree_add_item(tree, hf_ieee_802_1_proto_id, tvb, offset, tempByte, ENC_NA); |
2710 | |
|
2711 | 0 | offset += tempByte; |
2712 | 0 | } |
2713 | |
|
2714 | 0 | break; |
2715 | 0 | } |
2716 | 0 | case 0x07: /* Link Aggregation */ |
2717 | 0 | { |
2718 | | /* Get protocol id length */ |
2719 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_1_aggregation_status, tvb, offset, 1, ENC_BIG_ENDIAN); |
2720 | 0 | mac_phy_flags = proto_item_add_subtree(tf, ett_802_1_aggregation); |
2721 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_1_aggregation_status_cap, tvb, offset, 1, ENC_BIG_ENDIAN); |
2722 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_1_aggregation_status_enabled, tvb, offset, 1, ENC_BIG_ENDIAN); |
2723 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_1_aggregation_status_porttype, tvb, offset, 1, ENC_BIG_ENDIAN); |
2724 | |
|
2725 | 0 | offset++; |
2726 | | |
2727 | | /* Get aggregated port id */ |
2728 | 0 | proto_tree_add_item(tree, hf_ieee_802_1_aggregated_port_id, tvb, offset, 4, ENC_BIG_ENDIAN); |
2729 | |
|
2730 | 0 | offset+=4; |
2731 | 0 | break; |
2732 | 0 | } |
2733 | 0 | case 0x8: /* Congestion Notification */ |
2734 | 0 | { |
2735 | | /* Per-Priority CNPV Indicators */ |
2736 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio0, tvb, offset, 1, ENC_BIG_ENDIAN); |
2737 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio1, tvb, offset, 1, ENC_BIG_ENDIAN); |
2738 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio2, tvb, offset, 1, ENC_BIG_ENDIAN); |
2739 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio3, tvb, offset, 1, ENC_BIG_ENDIAN); |
2740 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio4, tvb, offset, 1, ENC_BIG_ENDIAN); |
2741 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio5, tvb, offset, 1, ENC_BIG_ENDIAN); |
2742 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio6, tvb, offset, 1, ENC_BIG_ENDIAN); |
2743 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_cnpv_prio7, tvb, offset, 1, ENC_BIG_ENDIAN); |
2744 | |
|
2745 | 0 | offset++; |
2746 | | |
2747 | | /* Per-Priority Ready Indicators */ |
2748 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio0, tvb, offset, 1, ENC_BIG_ENDIAN); |
2749 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio1, tvb, offset, 1, ENC_BIG_ENDIAN); |
2750 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio2, tvb, offset, 1, ENC_BIG_ENDIAN); |
2751 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio3, tvb, offset, 1, ENC_BIG_ENDIAN); |
2752 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio4, tvb, offset, 1, ENC_BIG_ENDIAN); |
2753 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio5, tvb, offset, 1, ENC_BIG_ENDIAN); |
2754 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio6, tvb, offset, 1, ENC_BIG_ENDIAN); |
2755 | 0 | proto_tree_add_item(tree, hf_ieee_8021qau_ready_prio7, tvb, offset, 1, ENC_BIG_ENDIAN); |
2756 | |
|
2757 | 0 | offset++; |
2758 | |
|
2759 | 0 | break; |
2760 | 0 | } |
2761 | 0 | case 0x9: /* ETS Configuration */ |
2762 | 0 | { |
2763 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_feature_flag_willing, tvb, offset, 1, ENC_BIG_ENDIAN); |
2764 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_feature_flag_cbs, tvb, offset, 1, ENC_BIG_ENDIAN); |
2765 | |
|
2766 | 0 | tempByte = (tvb_get_uint8(tvb, offset) & 0x7); |
2767 | | /* 0 implies 8 traffic classes supported */ |
2768 | 0 | proto_tree_add_uint_format_value(tree, hf_ieee_8021az_maxtcs, tvb, offset, 1, tempByte, "%u (0x%X)", tempByte ? tempByte : 8, tempByte); |
2769 | |
|
2770 | 0 | offset++; |
2771 | | |
2772 | | /* Priority Assignment Table */ |
2773 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_0, tvb, offset, 2, ENC_BIG_ENDIAN); |
2774 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_1, tvb, offset, 2, ENC_BIG_ENDIAN); |
2775 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_2, tvb, offset, 2, ENC_BIG_ENDIAN); |
2776 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_3, tvb, offset, 2, ENC_BIG_ENDIAN); |
2777 | |
|
2778 | 0 | offset +=2; |
2779 | |
|
2780 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_4, tvb, offset, 2, ENC_BIG_ENDIAN); |
2781 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_5, tvb, offset, 2, ENC_BIG_ENDIAN); |
2782 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_6, tvb, offset, 2, ENC_BIG_ENDIAN); |
2783 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_7, tvb, offset, 2, ENC_BIG_ENDIAN); |
2784 | |
|
2785 | 0 | offset +=2; |
2786 | | |
2787 | | /* TC Bandwidth Table */ |
2788 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_0, tvb, offset, 1, ENC_BIG_ENDIAN); |
2789 | |
|
2790 | 0 | offset++; |
2791 | |
|
2792 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_1, tvb, offset, 1, ENC_BIG_ENDIAN); |
2793 | |
|
2794 | 0 | offset++; |
2795 | |
|
2796 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_2, tvb, offset, 1, ENC_BIG_ENDIAN); |
2797 | |
|
2798 | 0 | offset++; |
2799 | |
|
2800 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_3, tvb, offset, 1, ENC_BIG_ENDIAN); |
2801 | |
|
2802 | 0 | offset++; |
2803 | |
|
2804 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_4, tvb, offset, 1, ENC_BIG_ENDIAN); |
2805 | |
|
2806 | 0 | offset++; |
2807 | |
|
2808 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_5, tvb, offset, 1, ENC_BIG_ENDIAN); |
2809 | |
|
2810 | 0 | offset++; |
2811 | |
|
2812 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_6, tvb, offset, 1, ENC_BIG_ENDIAN); |
2813 | |
|
2814 | 0 | offset++; |
2815 | |
|
2816 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_7, tvb, offset, 1, ENC_BIG_ENDIAN); |
2817 | |
|
2818 | 0 | offset++; |
2819 | | |
2820 | | /* TSA Assignment Table */ |
2821 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class0, tvb, offset, 1, ENC_BIG_ENDIAN); |
2822 | |
|
2823 | 0 | offset++; |
2824 | |
|
2825 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class1, tvb, offset, 1, ENC_BIG_ENDIAN); |
2826 | |
|
2827 | 0 | offset++; |
2828 | |
|
2829 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class2, tvb, offset, 1, ENC_BIG_ENDIAN); |
2830 | |
|
2831 | 0 | offset++; |
2832 | |
|
2833 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class3, tvb, offset, 1, ENC_BIG_ENDIAN); |
2834 | |
|
2835 | 0 | offset++; |
2836 | |
|
2837 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class4, tvb, offset, 1, ENC_BIG_ENDIAN); |
2838 | |
|
2839 | 0 | offset++; |
2840 | |
|
2841 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class5, tvb, offset, 1, ENC_BIG_ENDIAN); |
2842 | |
|
2843 | 0 | offset++; |
2844 | |
|
2845 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class6, tvb, offset, 1, ENC_BIG_ENDIAN); |
2846 | |
|
2847 | 0 | offset++; |
2848 | |
|
2849 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class7, tvb, offset, 1, ENC_BIG_ENDIAN); |
2850 | |
|
2851 | 0 | offset++; |
2852 | |
|
2853 | 0 | break; |
2854 | 0 | } |
2855 | 0 | case 0xA: /* ETS Recommendation */ |
2856 | 0 | { |
2857 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); |
2858 | |
|
2859 | 0 | offset++; |
2860 | | |
2861 | | /* Priority Assignment Table */ |
2862 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_0, tvb, offset, 2, ENC_BIG_ENDIAN); |
2863 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_1, tvb, offset, 2, ENC_BIG_ENDIAN); |
2864 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_2, tvb, offset, 2, ENC_BIG_ENDIAN); |
2865 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_3, tvb, offset, 2, ENC_BIG_ENDIAN); |
2866 | |
|
2867 | 0 | offset +=2; |
2868 | |
|
2869 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_4, tvb, offset, 2, ENC_BIG_ENDIAN); |
2870 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_5, tvb, offset, 2, ENC_BIG_ENDIAN); |
2871 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_6, tvb, offset, 2, ENC_BIG_ENDIAN); |
2872 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pgid_prio_7, tvb, offset, 2, ENC_BIG_ENDIAN); |
2873 | |
|
2874 | 0 | offset +=2; |
2875 | | |
2876 | | /* TC Bandwidth Table */ |
2877 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_0, tvb, offset, 1, ENC_BIG_ENDIAN); |
2878 | |
|
2879 | 0 | offset++; |
2880 | |
|
2881 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_1, tvb, offset, 1, ENC_BIG_ENDIAN); |
2882 | |
|
2883 | 0 | offset++; |
2884 | |
|
2885 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_2, tvb, offset, 1, ENC_BIG_ENDIAN); |
2886 | |
|
2887 | 0 | offset++; |
2888 | |
|
2889 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_3, tvb, offset, 1, ENC_BIG_ENDIAN); |
2890 | |
|
2891 | 0 | offset++; |
2892 | |
|
2893 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_4, tvb, offset, 1, ENC_BIG_ENDIAN); |
2894 | |
|
2895 | 0 | offset++; |
2896 | |
|
2897 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_5, tvb, offset, 1, ENC_BIG_ENDIAN); |
2898 | |
|
2899 | 0 | offset++; |
2900 | |
|
2901 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_6, tvb, offset, 1, ENC_BIG_ENDIAN); |
2902 | |
|
2903 | 0 | offset++; |
2904 | |
|
2905 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pg_per_7, tvb, offset, 1, ENC_BIG_ENDIAN); |
2906 | |
|
2907 | 0 | offset++; |
2908 | | |
2909 | | /* TSA Assignment Table */ |
2910 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class0, tvb, offset, 1, ENC_BIG_ENDIAN); |
2911 | |
|
2912 | 0 | offset++; |
2913 | |
|
2914 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class1, tvb, offset, 1, ENC_BIG_ENDIAN); |
2915 | |
|
2916 | 0 | offset++; |
2917 | |
|
2918 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class2, tvb, offset, 1, ENC_BIG_ENDIAN); |
2919 | |
|
2920 | 0 | offset++; |
2921 | |
|
2922 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class3, tvb, offset, 1, ENC_BIG_ENDIAN); |
2923 | |
|
2924 | 0 | offset++; |
2925 | |
|
2926 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class4, tvb, offset, 1, ENC_BIG_ENDIAN); |
2927 | |
|
2928 | 0 | offset++; |
2929 | |
|
2930 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class5, tvb, offset, 1, ENC_BIG_ENDIAN); |
2931 | |
|
2932 | 0 | offset++; |
2933 | |
|
2934 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class6, tvb, offset, 1, ENC_BIG_ENDIAN); |
2935 | |
|
2936 | 0 | offset++; |
2937 | |
|
2938 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_tsa_class7, tvb, offset, 1, ENC_BIG_ENDIAN); |
2939 | |
|
2940 | 0 | offset++; |
2941 | |
|
2942 | 0 | break; |
2943 | 0 | } |
2944 | 0 | case 0xB: /* PFC Configuration */ |
2945 | 0 | { |
2946 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_feature_flag_willing, tvb, offset, 1, ENC_BIG_ENDIAN); |
2947 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_feature_flag_mbc, tvb, offset, 1, ENC_BIG_ENDIAN); |
2948 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_pfc_numtcs, tvb, offset, 1, ENC_BIG_ENDIAN); |
2949 | |
|
2950 | 0 | offset++; |
2951 | |
|
2952 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio0, tvb, offset, 1, ENC_BIG_ENDIAN); |
2953 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio1, tvb, offset, 1, ENC_BIG_ENDIAN); |
2954 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio2, tvb, offset, 1, ENC_BIG_ENDIAN); |
2955 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio3, tvb, offset, 1, ENC_BIG_ENDIAN); |
2956 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio4, tvb, offset, 1, ENC_BIG_ENDIAN); |
2957 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio5, tvb, offset, 1, ENC_BIG_ENDIAN); |
2958 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio6, tvb, offset, 1, ENC_BIG_ENDIAN); |
2959 | 0 | proto_tree_add_item(tree, hf_dcbx_feature_pfc_prio7, tvb, offset, 1, ENC_BIG_ENDIAN); |
2960 | |
|
2961 | 0 | offset++; |
2962 | |
|
2963 | 0 | break; |
2964 | 0 | } |
2965 | 0 | case 0xC: /* Application Priority */ |
2966 | 0 | { |
2967 | 0 | proto_tree_add_item(tree, hf_ieee_8021az_app_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); |
2968 | |
|
2969 | 0 | offset++; |
2970 | |
|
2971 | 0 | appCount = tvb_reported_length_remaining(tvb, offset)/3; |
2972 | |
|
2973 | 0 | while(appCount--) { |
2974 | 0 | dcbApp = tvb_get_ntohs(tvb, offset + 1); |
2975 | |
|
2976 | 0 | apptlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3, |
2977 | 0 | ett_org_spc_ieee_dcbx_app, NULL, "%s Application", |
2978 | 0 | val_to_str_const(dcbApp, dcbx_app_types, "Unknown")); |
2979 | |
|
2980 | 0 | proto_tree_add_item(apptlv_tree, hf_ieee_8021az_app_prio, tvb, offset, 1, ENC_BIG_ENDIAN); |
2981 | 0 | proto_tree_add_item(apptlv_tree, hf_ieee_8021az_app_selector, tvb, offset, 1, ENC_BIG_ENDIAN); |
2982 | |
|
2983 | 0 | offset++; |
2984 | |
|
2985 | 0 | proto_tree_add_item(apptlv_tree, hf_dcbx_feature_app_proto, tvb, offset, 2, ENC_BIG_ENDIAN); |
2986 | |
|
2987 | 0 | offset += 2; |
2988 | 0 | } |
2989 | 0 | break; |
2990 | 0 | } |
2991 | 0 | } |
2992 | | |
2993 | 0 | return offset; |
2994 | 0 | } |
2995 | | |
2996 | | /* Dissect IEEE 802.1Qbg TLVs */ |
2997 | | static void |
2998 | | dissect_oui_default_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
2999 | 0 | { |
3000 | 0 | proto_tree_add_item(tree, hf_unknown_subtype, tvb, 0, 1, ENC_BIG_ENDIAN); |
3001 | 0 | if (tvb_captured_length_remaining(tvb, 1) > 0) { |
3002 | 0 | proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, 1, -1, ENC_NA); |
3003 | 0 | } |
3004 | 0 | } |
3005 | | |
3006 | | static void |
3007 | | dissect_ieee_802_1qbg_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
3008 | 0 | { |
3009 | 0 | uint8_t subType; |
3010 | 0 | uint32_t offset = 0; |
3011 | |
|
3012 | 0 | proto_tree *evb_capabilities_subtree = NULL; |
3013 | |
|
3014 | 0 | proto_item *tf = NULL; |
3015 | 0 | subType = tvb_get_uint8(tvb, offset); |
3016 | |
|
3017 | 0 | proto_tree_add_item(tree, hf_ieee_802_1qbg_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
3018 | |
|
3019 | 0 | offset++; |
3020 | |
|
3021 | 0 | switch (subType) { |
3022 | 0 | case 0x00: |
3023 | | /* Get EVB capabilities */ |
3024 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_1qbg_evb_support_caps, tvb, offset, 2, ENC_BIG_ENDIAN); |
3025 | 0 | evb_capabilities_subtree = proto_item_add_subtree(tf, ett_802_1qbg_capabilities_flags); |
3026 | |
|
3027 | 0 | proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_support_caps_std, tvb, offset, 2, ENC_BIG_ENDIAN); |
3028 | 0 | proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_support_caps_rr, tvb, offset, 2, ENC_BIG_ENDIAN); |
3029 | 0 | proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_support_caps_rte, tvb, offset, 2, ENC_BIG_ENDIAN); |
3030 | 0 | proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_support_caps_ecp, tvb, offset, 2, ENC_BIG_ENDIAN); |
3031 | 0 | proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_support_caps_vdp, tvb, offset, 2, ENC_BIG_ENDIAN); |
3032 | |
|
3033 | 0 | offset += 2; |
3034 | |
|
3035 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_1qbg_evb_configure_caps, tvb, offset, 2, ENC_BIG_ENDIAN); |
3036 | 0 | evb_capabilities_subtree = proto_item_add_subtree(tf, ett_802_1qbg_capabilities_flags); |
3037 | |
|
3038 | 0 | proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_configure_caps_std, tvb, offset, 2, ENC_BIG_ENDIAN); |
3039 | 0 | proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_configure_caps_rr, tvb, offset, 2, ENC_BIG_ENDIAN); |
3040 | 0 | proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_configure_caps_rte, tvb, offset, 2, ENC_BIG_ENDIAN); |
3041 | 0 | proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_configure_caps_ecp, tvb, offset, 2, ENC_BIG_ENDIAN); |
3042 | 0 | proto_tree_add_item(evb_capabilities_subtree, hf_ieee_802_1qbg_evb_configure_caps_vdp, tvb, offset, 2, ENC_BIG_ENDIAN); |
3043 | |
|
3044 | 0 | offset += 2; |
3045 | |
|
3046 | 0 | proto_tree_add_item(tree, hf_ieee_802_1qbg_evb_supported_vsi, tvb, offset, 2, ENC_BIG_ENDIAN); |
3047 | |
|
3048 | 0 | offset += 2; |
3049 | |
|
3050 | 0 | proto_tree_add_item(tree, hf_ieee_802_1qbg_evb_configured_vsi, tvb, offset, 2, ENC_BIG_ENDIAN); |
3051 | |
|
3052 | 0 | offset += 2; |
3053 | |
|
3054 | 0 | proto_tree_add_item(tree, hf_ieee_802_1qbg_evb_retrans_timer, tvb, offset, 1, ENC_BIG_ENDIAN); |
3055 | |
|
3056 | 0 | break; |
3057 | 0 | } |
3058 | | |
3059 | 0 | return; |
3060 | 0 | } |
3061 | | |
3062 | | |
3063 | | /* Dissect extreme avaya ap tlv*/ |
3064 | | static int |
3065 | | dissect_extreme_avaya_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint16_t dataLen) |
3066 | 0 | { |
3067 | 0 | uint8_t subType; |
3068 | 0 | uint32_t i, loopCount; |
3069 | 0 | uint32_t offset = 0; |
3070 | | |
3071 | | /* |
3072 | | Element TLV: |
3073 | | ___________________________________________________________________________________________________________________________ |
3074 | | | TLV Type | TLV Length | Avaya OUI | Subtype | HMAC-SHA Digest | Element Type | State | Mgmt. VLAN | Rsvd | System ID | |
3075 | | ---------------------------------------------------------------------------------------------------------------------------- |
3076 | | | 7 bits | 9 bits | 3 octets | 1 octet | 32 octets | 6 bits | 6 bits | 12 bits | 1 octet | 10 octets | |
3077 | | ---------------------------------------------------------------------------------------------------------------------------- |
3078 | | |
3079 | | Assignment TLV: |
3080 | | __________________________________________________________________________________________________________ |
3081 | | | TLV Type | TLV Length | Avaya OUI | Subtype | HMAC-SHA Digest | Assignment Status | VLAN | I-SID | |
3082 | | ---------------------------------------------------------------------------------------------------------- |
3083 | | | 7 bits | 9 bits | 3 octets | 1 octet | 32 octets | 4 bits | 12 bits | 3 octets | |
3084 | | ---------------------------------------------------------------------------------------------------------- |
3085 | | */ |
3086 | | |
3087 | | /* Get subtype */ |
3088 | 0 | subType = tvb_get_uint8(tvb, offset); |
3089 | 0 | proto_tree_add_item(tree, hf_ex_avaya_tlv_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
3090 | 0 | offset++; |
3091 | 0 | switch (subType) |
3092 | 0 | { |
3093 | 0 | case EX_AVAYA_SUBTYPE_ELEMENT_TLV: /* Element TLV */ |
3094 | 0 | { |
3095 | 0 | proto_tree_add_item(tree, hf_ex_avaya_hmac_shi, tvb, offset, 32, ENC_NA); |
3096 | 0 | offset+=32; |
3097 | 0 | proto_tree_add_item(tree, hf_ex_avaya_element_type, tvb, offset, 3, ENC_BIG_ENDIAN); |
3098 | 0 | proto_tree_add_item(tree, hf_ex_avaya_state, tvb, offset, 3, ENC_BIG_ENDIAN); |
3099 | 0 | proto_tree_add_item(tree, hf_ex_avaya_mgnt_vlan, tvb, offset, 3, ENC_BIG_ENDIAN); |
3100 | 0 | offset+=3; |
3101 | 0 | proto_tree_add_item(tree, hf_ex_avaya_rsvd, tvb, offset, 1, ENC_BIG_ENDIAN); |
3102 | 0 | offset+=1; |
3103 | 0 | proto_tree_add_item(tree, hf_ex_avaya_system_id, tvb, offset, 10, ENC_NA); |
3104 | 0 | offset+=10; |
3105 | 0 | break; |
3106 | 0 | } |
3107 | 0 | case EX_AVAYA_SUBTYPE_ASSIGNMENT_TLV: /* Assignment TLV */ |
3108 | 0 | { |
3109 | 0 | loopCount = (dataLen - 36) / 5; |
3110 | 0 | proto_tree_add_item(tree, hf_ex_avaya_hmac_shi, tvb, offset, 32, ENC_NA); |
3111 | 0 | offset+=32; |
3112 | 0 | for ( i=0; i < loopCount; i++) |
3113 | 0 | { |
3114 | 0 | proto_tree_add_item(tree, hf_ex_avaya_status, tvb, offset, 2, ENC_BIG_ENDIAN); |
3115 | 0 | proto_tree_add_item(tree, hf_ex_avaya_vlan, tvb, offset, 2, ENC_BIG_ENDIAN); |
3116 | 0 | offset+=2; |
3117 | 0 | proto_tree_add_item(tree, hf_ex_avaya_i_sid, tvb, offset, 3, ENC_BIG_ENDIAN); |
3118 | 0 | offset+=3; |
3119 | 0 | } |
3120 | 0 | break; |
3121 | 0 | } |
3122 | 0 | } |
3123 | 0 | return offset; |
3124 | 0 | } |
3125 | | |
3126 | | /* Dissect extreme avaya ap tlv*/ |
3127 | | static int |
3128 | | dissect_extreme_avaya2_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
3129 | 0 | { |
3130 | 0 | uint8_t subType; |
3131 | 0 | uint32_t numbvlans, sysidlength; |
3132 | 0 | uint32_t offset = 0; |
3133 | | |
3134 | | /* |
3135 | | Fabric TLV: |
3136 | | _________________________________________________________________________________________________ |
3137 | | | TLV Type | TLV Length | Avaya OUI | Subtype | Num. BVLANs | BVLAN-ID*N | SysID Len | Sysid | |
3138 | | ------------------------------------------------------------------------------------------------- |
3139 | | | 7 bits | 9 bits | 3 octets | 1 octet | 1 octet | 2 octets*N | 1 octet | octets*N | |
3140 | | ------------------------------------------------------------------------------------------------- |
3141 | | */ |
3142 | | |
3143 | | /* Get subtype */ |
3144 | 0 | subType = tvb_get_uint8(tvb, offset); |
3145 | 0 | proto_tree_add_item(tree, hf_ex_avaya2_tlv_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
3146 | 0 | offset++; |
3147 | 0 | switch (subType) { |
3148 | 0 | case EX_AVAYA2_SUBTYPE_ZTFv2_FC_TLV: /* Zero Touch Fabric v2 Fabric Connect TLV */ |
3149 | 0 | proto_tree_add_item(tree, hf_ex_avaya2_fabric_connect, tvb, offset, 1, ENC_NA); |
3150 | 0 | offset++; |
3151 | 0 | proto_tree_add_item_ret_uint(tree, hf_ex_avaya2_fabric_numbvlans, tvb, offset, 1, ENC_NA, &numbvlans); |
3152 | 0 | offset++; |
3153 | 0 | while (numbvlans--) { |
3154 | 0 | proto_tree_add_item(tree, hf_ex_avaya2_fabric_bvlanid, tvb, offset, 2, ENC_BIG_ENDIAN); |
3155 | 0 | offset += 2; |
3156 | 0 | } |
3157 | 0 | proto_tree_add_item_ret_uint(tree, hf_ex_avaya2_fabric_sysidlength, tvb, offset, 1, ENC_NA, &sysidlength); |
3158 | 0 | offset++; |
3159 | 0 | proto_tree_add_item(tree, hf_ex_avaya2_fabric_sysid, tvb, offset, sysidlength, ENC_NA); |
3160 | 0 | offset += sysidlength; |
3161 | 0 | break; |
3162 | 0 | } |
3163 | 0 | return offset; |
3164 | 0 | } |
3165 | | |
3166 | | /* Dissect IEEE 802.3 TLVs */ |
3167 | | static int |
3168 | | dissect_ieee_802_3_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
3169 | 0 | { |
3170 | 0 | uint8_t subType; |
3171 | 0 | uint32_t offset = 0; |
3172 | 0 | uint8_t tempByte; |
3173 | 0 | uint16_t tlvLen = tvb_reported_length(tvb)-offset; |
3174 | |
|
3175 | 0 | proto_tree *mac_phy_flags = NULL; |
3176 | 0 | proto_tree *autoneg_advertised_subtree = NULL; |
3177 | |
|
3178 | 0 | proto_item *tf = NULL, *subitem; |
3179 | | |
3180 | | /* Get subtype */ |
3181 | 0 | subType = tvb_get_uint8(tvb, offset); |
3182 | |
|
3183 | 0 | subitem = proto_tree_add_item(tree, hf_ieee_802_3_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
3184 | |
|
3185 | 0 | offset++; |
3186 | |
|
3187 | 0 | switch (subType) |
3188 | 0 | { |
3189 | 0 | case 0x01: /* MAC/PHY Configuration/Status */ |
3190 | 0 | { |
3191 | | /* Get auto-negotiation info */ |
3192 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_3_mac_phy_auto_neg_status, tvb, offset, 1, ENC_BIG_ENDIAN); |
3193 | 0 | mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_flags); |
3194 | |
|
3195 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mac_phy_auto_neg_status_supported, tvb, offset, 1, ENC_BIG_ENDIAN); |
3196 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mac_phy_auto_neg_status_enabled, tvb, offset, 1, ENC_BIG_ENDIAN); |
3197 | |
|
3198 | 0 | offset++; |
3199 | | |
3200 | | /* Get pmd auto-negotiation advertised capability */ |
3201 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_3_pmd_auto_neg_advertised_caps, tvb, offset, 2, ENC_BIG_ENDIAN); |
3202 | 0 | autoneg_advertised_subtree = proto_item_add_subtree(tf, ett_802_3_autoneg_advertised); |
3203 | |
|
3204 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_tfd, tvb, offset, 2, ENC_BIG_ENDIAN); |
3205 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_t, tvb, offset, 2, ENC_BIG_ENDIAN); |
3206 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_xfd, tvb, offset, 2, ENC_BIG_ENDIAN); |
3207 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_x, tvb, offset, 2, ENC_BIG_ENDIAN); |
3208 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_bpause, tvb, offset, 2, ENC_BIG_ENDIAN); |
3209 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_spause, tvb, offset, 2, ENC_BIG_ENDIAN); |
3210 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_apause, tvb, offset, 2, ENC_BIG_ENDIAN); |
3211 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_pause, tvb, offset, 2, ENC_BIG_ENDIAN); |
3212 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t2fd, tvb, offset, 2, ENC_BIG_ENDIAN); |
3213 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t2, tvb, offset, 2, ENC_BIG_ENDIAN); |
3214 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_txfd, tvb, offset, 2, ENC_BIG_ENDIAN); |
3215 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_tx, tvb, offset, 2, ENC_BIG_ENDIAN); |
3216 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t4, tvb, offset, 2, ENC_BIG_ENDIAN); |
3217 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_10base_tfd, tvb, offset, 2, ENC_BIG_ENDIAN); |
3218 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_10base_t, tvb, offset, 2, ENC_BIG_ENDIAN); |
3219 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_other, tvb, offset, 2, ENC_BIG_ENDIAN); |
3220 | |
|
3221 | 0 | autoneg_advertised_subtree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_802_3_autoneg_advertised, NULL, "Same in inverse (wrong) bitorder"); |
3222 | |
|
3223 | 0 | 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); |
3224 | 0 | 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); |
3225 | 0 | 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); |
3226 | 0 | 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); |
3227 | 0 | 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); |
3228 | 0 | 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); |
3229 | 0 | 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); |
3230 | 0 | 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); |
3231 | 0 | 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); |
3232 | 0 | 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); |
3233 | 0 | 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); |
3234 | 0 | 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); |
3235 | 0 | 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); |
3236 | 0 | 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); |
3237 | 0 | 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); |
3238 | 0 | proto_tree_add_item(autoneg_advertised_subtree, hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_other, tvb, offset, 2, ENC_BIG_ENDIAN); |
3239 | |
|
3240 | 0 | offset += 2; |
3241 | | |
3242 | | /* Get operational MAU type */ |
3243 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_pmd_mau_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
3244 | |
|
3245 | 0 | offset += 2; |
3246 | |
|
3247 | 0 | break; |
3248 | 0 | } |
3249 | 0 | case 0x02: /* MDI Power Support */ |
3250 | 0 | { |
3251 | | /* Get MDI power support info */ |
3252 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_support, tvb, offset, 1, ENC_BIG_ENDIAN); |
3253 | 0 | mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_power); |
3254 | |
|
3255 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mdi_power_support_port_class, tvb, offset, 1, ENC_BIG_ENDIAN); |
3256 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mdi_power_support_pse_power_support, tvb, offset, 1, ENC_BIG_ENDIAN); |
3257 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mdi_power_support_pse_power_enabled, tvb, offset, 1, ENC_BIG_ENDIAN); |
3258 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_mdi_power_support_pse_pairs, tvb, offset, 1, ENC_BIG_ENDIAN); |
3259 | |
|
3260 | 0 | offset++; |
3261 | | |
3262 | | /* Get PSE power pair */ |
3263 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_pse_pair, tvb, offset, 1, ENC_BIG_ENDIAN); |
3264 | |
|
3265 | 0 | offset++; |
3266 | | |
3267 | | /* Get power class */ |
3268 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_class, tvb, offset, 1, ENC_BIG_ENDIAN); |
3269 | |
|
3270 | 0 | offset++; |
3271 | |
|
3272 | 0 | if (tlvLen == 4) |
3273 | 0 | break; |
3274 | | |
3275 | | /* Get first byte */ |
3276 | 0 | tempByte = tvb_get_uint8(tvb, offset); |
3277 | | |
3278 | | /* Determine power type */ |
3279 | 0 | subType = ((tempByte & 0xC0) >> 6); |
3280 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
3281 | |
|
3282 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_source, tvb, offset, 1, ENC_BIG_ENDIAN); |
3283 | | |
3284 | | /* Determine power source subtype */ |
3285 | 0 | switch (subType) |
3286 | 0 | { |
3287 | 0 | case 0: |
3288 | 0 | case 2: |
3289 | 0 | { |
3290 | 0 | subType = ((tempByte & 0x30) >> 4); |
3291 | 0 | proto_item_append_text(tf, " %s", val_to_str_const(subType, media_power_pse_device, "Reserved")); |
3292 | |
|
3293 | 0 | break; |
3294 | 0 | } |
3295 | 0 | case 1: |
3296 | 0 | case 3: |
3297 | 0 | { |
3298 | 0 | subType = ((tempByte & 0x30) >> 4); |
3299 | 0 | proto_item_append_text(tf, " %s", val_to_str_const(subType, media_power_pd_device, "Reserved")); |
3300 | |
|
3301 | 0 | break; |
3302 | 0 | } |
3303 | 0 | default: |
3304 | 0 | { |
3305 | 0 | proto_item_append_text(tf, " %s", "Unknown"); |
3306 | |
|
3307 | 0 | break; |
3308 | 0 | } |
3309 | 0 | } |
3310 | | |
3311 | | /* Determine PD 4PID flag */ |
3312 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_pd4pid, tvb, offset, 1, ENC_BIG_ENDIAN); |
3313 | | |
3314 | | /* Determine power priority */ |
3315 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_mdi_power_priority, tvb, offset, 1, ENC_BIG_ENDIAN); |
3316 | |
|
3317 | 0 | offset++; |
3318 | | |
3319 | | /* Power Value: 1 to 510 expected */ |
3320 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_mdi_requested_power, tvb, offset, 2, ENC_BIG_ENDIAN); |
3321 | |
|
3322 | 0 | offset+=2; |
3323 | | |
3324 | | /* Power Value: 1 to 510 expected */ |
3325 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_mdi_allocated_power, tvb, offset, 2, ENC_BIG_ENDIAN); |
3326 | |
|
3327 | 0 | offset+=2; |
3328 | |
|
3329 | 0 | if (tlvLen == 26) { /* 802.3BT TLV Extensions */ |
3330 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_bt_ds_pd_requested_power_value_mode_a, tvb, offset, 2, ENC_BIG_ENDIAN); |
3331 | 0 | offset+=2; |
3332 | |
|
3333 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_bt_ds_pd_requested_power_value_mode_b, tvb, offset, 2, ENC_BIG_ENDIAN); |
3334 | 0 | offset+=2; |
3335 | |
|
3336 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_bt_ds_pse_allocated_power_value_alt_a, tvb, offset, 2, ENC_BIG_ENDIAN); |
3337 | 0 | offset+=2; |
3338 | |
|
3339 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_bt_ds_pse_allocated_power_value_alt_b, tvb, offset, 2, ENC_BIG_ENDIAN); |
3340 | 0 | offset+=2; |
3341 | |
|
3342 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_3_bt_power_status, tvb, offset, 2, ENC_BIG_ENDIAN); |
3343 | 0 | mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_bt_power); |
3344 | |
|
3345 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_pse_powering_status, tvb, offset, 2, ENC_BIG_ENDIAN); |
3346 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_pd_powered_status, tvb, offset, 2, ENC_BIG_ENDIAN); |
3347 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_pse_power_pairs_ext, tvb, offset, 2, ENC_BIG_ENDIAN); |
3348 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_ds_pwr_class_ext_a, tvb, offset, 2, ENC_BIG_ENDIAN); |
3349 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_ds_pwr_class_ext_b, tvb, offset, 2, ENC_BIG_ENDIAN); |
3350 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_pwr_class_ext, tvb, offset, 2, ENC_BIG_ENDIAN); |
3351 | 0 | offset+=2; |
3352 | |
|
3353 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_3_bt_system_setup, tvb, offset, 1, ENC_BIG_ENDIAN); |
3354 | 0 | mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_bt_system_setup); |
3355 | |
|
3356 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_power_type_ext, tvb, offset, 1, ENC_BIG_ENDIAN); |
3357 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_power_pd_load, tvb, offset, 1, ENC_BIG_ENDIAN); |
3358 | 0 | offset+=1; |
3359 | |
|
3360 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_bt_pse_maximum_available_power_value, tvb, offset, 2, ENC_BIG_ENDIAN); |
3361 | 0 | offset+=2; |
3362 | |
|
3363 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_3_bt_autoclass, tvb, offset, 1, ENC_BIG_ENDIAN); |
3364 | 0 | mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_bt_autoclass); |
3365 | |
|
3366 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_pse_autoclass_support, tvb, offset, 1, ENC_BIG_ENDIAN); |
3367 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_autoclass_completed, tvb, offset, 1, ENC_BIG_ENDIAN); |
3368 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_autoclass_request, tvb, offset, 1, ENC_BIG_ENDIAN); |
3369 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_autoclass_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); |
3370 | 0 | offset+=1; |
3371 | |
|
3372 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_3_bt_power_down, tvb, offset, 3, ENC_BIG_ENDIAN); |
3373 | 0 | mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_bt_power_down); |
3374 | |
|
3375 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_power_down_request, tvb, offset, 3, ENC_BIG_ENDIAN); |
3376 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_bt_power_down_time, tvb, offset, 3, ENC_BIG_ENDIAN); |
3377 | 0 | offset+=3; |
3378 | 0 | } |
3379 | 0 | break; |
3380 | 0 | } |
3381 | 0 | case 0x03: /* Link Aggregation */ |
3382 | 0 | { |
3383 | | /* Get aggregation status */ |
3384 | 0 | expert_add_info(pinfo, subitem, &ei_lldp_tlv_deprecated); |
3385 | 0 | tf = proto_tree_add_item(tree, hf_ieee_802_3_aggregation_status, tvb, offset, 1, ENC_BIG_ENDIAN); |
3386 | 0 | mac_phy_flags = proto_item_add_subtree(tf, ett_802_3_aggregation); |
3387 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_aggregation_status_cap, tvb, offset, 1, ENC_BIG_ENDIAN); |
3388 | 0 | proto_tree_add_item(mac_phy_flags, hf_ieee_802_3_aggregation_status_enabled, tvb, offset, 1, ENC_BIG_ENDIAN); |
3389 | |
|
3390 | 0 | offset++; |
3391 | | |
3392 | | /* Get aggregated port id */ |
3393 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_aggregated_port_id, tvb, offset, 4, ENC_BIG_ENDIAN); |
3394 | |
|
3395 | 0 | offset+=4; |
3396 | 0 | break; |
3397 | 0 | } |
3398 | 0 | case 0x04: /* Maximum Frame Size */ |
3399 | 0 | { |
3400 | | /* Get maximum frame size */ |
3401 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_max_frame_size, tvb, offset, 2, ENC_BIG_ENDIAN); |
3402 | |
|
3403 | 0 | offset+=2; |
3404 | 0 | break; |
3405 | 0 | } |
3406 | 0 | case 0x05: /* Energy-Efficient Ethernet */ |
3407 | 0 | { |
3408 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_eee_transmit, tvb, offset, 2, ENC_BIG_ENDIAN); |
3409 | 0 | offset+=2; |
3410 | |
|
3411 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_eee_receive, tvb, offset, 2, ENC_BIG_ENDIAN); |
3412 | 0 | offset+=2; |
3413 | |
|
3414 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_eee_fallback_receive, tvb, offset, 2, ENC_BIG_ENDIAN); |
3415 | 0 | offset+=2; |
3416 | |
|
3417 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_eee_echo_transmit, tvb, offset, 2, ENC_BIG_ENDIAN); |
3418 | 0 | offset+=2; |
3419 | |
|
3420 | 0 | proto_tree_add_item(tree, hf_ieee_802_3_eee_echo_receive, tvb, offset, 2, ENC_BIG_ENDIAN); |
3421 | 0 | offset+=2; |
3422 | |
|
3423 | 0 | break; |
3424 | 0 | } |
3425 | 0 | case 0x07: /* IEEE 802.3br Frame Preemption Protocol */ |
3426 | 0 | { |
3427 | 0 | static int * const preemption_capabilities[] = { |
3428 | 0 | &hf_ieee_802_3br_aec_support, |
3429 | 0 | &hf_ieee_802_3br_aec_enable, |
3430 | 0 | &hf_ieee_802_3br_aec_active, |
3431 | 0 | &hf_ieee_802_3br_aec_addfragsize, |
3432 | 0 | &hf_ieee_802_3br_aec_reserved, |
3433 | 0 | NULL |
3434 | 0 | }; |
3435 | | |
3436 | | /* Get Additional Ethernet Capabilities */ |
3437 | 0 | proto_tree_add_bitmask(tree, tvb, offset, hf_ieee_802_3br_aec, ett_802_3br_capabilities_flags, preemption_capabilities, ENC_BIG_ENDIAN); |
3438 | 0 | offset+=2; |
3439 | 0 | break; |
3440 | 0 | } |
3441 | 0 | } |
3442 | | |
3443 | 0 | if(tvb_reported_length_remaining(tvb, offset)) { |
3444 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length_excess, tvb, offset, -1); |
3445 | 0 | } |
3446 | 0 | return offset; |
3447 | 0 | } |
3448 | | |
3449 | | /* Dissect Media TLVs */ |
3450 | | static void |
3451 | | dissect_media_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
3452 | 0 | { |
3453 | 0 | uint16_t tlvLen = tvb_reported_length(tvb); |
3454 | 0 | uint8_t subType; |
3455 | 0 | uint32_t offset = 0; |
3456 | 0 | uint8_t tempByte; |
3457 | 0 | uint32_t LCI_Length; |
3458 | |
|
3459 | 0 | proto_tree *media_flags = NULL; |
3460 | 0 | proto_item *tf = NULL; |
3461 | | /* Get subtype */ |
3462 | 0 | subType = tvb_get_uint8(tvb, offset); |
3463 | 0 | proto_tree_add_item(tree, hf_media_tlv_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
3464 | 0 | offset++; |
3465 | 0 | tlvLen--; |
3466 | |
|
3467 | 0 | switch (subType) |
3468 | 0 | { |
3469 | 0 | case 1: /* LLDP-MED Capabilities */ |
3470 | 0 | { |
3471 | | /* Get capabilities */ |
3472 | 0 | if (tlvLen < 2) |
3473 | 0 | { |
3474 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen); |
3475 | 0 | return; |
3476 | 0 | } |
3477 | | |
3478 | 0 | tf = proto_tree_add_item(tree, hf_media_tlv_subtype_caps, tvb, offset, 2, ENC_BIG_ENDIAN); |
3479 | 0 | media_flags = proto_item_add_subtree(tf, ett_media_capabilities); |
3480 | 0 | proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_llpd, tvb, offset, 2, ENC_BIG_ENDIAN); |
3481 | 0 | proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_network_policy, tvb, offset, 2, ENC_BIG_ENDIAN); |
3482 | 0 | proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_location_id, tvb, offset, 2, ENC_BIG_ENDIAN); |
3483 | 0 | proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_mdi_pse, tvb, offset, 2, ENC_BIG_ENDIAN); |
3484 | 0 | proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_mid_pd, tvb, offset, 2, ENC_BIG_ENDIAN); |
3485 | 0 | proto_tree_add_item(media_flags, hf_media_tlv_subtype_caps_inventory, tvb, offset, 2, ENC_BIG_ENDIAN); |
3486 | |
|
3487 | 0 | offset += 2; |
3488 | 0 | tlvLen -= 2; |
3489 | | |
3490 | | /* Get Class type */ |
3491 | 0 | if (tlvLen < 1) |
3492 | 0 | { |
3493 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen); |
3494 | 0 | return; |
3495 | 0 | } |
3496 | | |
3497 | 0 | proto_tree_add_item(tree, hf_media_tlv_subtype_class, tvb, offset, 1, ENC_BIG_ENDIAN); |
3498 | |
|
3499 | 0 | offset++; |
3500 | 0 | tlvLen--; |
3501 | |
|
3502 | 0 | break; |
3503 | 0 | } |
3504 | 0 | case 2: /* Network Policy */ |
3505 | 0 | { |
3506 | | /* Get application type */ |
3507 | 0 | if (tlvLen < 1) |
3508 | 0 | { |
3509 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen); |
3510 | 0 | return; |
3511 | 0 | } |
3512 | | |
3513 | 0 | proto_tree_add_item(tree, hf_media_application_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
3514 | |
|
3515 | 0 | offset++; |
3516 | 0 | tlvLen--; |
3517 | | |
3518 | | /* Get flags */ |
3519 | 0 | if (tlvLen < 3) |
3520 | 0 | { |
3521 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen); |
3522 | 0 | return; |
3523 | 0 | } |
3524 | | |
3525 | 0 | proto_tree_add_item(tree, hf_media_policy_flag, tvb, offset, 3, ENC_BIG_ENDIAN); |
3526 | 0 | proto_tree_add_item(tree, hf_media_tag_flag, tvb, offset, 3, ENC_BIG_ENDIAN); |
3527 | | |
3528 | | /* Get vlan id */ |
3529 | 0 | proto_tree_add_item(tree, hf_media_vlan_id, tvb, offset, 3, ENC_BIG_ENDIAN); |
3530 | | |
3531 | | |
3532 | | /* Get L2 priority */ |
3533 | |
|
3534 | 0 | proto_tree_add_item(tree, hf_media_l2_prio, tvb, offset, 3, ENC_BIG_ENDIAN); |
3535 | | |
3536 | | /* Get DSCP value */ |
3537 | 0 | proto_tree_add_item(tree, hf_media_dscp, tvb, offset, 3, ENC_BIG_ENDIAN); |
3538 | |
|
3539 | 0 | break; |
3540 | 0 | } |
3541 | 0 | case 3: /* Location Identification */ |
3542 | 0 | { |
3543 | | /* Get location data format */ |
3544 | 0 | if (tlvLen < 1) |
3545 | 0 | { |
3546 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen); |
3547 | 0 | return; |
3548 | 0 | } |
3549 | | |
3550 | 0 | tempByte = tvb_get_uint8(tvb, offset); |
3551 | 0 | proto_tree_add_item(tree, hf_media_loc_data_format, tvb, offset, 1, ENC_BIG_ENDIAN); |
3552 | |
|
3553 | 0 | offset++; |
3554 | 0 | tlvLen--; |
3555 | |
|
3556 | 0 | switch (tempByte) |
3557 | 0 | { |
3558 | 0 | case 1: /* Coordinate-based LCI */ |
3559 | 0 | { |
3560 | | /* |
3561 | | * See RFC 6225 (obsoletes RFC 3825). |
3562 | | * XXX - should this be handled by the BOOTP |
3563 | | * dissector, and exported to us? |
3564 | | */ |
3565 | 0 | if (tlvLen < 16) |
3566 | 0 | { |
3567 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen); |
3568 | 0 | return; |
3569 | 0 | } |
3570 | | |
3571 | | /* Get latitude resolution */ |
3572 | 0 | proto_tree_add_item(tree, hf_media_loc_lat_resolution, tvb, offset, 1, ENC_BIG_ENDIAN); |
3573 | | |
3574 | | /* Get latitude */ |
3575 | 0 | proto_tree_add_item(tree, hf_media_loc_lat, tvb, offset, 5, ENC_BIG_ENDIAN); |
3576 | |
|
3577 | 0 | offset += 5; |
3578 | | |
3579 | | /* Get longitude resolution */ |
3580 | 0 | proto_tree_add_item(tree, hf_media_loc_long_resolution, tvb, offset, 1, ENC_BIG_ENDIAN); |
3581 | | |
3582 | | /* Get longitude */ |
3583 | 0 | proto_tree_add_item(tree, hf_media_loc_long, tvb, offset, 5, ENC_BIG_ENDIAN); |
3584 | |
|
3585 | 0 | offset += 5; |
3586 | | |
3587 | | /* Altitude Type */ |
3588 | 0 | proto_tree_add_item(tree, hf_media_loc_alt_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
3589 | | |
3590 | | /* Get Altitude Resolution */ |
3591 | 0 | proto_tree_add_item(tree, hf_media_loc_alt_resolution, tvb, offset, 2, ENC_BIG_ENDIAN); |
3592 | |
|
3593 | 0 | offset++; |
3594 | | |
3595 | | /* Get Altitude */ |
3596 | 0 | proto_tree_add_item(tree, hf_media_loc_alt, tvb, offset, 4, ENC_BIG_ENDIAN); |
3597 | |
|
3598 | 0 | offset += 4; |
3599 | | |
3600 | | /* Get Ver */ |
3601 | 0 | proto_tree_add_item(tree, hf_media_loc_ver, tvb, offset, 1, ENC_BIG_ENDIAN); |
3602 | | |
3603 | | /* Get reserved */ |
3604 | 0 | proto_tree_add_item(tree, hf_media_loc_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); |
3605 | | |
3606 | | /* Get datum */ |
3607 | 0 | proto_tree_add_item(tree, hf_media_loc_datum, tvb, offset, 1, ENC_BIG_ENDIAN); |
3608 | |
|
3609 | 0 | offset++; |
3610 | |
|
3611 | 0 | break; |
3612 | 0 | } |
3613 | 0 | case 2: /* Civic Address LCI */ |
3614 | 0 | { |
3615 | | /* |
3616 | | * See draft-ietf-geopriv-dhcp-civil-07. |
3617 | | * XXX - should this be handled by the BOOTP |
3618 | | * dissector, and exported to us? |
3619 | | */ |
3620 | 0 | if (tlvLen < 1) |
3621 | 0 | { |
3622 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen); |
3623 | 0 | return; |
3624 | 0 | } |
3625 | | |
3626 | | /* Get LCI length */ |
3627 | 0 | tempByte = tvb_get_uint8(tvb, offset); |
3628 | 0 | tlvLen--; |
3629 | 0 | if (tempByte > tlvLen) |
3630 | 0 | { |
3631 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length_excess , tvb, offset, tlvLen); |
3632 | |
|
3633 | 0 | return; |
3634 | 0 | } |
3635 | | |
3636 | 0 | proto_tree_add_item(tree, hf_media_civic_lci_length, tvb, offset, 1 , ENC_BIG_ENDIAN); |
3637 | |
|
3638 | 0 | LCI_Length = (uint32_t)tempByte; |
3639 | |
|
3640 | 0 | offset++; |
3641 | | |
3642 | | /* Get what value */ |
3643 | 0 | if (LCI_Length < 1) |
3644 | 0 | { |
3645 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen); |
3646 | 0 | return; |
3647 | 0 | } |
3648 | | |
3649 | 0 | proto_tree_add_item(tree, hf_media_civic_what, tvb, offset, 1, ENC_BIG_ENDIAN); |
3650 | |
|
3651 | 0 | offset++; |
3652 | 0 | LCI_Length--; |
3653 | | |
3654 | | /* Get country code */ |
3655 | 0 | if (LCI_Length < 2) |
3656 | 0 | { |
3657 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen); |
3658 | 0 | return; |
3659 | 0 | } |
3660 | | |
3661 | 0 | proto_tree_add_item(tree, hf_media_civic_country, tvb, offset, 2, ENC_ASCII); |
3662 | |
|
3663 | 0 | offset += 2; |
3664 | 0 | LCI_Length -= 2; |
3665 | |
|
3666 | 0 | while (LCI_Length > 0) |
3667 | 0 | { |
3668 | | /* Get CA Type */ |
3669 | 0 | proto_tree_add_item(tree, hf_media_civic_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
3670 | |
|
3671 | 0 | offset++; |
3672 | 0 | LCI_Length--; |
3673 | | |
3674 | | /* Get CA Length */ |
3675 | 0 | if (LCI_Length < 1) |
3676 | 0 | { |
3677 | 0 | proto_tree_add_expert(tree, pinfo, &ei_lldp_bad_length, tvb, offset, tlvLen); |
3678 | 0 | return; |
3679 | 0 | } |
3680 | 0 | tempByte = tvb_get_uint8(tvb, offset); |
3681 | |
|
3682 | 0 | proto_tree_add_item(tree, hf_media_civic_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN); |
3683 | |
|
3684 | 0 | offset++; |
3685 | 0 | LCI_Length--; |
3686 | | |
3687 | | /* Make sure the CA value is within the specified length */ |
3688 | 0 | if (tempByte > LCI_Length) |
3689 | 0 | return; |
3690 | | |
3691 | 0 | if (tempByte > 0) |
3692 | 0 | { |
3693 | | /* Get CA Value */ |
3694 | 0 | proto_tree_add_item(tree, hf_media_civic_addr_value, tvb, offset, tempByte, ENC_ASCII); |
3695 | |
|
3696 | 0 | offset += tempByte; |
3697 | 0 | LCI_Length -= tempByte; |
3698 | 0 | } |
3699 | 0 | } |
3700 | | |
3701 | 0 | break; |
3702 | 0 | } |
3703 | 0 | case 3: /* ECS ELIN */ |
3704 | 0 | { |
3705 | 0 | if (tlvLen > 0) |
3706 | 0 | { |
3707 | 0 | proto_tree_add_item(tree, hf_media_ecs, tvb, offset, tlvLen, ENC_ASCII); |
3708 | 0 | } |
3709 | |
|
3710 | 0 | break; |
3711 | 0 | } |
3712 | 0 | } |
3713 | | |
3714 | 0 | break; |
3715 | 0 | } |
3716 | 0 | case 4: /* Extended Power-via-MDI */ |
3717 | 0 | { |
3718 | | /* Get first byte */ |
3719 | 0 | tempByte = tvb_get_uint8(tvb, offset); |
3720 | | |
3721 | | /* Determine power type */ |
3722 | 0 | subType = ((tempByte & 0xC0) >> 6); |
3723 | 0 | proto_tree_add_item(tree, hf_media_power_type, tvb, offset, 1, ENC_BIG_ENDIAN); |
3724 | |
|
3725 | 0 | tf = proto_tree_add_item(tree, hf_media_power_source, tvb, offset, 1, ENC_BIG_ENDIAN); |
3726 | | |
3727 | | /* Determine power source */ |
3728 | 0 | switch (subType) |
3729 | 0 | { |
3730 | 0 | case 0: |
3731 | 0 | { |
3732 | 0 | subType = ((tempByte & 0x30) >> 4); |
3733 | 0 | proto_item_append_text(tf, " %s", val_to_str_const(subType, media_power_pse_device, "Reserved")); |
3734 | |
|
3735 | 0 | break; |
3736 | 0 | } |
3737 | 0 | case 1: |
3738 | 0 | { |
3739 | 0 | subType = ((tempByte & 0x30) >> 4); |
3740 | 0 | proto_item_append_text(tf, " %s", val_to_str_const(subType, media_power_pd_device, "Reserved")); |
3741 | |
|
3742 | 0 | break; |
3743 | 0 | } |
3744 | 0 | default: |
3745 | 0 | { |
3746 | 0 | proto_item_append_text(tf, " %s", "Unknown"); |
3747 | 0 | break; |
3748 | 0 | } |
3749 | 0 | } |
3750 | | |
3751 | | /* Determine power priority */ |
3752 | 0 | proto_tree_add_item(tree, hf_media_power_priority, tvb, offset, 1, ENC_BIG_ENDIAN); |
3753 | |
|
3754 | 0 | offset++; |
3755 | | |
3756 | | /* Power Value: 0 to 102.3 Watts (0.1 W increments) */ |
3757 | 0 | proto_tree_add_item(tree, hf_media_power_value, tvb, offset, 2, ENC_BIG_ENDIAN); |
3758 | |
|
3759 | 0 | break; |
3760 | 0 | } |
3761 | 0 | case 5: /* Hardware Revision */ |
3762 | 0 | { |
3763 | | /* Figure out the length of the hardware revision field */ |
3764 | 0 | if (tlvLen > 0) |
3765 | 0 | { |
3766 | 0 | proto_tree_add_item(tree, hf_media_hardware, tvb, offset, tlvLen, ENC_ASCII|ENC_NA); |
3767 | 0 | } |
3768 | |
|
3769 | 0 | break; |
3770 | 0 | } |
3771 | 0 | case 6: /* Firmware Revision */ |
3772 | 0 | { |
3773 | | /* Figure out the length of the firmware revision field */ |
3774 | 0 | if (tlvLen > 0) |
3775 | 0 | { |
3776 | 0 | proto_tree_add_item(tree, hf_media_firmware, tvb, offset, tlvLen, ENC_ASCII|ENC_NA); |
3777 | 0 | } |
3778 | |
|
3779 | 0 | break; |
3780 | 0 | } |
3781 | 0 | case 7: /* Software Revision */ |
3782 | 0 | { |
3783 | | /* Figure out the length of the software revision field */ |
3784 | 0 | if (tlvLen > 0) |
3785 | 0 | { |
3786 | 0 | proto_tree_add_item(tree, hf_media_software, tvb, offset, tlvLen, ENC_ASCII|ENC_NA); |
3787 | 0 | } |
3788 | |
|
3789 | 0 | break; |
3790 | 0 | } |
3791 | 0 | case 8: /* Serial Number */ |
3792 | 0 | { |
3793 | | /* Figure out the length of the serial number field */ |
3794 | 0 | if (tlvLen > 0) |
3795 | 0 | { |
3796 | 0 | proto_tree_add_item(tree, hf_media_sn, tvb, offset, tlvLen, ENC_ASCII|ENC_NA); |
3797 | 0 | } |
3798 | |
|
3799 | 0 | break; |
3800 | 0 | } |
3801 | 0 | case 9: /* Manufacturer Name */ |
3802 | 0 | { |
3803 | | /* Figure out the length of the manufacturer name field */ |
3804 | 0 | if (tlvLen > 0) |
3805 | 0 | { |
3806 | 0 | proto_tree_add_item(tree, hf_media_manufacturer, tvb, offset, tlvLen, ENC_ASCII|ENC_NA); |
3807 | 0 | } |
3808 | |
|
3809 | 0 | break; |
3810 | 0 | } |
3811 | 0 | case 10: /* Model Name */ |
3812 | 0 | { |
3813 | | /* Figure out the length of the model name field */ |
3814 | 0 | if (tlvLen > 0) |
3815 | 0 | { |
3816 | 0 | proto_tree_add_item(tree, hf_media_model, tvb, offset, tlvLen, ENC_ASCII|ENC_NA); |
3817 | 0 | } |
3818 | |
|
3819 | 0 | break; |
3820 | 0 | } |
3821 | 0 | case 11: /* Asset ID */ |
3822 | 0 | { |
3823 | | /* Figure out the length of the asset id field */ |
3824 | 0 | if (tlvLen > 0) |
3825 | 0 | { |
3826 | 0 | proto_tree_add_item(tree, hf_media_asset, tvb, offset, tlvLen, ENC_ASCII|ENC_NA); |
3827 | 0 | } |
3828 | |
|
3829 | 0 | break; |
3830 | 0 | } |
3831 | 0 | } |
3832 | | |
3833 | 0 | return; |
3834 | 0 | } |
3835 | | |
3836 | | |
3837 | | static uint32_t |
3838 | | dissect_profinet_period(tvbuff_t *tvb, proto_tree *tree, uint32_t offset, const char *name, int hf_valid, int hf_value) |
3839 | 0 | { |
3840 | 0 | uint32_t period; |
3841 | 0 | proto_tree *period_tree; |
3842 | |
|
3843 | 0 | period = tvb_get_ntohl(tvb, offset); |
3844 | |
|
3845 | 0 | period_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_profinet_period, NULL, "%s: %s, %uns", |
3846 | 0 | name, (period & 0x80000000) ? "Valid" : "Invalid", period & 0x7FFFFFFF); |
3847 | |
|
3848 | 0 | proto_tree_add_uint(period_tree, hf_valid, tvb, offset, 4, period); |
3849 | 0 | proto_tree_add_uint(period_tree, hf_value, tvb, offset, 4, period); |
3850 | 0 | offset+=4; |
3851 | |
|
3852 | 0 | return offset; |
3853 | 0 | } |
3854 | | |
3855 | | static void |
3856 | | select_source_of_name_of_station |
3857 | | (packet_info *pinfo _U_, profinet_lldp_column_info *pn_lldp_column_info) |
3858 | 0 | { |
3859 | 0 | if (pn_lldp_column_info->chassis_id_locally_assigned != NULL) |
3860 | 0 | { |
3861 | 0 | pn_lldp_column_info->is_nos_assigned = true; |
3862 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "NoS = %s ", pn_lldp_column_info->chassis_id_locally_assigned); |
3863 | 0 | } |
3864 | 0 | else |
3865 | 0 | { |
3866 | 0 | if (pn_lldp_column_info->chassis_id_mac != NULL) |
3867 | 0 | { |
3868 | 0 | pn_lldp_column_info->is_nos_assigned = true; |
3869 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "NoS = %s ", pn_lldp_column_info->chassis_id_mac); |
3870 | 0 | } |
3871 | 0 | } |
3872 | 0 | } |
3873 | | |
3874 | | static void |
3875 | | set_name_of_station_for_profinet_specialized_column_info |
3876 | | (packet_info *pinfo _U_, profinet_lldp_column_info *pn_lldp_column_info) |
3877 | 0 | { |
3878 | 0 | const char *delimForProfinetv23 = "."; |
3879 | 0 | char* foundDot = NULL; |
3880 | 0 | char* tokenPortId = NULL; |
3881 | 0 | char* tokenNameOfStation = NULL; |
3882 | 0 | char* lldpPortIdCombinedWithNameOfStation = NULL; |
3883 | |
|
3884 | 0 | if (pn_lldp_column_info->is_nos_assigned != true) |
3885 | 0 | { |
3886 | 0 | if (pn_lldp_column_info->port_id_locally_assigned != NULL) |
3887 | 0 | { |
3888 | 0 | foundDot = strstr(pn_lldp_column_info->port_id_locally_assigned, delimForProfinetv23); |
3889 | 0 | if (foundDot != NULL) |
3890 | 0 | { |
3891 | 0 | pn_lldp_column_info->is_nos_assigned = true; |
3892 | 0 | pn_lldp_column_info->is_port_id_assigned = true; |
3893 | 0 | lldpPortIdCombinedWithNameOfStation = wmem_strdup(pinfo->pool, pn_lldp_column_info->port_id_locally_assigned); |
3894 | 0 | tokenPortId = strtok(lldpPortIdCombinedWithNameOfStation, delimForProfinetv23); |
3895 | 0 | tokenNameOfStation = strtok(NULL, delimForProfinetv23); |
3896 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "NoS = %s ", tokenNameOfStation); |
3897 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "Port Id = %s ", tokenPortId); |
3898 | 0 | } |
3899 | 0 | else |
3900 | 0 | { |
3901 | 0 | select_source_of_name_of_station(pinfo, pn_lldp_column_info); |
3902 | 0 | } |
3903 | 0 | } |
3904 | 0 | else |
3905 | 0 | { |
3906 | 0 | select_source_of_name_of_station(pinfo, pn_lldp_column_info); |
3907 | 0 | } |
3908 | 0 | } |
3909 | 0 | } |
3910 | | |
3911 | | static void |
3912 | | set_port_id_for_profinet_specialized_column_info |
3913 | | (packet_info *pinfo _U_, profinet_lldp_column_info *pn_lldp_column_info) |
3914 | 0 | { |
3915 | 0 | if (pn_lldp_column_info->is_port_id_assigned != true) |
3916 | 0 | { |
3917 | 0 | if (pn_lldp_column_info->port_id_locally_assigned != NULL) |
3918 | 0 | { |
3919 | 0 | pn_lldp_column_info->is_port_id_assigned = true; |
3920 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "Port Id = %s ", pn_lldp_column_info->port_id_locally_assigned); |
3921 | 0 | } |
3922 | 0 | } |
3923 | 0 | } |
3924 | | |
3925 | | /* Dissect PROFINET TLVs */ |
3926 | | static void |
3927 | | dissect_profinet_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, profinet_lldp_column_info *pn_lldp_column_info) |
3928 | 0 | { |
3929 | 0 | uint8_t subType; |
3930 | 0 | uint32_t offset = 0; |
3931 | 0 | proto_item *tf = NULL; |
3932 | 0 | uint32_t class3_PortStatus; |
3933 | 0 | uint32_t port_rx_delay_local; |
3934 | 0 | uint32_t port_rx_delay_remote; |
3935 | 0 | uint32_t port_tx_delay_local; |
3936 | 0 | uint32_t port_tx_delay_remote; |
3937 | 0 | uint32_t cable_delay_local; |
3938 | | |
3939 | | |
3940 | | /* Get subtype */ |
3941 | 0 | subType = tvb_get_uint8(tvb, offset); |
3942 | 0 | proto_tree_add_uint(tree, hf_profinet_tlv_subtype, tvb, offset, 1, subType); |
3943 | 0 | offset++; |
3944 | |
|
3945 | 0 | if (column_info_selection == PROFINET_SPECIAL_COLUMN_INFO) |
3946 | 0 | { |
3947 | 0 | set_name_of_station_for_profinet_specialized_column_info(pinfo, pn_lldp_column_info); |
3948 | 0 | set_port_id_for_profinet_specialized_column_info(pinfo, pn_lldp_column_info); |
3949 | 0 | } |
3950 | |
|
3951 | 0 | switch (subType) |
3952 | 0 | { |
3953 | 0 | case 1: /* LLDP_PNIO_DELAY */ |
3954 | 0 | { |
3955 | 0 | port_rx_delay_local = tvb_get_ntohl(tvb, offset); |
3956 | 0 | tf = proto_tree_add_uint(tree, hf_profinet_port_rx_delay_local, tvb, offset, 4, port_rx_delay_local); |
3957 | 0 | if(port_rx_delay_local) { |
3958 | 0 | proto_item_append_text(tf, "ns"); |
3959 | 0 | } else { |
3960 | 0 | proto_item_append_text(tf, " (unknown)"); |
3961 | 0 | } |
3962 | 0 | offset+=4; |
3963 | 0 | port_rx_delay_remote = tvb_get_ntohl(tvb, offset); |
3964 | 0 | tf = proto_tree_add_uint(tree, hf_profinet_port_rx_delay_remote, tvb, offset, 4, port_rx_delay_remote); |
3965 | 0 | if(port_rx_delay_remote) { |
3966 | 0 | proto_item_append_text(tf, "ns"); |
3967 | 0 | } else { |
3968 | 0 | proto_item_append_text(tf, " (unknown)"); |
3969 | 0 | } |
3970 | 0 | offset+=4; |
3971 | 0 | port_tx_delay_local = tvb_get_ntohl(tvb, offset); |
3972 | 0 | tf = proto_tree_add_uint(tree, hf_profinet_port_tx_delay_local, tvb, offset, 4, port_tx_delay_local); |
3973 | 0 | if(port_tx_delay_local) { |
3974 | 0 | proto_item_append_text(tf, "ns"); |
3975 | 0 | } else { |
3976 | 0 | proto_item_append_text(tf, " (unknown)"); |
3977 | 0 | } |
3978 | 0 | offset+=4; |
3979 | 0 | port_tx_delay_remote = tvb_get_ntohl(tvb, offset); |
3980 | 0 | tf = proto_tree_add_uint(tree, hf_profinet_port_tx_delay_remote, tvb, offset, 4, port_tx_delay_remote); |
3981 | 0 | if(port_tx_delay_remote) { |
3982 | 0 | proto_item_append_text(tf, "ns"); |
3983 | 0 | } else { |
3984 | 0 | proto_item_append_text(tf, " (unknown)"); |
3985 | 0 | } |
3986 | 0 | offset+=4; |
3987 | 0 | cable_delay_local = tvb_get_ntohl(tvb, offset); |
3988 | 0 | tf = proto_tree_add_uint(tree, hf_profinet_cable_delay_local, tvb, offset, 4, cable_delay_local); |
3989 | 0 | if(cable_delay_local) { |
3990 | 0 | proto_item_append_text(tf, "ns"); |
3991 | 0 | } else { |
3992 | 0 | proto_item_append_text(tf, " (unknown)"); |
3993 | 0 | } |
3994 | | /*offset+=4;*/ |
3995 | 0 | break; |
3996 | 0 | } |
3997 | 0 | case 2: /* LLDP_PNIO_PORTSTATUS */ |
3998 | 0 | { |
3999 | 0 | proto_tree_add_item(tree, hf_profinet_class2_port_status, tvb, offset, 2, ENC_BIG_ENDIAN); |
4000 | 0 | offset+=2; |
4001 | 0 | proto_tree_add_item_ret_uint(tree, hf_profinet_class3_port_status, tvb, offset, 2, ENC_BIG_ENDIAN, &class3_PortStatus); |
4002 | 0 | proto_tree_add_item(tree, hf_profinet_class3_port_status_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); |
4003 | 0 | proto_tree_add_item(tree, hf_profinet_class3_port_status_Fragmentation, tvb, offset, 2, ENC_BIG_ENDIAN); |
4004 | 0 | proto_tree_add_item(tree, hf_profinet_class3_port_status_PreambleLength, tvb, offset, 2, ENC_BIG_ENDIAN); |
4005 | |
|
4006 | 0 | col_append_fstr(pinfo->cinfo, COL_INFO, "RTClass3 Port Status = %s", val_to_str(class3_PortStatus, profinet_port3_status_vals, "Unknown %d")); |
4007 | | /*offset+=2;*/ |
4008 | 0 | break; |
4009 | 0 | } |
4010 | | /*case 3:*/ /* XXX - LLDP_PNIO_ALIAS */ |
4011 | 0 | case 4: /* LLDP_PNIO_MRPPORTSTATUS */ |
4012 | 0 | { |
4013 | | /* DomainUUID */ |
4014 | 0 | proto_tree_add_item(tree, hf_profinet_mrp_domain_uuid, tvb, offset, 16, ENC_BIG_ENDIAN); |
4015 | 0 | offset += 16; |
4016 | | |
4017 | | /* MRRT PortStatus */ |
4018 | 0 | proto_tree_add_item(tree, hf_profinet_mrrt_port_status, tvb, offset, 2, ENC_BIG_ENDIAN); |
4019 | | /*offset+=2;*/ |
4020 | 0 | break; |
4021 | 0 | } |
4022 | 0 | case 5: /* LLDP_PNIO_CHASSIS_MAC */ |
4023 | 0 | { |
4024 | 0 | proto_tree_add_item(tree, hf_profinet_cm_mac, tvb, offset, 6, ENC_NA); |
4025 | | /*offset += 6;*/ |
4026 | 0 | break; |
4027 | 0 | } |
4028 | 0 | case 6: /* LLDP_PNIO_PTCPSTATUS */ |
4029 | 0 | { |
4030 | | /* MasterSourceAddress */ |
4031 | 0 | proto_tree_add_item(tree, hf_profinet_master_source_address, tvb, offset, 6, ENC_NA); |
4032 | 0 | offset += 6; |
4033 | | /* SubdomainUUID */ |
4034 | 0 | proto_tree_add_item(tree, hf_profinet_subdomain_uuid, tvb, offset, 16, ENC_BIG_ENDIAN); |
4035 | 0 | offset += 16; |
4036 | | /* IRDataUUID */ |
4037 | 0 | proto_tree_add_item(tree, hf_profinet_ir_data_uuid, tvb, offset, 16, ENC_BIG_ENDIAN); |
4038 | 0 | offset += 16; |
4039 | | /* LengthOfPeriod */ |
4040 | 0 | offset = dissect_profinet_period(tvb, tree, offset, "LengthOfPeriod", |
4041 | 0 | hf_profinet_length_of_period_valid, hf_profinet_length_of_period_length); |
4042 | | /* RedPeriodBegin */ |
4043 | 0 | offset = dissect_profinet_period(tvb, tree, offset, "RedPeriodBegin", |
4044 | 0 | hf_profinet_red_period_begin_valid, hf_profinet_red_period_begin_offset); |
4045 | | /* OrangePeriodBegin */ |
4046 | 0 | offset = dissect_profinet_period(tvb, tree, offset, "OrangePeriodBegin", |
4047 | 0 | hf_profinet_orange_period_begin_valid, hf_profinet_orange_period_begin_offset); |
4048 | | /* GreenPeriodBegin */ |
4049 | 0 | /*offset = */dissect_profinet_period(tvb, tree, offset, "GreenPeriodBegin", |
4050 | 0 | hf_profinet_green_period_begin_valid, hf_profinet_green_period_begin_offset); |
4051 | 0 | break; |
4052 | 0 | } |
4053 | 0 | case 9: /* LLDP_PNIO_TSNDOMAIN */ |
4054 | 0 | { |
4055 | | /* DomainUUID */ |
4056 | 0 | proto_tree_add_item(tree, hf_profinet_tsn_domain_uuid, tvb, offset, 16, ENC_BIG_ENDIAN); |
4057 | | /*offset += 16;*/ |
4058 | 0 | break; |
4059 | 0 | } |
4060 | 0 | case 10: /* LLDP_PNIO_TSNNMEManagementAddr */ |
4061 | 0 | { |
4062 | 0 | uint8_t management_string_length = 0; |
4063 | 0 | management_string_length = tvb_get_uint8(tvb, offset); |
4064 | | |
4065 | | /* Management Address String Length */ |
4066 | 0 | proto_tree_add_item(tree, hf_profinet_tsn_nme_management_addr_str_length, tvb, offset, 1, ENC_BIG_ENDIAN); |
4067 | 0 | offset += 1; |
4068 | | |
4069 | | /* Management Address Subtype */ |
4070 | 0 | proto_tree_add_item(tree, hf_profinet_tsn_nme_management_addr_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
4071 | 0 | offset += 1; |
4072 | 0 | management_string_length -= 1; |
4073 | | |
4074 | | /* Management Address */ |
4075 | 0 | proto_tree_add_item(tree, hf_profinet_tsn_nme_management_addr, tvb, offset, management_string_length, ENC_NA); |
4076 | | /*offset += management_string_length;*/ |
4077 | 0 | break; |
4078 | 0 | } |
4079 | 0 | case 11: /* LLDP_PNIO_TSNNMENameUUID */ |
4080 | 0 | { |
4081 | | /* TSNNMENameUUID */ |
4082 | 0 | proto_tree_add_item(tree, hf_profinet_tsn_nme_name_uuid, tvb, offset, 16, ENC_BIG_ENDIAN); |
4083 | | /*offset += 16;*/ |
4084 | 0 | break; |
4085 | 0 | } |
4086 | 0 | case 12: /* LLDP_PNIO_TSNNMEParameterUUID */ |
4087 | 0 | { |
4088 | | /* NMEParameterUUID */ |
4089 | 0 | proto_tree_add_item(tree, hf_profinet_tsn_nme_parameter_uuid, tvb, offset, 16, ENC_BIG_ENDIAN); |
4090 | | /*offset += 16;*/ |
4091 | 0 | break; |
4092 | 0 | } |
4093 | 0 | case 13: /* LLDP_PNIO_TSNTimeDomain */ |
4094 | 0 | { |
4095 | | /*TimeDomainNumber*/ |
4096 | 0 | proto_tree_add_item(tree, hf_profinet_time_domain_number, tvb, offset, 2, ENC_BIG_ENDIAN); |
4097 | 0 | offset += 2; |
4098 | | |
4099 | | /*TimeDomainUUID*/ |
4100 | 0 | proto_tree_add_item(tree, hf_profinet_time_domain_uuid, tvb, offset, 16, ENC_BIG_ENDIAN); |
4101 | 0 | offset += 16; |
4102 | | |
4103 | | /*TimeDomainMasterIdentity*/ |
4104 | 0 | proto_tree_add_item(tree, hf_profinet_time_domain_master_identity, tvb, offset, 8, ENC_NA); |
4105 | | /*offset += 8;*/ |
4106 | 0 | break; |
4107 | 0 | } |
4108 | 0 | default: |
4109 | 0 | proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA); |
4110 | 0 | } |
4111 | 0 | } |
4112 | | |
4113 | | /* Dissect Cisco OUI TLVs */ |
4114 | | static void |
4115 | | dissect_cisco_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
4116 | 0 | { |
4117 | 0 | uint8_t subType; |
4118 | 0 | uint32_t offset = 0; |
4119 | 0 | unsigned length = tvb_reported_length(tvb); |
4120 | |
|
4121 | 0 | proto_tree *upoe_data = NULL; |
4122 | 0 | proto_item *tf = NULL; |
4123 | 0 | proto_item *parent_item = proto_tree_get_parent(tree); |
4124 | |
|
4125 | 0 | if (tree == NULL) return; |
4126 | | |
4127 | | /* Get subtype */ |
4128 | 0 | subType = tvb_get_uint8(tvb, offset); |
4129 | |
|
4130 | 0 | proto_tree_add_item(tree, hf_cisco_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
4131 | 0 | offset++; |
4132 | 0 | length--; |
4133 | |
|
4134 | 0 | switch (subType) |
4135 | 0 | { |
4136 | | /* UPOE */ |
4137 | 0 | case 0x01: |
4138 | 0 | tf = proto_tree_add_item(tree, hf_cisco_upoe, tvb, offset, 1, ENC_BIG_ENDIAN); |
4139 | 0 | upoe_data = proto_item_add_subtree(tf, ett_cisco_upoe_tlv); |
4140 | 0 | proto_tree_add_item(upoe_data, hf_cisco_upoe_supported, tvb, offset, 1, ENC_BIG_ENDIAN); |
4141 | 0 | proto_tree_add_item(upoe_data, hf_cisco_upoe_altb_detection, tvb, offset, 1, ENC_BIG_ENDIAN); |
4142 | 0 | proto_tree_add_item(upoe_data, hf_cisco_upoe_req_spare_pair, tvb, offset, 1, ENC_BIG_ENDIAN); |
4143 | 0 | proto_tree_add_item(upoe_data, hf_cisco_upoe_pse_spare_pair_oper, tvb, offset, 1, ENC_BIG_ENDIAN); |
4144 | 0 | offset++; |
4145 | 0 | length--; |
4146 | 0 | break; |
4147 | | /* ACI */ |
4148 | 0 | case 0xc9: // 201 port-state, uint8 |
4149 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_portstate, tvb, offset, length, ENC_NA); |
4150 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4151 | 0 | offset++; |
4152 | 0 | length--; |
4153 | 0 | break; |
4154 | 0 | case 0xca: // 202 node-role, uint8 |
4155 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_noderole, tvb, offset, length, ENC_NA); |
4156 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4157 | 0 | offset++; |
4158 | 0 | length--; |
4159 | 0 | break; |
4160 | 0 | case 0xcb: // 203 node-id, uint32 |
4161 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_nodeid, tvb, offset, length, ENC_BIG_ENDIAN); |
4162 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4163 | 0 | offset += 4; |
4164 | 0 | length -= 4; |
4165 | 0 | break; |
4166 | 0 | case 0xcc: // 204 spine-level, uint8 |
4167 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_spinelevel, tvb, offset, length, ENC_NA); |
4168 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4169 | 0 | offset++; |
4170 | 0 | length--; |
4171 | 0 | break; |
4172 | 0 | case 0xcd: // 205 pod-id, uint16 |
4173 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_podid, tvb, offset, 2, ENC_BIG_ENDIAN); |
4174 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4175 | 0 | offset += 2; |
4176 | 0 | length -= 2; |
4177 | 0 | break; |
4178 | 0 | case 0xce: // 206 fabric-name, string |
4179 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_fabricname, tvb, offset, length, ENC_ASCII); |
4180 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4181 | 0 | offset += length; |
4182 | 0 | length -= length; |
4183 | 0 | break; |
4184 | 0 | case 0xcf: // 207 av (id, ip, uuid) (uint8, ipv4, string) |
4185 | 0 | proto_tree_add_item(tree, hf_cisco_aci_apiclist, tvb, offset, length, ENC_NA); |
4186 | 0 | while (length > 0) { |
4187 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_apicid, tvb, offset, 1, ENC_NA); |
4188 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4189 | 0 | offset++; |
4190 | 0 | length--; |
4191 | 0 | proto_tree_add_item(tree, hf_cisco_aci_apicipv4, tvb, offset, 4, ENC_NA); |
4192 | 0 | offset += 4; |
4193 | 0 | length -= 4; |
4194 | 0 | proto_tree_add_item(tree, hf_cisco_aci_apicuuid, tvb, offset, 36, ENC_ASCII); |
4195 | 0 | offset += 36; |
4196 | 0 | length -= 36; |
4197 | 0 | } |
4198 | 0 | break; |
4199 | 0 | case 0xd0: // 208 node-ip, ipv4 |
4200 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_nodeip, tvb, offset, length, ENC_NA); |
4201 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4202 | 0 | offset += 4; |
4203 | 0 | length -= 4; |
4204 | 0 | break; |
4205 | 0 | case 0xd1: // 209 port-role, uint8 |
4206 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_portrole, tvb, offset, length, ENC_NA); |
4207 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4208 | 0 | offset++; |
4209 | 0 | length--; |
4210 | 0 | break; |
4211 | 0 | case 0xd2: // 210 fw-ver, string |
4212 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_version, tvb, offset, length, ENC_ASCII); |
4213 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4214 | 0 | offset += length; |
4215 | 0 | length -= length; |
4216 | 0 | break; |
4217 | 0 | case 0xd3: // 211 infra-vlan, uint16 |
4218 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_fabricvlan, tvb, offset, 2, ENC_BIG_ENDIAN); |
4219 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4220 | 0 | offset += 2; |
4221 | 0 | length -= 2; |
4222 | 0 | break; |
4223 | 0 | case 0xd4: // 212 serial-number, string |
4224 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_serialno, tvb, offset, length, ENC_ASCII); |
4225 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4226 | 0 | offset += length; |
4227 | 0 | length -= length; |
4228 | 0 | break; |
4229 | | #if 0 |
4230 | | case 0xd5: // 213 unused |
4231 | | break; |
4232 | | #endif |
4233 | 0 | case 0xd6: // 214 model, string |
4234 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_model, tvb, offset, length, ENC_ASCII); |
4235 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4236 | 0 | offset += length; |
4237 | 0 | length -= length; |
4238 | 0 | break; |
4239 | 0 | case 0xd7: // 215 name, string |
4240 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_nodename, tvb, offset, length, ENC_ASCII); |
4241 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4242 | 0 | offset += length; |
4243 | 0 | length -= length; |
4244 | 0 | break; |
4245 | 0 | case 0xd8: // 216 port-mode, uint16 |
4246 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_portmode, tvb, offset, length, ENC_BIG_ENDIAN); |
4247 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4248 | 0 | offset += 2; |
4249 | 0 | length -= 2; |
4250 | 0 | break; |
4251 | 0 | case 0xd9: // 217 authenticate-cookie, bytes |
4252 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_authcookie, tvb, offset, length, ENC_NA); |
4253 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4254 | 0 | offset += length; |
4255 | 0 | length -= length; |
4256 | 0 | break; |
4257 | 0 | case 0xda: // 218 standby-apic, uint8 |
4258 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_apicmode, tvb, offset, length, ENC_NA); |
4259 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4260 | 0 | offset++; |
4261 | 0 | length--; |
4262 | 0 | break; |
4263 | 0 | case 0xdb: // 219 fabric-id, uint16 |
4264 | 0 | tf = proto_tree_add_item(tree, hf_cisco_aci_fabricid, tvb, offset, length, ENC_BIG_ENDIAN); |
4265 | 0 | proto_item_append_text(parent_item, ": %s", proto_item_get_display_repr(pinfo->pool, tf)); |
4266 | 0 | offset += 2; |
4267 | 0 | length -= 2; |
4268 | 0 | break; |
4269 | 0 | default: |
4270 | 0 | if (length > 0) { |
4271 | 0 | proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, length, ENC_NA); |
4272 | 0 | offset += length; |
4273 | 0 | length -= length; |
4274 | 0 | } |
4275 | 0 | break; |
4276 | 0 | } |
4277 | 0 | if (length > 0) { |
4278 | 0 | proto_tree_add_item(tree, hf_subtype_content_remaining, tvb, offset, length, ENC_NA); |
4279 | 0 | } |
4280 | 0 | } |
4281 | | |
4282 | | /* Dissect OUI HytecGer-TLV's */ |
4283 | | static void |
4284 | | dissect_hytec_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
4285 | 0 | { |
4286 | 0 | uint8_t subtype, group, identifier; |
4287 | 0 | int32_t bit_offset, msg_len, expected_data_length, maximum_data_length, temp_int32; |
4288 | 0 | proto_tree *hytec_data = NULL; |
4289 | 0 | proto_item *tf = NULL; |
4290 | 0 | proto_item *group_proto_item, *identifier_proto_item; |
4291 | 0 | float float_value = 0.0f; |
4292 | 0 | uint32_t offset = 0; |
4293 | |
|
4294 | 0 | subtype = tvb_get_uint8(tvb, offset); |
4295 | 0 | proto_tree_add_uint(tree, hf_hytec_tlv_subtype, tvb, offset, 1, subtype); |
4296 | 0 | offset++; |
4297 | | |
4298 | | /* get the group and identifier of the chosen subtype */ |
4299 | 0 | bit_offset = (int32_t)(offset *8); |
4300 | 0 | group = tvb_get_bits8(tvb, bit_offset + HYTEC_GROUP_MASK_OFFSET, HYTEC_GROUP_MASK_SIZE); |
4301 | 0 | identifier = tvb_get_bits8(tvb, bit_offset + HYTEC_IDENTIFIER_MASK_OFFSET, HYTEC_IDENTIFIER_MASK_SIZE); |
4302 | |
|
4303 | 0 | group_proto_item = proto_tree_add_item(tree, hf_hytec_group, tvb, offset, 1, ENC_BIG_ENDIAN); |
4304 | 0 | identifier_proto_item = proto_tree_add_item(tree, hf_hytec_identifier, tvb, offset, 1, ENC_BIG_ENDIAN); |
4305 | 0 | proto_item_append_text(identifier_proto_item, " ("); /* a group dependent identifier description will be appended */ |
4306 | |
|
4307 | 0 | offset++; |
4308 | 0 | msg_len = tvb_reported_length_remaining(tvb, offset); |
4309 | |
|
4310 | 0 | switch (subtype) |
4311 | 0 | { |
4312 | 0 | case HYTEC_SUBTYPE__TRANSCEIVER: /* Transceiver-Subtype */ |
4313 | 0 | proto_item_append_text(group_proto_item, " (%s)", val_to_str_const(group, hytec_transceiver_groups, "Unknown" )); |
4314 | |
|
4315 | 0 | switch (group) |
4316 | 0 | { |
4317 | 0 | case HYTEC_TRANSG__TRANCEIVER_IDENTIFIER: |
4318 | 0 | proto_item_append_text(identifier_proto_item, "%s", val_to_str_const(identifier, hytec_tid, "Unknown")); |
4319 | |
|
4320 | 0 | switch (identifier) |
4321 | 0 | { |
4322 | 0 | case HYTEC_TID__VENDOR_PRODUCT_REVISION: |
4323 | 0 | maximum_data_length = 64; |
4324 | 0 | if(0 < msg_len && msg_len <= maximum_data_length) |
4325 | 0 | proto_tree_add_item(tree, hf_hytec_transceiver_vendor_product_revision, tvb, offset, msg_len, ENC_ASCII); |
4326 | 0 | else |
4327 | 0 | { /* unexpected length */ |
4328 | 0 | 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); |
4329 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4330 | 0 | } |
4331 | 0 | break; |
4332 | 0 | default: proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA); /* unknown identifier */ |
4333 | 0 | } /* switch (identifier) */ |
4334 | | |
4335 | 0 | break; |
4336 | 0 | case HYTEC_TRANSG__TRANSCEIVER_BRIDGEABLE_DISTANCE: |
4337 | 0 | expected_data_length = 4; |
4338 | 0 | proto_item_append_text(identifier_proto_item, "%s", val_to_str_const(identifier, hytec_tbd, "Unknown")); |
4339 | |
|
4340 | 0 | switch (identifier) |
4341 | 0 | { |
4342 | 0 | case HYTEC_TBD__SINGLE_MODE: |
4343 | 0 | if(msg_len == expected_data_length) |
4344 | 0 | { |
4345 | 0 | proto_tree_add_item(tree, hf_hytec_single_mode, tvb, offset, msg_len, ENC_BIG_ENDIAN); |
4346 | 0 | } |
4347 | 0 | else |
4348 | 0 | { /* unexpected length */ |
4349 | 0 | 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); |
4350 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4351 | 0 | } |
4352 | 0 | break; |
4353 | 0 | case HYTEC_TBD__MULTI_MODE_50: |
4354 | 0 | if(msg_len == expected_data_length) |
4355 | 0 | { |
4356 | 0 | proto_tree_add_item(tree, hf_hytec_multi_mode_50, tvb, offset, msg_len, ENC_BIG_ENDIAN); |
4357 | 0 | } |
4358 | 0 | else |
4359 | 0 | { /* unexpected length */ |
4360 | 0 | 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); |
4361 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4362 | 0 | } |
4363 | 0 | break; |
4364 | 0 | case HYTEC_TBD__MULTI_MODE_62_5: |
4365 | 0 | if(msg_len == expected_data_length) |
4366 | 0 | { |
4367 | 0 | proto_tree_add_item(tree, hf_hytec_multi_mode_62_5, tvb, offset, msg_len, ENC_BIG_ENDIAN); |
4368 | 0 | } |
4369 | 0 | else |
4370 | 0 | { /* unexpected length */ |
4371 | 0 | 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); |
4372 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4373 | 0 | } |
4374 | 0 | break; |
4375 | 0 | default: proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA); /* unknown identifier */ |
4376 | 0 | } /* switch (identifier) */ |
4377 | 0 | break; |
4378 | 0 | case HYTEC_TRANSG__MEASUREMENT_DATA: |
4379 | 0 | expected_data_length = 4; |
4380 | 0 | proto_item_append_text(identifier_proto_item, "%s", val_to_str_const(identifier, hytec_md, "Unknown")); |
4381 | |
|
4382 | 0 | switch (identifier) |
4383 | 0 | { |
4384 | 0 | case HYTEC_MD__TX_CURRENT_OUTPUT_POWER: |
4385 | 0 | if(msg_len == expected_data_length) |
4386 | 0 | { |
4387 | 0 | temp_int32 = tvb_get_ntohil(tvb, offset); |
4388 | 0 | float_value = (float) 0.1 * (float) temp_int32; |
4389 | 0 | proto_tree_add_float(tree, hf_hytec_tx_current_output_power, tvb, offset, msg_len, float_value); |
4390 | 0 | } |
4391 | 0 | else |
4392 | 0 | { /* unexpected length */ |
4393 | 0 | 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); |
4394 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4395 | 0 | } |
4396 | 0 | break; |
4397 | 0 | case HYTEC_MD__RX_CURRENT_INPUT_POWER: |
4398 | 0 | if(msg_len == expected_data_length) |
4399 | 0 | { |
4400 | 0 | temp_int32 = tvb_get_ntohil(tvb, offset); |
4401 | 0 | float_value = (float) 0.1 * (float) temp_int32; |
4402 | 0 | proto_tree_add_float(tree, hf_hytec_rx_current_input_power, tvb, offset, msg_len, float_value); |
4403 | 0 | } |
4404 | 0 | else |
4405 | 0 | { /* unexpected length */ |
4406 | 0 | 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); |
4407 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4408 | 0 | } |
4409 | 0 | break; |
4410 | 0 | case HYTEC_MD__RX_INPUT_SNR: |
4411 | 0 | if(msg_len == expected_data_length) |
4412 | 0 | { |
4413 | 0 | temp_int32 = tvb_get_ntohil(tvb, offset); |
4414 | 0 | if(temp_int32 < 0) float_value = (float)-1.0 * (float)((~temp_int32) >> 8); |
4415 | 0 | else float_value = (float) (temp_int32 >> 8); |
4416 | 0 | float_value += (float)(temp_int32 & 0xFF) * (float)0.00390625; /* 0.00390625 == 0.5 ^ 8 */ |
4417 | 0 | proto_tree_add_float(tree, hf_hytec_rx_input_snr, tvb, offset, msg_len, float_value); |
4418 | 0 | } |
4419 | 0 | else |
4420 | 0 | { /* unexpected length */ |
4421 | 0 | 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); |
4422 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4423 | 0 | } |
4424 | 0 | break; |
4425 | 0 | case HYTEC_MD__LINELOSS: |
4426 | 0 | if(msg_len == expected_data_length) |
4427 | 0 | { |
4428 | 0 | temp_int32 = tvb_get_ntohil(tvb, offset); |
4429 | 0 | if(temp_int32 < 0) float_value = (float)-1.0 * (float)((~temp_int32) >> 8); |
4430 | 0 | else float_value = (float) (temp_int32 >> 8); |
4431 | 0 | float_value += (float)(temp_int32 & 0xFF) * (float)0.00390625; /* 0.5 ^ 8 */ |
4432 | 0 | proto_tree_add_float(tree, hf_hytec_lineloss, tvb, offset, msg_len, float_value); |
4433 | 0 | } |
4434 | 0 | else |
4435 | 0 | { /* unexpected length */ |
4436 | 0 | 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); |
4437 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4438 | 0 | } |
4439 | 0 | break; |
4440 | 0 | default: proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA); /* unknown identifier */ |
4441 | 0 | } /* switch (identifier) */ |
4442 | 0 | break; |
4443 | 0 | default: /* unknown group */ |
4444 | | /* identifier considered also unknown */ |
4445 | 0 | proto_item_append_text(identifier_proto_item, "Unknown"); |
4446 | 0 | proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA); |
4447 | 0 | } /* switch (group) */ |
4448 | 0 | break; |
4449 | 0 | case HYTEC_SUBTYPE__TRACE: /* Trace-Subtype */ |
4450 | 0 | proto_item_append_text(group_proto_item, " (%s)", val_to_str_const(group, hytec_trace_groups, "Unknown")); |
4451 | |
|
4452 | 0 | switch (group) |
4453 | 0 | { |
4454 | 0 | case HYTEC_TRACEG__MAC_TRACE: |
4455 | 0 | proto_item_append_text(identifier_proto_item, "%s", val_to_str_const(identifier, hytec_mc, "Unknown")); |
4456 | |
|
4457 | 0 | switch (identifier) |
4458 | 0 | { |
4459 | 0 | case HYTEC_MC__MAC_TRACE_REQUEST: |
4460 | 0 | expected_data_length = 13; |
4461 | 0 | if(msg_len == expected_data_length) |
4462 | 0 | { |
4463 | 0 | tf = proto_tree_add_item(tree, hf_hytec_mac_trace_request, tvb, offset, -1, ENC_NA); |
4464 | 0 | hytec_data = proto_item_add_subtree(tf, ett_org_spc_hytec_trace_request); |
4465 | 0 | proto_tree_add_item(hytec_data, hf_hytec_trace_mac_address, tvb, offset, 6, ENC_NA); |
4466 | 0 | offset += 6; |
4467 | 0 | proto_tree_add_item(hytec_data, hf_hytec_request_mac_address, tvb, offset, 6, ENC_NA); |
4468 | 0 | offset += 6; |
4469 | 0 | proto_tree_add_item(hytec_data, hf_hytec_maximum_depth, tvb, offset, 1, ENC_BIG_ENDIAN); |
4470 | | /*offset += 1;*/ |
4471 | 0 | } |
4472 | 0 | else |
4473 | 0 | { /* unexpected length */ |
4474 | 0 | 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); |
4475 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4476 | 0 | } |
4477 | 0 | break; |
4478 | 0 | case HYTEC_MC__MAC_TRACE_REPLY: |
4479 | 0 | expected_data_length = 13; |
4480 | 0 | if(msg_len == expected_data_length) |
4481 | 0 | { |
4482 | 0 | tf = proto_tree_add_item(tree, hf_hytec_mac_trace_reply, tvb, offset, -1, ENC_NA); |
4483 | 0 | hytec_data = proto_item_add_subtree(tf, ett_org_spc_hytec_trace_reply); |
4484 | 0 | proto_tree_add_item(hytec_data, hf_hytec_trace_mac_address, tvb, offset, 6, ENC_NA); |
4485 | 0 | offset += 6; |
4486 | 0 | proto_tree_add_item(hytec_data, hf_hytec_answering_mac_address, tvb, offset, 6, ENC_NA); |
4487 | 0 | offset += 6; |
4488 | 0 | proto_tree_add_item(hytec_data, hf_hytec_actual_depth, tvb, offset, 1, ENC_BIG_ENDIAN); |
4489 | | /*offset += 1;*/ |
4490 | 0 | } |
4491 | 0 | else |
4492 | 0 | { /* unexpected length */ |
4493 | 0 | 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); |
4494 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4495 | 0 | } |
4496 | 0 | break; |
4497 | 0 | case HYTEC_MC__NAME_OF_REPLYING_DEVICE: |
4498 | 0 | maximum_data_length = 64; |
4499 | 0 | 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); |
4500 | 0 | else |
4501 | 0 | { /* unexpected length */ |
4502 | 0 | 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); |
4503 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4504 | 0 | } |
4505 | 0 | break; |
4506 | 0 | case HYTEC_MC__OUTGOING_PORT_NAME: |
4507 | 0 | maximum_data_length = 64; |
4508 | 0 | 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); |
4509 | 0 | else |
4510 | 0 | { /* unexpected length */ |
4511 | 0 | 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); |
4512 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4513 | 0 | } |
4514 | 0 | break; |
4515 | 0 | case HYTEC_MC__IPV4_ADDRESS_OF_REPLYING_DEVICE: |
4516 | 0 | expected_data_length = 4; |
4517 | 0 | if(msg_len == expected_data_length) proto_tree_add_item(tree, hf_hytec_ipv4_address_of_replying_device, tvb, offset, msg_len, ENC_NA); |
4518 | 0 | else |
4519 | 0 | { /* unexpected length */ |
4520 | 0 | 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); |
4521 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4522 | 0 | } |
4523 | 0 | break; |
4524 | 0 | case HYTEC_MC__END_OF_TRACE: |
4525 | 0 | expected_data_length = 1; |
4526 | 0 | if(msg_len == expected_data_length) proto_tree_add_item(tree, hf_hytec_end_of_trace, tvb, offset, msg_len, ENC_BIG_ENDIAN); |
4527 | 0 | else |
4528 | 0 | { /* unexpected length */ |
4529 | 0 | 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); |
4530 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4531 | 0 | } |
4532 | 0 | break; |
4533 | 0 | case HYTEC_MC__IPV6_ADDRESS_OF_REPLYING_DEVICE: |
4534 | 0 | expected_data_length = 16; |
4535 | 0 | if(msg_len == expected_data_length) proto_tree_add_item(tree, hf_hytec_ipv6_address_of_replying_device, tvb, offset, msg_len, ENC_NA); |
4536 | 0 | else |
4537 | 0 | { /* unexpected length */ |
4538 | 0 | 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); |
4539 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4540 | 0 | } |
4541 | 0 | break; |
4542 | 0 | case HYTEC_MC__INCOMING_PORT_NAME: |
4543 | 0 | maximum_data_length = 64; |
4544 | 0 | 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); |
4545 | 0 | else |
4546 | 0 | { /* unexpected length */ |
4547 | 0 | 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); |
4548 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4549 | 0 | } |
4550 | 0 | break; |
4551 | 0 | case HYTEC_MC__TRACE_IDENTIFIER: |
4552 | 0 | expected_data_length = 4; |
4553 | 0 | if(msg_len == expected_data_length) proto_tree_add_item(tree, hf_hytec_trace_identifier, tvb, offset, msg_len, ENC_BIG_ENDIAN); |
4554 | 0 | else |
4555 | 0 | { /* unexpected length */ |
4556 | 0 | 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); |
4557 | 0 | if(msg_len) proto_tree_add_item(tree, hf_hytec_invalid_object_data, tvb, offset, msg_len, ENC_STR_HEX); |
4558 | 0 | } |
4559 | 0 | break; |
4560 | 0 | default: proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA); /* unknown identifier */ |
4561 | 0 | } /* switch (identifier) */ |
4562 | 0 | break; |
4563 | 0 | default: /* unknown group */ |
4564 | | /* identifier considered also unknown */ |
4565 | 0 | proto_item_append_text(identifier_proto_item, "Unknown"); |
4566 | 0 | proto_tree_add_item(tree, hf_hytec_unknown_identifier_content, tvb, offset, -1, ENC_NA); |
4567 | 0 | } /* switch (group) */ |
4568 | 0 | break; |
4569 | 0 | default: /* unknown subtype */ |
4570 | 0 | proto_item_append_text(group_proto_item, " (Unknown)"); |
4571 | 0 | proto_item_append_text(identifier_proto_item, "Unknown"); |
4572 | 0 | proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA); |
4573 | 0 | break; |
4574 | 0 | } /* switch (subtype) */ |
4575 | | |
4576 | 0 | proto_item_append_text(identifier_proto_item, ")"); |
4577 | 0 | } |
4578 | | |
4579 | | /* Dissect Avaya OUI TLVs */ |
4580 | | static void |
4581 | | dissect_avaya_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
4582 | 0 | { |
4583 | 0 | uint8_t subType; |
4584 | 0 | uint32_t offset = 0; |
4585 | |
|
4586 | 0 | proto_tree *avaya_data = NULL; |
4587 | 0 | proto_item *tf = NULL; |
4588 | | |
4589 | | /* Get subtype */ |
4590 | 0 | subType = tvb_get_uint8(tvb, offset); |
4591 | |
|
4592 | 0 | proto_tree_add_item(tree, hf_avaya_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
4593 | |
|
4594 | 0 | offset++; |
4595 | |
|
4596 | 0 | switch (subType) |
4597 | 0 | { |
4598 | 0 | case 0x01: /* PoE Conservation Level Support */ |
4599 | 0 | { |
4600 | 0 | proto_tree_add_item(tree, hf_avaya_poe, tvb, offset, 7, ENC_NA); |
4601 | 0 | break; |
4602 | 0 | } |
4603 | 0 | case 0x03: /* Call Server IP Address */ |
4604 | 0 | { |
4605 | 0 | proto_tree_add_item(tree, hf_avaya_call_server, tvb, offset, 4, ENC_NA); |
4606 | 0 | break; |
4607 | 0 | } |
4608 | 0 | case 0x04: /* IP Phone Addresses */ |
4609 | 0 | { |
4610 | 0 | tf = proto_tree_add_item(tree, hf_avaya_ipphone, tvb, offset, 12, ENC_NA); |
4611 | 0 | avaya_data = proto_item_add_subtree(tf, ett_avaya_ipphone_tlv); |
4612 | 0 | proto_tree_add_item(avaya_data, hf_avaya_ipphone_ip, tvb, offset, 4, ENC_NA); |
4613 | 0 | proto_tree_add_item(avaya_data, hf_avaya_ipphone_mask, tvb, offset+4, 4, ENC_NA); |
4614 | 0 | proto_tree_add_item(avaya_data, hf_avaya_ipphone_gateway, tvb, offset+8, 4, ENC_NA); |
4615 | 0 | break; |
4616 | 0 | } |
4617 | 0 | case 0x05: /* CNA Server IP Address */ |
4618 | 0 | { |
4619 | 0 | proto_tree_add_item(tree, hf_avaya_cna_server, tvb, offset, 4, ENC_NA); |
4620 | 0 | break; |
4621 | 0 | } |
4622 | 0 | case 0x06: /* File Server */ |
4623 | 0 | { |
4624 | 0 | proto_tree_add_item(tree, hf_avaya_file_server, tvb, offset, 4, ENC_NA); |
4625 | 0 | break; |
4626 | 0 | } |
4627 | 0 | case 0x07: /* 802.1Q Framing */ |
4628 | 0 | { |
4629 | 0 | proto_tree_add_item(tree, hf_avaya_dot1q, tvb, offset, 1, ENC_NA); |
4630 | 0 | break; |
4631 | 0 | } |
4632 | 0 | default: |
4633 | 0 | proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA); |
4634 | 0 | break; |
4635 | 0 | } |
4636 | 0 | } |
4637 | | |
4638 | | /* Dissect IANA OUI TLVs */ |
4639 | | static void |
4640 | | dissect_iana_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
4641 | 0 | { |
4642 | 0 | uint16_t msg_len; |
4643 | 0 | uint8_t subType; |
4644 | 0 | uint32_t offset = 0; |
4645 | | |
4646 | | /* Get subtype */ |
4647 | 0 | subType = tvb_get_uint8(tvb, offset); |
4648 | |
|
4649 | 0 | proto_tree_add_item(tree, hf_iana_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); |
4650 | 0 | offset++; |
4651 | |
|
4652 | 0 | msg_len=tvb_reported_length_remaining(tvb, offset); |
4653 | 0 | switch (subType) |
4654 | 0 | { |
4655 | 0 | case 0x01: /* MUDURL */ |
4656 | 0 | if ( msg_len > 0 ) |
4657 | 0 | proto_tree_add_item(tree, hf_iana_mudurl, tvb, offset, msg_len, ENC_ASCII); |
4658 | 0 | break; |
4659 | | |
4660 | 0 | default: |
4661 | 0 | proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA); |
4662 | 0 | break; |
4663 | 0 | } |
4664 | 0 | } |
4665 | | |
4666 | | static void |
4667 | | dissect_onos_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
4668 | 0 | { |
4669 | 0 | uint16_t msg_len; |
4670 | 0 | uint32_t subType; |
4671 | 0 | uint32_t offset = 0; |
4672 | |
|
4673 | 0 | proto_tree_add_item_ret_uint(tree, hf_onos_subtype, tvb, offset, 1, ENC_BIG_ENDIAN, &subType); |
4674 | 0 | offset++; |
4675 | |
|
4676 | 0 | msg_len=tvb_reported_length_remaining(tvb, offset); |
4677 | 0 | switch (subType) |
4678 | 0 | { |
4679 | 0 | case ONOS_CHASSIS_TLV_TYPE: |
4680 | 0 | proto_tree_add_item(tree, hf_onos_chassis, tvb, offset, msg_len, ENC_ASCII); |
4681 | 0 | break; |
4682 | 0 | case ONOS_PORT_TLV_TYPE: |
4683 | 0 | proto_tree_add_item(tree, hf_onos_port, tvb, offset, msg_len, ENC_ASCII); |
4684 | 0 | break; |
4685 | 0 | case ONOS_TTL_TLV_TYPE: |
4686 | 0 | proto_tree_add_item(tree, hf_onos_ttl, tvb, offset, msg_len, ENC_NA); |
4687 | 0 | break; |
4688 | 0 | default: |
4689 | 0 | proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA); |
4690 | 0 | break; |
4691 | 0 | } |
4692 | 0 | } |
4693 | | |
4694 | | |
4695 | | /* Dissect Organizational Specific TLV */ |
4696 | | static int32_t |
4697 | | dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset, profinet_lldp_column_info *pn_lldp_column_info) |
4698 | 0 | { |
4699 | 0 | uint16_t dataLen; |
4700 | 0 | uint16_t tempShort; |
4701 | 0 | int tempTree; |
4702 | 0 | uint32_t oui, tLength = tvb_reported_length(tvb); |
4703 | 0 | uint8_t subType; |
4704 | 0 | tvbuff_t *vendor_tvb; |
4705 | 0 | const char *ouiStr; |
4706 | 0 | const char *subTypeStr; |
4707 | |
|
4708 | 0 | proto_tree *org_tlv_tree = NULL; |
4709 | 0 | proto_item *lf = NULL; |
4710 | | /* Get tlv type and length */ |
4711 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
4712 | | |
4713 | | /* Get tlv length */ |
4714 | 0 | dataLen = TLV_INFO_LEN(tempShort); |
4715 | | /* Get OUI value */ |
4716 | 0 | oui = tvb_get_ntoh24(tvb, (offset+2)); |
4717 | 0 | subType = tvb_get_uint8(tvb, (offset+5)); |
4718 | | |
4719 | | /* check for registered dissectors for the OUI If none found continue, else call dissector */ |
4720 | 0 | if( dissector_try_uint(oui_unique_code_table, oui, tvb, pinfo, tree) ) { |
4721 | 0 | return tLength; |
4722 | 0 | } |
4723 | | /* Look in manuf database for OUI */ |
4724 | 0 | ouiStr = uint_get_manuf_name_if_known(oui); |
4725 | 0 | if(ouiStr==NULL) ouiStr="Unknown"; |
4726 | | |
4727 | | /* Set a default value */ |
4728 | 0 | tempTree = ett_org_spc_ProfinetSubTypes_1; |
4729 | 0 | switch(oui) |
4730 | 0 | { |
4731 | 0 | case OUI_DCBX: |
4732 | 0 | subTypeStr = val_to_str(subType, dcbx_protocol_types, "Unknown subtype (0x%x)"); |
4733 | 0 | switch(subType) |
4734 | 0 | { |
4735 | 0 | case 1: tempTree = ett_org_spc_dcbx_cin; |
4736 | 0 | break; |
4737 | 0 | case 2: tempTree = ett_org_spc_dcbx_cee; |
4738 | 0 | break; |
4739 | 0 | } |
4740 | 0 | break; |
4741 | 0 | case OUI_IEEE_802_1: |
4742 | 0 | subTypeStr = val_to_str(subType, ieee_802_1_subtypes, "Unknown subtype 0x%x"); |
4743 | 0 | switch(subType) |
4744 | 0 | { |
4745 | 0 | case 0x1: tempTree = ett_org_spc_ieee_802_1_1; |
4746 | 0 | break; |
4747 | 0 | case 0x2: tempTree = ett_org_spc_ieee_802_1_2; |
4748 | 0 | break; |
4749 | 0 | case 0x3: tempTree = ett_org_spc_ieee_802_1_3; |
4750 | 0 | break; |
4751 | 0 | case 0x4: tempTree = ett_org_spc_ieee_802_1_4; |
4752 | 0 | break; |
4753 | 0 | case 0x8: tempTree = ett_org_spc_ieee_802_1_8; |
4754 | 0 | break; |
4755 | 0 | case 0x9: tempTree = ett_org_spc_ieee_802_1_9; |
4756 | 0 | break; |
4757 | 0 | case 0xa: tempTree = ett_org_spc_ieee_802_1_a; |
4758 | 0 | break; |
4759 | 0 | case 0xb: tempTree = ett_org_spc_ieee_802_1_b; |
4760 | 0 | break; |
4761 | 0 | case 0xc: tempTree = ett_org_spc_ieee_802_1_c; |
4762 | 0 | break; |
4763 | 0 | } |
4764 | 0 | break; |
4765 | 0 | case OUI_IEEE_802_3: |
4766 | 0 | subTypeStr = val_to_str(subType, ieee_802_3_subtypes, "Unknown subtype 0x%x"); |
4767 | 0 | switch(subType) |
4768 | 0 | { |
4769 | 0 | case 1: tempTree = ett_org_spc_ieee_802_3_1; |
4770 | 0 | break; |
4771 | 0 | case 2: tempTree = ett_org_spc_ieee_802_3_2; |
4772 | 0 | break; |
4773 | 0 | case 3: tempTree = ett_org_spc_ieee_802_3_3; |
4774 | 0 | break; |
4775 | 0 | case 4: tempTree = ett_org_spc_ieee_802_3_4; |
4776 | 0 | break; |
4777 | 0 | case 5: tempTree = ett_org_spc_ieee_802_3_5; |
4778 | 0 | break; |
4779 | 0 | case 7: tempTree = ett_org_spc_ieee_802_3_7; |
4780 | 0 | break; |
4781 | 0 | } |
4782 | 0 | break; |
4783 | 0 | case OUI_MEDIA_ENDPOINT: |
4784 | 0 | subTypeStr = val_to_str(subType, media_subtypes, "Unknown subtype 0x%x"); |
4785 | 0 | switch(subType) |
4786 | 0 | { |
4787 | 0 | case 1: tempTree = ett_org_spc_media_1; |
4788 | 0 | break; |
4789 | 0 | case 2: tempTree = ett_org_spc_media_2; |
4790 | 0 | break; |
4791 | 0 | case 3: tempTree = ett_org_spc_media_3; |
4792 | 0 | break; |
4793 | 0 | case 4: tempTree = ett_org_spc_media_4; |
4794 | 0 | break; |
4795 | 0 | case 5: tempTree = ett_org_spc_media_5; |
4796 | 0 | break; |
4797 | 0 | case 6: tempTree = ett_org_spc_media_6; |
4798 | 0 | break; |
4799 | 0 | case 7: tempTree = ett_org_spc_media_7; |
4800 | 0 | break; |
4801 | 0 | case 8: tempTree = ett_org_spc_media_8; |
4802 | 0 | break; |
4803 | 0 | case 9: tempTree = ett_org_spc_media_9; |
4804 | 0 | break; |
4805 | 0 | case 10: tempTree = ett_org_spc_media_10; |
4806 | 0 | break; |
4807 | 0 | case 11: tempTree = ett_org_spc_media_11; |
4808 | 0 | break; |
4809 | 0 | } |
4810 | 0 | break; |
4811 | 0 | case OUI_PROFINET: |
4812 | 0 | subTypeStr = val_to_str(subType, profinet_subtypes, "Reserved (0x%x)"); |
4813 | 0 | switch(subType) |
4814 | 0 | { |
4815 | 0 | case 1: tempTree = ett_org_spc_ProfinetSubTypes_1; |
4816 | 0 | break; |
4817 | 0 | case 2: tempTree = ett_org_spc_ProfinetSubTypes_2; |
4818 | 0 | break; |
4819 | 0 | case 3: tempTree = ett_org_spc_ProfinetSubTypes_3; |
4820 | 0 | break; |
4821 | 0 | case 4: tempTree = ett_org_spc_ProfinetSubTypes_4; |
4822 | 0 | break; |
4823 | 0 | case 5: tempTree = ett_org_spc_ProfinetSubTypes_5; |
4824 | 0 | break; |
4825 | 0 | case 6: tempTree = ett_org_spc_ProfinetSubTypes_6; |
4826 | 0 | break; |
4827 | 0 | } |
4828 | 0 | break; |
4829 | 0 | case OUI_CISCO_2: |
4830 | 0 | subTypeStr = val_to_str(subType, cisco_subtypes, "Unknown subtype (0x%x)"); |
4831 | 0 | break; |
4832 | 0 | case OUI_IEEE_802_1QBG: |
4833 | 0 | subTypeStr = val_to_str(subType, ieee_802_1qbg_subtypes, "Unknown subtype 0x%x"); |
4834 | 0 | break; |
4835 | 0 | case OUI_AVAYA_EXTREME: |
4836 | 0 | subTypeStr = val_to_str(subType, ex_avaya_subtypes, "Unknown subtype 0x%x"); |
4837 | 0 | switch(subType) |
4838 | 0 | { |
4839 | 0 | case EX_AVAYA_SUBTYPE_ELEMENT_TLV: tempTree = ett_ex_avayaSubTypes_11; |
4840 | 0 | break; |
4841 | 0 | case EX_AVAYA_SUBTYPE_ASSIGNMENT_TLV: tempTree = ett_ex_avayaSubTypes_12; |
4842 | 0 | break; |
4843 | 0 | } |
4844 | 0 | break; |
4845 | 0 | case OUI_AVAYA_EXTREME2: |
4846 | 0 | subTypeStr = val_to_str(subType, ex_avaya2_subtypes, "Unknown subtype 0x%x"); |
4847 | 0 | switch(subType) |
4848 | 0 | { |
4849 | 0 | case EX_AVAYA2_SUBTYPE_ZTFv2_FC_TLV: tempTree = ett_ex_avaya2SubTypes_4; |
4850 | 0 | break; |
4851 | 0 | } |
4852 | 0 | break; |
4853 | 0 | case OUI_HYTEC_GER: |
4854 | 0 | subTypeStr = val_to_str(subType, hytec_subtypes, "Unknown subtype (0x%x)"); |
4855 | 0 | switch(subType) |
4856 | 0 | { |
4857 | 0 | case HYTEC_SUBTYPE__TRANSCEIVER: tempTree = ett_org_spc_hytec_subtype_transceiver; |
4858 | 0 | break; |
4859 | 0 | case HYTEC_SUBTYPE__TRACE: tempTree = ett_org_spc_hytec_subtype_trace; |
4860 | 0 | break; |
4861 | 0 | } |
4862 | 0 | break; |
4863 | 0 | case OUI_AVAYA: |
4864 | 0 | subTypeStr = val_to_str(subType, avaya_subtypes, "Unknown subtype (0x%x)"); |
4865 | 0 | break; |
4866 | 0 | case OUI_IANA: |
4867 | 0 | subTypeStr = val_to_str(subType, iana_subtypes, "Unknown subtype (0x%x)"); |
4868 | 0 | break; |
4869 | 0 | case OUI_ONOS: |
4870 | 0 | subTypeStr = val_to_str(subType, onos_subtypes, "Unknown subtype (0x%x)"); |
4871 | 0 | break; |
4872 | 0 | case OUI_ODVA: |
4873 | 0 | subTypeStr = val_to_str(subType, lldp_cip_subtypes, "Unknown subtype (0x%x)"); |
4874 | 0 | break; |
4875 | 0 | default: |
4876 | 0 | subTypeStr = wmem_strdup_printf(pinfo->pool, "Unknown (%d)",subType); |
4877 | 0 | break; |
4878 | 0 | } |
4879 | | |
4880 | 0 | org_tlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, tLength, tempTree, NULL, "%s - %s", ouiStr, subTypeStr); |
4881 | 0 | proto_tree_add_item(org_tlv_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
4882 | |
|
4883 | 0 | lf = proto_tree_add_item(org_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
4884 | 0 | if (dataLen < 4) |
4885 | 0 | { |
4886 | 0 | expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, |
4887 | 0 | "TLV length (%u) too short, must be >=4)", dataLen); |
4888 | 0 | return tLength; |
4889 | 0 | } |
4890 | | |
4891 | | /* Display organizational unique id */ |
4892 | 0 | proto_tree_add_uint(org_tlv_tree, hf_org_spc_oui, tvb, offset + 2, 3, oui); |
4893 | | |
4894 | | /* Try to make sure we don't overrun the sub-tlvs */ |
4895 | 0 | vendor_tvb = tvb_new_subset_length(tvb, offset + 5, dataLen - 3); |
4896 | |
|
4897 | 0 | switch (oui) |
4898 | 0 | { |
4899 | 0 | case OUI_DCBX: |
4900 | 0 | dissect_dcbx_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4901 | 0 | break; |
4902 | 0 | case OUI_IEEE_802_1: |
4903 | 0 | dissect_ieee_802_1_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4904 | 0 | break; |
4905 | 0 | case OUI_IEEE_802_3: |
4906 | 0 | dissect_ieee_802_3_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4907 | 0 | break; |
4908 | 0 | case OUI_MEDIA_ENDPOINT: |
4909 | 0 | dissect_media_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4910 | 0 | break; |
4911 | 0 | case OUI_PROFINET: |
4912 | 0 | dissect_profinet_tlv(vendor_tvb, pinfo, org_tlv_tree, pn_lldp_column_info); |
4913 | 0 | break; |
4914 | 0 | case OUI_CISCO_2: |
4915 | 0 | dissect_cisco_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4916 | 0 | break; |
4917 | 0 | case OUI_IEEE_802_1QBG: |
4918 | 0 | dissect_ieee_802_1qbg_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4919 | 0 | break; |
4920 | 0 | case OUI_HYTEC_GER: |
4921 | 0 | dissect_hytec_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4922 | 0 | break; |
4923 | 0 | case OUI_AVAYA: |
4924 | 0 | dissect_avaya_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4925 | 0 | break; |
4926 | 0 | case OUI_IANA: |
4927 | 0 | dissect_iana_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4928 | 0 | break; |
4929 | 0 | case OUI_AVAYA_EXTREME: |
4930 | 0 | dissect_extreme_avaya_tlv(vendor_tvb, pinfo, org_tlv_tree, dataLen ); |
4931 | 0 | break; |
4932 | 0 | case OUI_AVAYA_EXTREME2: |
4933 | 0 | dissect_extreme_avaya2_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4934 | 0 | break; |
4935 | 0 | case OUI_ONOS: |
4936 | 0 | dissect_onos_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4937 | 0 | break; |
4938 | 0 | case OUI_ODVA: |
4939 | 0 | dissect_lldp_cip_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4940 | 0 | break; |
4941 | 0 | default: |
4942 | 0 | dissect_oui_default_tlv(vendor_tvb, pinfo, org_tlv_tree); |
4943 | 0 | } |
4944 | | |
4945 | 0 | return offset + tvb_reported_length(tvb); |
4946 | 0 | } |
4947 | | |
4948 | | /* Dissect Unknown TLV */ |
4949 | | static int32_t |
4950 | | dissect_lldp_unknown_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, uint32_t offset) |
4951 | 0 | { |
4952 | 0 | uint16_t dataLen; |
4953 | 0 | uint16_t tempShort; |
4954 | |
|
4955 | 0 | proto_tree *unknown_tlv_tree; |
4956 | | |
4957 | | /* Get tlv type and length */ |
4958 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
4959 | | |
4960 | | /* Get tlv length */ |
4961 | 0 | dataLen = TLV_INFO_LEN(tempShort); |
4962 | |
|
4963 | 0 | unknown_tlv_tree = proto_tree_add_subtree(tree, tvb, offset, (dataLen + 2), ett_unknown_tlv, NULL, "Unknown TLV"); |
4964 | |
|
4965 | 0 | proto_tree_add_item(unknown_tlv_tree, hf_lldp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
4966 | 0 | proto_tree_add_item(unknown_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN); |
4967 | |
|
4968 | 0 | offset += 2; |
4969 | | /* Adjust for unknown data */ |
4970 | 0 | offset += dataLen; |
4971 | |
|
4972 | 0 | return offset; |
4973 | 0 | } |
4974 | | |
4975 | | |
4976 | | /* Dissect LLDP packets */ |
4977 | | static int |
4978 | | dissect_lldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) |
4979 | 7 | { |
4980 | 7 | proto_item *ti; |
4981 | 7 | proto_tree *lldp_tree = NULL; |
4982 | 7 | tvbuff_t *new_tvb = NULL; |
4983 | 7 | uint32_t offset = 0; |
4984 | 7 | uint16_t isShutdown; |
4985 | 7 | int32_t rtnValue = 0; |
4986 | 7 | uint16_t tempShort; |
4987 | 7 | uint8_t tlvType; |
4988 | 7 | uint32_t tvbLen; |
4989 | 7 | profinet_lldp_column_info *pn_lldp_column_info = NULL; |
4990 | 7 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "LLDP"); |
4991 | | |
4992 | | /* Clear the information column on summary display */ |
4993 | 7 | col_clear(pinfo->cinfo, COL_INFO); |
4994 | | |
4995 | 7 | ti = proto_tree_add_item(tree, proto_lldp, tvb, offset, -1, ENC_NA); |
4996 | 7 | lldp_tree = proto_item_add_subtree(ti, ett_lldp); |
4997 | | |
4998 | | // Maybe add an explicit field for the type of the destination mac address? |
4999 | | |
5000 | | // IEEE 802.1AB-2016, Table 7-2—Support for MAC addresses in different systems |
5001 | | // Address | C-VLAN Bridge | S-VLAN Bridge | TPMR Bridge | End station |
5002 | | // ------------------------------------------+---------------+----------------+---------------+------------- |
5003 | | // 01-80-C2-00-00-0E Nearest bridge | Mandatory | Mandatory | Mandatory | Mandatory |
5004 | | // 01-80-C2-00-00-03 Nearest non-TPMR bridge | Mandatory | Mandatory | Not permitted | Recommended |
5005 | | // 01-80-C2-00-00-00 Nearest Customer Bridge | Mandatory | Not permitted | Not permitted | Recommended |
5006 | | // Any other group MAC address | Permitted | Permitted | Permitted | Permitted |
5007 | | // Any individual MAC address | Permitted | Permitted | Permitted | Permitted |
5008 | | |
5009 | | /* Get chassis id tlv */ |
5010 | 7 | tempShort = tvb_get_ntohs(tvb, offset); |
5011 | 7 | new_tvb = tvb_new_subset_length(tvb, offset, TLV_INFO_LEN(tempShort)+2); |
5012 | | |
5013 | | /* allocation */ |
5014 | 7 | pn_lldp_column_info = wmem_new0(pinfo->pool, profinet_lldp_column_info); |
5015 | | |
5016 | 7 | rtnValue = dissect_lldp_chassis_id(new_tvb, pinfo, lldp_tree, 0, pn_lldp_column_info); |
5017 | 7 | if (rtnValue < 0) |
5018 | 1 | { |
5019 | 1 | col_set_str(pinfo->cinfo, COL_INFO, "Invalid Chassis ID TLV"); |
5020 | 1 | return tvb_captured_length(tvb); |
5021 | 1 | } |
5022 | | |
5023 | 6 | offset += rtnValue; |
5024 | | |
5025 | | /* Get port id tlv */ |
5026 | 6 | tempShort = tvb_get_ntohs(tvb, offset); |
5027 | 6 | new_tvb = tvb_new_subset_length(tvb, offset, TLV_INFO_LEN(tempShort)+2); |
5028 | | |
5029 | 6 | rtnValue = dissect_lldp_port_id(new_tvb, pinfo, lldp_tree, 0, pn_lldp_column_info); |
5030 | 6 | if (rtnValue < 0) |
5031 | 1 | { |
5032 | 1 | col_set_str(pinfo->cinfo, COL_INFO, "Invalid Port ID TLV"); |
5033 | 1 | return tvb_captured_length(tvb); |
5034 | 1 | } |
5035 | | |
5036 | 5 | offset += rtnValue; |
5037 | | |
5038 | | /* Get time to live tlv */ |
5039 | 5 | tempShort = tvb_get_ntohs(tvb, offset); |
5040 | 5 | new_tvb = tvb_new_subset_length(tvb, offset, TLV_INFO_LEN(tempShort)+2); |
5041 | | |
5042 | 5 | rtnValue = dissect_lldp_time_to_live(new_tvb, pinfo, lldp_tree, 0, &isShutdown); |
5043 | 5 | if (rtnValue < 0) |
5044 | 0 | { |
5045 | 0 | col_set_str(pinfo->cinfo, COL_INFO, "Invalid Time-to-Live TLV"); |
5046 | 0 | return tvb_captured_length(tvb); |
5047 | 0 | } |
5048 | | |
5049 | 5 | offset += rtnValue; |
5050 | | |
5051 | 5 | tvbLen = tvb_captured_length(tvb); |
5052 | | /* Dissect optional tlv info that contained in data packets */ |
5053 | 5 | while (offset < tvbLen) |
5054 | 0 | { |
5055 | 0 | tempShort = tvb_get_ntohs(tvb, offset); |
5056 | 0 | tlvType = TLV_TYPE(tempShort); |
5057 | | /* pass single TLV to dissectors, Zero offset (point to front of tlv) */ |
5058 | 0 | new_tvb = tvb_new_subset_length(tvb, offset, TLV_INFO_LEN(tempShort)+2); |
5059 | 0 | switch (tlvType) |
5060 | 0 | { |
5061 | 0 | case CHASSIS_ID_TLV_TYPE: |
5062 | 0 | dissect_lldp_chassis_id(new_tvb, pinfo, lldp_tree, 0, pn_lldp_column_info); |
5063 | 0 | rtnValue = -1; /* Duplicate chassis id tlv */ |
5064 | 0 | if (column_info_selection == DEFAULT_COLUMN_INFO) |
5065 | 0 | { |
5066 | 0 | col_set_str(pinfo->cinfo, COL_INFO, "Duplicate Chassis ID TLV"); |
5067 | 0 | } |
5068 | 0 | break; |
5069 | 0 | case PORT_ID_TLV_TYPE: |
5070 | 0 | dissect_lldp_port_id(new_tvb, pinfo, lldp_tree, 0, pn_lldp_column_info); |
5071 | 0 | rtnValue = -1; /* Duplicate port id tlv */ |
5072 | 0 | if (column_info_selection == DEFAULT_COLUMN_INFO) |
5073 | 0 | { |
5074 | 0 | col_set_str(pinfo->cinfo, COL_INFO, "Duplicate Port ID TLV"); |
5075 | 0 | } |
5076 | 0 | break; |
5077 | 0 | case TIME_TO_LIVE_TLV_TYPE: |
5078 | 0 | dissect_lldp_time_to_live(new_tvb, pinfo, lldp_tree, 0, &isShutdown); |
5079 | 0 | rtnValue = -1; /* Duplicate time-to-live tlv */ |
5080 | 0 | if (column_info_selection == DEFAULT_COLUMN_INFO) |
5081 | 0 | { |
5082 | 0 | col_set_str(pinfo->cinfo, COL_INFO, "Duplicate Time-To-Live TLV"); |
5083 | 0 | } |
5084 | 0 | break; |
5085 | 0 | case END_OF_LLDPDU_TLV_TYPE: |
5086 | 0 | rtnValue = dissect_lldp_end_of_lldpdu(new_tvb, pinfo, lldp_tree, 0); |
5087 | 0 | break; |
5088 | 0 | case PORT_DESCRIPTION_TLV_TYPE: |
5089 | 0 | rtnValue = dissect_lldp_port_desc(new_tvb, pinfo, lldp_tree, 0); |
5090 | 0 | break; |
5091 | 0 | case SYSTEM_NAME_TLV_TYPE: |
5092 | 0 | case SYSTEM_DESCRIPTION_TLV_TYPE: |
5093 | 0 | rtnValue = dissect_lldp_system_name(new_tvb, pinfo, lldp_tree, 0); |
5094 | 0 | break; |
5095 | 0 | case SYSTEM_CAPABILITIES_TLV_TYPE: |
5096 | 0 | rtnValue = dissect_lldp_system_capabilities(new_tvb, pinfo, lldp_tree, 0); |
5097 | 0 | break; |
5098 | 0 | case MANAGEMENT_ADDR_TLV_TYPE: |
5099 | 0 | rtnValue = dissect_lldp_management_address(new_tvb, pinfo, lldp_tree, 0); |
5100 | 0 | break; |
5101 | 0 | case ORGANIZATION_SPECIFIC_TLV_TYPE: |
5102 | 0 | rtnValue = dissect_organizational_specific_tlv(new_tvb, pinfo, lldp_tree, 0, pn_lldp_column_info); |
5103 | 0 | break; |
5104 | 0 | default: |
5105 | 0 | if (!assume_unrecognized_tlv |
5106 | 0 | || tempShort > tvb_reported_length_remaining(tvb, offset)) { |
5107 | | /* Probably not an LLDP LTV */ |
5108 | 0 | rtnValue = -1; |
5109 | 0 | } |
5110 | 0 | else { |
5111 | 0 | rtnValue = dissect_lldp_unknown_tlv(new_tvb, pinfo, lldp_tree, 0); |
5112 | 0 | } |
5113 | 0 | break; |
5114 | 0 | } |
5115 | | |
5116 | | // Shutdown PDU: Verify that only ChassisID, PortID, TTL and optionally END TLVs are present |
5117 | 0 | if (isShutdown && tlvType != END_OF_LLDPDU_TLV_TYPE) |
5118 | 0 | { |
5119 | 0 | proto_tree_add_expert_format(tree, pinfo, &ei_lldp_shutdown_excess_tlv , tvb, offset, TLV_INFO_LEN(tempShort), |
5120 | 0 | "TLV type 0x%02X not allowed in Shutdown PDU", tlvType); |
5121 | 0 | } |
5122 | |
|
5123 | 0 | if (rtnValue < 0) { |
5124 | 0 | break; |
5125 | 0 | } |
5126 | 0 | else |
5127 | 0 | offset += rtnValue; |
5128 | | |
5129 | | /* Terminate the LLDP dissector after reaching the END_OF_LLDPDU */ |
5130 | 0 | if (tlvType == END_OF_LLDPDU_TLV_TYPE) { |
5131 | 0 | break; |
5132 | 0 | } |
5133 | 0 | } |
5134 | | |
5135 | 5 | set_actual_length(tvb, offset); |
5136 | 5 | proto_item_set_len(ti, offset); |
5137 | 5 | return tvb_captured_length(tvb); |
5138 | 5 | } |
5139 | | |
5140 | | /* Register the protocol with Wireshark */ |
5141 | | void |
5142 | | proto_register_lldp(void) |
5143 | 14 | { |
5144 | 14 | module_t *lldp_module; |
5145 | 14 | expert_module_t *expert_lldp; |
5146 | | |
5147 | | /* Setup list of header fields */ |
5148 | 14 | static hf_register_info hf[] = { |
5149 | 14 | { &hf_lldp_tlv_type, |
5150 | 14 | { "TLV Type", "lldp.tlv.type", FT_UINT16, BASE_DEC, |
5151 | 14 | VALS(tlv_types), TLV_TYPE_MASK, NULL, HFILL } |
5152 | 14 | }, |
5153 | 14 | { &hf_lldp_tlv_len, |
5154 | 14 | { "TLV Length", "lldp.tlv.len", FT_UINT16, BASE_DEC, |
5155 | 14 | NULL, TLV_INFO_LEN_MASK, NULL, HFILL } |
5156 | 14 | }, |
5157 | 14 | { &hf_lldp_tlv_system_cap, |
5158 | 14 | { "Capabilities", "lldp.tlv.system_cap", FT_UINT16, BASE_HEX, |
5159 | 14 | NULL, 0, NULL, HFILL } |
5160 | 14 | }, |
5161 | 14 | { &hf_lldp_tlv_system_cap_other, |
5162 | 14 | { "Other", "lldp.tlv.system_cap.other", FT_BOOLEAN, 16, |
5163 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_OTHER, NULL, HFILL } |
5164 | 14 | }, |
5165 | 14 | { &hf_lldp_tlv_system_cap_repeater, |
5166 | 14 | { "Repeater", "lldp.tlv.system_cap.repeater", FT_BOOLEAN, 16, |
5167 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_REPEATER, NULL, HFILL } |
5168 | 14 | }, |
5169 | 14 | { &hf_lldp_tlv_system_cap_bridge, |
5170 | 14 | { "Bridge", "lldp.tlv.system_cap.bridge", FT_BOOLEAN, 16, |
5171 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_BRIDGE, NULL, HFILL } |
5172 | 14 | }, |
5173 | 14 | { &hf_lldp_tlv_system_cap_wlan_access_pt, |
5174 | 14 | { "WLAN access point", "lldp.tlv.system_cap.wlan_access_pt", FT_BOOLEAN, 16, |
5175 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_WLAN, NULL, HFILL } |
5176 | 14 | }, |
5177 | 14 | { &hf_lldp_tlv_system_cap_router, |
5178 | 14 | { "Router", "lldp.tlv.system_cap.router", FT_BOOLEAN, 16, |
5179 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_ROUTER, NULL, HFILL } |
5180 | 14 | }, |
5181 | 14 | { &hf_lldp_tlv_system_cap_telephone, |
5182 | 14 | { "Telephone", "lldp.tlv.system_cap.telephone", FT_BOOLEAN, 16, |
5183 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_TELEPHONE, NULL, HFILL } |
5184 | 14 | }, |
5185 | 14 | { &hf_lldp_tlv_system_cap_docsis_cable_device, |
5186 | 14 | { "DOCSIS cable device", "lldp.tlv.system_cap.docsis_cable_device", FT_BOOLEAN, 16, |
5187 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_DOCSIS, NULL, HFILL } |
5188 | 14 | }, |
5189 | 14 | { &hf_lldp_tlv_system_cap_station_only, |
5190 | 14 | { "Station only", "lldp.tlv.system_cap.station_only", FT_BOOLEAN, 16, |
5191 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_STATION, NULL, HFILL } |
5192 | 14 | }, |
5193 | 14 | { &hf_lldp_tlv_system_cap_cvlan_component, |
5194 | 14 | { "C-VLAN component", "lldp.tlv.system_cap.cvlan", FT_BOOLEAN, 16, |
5195 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_CVLAN, NULL, HFILL } |
5196 | 14 | }, |
5197 | 14 | { &hf_lldp_tlv_system_cap_svlan_component, |
5198 | 14 | { "S-VLAN component", "lldp.tlv.system_cap.svlan", FT_BOOLEAN, 16, |
5199 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_SVLAN, NULL, HFILL } |
5200 | 14 | }, |
5201 | 14 | { &hf_lldp_tlv_system_cap_tpmr_component, |
5202 | 14 | { "TPMR component", "lldp.tlv.system_cap.tpmr", FT_BOOLEAN, 16, |
5203 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_TPMR, NULL, HFILL } |
5204 | 14 | }, |
5205 | 14 | { &hf_lldp_tlv_system_name, |
5206 | 14 | { "System Name", "lldp.tlv.system.name", FT_STRING, BASE_NONE, |
5207 | 14 | NULL, 0, NULL, HFILL } |
5208 | 14 | }, |
5209 | 14 | { &hf_lldp_tlv_system_desc, |
5210 | 14 | { "System Description", "lldp.tlv.system.desc", FT_STRING, BASE_NONE, |
5211 | 14 | NULL, 0, NULL, HFILL } |
5212 | 14 | }, |
5213 | 14 | { &hf_lldp_tlv_enable_system_cap, |
5214 | 14 | { "Enabled Capabilities", "lldp.tlv.enable_system_cap", FT_UINT16, BASE_HEX, |
5215 | 14 | NULL, 0, NULL, HFILL } |
5216 | 14 | }, |
5217 | 14 | { &hf_lldp_tlv_enable_system_cap_other, |
5218 | 14 | { "Other", "lldp.tlv.enable_system_cap.other", FT_BOOLEAN, 16, |
5219 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_OTHER, NULL, HFILL } |
5220 | 14 | }, |
5221 | 14 | { &hf_lldp_tlv_enable_system_cap_repeater, |
5222 | 14 | { "Repeater", "lldp.tlv.enable_system_cap.repeater", FT_BOOLEAN, 16, |
5223 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_REPEATER, NULL, HFILL } |
5224 | 14 | }, |
5225 | 14 | { &hf_lldp_tlv_enable_system_cap_bridge, |
5226 | 14 | { "Bridge", "lldp.tlv.enable_system_cap.bridge", FT_BOOLEAN, 16, |
5227 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_BRIDGE, NULL, HFILL } |
5228 | 14 | }, |
5229 | 14 | { &hf_lldp_tlv_enable_system_cap_wlan_access_pt, |
5230 | 14 | { "WLAN access point", "lldp.tlv.enable_system_cap.wlan_access_pt", FT_BOOLEAN, 16, |
5231 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_WLAN, NULL, HFILL } |
5232 | 14 | }, |
5233 | 14 | { &hf_lldp_tlv_enable_system_cap_router, |
5234 | 14 | { "Router", "lldp.tlv.enable_system_cap.router", FT_BOOLEAN, 16, |
5235 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_ROUTER, NULL, HFILL } |
5236 | 14 | }, |
5237 | 14 | { &hf_lldp_tlv_enable_system_cap_telephone, |
5238 | 14 | { "Telephone", "lldp.tlv.enable_system_cap.telephone", FT_BOOLEAN, 16, |
5239 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_TELEPHONE, NULL, HFILL } |
5240 | 14 | }, |
5241 | 14 | { &hf_lldp_tlv_enable_system_cap_docsis_cable_device, |
5242 | 14 | { "DOCSIS cable device", "lldp.tlv.enable_system_cap.docsis_cable_device", FT_BOOLEAN, 16, |
5243 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_DOCSIS, NULL, HFILL } |
5244 | 14 | }, |
5245 | 14 | { &hf_lldp_tlv_enable_system_cap_station_only, |
5246 | 14 | { "Station only", "lldp.tlv.enable_system_cap.station_only", FT_BOOLEAN, 16, |
5247 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_STATION, NULL, HFILL } |
5248 | 14 | }, |
5249 | 14 | { &hf_lldp_tlv_enable_system_cap_cvlan_component, |
5250 | 14 | { "C-VLAN component", "lldp.tlv.enable_system_cap.cvlan", FT_BOOLEAN, 16, |
5251 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_CVLAN, NULL, HFILL } |
5252 | 14 | }, |
5253 | 14 | { &hf_lldp_tlv_enable_system_cap_svlan_component, |
5254 | 14 | { "S-VLAN component", "lldp.tlv.enable_system_cap.svlan", FT_BOOLEAN, 16, |
5255 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_SVLAN, NULL, HFILL } |
5256 | 14 | }, |
5257 | 14 | { &hf_lldp_tlv_enable_system_cap_tpmr_component, |
5258 | 14 | { "TPMR component", "lldp.tlv.enable_system_cap.tpmr", FT_BOOLEAN, 16, |
5259 | 14 | TFS(&tfs_capable_not_capable), SYSTEM_CAPABILITY_TPMR, NULL, HFILL } |
5260 | 14 | }, |
5261 | 14 | { &hf_chassis_id_subtype, |
5262 | 14 | { "Chassis Id Subtype", "lldp.chassis.subtype", FT_UINT8, BASE_DEC, |
5263 | 14 | VALS(chassis_id_subtypes), 0, NULL, HFILL } |
5264 | 14 | }, |
5265 | 14 | { &hf_chassis_id, |
5266 | 14 | { "Chassis Id", "lldp.chassis.id", FT_BYTES, BASE_NONE, |
5267 | 14 | NULL, 0, NULL, HFILL } |
5268 | 14 | }, |
5269 | 14 | { &hf_chassis_id_mac, |
5270 | 14 | { "Chassis Id", "lldp.chassis.id.mac", FT_ETHER, BASE_NONE, |
5271 | 14 | NULL, 0, NULL, HFILL } |
5272 | 14 | }, |
5273 | 14 | { &hf_chassis_id_ip4, |
5274 | 14 | { "Chassis Id", "lldp.chassis.id.ip4", FT_IPv4, BASE_NONE, |
5275 | 14 | NULL, 0, NULL, HFILL } |
5276 | 14 | }, |
5277 | 14 | { &hf_chassis_id_ip6, |
5278 | 14 | { "Chassis Id", "lldp.chassis.id.ip6", FT_IPv6, BASE_NONE, |
5279 | 14 | NULL, 0, NULL, HFILL } |
5280 | 14 | }, |
5281 | 14 | { &hf_port_id_subtype, |
5282 | 14 | { "Port Id Subtype", "lldp.port.subtype", FT_UINT8, BASE_DEC, |
5283 | 14 | VALS(port_id_subtypes), 0, NULL, HFILL } |
5284 | 14 | }, |
5285 | 14 | { &hf_port_id, |
5286 | 14 | { "Port Id", "lldp.port.id", FT_STRING, BASE_NONE, |
5287 | 14 | NULL, 0, NULL, HFILL } |
5288 | 14 | }, |
5289 | 14 | { &hf_port_desc, |
5290 | 14 | { "Port Description", "lldp.port.desc", FT_STRING, BASE_NONE, |
5291 | 14 | NULL, 0, NULL, HFILL } |
5292 | 14 | }, |
5293 | 14 | { &hf_port_id_mac, |
5294 | 14 | { "Port Id", "lldp.port.id.mac", FT_ETHER, BASE_NONE, |
5295 | 14 | NULL, 0, NULL, HFILL } |
5296 | 14 | }, |
5297 | 14 | { &hf_lldp_network_address_family, |
5298 | 14 | { "Network Address family", "lldp.network_address.subtype", FT_UINT8, BASE_DEC, |
5299 | 14 | VALS(afn_vals), 0, NULL, HFILL } |
5300 | 14 | }, |
5301 | 14 | { &hf_port_id_ip4, |
5302 | 14 | { "Port Id", "lldp.port.id.ip4", FT_IPv4, BASE_NONE, |
5303 | 14 | NULL, 0, NULL, HFILL } |
5304 | 14 | }, |
5305 | 14 | { &hf_port_id_ip6, |
5306 | 14 | { "Port Id", "lldp.port.id.ip6", FT_IPv6, BASE_NONE, |
5307 | 14 | NULL, 0, NULL, HFILL } |
5308 | 14 | }, |
5309 | 14 | { &hf_time_to_live, |
5310 | 14 | { "Seconds", "lldp.time_to_live", FT_UINT16, BASE_DEC, |
5311 | 14 | NULL, 0, NULL, HFILL } |
5312 | 14 | }, |
5313 | 14 | { &hf_pdu_type, |
5314 | 14 | { "PDU Type", "lldp.pdu_type", FT_NONE, BASE_NONE, |
5315 | 14 | NULL, 0, NULL, HFILL } |
5316 | 14 | }, |
5317 | | |
5318 | 14 | { &hf_mgn_address_len, |
5319 | 14 | { "Address String Length", "lldp.mgn.address.len", FT_UINT8, BASE_DEC, |
5320 | 14 | NULL, 0, NULL, HFILL } |
5321 | 14 | }, |
5322 | 14 | { &hf_mgn_address_subtype, |
5323 | 14 | { "Address Subtype", "lldp.mgn.address.subtype", FT_UINT8, BASE_DEC, |
5324 | 14 | VALS(afn_vals), 0, "Undefined", HFILL } |
5325 | 14 | }, |
5326 | 14 | { &hf_mgn_addr_ipv4, |
5327 | 14 | { "Management Address", "lldp.mgn.addr.ip4", FT_IPv4, BASE_NONE, |
5328 | 14 | NULL, 0, NULL, HFILL } |
5329 | 14 | }, |
5330 | 14 | { &hf_mgn_addr_ipv6, |
5331 | 14 | { "Management Address", "lldp.mgn.addr.ip6", FT_IPv6, BASE_NONE, |
5332 | 14 | NULL, 0, NULL, HFILL } |
5333 | 14 | }, |
5334 | 14 | { &hf_mgn_addr_hex, |
5335 | 14 | { "Management Address", "lldp.mgn.addr.hex", FT_BYTES, BASE_NONE, |
5336 | 14 | NULL, 0, NULL, HFILL } |
5337 | 14 | }, |
5338 | 14 | { &hf_mgn_interface_subtype, |
5339 | 14 | { "Interface Subtype", "lldp.mgn.interface.subtype", FT_UINT8, BASE_DEC, |
5340 | 14 | VALS(interface_subtype_values), 0, "Undefined", HFILL } |
5341 | 14 | }, |
5342 | 14 | { &hf_mgn_interface_number, |
5343 | 14 | { "Interface Number", "lldp.mgn.interface.number", FT_UINT32, BASE_DEC, |
5344 | 14 | NULL, 0, NULL, HFILL } |
5345 | 14 | }, |
5346 | 14 | { &hf_mgn_oid_len, |
5347 | 14 | { "OID String Length", "lldp.mgn.obj.len", FT_UINT8, BASE_DEC, |
5348 | 14 | NULL, 0, NULL, HFILL } |
5349 | 14 | }, |
5350 | 14 | { &hf_mgn_obj_id, |
5351 | 14 | { "Object Identifier", "lldp.mgn.obj.id", FT_OID, BASE_NONE, |
5352 | 14 | NULL, 0, NULL, HFILL } |
5353 | 14 | }, |
5354 | 14 | { &hf_org_spc_oui, |
5355 | 14 | { "Organization Unique Code", "lldp.orgtlv.oui", FT_UINT24, BASE_OUI, |
5356 | 14 | NULL, 0x0, NULL, HFILL } |
5357 | 14 | }, |
5358 | 14 | { &hf_dcbx_type, |
5359 | 14 | { "DCBx Protocol", "lldp.dcbx.proto", FT_UINT8, BASE_HEX, |
5360 | 14 | VALS(dcbx_protocol_types), 0x0, NULL, HFILL } |
5361 | 14 | }, |
5362 | 14 | { &hf_dcbx_tlv_type, |
5363 | 14 | { "DCBx TLV Type", "lldp.dcbx.type", FT_UINT16, BASE_DEC, |
5364 | 14 | VALS(dcbx_subtypes), TLV_TYPE_MASK, NULL, HFILL } |
5365 | 14 | }, |
5366 | 14 | { &hf_dcbx_tlv_len, |
5367 | 14 | { "DCBx TLV Length", "lldp.dcbx.len", FT_UINT16, BASE_DEC, |
5368 | 14 | NULL, TLV_INFO_LEN_MASK, NULL, HFILL } |
5369 | 14 | }, |
5370 | 14 | { &hf_dcbx_tlv_oper_version, |
5371 | 14 | { "Operating Version", "lldp.dcbx.version", FT_UINT8, BASE_HEX, |
5372 | 14 | VALS(dcbx_protocol_types), 0x0, "Unknown", HFILL } |
5373 | 14 | }, |
5374 | 14 | { &hf_dcbx_tlv_max_version, |
5375 | 14 | { "Max Version", "lldp.dcbx.max_version", FT_UINT8, BASE_HEX, |
5376 | 14 | VALS(dcbx_protocol_types), 0x0, "Unknown", HFILL } |
5377 | 14 | }, |
5378 | 14 | { &hf_dcbx_control_sequence, |
5379 | 14 | { "Sequence No", "lldp.dcbx.control.seq", FT_UINT32, BASE_DEC, |
5380 | 14 | NULL, 0, NULL, HFILL } |
5381 | 14 | }, |
5382 | 14 | { &hf_dcbx_control_ack, |
5383 | 14 | { "Ack No", "lldp.dcbx.control.ack", FT_UINT32, BASE_DEC, |
5384 | 14 | NULL, 0, NULL, HFILL } |
5385 | 14 | }, |
5386 | 14 | { &hf_dcbx_feature_flag_enabled, |
5387 | 14 | { "Feature", "lldp.dcbx.feature.enabled", FT_BOOLEAN , 8, |
5388 | 14 | TFS(&tfs_enabled_disabled), 0x80, NULL, HFILL } |
5389 | 14 | }, |
5390 | 14 | { &hf_dcbx_feature_flag_willing, |
5391 | 14 | { "Willing", "lldp.dcbx.feature.willing", FT_BOOLEAN , 8, |
5392 | 14 | TFS(&tfs_yes_no), 0x40, NULL, HFILL } |
5393 | 14 | }, |
5394 | 14 | { &hf_dcbx_feature_flag_error, |
5395 | 14 | { "Error", "lldp.dcbx.feature.error", FT_BOOLEAN , 8, |
5396 | 14 | TFS(&tfs_set_notset), 0x20, NULL, HFILL } |
5397 | 14 | }, |
5398 | 14 | { &hf_dcbx_feature_subtype, |
5399 | 14 | { "Subtype", "lldp.dcbx.feature.subtype", FT_UINT8, BASE_HEX, |
5400 | 14 | NULL, 0, NULL, HFILL } |
5401 | 14 | }, |
5402 | 14 | { &hf_dcbx_feature_pgid_reserved, |
5403 | 14 | { "Reserved", "lldp.dcbx.feature.pg.reserved", FT_UINT8, BASE_HEX, |
5404 | 14 | NULL, 0xFE, NULL, HFILL } |
5405 | 14 | }, |
5406 | 14 | { &hf_dcbx_feature_pgid_prio_0, |
5407 | 14 | { "PGID for Prio 0", "lldp.dcbx.feature.pg.pgid_prio0", FT_UINT16, BASE_DEC, |
5408 | 14 | NULL, 0xF000, NULL, HFILL } |
5409 | 14 | }, |
5410 | 14 | { &hf_dcbx_feature_pgid_prio_1, |
5411 | 14 | { "PGID for Prio 1", "lldp.dcbx.feature.pg.pgid_prio1", FT_UINT16, BASE_DEC, |
5412 | 14 | NULL, 0x0F00, NULL, HFILL } |
5413 | 14 | }, |
5414 | 14 | { &hf_dcbx_feature_pgid_prio_2, |
5415 | 14 | { "PGID for Prio 2", "lldp.dcbx.feature.pg.pgid_prio2", FT_UINT16, BASE_DEC, |
5416 | 14 | NULL, 0x00F0, NULL, HFILL } |
5417 | 14 | }, |
5418 | 14 | { &hf_dcbx_feature_pgid_prio_3, |
5419 | 14 | { "PGID for Prio 3", "lldp.dcbx.feature.pg.pgid_prio3", FT_UINT16, BASE_DEC, |
5420 | 14 | NULL, 0x000F, NULL, HFILL } |
5421 | 14 | }, |
5422 | 14 | { &hf_dcbx_feature_pgid_prio_4, |
5423 | 14 | { "PGID for Prio 4", "lldp.dcbx.feature.pg.pgid_prio4", FT_UINT16, BASE_DEC, |
5424 | 14 | NULL, 0xF000, NULL, HFILL } |
5425 | 14 | }, |
5426 | 14 | { &hf_dcbx_feature_pgid_prio_5, |
5427 | 14 | { "PGID for Prio 5", "lldp.dcbx.feature.pg.pgid_prio5", FT_UINT16, BASE_DEC, |
5428 | 14 | NULL, 0x0F00, NULL, HFILL } |
5429 | 14 | }, |
5430 | 14 | { &hf_dcbx_feature_pgid_prio_6, |
5431 | 14 | { "PGID for Prio 6", "lldp.dcbx.feature.pg.pgid_prio6", FT_UINT16, BASE_DEC, |
5432 | 14 | NULL, 0x00F0, NULL, HFILL } |
5433 | 14 | }, |
5434 | 14 | { &hf_dcbx_feature_pgid_prio_7, |
5435 | 14 | { "PGID for Prio 7", "lldp.dcbx.feature.pg.pgid_prio7", FT_UINT16, BASE_DEC, |
5436 | 14 | NULL, 0x000F, NULL, HFILL } |
5437 | 14 | }, |
5438 | 14 | { &hf_dcbx_feature_pg_per_0, |
5439 | 14 | { "Bandwidth for PGID 0", "lldp.dcbx.feature.pg.per0", FT_UINT8, BASE_DEC, |
5440 | 14 | NULL, 0, NULL, HFILL } |
5441 | 14 | }, |
5442 | 14 | { &hf_dcbx_feature_pg_per_1, |
5443 | 14 | { "Bandwidth for PGID 1", "lldp.dcbx.feature.pg.per1", FT_UINT8, BASE_DEC, |
5444 | 14 | NULL, 0, NULL, HFILL } |
5445 | 14 | }, |
5446 | 14 | { &hf_dcbx_feature_pg_per_2, |
5447 | 14 | { "Bandwidth for PGID 2", "lldp.dcbx.feature.pg.per2", FT_UINT8, BASE_DEC, |
5448 | 14 | NULL, 0, NULL, HFILL } |
5449 | 14 | }, |
5450 | 14 | { &hf_dcbx_feature_pg_per_3, |
5451 | 14 | { "Bandwidth for PGID 3", "lldp.dcbx.feature.pg.per3", FT_UINT8, BASE_DEC, |
5452 | 14 | NULL, 0, NULL, HFILL } |
5453 | 14 | }, |
5454 | 14 | { &hf_dcbx_feature_pg_per_4, |
5455 | 14 | { "Bandwidth for PGID 4", "lldp.dcbx.feature.pg.per4", FT_UINT8, BASE_DEC, |
5456 | 14 | NULL, 0, NULL, HFILL } |
5457 | 14 | }, |
5458 | 14 | { &hf_dcbx_feature_pg_per_5, |
5459 | 14 | { "Bandwidth for PGID 5", "lldp.dcbx.feature.pg.per5", FT_UINT8, BASE_DEC, |
5460 | 14 | NULL, 0, NULL, HFILL } |
5461 | 14 | }, |
5462 | 14 | { &hf_dcbx_feature_pg_per_6, |
5463 | 14 | { "Bandwidth for PGID 6", "lldp.dcbx.feature.pg.per6", FT_UINT8, BASE_DEC, |
5464 | 14 | NULL, 0, NULL, HFILL } |
5465 | 14 | }, |
5466 | 14 | { &hf_dcbx_feature_pg_per_7, |
5467 | 14 | { "Bandwidth for PGID 7", "lldp.dcbx.feature.pg.per7", FT_UINT8, BASE_DEC, |
5468 | 14 | NULL, 0, NULL, HFILL } |
5469 | 14 | }, |
5470 | 14 | { &hf_dcbx_feature_pg_numtcs, |
5471 | 14 | { "Number of Traffic Classes Supported", "lldp.dcbx.feature.pg.numtcs", FT_UINT8, BASE_HEX, |
5472 | 14 | NULL, 0, NULL, HFILL } |
5473 | 14 | }, |
5474 | 14 | { &hf_dcbx_feature_pfc_prio0, |
5475 | 14 | { "PFC for Priority 0", "lldp.dcbx.feature.pfc.prio0", FT_BOOLEAN, 8, |
5476 | 14 | TFS(&tfs_enabled_disabled), 0x1, NULL, HFILL } |
5477 | 14 | }, |
5478 | 14 | { &hf_dcbx_feature_pfc_prio1, |
5479 | 14 | { "PFC for Priority 1", "lldp.dcbx.feature.pfc.prio1", FT_BOOLEAN, 8, |
5480 | 14 | TFS(&tfs_enabled_disabled), 0x2, NULL, HFILL } |
5481 | 14 | }, |
5482 | 14 | { &hf_dcbx_feature_pfc_prio2, |
5483 | 14 | { "PFC for Priority 2", "lldp.dcbx.feature.pfc.prio2", FT_BOOLEAN, 8, |
5484 | 14 | TFS(&tfs_enabled_disabled), 0x4, NULL, HFILL } |
5485 | 14 | }, |
5486 | 14 | { &hf_dcbx_feature_pfc_prio3, |
5487 | 14 | { "PFC for Priority 3", "lldp.dcbx.feature.pfc.prio3", FT_BOOLEAN, 8, |
5488 | 14 | TFS(&tfs_enabled_disabled), 0x8, NULL, HFILL } |
5489 | 14 | }, |
5490 | 14 | { &hf_dcbx_feature_pfc_prio4, |
5491 | 14 | { "PFC for Priority 4", "lldp.dcbx.feature.pfc.prio4", FT_BOOLEAN, 8, |
5492 | 14 | TFS(&tfs_enabled_disabled), 0x10, NULL, HFILL } |
5493 | 14 | }, |
5494 | 14 | { &hf_dcbx_feature_pfc_prio5, |
5495 | 14 | { "PFC for Priority 5", "lldp.dcbx.feature.pfc.prio5", FT_BOOLEAN, 8, |
5496 | 14 | TFS(&tfs_enabled_disabled), 0x20, NULL, HFILL } |
5497 | 14 | }, |
5498 | 14 | { &hf_dcbx_feature_pfc_prio6, |
5499 | 14 | { "PFC for Priority 6", "lldp.dcbx.feature.pfc.prio6", FT_BOOLEAN, 8, |
5500 | 14 | TFS(&tfs_enabled_disabled), 0x40, NULL, HFILL } |
5501 | 14 | }, |
5502 | 14 | { &hf_dcbx_feature_pfc_prio7, |
5503 | 14 | { "PFC for Priority 7", "lldp.dcbx.feature.pfc.prio7", FT_BOOLEAN, 8, |
5504 | 14 | TFS(&tfs_enabled_disabled), 0x80, NULL, HFILL } |
5505 | 14 | }, |
5506 | 14 | { &hf_dcbx_feature_pfc_numtcs, |
5507 | 14 | { "Number of Traffic Classes Supported", "lldp.dcbx.feature.pfc.numtcs", FT_UINT8, BASE_HEX, |
5508 | 14 | NULL, 0, NULL, HFILL } |
5509 | 14 | }, |
5510 | 14 | { &hf_dcbx_feature_app_proto, |
5511 | 14 | { "Application Protocol Id", "lldp.dcbx.feature.app.proto", FT_UINT16, BASE_HEX, |
5512 | 14 | NULL, 0, NULL, HFILL } |
5513 | 14 | }, |
5514 | 14 | { &hf_dcbx_feature_app_selector, |
5515 | 14 | { "Selector Field", "lldp.dcbx.feature.app.sf", FT_UINT24, BASE_DEC, |
5516 | 14 | VALS(dcbx_app_selector), 0x3 << 16, NULL, HFILL } |
5517 | 14 | }, |
5518 | 14 | { &hf_dcbx_feature_app_oui, |
5519 | 14 | { "Application OUI", "lldp.dcbx.feature.app.oui", FT_UINT24, BASE_HEX, |
5520 | 14 | NULL, ~(0x3 << 16), NULL, HFILL } |
5521 | 14 | }, |
5522 | 14 | { &hf_dcbx_feature_app_prio, |
5523 | 14 | { "Application Priority", "lldp.dcbx.feature.app.prio", FT_UINT8, BASE_DEC, |
5524 | 14 | NULL, 0x0, NULL, HFILL } |
5525 | 14 | }, |
5526 | 14 | { &hf_dcbx_feature_flag_llink_type, |
5527 | 14 | { "Logical Link Down Type", "lldp.dcbx.feature.llink.type", FT_UINT8, BASE_HEX, |
5528 | 14 | VALS(dcbx_llink_types), 0x80, NULL, HFILL } |
5529 | 14 | }, |
5530 | 14 | { &hf_ieee_802_1_subtype, |
5531 | 14 | { "IEEE 802.1 Subtype", "lldp.ieee.802_1.subtype", FT_UINT8, BASE_HEX, |
5532 | 14 | VALS(ieee_802_1_subtypes), 0x0, NULL, HFILL } |
5533 | 14 | }, |
5534 | 14 | { &hf_ieee_802_1_port_and_vlan_id_flag, |
5535 | 14 | { "Flags", "lldp.ieee.802_1.port_and_vlan_id_flag", FT_UINT8, BASE_HEX, |
5536 | 14 | NULL, 0x0, NULL, HFILL } |
5537 | 14 | }, |
5538 | 14 | { &hf_ieee_802_1_port_and_vlan_id_flag_supported, |
5539 | 14 | { "Port and Protocol VLAN", "lldp.ieee.802_1.port_and_vlan_id_flag.supported", FT_BOOLEAN, 8, |
5540 | 14 | TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL } |
5541 | 14 | }, |
5542 | 14 | { &hf_ieee_802_1_port_and_vlan_id_flag_enabled, |
5543 | 14 | { "Port and Protocol VLAN", "lldp.ieee.802_1.port_and_vlan_id_flag.enabled", FT_BOOLEAN, 8, |
5544 | 14 | TFS(&tfs_enabled_disabled), 0x04, NULL, HFILL } |
5545 | 14 | }, |
5546 | 14 | { &hf_ieee_802_1_port_vlan_id, |
5547 | 14 | { "Port VLAN Identifier", "lldp.ieee.802_1.port_vlan.id", FT_UINT16, BASE_DEC_HEX, |
5548 | 14 | NULL, 0x0, NULL, HFILL } |
5549 | 14 | }, |
5550 | 14 | { &hf_ieee_802_1_port_proto_vlan_id, |
5551 | 14 | { "Port and Protocol VLAN Identifier", "lldp.ieee.802_1.port_proto_vlan.id", FT_UINT16, BASE_DEC_HEX, |
5552 | 14 | NULL, 0x0, NULL, HFILL } |
5553 | 14 | }, |
5554 | 14 | { &hf_ieee_802_1_vlan_id, |
5555 | 14 | { "VLAN Identifier", "lldp.ieee.802_1.vlan.id", FT_UINT16, BASE_DEC_HEX, |
5556 | 14 | NULL, 0x0, NULL, HFILL } |
5557 | 14 | }, |
5558 | 14 | { &hf_ieee_802_1_vlan_name_length, |
5559 | 14 | { "VLAN Name Length", "lldp.ieee.802_1.vlan.name_len", FT_UINT8, BASE_DEC, |
5560 | 14 | NULL, 0x0, NULL, HFILL } |
5561 | 14 | }, |
5562 | 14 | { &hf_ieee_802_1_vlan_name, |
5563 | 14 | { "VLAN Name", "lldp.ieee.802_1.vlan.name", FT_STRINGZ, BASE_NONE, |
5564 | 14 | NULL, 0x0, NULL, HFILL } |
5565 | 14 | }, |
5566 | 14 | { &hf_ieee_802_1_proto_id_length, |
5567 | 14 | { "Protocol Identity Length", "lldp.ieee.802_1.proto.id_length", FT_UINT8, BASE_DEC, |
5568 | 14 | NULL, 0x0, NULL, HFILL } |
5569 | 14 | }, |
5570 | 14 | { &hf_ieee_802_1_proto_id, |
5571 | 14 | { "Protocol Identity", "lldp.ieee.802_1.proto.id", FT_BYTES, BASE_NONE, |
5572 | 14 | NULL, 0x0, NULL, HFILL } |
5573 | 14 | }, |
5574 | 14 | { &hf_ieee_802_1_aggregation_status, |
5575 | 14 | { "Aggregation Status", "lldp.ieee.802_1.aggregation_status", FT_UINT8, BASE_HEX, |
5576 | 14 | NULL, 0x0, NULL, HFILL } |
5577 | 14 | }, |
5578 | 14 | { &hf_ieee_802_1_aggregation_status_cap, |
5579 | 14 | { "Aggregation Capability", "lldp.ieee.802_1.aggregation_status.cap", FT_BOOLEAN, 8, |
5580 | 14 | TFS(&tfs_yes_no), 0x01, NULL, HFILL } |
5581 | 14 | }, |
5582 | 14 | { &hf_ieee_802_1_aggregation_status_enabled, |
5583 | 14 | { "Aggregation Status", "lldp.ieee.802_1.aggregation_status.enabled", FT_BOOLEAN, 8, |
5584 | 14 | TFS(&tfs_enabled_disabled), 0x02, NULL, HFILL } |
5585 | 14 | }, |
5586 | 14 | { &hf_ieee_802_1_aggregation_status_porttype, |
5587 | 14 | { "Aggregation Status", "lldp.ieee.802_1.aggregation_status.porttype", FT_UINT8, BASE_DEC, |
5588 | 14 | VALS(porttype_values), 0x0c, NULL, HFILL } |
5589 | 14 | }, |
5590 | 14 | { &hf_ieee_802_1_aggregated_port_id, |
5591 | 14 | { "Aggregated Port Id", "lldp.ieee.802_1.aggregated_port_id", FT_UINT32, BASE_DEC, |
5592 | 14 | NULL, 0, NULL, HFILL } |
5593 | 14 | }, |
5594 | 14 | { &hf_ieee_8021qau_cnpv_prio0, |
5595 | 14 | { "Priority 0 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio0", FT_BOOLEAN, 8, |
5596 | 14 | TFS(&tfs_enabled_disabled), 0x01, NULL, HFILL } |
5597 | 14 | }, |
5598 | 14 | { &hf_ieee_8021qau_cnpv_prio1, |
5599 | 14 | { "Priority 1 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio1", FT_BOOLEAN, 8, |
5600 | 14 | TFS(&tfs_enabled_disabled), 0x02, NULL, HFILL } |
5601 | 14 | }, |
5602 | 14 | { &hf_ieee_8021qau_cnpv_prio2, |
5603 | 14 | { "Priority 2 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio2", FT_BOOLEAN, 8, |
5604 | 14 | TFS(&tfs_enabled_disabled), 0x04, NULL, HFILL } |
5605 | 14 | }, |
5606 | 14 | { &hf_ieee_8021qau_cnpv_prio3, |
5607 | 14 | { "Priority 3 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio3", FT_BOOLEAN, 8, |
5608 | 14 | TFS(&tfs_enabled_disabled), 0x08, NULL, HFILL } |
5609 | 14 | }, |
5610 | 14 | { &hf_ieee_8021qau_cnpv_prio4, |
5611 | 14 | { "Priority 4 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio4", FT_BOOLEAN, 8, |
5612 | 14 | TFS(&tfs_enabled_disabled), 0x10, NULL, HFILL } |
5613 | 14 | }, |
5614 | 14 | { &hf_ieee_8021qau_cnpv_prio5, |
5615 | 14 | { "Priority 5 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio5", FT_BOOLEAN, 8, |
5616 | 14 | TFS(&tfs_enabled_disabled), 0x20, NULL, HFILL } |
5617 | 14 | }, |
5618 | 14 | { &hf_ieee_8021qau_cnpv_prio6, |
5619 | 14 | { "Priority 6 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio6", FT_BOOLEAN, 8, |
5620 | 14 | TFS(&tfs_enabled_disabled), 0x40, NULL, HFILL } |
5621 | 14 | }, |
5622 | 14 | { &hf_ieee_8021qau_cnpv_prio7, |
5623 | 14 | { "Priority 7 CNPV Capability", "lldp.ieee.802_1qau.cnpv.prio7", FT_BOOLEAN, 8, |
5624 | 14 | TFS(&tfs_enabled_disabled), 0x80, NULL, HFILL } |
5625 | 14 | }, |
5626 | 14 | { &hf_ieee_8021qau_ready_prio0, |
5627 | 14 | { "Priority 0 Ready Indicator", "lldp.ieee.802_1qau.ready.prio0", FT_BOOLEAN, 8, |
5628 | 14 | TFS(&tfs_set_notset), 0x01, NULL, HFILL } |
5629 | 14 | }, |
5630 | 14 | { &hf_ieee_8021qau_ready_prio1, |
5631 | 14 | { "Priority 1 Ready Indicator", "lldp.ieee.802_1qau.ready.prio1", FT_BOOLEAN, 8, |
5632 | 14 | TFS(&tfs_set_notset), 0x02, NULL, HFILL } |
5633 | 14 | }, |
5634 | 14 | { &hf_ieee_8021qau_ready_prio2, |
5635 | 14 | { "Priority 2 Ready Indicator", "lldp.ieee.802_1qau.ready.prio2", FT_BOOLEAN, 8, |
5636 | 14 | TFS(&tfs_set_notset), 0x04, NULL, HFILL } |
5637 | 14 | }, |
5638 | 14 | { &hf_ieee_8021qau_ready_prio3, |
5639 | 14 | { "Priority 3 Ready Indicator", "lldp.ieee.802_1qau.ready.prio3", FT_BOOLEAN, 8, |
5640 | 14 | TFS(&tfs_set_notset), 0x08, NULL, HFILL } |
5641 | 14 | }, |
5642 | 14 | { &hf_ieee_8021qau_ready_prio4, |
5643 | 14 | { "Priority 4 Ready Indicator", "lldp.ieee.802_1qau.ready.prio4", FT_BOOLEAN, 8, |
5644 | 14 | TFS(&tfs_set_notset), 0x10, NULL, HFILL } |
5645 | 14 | }, |
5646 | 14 | { &hf_ieee_8021qau_ready_prio5, |
5647 | 14 | { "Priority 5 Ready Indicator", "lldp.ieee.802_1qau.ready.prio5", FT_BOOLEAN, 8, |
5648 | 14 | TFS(&tfs_set_notset), 0x20, NULL, HFILL } |
5649 | 14 | }, |
5650 | 14 | { &hf_ieee_8021qau_ready_prio6, |
5651 | 14 | { "Priority 6 Ready Indicator", "lldp.ieee.802_1qau.ready.prio6", FT_BOOLEAN, 8, |
5652 | 14 | TFS(&tfs_set_notset), 0x40, NULL, HFILL } |
5653 | 14 | }, |
5654 | 14 | { &hf_ieee_8021qau_ready_prio7, |
5655 | 14 | { "Priority 7 Ready Indicator", "lldp.ieee.802_1qau.ready.prio7", FT_BOOLEAN, 8, |
5656 | 14 | TFS(&tfs_set_notset), 0x80, NULL, HFILL } |
5657 | 14 | }, |
5658 | 14 | { &hf_ieee_8021az_feature_flag_willing, |
5659 | 14 | { "Willing", "lldp.dcbx.ieee.willing", FT_BOOLEAN , 8, |
5660 | 14 | TFS(&tfs_yes_no), 0x80, NULL, HFILL } |
5661 | 14 | }, |
5662 | 14 | { &hf_ieee_8021az_feature_flag_cbs, |
5663 | 14 | { "Credit-Based Shaper", "lldp.dcbx.ieee.ets.cbs", FT_BOOLEAN, 8, |
5664 | 14 | TFS(&tfs_supported_not_supported), 0x40, NULL, HFILL } |
5665 | 14 | }, |
5666 | 14 | { &hf_ieee_8021az_maxtcs, |
5667 | 14 | { "Maximum Number of Traffic Classes", "lldp.dcbx.ieee.ets.maxtcs", FT_UINT8, BASE_DEC, |
5668 | 14 | NULL, 0x7, NULL, HFILL } |
5669 | 14 | }, |
5670 | 14 | { &hf_ieee_8021az_tsa_class0, |
5671 | 14 | { "TSA for Traffic Class 0", "lldp.dcbx.ieee.ets.tsa0", FT_UINT8, BASE_DEC, |
5672 | 14 | VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL } |
5673 | 14 | }, |
5674 | 14 | { &hf_ieee_8021az_tsa_class1, |
5675 | 14 | { "TSA for Traffic Class 1", "lldp.dcbx.ieee.ets.tsa1", FT_UINT8, BASE_DEC, |
5676 | 14 | VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL } |
5677 | 14 | }, |
5678 | 14 | { &hf_ieee_8021az_tsa_class2, |
5679 | 14 | { "TSA for Traffic Class 2", "lldp.dcbx.ieee.ets.tsa2", FT_UINT8, BASE_DEC, |
5680 | 14 | VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL } |
5681 | 14 | }, |
5682 | 14 | { &hf_ieee_8021az_tsa_class3, |
5683 | 14 | { "TSA for Traffic Class 3", "lldp.dcbx.ieee.ets.tsa3", FT_UINT8, BASE_DEC, |
5684 | 14 | VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL } |
5685 | 14 | }, |
5686 | 14 | { &hf_ieee_8021az_tsa_class4, |
5687 | 14 | { "TSA for Traffic Class 4", "lldp.dcbx.ieee.ets.tsa4", FT_UINT8, BASE_DEC, |
5688 | 14 | VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL } |
5689 | 14 | }, |
5690 | 14 | { &hf_ieee_8021az_tsa_class5, |
5691 | 14 | { "TSA for Traffic Class 5", "lldp.dcbx.ieee.ets.tsa5", FT_UINT8, BASE_DEC, |
5692 | 14 | VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL } |
5693 | 14 | }, |
5694 | 14 | { &hf_ieee_8021az_tsa_class6, |
5695 | 14 | { "TSA for Traffic Class 6", "lldp.dcbx.ieee.ets.tsa6", FT_UINT8, BASE_DEC, |
5696 | 14 | VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL } |
5697 | 14 | }, |
5698 | 14 | { &hf_ieee_8021az_tsa_class7, |
5699 | 14 | { "TSA for Traffic Class 7", "lldp.dcbx.ieee.ets.tsa7", FT_UINT8, BASE_DEC, |
5700 | 14 | VALS(dcbx_ieee_8021az_tsa), 0, "Reserved", HFILL } |
5701 | 14 | }, |
5702 | 14 | { &hf_ieee_8021az_feature_flag_mbc, |
5703 | 14 | { "MACsec Bypass Capability", "lldp.dcbx.ieee.pfc.mbc", FT_BOOLEAN, 8, |
5704 | 14 | TFS(&tfs_capable_not_capable), 0x40, NULL, HFILL } |
5705 | 14 | }, |
5706 | 14 | { &hf_ieee_8021az_pfc_numtcs, |
5707 | 14 | { "Max PFC Enabled Traffic Classes", "lldp.dcbx.ieee.pfc.numtcs", FT_UINT8, BASE_DEC, |
5708 | 14 | NULL, 0xF, NULL, HFILL } |
5709 | 14 | }, |
5710 | 14 | { &hf_ieee_8021az_app_reserved, |
5711 | 14 | { "Reserved", "lldp.dcbx.ieee.app.reserved", FT_UINT8, BASE_HEX, |
5712 | 14 | NULL, 0x0, NULL, HFILL } |
5713 | 14 | }, |
5714 | 14 | { &hf_ieee_8021az_app_prio, |
5715 | 14 | { "Application Priority", "lldp.dcbx.ieee.app.prio", FT_UINT8, BASE_DEC, |
5716 | 14 | NULL, 0xE0, NULL, HFILL } |
5717 | 14 | }, |
5718 | 14 | { &hf_ieee_8021az_app_selector, |
5719 | 14 | { "Application Selector", "lldp.dcbx.iee.app.sf", FT_UINT8, BASE_DEC, |
5720 | 14 | VALS(dcbx_ieee_8021az_sf), 0x7, NULL, HFILL } |
5721 | 14 | }, |
5722 | 14 | { &hf_ieee_802_3_subtype, |
5723 | 14 | { "IEEE 802.3 Subtype", "lldp.ieee.802_3.subtype", FT_UINT8, BASE_HEX, |
5724 | 14 | VALS(ieee_802_3_subtypes), 0x0, NULL, HFILL } |
5725 | 14 | }, |
5726 | 14 | { &hf_ieee_802_3_mac_phy_auto_neg_status, |
5727 | 14 | { "Auto-Negotiation Support/Status", "lldp.ieee.802_3.mac_phy_auto_neg_status", FT_UINT8, BASE_HEX, |
5728 | 14 | NULL, 0x0, NULL, HFILL } |
5729 | 14 | }, |
5730 | 14 | { &hf_ieee_802_3_mac_phy_auto_neg_status_supported, |
5731 | 14 | { "Auto-Negotiation", "lldp.ieee.802_3.mac_phy_auto_neg_status.supported", FT_BOOLEAN, 8, |
5732 | 14 | TFS(&tfs_supported_not_supported), 0x01, NULL, HFILL } |
5733 | 14 | }, |
5734 | 14 | { &hf_ieee_802_3_mac_phy_auto_neg_status_enabled, |
5735 | 14 | { "Auto-Negotiation", "lldp.ieee.802_3.mac_phy_auto_neg_status.enabled", FT_BOOLEAN, 8, |
5736 | 14 | TFS(&tfs_enabled_disabled), 0x02, NULL, HFILL } |
5737 | 14 | }, |
5738 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps, |
5739 | 14 | { "PMD Auto-Negotiation Advertised Capability", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps", FT_UINT16, BASE_HEX, |
5740 | 14 | NULL, 0x0, NULL, HFILL } |
5741 | 14 | }, |
5742 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_tfd, |
5743 | 14 | { "1000BASE-T (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.1000base_tfd", FT_BOOLEAN, 16, |
5744 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_1000BASE_TFD, NULL, HFILL } |
5745 | 14 | }, |
5746 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_t, |
5747 | 14 | { "1000BASE-T (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.1000base_t", FT_BOOLEAN, 16, |
5748 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_1000BASE_T, NULL, HFILL } |
5749 | 14 | }, |
5750 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_xfd, |
5751 | 14 | { "1000BASE-X (-LX, -SX, -CX full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.1000base_xfd", FT_BOOLEAN, 16, |
5752 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_1000BASE_XFD, NULL, HFILL } |
5753 | 14 | }, |
5754 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_1000base_x, |
5755 | 14 | { "1000BASE-X (-LX, -SX, -CX half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.1000base_x", FT_BOOLEAN, 16, |
5756 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_1000BASE_X, NULL, HFILL } |
5757 | 14 | }, |
5758 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_bpause, |
5759 | 14 | { "Asymmetric and Symmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.fdx_bpause", FT_BOOLEAN, 16, |
5760 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_FDX_BPAUSE, NULL, HFILL } |
5761 | 14 | }, |
5762 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_spause, |
5763 | 14 | { "Symmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.fdx_spause", FT_BOOLEAN, 16, |
5764 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_FDX_SPAUSE, NULL, HFILL } |
5765 | 14 | }, |
5766 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_apause, |
5767 | 14 | { "Asymmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.fdx_apause", FT_BOOLEAN, 16, |
5768 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_FDX_APAUSE, NULL, HFILL } |
5769 | 14 | }, |
5770 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_fdx_pause, |
5771 | 14 | { "PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.fdx_pause", FT_BOOLEAN, 16, |
5772 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_FDX_PAUSE, NULL, HFILL } |
5773 | 14 | }, |
5774 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t2fd, |
5775 | 14 | { "100BASE-T2 (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.100base_t2fd", FT_BOOLEAN, 16, |
5776 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_100BASE_T2FD, NULL, HFILL } |
5777 | 14 | }, |
5778 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t2, |
5779 | 14 | { "100BASE-T2 (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.100base_t2", FT_BOOLEAN, 16, |
5780 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_100BASE_T2, NULL, HFILL } |
5781 | 14 | }, |
5782 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_txfd, |
5783 | 14 | { "100BASE-TX (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.100base_txfd", FT_BOOLEAN, 16, |
5784 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_100BASE_TXFD, NULL, HFILL } |
5785 | 14 | }, |
5786 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_tx, |
5787 | 14 | { "100BASE-TX (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.100base_tx", FT_BOOLEAN, 16, |
5788 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_100BASE_TX, NULL, HFILL } |
5789 | 14 | }, |
5790 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_100base_t4, |
5791 | 14 | { "100BASE-T4", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.100base_t4", FT_BOOLEAN, 16, |
5792 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_100BASE_T4, NULL, HFILL } |
5793 | 14 | }, |
5794 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_10base_tfd, |
5795 | 14 | { "10BASE-T (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.10base_tfd", FT_BOOLEAN, 16, |
5796 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_10BASET_FD, NULL, HFILL } |
5797 | 14 | }, |
5798 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_10base_t, |
5799 | 14 | { "10BASE-T (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.10base_t", FT_BOOLEAN, 16, |
5800 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_10BASE_T, NULL, HFILL } |
5801 | 14 | }, |
5802 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_other, |
5803 | 14 | { "Other or unknown", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps.other", FT_BOOLEAN, 16, |
5804 | 14 | TFS(&tfs_capable_not_capable), AUTONEG_OTHER, NULL, HFILL } |
5805 | 14 | }, |
5806 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_tfd, |
5807 | 14 | { "1000BASE-T (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.1000base_tfd", FT_BOOLEAN, 16, |
5808 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_1000BASE_TFD, NULL, HFILL } |
5809 | 14 | }, |
5810 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_t, |
5811 | 14 | { "1000BASE-T (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.1000base_t", FT_BOOLEAN, 16, |
5812 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_1000BASE_T, NULL, HFILL } |
5813 | 14 | }, |
5814 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_xfd, |
5815 | 14 | { "1000BASE-X (-LX, -SX, -CX full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.1000base_xfd", FT_BOOLEAN, 16, |
5816 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_1000BASE_XFD, NULL, HFILL } |
5817 | 14 | }, |
5818 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_1000base_x, |
5819 | 14 | { "1000BASE-X (-LX, -SX, -CX half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.1000base_x", FT_BOOLEAN, 16, |
5820 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_1000BASE_X, NULL, HFILL } |
5821 | 14 | }, |
5822 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_bpause, |
5823 | 14 | { "Asymmetric and Symmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.fdx_bpause", FT_BOOLEAN, 16, |
5824 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_FDX_BPAUSE, NULL, HFILL } |
5825 | 14 | }, |
5826 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_spause, |
5827 | 14 | { "Symmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.fdx_spause", FT_BOOLEAN, 16, |
5828 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_FDX_SPAUSE, NULL, HFILL } |
5829 | 14 | }, |
5830 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_apause, |
5831 | 14 | { "Asymmetric PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.fdx_apause", FT_BOOLEAN, 16, |
5832 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_FDX_APAUSE, NULL, HFILL } |
5833 | 14 | }, |
5834 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_fdx_pause, |
5835 | 14 | { "PAUSE (for full-duplex links)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.fdx_pause", FT_BOOLEAN, 16, |
5836 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_FDX_PAUSE, NULL, HFILL } |
5837 | 14 | }, |
5838 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t2fd, |
5839 | 14 | { "100BASE-T2 (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.100base_t2fd", FT_BOOLEAN, 16, |
5840 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_100BASE_T2FD, NULL, HFILL } |
5841 | 14 | }, |
5842 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t2, |
5843 | 14 | { "100BASE-T2 (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.100base_t2", FT_BOOLEAN, 16, |
5844 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_100BASE_T2, NULL, HFILL } |
5845 | 14 | }, |
5846 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_txfd, |
5847 | 14 | { "100BASE-TX (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.100base_txfd", FT_BOOLEAN, 16, |
5848 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_100BASE_TXFD, NULL, HFILL } |
5849 | 14 | }, |
5850 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_tx, |
5851 | 14 | { "100BASE-TX (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.100base_tx", FT_BOOLEAN, 16, |
5852 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_100BASE_TX, NULL, HFILL } |
5853 | 14 | }, |
5854 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_100base_t4, |
5855 | 14 | { "100BASE-T4", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.100base_t4", FT_BOOLEAN, 16, |
5856 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_100BASE_T4, NULL, HFILL } |
5857 | 14 | }, |
5858 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_10base_tfd, |
5859 | 14 | { "10BASE-T (full duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.10base_tfd", FT_BOOLEAN, 16, |
5860 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_10BASET_FD, NULL, HFILL } |
5861 | 14 | }, |
5862 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_10base_t, |
5863 | 14 | { "10BASE-T (half duplex mode)", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.10base_t", FT_BOOLEAN, 16, |
5864 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_10BASE_T, NULL, HFILL } |
5865 | 14 | }, |
5866 | 14 | { &hf_ieee_802_3_pmd_auto_neg_advertised_caps_inv_other, |
5867 | 14 | { "Other or unknown", "lldp.ieee.802_3.pmd_auto_neg_advertised_caps_inv.other", FT_BOOLEAN, 16, |
5868 | 14 | TFS(&tfs_capable_not_capable), INV_AUTONEG_OTHER, NULL, HFILL } |
5869 | 14 | }, |
5870 | 14 | { &hf_ieee_802_3_pmd_mau_type, |
5871 | 14 | { "Operational MAU Type", "lldp.ieee.802_3.pmd_mau_type", FT_UINT16, BASE_HEX, |
5872 | 14 | VALS(operational_mau_type_values), 0x0, "Unknown", HFILL } |
5873 | 14 | }, |
5874 | 14 | { &hf_ieee_802_3_mdi_power_support, |
5875 | 14 | { "MDI Power Support", "lldp.ieee.802_3.mdi_power_support", FT_UINT8, BASE_HEX, |
5876 | 14 | NULL, 0x0, NULL, HFILL } |
5877 | 14 | }, |
5878 | 14 | { &hf_ieee_802_3_mdi_power_support_port_class, |
5879 | 14 | { "Port Class", "lldp.ieee.802_3.mdi_power_support.port_class", FT_BOOLEAN, 8, |
5880 | 14 | TFS(&tfs_ieee_802_3_pse_pd), 0x01, NULL, HFILL } |
5881 | 14 | }, |
5882 | 14 | { &hf_ieee_802_3_mdi_power_support_pse_power_support, |
5883 | 14 | { "PSE MDI Power", "lldp.ieee.802_3.mdi_power_support.supported", FT_BOOLEAN, 8, |
5884 | 14 | TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL } |
5885 | 14 | }, |
5886 | 14 | { &hf_ieee_802_3_mdi_power_support_pse_power_enabled, |
5887 | 14 | { "PSE MDI Power", "lldp.ieee.802_3.mdi_power_support.enabled", FT_BOOLEAN, 8, |
5888 | 14 | TFS(&tfs_enabled_disabled), 0x04, NULL, HFILL } |
5889 | 14 | }, |
5890 | 14 | { &hf_ieee_802_3_mdi_power_support_pse_pairs, |
5891 | 14 | { "PSE Pairs Control Ability", "lldp.ieee.802_3.mdi_power_support.pse_pairs", FT_BOOLEAN, 8, |
5892 | 14 | TFS(&tfs_yes_no), 0x08, NULL, HFILL } |
5893 | 14 | }, |
5894 | 14 | { &hf_ieee_802_3_mdi_power_pse_pair, |
5895 | 14 | { "PSE Power Pair", "lldp.ieee.802_3.mdi_pse_pair", FT_UINT8, BASE_DEC, |
5896 | 14 | VALS(power_pair_802_3), 0x0, NULL, HFILL } |
5897 | 14 | }, |
5898 | 14 | { &hf_ieee_802_3_mdi_power_class, |
5899 | 14 | { "Power Class", "lldp.ieee.802_3.mdi_power_class", FT_UINT8, BASE_DEC, |
5900 | 14 | VALS(power_class_802_3), 0x0, NULL, HFILL } |
5901 | 14 | }, |
5902 | 14 | { &hf_ieee_802_3_mdi_power_type, |
5903 | 14 | { "Power Type", "lldp.ieee.802_3.mdi_power_type", FT_UINT8, BASE_DEC, |
5904 | 14 | VALS(power_type_802_3), 0xC0, "Unknown", HFILL } |
5905 | 14 | }, |
5906 | 14 | { &hf_ieee_802_3_mdi_power_source, |
5907 | 14 | { "Power Source", "lldp.ieee.802_3.mdi_power_source", FT_UINT8, BASE_DEC, |
5908 | 14 | NULL, 0x30, NULL, HFILL } |
5909 | 14 | }, |
5910 | 14 | { &hf_ieee_802_3_mdi_power_priority, |
5911 | 14 | { "Power Priority", "lldp.ieee.802_3.mdi_power_priority", FT_UINT8, BASE_DEC, |
5912 | 14 | VALS(media_power_priority), 0x03, NULL, HFILL } |
5913 | 14 | }, |
5914 | 14 | { &hf_ieee_802_3_mdi_power_pd4pid, |
5915 | 14 | { "PD 4PID", "lldp.ieee.802_3.mdi_power_pd4pid", FT_BOOLEAN, 8, |
5916 | 14 | TFS(&tfs_supported_not_supported), 0x4, NULL, HFILL } |
5917 | 14 | }, |
5918 | 14 | { &hf_ieee_802_3_mdi_requested_power, |
5919 | 14 | { "PD Requested Power Value", "lldp.ieee.802_3.mdi_pde_requested", FT_UINT16, BASE_CUSTOM, |
5920 | 14 | CF_FUNC(mdi_power_base), 0, NULL, HFILL } |
5921 | 14 | }, |
5922 | 14 | { &hf_ieee_802_3_mdi_allocated_power, |
5923 | 14 | { "PSE Allocated Power Value", "lldp.ieee.802_3.mdi_pse_allocated", FT_UINT16, BASE_CUSTOM, |
5924 | 14 | CF_FUNC(mdi_power_base), 0, NULL, HFILL } |
5925 | 14 | }, |
5926 | 14 | { &hf_ieee_802_3_bt_ds_pd_requested_power_value_mode_a, |
5927 | 14 | { "DS PD Requested Power Value Mode A", "lldp.ieee.802_3.bt_ds_pd_requested_power_value_mode_a", FT_UINT16, BASE_CUSTOM, |
5928 | 14 | CF_FUNC(mdi_power_base), 0, NULL, HFILL } |
5929 | 14 | }, |
5930 | 14 | { &hf_ieee_802_3_bt_ds_pd_requested_power_value_mode_b, |
5931 | 14 | { "DS PD Requested Power Value Mode B", "lldp.ieee.802_3.bt_ds_pd_requested_power_value_mode_b", FT_UINT16, BASE_CUSTOM, |
5932 | 14 | CF_FUNC(mdi_power_base), 0, NULL, HFILL } |
5933 | 14 | }, |
5934 | 14 | { &hf_ieee_802_3_bt_ds_pse_allocated_power_value_alt_a, |
5935 | 14 | { "DS PSE Allocated Power Value Alt A", "lldp.ieee.802_3.bt_ds_pse_allocated_power_value_alt_a", FT_UINT16, BASE_CUSTOM, |
5936 | 14 | CF_FUNC(mdi_power_base), 0, NULL, HFILL } |
5937 | 14 | }, |
5938 | 14 | { &hf_ieee_802_3_bt_ds_pse_allocated_power_value_alt_b, |
5939 | 14 | { "DS PSE Allocated Power Value Alt B", "lldp.ieee.802_3.bt_ds_pse_allocated_power_value_alt_b", FT_UINT16, BASE_CUSTOM, |
5940 | 14 | CF_FUNC(mdi_power_base), 0, NULL, HFILL } |
5941 | 14 | }, |
5942 | 14 | { &hf_ieee_802_3_bt_power_status, |
5943 | 14 | { "Power Status", "lldp.ieee.802_3.bt_power_status", FT_UINT16, BASE_HEX, |
5944 | 14 | NULL, 0, NULL, HFILL } |
5945 | 14 | }, |
5946 | 14 | { &hf_ieee_802_3_bt_pse_powering_status, |
5947 | 14 | { "PSE Powering Status", "lldp.ieee.802_3.bt_pse_powering_status", FT_UINT16, BASE_DEC, |
5948 | 14 | VALS(pse_powering_status_802_3_bt), 0xC000, NULL, HFILL } |
5949 | 14 | }, |
5950 | 14 | { &hf_ieee_802_3_bt_pd_powered_status, |
5951 | 14 | { "PD Powered Status", "lldp.ieee.802_3.bt_pd_powered_status", FT_UINT16, BASE_DEC, |
5952 | 14 | VALS(pd_powered_status_802_3_bt), 0x3000, NULL, HFILL } |
5953 | 14 | }, |
5954 | 14 | { &hf_ieee_802_3_bt_pse_power_pairs_ext, |
5955 | 14 | { "PSE Power Pairs ext", "lldp.ieee.802_3.bt_pse_power_pairs_ext", FT_UINT16, BASE_DEC, |
5956 | 14 | VALS(power_pairs_ext_802_3_bt), 0x0C00, NULL, HFILL } |
5957 | 14 | }, |
5958 | 14 | { &hf_ieee_802_3_bt_ds_pwr_class_ext_a, |
5959 | 14 | { "DS Pwr Class Ext A", "lldp.ieee.802_3.bt_ds_pwr_class_ext_a", FT_UINT16, BASE_DEC, |
5960 | 14 | VALS(power_type_ext_mode_ab_802_3_bt), 0x0380, NULL, HFILL } |
5961 | 14 | }, |
5962 | 14 | { &hf_ieee_802_3_bt_ds_pwr_class_ext_b, |
5963 | 14 | { "DS Pwr Class Ext B", "lldp.ieee.802_3.bt_ds_pwr_class_ext_b", FT_UINT16, BASE_DEC, |
5964 | 14 | VALS(power_type_ext_mode_ab_802_3_bt), 0x0070, NULL, HFILL } |
5965 | 14 | }, |
5966 | 14 | { &hf_ieee_802_3_bt_pwr_class_ext, |
5967 | 14 | { "Pwr Class Ext", "lldp.ieee.802_3.bt_pwr_class_ext_", FT_UINT16, BASE_DEC, |
5968 | 14 | VALS(power_class_ext_802_3_bt), 0x000F, NULL, HFILL } |
5969 | 14 | }, |
5970 | 14 | { &hf_ieee_802_3_bt_system_setup, |
5971 | 14 | { "System Setup", "lldp.ieee.802_3.bt_system_setup", FT_UINT8, BASE_HEX, |
5972 | 14 | NULL, 0, NULL, HFILL } |
5973 | 14 | }, |
5974 | 14 | { &hf_ieee_802_3_bt_power_type_ext, |
5975 | 14 | { "Power Type Ext", "lldp.ieee.802_3.bt_power_type_ext", FT_UINT8, BASE_DEC, |
5976 | 14 | VALS(power_type_ext_802_3_bt), 0x0E, NULL, HFILL } |
5977 | 14 | }, |
5978 | 14 | { &hf_ieee_802_3_bt_power_pd_load, |
5979 | 14 | { "PD Load", "lldp.ieee.802_3.bt_power.pd_load", FT_BOOLEAN, 8, |
5980 | 14 | TFS(&tfs_ieee_802_3_pd_load), 0x1, NULL, HFILL } |
5981 | 14 | }, |
5982 | 14 | { &hf_ieee_802_3_bt_pse_maximum_available_power_value, |
5983 | 14 | { "PSE Maximum Available Power Value", "lldp.ieee.802_3.bt_pse_maximum_available_power_value", FT_UINT16, BASE_CUSTOM, |
5984 | 14 | CF_FUNC(mdi_power_base), 0, NULL, HFILL } |
5985 | 14 | }, |
5986 | 14 | { &hf_ieee_802_3_bt_autoclass, |
5987 | 14 | { "Autoclass", "lldp.ieee.802_3.bt_autoclass", FT_UINT8, BASE_HEX, |
5988 | 14 | NULL, 0, NULL, HFILL } |
5989 | 14 | }, |
5990 | 14 | { &hf_ieee_802_3_bt_pse_autoclass_support, |
5991 | 14 | { "PSE Autoclass support", "lldp.ieee.802_3.bt_pse_autoclass_support", FT_UINT8, BASE_DEC, |
5992 | 14 | NULL, 0x04, NULL, HFILL } |
5993 | 14 | }, |
5994 | 14 | { &hf_ieee_802_3_bt_autoclass_completed, |
5995 | 14 | { "Autoclass Completed", "lldp.ieee.802_3.bt_autoclass_completed", FT_UINT8, BASE_DEC, |
5996 | 14 | NULL, 0x02, NULL, HFILL } |
5997 | 14 | }, |
5998 | 14 | { &hf_ieee_802_3_bt_autoclass_request, |
5999 | 14 | { "Autoclass Request", "lldp.ieee.802_3.bt_autoclass_request", FT_UINT8, BASE_DEC, |
6000 | 14 | NULL, 0x01, NULL, HFILL } |
6001 | 14 | }, |
6002 | 14 | { &hf_ieee_802_3_bt_autoclass_reserved, |
6003 | 14 | { "Autoclass Reserved", "lldp.ieee.802_3.bt_autoclass_reserved", FT_UINT8, BASE_HEX, |
6004 | 14 | NULL, 0xF8, NULL, HFILL } |
6005 | 14 | }, |
6006 | 14 | { &hf_ieee_802_3_bt_power_down, |
6007 | 14 | { "Power down", "lldp.ieee.802_3.bt_power_down", FT_UINT24, BASE_HEX, |
6008 | 14 | NULL, 0, NULL, HFILL } |
6009 | 14 | }, |
6010 | 14 | { &hf_ieee_802_3_bt_power_down_request, |
6011 | 14 | { "Power down request", "lldp.ieee.802_3.bt_power_down_request", FT_UINT24, BASE_DEC, |
6012 | 14 | NULL, 0xFC0000, NULL, HFILL } |
6013 | 14 | }, |
6014 | 14 | { &hf_ieee_802_3_bt_power_down_time, |
6015 | 14 | { "Power down time", "lldp.ieee.802_3.bt_power_down_time", FT_UINT24, BASE_DEC, |
6016 | 14 | NULL, 0x03FFFF, NULL, HFILL } |
6017 | 14 | }, |
6018 | 14 | { &hf_ieee_802_3_aggregation_status, |
6019 | 14 | { "Aggregation Status", "lldp.ieee.802_3.aggregation_status", FT_UINT8, BASE_HEX, |
6020 | 14 | NULL, 0x0, NULL, HFILL } |
6021 | 14 | }, |
6022 | 14 | { &hf_ieee_802_3_aggregation_status_cap, |
6023 | 14 | { "Aggregation Capability", "lldp.ieee.802_3.aggregation_status.cap", FT_BOOLEAN, 8, |
6024 | 14 | TFS(&tfs_yes_no), 0x01, NULL, HFILL } |
6025 | 14 | }, |
6026 | 14 | { &hf_ieee_802_3_aggregation_status_enabled, |
6027 | 14 | { "Aggregation Status", "lldp.ieee.802_3.aggregation_status.enabled", FT_BOOLEAN, 8, |
6028 | 14 | TFS(&tfs_enabled_disabled), 0x02, NULL, HFILL } |
6029 | 14 | }, |
6030 | 14 | { &hf_ieee_802_3_aggregated_port_id, |
6031 | 14 | { "Aggregated Port Id", "lldp.ieee.802_3.aggregated_port_id", FT_UINT32, BASE_DEC, |
6032 | 14 | NULL, 0, NULL, HFILL } |
6033 | 14 | }, |
6034 | 14 | { &hf_ieee_802_3_max_frame_size, |
6035 | 14 | { "Maximum Frame Size", "lldp.ieee.802_3.max_frame_size", FT_UINT16, BASE_DEC, |
6036 | 14 | NULL, 0, NULL, HFILL } |
6037 | 14 | }, |
6038 | 14 | { &hf_ieee_802_3_eee_transmit, |
6039 | 14 | { "Transmit", "lldp.ieee.802_3.eee.transmit", FT_UINT16, BASE_DEC, |
6040 | 14 | NULL, 0, NULL, HFILL } |
6041 | 14 | }, |
6042 | 14 | { &hf_ieee_802_3_eee_receive, |
6043 | 14 | { "Receive", "lldp.ieee.802_3.eee.receive", FT_UINT16, BASE_DEC, |
6044 | 14 | NULL, 0, NULL, HFILL } |
6045 | 14 | }, |
6046 | 14 | { &hf_ieee_802_3_eee_fallback_receive, |
6047 | 14 | { "Fallback Receive", "lldp.ieee.802_3.eee.fallback_receive", FT_UINT16, BASE_DEC, |
6048 | 14 | NULL, 0, NULL, HFILL } |
6049 | 14 | }, |
6050 | 14 | { &hf_ieee_802_3_eee_echo_transmit, |
6051 | 14 | { "Echo Transmit", "lldp.ieee.802_3.eee.echo_transmit", FT_UINT16, BASE_DEC, |
6052 | 14 | NULL, 0, NULL, HFILL } |
6053 | 14 | }, |
6054 | 14 | { &hf_ieee_802_3_eee_echo_receive, |
6055 | 14 | { "Echo Receive", "lldp.ieee.802_3.eee.echo_receive", FT_UINT16, BASE_DEC, |
6056 | 14 | NULL, 0, NULL, HFILL } |
6057 | 14 | }, |
6058 | 14 | { &hf_ieee_802_1qbg_subtype, |
6059 | 14 | { "IEEE 802.1Qbg Subtype", "lldp.ieee.802_1qbg.subtype", FT_UINT8, BASE_HEX, |
6060 | 14 | VALS(ieee_802_1qbg_subtypes), 0x0, NULL, HFILL } |
6061 | 14 | }, |
6062 | 14 | { &hf_ieee_802_1qbg_evb_support_caps, |
6063 | 14 | { "Supported capabilities", "lldp.ieee.802_1qbg.evb_support_caps", FT_UINT16, BASE_HEX, |
6064 | 14 | NULL, 0x0, NULL, HFILL } |
6065 | 14 | }, |
6066 | 14 | { &hf_ieee_802_1qbg_evb_support_caps_std, |
6067 | 14 | { "Standard bridging (STD)", "lldp.ieee.802_1qbg.evb_support_caps.std", FT_BOOLEAN, 16, |
6068 | 14 | TFS(&tfs_capable_not_capable), EVB_CAPA_STD, NULL, HFILL } |
6069 | 14 | }, |
6070 | 14 | { &hf_ieee_802_1qbg_evb_support_caps_rr, |
6071 | 14 | { "Reflective relay (RR)", "lldp.ieee.802_1qbg.evb_support_caps.rr", FT_BOOLEAN, 16, |
6072 | 14 | TFS(&tfs_capable_not_capable), EVB_CAPA_RR, NULL, HFILL } |
6073 | 14 | }, |
6074 | 14 | { &hf_ieee_802_1qbg_evb_support_caps_rte, |
6075 | 14 | { "Retransmission timer exponent (RTE)", "lldp.ieee.802_1qbg.evb_support_caps.rte", FT_BOOLEAN, 16, |
6076 | 14 | TFS(&tfs_capable_not_capable), EVB_CAPA_RTE, NULL, HFILL } |
6077 | 14 | }, |
6078 | 14 | { &hf_ieee_802_1qbg_evb_support_caps_ecp, |
6079 | 14 | { "Edge control protocol (ECP)", "lldp.ieee.802_1qbg.evb_support_caps.ecp", FT_BOOLEAN, 16, |
6080 | 14 | TFS(&tfs_capable_not_capable), EVB_CAPA_ECP, NULL, HFILL } |
6081 | 14 | }, |
6082 | 14 | { &hf_ieee_802_1qbg_evb_support_caps_vdp, |
6083 | 14 | { "VSI discovery protocol (VDP)", "lldp.ieee.802_1qbg.evb_support_caps.vdp", FT_BOOLEAN, 16, |
6084 | 14 | TFS(&tfs_capable_not_capable), EVB_CAPA_VDP, NULL, HFILL } |
6085 | 14 | }, |
6086 | 14 | { &hf_ieee_802_1qbg_evb_configure_caps, |
6087 | 14 | { "Configured capabilities", "lldp.ieee.802_1qbg.evb_configure_caps", FT_UINT16, BASE_HEX, |
6088 | 14 | NULL, 0x0, NULL, HFILL } |
6089 | 14 | }, |
6090 | 14 | { &hf_ieee_802_1qbg_evb_configure_caps_std, |
6091 | 14 | { "Standard bridging (STD)", "lldp.ieee.802_1qbg.evb_configure_caps.std", FT_BOOLEAN, 16, |
6092 | 14 | TFS(&tfs_capable_not_capable), EVB_CAPA_STD, NULL, HFILL } |
6093 | 14 | }, |
6094 | 14 | { &hf_ieee_802_1qbg_evb_configure_caps_rr, |
6095 | 14 | { "Reflective relay (RR)", "lldp.ieee.802_1qbg.evb_configure_caps.rr", FT_BOOLEAN, 16, |
6096 | 14 | TFS(&tfs_capable_not_capable), EVB_CAPA_RR, NULL, HFILL } |
6097 | 14 | }, |
6098 | 14 | { &hf_ieee_802_1qbg_evb_configure_caps_rte, |
6099 | 14 | { "Retransmission timer exponent (RTE)", "lldp.ieee.802_1qbg.evb_configure_caps.rte", FT_BOOLEAN, 16, |
6100 | 14 | TFS(&tfs_capable_not_capable), EVB_CAPA_RTE, NULL, HFILL } |
6101 | 14 | }, |
6102 | 14 | { &hf_ieee_802_1qbg_evb_configure_caps_ecp, |
6103 | 14 | { "Edge control protocol (ECP)", "lldp.ieee.802_1qbg.evb_configure_caps.ecp", FT_BOOLEAN, 16, |
6104 | 14 | TFS(&tfs_capable_not_capable), EVB_CAPA_ECP, NULL, HFILL } |
6105 | 14 | }, |
6106 | 14 | { &hf_ieee_802_1qbg_evb_configure_caps_vdp, |
6107 | 14 | { "VSI discovery protocol (VDP)", "lldp.ieee.802_1qbg.evb_configure_caps.vdp", FT_BOOLEAN, 16, |
6108 | 14 | TFS(&tfs_capable_not_capable), EVB_CAPA_VDP, NULL, HFILL } |
6109 | 14 | }, |
6110 | 14 | { &hf_ieee_802_1qbg_evb_supported_vsi, |
6111 | 14 | { "Supported No of VSIs", "lldp.ieee.802_1qbg.evb_supported_vsi", FT_UINT16, BASE_DEC, |
6112 | 14 | NULL, 0x0, NULL, HFILL } |
6113 | 14 | }, |
6114 | 14 | { &hf_ieee_802_1qbg_evb_configured_vsi, |
6115 | 14 | { "Configured No of VSIs", "lldp.ieee.802_1qbg.evb_configured_vsi", FT_UINT16, BASE_DEC, |
6116 | 14 | NULL, 0x0, NULL, HFILL } |
6117 | 14 | }, |
6118 | 14 | { &hf_ieee_802_1qbg_evb_retrans_timer, |
6119 | 14 | { "Retransmission timer exponent", "lldp.ieee.802_1qbg.evb_retrans_timer", FT_UINT8, BASE_DEC, |
6120 | 14 | NULL, 0x0, NULL, HFILL } |
6121 | 14 | }, |
6122 | 14 | { &hf_ieee_802_3br_aec, |
6123 | 14 | { "Additional Ethernet Capabilities", "lldp.ieee.802_3br.eac", FT_UINT16, BASE_HEX, |
6124 | 14 | NULL, 0x0, NULL, HFILL } |
6125 | 14 | }, |
6126 | 14 | { &hf_ieee_802_3br_aec_support, |
6127 | 14 | { "Preemption capabilities support", "lldp.ieee.802_3br.aec.support", FT_BOOLEAN, 16, |
6128 | 14 | TFS(&tfs_supported_not_supported), IEEE_802_3BR_AEC_SUPPORT, NULL, HFILL } |
6129 | 14 | }, |
6130 | 14 | { &hf_ieee_802_3br_aec_enable, |
6131 | 14 | { "Preemption capabilities enable", "lldp.ieee.802_3br.aec.enable", FT_BOOLEAN, 16, |
6132 | 14 | TFS(&tfs_enabled_disabled), IEEE_802_3BR_AEC_ENABLE, NULL, HFILL } |
6133 | 14 | }, |
6134 | 14 | { &hf_ieee_802_3br_aec_active, |
6135 | 14 | { "Preemption capabilities active", "lldp.ieee.802_3br.aec.active", FT_BOOLEAN, 16, |
6136 | 14 | TFS(&tfs_active_inactive), IEEE_802_3BR_AEC_ACTIVE, NULL, HFILL } |
6137 | 14 | }, |
6138 | 14 | { &hf_ieee_802_3br_aec_addfragsize, |
6139 | 14 | { "Additional Fragment Size", "lldp.ieee.802_3br.aec.addfragsize", FT_UINT16, BASE_DEC, |
6140 | 14 | NULL, IEEE_802_3BR_AEC_ADDFRAGSIZE, NULL, HFILL } |
6141 | 14 | }, |
6142 | 14 | { &hf_ieee_802_3br_aec_reserved, |
6143 | 14 | { "Reserved", "lldp.ieee.802_3br.aec.reserved", FT_UINT16, BASE_HEX, |
6144 | 14 | NULL, IEEE_802_3BR_AEC_RESERVED, NULL, HFILL } |
6145 | 14 | }, |
6146 | 14 | { &hf_media_tlv_subtype, |
6147 | 14 | { "Media Subtype", "lldp.media.subtype", FT_UINT8, BASE_HEX, |
6148 | 14 | VALS(media_subtypes), 0x0, NULL, HFILL } |
6149 | 14 | }, |
6150 | 14 | { &hf_media_tlv_subtype_caps, |
6151 | 14 | { "Capabilities", "lldp.media.subtype.caps", FT_UINT16, BASE_HEX, |
6152 | 14 | NULL, 0x0, NULL, HFILL } |
6153 | 14 | }, |
6154 | 14 | { &hf_media_tlv_subtype_caps_llpd, |
6155 | 14 | { "LLDP-MED Capabilities", "lldp.media.subtype.caps.llpd", FT_BOOLEAN, 16, |
6156 | 14 | TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_LLDP, NULL, HFILL } |
6157 | 14 | }, |
6158 | 14 | { &hf_media_tlv_subtype_caps_network_policy, |
6159 | 14 | { "Network Policy", "lldp.media.subtype.caps.network_policy", FT_BOOLEAN, 16, |
6160 | 14 | TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_NETWORK_POLICY, NULL, HFILL } |
6161 | 14 | }, |
6162 | 14 | { &hf_media_tlv_subtype_caps_location_id, |
6163 | 14 | { "Location Identification", "lldp.media.subtype.caps.location_id", FT_BOOLEAN, 16, |
6164 | 14 | TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_LOCATION_ID, NULL, HFILL } |
6165 | 14 | }, |
6166 | 14 | { &hf_media_tlv_subtype_caps_mdi_pse, |
6167 | 14 | { "Extended Power via MDI-PSE", "lldp.media.subtype.caps.mdi_pse", FT_BOOLEAN, 16, |
6168 | 14 | TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_MDI_PSE, NULL, HFILL } |
6169 | 14 | }, |
6170 | 14 | { &hf_media_tlv_subtype_caps_mid_pd, |
6171 | 14 | { "Extended Power via MDI-PD", "lldp.media.subtype.caps.mid_pd", FT_BOOLEAN, 16, |
6172 | 14 | TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_MDI_PD, NULL, HFILL } |
6173 | 14 | }, |
6174 | 14 | { &hf_media_tlv_subtype_caps_inventory, |
6175 | 14 | { "Inventory", "lldp.media.subtype.caps.inventory", FT_BOOLEAN, 16, |
6176 | 14 | TFS(&tfs_capable_not_capable), MEDIA_CAPABILITY_INVENTORY, NULL, HFILL } |
6177 | 14 | }, |
6178 | 14 | { &hf_media_tlv_subtype_class, |
6179 | 14 | { "Class Type", "lldp.media.subtype.class", FT_UINT8, BASE_DEC, |
6180 | 14 | VALS(media_class_values), 0x0, "Unknown", HFILL } |
6181 | 14 | }, |
6182 | 14 | { &hf_media_application_type, |
6183 | 14 | { "Application Type", "lldp.media.app_type", FT_UINT8, BASE_DEC, |
6184 | 14 | VALS(media_application_type), 0x0, "Unknown", HFILL } |
6185 | 14 | }, |
6186 | 14 | { &hf_media_policy_flag, |
6187 | 14 | { "Policy", "lldp.media.policy_flag", FT_BOOLEAN, 24, |
6188 | 14 | TFS(&tfs_unknown_defined), 0x800000, NULL, HFILL } |
6189 | 14 | }, |
6190 | 14 | { &hf_media_tag_flag, |
6191 | 14 | { "Tagged", "lldp.media.tag_flag", FT_BOOLEAN, 24, |
6192 | 14 | TFS(&tfs_yes_no), 0x400000, NULL, HFILL } |
6193 | 14 | }, |
6194 | 14 | { &hf_media_vlan_id, |
6195 | 14 | { "VLAN Id", "lldp.media.vlan_id", FT_UINT24, BASE_DEC, |
6196 | 14 | NULL, 0x1FFE00, NULL, HFILL } |
6197 | 14 | }, |
6198 | 14 | { &hf_media_l2_prio, |
6199 | 14 | { "L2 Priority", "lldp.media.l2_prio", FT_UINT24, BASE_DEC, |
6200 | 14 | NULL, 0x0001C0, NULL, HFILL } |
6201 | 14 | }, |
6202 | 14 | { &hf_media_dscp, |
6203 | 14 | { "DSCP Priority", "lldp.media.dscp", FT_UINT24, BASE_DEC, |
6204 | 14 | NULL, 0x00003F, NULL, HFILL } |
6205 | 14 | }, |
6206 | 14 | { &hf_media_loc_data_format, |
6207 | 14 | { "Location Data Format", "lldp.media.loc.data_format", FT_UINT8, BASE_DEC, |
6208 | 14 | VALS(location_data_format), 0x0, NULL, HFILL } |
6209 | 14 | }, |
6210 | 14 | { &hf_media_loc_lat_resolution, |
6211 | 14 | { "Latitude Resolution", "lldp.media.loc.lat_resolution", FT_UINT8, BASE_CUSTOM, |
6212 | 14 | CF_FUNC(latitude_or_longitude_resolution), 0xFC, NULL, HFILL } |
6213 | 14 | }, |
6214 | 14 | { &hf_media_loc_lat, |
6215 | 14 | { "Latitude", "lldp.media.loc.latitude", FT_UINT40, BASE_CUSTOM, |
6216 | 14 | CF_FUNC(latitude_base), 0x0, NULL, HFILL } |
6217 | 14 | }, |
6218 | 14 | { &hf_media_loc_long_resolution, |
6219 | 14 | { "Longitude Resolution", "lldp.media.loc.long_resolution", FT_UINT8, BASE_CUSTOM, |
6220 | 14 | CF_FUNC(latitude_or_longitude_resolution), 0xFC, NULL, HFILL } |
6221 | 14 | }, |
6222 | 14 | { &hf_media_loc_long, |
6223 | 14 | { "Longitude", "lldp.media.loc.longitude", FT_UINT40, BASE_CUSTOM, |
6224 | 14 | CF_FUNC(longitude_base), 0x0, NULL, HFILL } |
6225 | 14 | }, |
6226 | 14 | { &hf_media_loc_alt_type, |
6227 | 14 | { "Altitude Type", "lldp.media.loc.alt_type", FT_UINT8, BASE_DEC, |
6228 | 14 | VALS(altitude_type), 0xF0, "Unknown", HFILL } |
6229 | 14 | }, |
6230 | 14 | { &hf_media_loc_alt_resolution, |
6231 | 14 | { "Altitude Resolution", "lldp.media.loc.alt_resolution", FT_UINT16, BASE_CUSTOM, |
6232 | 14 | CF_FUNC(altitude_resolution), 0x0FC0, NULL, HFILL } |
6233 | 14 | }, |
6234 | 14 | { &hf_media_loc_alt, |
6235 | 14 | { "Altitude", "lldp.media.loc.altitude", FT_UINT32, BASE_CUSTOM, |
6236 | 14 | CF_FUNC(altitude_base), 0x0, NULL, HFILL } |
6237 | 14 | }, |
6238 | 14 | { &hf_media_loc_ver, |
6239 | 14 | { "Ver", "lldp.media.loc.ver", FT_UINT8, BASE_DEC, |
6240 | 14 | NULL, 0xC0, NULL, HFILL } |
6241 | 14 | }, |
6242 | 14 | { &hf_media_loc_reserved, |
6243 | 14 | { "Reserved", "lldp.media.loc.reserved", FT_UINT8, BASE_DEC, |
6244 | 14 | NULL, 0x38, NULL, HFILL } |
6245 | 14 | }, |
6246 | 14 | { &hf_media_loc_datum, |
6247 | 14 | { "Datum", "lldp.media.loc.datum", FT_UINT8, BASE_DEC, |
6248 | 14 | VALS(datum_type_values), 0x07, NULL, HFILL } |
6249 | 14 | }, |
6250 | 14 | { &hf_media_civic_lci_length, |
6251 | 14 | { "LCI Length", "lldp.media.civic.length", FT_UINT8, BASE_DEC, |
6252 | 14 | NULL, 0x0, NULL, HFILL } |
6253 | 14 | }, |
6254 | 14 | { &hf_media_civic_what, |
6255 | 14 | { "What", "lldp.media.civic.what", FT_UINT8, BASE_DEC, |
6256 | 14 | VALS(civic_address_what_values), 0x0, "Unknown", HFILL } |
6257 | 14 | }, |
6258 | 14 | { &hf_media_civic_country, |
6259 | 14 | { "Country", "lldp.media.civic.country", FT_STRING, BASE_NONE, |
6260 | 14 | NULL, 0x0, NULL, HFILL } |
6261 | 14 | }, |
6262 | 14 | { &hf_media_civic_addr_type, |
6263 | 14 | { "CA Type", "lldp.media.civic.type", FT_UINT8, BASE_DEC, |
6264 | 14 | VALS(civic_address_type_values), 0x0, "Unknown", HFILL } |
6265 | 14 | }, |
6266 | 14 | { &hf_media_civic_addr_len, |
6267 | 14 | { "CA Length", "lldp.media.civic.addr_length", FT_UINT8, BASE_DEC, |
6268 | 14 | NULL, 0x0, NULL, HFILL } |
6269 | 14 | }, |
6270 | 14 | { &hf_media_civic_addr_value, |
6271 | 14 | { "CA Value", "lldp.media.civic.value", FT_STRINGZ, BASE_NONE, |
6272 | 14 | NULL, 0x0, NULL, HFILL } |
6273 | 14 | }, |
6274 | 14 | { &hf_media_ecs, |
6275 | 14 | { "ELIN", "lldp.media.ecs", FT_STRINGZ, BASE_NONE, |
6276 | 14 | NULL, 0x0, NULL, HFILL } |
6277 | 14 | }, |
6278 | 14 | { &hf_media_power_type, |
6279 | 14 | { "Power Type", "lldp.media.power.type", FT_UINT8, BASE_DEC, |
6280 | 14 | VALS(media_power_type), 0xC0, "Unknown", HFILL } |
6281 | 14 | }, |
6282 | 14 | { &hf_media_power_source, |
6283 | 14 | { "Power Source", "lldp.media.power.source", FT_UINT8, BASE_DEC, |
6284 | 14 | NULL, 0x30, NULL, HFILL } |
6285 | 14 | }, |
6286 | 14 | { &hf_media_power_priority, |
6287 | 14 | { "Power Priority", "lldp.media.power.prio", FT_UINT8, BASE_DEC, |
6288 | 14 | VALS(media_power_priority), 0x0F, "Reserved", HFILL } |
6289 | 14 | }, |
6290 | 14 | { &hf_media_power_value, |
6291 | 14 | { "Power Value", "lldp.media.power.value", FT_UINT16, BASE_CUSTOM, |
6292 | 14 | CF_FUNC(media_power_base), 0x0, NULL, HFILL } |
6293 | 14 | }, |
6294 | 14 | { &hf_media_hardware, |
6295 | 14 | { "Hardware Revision", "lldp.media.hardware", FT_STRINGZPAD, BASE_NONE, |
6296 | 14 | NULL, 0x0, NULL, HFILL } |
6297 | 14 | }, |
6298 | 14 | { &hf_media_firmware, |
6299 | 14 | { "Firmware Revision", "lldp.media.firmware", FT_STRINGZPAD, BASE_NONE, |
6300 | 14 | NULL, 0x0, NULL, HFILL } |
6301 | 14 | }, |
6302 | 14 | { &hf_media_software, |
6303 | 14 | { "Software Revision", "lldp.media.software", FT_STRINGZPAD, BASE_NONE, |
6304 | 14 | NULL, 0x0, NULL, HFILL } |
6305 | 14 | }, |
6306 | 14 | { &hf_media_sn, |
6307 | 14 | { "Serial Number", "lldp.media.sn", FT_STRINGZPAD, BASE_NONE, |
6308 | 14 | NULL, 0x0, NULL, HFILL } |
6309 | 14 | }, |
6310 | 14 | { &hf_media_manufacturer, |
6311 | 14 | { "Manufacturer Name", "lldp.media.manufacturer", FT_STRINGZPAD, BASE_NONE, |
6312 | 14 | NULL, 0x0, NULL, HFILL } |
6313 | 14 | }, |
6314 | 14 | { &hf_media_model, |
6315 | 14 | { "Model Name", "lldp.media.model", FT_STRINGZPAD, BASE_NONE, |
6316 | 14 | NULL, 0x0, NULL, HFILL } |
6317 | 14 | }, |
6318 | 14 | { &hf_media_asset, |
6319 | 14 | { "Asset ID", "lldp.media.asset", FT_STRINGZPAD, BASE_NONE, |
6320 | 14 | NULL, 0x0, NULL, HFILL } |
6321 | 14 | }, |
6322 | 14 | { &hf_profinet_tlv_subtype, |
6323 | 14 | { "Subtype", "lldp.profinet.subtype", FT_UINT8, BASE_HEX, |
6324 | 14 | VALS(profinet_subtypes), 0x0, "PROFINET Subtype", HFILL } |
6325 | 14 | }, |
6326 | 14 | { &hf_profinet_port_rx_delay_local, |
6327 | 14 | { "Port RX Delay Local", "lldp.profinet.port_rx_delay_local", FT_UINT32, BASE_DEC, |
6328 | 14 | NULL, 0x0, NULL, HFILL } |
6329 | 14 | }, |
6330 | 14 | { &hf_profinet_port_rx_delay_remote, |
6331 | 14 | { "Port RX Delay Remote", "lldp.profinet.port_rx_delay_remote", FT_UINT32, BASE_DEC, |
6332 | 14 | NULL, 0x0, NULL, HFILL } |
6333 | 14 | }, |
6334 | 14 | { &hf_profinet_port_tx_delay_local, |
6335 | 14 | { "Port TX Delay Local", "lldp.profinet.port_tx_delay_local", FT_UINT32, BASE_DEC, |
6336 | 14 | NULL, 0x0, NULL, HFILL } |
6337 | 14 | }, |
6338 | 14 | { &hf_profinet_port_tx_delay_remote, |
6339 | 14 | { "Port TX Delay Remote", "lldp.profinet.port_tx_delay_remote", FT_UINT32, BASE_DEC, |
6340 | 14 | NULL, 0x0, NULL, HFILL } |
6341 | 14 | }, |
6342 | 14 | { &hf_profinet_cable_delay_local, |
6343 | 14 | { "Port Cable Delay Local", "lldp.profinet.cable_delay_local", FT_UINT32, BASE_DEC, |
6344 | 14 | NULL, 0x0, NULL, HFILL } |
6345 | 14 | }, |
6346 | 14 | { &hf_profinet_class2_port_status, |
6347 | 14 | { "RTClass2 Port Status", "lldp.profinet.rtc2_port_status", FT_UINT16, BASE_HEX, |
6348 | 14 | VALS(profinet_port2_status_vals), 0x0, NULL, HFILL } |
6349 | 14 | }, |
6350 | 14 | { &hf_profinet_class3_port_status, |
6351 | 14 | { "RTClass3 Port Status", "lldp.profinet.rtc3_port_status", FT_UINT16, BASE_HEX, |
6352 | 14 | VALS(profinet_port3_status_vals), 0x07, NULL, HFILL } |
6353 | 14 | }, |
6354 | | /* class3_port state got some new BITs */ |
6355 | 14 | { &hf_profinet_class3_port_status_Fragmentation, |
6356 | 14 | { "RTClass3_PortStatus.Fragmentation", "lldp.profinet.rtc3_port_status.fragmentation", FT_BOOLEAN, 16, |
6357 | 14 | TFS(&tfs_on_off), 0x1000, NULL, HFILL } |
6358 | 14 | }, |
6359 | 14 | { &hf_profinet_class3_port_status_reserved, |
6360 | 14 | { "RTClass3_PortStatus.reserved", "lldp.profinet.rtc3_port_status.reserved", FT_UINT16, BASE_HEX, |
6361 | 14 | NULL, 0x0FF8, "reserved", HFILL } |
6362 | 14 | }, |
6363 | 14 | { &hf_profinet_class3_port_status_PreambleLength, |
6364 | 14 | { "RTClass3_PortStatus.PreambleLength", "lldp.profinet.rtc3_port_status.preambleLength", FT_UINT16, BASE_HEX, |
6365 | 14 | VALS(profinet_port3_status_PreambleLength), 0x2000, NULL, HFILL } |
6366 | 14 | }, |
6367 | 14 | { &hf_profinet_mrp_domain_uuid, |
6368 | 14 | { "MRP DomainUUID", "lldp.profinet.mrp_domain_uuid", FT_GUID, BASE_NONE, |
6369 | 14 | NULL, 0x0, NULL, HFILL } |
6370 | 14 | }, |
6371 | 14 | { &hf_profinet_tsn_domain_uuid, |
6372 | 14 | { "TSN DomainUUID", "lldp.profinet.tsn_domain_uuid", FT_GUID, BASE_NONE, |
6373 | 14 | NULL, 0x0, NULL, HFILL } |
6374 | 14 | }, |
6375 | 14 | { &hf_profinet_tsn_nme_management_addr, |
6376 | 14 | { "TSN NME Management Address", "lldp.profinet.tsn_nme_management_addr", FT_BYTES, BASE_NONE, |
6377 | 14 | NULL, 0x0, NULL, HFILL } |
6378 | 14 | }, |
6379 | 14 | { &hf_profinet_tsn_nme_management_addr_str_length, |
6380 | 14 | { "TSN NME Management Address String Length", "lldp.profinet.tsn_nme_management_addr_str_length", FT_UINT8, BASE_HEX, |
6381 | 14 | NULL, 0x0, NULL, HFILL } |
6382 | 14 | }, |
6383 | 14 | { &hf_profinet_tsn_nme_management_addr_subtype, |
6384 | 14 | { "TSN NME Management Address Subtype", "lldp.profinet.tsn_nme_management_addr_subtype", FT_UINT8, BASE_HEX, |
6385 | 14 | NULL, 0x0, NULL, HFILL } |
6386 | 14 | }, |
6387 | 14 | { &hf_profinet_tsn_nme_name_uuid, |
6388 | 14 | { "TSN NME Name UUID", "lldp.profinet.tsn_nme_name_uuid", FT_GUID, BASE_NONE, |
6389 | 14 | NULL, 0x0, NULL, HFILL } |
6390 | 14 | }, |
6391 | 14 | { &hf_profinet_tsn_nme_parameter_uuid, |
6392 | 14 | { "TSN NME Parameter UUID", "lldp.profinet.tsn_nme_parameter_uuid", FT_GUID, BASE_NONE, |
6393 | 14 | NULL, 0x0, NULL, HFILL } |
6394 | 14 | }, |
6395 | 14 | { &hf_profinet_time_domain_number, |
6396 | 14 | { "Time Domain Number", "lldp.profinet.time_domain_number", FT_UINT16, BASE_HEX, |
6397 | 14 | VALS(profinet_time_domain_number_vals), 0x0, NULL, HFILL } |
6398 | 14 | }, |
6399 | 14 | { &hf_profinet_time_domain_uuid, |
6400 | 14 | { "Time Domain UUID", "lldp.profinet.time_domain_uuid", FT_GUID, BASE_NONE, |
6401 | 14 | NULL, 0x0, NULL, HFILL } |
6402 | 14 | }, |
6403 | 14 | { &hf_profinet_time_domain_master_identity, |
6404 | 14 | { "Time Domain Master Identity", "lldp.profinet.time_domain_master_identity", FT_BYTES, BASE_NONE, |
6405 | 14 | 0x0, 0x0, NULL, HFILL } |
6406 | 14 | }, |
6407 | 14 | { &hf_profinet_mrrt_port_status, |
6408 | 14 | { "MRRT PortStatus", "lldp.profinet.mrrt_port_status", FT_UINT16, BASE_HEX, |
6409 | 14 | VALS(profinet_mrrt_port_status_vals), 0x0, NULL, HFILL } |
6410 | 14 | }, |
6411 | 14 | { &hf_profinet_cm_mac, |
6412 | 14 | { "CMMacAdd", "lldp.profinet.cm_mac_add", FT_ETHER, BASE_NONE, |
6413 | 14 | NULL, 0x0, "CMResponderMacAdd or CMInitiatorMacAdd", HFILL } |
6414 | 14 | }, |
6415 | 14 | { &hf_profinet_master_source_address, |
6416 | 14 | { "MasterSourceAddress", "lldp.profinet.master_source_address", FT_ETHER, BASE_NONE, |
6417 | 14 | NULL, 0x0, NULL, HFILL } |
6418 | 14 | }, |
6419 | 14 | { &hf_profinet_subdomain_uuid, |
6420 | 14 | { "SubdomainUUID", "lldp.profinet.subdomain_uuid", FT_GUID, BASE_NONE, |
6421 | 14 | NULL, 0x0, NULL, HFILL } |
6422 | 14 | }, |
6423 | 14 | { &hf_profinet_ir_data_uuid, |
6424 | 14 | { "IRDataUUID", "lldp.profinet.ir_data_uuid", FT_GUID, BASE_NONE, |
6425 | 14 | NULL, 0x0, NULL, HFILL } |
6426 | 14 | }, |
6427 | 14 | { &hf_profinet_length_of_period_valid, |
6428 | 14 | { "LengthOfPeriod.Valid", "lldp.profinet.length_of_period_valid", FT_UINT32, BASE_DEC, |
6429 | 14 | NULL, 0x80000000, "Length field is valid/invalid", HFILL } |
6430 | 14 | }, |
6431 | 14 | { &hf_profinet_length_of_period_length, |
6432 | 14 | { "LengthOfPeriod.Length", "lldp.profinet.length_of_period_length", FT_UINT32, BASE_DEC, |
6433 | 14 | NULL, 0x7FFFFFFF, "Duration of a cycle in nanoseconds", HFILL } |
6434 | 14 | }, |
6435 | 14 | { &hf_profinet_red_period_begin_valid, |
6436 | 14 | { "RedPeriodBegin.Valid", "lldp.profinet.red_period_begin_valid", FT_UINT32, BASE_DEC, |
6437 | 14 | NULL, 0x80000000, "Offset field is valid/invalid", HFILL } |
6438 | 14 | }, |
6439 | 14 | { &hf_profinet_red_period_begin_offset, |
6440 | 14 | { "RedPeriodBegin.Offset", "lldp.profinet.red_period_begin_offset", FT_UINT32, BASE_DEC, |
6441 | 14 | NULL, 0x7FFFFFFF, "RT_CLASS_3 period, offset to cycle begin in nanoseconds", HFILL } |
6442 | 14 | }, |
6443 | 14 | { &hf_profinet_orange_period_begin_valid, |
6444 | 14 | { "OrangePeriodBegin.Valid", "lldp.profinet.orange_period_begin_valid", FT_UINT32, BASE_DEC, |
6445 | 14 | NULL, 0x80000000, "Offset field is valid/invalid", HFILL } |
6446 | 14 | }, |
6447 | 14 | { &hf_profinet_orange_period_begin_offset, |
6448 | 14 | { "OrangePeriodBegin.Offset","lldp.profinet.orange_period_begin_offset", FT_UINT32, BASE_DEC, |
6449 | 14 | NULL, 0x7FFFFFFF, "RT_CLASS_2 period, offset to cycle begin in nanoseconds", HFILL } |
6450 | 14 | }, |
6451 | 14 | { &hf_profinet_green_period_begin_valid, |
6452 | 14 | { "GreenPeriodBegin.Valid", "lldp.profinet.green_period_begin_valid", FT_UINT32, BASE_DEC, |
6453 | 14 | NULL, 0x80000000, "Offset field is valid/invalid", HFILL } |
6454 | 14 | }, |
6455 | 14 | { &hf_profinet_green_period_begin_offset, |
6456 | 14 | { "GreenPeriodBegin.Offset", "lldp.profinet.green_period_begin_offset", FT_UINT32, BASE_DEC, |
6457 | 14 | NULL, 0x7FFFFFFF, "Unrestricted period, offset to cycle begin in nanoseconds", HFILL } |
6458 | 14 | }, |
6459 | | /* Cisco generic */ |
6460 | 14 | { &hf_cisco_subtype, |
6461 | 14 | { "Cisco Subtype", "lldp.cisco.subtype", FT_UINT8, BASE_HEX, |
6462 | 14 | VALS(cisco_subtypes), 0x0, NULL, HFILL } |
6463 | 14 | }, |
6464 | 14 | { &hf_cisco_upoe, |
6465 | 14 | { "UPOE Capabilities", "lldp.cisco.upoe", FT_UINT8, BASE_HEX, |
6466 | 14 | NULL, 0x0, "PSE/PD Capabilities", HFILL } |
6467 | 14 | }, |
6468 | 14 | { &hf_cisco_upoe_supported, |
6469 | 14 | { "UPOE Supported", "lldp.cisco.upoe.supported", FT_BOOLEAN, 8, |
6470 | 14 | TFS(&tfs_yes_no), 0x01, "UPOE (4-pair POE) Supported", HFILL } |
6471 | 14 | }, |
6472 | 14 | { &hf_cisco_upoe_altb_detection, |
6473 | 14 | { "ALT-B Detection required", "lldp.cisco.upoe.altb_detection_required", FT_BOOLEAN, 8, |
6474 | 14 | TFS(&tfs_yes_no), 0x02, "ALT-B pair Detection/Classification Required", HFILL } |
6475 | 14 | }, |
6476 | 14 | { &hf_cisco_upoe_req_spare_pair, |
6477 | 14 | { "PD Request Spare Pair PoE", "lldp.cisco.upoe.pd_altb_desired", FT_BOOLEAN, 8, |
6478 | 14 | TFS(&tfs_desired_not_desired), 0x04, "PD ALT-B Pair Desired", HFILL } |
6479 | 14 | }, |
6480 | 14 | { &hf_cisco_upoe_pse_spare_pair_oper, |
6481 | 14 | { "PSE Spare Pair PoE", "lldp.cisco.upoe.pse_altb_oper", FT_BOOLEAN, 8, |
6482 | 14 | TFS(&tfs_enabled_disabled), 0x08, "PSE ALT-B Pair Operational State", HFILL } |
6483 | 14 | }, |
6484 | | /* Cisco ACI */ |
6485 | 14 | { &hf_cisco_aci_portstate, |
6486 | 14 | { "Port State", "lldp.cisco.portstate", FT_UINT8, BASE_NONE, |
6487 | 14 | VALS(cisco_portstate_vals), 0x0, NULL, HFILL } |
6488 | 14 | }, |
6489 | 14 | { &hf_cisco_aci_noderole, |
6490 | 14 | { "Node Role", "lldp.cisco.noderole", FT_UINT8, BASE_DEC, |
6491 | 14 | VALS(cisco_noderole_vals), 0x0, NULL, HFILL } |
6492 | 14 | }, |
6493 | 14 | { &hf_cisco_aci_nodeid, |
6494 | 14 | { "Node ID", "lldp.cisco.nodeid", FT_UINT32, BASE_DEC, |
6495 | 14 | NULL, 0x0, NULL, HFILL } |
6496 | 14 | }, |
6497 | 14 | { &hf_cisco_aci_spinelevel, |
6498 | 14 | { "Spine Level", "lldp.cisco.spinelevel", FT_UINT8, BASE_DEC, |
6499 | 14 | NULL, 0x0, NULL, HFILL } |
6500 | 14 | }, |
6501 | 14 | { &hf_cisco_aci_podid, |
6502 | 14 | { "Pod ID", "lldp.cisco.podid", FT_UINT16, BASE_DEC, |
6503 | 14 | NULL, 0x0, NULL, HFILL } |
6504 | 14 | }, |
6505 | 14 | { &hf_cisco_aci_fabricname, |
6506 | 14 | { "Fabric Name", "lldp.cisco.fabricname", FT_STRING, BASE_NONE, |
6507 | 14 | NULL, 0x0, NULL, HFILL } |
6508 | 14 | }, |
6509 | 14 | { &hf_cisco_aci_apiclist, |
6510 | 14 | { "Appliance Vector", "lldp.cisco.apiclist", FT_BYTES, BASE_NONE, |
6511 | 14 | NULL, 0x0, NULL, HFILL } |
6512 | 14 | }, |
6513 | 14 | { &hf_cisco_aci_apicid, |
6514 | 14 | { "APIC ID", "lldp.cisco.apicid", FT_UINT8, BASE_DEC, |
6515 | 14 | NULL, 0x0, NULL, HFILL } |
6516 | 14 | }, |
6517 | 14 | { &hf_cisco_aci_apicipv4, |
6518 | 14 | { "APIC IPv4", "lldp.cisco.apicipv4", FT_IPv4, BASE_NONE, |
6519 | 14 | NULL, 0x0, NULL, HFILL } |
6520 | 14 | }, |
6521 | 14 | { &hf_cisco_aci_apicuuid, |
6522 | 14 | { "APIC UUID", "lldp.cisco.apicuuid", FT_STRING, BASE_NONE, |
6523 | 14 | NULL, 0x0, NULL, HFILL } |
6524 | 14 | }, |
6525 | 14 | { &hf_cisco_aci_nodeip, |
6526 | 14 | { "Node IP", "lldp.cisco.nodeip", FT_IPv4, BASE_NONE, |
6527 | 14 | NULL, 0x0, NULL, HFILL } |
6528 | 14 | }, |
6529 | 14 | { &hf_cisco_aci_portrole, |
6530 | 14 | { "Port Role", "lldp.cisco.portrole", FT_UINT8, BASE_NONE, |
6531 | 14 | VALS(cisco_portrole_vals), 0x0, NULL, HFILL } |
6532 | 14 | }, |
6533 | 14 | { &hf_cisco_aci_version, |
6534 | 14 | { "Version", "lldp.cisco.version", FT_STRING, BASE_NONE, |
6535 | 14 | NULL, 0x0, NULL, HFILL } |
6536 | 14 | }, |
6537 | 14 | { &hf_cisco_aci_fabricvlan, |
6538 | 14 | { "Fabric VLAN", "lldp.cisco.fabricvlan", FT_UINT16, BASE_DEC, |
6539 | 14 | NULL, 0x0, NULL, HFILL } |
6540 | 14 | }, |
6541 | 14 | { &hf_cisco_aci_serialno, |
6542 | 14 | { "Serial No", "lldp.cisco.serialno", FT_STRING, BASE_NONE, |
6543 | 14 | NULL, 0x0, NULL, HFILL } |
6544 | 14 | }, |
6545 | 14 | { &hf_cisco_aci_model, |
6546 | 14 | { "Model", "lldp.cisco.model", FT_STRING, BASE_NONE, |
6547 | 14 | NULL, 0x0, NULL, HFILL } |
6548 | 14 | }, |
6549 | 14 | { &hf_cisco_aci_nodename, |
6550 | 14 | { "Node Name", "lldp.cisco.nodename", FT_STRING, BASE_NONE, |
6551 | 14 | NULL, 0x0, NULL, HFILL } |
6552 | 14 | }, |
6553 | 14 | { &hf_cisco_aci_portmode, |
6554 | 14 | { "Port Mode", "lldp.cisco.portmode", FT_UINT8, BASE_NONE, |
6555 | 14 | VALS(cisco_portmode_vals), 0x0, NULL, HFILL } |
6556 | 14 | }, |
6557 | 14 | { &hf_cisco_aci_authcookie, |
6558 | 14 | { "Authentication Cookie", "lldp.cisco.authcookie", FT_BYTES, BASE_NONE, |
6559 | 14 | NULL, 0x0, NULL, HFILL } |
6560 | 14 | }, |
6561 | 14 | { &hf_cisco_aci_apicmode, |
6562 | 14 | { "APIC Mode", "lldp.cisco.apicmode", FT_UINT8, BASE_DEC, |
6563 | 14 | VALS(cisco_apicmode_vals), 0x0, NULL, HFILL } |
6564 | 14 | }, |
6565 | 14 | { &hf_cisco_aci_fabricid, |
6566 | 14 | { "Fabric ID", "lldp.cisco.fabricd", FT_UINT16, BASE_DEC, |
6567 | 14 | NULL, 0x0, NULL, HFILL } |
6568 | 14 | }, |
6569 | | /* Hytec */ |
6570 | 14 | { &hf_hytec_tlv_subtype, |
6571 | 14 | { "Hytec Subtype", "lldp.hytec.tlv_subtype", FT_UINT8, BASE_DEC, |
6572 | 14 | VALS(hytec_subtypes), 0x0, NULL, HFILL } |
6573 | 14 | }, |
6574 | 14 | { &hf_hytec_group, |
6575 | 14 | { "Group", "lldp.hytec.group", FT_UINT8, BASE_DEC, |
6576 | 14 | NULL, HYTEC_GROUP_MASK, NULL, HFILL } |
6577 | 14 | }, |
6578 | 14 | { &hf_hytec_identifier, |
6579 | 14 | { "Identifier", "lldp.hytec.identifier", FT_UINT8, BASE_DEC, |
6580 | 14 | NULL, HYTEC_IDENTIFIER_MASK, NULL, HFILL } |
6581 | 14 | }, |
6582 | 14 | { &hf_hytec_transceiver_vendor_product_revision, |
6583 | 14 | { HYTEC_TID__VENDOR_PRODUCT_REVISION_STR, "lldp.hytec.transceiver_vendor_product_revision", FT_STRING, BASE_NONE, |
6584 | 14 | NULL, 0x0, NULL, HFILL } |
6585 | 14 | }, |
6586 | 14 | { &hf_hytec_single_mode, |
6587 | 14 | { HYTEC_TBD__SINGLE_MODE_STR, "lldp.hytec.single_mode", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, |
6588 | 14 | UNS(&units_meters), 0x0, NULL, HFILL} |
6589 | 14 | }, |
6590 | 14 | { &hf_hytec_multi_mode_50, |
6591 | 14 | { HYTEC_TBD__MULTI_MODE_50_STR, "lldp.hytec.multi_mode_50", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, |
6592 | 14 | UNS(&units_meters), 0x0, NULL, HFILL} |
6593 | 14 | }, |
6594 | 14 | { &hf_hytec_multi_mode_62_5, |
6595 | 14 | { HYTEC_TBD__MULTI_MODE_62_5_STR, "lldp.hytec.multi_mode_62_5", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, |
6596 | 14 | UNS(&units_meters), 0x0, NULL, HFILL} |
6597 | 14 | }, |
6598 | 14 | { &hf_hytec_tx_current_output_power, |
6599 | 14 | { HYTEC_MD__TX_CURRENT_OUTPUT_POWER_STR, "lldp.hytec.tx_current_output_power", FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, |
6600 | 14 | UNS(&units_microwatt), 0x0, NULL, HFILL} |
6601 | 14 | }, |
6602 | 14 | { &hf_hytec_rx_current_input_power, |
6603 | 14 | { HYTEC_MD__RX_CURRENT_INPUT_POWER_STR, "lldp.hytec.rx_current_input_power", FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, |
6604 | 14 | UNS(&units_microwatt), 0x0, NULL, HFILL} |
6605 | 14 | }, |
6606 | 14 | { &hf_hytec_rx_input_snr, |
6607 | 14 | { HYTEC_MD__RX_INPUT_SNR_STR, "lldp.hytec.rx_input_snr", FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, |
6608 | 14 | UNS(&units_decibels), 0x0, NULL, HFILL} |
6609 | 14 | }, |
6610 | 14 | { &hf_hytec_lineloss, |
6611 | 14 | { HYTEC_MD__LINELOSS_STR, "lldp.hytec.lineloss", FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, |
6612 | 14 | UNS(&units_decibels), 0x0, NULL, HFILL} |
6613 | 14 | }, |
6614 | 14 | { &hf_hytec_mac_trace_request, |
6615 | 14 | { HYTEC_MC__MAC_TRACE_REQUEST_STR, "lldp.hytec.mac_trace_request", FT_NONE, BASE_NONE, |
6616 | 14 | NULL, 0x0, NULL, HFILL} |
6617 | 14 | }, |
6618 | 14 | { &hf_hytec_trace_mac_address, |
6619 | 14 | { "Trace MAC address", "lldp.hytec.trace_mac_address", FT_ETHER, BASE_NONE, |
6620 | 14 | NULL, 0x0, NULL, HFILL} |
6621 | 14 | }, |
6622 | 14 | { &hf_hytec_request_mac_address, |
6623 | 14 | { "Requester's MAC address", "lldp.hytec.requesters_mac_address", FT_ETHER, BASE_NONE, |
6624 | 14 | NULL, 0x0, NULL, HFILL} |
6625 | 14 | }, |
6626 | 14 | { &hf_hytec_maximum_depth, |
6627 | 14 | { "Maximum depth", "lldp.hytec.maximum_depth", FT_UINT8, BASE_DEC, |
6628 | 14 | NULL, 0x0, NULL, HFILL} |
6629 | 14 | }, |
6630 | 14 | { &hf_hytec_mac_trace_reply, |
6631 | 14 | { HYTEC_MC__MAC_TRACE_REPLY_STR, "lldp.hytec.mac_trace_reply", FT_NONE, BASE_NONE, |
6632 | 14 | NULL, 0x0, NULL, HFILL} |
6633 | 14 | }, |
6634 | 14 | { &hf_hytec_answering_mac_address, |
6635 | 14 | { "Answering MAC address", "lldp.hytec.answering_mac_address", FT_ETHER, BASE_NONE, |
6636 | 14 | NULL, 0x0, NULL, HFILL} |
6637 | 14 | }, |
6638 | 14 | { &hf_hytec_actual_depth, |
6639 | 14 | { "Actual depth", "lldp.hytec.actual_depth", FT_UINT8, BASE_DEC, |
6640 | 14 | NULL, 0x0, NULL, HFILL} |
6641 | 14 | }, |
6642 | 14 | { &hf_hytec_name_of_replying_device, |
6643 | 14 | { HYTEC_MC__NAME_OF_REPLYING_DEVICE_STR, "lldp.hytec.name_of_replying_device", FT_STRING, BASE_NONE, |
6644 | 14 | NULL, 0x0, NULL, HFILL} |
6645 | 14 | }, |
6646 | 14 | { &hf_hytec_outgoing_port_name, |
6647 | 14 | { HYTEC_MC__OUTGOING_PORT_NAME_STR, "lldp.hytec.outgoing_port_name", FT_STRING, BASE_NONE, |
6648 | 14 | NULL, 0x0, NULL, HFILL} |
6649 | 14 | }, |
6650 | 14 | { &hf_hytec_ipv4_address_of_replying_device, |
6651 | 14 | { HYTEC_MC__IPV4_ADDRESS_OF_REPLYING_DEVICE_STR, "lldp.hytec.ipv4_address_of_replying_device", FT_IPv4, BASE_NONE, |
6652 | 14 | NULL, 0x0, NULL, HFILL} |
6653 | 14 | }, |
6654 | 14 | { &hf_hytec_end_of_trace, |
6655 | 14 | { HYTEC_MC__END_OF_TRACE_STR, "lldp.hytec.end_of_trace", FT_UINT8, BASE_HEX, |
6656 | 14 | NULL, 0x0, NULL, HFILL} |
6657 | 14 | }, |
6658 | 14 | { &hf_hytec_ipv6_address_of_replying_device, |
6659 | 14 | { HYTEC_MC__IPV6_ADDRESS_OF_REPLYING_DEVICE_STR, "lldp.hytec.ipv6_address_of_replying_device", FT_IPv6, BASE_NONE, |
6660 | 14 | NULL, 0x0, NULL, HFILL} |
6661 | 14 | }, |
6662 | 14 | { &hf_hytec_incoming_port_name, |
6663 | 14 | { HYTEC_MC__INCOMING_PORT_NAME_STR, "lldp.hytec.incoming_port_name", FT_STRING, BASE_NONE, |
6664 | 14 | NULL, 0x0, NULL, HFILL} |
6665 | 14 | }, |
6666 | 14 | { &hf_hytec_trace_identifier, |
6667 | 14 | { HYTEC_MC__TRACE_IDENTIFIER_STR, "lldp.hytec.trace_identifier", FT_UINT32, BASE_HEX, |
6668 | 14 | NULL, 0x0, NULL, HFILL} |
6669 | 14 | }, |
6670 | 14 | { &hf_hytec_invalid_object_data, |
6671 | 14 | { "Invalid object data", "lldp.hytec.invalid_object_data", FT_BYTES, BASE_NONE, |
6672 | 14 | NULL, 0x0, NULL, HFILL } |
6673 | 14 | }, |
6674 | 14 | { &hf_hytec_unknown_identifier_content, |
6675 | 14 | { "Unknown Identifier Content","lldp.hytec.unknown_identifier_content", FT_BYTES, BASE_NONE, |
6676 | 14 | NULL, 0x0, NULL, HFILL } |
6677 | 14 | }, |
6678 | 14 | { &hf_avaya_subtype, |
6679 | 14 | { "Avaya Subtype", "lldp.avaya.subtype", FT_UINT8, BASE_HEX, |
6680 | 14 | VALS(avaya_subtypes), 0x0, NULL, HFILL } |
6681 | 14 | }, |
6682 | 14 | { &hf_avaya_poe, |
6683 | 14 | { "PoE Conservation Level Support", "lldp.avaya.poe", FT_BYTES, BASE_NONE, |
6684 | 14 | NULL, 0x0, NULL, HFILL } |
6685 | 14 | }, |
6686 | 14 | { &hf_avaya_call_server, |
6687 | 14 | { "Call Server IP Address", "lldp.avaya.callserver", FT_IPv4, BASE_NONE, |
6688 | 14 | NULL, 0x0, NULL, HFILL } |
6689 | 14 | }, |
6690 | 14 | { &hf_avaya_cna_server, |
6691 | 14 | { "CNA Server IP Address", "lldp.avaya.cnaserver", FT_IPv4, BASE_NONE, |
6692 | 14 | NULL, 0x0, NULL, HFILL } |
6693 | 14 | }, |
6694 | 14 | { &hf_avaya_file_server, |
6695 | 14 | { "File Server", "lldp.avaya.fileserver", FT_IPv4, BASE_NONE, |
6696 | 14 | NULL, 0x0, NULL, HFILL } |
6697 | 14 | }, |
6698 | 14 | { &hf_avaya_dot1q, |
6699 | 14 | { "802.1Q Framing", "lldp.avaya.dot1q", FT_UINT8, BASE_HEX, |
6700 | 14 | VALS(avaya_dot1q_subtypes), 0x0, NULL, HFILL } |
6701 | 14 | }, |
6702 | 14 | { &hf_avaya_ipphone, |
6703 | 14 | { "IP Phone Addresses", "lldp.avaya.ipphone", FT_BYTES, BASE_NONE, |
6704 | 14 | NULL, 0x0, NULL, HFILL } |
6705 | 14 | }, |
6706 | 14 | { &hf_avaya_ipphone_ip, |
6707 | 14 | { "IP Address", "lldp.avaya.ipphone.ip", FT_IPv4, BASE_NONE, |
6708 | 14 | NULL, 0x0, NULL, HFILL } |
6709 | 14 | }, |
6710 | 14 | { &hf_avaya_ipphone_mask, |
6711 | 14 | { "Subnet Mask", "lldp.avaya.ipphone.mask", FT_IPv4, BASE_NONE, |
6712 | 14 | NULL, 0x0, NULL, HFILL } |
6713 | 14 | }, |
6714 | 14 | { &hf_avaya_ipphone_gateway, |
6715 | 14 | { "Gateway IP", "lldp.avaya.ipphone.gateway", FT_IPv4, BASE_NONE, |
6716 | 14 | NULL, 0x0, NULL, HFILL } |
6717 | 14 | }, |
6718 | 14 | { &hf_iana_subtype, |
6719 | 14 | { "IANA Subtype", "lldp.iana.subtype", FT_UINT8, BASE_HEX, |
6720 | 14 | VALS(iana_subtypes), 0x0, NULL, HFILL } |
6721 | 14 | }, |
6722 | 14 | { &hf_iana_mudurl, |
6723 | 14 | { "Manufacturer Usage Description URL", "lldp.iana.mudurl", FT_STRING, BASE_NONE, |
6724 | 14 | NULL, 0x0, NULL, HFILL } |
6725 | 14 | }, |
6726 | 14 | { &hf_onos_subtype, |
6727 | 14 | { "ONOS Subtype", "lldp.onos.subtype", FT_UINT8, BASE_HEX, |
6728 | 14 | VALS(onos_subtypes), 0x0, NULL, HFILL } |
6729 | 14 | }, |
6730 | 14 | { &hf_onos_chassis, |
6731 | 14 | { "Chassis", "lldp.onos.chassis", FT_STRING, BASE_NONE, |
6732 | 14 | NULL, 0x0, NULL, HFILL } |
6733 | 14 | }, |
6734 | 14 | { &hf_onos_port, |
6735 | 14 | { "Port", "lldp.onos.port", FT_STRING, BASE_NONE, |
6736 | 14 | NULL, 0x0, NULL, HFILL } |
6737 | 14 | }, |
6738 | 14 | { &hf_onos_ttl, |
6739 | 14 | { "ttl", "lldp.onos.ttl", FT_UINT32, BASE_DEC, |
6740 | 14 | NULL, 0x0, NULL, HFILL } |
6741 | 14 | }, |
6742 | 14 | { &hf_unknown_subtype, |
6743 | 14 | { "Unknown Subtype","lldp.unknown_subtype", FT_UINT8, BASE_DEC, |
6744 | 14 | NULL, 0x0, NULL, HFILL } |
6745 | 14 | }, |
6746 | 14 | { &hf_unknown_subtype_content, |
6747 | 14 | { "Unknown Subtype Content","lldp.unknown_subtype.content", FT_BYTES, BASE_NONE, |
6748 | 14 | NULL, 0x0, NULL, HFILL } |
6749 | 14 | }, |
6750 | 14 | { &hf_subtype_content_remaining, |
6751 | 14 | { "Subtype Unknown Trailing Bytes","lldp.subtype.content_remaining", FT_BYTES, BASE_NONE, |
6752 | 14 | NULL, 0x0, NULL, HFILL } |
6753 | 14 | }, |
6754 | 14 | { &hf_ex_avaya_tlv_subtype, |
6755 | 14 | { "Subtype", "lldp.extreme_avaya_ap.subtype", FT_UINT8, BASE_DEC, |
6756 | 14 | VALS(ex_avaya_subtypes), 0x0, NULL, HFILL } |
6757 | 14 | }, |
6758 | 14 | { &hf_ex_avaya_hmac_shi, |
6759 | 14 | { "HMAC-SHA Digest", "lldp.extreme_avaya_ap.hmac_sha_digest", FT_BYTES, BASE_NONE, |
6760 | 14 | NULL, 0x0, NULL, HFILL } |
6761 | 14 | }, |
6762 | 14 | { &hf_ex_avaya_element_type, |
6763 | 14 | { "Element Type", "lldp.extreme_avaya_ap.element_type", FT_UINT24, BASE_DEC, |
6764 | 14 | NULL, 0xfc0000, NULL, HFILL } |
6765 | 14 | }, |
6766 | 14 | { &hf_ex_avaya_state, |
6767 | 14 | { "State", "lldp.extreme_avaya_ap.state", FT_UINT24, BASE_DEC, |
6768 | 14 | NULL, 0x03f000, NULL, HFILL } |
6769 | 14 | }, |
6770 | 14 | { &hf_ex_avaya_mgnt_vlan, |
6771 | 14 | { "Mgmt VLAN", "lldp.extreme_avaya_ap.mgnt_vlan", FT_UINT24, BASE_DEC, |
6772 | 14 | NULL, 0x000fff, NULL, HFILL } |
6773 | 14 | }, |
6774 | 14 | { &hf_ex_avaya_vlan, |
6775 | 14 | { "VLAN", "lldp.extreme_avaya_ap.vlan", FT_UINT16, BASE_DEC, |
6776 | 14 | NULL, 0x0fff, NULL, HFILL } |
6777 | 14 | }, |
6778 | 14 | { &hf_ex_avaya_rsvd, |
6779 | 14 | { "Reserved", "lldp.extreme_avaya_ap.rsvd", FT_UINT8, BASE_DEC, |
6780 | 14 | NULL, 0x0, NULL, HFILL } |
6781 | 14 | }, |
6782 | 14 | { &hf_ex_avaya_system_id, |
6783 | 14 | { "System ID", "lldp.extreme_avaya_ap.system_id", FT_BYTES, SEP_COLON, |
6784 | 14 | NULL, 0x0, NULL, HFILL } |
6785 | 14 | }, |
6786 | 14 | { &hf_ex_avaya_status, |
6787 | 14 | { "Assignment Status", "lldp.extreme_avaya_ap.status", FT_UINT16, BASE_DEC, |
6788 | 14 | NULL, 0xf000, NULL, HFILL } |
6789 | 14 | }, |
6790 | 14 | { &hf_ex_avaya_i_sid, |
6791 | 14 | { "I-SID", "lldp.extreme_avaya_ap.i_sid", FT_UINT24, BASE_DEC, |
6792 | 14 | NULL, 0x0, NULL, HFILL } |
6793 | 14 | }, |
6794 | 14 | { &hf_ex_avaya2_tlv_subtype, |
6795 | 14 | { "Subtype", "lldp.extreme_avaya.fabric.subtype", FT_UINT8, BASE_DEC, |
6796 | 14 | VALS(ex_avaya2_subtypes), 0x0, NULL, HFILL } |
6797 | 14 | }, |
6798 | 14 | { &hf_ex_avaya2_fabric_connect, |
6799 | 14 | { "FC Capability", "lldp.extreme_avaya.fabric.fabric_connect", FT_BOOLEAN, BASE_NONE, |
6800 | 14 | TFS(&tfs_enabled_disabled), 0x0, "Fabric Connect aka auto-sense", HFILL } |
6801 | 14 | }, |
6802 | 14 | { &hf_ex_avaya2_fabric_numbvlans, |
6803 | 14 | { "Number B-VLANs", "lldp.extreme_avaya.fabric.numbvlans", FT_UINT8, BASE_DEC, |
6804 | 14 | NULL, 0x0, NULL, HFILL } |
6805 | 14 | }, |
6806 | 14 | { &hf_ex_avaya2_fabric_bvlanid, |
6807 | 14 | { "B-VLAN ID", "lldp.extreme_avaya.fabric.bvlanid", FT_UINT16, BASE_DEC, |
6808 | 14 | NULL, 0x0, NULL, HFILL } |
6809 | 14 | }, |
6810 | 14 | { &hf_ex_avaya2_fabric_sysidlength, |
6811 | 14 | { "SysID Length", "lldp.extreme_avaya.fabric.sysidlength", FT_UINT8, BASE_DEC, |
6812 | 14 | NULL, 0x0, NULL, HFILL } |
6813 | 14 | }, |
6814 | 14 | { &hf_ex_avaya2_fabric_sysid, |
6815 | 14 | { "System ID", "lldp.extreme_avaya.fabric.sysid", FT_SYSTEM_ID, BASE_NONE, |
6816 | 14 | NULL, 0x0, NULL, HFILL } |
6817 | 14 | }, |
6818 | 14 | }; |
6819 | | |
6820 | | /* Setup protocol subtree array */ |
6821 | 14 | static int *ett[] = { |
6822 | 14 | &ett_lldp, |
6823 | 14 | &ett_chassis_id, |
6824 | 14 | &ett_port_id, |
6825 | 14 | &ett_time_to_live, |
6826 | 14 | &ett_end_of_lldpdu, |
6827 | 14 | &ett_port_description, |
6828 | 14 | &ett_system_name, |
6829 | 14 | &ett_system_desc, |
6830 | 14 | &ett_system_cap, |
6831 | 14 | &ett_system_cap_summary, |
6832 | 14 | &ett_system_cap_enabled, |
6833 | 14 | &ett_management_address, |
6834 | 14 | &ett_unknown_tlv, |
6835 | 14 | &ett_org_spc_tlv, |
6836 | 14 | &ett_org_spc_def, |
6837 | 14 | &ett_org_spc_dcbx_cin, |
6838 | 14 | &ett_org_spc_dcbx_cee, |
6839 | 14 | &ett_org_spc_dcbx_cee_1, |
6840 | 14 | &ett_org_spc_dcbx_cee_2, |
6841 | 14 | &ett_org_spc_dcbx_cee_3, |
6842 | 14 | &ett_org_spc_dcbx_cee_4, |
6843 | 14 | &ett_org_spc_dcbx_cin_6, |
6844 | 14 | &ett_org_spc_dcbx_cee_app, |
6845 | 14 | &ett_org_spc_ieee_802_1_1, |
6846 | 14 | &ett_org_spc_ieee_802_1_2, |
6847 | 14 | &ett_org_spc_ieee_802_1_3, |
6848 | 14 | &ett_org_spc_ieee_802_1_4, |
6849 | 14 | &ett_org_spc_ieee_802_1_8, |
6850 | 14 | &ett_org_spc_ieee_802_1_9, |
6851 | 14 | &ett_org_spc_ieee_802_1_a, |
6852 | 14 | &ett_org_spc_ieee_802_1_b, |
6853 | 14 | &ett_org_spc_ieee_802_1_c, |
6854 | 14 | &ett_org_spc_ieee_dcbx_app, |
6855 | 14 | &ett_org_spc_ieee_802_3_1, |
6856 | 14 | &ett_org_spc_ieee_802_3_2, |
6857 | 14 | &ett_org_spc_ieee_802_3_3, |
6858 | 14 | &ett_org_spc_ieee_802_3_4, |
6859 | 14 | &ett_org_spc_ieee_802_3_5, |
6860 | 14 | &ett_org_spc_ieee_802_3_7, |
6861 | 14 | &ett_org_spc_media_1, |
6862 | 14 | &ett_org_spc_media_2, |
6863 | 14 | &ett_org_spc_media_3, |
6864 | 14 | &ett_org_spc_media_4, |
6865 | 14 | &ett_org_spc_media_5, |
6866 | 14 | &ett_org_spc_media_6, |
6867 | 14 | &ett_org_spc_media_7, |
6868 | 14 | &ett_org_spc_media_8, |
6869 | 14 | &ett_org_spc_media_9, |
6870 | 14 | &ett_org_spc_media_10, |
6871 | 14 | &ett_org_spc_media_11, |
6872 | 14 | &ett_org_spc_ProfinetSubTypes_1, |
6873 | 14 | &ett_org_spc_ProfinetSubTypes_2, |
6874 | 14 | &ett_org_spc_ProfinetSubTypes_3, |
6875 | 14 | &ett_org_spc_ProfinetSubTypes_4, |
6876 | 14 | &ett_org_spc_ProfinetSubTypes_5, |
6877 | 14 | &ett_org_spc_ProfinetSubTypes_6, |
6878 | 14 | &ett_port_vlan_flags, |
6879 | 14 | &ett_802_3_flags, |
6880 | 14 | &ett_802_3_autoneg_advertised, |
6881 | 14 | &ett_802_3_power, |
6882 | 14 | &ett_802_3_bt_power, |
6883 | 14 | &ett_802_3_bt_system_setup, |
6884 | 14 | &ett_802_3_bt_autoclass, |
6885 | 14 | &ett_802_3_bt_power_down, |
6886 | 14 | &ett_802_3_aggregation, |
6887 | 14 | &ett_802_1_aggregation, |
6888 | 14 | &ett_802_1qbg_capabilities_flags, |
6889 | 14 | &ett_802_3br_capabilities_flags, |
6890 | 14 | &ett_media_capabilities, |
6891 | 14 | &ett_profinet_period, |
6892 | 14 | &ett_cisco_upoe_tlv, |
6893 | 14 | &ett_avaya_ipphone_tlv, |
6894 | 14 | &ett_org_spc_hytec_subtype_transceiver, |
6895 | 14 | &ett_org_spc_hytec_subtype_trace, |
6896 | 14 | &ett_org_spc_hytec_trace_request, |
6897 | 14 | &ett_org_spc_hytec_trace_reply, |
6898 | 14 | &ett_ex_avayaSubTypes_11, |
6899 | 14 | &ett_ex_avayaSubTypes_12, |
6900 | 14 | &ett_ex_avaya2SubTypes_4 |
6901 | 14 | }; |
6902 | | |
6903 | 14 | static ei_register_info ei[] = { |
6904 | 14 | { &ei_lldp_bad_length, { "lldp.incorrect_length", PI_MALFORMED, PI_WARN, "Invalid length, too short", EXPFILL }}, |
6905 | 14 | { &ei_lldp_bad_length_excess, { "lldp.excess_length", PI_MALFORMED, PI_WARN, "Invalid length, greater than expected", EXPFILL }}, |
6906 | 14 | { &ei_lldp_shutdown_excess_tlv, { "lldp.excess_tlv", PI_MALFORMED, PI_WARN, "Excess TLV in Shutdown PDU", EXPFILL }}, |
6907 | 14 | { &ei_lldp_bad_type, { "lldp.bad_type", PI_MALFORMED, PI_WARN, "Incorrect type", EXPFILL }}, |
6908 | 14 | { &ei_lldp_tlv_deprecated, { "lldp.tlv_deprecated", PI_PROTOCOL, PI_WARN, "TLV has been deprecated", EXPFILL }}, |
6909 | 14 | }; |
6910 | | |
6911 | 14 | static const enum_val_t column_info_options[] = { |
6912 | 14 | { "default_column_info", "Default Column Info", DEFAULT_COLUMN_INFO }, |
6913 | 14 | { "profinet_special_column_info", "PROFINET Special Column Info", PROFINET_SPECIAL_COLUMN_INFO }, |
6914 | 14 | { NULL, NULL, 0 } |
6915 | 14 | }; |
6916 | | |
6917 | | /* Register the protocol name and description */ |
6918 | 14 | proto_lldp = proto_register_protocol("Link Layer Discovery Protocol", "LLDP", "lldp"); |
6919 | 14 | lldp_handle = register_dissector("lldp", dissect_lldp, proto_lldp); |
6920 | | |
6921 | | /* Register preferences */ |
6922 | 14 | lldp_module = prefs_register_protocol(proto_lldp, NULL); |
6923 | | |
6924 | 14 | prefs_register_enum_preference(lldp_module, |
6925 | 14 | "column_info_selection", |
6926 | 14 | "Select Column Info Display Style", |
6927 | 14 | "Which Information will be showed at Column Information is decided by the selection", |
6928 | 14 | &column_info_selection, |
6929 | 14 | column_info_options, |
6930 | 14 | false); |
6931 | | |
6932 | 14 | prefs_register_bool_preference(lldp_module, |
6933 | 14 | "assume_unrecognized_tlv", |
6934 | 14 | "Assume unrecognized TLV", |
6935 | 14 | "If checked, assume an unrecognized TLV type should be consumed and treated as an LLDP TLV. Otherwise, end LLDP dissection.", |
6936 | 14 | &assume_unrecognized_tlv); |
6937 | | |
6938 | | /* Required function calls to register the header fields and subtrees used */ |
6939 | 14 | proto_register_field_array(proto_lldp, hf, array_length(hf)); |
6940 | 14 | proto_register_subtree_array(ett, array_length(ett)); |
6941 | 14 | oui_unique_code_table = register_dissector_table("lldp.orgtlv.oui", "LLDP OUI", proto_lldp, FT_UINT24, BASE_HEX ); |
6942 | | |
6943 | 14 | expert_lldp = expert_register_protocol(proto_lldp); |
6944 | 14 | expert_register_field_array(expert_lldp, ei, array_length(ei)); |
6945 | 14 | } |
6946 | | |
6947 | | void |
6948 | | proto_reg_handoff_lldp(void) |
6949 | 14 | { |
6950 | 14 | dissector_add_uint("ethertype", ETHERTYPE_LLDP, lldp_handle); |
6951 | 14 | dissector_add_uint("ethertype", ETHERTYPE_ONOS, lldp_handle); |
6952 | 14 | } |
6953 | | |
6954 | | /* |
6955 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
6956 | | * |
6957 | | * Local variables: |
6958 | | * c-basic-offset: 8 |
6959 | | * tab-width: 8 |
6960 | | * indent-tabs-mode: t |
6961 | | * End: |
6962 | | * |
6963 | | * vi: set shiftwidth=8 tabstop=8 noexpandtab: |
6964 | | * :indentSize=8:tabSize=8:noTabs=false: |
6965 | | */ |