/* \summary: IEEE 802.1ab Link Layer Discovery Protocol (LLDP) printer */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
#define LLDP_PRIVATE_8021_SUBTYPE_PFC_CONFIGURATION 11
#define LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY 12
#define LLDP_PRIVATE_8021_SUBTYPE_EVB 13
-#define LLDP_PRIVATE_8021_SUBTYPE_CDCP 14
+#define LLDP_PRIVATE_8021_SUBTYPE_CDCP 14
static const struct tok lldp_8021_subtype_values[] = {
{ LLDP_PRIVATE_8021_SUBTYPE_PORT_VLAN_ID, "Port VLAN Id"},
#define LLDP_MDI_PAIR_CONTROL_ABILITY (1 << 3)
static const struct tok lldp_mdi_values[] = {
- { LLDP_MDI_PORT_CLASS, "PSE"},
- { LLDP_MDI_POWER_SUPPORT, "supported"},
- { LLDP_MDI_POWER_STATE, "enabled"},
- { LLDP_MDI_PAIR_CONTROL_ABILITY, "can be controlled"},
+ { LLDP_MDI_PORT_CLASS, "PSE"},
+ { LLDP_MDI_POWER_SUPPORT, "supported"},
+ { LLDP_MDI_POWER_STATE, "enabled"},
+ { LLDP_MDI_PAIR_CONTROL_ABILITY, "can be controlled"},
{ 0, NULL}
};
tptr = tptr + 9;
/* Decode each civic address element */
- while (lci_len > 0) {
+ while (lci_len != 0) {
if (lci_len < 2) {
return hexdump;
}
tptr += 2;
lci_len -= 2;
- ND_PRINT("\n\t CA type \'%s\' (%u), length %u: ",
+ ND_PRINT("\n\t CA type '%s' (%u), length %u: ",
tok2str(lldp_tia_location_lci_catype_values, "unknown", ca_type),
ca_type, ca_len);
len--;
af = GET_U_1(tptr);
switch (af) {
- case AFNUM_INET:
+ case AFNUM_IP:
if (len < sizeof(nd_ipv4))
return NULL;
pfunc = ipaddr_string;
break;
- case AFNUM_INET6:
+ case AFNUM_IP6:
if (len < sizeof(nd_ipv6))
return NULL;
pfunc = ip6addr_string;
break;
case AFNUM_802:
- if (len < MAC_ADDR_LEN)
+ if (len < MAC48_LEN)
return NULL;
- pfunc = etheraddr_string;
+ pfunc = mac48_string;
break;
default:
pfunc = NULL;
if (tlv_len < 1+6) {
goto trunc;
}
- ND_PRINT("%s", GET_ETHERADDR_STRING(tptr + 1));
+ ND_PRINT("%s", GET_MAC48_STRING(tptr + 1));
break;
case LLDP_CHASSIS_INTF_NAME_SUBTYPE: /* fall through */
if (tlv_len < 1+6) {
goto trunc;
}
- ND_PRINT("%s", GET_ETHERADDR_STRING(tptr + 1));
+ ND_PRINT("%s", GET_MAC48_STRING(tptr + 1));
break;
case LLDP_PORT_INTF_NAME_SUBTYPE: /* fall through */