/* \summary: IEEE 802.1ab Link Layer Discovery Protocol (LLDP) printer */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
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 */