2 * Copyright (c) 1998-2007 The TCPDUMP project
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that: (1) source code
6 * distributions retain the above copyright notice and this paragraph
7 * in its entirety, and (2) distributions including binary code include
8 * the above copyright notice and this paragraph in its entirety in
9 * the documentation or other materials provided with the distribution.
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
11 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
12 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13 * FOR A PARTICULAR PURPOSE.
15 * Original code by Hannes Gredler (hannes@gredler.at)
16 * IEEE and TIA extensions by Carles Kishimoto <carles.kishimoto@gmail.com>
17 * DCBX extensions by Kaladhar Musunuru <kaladharm@sourceforge.net>
20 /* \summary: IEEE 802.1ab Link Layer Discovery Protocol (LLDP) printer */
26 #include <netdissect-stdinc.h>
30 #include "netdissect.h"
32 #include "addrtoname.h"
36 #define LLDP_EXTRACT_TYPE(x) (((x)&0xfe00)>>9)
37 #define LLDP_EXTRACT_LEN(x) ((x)&0x01ff)
42 #define LLDP_END_TLV 0
43 #define LLDP_CHASSIS_ID_TLV 1
44 #define LLDP_PORT_ID_TLV 2
45 #define LLDP_TTL_TLV 3
46 #define LLDP_PORT_DESCR_TLV 4
47 #define LLDP_SYSTEM_NAME_TLV 5
48 #define LLDP_SYSTEM_DESCR_TLV 6
49 #define LLDP_SYSTEM_CAP_TLV 7
50 #define LLDP_MGMT_ADDR_TLV 8
51 #define LLDP_PRIVATE_TLV 127
53 static const struct tok lldp_tlv_values
[] = {
54 { LLDP_END_TLV
, "End" },
55 { LLDP_CHASSIS_ID_TLV
, "Chassis ID" },
56 { LLDP_PORT_ID_TLV
, "Port ID" },
57 { LLDP_TTL_TLV
, "Time to Live" },
58 { LLDP_PORT_DESCR_TLV
, "Port Description" },
59 { LLDP_SYSTEM_NAME_TLV
, "System Name" },
60 { LLDP_SYSTEM_DESCR_TLV
, "System Description" },
61 { LLDP_SYSTEM_CAP_TLV
, "System Capabilities" },
62 { LLDP_MGMT_ADDR_TLV
, "Management Address" },
63 { LLDP_PRIVATE_TLV
, "Organization specific" },
70 #define LLDP_CHASSIS_CHASSIS_COMP_SUBTYPE 1
71 #define LLDP_CHASSIS_INTF_ALIAS_SUBTYPE 2
72 #define LLDP_CHASSIS_PORT_COMP_SUBTYPE 3
73 #define LLDP_CHASSIS_MAC_ADDR_SUBTYPE 4
74 #define LLDP_CHASSIS_NETWORK_ADDR_SUBTYPE 5
75 #define LLDP_CHASSIS_INTF_NAME_SUBTYPE 6
76 #define LLDP_CHASSIS_LOCAL_SUBTYPE 7
78 static const struct tok lldp_chassis_subtype_values
[] = {
79 { LLDP_CHASSIS_CHASSIS_COMP_SUBTYPE
, "Chassis component"},
80 { LLDP_CHASSIS_INTF_ALIAS_SUBTYPE
, "Interface alias"},
81 { LLDP_CHASSIS_PORT_COMP_SUBTYPE
, "Port component"},
82 { LLDP_CHASSIS_MAC_ADDR_SUBTYPE
, "MAC address"},
83 { LLDP_CHASSIS_NETWORK_ADDR_SUBTYPE
, "Network address"},
84 { LLDP_CHASSIS_INTF_NAME_SUBTYPE
, "Interface name"},
85 { LLDP_CHASSIS_LOCAL_SUBTYPE
, "Local"},
92 #define LLDP_PORT_INTF_ALIAS_SUBTYPE 1
93 #define LLDP_PORT_PORT_COMP_SUBTYPE 2
94 #define LLDP_PORT_MAC_ADDR_SUBTYPE 3
95 #define LLDP_PORT_NETWORK_ADDR_SUBTYPE 4
96 #define LLDP_PORT_INTF_NAME_SUBTYPE 5
97 #define LLDP_PORT_AGENT_CIRC_ID_SUBTYPE 6
98 #define LLDP_PORT_LOCAL_SUBTYPE 7
100 static const struct tok lldp_port_subtype_values
[] = {
101 { LLDP_PORT_INTF_ALIAS_SUBTYPE
, "Interface alias"},
102 { LLDP_PORT_PORT_COMP_SUBTYPE
, "Port component"},
103 { LLDP_PORT_MAC_ADDR_SUBTYPE
, "MAC address"},
104 { LLDP_PORT_NETWORK_ADDR_SUBTYPE
, "Network Address"},
105 { LLDP_PORT_INTF_NAME_SUBTYPE
, "Interface Name"},
106 { LLDP_PORT_AGENT_CIRC_ID_SUBTYPE
, "Agent circuit ID"},
107 { LLDP_PORT_LOCAL_SUBTYPE
, "Local"},
112 * System Capabilities
114 #define LLDP_CAP_OTHER (1 << 0)
115 #define LLDP_CAP_REPEATER (1 << 1)
116 #define LLDP_CAP_BRIDGE (1 << 2)
117 #define LLDP_CAP_WLAN_AP (1 << 3)
118 #define LLDP_CAP_ROUTER (1 << 4)
119 #define LLDP_CAP_PHONE (1 << 5)
120 #define LLDP_CAP_DOCSIS (1 << 6)
121 #define LLDP_CAP_STATION_ONLY (1 << 7)
123 static const struct tok lldp_cap_values
[] = {
124 { LLDP_CAP_OTHER
, "Other"},
125 { LLDP_CAP_REPEATER
, "Repeater"},
126 { LLDP_CAP_BRIDGE
, "Bridge"},
127 { LLDP_CAP_WLAN_AP
, "WLAN AP"},
128 { LLDP_CAP_ROUTER
, "Router"},
129 { LLDP_CAP_PHONE
, "Telephone"},
130 { LLDP_CAP_DOCSIS
, "Docsis"},
131 { LLDP_CAP_STATION_ONLY
, "Station Only"},
135 #define LLDP_PRIVATE_8021_SUBTYPE_PORT_VLAN_ID 1
136 #define LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_VLAN_ID 2
137 #define LLDP_PRIVATE_8021_SUBTYPE_VLAN_NAME 3
138 #define LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_IDENTITY 4
139 #define LLDP_PRIVATE_8021_SUBTYPE_CONGESTION_NOTIFICATION 8
140 #define LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION 9
141 #define LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION 10
142 #define LLDP_PRIVATE_8021_SUBTYPE_PFC_CONFIGURATION 11
143 #define LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY 12
144 #define LLDP_PRIVATE_8021_SUBTYPE_EVB 13
145 #define LLDP_PRIVATE_8021_SUBTYPE_CDCP 14
147 static const struct tok lldp_8021_subtype_values
[] = {
148 { LLDP_PRIVATE_8021_SUBTYPE_PORT_VLAN_ID
, "Port VLAN Id"},
149 { LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_VLAN_ID
, "Port and Protocol VLAN ID"},
150 { LLDP_PRIVATE_8021_SUBTYPE_VLAN_NAME
, "VLAN name"},
151 { LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_IDENTITY
, "Protocol Identity"},
152 { LLDP_PRIVATE_8021_SUBTYPE_CONGESTION_NOTIFICATION
, "Congestion Notification"},
153 { LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION
, "ETS Configuration"},
154 { LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION
, "ETS Recommendation"},
155 { LLDP_PRIVATE_8021_SUBTYPE_PFC_CONFIGURATION
, "Priority Flow Control Configuration"},
156 { LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY
, "Application Priority"},
157 { LLDP_PRIVATE_8021_SUBTYPE_EVB
, "EVB"},
158 { LLDP_PRIVATE_8021_SUBTYPE_CDCP
,"CDCP"},
162 #define LLDP_8021_PORT_PROTOCOL_VLAN_SUPPORT (1 << 1)
163 #define LLDP_8021_PORT_PROTOCOL_VLAN_STATUS (1 << 2)
165 static const struct tok lldp_8021_port_protocol_id_values
[] = {
166 { LLDP_8021_PORT_PROTOCOL_VLAN_SUPPORT
, "supported"},
167 { LLDP_8021_PORT_PROTOCOL_VLAN_STATUS
, "enabled"},
171 #define LLDP_PRIVATE_8023_SUBTYPE_MACPHY 1
172 #define LLDP_PRIVATE_8023_SUBTYPE_MDIPOWER 2
173 #define LLDP_PRIVATE_8023_SUBTYPE_LINKAGGR 3
174 #define LLDP_PRIVATE_8023_SUBTYPE_MTU 4
176 static const struct tok lldp_8023_subtype_values
[] = {
177 { LLDP_PRIVATE_8023_SUBTYPE_MACPHY
, "MAC/PHY configuration/status"},
178 { LLDP_PRIVATE_8023_SUBTYPE_MDIPOWER
, "Power via MDI"},
179 { LLDP_PRIVATE_8023_SUBTYPE_LINKAGGR
, "Link aggregation"},
180 { LLDP_PRIVATE_8023_SUBTYPE_MTU
, "Max frame size"},
184 #define LLDP_PRIVATE_TIA_SUBTYPE_CAPABILITIES 1
185 #define LLDP_PRIVATE_TIA_SUBTYPE_NETWORK_POLICY 2
186 #define LLDP_PRIVATE_TIA_SUBTYPE_LOCAL_ID 3
187 #define LLDP_PRIVATE_TIA_SUBTYPE_EXTENDED_POWER_MDI 4
188 #define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_HARDWARE_REV 5
189 #define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_FIRMWARE_REV 6
190 #define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SOFTWARE_REV 7
191 #define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SERIAL_NUMBER 8
192 #define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MANUFACTURER_NAME 9
193 #define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MODEL_NAME 10
194 #define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_ASSET_ID 11
196 static const struct tok lldp_tia_subtype_values
[] = {
197 { LLDP_PRIVATE_TIA_SUBTYPE_CAPABILITIES
, "LLDP-MED Capabilities" },
198 { LLDP_PRIVATE_TIA_SUBTYPE_NETWORK_POLICY
, "Network policy" },
199 { LLDP_PRIVATE_TIA_SUBTYPE_LOCAL_ID
, "Location identification" },
200 { LLDP_PRIVATE_TIA_SUBTYPE_EXTENDED_POWER_MDI
, "Extended power-via-MDI" },
201 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_HARDWARE_REV
, "Inventory - hardware revision" },
202 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_FIRMWARE_REV
, "Inventory - firmware revision" },
203 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SOFTWARE_REV
, "Inventory - software revision" },
204 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SERIAL_NUMBER
, "Inventory - serial number" },
205 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MANUFACTURER_NAME
, "Inventory - manufacturer name" },
206 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MODEL_NAME
, "Inventory - model name" },
207 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_ASSET_ID
, "Inventory - asset ID" },
211 #define LLDP_PRIVATE_TIA_LOCATION_ALTITUDE_METERS 1
212 #define LLDP_PRIVATE_TIA_LOCATION_ALTITUDE_FLOORS 2
214 static const struct tok lldp_tia_location_altitude_type_values
[] = {
215 { LLDP_PRIVATE_TIA_LOCATION_ALTITUDE_METERS
, "meters"},
216 { LLDP_PRIVATE_TIA_LOCATION_ALTITUDE_FLOORS
, "floors"},
220 /* ANSI/TIA-1057 - Annex B */
221 #define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A1 1
222 #define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A2 2
223 #define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A3 3
224 #define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A4 4
225 #define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A5 5
226 #define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A6 6
228 static const struct tok lldp_tia_location_lci_catype_values
[] = {
229 { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A1
, "national subdivisions (state,canton,region,province,prefecture)"},
230 { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A2
, "county, parish, gun, district"},
231 { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A3
, "city, township, shi"},
232 { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A4
, "city division, borough, city district, ward chou"},
233 { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A5
, "neighborhood, block"},
234 { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A6
, "street"},
238 static const struct tok lldp_tia_location_lci_what_values
[] = {
239 { 0, "location of DHCP server"},
240 { 1, "location of the network element believed to be closest to the client"},
241 { 2, "location of the client"},
246 * From RFC 3636 - dot3MauType
248 #define LLDP_MAU_TYPE_UNKNOWN 0
249 #define LLDP_MAU_TYPE_AUI 1
250 #define LLDP_MAU_TYPE_10BASE_5 2
251 #define LLDP_MAU_TYPE_FOIRL 3
252 #define LLDP_MAU_TYPE_10BASE_2 4
253 #define LLDP_MAU_TYPE_10BASE_T 5
254 #define LLDP_MAU_TYPE_10BASE_FP 6
255 #define LLDP_MAU_TYPE_10BASE_FB 7
256 #define LLDP_MAU_TYPE_10BASE_FL 8
257 #define LLDP_MAU_TYPE_10BROAD36 9
258 #define LLDP_MAU_TYPE_10BASE_T_HD 10
259 #define LLDP_MAU_TYPE_10BASE_T_FD 11
260 #define LLDP_MAU_TYPE_10BASE_FL_HD 12
261 #define LLDP_MAU_TYPE_10BASE_FL_FD 13
262 #define LLDP_MAU_TYPE_100BASE_T4 14
263 #define LLDP_MAU_TYPE_100BASE_TX_HD 15
264 #define LLDP_MAU_TYPE_100BASE_TX_FD 16
265 #define LLDP_MAU_TYPE_100BASE_FX_HD 17
266 #define LLDP_MAU_TYPE_100BASE_FX_FD 18
267 #define LLDP_MAU_TYPE_100BASE_T2_HD 19
268 #define LLDP_MAU_TYPE_100BASE_T2_FD 20
269 #define LLDP_MAU_TYPE_1000BASE_X_HD 21
270 #define LLDP_MAU_TYPE_1000BASE_X_FD 22
271 #define LLDP_MAU_TYPE_1000BASE_LX_HD 23
272 #define LLDP_MAU_TYPE_1000BASE_LX_FD 24
273 #define LLDP_MAU_TYPE_1000BASE_SX_HD 25
274 #define LLDP_MAU_TYPE_1000BASE_SX_FD 26
275 #define LLDP_MAU_TYPE_1000BASE_CX_HD 27
276 #define LLDP_MAU_TYPE_1000BASE_CX_FD 28
277 #define LLDP_MAU_TYPE_1000BASE_T_HD 29
278 #define LLDP_MAU_TYPE_1000BASE_T_FD 30
279 #define LLDP_MAU_TYPE_10GBASE_X 31
280 #define LLDP_MAU_TYPE_10GBASE_LX4 32
281 #define LLDP_MAU_TYPE_10GBASE_R 33
282 #define LLDP_MAU_TYPE_10GBASE_ER 34
283 #define LLDP_MAU_TYPE_10GBASE_LR 35
284 #define LLDP_MAU_TYPE_10GBASE_SR 36
285 #define LLDP_MAU_TYPE_10GBASE_W 37
286 #define LLDP_MAU_TYPE_10GBASE_EW 38
287 #define LLDP_MAU_TYPE_10GBASE_LW 39
288 #define LLDP_MAU_TYPE_10GBASE_SW 40
290 static const struct tok lldp_mau_types_values
[] = {
291 { LLDP_MAU_TYPE_UNKNOWN
, "Unknown"},
292 { LLDP_MAU_TYPE_AUI
, "AUI"},
293 { LLDP_MAU_TYPE_10BASE_5
, "10BASE_5"},
294 { LLDP_MAU_TYPE_FOIRL
, "FOIRL"},
295 { LLDP_MAU_TYPE_10BASE_2
, "10BASE2"},
296 { LLDP_MAU_TYPE_10BASE_T
, "10BASET duplex mode unknown"},
297 { LLDP_MAU_TYPE_10BASE_FP
, "10BASEFP"},
298 { LLDP_MAU_TYPE_10BASE_FB
, "10BASEFB"},
299 { LLDP_MAU_TYPE_10BASE_FL
, "10BASEFL duplex mode unknown"},
300 { LLDP_MAU_TYPE_10BROAD36
, "10BROAD36"},
301 { LLDP_MAU_TYPE_10BASE_T_HD
, "10BASET hdx"},
302 { LLDP_MAU_TYPE_10BASE_T_FD
, "10BASET fdx"},
303 { LLDP_MAU_TYPE_10BASE_FL_HD
, "10BASEFL hdx"},
304 { LLDP_MAU_TYPE_10BASE_FL_FD
, "10BASEFL fdx"},
305 { LLDP_MAU_TYPE_100BASE_T4
, "100BASET4"},
306 { LLDP_MAU_TYPE_100BASE_TX_HD
, "100BASETX hdx"},
307 { LLDP_MAU_TYPE_100BASE_TX_FD
, "100BASETX fdx"},
308 { LLDP_MAU_TYPE_100BASE_FX_HD
, "100BASEFX hdx"},
309 { LLDP_MAU_TYPE_100BASE_FX_FD
, "100BASEFX fdx"},
310 { LLDP_MAU_TYPE_100BASE_T2_HD
, "100BASET2 hdx"},
311 { LLDP_MAU_TYPE_100BASE_T2_FD
, "100BASET2 fdx"},
312 { LLDP_MAU_TYPE_1000BASE_X_HD
, "1000BASEX hdx"},
313 { LLDP_MAU_TYPE_1000BASE_X_FD
, "1000BASEX fdx"},
314 { LLDP_MAU_TYPE_1000BASE_LX_HD
, "1000BASELX hdx"},
315 { LLDP_MAU_TYPE_1000BASE_LX_FD
, "1000BASELX fdx"},
316 { LLDP_MAU_TYPE_1000BASE_SX_HD
, "1000BASESX hdx"},
317 { LLDP_MAU_TYPE_1000BASE_SX_FD
, "1000BASESX fdx"},
318 { LLDP_MAU_TYPE_1000BASE_CX_HD
, "1000BASECX hdx"},
319 { LLDP_MAU_TYPE_1000BASE_CX_FD
, "1000BASECX fdx"},
320 { LLDP_MAU_TYPE_1000BASE_T_HD
, "1000BASET hdx"},
321 { LLDP_MAU_TYPE_1000BASE_T_FD
, "1000BASET fdx"},
322 { LLDP_MAU_TYPE_10GBASE_X
, "10GBASEX"},
323 { LLDP_MAU_TYPE_10GBASE_LX4
, "10GBASELX4"},
324 { LLDP_MAU_TYPE_10GBASE_R
, "10GBASER"},
325 { LLDP_MAU_TYPE_10GBASE_ER
, "10GBASEER"},
326 { LLDP_MAU_TYPE_10GBASE_LR
, "10GBASELR"},
327 { LLDP_MAU_TYPE_10GBASE_SR
, "10GBASESR"},
328 { LLDP_MAU_TYPE_10GBASE_W
, "10GBASEW"},
329 { LLDP_MAU_TYPE_10GBASE_EW
, "10GBASEEW"},
330 { LLDP_MAU_TYPE_10GBASE_LW
, "10GBASELW"},
331 { LLDP_MAU_TYPE_10GBASE_SW
, "10GBASESW"},
335 #define LLDP_8023_AUTONEGOTIATION_SUPPORT (1 << 0)
336 #define LLDP_8023_AUTONEGOTIATION_STATUS (1 << 1)
338 static const struct tok lldp_8023_autonegotiation_values
[] = {
339 { LLDP_8023_AUTONEGOTIATION_SUPPORT
, "supported"},
340 { LLDP_8023_AUTONEGOTIATION_STATUS
, "enabled"},
344 #define LLDP_TIA_CAPABILITY_MED (1 << 0)
345 #define LLDP_TIA_CAPABILITY_NETWORK_POLICY (1 << 1)
346 #define LLDP_TIA_CAPABILITY_LOCATION_IDENTIFICATION (1 << 2)
347 #define LLDP_TIA_CAPABILITY_EXTENDED_POWER_MDI_PSE (1 << 3)
348 #define LLDP_TIA_CAPABILITY_EXTENDED_POWER_MDI_PD (1 << 4)
349 #define LLDP_TIA_CAPABILITY_INVENTORY (1 << 5)
351 static const struct tok lldp_tia_capabilities_values
[] = {
352 { LLDP_TIA_CAPABILITY_MED
, "LLDP-MED capabilities"},
353 { LLDP_TIA_CAPABILITY_NETWORK_POLICY
, "network policy"},
354 { LLDP_TIA_CAPABILITY_LOCATION_IDENTIFICATION
, "location identification"},
355 { LLDP_TIA_CAPABILITY_EXTENDED_POWER_MDI_PSE
, "extended power via MDI-PSE"},
356 { LLDP_TIA_CAPABILITY_EXTENDED_POWER_MDI_PD
, "extended power via MDI-PD"},
357 { LLDP_TIA_CAPABILITY_INVENTORY
, "Inventory"},
361 #define LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_1 1
362 #define LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_2 2
363 #define LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_3 3
364 #define LLDP_TIA_DEVICE_TYPE_NETWORK_CONNECTIVITY 4
366 static const struct tok lldp_tia_device_type_values
[] = {
367 { LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_1
, "endpoint class 1"},
368 { LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_2
, "endpoint class 2"},
369 { LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_3
, "endpoint class 3"},
370 { LLDP_TIA_DEVICE_TYPE_NETWORK_CONNECTIVITY
, "network connectivity"},
374 #define LLDP_TIA_APPLICATION_TYPE_VOICE 1
375 #define LLDP_TIA_APPLICATION_TYPE_VOICE_SIGNALING 2
376 #define LLDP_TIA_APPLICATION_TYPE_GUEST_VOICE 3
377 #define LLDP_TIA_APPLICATION_TYPE_GUEST_VOICE_SIGNALING 4
378 #define LLDP_TIA_APPLICATION_TYPE_SOFTPHONE_VOICE 5
379 #define LLDP_TIA_APPLICATION_TYPE_VIDEO_CONFERENCING 6
380 #define LLDP_TIA_APPLICATION_TYPE_STREAMING_VIDEO 7
381 #define LLDP_TIA_APPLICATION_TYPE_VIDEO_SIGNALING 8
383 static const struct tok lldp_tia_application_type_values
[] = {
384 { LLDP_TIA_APPLICATION_TYPE_VOICE
, "voice"},
385 { LLDP_TIA_APPLICATION_TYPE_VOICE_SIGNALING
, "voice signaling"},
386 { LLDP_TIA_APPLICATION_TYPE_GUEST_VOICE
, "guest voice"},
387 { LLDP_TIA_APPLICATION_TYPE_GUEST_VOICE_SIGNALING
, "guest voice signaling"},
388 { LLDP_TIA_APPLICATION_TYPE_SOFTPHONE_VOICE
, "softphone voice"},
389 { LLDP_TIA_APPLICATION_TYPE_VIDEO_CONFERENCING
, "video conferencing"},
390 { LLDP_TIA_APPLICATION_TYPE_STREAMING_VIDEO
, "streaming video"},
391 { LLDP_TIA_APPLICATION_TYPE_VIDEO_SIGNALING
, "video signaling"},
395 #define LLDP_TIA_NETWORK_POLICY_X_BIT (1 << 5)
396 #define LLDP_TIA_NETWORK_POLICY_T_BIT (1 << 6)
397 #define LLDP_TIA_NETWORK_POLICY_U_BIT (1 << 7)
399 static const struct tok lldp_tia_network_policy_bits_values
[] = {
400 { LLDP_TIA_NETWORK_POLICY_U_BIT
, "Unknown"},
401 { LLDP_TIA_NETWORK_POLICY_T_BIT
, "Tagged"},
402 { LLDP_TIA_NETWORK_POLICY_X_BIT
, "reserved"},
406 #define LLDP_EXTRACT_NETWORK_POLICY_VLAN(x) (((x)&0x1ffe)>>1)
407 #define LLDP_EXTRACT_NETWORK_POLICY_L2_PRIORITY(x) (((x)&0x01ff)>>6)
408 #define LLDP_EXTRACT_NETWORK_POLICY_DSCP(x) ((x)&0x003f)
410 #define LLDP_TIA_LOCATION_DATA_FORMAT_COORDINATE_BASED 1
411 #define LLDP_TIA_LOCATION_DATA_FORMAT_CIVIC_ADDRESS 2
412 #define LLDP_TIA_LOCATION_DATA_FORMAT_ECS_ELIN 3
414 static const struct tok lldp_tia_location_data_format_values
[] = {
415 { LLDP_TIA_LOCATION_DATA_FORMAT_COORDINATE_BASED
, "coordinate-based LCI"},
416 { LLDP_TIA_LOCATION_DATA_FORMAT_CIVIC_ADDRESS
, "civic address LCI"},
417 { LLDP_TIA_LOCATION_DATA_FORMAT_ECS_ELIN
, "ECS ELIN"},
421 #define LLDP_TIA_LOCATION_DATUM_WGS_84 1
422 #define LLDP_TIA_LOCATION_DATUM_NAD_83_NAVD_88 2
423 #define LLDP_TIA_LOCATION_DATUM_NAD_83_MLLW 3
425 static const struct tok lldp_tia_location_datum_type_values
[] = {
426 { LLDP_TIA_LOCATION_DATUM_WGS_84
, "World Geodesic System 1984"},
427 { LLDP_TIA_LOCATION_DATUM_NAD_83_NAVD_88
, "North American Datum 1983 (NAVD88)"},
428 { LLDP_TIA_LOCATION_DATUM_NAD_83_MLLW
, "North American Datum 1983 (MLLW)"},
432 #define LLDP_TIA_POWER_SOURCE_PSE 1
433 #define LLDP_TIA_POWER_SOURCE_LOCAL 2
434 #define LLDP_TIA_POWER_SOURCE_PSE_AND_LOCAL 3
436 static const struct tok lldp_tia_power_source_values
[] = {
437 { LLDP_TIA_POWER_SOURCE_PSE
, "PSE - primary power source"},
438 { LLDP_TIA_POWER_SOURCE_LOCAL
, "local - backup power source"},
439 { LLDP_TIA_POWER_SOURCE_PSE_AND_LOCAL
, "PSE+local - reserved"},
443 #define LLDP_TIA_POWER_PRIORITY_CRITICAL 1
444 #define LLDP_TIA_POWER_PRIORITY_HIGH 2
445 #define LLDP_TIA_POWER_PRIORITY_LOW 3
447 static const struct tok lldp_tia_power_priority_values
[] = {
448 { LLDP_TIA_POWER_PRIORITY_CRITICAL
, "critical"},
449 { LLDP_TIA_POWER_PRIORITY_HIGH
, "high"},
450 { LLDP_TIA_POWER_PRIORITY_LOW
, "low"},
454 #define LLDP_TIA_POWER_VAL_MAX 1024
456 static const struct tok lldp_tia_inventory_values
[] = {
457 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_HARDWARE_REV
, "Hardware revision" },
458 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_FIRMWARE_REV
, "Firmware revision" },
459 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SOFTWARE_REV
, "Software revision" },
460 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SERIAL_NUMBER
, "Serial number" },
461 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MANUFACTURER_NAME
, "Manufacturer name" },
462 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MODEL_NAME
, "Model name" },
463 { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_ASSET_ID
, "Asset ID" },
468 * From RFC 3636 - ifMauAutoNegCapAdvertisedBits
470 #define LLDP_MAU_PMD_OTHER (1 << 15)
471 #define LLDP_MAU_PMD_10BASE_T (1 << 14)
472 #define LLDP_MAU_PMD_10BASE_T_FD (1 << 13)
473 #define LLDP_MAU_PMD_100BASE_T4 (1 << 12)
474 #define LLDP_MAU_PMD_100BASE_TX (1 << 11)
475 #define LLDP_MAU_PMD_100BASE_TX_FD (1 << 10)
476 #define LLDP_MAU_PMD_100BASE_T2 (1 << 9)
477 #define LLDP_MAU_PMD_100BASE_T2_FD (1 << 8)
478 #define LLDP_MAU_PMD_FDXPAUSE (1 << 7)
479 #define LLDP_MAU_PMD_FDXAPAUSE (1 << 6)
480 #define LLDP_MAU_PMD_FDXSPAUSE (1 << 5)
481 #define LLDP_MAU_PMD_FDXBPAUSE (1 << 4)
482 #define LLDP_MAU_PMD_1000BASE_X (1 << 3)
483 #define LLDP_MAU_PMD_1000BASE_X_FD (1 << 2)
484 #define LLDP_MAU_PMD_1000BASE_T (1 << 1)
485 #define LLDP_MAU_PMD_1000BASE_T_FD (1 << 0)
487 static const struct tok lldp_pmd_capability_values
[] = {
488 { LLDP_MAU_PMD_10BASE_T
, "10BASE-T hdx"},
489 { LLDP_MAU_PMD_10BASE_T_FD
, "10BASE-T fdx"},
490 { LLDP_MAU_PMD_100BASE_T4
, "100BASE-T4"},
491 { LLDP_MAU_PMD_100BASE_TX
, "100BASE-TX hdx"},
492 { LLDP_MAU_PMD_100BASE_TX_FD
, "100BASE-TX fdx"},
493 { LLDP_MAU_PMD_100BASE_T2
, "100BASE-T2 hdx"},
494 { LLDP_MAU_PMD_100BASE_T2_FD
, "100BASE-T2 fdx"},
495 { LLDP_MAU_PMD_FDXPAUSE
, "Pause for fdx links"},
496 { LLDP_MAU_PMD_FDXAPAUSE
, "Asym PAUSE for fdx"},
497 { LLDP_MAU_PMD_FDXSPAUSE
, "Sym PAUSE for fdx"},
498 { LLDP_MAU_PMD_FDXBPAUSE
, "Asym and Sym PAUSE for fdx"},
499 { LLDP_MAU_PMD_1000BASE_X
, "1000BASE-{X LX SX CX} hdx"},
500 { LLDP_MAU_PMD_1000BASE_X_FD
, "1000BASE-{X LX SX CX} fdx"},
501 { LLDP_MAU_PMD_1000BASE_T
, "1000BASE-T hdx"},
502 { LLDP_MAU_PMD_1000BASE_T_FD
, "1000BASE-T fdx"},
506 #define LLDP_MDI_PORT_CLASS (1 << 0)
507 #define LLDP_MDI_POWER_SUPPORT (1 << 1)
508 #define LLDP_MDI_POWER_STATE (1 << 2)
509 #define LLDP_MDI_PAIR_CONTROL_ABILITY (1 << 3)
511 static const struct tok lldp_mdi_values
[] = {
512 { LLDP_MDI_PORT_CLASS
, "PSE"},
513 { LLDP_MDI_POWER_SUPPORT
, "supported"},
514 { LLDP_MDI_POWER_STATE
, "enabled"},
515 { LLDP_MDI_PAIR_CONTROL_ABILITY
, "can be controlled"},
519 #define LLDP_MDI_PSE_PORT_POWER_PAIRS_SIGNAL 1
520 #define LLDP_MDI_PSE_PORT_POWER_PAIRS_SPARE 2
522 static const struct tok lldp_mdi_power_pairs_values
[] = {
523 { LLDP_MDI_PSE_PORT_POWER_PAIRS_SIGNAL
, "signal"},
524 { LLDP_MDI_PSE_PORT_POWER_PAIRS_SPARE
, "spare"},
528 #define LLDP_MDI_POWER_CLASS0 1
529 #define LLDP_MDI_POWER_CLASS1 2
530 #define LLDP_MDI_POWER_CLASS2 3
531 #define LLDP_MDI_POWER_CLASS3 4
532 #define LLDP_MDI_POWER_CLASS4 5
534 static const struct tok lldp_mdi_power_class_values
[] = {
535 { LLDP_MDI_POWER_CLASS0
, "class0"},
536 { LLDP_MDI_POWER_CLASS1
, "class1"},
537 { LLDP_MDI_POWER_CLASS2
, "class2"},
538 { LLDP_MDI_POWER_CLASS3
, "class3"},
539 { LLDP_MDI_POWER_CLASS4
, "class4"},
543 #define LLDP_AGGREGATION_CAPABILTIY (1 << 0)
544 #define LLDP_AGGREGATION_STATUS (1 << 1)
546 static const struct tok lldp_aggregation_values
[] = {
547 { LLDP_AGGREGATION_CAPABILTIY
, "supported"},
548 { LLDP_AGGREGATION_STATUS
, "enabled"},
553 * DCBX protocol subtypes.
555 #define LLDP_DCBX_SUBTYPE_1 1
556 #define LLDP_DCBX_SUBTYPE_2 2
558 static const struct tok lldp_dcbx_subtype_values
[] = {
559 { LLDP_DCBX_SUBTYPE_1
, "DCB Capability Exchange Protocol Rev 1" },
560 { LLDP_DCBX_SUBTYPE_2
, "DCB Capability Exchange Protocol Rev 1.01" },
564 #define LLDP_DCBX_CONTROL_TLV 1
565 #define LLDP_DCBX_PRIORITY_GROUPS_TLV 2
566 #define LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV 3
567 #define LLDP_DCBX_APPLICATION_TLV 4
570 * Interface numbering subtypes.
572 #define LLDP_INTF_NUMB_IFX_SUBTYPE 2
573 #define LLDP_INTF_NUMB_SYSPORT_SUBTYPE 3
575 static const struct tok lldp_intf_numb_subtype_values
[] = {
576 { LLDP_INTF_NUMB_IFX_SUBTYPE
, "Interface Index" },
577 { LLDP_INTF_NUMB_SYSPORT_SUBTYPE
, "System Port Number" },
581 #define LLDP_INTF_NUM_LEN 5
583 #define LLDP_EVB_MODE_NOT_SUPPORTED 0
584 #define LLDP_EVB_MODE_EVB_BRIDGE 1
585 #define LLDP_EVB_MODE_EVB_STATION 2
586 #define LLDP_EVB_MODE_RESERVED 3
588 static const struct tok lldp_evb_mode_values
[]={
589 { LLDP_EVB_MODE_NOT_SUPPORTED
, "Not Supported"},
590 { LLDP_EVB_MODE_EVB_BRIDGE
, "EVB Bridge"},
591 { LLDP_EVB_MODE_EVB_STATION
, "EVB Staion"},
592 { LLDP_EVB_MODE_RESERVED
, "Reserved for future Standardization"},
597 #define LLDP_PRIVATE_8021_SUBTYPE_CONGESTION_NOTIFICATION_LENGTH 6
598 #define LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION_LENGTH 25
599 #define LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION_LENGTH 25
600 #define LLDP_PRIVATE_8021_SUBTYPE_PFC_CONFIGURATION_LENGTH 6
601 #define LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY_MIN_LENGTH 5
602 #define LLDP_PRIVATE_8021_SUBTYPE_EVB_LENGTH 9
603 #define LLDP_PRIVATE_8021_SUBTYPE_CDCP_MIN_LENGTH 8
605 #define LLDP_IANA_SUBTYPE_MUDURL 1
607 static const struct tok lldp_iana_subtype_values
[] = {
608 { LLDP_IANA_SUBTYPE_MUDURL
, "MUD-URL" },
614 print_ets_priority_assignment_table(netdissect_options
*ndo
,
617 ND_PRINT((ndo
, "\n\t Priority Assignment Table"));
618 ND_PRINT((ndo
, "\n\t Priority : 0 1 2 3 4 5 6 7"));
619 ND_PRINT((ndo
, "\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d",
620 ptr
[0]>>4,ptr
[0]&0x0f,ptr
[1]>>4,ptr
[1]&0x0f,ptr
[2]>>4,
621 ptr
[2] & 0x0f, ptr
[3] >> 4, ptr
[3] & 0x0f));
625 print_tc_bandwidth_table(netdissect_options
*ndo
,
628 ND_PRINT((ndo
, "\n\t TC Bandwidth Table"));
629 ND_PRINT((ndo
, "\n\t TC%% : 0 1 2 3 4 5 6 7"));
630 ND_PRINT((ndo
, "\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d",
631 ptr
[0], ptr
[1], ptr
[2], ptr
[3], ptr
[4], ptr
[5], ptr
[6], ptr
[7]));
635 print_tsa_assignment_table(netdissect_options
*ndo
,
638 ND_PRINT((ndo
, "\n\t TSA Assignment Table"));
639 ND_PRINT((ndo
, "\n\t Traffic Class: 0 1 2 3 4 5 6 7"));
640 ND_PRINT((ndo
, "\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d",
641 ptr
[0], ptr
[1], ptr
[2], ptr
[3], ptr
[4], ptr
[5], ptr
[6], ptr
[7]));
645 * Print IEEE 802.1 private extensions. (802.1AB annex E)
648 lldp_private_8021_print(netdissect_options
*ndo
,
649 const u_char
*tptr
, u_int tlv_len
)
651 int subtype
, hexdump
= FALSE
;
661 ND_PRINT((ndo
, "\n\t %s Subtype (%u)",
662 tok2str(lldp_8021_subtype_values
, "unknown", subtype
),
666 case LLDP_PRIVATE_8021_SUBTYPE_PORT_VLAN_ID
:
670 ND_PRINT((ndo
, "\n\t port vlan id (PVID): %u",
671 EXTRACT_16BITS(tptr
+ 4)));
673 case LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_VLAN_ID
:
677 ND_PRINT((ndo
, "\n\t port and protocol vlan id (PPVID): %u, flags [%s] (0x%02x)",
678 EXTRACT_16BITS(tptr
+5),
679 bittok2str(lldp_8021_port_protocol_id_values
, "none", *(tptr
+4)),
682 case LLDP_PRIVATE_8021_SUBTYPE_VLAN_NAME
:
686 ND_PRINT((ndo
, "\n\t vlan id (VID): %u", EXTRACT_16BITS(tptr
+ 4)));
691 if (tlv_len
< 7+sublen
) {
694 ND_PRINT((ndo
, "\n\t vlan name: "));
695 safeputs(ndo
, tptr
+ 7, sublen
);
697 case LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_IDENTITY
:
702 if (tlv_len
< 5+sublen
) {
705 ND_PRINT((ndo
, "\n\t protocol identity: "));
706 safeputs(ndo
, tptr
+ 5, sublen
);
708 case LLDP_PRIVATE_8021_SUBTYPE_CONGESTION_NOTIFICATION
:
709 if(tlv_len
<LLDP_PRIVATE_8021_SUBTYPE_CONGESTION_NOTIFICATION_LENGTH
){
713 ND_PRINT((ndo
, "\n\t Pre-Priority CNPV Indicator"));
714 ND_PRINT((ndo
, "\n\t Priority : 0 1 2 3 4 5 6 7"));
715 ND_PRINT((ndo
, "\n\t Value : "));
716 for(i
=0;i
<NO_OF_BITS
;i
++)
717 ND_PRINT((ndo
, "%-2d ", (tval
>> i
) & 0x01));
719 ND_PRINT((ndo
, "\n\t Pre-Priority Ready Indicator"));
720 ND_PRINT((ndo
, "\n\t Priority : 0 1 2 3 4 5 6 7"));
721 ND_PRINT((ndo
, "\n\t Value : "));
722 for(i
=0;i
<NO_OF_BITS
;i
++)
723 ND_PRINT((ndo
, "%-2d ", (tval
>> i
) & 0x01));
726 case LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION
:
727 if(tlv_len
<LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION_LENGTH
) {
731 ND_PRINT((ndo
, "\n\t Willing:%d, CBS:%d, RES:%d, Max TCs:%d",
732 tval
>> 7, (tval
>> 6) & 0x02, (tval
>> 3) & 0x07, tval
& 0x07));
734 /*Print Priority Assignment Table*/
735 print_ets_priority_assignment_table(ndo
, tptr
+ 5);
737 /*Print TC Bandwidth Table*/
738 print_tc_bandwidth_table(ndo
, tptr
+ 9);
740 /* Print TSA Assignment Table */
741 print_tsa_assignment_table(ndo
, tptr
+ 17);
745 case LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION
:
746 if(tlv_len
<LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION_LENGTH
) {
749 ND_PRINT((ndo
, "\n\t RES: %d", *(tptr
+ 4)));
750 /*Print Priority Assignment Table */
751 print_ets_priority_assignment_table(ndo
, tptr
+ 5);
752 /*Print TC Bandwidth Table */
753 print_tc_bandwidth_table(ndo
, tptr
+ 9);
754 /* Print TSA Assignment Table */
755 print_tsa_assignment_table(ndo
, tptr
+ 17);
758 case LLDP_PRIVATE_8021_SUBTYPE_PFC_CONFIGURATION
:
759 if(tlv_len
<LLDP_PRIVATE_8021_SUBTYPE_PFC_CONFIGURATION_LENGTH
) {
763 ND_PRINT((ndo
, "\n\t Willing: %d, MBC: %d, RES: %d, PFC cap:%d ",
764 tval
>> 7, (tval
>> 6) & 0x01, (tval
>> 4) & 0x03, (tval
& 0x0f)));
765 ND_PRINT((ndo
, "\n\t PFC Enable"));
767 ND_PRINT((ndo
, "\n\t Priority : 0 1 2 3 4 5 6 7"));
768 ND_PRINT((ndo
, "\n\t Value : "));
769 for(i
=0;i
<NO_OF_BITS
;i
++)
770 ND_PRINT((ndo
, "%-2d ", (tval
>> i
) & 0x01));
773 case LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY
:
774 if(tlv_len
<LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY_MIN_LENGTH
) {
777 ND_PRINT((ndo
, "\n\t RES: %d", *(tptr
+ 4)));
778 if(tlv_len
<=LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY_MIN_LENGTH
){
781 /* Length of Application Priority Table */
787 ND_PRINT((ndo
, "\n\t Application Priority Table"));
790 ND_PRINT((ndo
, "\n\t Priority: %u, RES: %u, Sel: %u, Protocol ID: %u",
791 tval
>> 5, (tval
>> 3) & 0x03, (tval
& 0x07),
792 EXTRACT_16BITS(tptr
+ i
+ 5)));
796 case LLDP_PRIVATE_8021_SUBTYPE_EVB
:
797 if(tlv_len
<LLDP_PRIVATE_8021_SUBTYPE_EVB_LENGTH
){
800 ND_PRINT((ndo
, "\n\t EVB Bridge Status"));
802 ND_PRINT((ndo
, "\n\t RES: %d, BGID: %d, RRCAP: %d, RRCTR: %d",
803 tval
>> 3, (tval
>> 2) & 0x01, (tval
>> 1) & 0x01, tval
& 0x01));
804 ND_PRINT((ndo
, "\n\t EVB Station Status"));
806 ND_PRINT((ndo
, "\n\t RES: %d, SGID: %d, RRREQ: %d,RRSTAT: %d",
807 tval
>> 4, (tval
>> 3) & 0x01, (tval
>> 2) & 0x01, tval
& 0x03));
809 ND_PRINT((ndo
, "\n\t R: %d, RTE: %d, ",tval
>> 5, tval
& 0x1f));
811 ND_PRINT((ndo
, "EVB Mode: %s [%d]",
812 tok2str(lldp_evb_mode_values
, "unknown", tval
>> 6), tval
>> 6));
813 ND_PRINT((ndo
, "\n\t ROL: %d, RWD: %d, ", (tval
>> 5) & 0x01, tval
& 0x1f));
815 ND_PRINT((ndo
, "RES: %d, ROL: %d, RKA: %d", tval
>> 6, (tval
>> 5) & 0x01, tval
& 0x1f));
818 case LLDP_PRIVATE_8021_SUBTYPE_CDCP
:
819 if(tlv_len
<LLDP_PRIVATE_8021_SUBTYPE_CDCP_MIN_LENGTH
){
823 ND_PRINT((ndo
, "\n\t Role: %d, RES: %d, Scomp: %d ",
824 tval
>> 7, (tval
>> 4) & 0x07, (tval
>> 3) & 0x01));
825 ND_PRINT((ndo
, "ChnCap: %d", EXTRACT_16BITS(tptr
+ 6) & 0x0fff));
832 tval
=EXTRACT_24BITS(tptr
+i
+8);
833 ND_PRINT((ndo
, "\n\t SCID: %d, SVID: %d",
834 tval
>> 12, tval
& 0x000fff));
848 * Print IEEE 802.3 private extensions. (802.3bc)
851 lldp_private_8023_print(netdissect_options
*ndo
,
852 const u_char
*tptr
, u_int tlv_len
)
854 int subtype
, hexdump
= FALSE
;
861 ND_PRINT((ndo
, "\n\t %s Subtype (%u)",
862 tok2str(lldp_8023_subtype_values
, "unknown", subtype
),
866 case LLDP_PRIVATE_8023_SUBTYPE_MACPHY
:
870 ND_PRINT((ndo
, "\n\t autonegotiation [%s] (0x%02x)",
871 bittok2str(lldp_8023_autonegotiation_values
, "none", *(tptr
+4)),
873 ND_PRINT((ndo
, "\n\t PMD autoneg capability [%s] (0x%04x)",
874 bittok2str(lldp_pmd_capability_values
,"unknown", EXTRACT_16BITS(tptr
+5)),
875 EXTRACT_16BITS(tptr
+ 5)));
876 ND_PRINT((ndo
, "\n\t MAU type %s (0x%04x)",
877 tok2str(lldp_mau_types_values
, "unknown", EXTRACT_16BITS(tptr
+7)),
878 EXTRACT_16BITS(tptr
+ 7)));
881 case LLDP_PRIVATE_8023_SUBTYPE_MDIPOWER
:
885 ND_PRINT((ndo
, "\n\t MDI power support [%s], power pair %s, power class %s",
886 bittok2str(lldp_mdi_values
, "none", *(tptr
+4)),
887 tok2str(lldp_mdi_power_pairs_values
, "unknown", *(tptr
+5)),
888 tok2str(lldp_mdi_power_class_values
, "unknown", *(tptr
+ 6))));
891 case LLDP_PRIVATE_8023_SUBTYPE_LINKAGGR
:
895 ND_PRINT((ndo
, "\n\t aggregation status [%s], aggregation port ID %u",
896 bittok2str(lldp_aggregation_values
, "none", *(tptr
+4)),
897 EXTRACT_32BITS(tptr
+ 5)));
900 case LLDP_PRIVATE_8023_SUBTYPE_MTU
:
904 ND_PRINT((ndo
, "\n\t MTU size %u", EXTRACT_16BITS(tptr
+ 4)));
916 * Extract 34bits of latitude/longitude coordinates.
919 lldp_extract_latlon(const u_char
*tptr
)
923 latlon
= *tptr
& 0x3;
924 latlon
= (latlon
<< 32) | EXTRACT_32BITS(tptr
+1);
929 /* objects defined in IANA subtype 00 00 5e
930 * (right now there is only one)
935 lldp_private_iana_print(netdissect_options
*ndo
,
936 const u_char
*tptr
, u_int tlv_len
)
938 int subtype
, hexdump
= FALSE
;
945 ND_PRINT((ndo
, "\n\t %s Subtype (%u)",
946 tok2str(lldp_iana_subtype_values
, "unknown", subtype
),
950 case LLDP_IANA_SUBTYPE_MUDURL
:
951 ND_PRINT((ndo
, "\n\t MUD-URL="));
952 (void)fn_printn(ndo
, tptr
+4, tlv_len
-4, NULL
);
964 * Print private TIA extensions.
967 lldp_private_tia_print(netdissect_options
*ndo
,
968 const u_char
*tptr
, u_int tlv_len
)
970 int subtype
, hexdump
= FALSE
;
971 uint8_t location_format
;
974 uint8_t ca_type
, ca_len
;
981 ND_PRINT((ndo
, "\n\t %s Subtype (%u)",
982 tok2str(lldp_tia_subtype_values
, "unknown", subtype
),
986 case LLDP_PRIVATE_TIA_SUBTYPE_CAPABILITIES
:
990 ND_PRINT((ndo
, "\n\t Media capabilities [%s] (0x%04x)",
991 bittok2str(lldp_tia_capabilities_values
, "none",
992 EXTRACT_16BITS(tptr
+ 4)), EXTRACT_16BITS(tptr
+ 4)));
993 ND_PRINT((ndo
, "\n\t Device type [%s] (0x%02x)",
994 tok2str(lldp_tia_device_type_values
, "unknown", *(tptr
+6)),
998 case LLDP_PRIVATE_TIA_SUBTYPE_NETWORK_POLICY
:
1002 ND_PRINT((ndo
, "\n\t Application type [%s] (0x%02x)",
1003 tok2str(lldp_tia_application_type_values
, "none", *(tptr
+4)),
1005 ND_PRINT((ndo
, ", Flags [%s]", bittok2str(
1006 lldp_tia_network_policy_bits_values
, "none", *(tptr
+ 5))));
1007 ND_PRINT((ndo
, "\n\t Vlan id %u",
1008 LLDP_EXTRACT_NETWORK_POLICY_VLAN(EXTRACT_16BITS(tptr
+ 5))));
1009 ND_PRINT((ndo
, ", L2 priority %u",
1010 LLDP_EXTRACT_NETWORK_POLICY_L2_PRIORITY(EXTRACT_16BITS(tptr
+ 6))));
1011 ND_PRINT((ndo
, ", DSCP value %u",
1012 LLDP_EXTRACT_NETWORK_POLICY_DSCP(EXTRACT_16BITS(tptr
+ 6))));
1015 case LLDP_PRIVATE_TIA_SUBTYPE_LOCAL_ID
:
1019 location_format
= *(tptr
+4);
1020 ND_PRINT((ndo
, "\n\t Location data format %s (0x%02x)",
1021 tok2str(lldp_tia_location_data_format_values
, "unknown", location_format
),
1024 switch (location_format
) {
1025 case LLDP_TIA_LOCATION_DATA_FORMAT_COORDINATE_BASED
:
1029 ND_PRINT((ndo
, "\n\t Latitude resolution %u, latitude value %" PRIu64
,
1030 (*(tptr
+ 5) >> 2), lldp_extract_latlon(tptr
+ 5)));
1031 ND_PRINT((ndo
, "\n\t Longitude resolution %u, longitude value %" PRIu64
,
1032 (*(tptr
+ 10) >> 2), lldp_extract_latlon(tptr
+ 10)));
1033 ND_PRINT((ndo
, "\n\t Altitude type %s (%u)",
1034 tok2str(lldp_tia_location_altitude_type_values
, "unknown",(*(tptr
+15)>>4)),
1035 (*(tptr
+ 15) >> 4)));
1036 ND_PRINT((ndo
, "\n\t Altitude resolution %u, altitude value 0x%x",
1037 (EXTRACT_16BITS(tptr
+15)>>6)&0x3f,
1038 ((EXTRACT_32BITS(tptr
+ 16) & 0x3fffffff))));
1039 ND_PRINT((ndo
, "\n\t Datum %s (0x%02x)",
1040 tok2str(lldp_tia_location_datum_type_values
, "unknown", *(tptr
+20)),
1044 case LLDP_TIA_LOCATION_DATA_FORMAT_CIVIC_ADDRESS
:
1048 lci_len
= *(tptr
+5);
1052 if (tlv_len
< 7+lci_len
) {
1055 ND_PRINT((ndo
, "\n\t LCI length %u, LCI what %s (0x%02x), Country-code ",
1057 tok2str(lldp_tia_location_lci_what_values
, "unknown", *(tptr
+6)),
1061 safeputs(ndo
, tptr
+ 7, 2);
1063 lci_len
= lci_len
-3;
1066 /* Decode each civic address element */
1067 while (lci_len
> 0) {
1077 ND_PRINT((ndo
, "\n\t CA type \'%s\' (%u), length %u: ",
1078 tok2str(lldp_tia_location_lci_catype_values
, "unknown", ca_type
),
1081 /* basic sanity check */
1082 if ( ca_type
== 0 || ca_len
== 0) {
1085 if (lci_len
< ca_len
) {
1089 safeputs(ndo
, tptr
, ca_len
);
1095 case LLDP_TIA_LOCATION_DATA_FORMAT_ECS_ELIN
:
1096 ND_PRINT((ndo
, "\n\t ECS ELIN id "));
1097 safeputs(ndo
, tptr
+ 5, tlv_len
- 5);
1101 ND_PRINT((ndo
, "\n\t Location ID "));
1102 print_unknown_data(ndo
, tptr
+ 5, "\n\t ", tlv_len
- 5);
1106 case LLDP_PRIVATE_TIA_SUBTYPE_EXTENDED_POWER_MDI
:
1110 ND_PRINT((ndo
, "\n\t Power type [%s]",
1111 (*(tptr
+ 4) & 0xC0 >> 6) ? "PD device" : "PSE device"));
1112 ND_PRINT((ndo
, ", Power source [%s]",
1113 tok2str(lldp_tia_power_source_values
, "none", (*(tptr
+ 4) & 0x30) >> 4)));
1114 ND_PRINT((ndo
, "\n\t Power priority [%s] (0x%02x)",
1115 tok2str(lldp_tia_power_priority_values
, "none", *(tptr
+4)&0x0f),
1116 *(tptr
+ 4) & 0x0f));
1117 power_val
= EXTRACT_16BITS(tptr
+5);
1118 if (power_val
< LLDP_TIA_POWER_VAL_MAX
) {
1119 ND_PRINT((ndo
, ", Power %.1f Watts", ((float)power_val
) / 10));
1121 ND_PRINT((ndo
, ", Power %u (Reserved)", power_val
));
1125 case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_HARDWARE_REV
:
1126 case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_FIRMWARE_REV
:
1127 case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SOFTWARE_REV
:
1128 case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SERIAL_NUMBER
:
1129 case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MANUFACTURER_NAME
:
1130 case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MODEL_NAME
:
1131 case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_ASSET_ID
:
1132 ND_PRINT((ndo
, "\n\t %s ",
1133 tok2str(lldp_tia_inventory_values
, "unknown", subtype
)));
1134 safeputs(ndo
, tptr
+ 4, tlv_len
- 4);
1146 * Print DCBX Protocol fields (V 1.01).
1149 lldp_private_dcbx_print(netdissect_options
*ndo
,
1150 const u_char
*pptr
, u_int len
)
1152 int subtype
, hexdump
= FALSE
;
1155 uint32_t i
, pgval
, uval
;
1156 u_int tlen
, tlv_type
, tlv_len
;
1157 const u_char
*tptr
, *mptr
;
1162 subtype
= *(pptr
+3);
1164 ND_PRINT((ndo
, "\n\t %s Subtype (%u)",
1165 tok2str(lldp_dcbx_subtype_values
, "unknown", subtype
),
1168 /* by passing old version */
1169 if (subtype
== LLDP_DCBX_SUBTYPE_1
)
1175 while (tlen
>= sizeof(tlv
)) {
1177 ND_TCHECK2(*tptr
, sizeof(tlv
));
1179 tlv
= EXTRACT_16BITS(tptr
);
1181 tlv_type
= LLDP_EXTRACT_TYPE(tlv
);
1182 tlv_len
= LLDP_EXTRACT_LEN(tlv
);
1185 tlen
-= sizeof(tlv
);
1186 tptr
+= sizeof(tlv
);
1189 if (!tlv_type
|| !tlv_len
) {
1193 ND_TCHECK2(*tptr
, tlv_len
);
1194 if (tlen
< tlv_len
) {
1198 /* decode every tlv */
1200 case LLDP_DCBX_CONTROL_TLV
:
1204 ND_PRINT((ndo
, "\n\t Control - Protocol Control (type 0x%x, length %d)",
1205 LLDP_DCBX_CONTROL_TLV
, tlv_len
));
1206 ND_PRINT((ndo
, "\n\t Oper_Version: %d", *tptr
));
1207 ND_PRINT((ndo
, "\n\t Max_Version: %d", *(tptr
+ 1)));
1208 ND_PRINT((ndo
, "\n\t Sequence Number: %d", EXTRACT_32BITS(tptr
+ 2)));
1209 ND_PRINT((ndo
, "\n\t Acknowledgement Number: %d",
1210 EXTRACT_32BITS(tptr
+ 6)));
1212 case LLDP_DCBX_PRIORITY_GROUPS_TLV
:
1216 ND_PRINT((ndo
, "\n\t Feature - Priority Group (type 0x%x, length %d)",
1217 LLDP_DCBX_PRIORITY_GROUPS_TLV
, tlv_len
));
1218 ND_PRINT((ndo
, "\n\t Oper_Version: %d", *tptr
));
1219 ND_PRINT((ndo
, "\n\t Max_Version: %d", *(tptr
+ 1)));
1220 ND_PRINT((ndo
, "\n\t Info block(0x%02X): ", *(tptr
+ 2)));
1222 ND_PRINT((ndo
, "Enable bit: %d, Willing bit: %d, Error Bit: %d",
1223 (tval
& 0x80) ? 1 : 0, (tval
& 0x40) ? 1 : 0,
1224 (tval
& 0x20) ? 1 : 0));
1225 ND_PRINT((ndo
, "\n\t SubType: %d", *(tptr
+ 3)));
1226 ND_PRINT((ndo
, "\n\t Priority Allocation"));
1229 * Array of 8 4-bit priority group ID values; we fetch all
1230 * 32 bits and extract each nibble.
1232 pgval
= EXTRACT_32BITS(tptr
+4);
1233 for (i
= 0; i
<= 7; i
++) {
1234 ND_PRINT((ndo
, "\n\t PgId_%d: %d",
1235 i
, (pgval
>> (28 - 4 * i
)) & 0xF));
1237 ND_PRINT((ndo
, "\n\t Priority Group Allocation"));
1238 for (i
= 0; i
<= 7; i
++)
1239 ND_PRINT((ndo
, "\n\t Pg percentage[%d]: %d", i
, *(tptr
+ 8 + i
)));
1240 ND_PRINT((ndo
, "\n\t NumTCsSupported: %d", *(tptr
+ 8 + 8)));
1242 case LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV
:
1246 ND_PRINT((ndo
, "\n\t Feature - Priority Flow Control"));
1247 ND_PRINT((ndo
, " (type 0x%x, length %d)",
1248 LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV
, tlv_len
));
1249 ND_PRINT((ndo
, "\n\t Oper_Version: %d", *tptr
));
1250 ND_PRINT((ndo
, "\n\t Max_Version: %d", *(tptr
+ 1)));
1251 ND_PRINT((ndo
, "\n\t Info block(0x%02X): ", *(tptr
+ 2)));
1253 ND_PRINT((ndo
, "Enable bit: %d, Willing bit: %d, Error Bit: %d",
1254 (tval
& 0x80) ? 1 : 0, (tval
& 0x40) ? 1 : 0,
1255 (tval
& 0x20) ? 1 : 0));
1256 ND_PRINT((ndo
, "\n\t SubType: %d", *(tptr
+ 3)));
1258 ND_PRINT((ndo
, "\n\t PFC Config (0x%02X)", *(tptr
+ 4)));
1259 for (i
= 0; i
<= 7; i
++)
1260 ND_PRINT((ndo
, "\n\t Priority Bit %d: %s",
1261 i
, (tval
& (1 << i
)) ? "Enabled" : "Disabled"));
1262 ND_PRINT((ndo
, "\n\t NumTCPFCSupported: %d", *(tptr
+ 5)));
1264 case LLDP_DCBX_APPLICATION_TLV
:
1268 ND_PRINT((ndo
, "\n\t Feature - Application (type 0x%x, length %d)",
1269 LLDP_DCBX_APPLICATION_TLV
, tlv_len
));
1270 ND_PRINT((ndo
, "\n\t Oper_Version: %d", *tptr
));
1271 ND_PRINT((ndo
, "\n\t Max_Version: %d", *(tptr
+ 1)));
1272 ND_PRINT((ndo
, "\n\t Info block(0x%02X): ", *(tptr
+ 2)));
1274 ND_PRINT((ndo
, "Enable bit: %d, Willing bit: %d, Error Bit: %d",
1275 (tval
& 0x80) ? 1 : 0, (tval
& 0x40) ? 1 : 0,
1276 (tval
& 0x20) ? 1 : 0));
1277 ND_PRINT((ndo
, "\n\t SubType: %d", *(tptr
+ 3)));
1281 ND_PRINT((ndo
, "\n\t Application Value"));
1282 ND_PRINT((ndo
, "\n\t Application Protocol ID: 0x%04x",
1283 EXTRACT_16BITS(mptr
)));
1284 uval
= EXTRACT_24BITS(mptr
+2);
1285 ND_PRINT((ndo
, "\n\t SF (0x%x) Application Protocol ID is %s",
1287 (uval
>> 22) ? "Socket Number" : "L2 EtherType"));
1288 ND_PRINT((ndo
, "\n\t OUI: 0x%06x", uval
& 0x3fffff));
1289 ND_PRINT((ndo
, "\n\t User Priority Map: 0x%02x", *(mptr
+ 5)));
1299 /* do we also want to see a hex dump ? */
1300 if (ndo
->ndo_vflag
> 1 || (ndo
->ndo_vflag
&& hexdump
)) {
1301 print_unknown_data(ndo
, tptr
, "\n\t ", tlv_len
);
1313 lldp_network_addr_print(netdissect_options
*ndo
, const u_char
*tptr
, u_int len
)
1316 static char buf
[BUFSIZE
];
1317 const char * (*pfunc
)(netdissect_options
*, const u_char
*);
1327 /* This cannot be assigned to ipaddr_string(), which is a macro. */
1333 /* This cannot be assigned to ip6addr_string(), which is a macro. */
1339 pfunc
= etheraddr_string
;
1347 snprintf(buf
, sizeof(buf
), "AFI %s (%u), no AF printer !",
1348 tok2str(af_values
, "Unknown", af
), af
);
1350 snprintf(buf
, sizeof(buf
), "AFI %s (%u): %s",
1351 tok2str(af_values
, "Unknown", af
), af
, (*pfunc
)(ndo
, tptr
+1));
1358 lldp_mgmt_addr_tlv_print(netdissect_options
*ndo
,
1359 const u_char
*pptr
, u_int len
)
1361 uint8_t mgmt_addr_len
, intf_num_subtype
, oid_len
;
1372 mgmt_addr_len
= *tptr
++;
1375 if (tlen
< mgmt_addr_len
) {
1379 mgmt_addr
= lldp_network_addr_print(ndo
, tptr
, mgmt_addr_len
);
1380 if (mgmt_addr
== NULL
) {
1383 ND_PRINT((ndo
, "\n\t Management Address length %u, %s",
1384 mgmt_addr_len
, mgmt_addr
));
1385 tptr
+= mgmt_addr_len
;
1386 tlen
-= mgmt_addr_len
;
1388 if (tlen
< LLDP_INTF_NUM_LEN
) {
1392 intf_num_subtype
= *tptr
;
1393 ND_PRINT((ndo
, "\n\t %s Interface Numbering (%u): %u",
1394 tok2str(lldp_intf_numb_subtype_values
, "Unknown", intf_num_subtype
),
1396 EXTRACT_32BITS(tptr
+ 1)));
1398 tptr
+= LLDP_INTF_NUM_LEN
;
1399 tlen
-= LLDP_INTF_NUM_LEN
;
1402 * The OID is optional.
1407 if (tlen
< 1U + oid_len
) {
1411 ND_PRINT((ndo
, "\n\t OID length %u", oid_len
));
1412 safeputs(ndo
, tptr
+ 1, oid_len
);
1420 lldp_print(netdissect_options
*ndo
,
1421 register const u_char
*pptr
, register u_int len
)
1424 uint16_t tlv
, cap
, ena_cap
;
1425 u_int oui
, tlen
, hexdump
, tlv_type
, tlv_len
;
1432 ND_PRINT((ndo
, "LLDP, length %u", len
));
1434 while (tlen
>= sizeof(tlv
)) {
1436 ND_TCHECK2(*tptr
, sizeof(tlv
));
1438 tlv
= EXTRACT_16BITS(tptr
);
1440 tlv_type
= LLDP_EXTRACT_TYPE(tlv
);
1441 tlv_len
= LLDP_EXTRACT_LEN(tlv
);
1444 tlen
-= sizeof(tlv
);
1445 tptr
+= sizeof(tlv
);
1447 if (ndo
->ndo_vflag
) {
1448 ND_PRINT((ndo
, "\n\t%s TLV (%u), length %u",
1449 tok2str(lldp_tlv_values
, "Unknown", tlv_type
),
1450 tlv_type
, tlv_len
));
1453 /* infinite loop check */
1454 if (!tlv_type
|| !tlv_len
) {
1458 ND_TCHECK2(*tptr
, tlv_len
);
1459 if (tlen
< tlv_len
) {
1465 case LLDP_CHASSIS_ID_TLV
:
1466 if (ndo
->ndo_vflag
) {
1471 ND_PRINT((ndo
, "\n\t Subtype %s (%u): ",
1472 tok2str(lldp_chassis_subtype_values
, "Unknown", subtype
),
1476 case LLDP_CHASSIS_MAC_ADDR_SUBTYPE
:
1477 if (tlv_len
< 1+6) {
1480 ND_PRINT((ndo
, "%s", etheraddr_string(ndo
, tptr
+ 1)));
1483 case LLDP_CHASSIS_INTF_NAME_SUBTYPE
: /* fall through */
1484 case LLDP_CHASSIS_LOCAL_SUBTYPE
:
1485 case LLDP_CHASSIS_CHASSIS_COMP_SUBTYPE
:
1486 case LLDP_CHASSIS_INTF_ALIAS_SUBTYPE
:
1487 case LLDP_CHASSIS_PORT_COMP_SUBTYPE
:
1488 safeputs(ndo
, tptr
+ 1, tlv_len
- 1);
1491 case LLDP_CHASSIS_NETWORK_ADDR_SUBTYPE
:
1492 network_addr
= lldp_network_addr_print(ndo
, tptr
+1, tlv_len
-1);
1493 if (network_addr
== NULL
) {
1496 ND_PRINT((ndo
, "%s", network_addr
));
1506 case LLDP_PORT_ID_TLV
:
1507 if (ndo
->ndo_vflag
) {
1512 ND_PRINT((ndo
, "\n\t Subtype %s (%u): ",
1513 tok2str(lldp_port_subtype_values
, "Unknown", subtype
),
1517 case LLDP_PORT_MAC_ADDR_SUBTYPE
:
1518 if (tlv_len
< 1+6) {
1521 ND_PRINT((ndo
, "%s", etheraddr_string(ndo
, tptr
+ 1)));
1524 case LLDP_PORT_INTF_NAME_SUBTYPE
: /* fall through */
1525 case LLDP_PORT_LOCAL_SUBTYPE
:
1526 case LLDP_PORT_AGENT_CIRC_ID_SUBTYPE
:
1527 case LLDP_PORT_INTF_ALIAS_SUBTYPE
:
1528 case LLDP_PORT_PORT_COMP_SUBTYPE
:
1529 safeputs(ndo
, tptr
+ 1, tlv_len
- 1);
1532 case LLDP_PORT_NETWORK_ADDR_SUBTYPE
:
1533 network_addr
= lldp_network_addr_print(ndo
, tptr
+1, tlv_len
-1);
1534 if (network_addr
== NULL
) {
1537 ND_PRINT((ndo
, "%s", network_addr
));
1548 if (ndo
->ndo_vflag
) {
1552 ND_PRINT((ndo
, ": TTL %us", EXTRACT_16BITS(tptr
)));
1556 case LLDP_PORT_DESCR_TLV
:
1557 if (ndo
->ndo_vflag
) {
1558 ND_PRINT((ndo
, ": "));
1559 safeputs(ndo
, tptr
, tlv_len
);
1563 case LLDP_SYSTEM_NAME_TLV
:
1565 * The system name is also print in non-verbose mode
1566 * similar to the CDP printer.
1568 ND_PRINT((ndo
, ": "));
1569 safeputs(ndo
, tptr
, tlv_len
);
1572 case LLDP_SYSTEM_DESCR_TLV
:
1573 if (ndo
->ndo_vflag
) {
1574 ND_PRINT((ndo
, "\n\t "));
1575 safeputs(ndo
, tptr
, tlv_len
);
1579 case LLDP_SYSTEM_CAP_TLV
:
1580 if (ndo
->ndo_vflag
) {
1582 * XXX - IEEE Std 802.1AB-2009 says the first octet
1583 * if a chassis ID subtype, with the system
1584 * capabilities and enabled capabilities following
1590 cap
= EXTRACT_16BITS(tptr
);
1591 ena_cap
= EXTRACT_16BITS(tptr
+2);
1592 ND_PRINT((ndo
, "\n\t System Capabilities [%s] (0x%04x)",
1593 bittok2str(lldp_cap_values
, "none", cap
), cap
));
1594 ND_PRINT((ndo
, "\n\t Enabled Capabilities [%s] (0x%04x)",
1595 bittok2str(lldp_cap_values
, "none", ena_cap
), ena_cap
));
1599 case LLDP_MGMT_ADDR_TLV
:
1600 if (ndo
->ndo_vflag
) {
1601 if (!lldp_mgmt_addr_tlv_print(ndo
, tptr
, tlv_len
)) {
1607 case LLDP_PRIVATE_TLV
:
1608 if (ndo
->ndo_vflag
) {
1612 oui
= EXTRACT_24BITS(tptr
);
1613 ND_PRINT((ndo
, ": OUI %s (0x%06x)", tok2str(oui_values
, "Unknown", oui
), oui
));
1616 case OUI_IEEE_8021_PRIVATE
:
1617 hexdump
= lldp_private_8021_print(ndo
, tptr
, tlv_len
);
1619 case OUI_IEEE_8023_PRIVATE
:
1620 hexdump
= lldp_private_8023_print(ndo
, tptr
, tlv_len
);
1623 hexdump
= lldp_private_iana_print(ndo
, tptr
, tlv_len
);
1626 hexdump
= lldp_private_tia_print(ndo
, tptr
, tlv_len
);
1629 hexdump
= lldp_private_dcbx_print(ndo
, tptr
, tlv_len
);
1643 /* do we also want to see a hex dump ? */
1644 if (ndo
->ndo_vflag
> 1 || (ndo
->ndo_vflag
&& hexdump
)) {
1645 print_unknown_data(ndo
, tptr
, "\n\t ", tlv_len
);
1653 ND_PRINT((ndo
, "\n\t[|LLDP]"));
1658 * c-style: whitesmith