vlan_str(const uint16_t vid)
{
static char buf[sizeof("65535 (bogus)")];
- const char *fmt;
if (vid == OFP_VLAN_NONE)
return "NONE";
- fmt = (vid > 0 && vid < 0x0fff) ? "%u" : "%u (bogus)";
- nd_snprintf(buf, sizeof(buf), fmt, vid);
+ snprintf(buf, sizeof(buf), "%u%s", vid,
+ (vid > 0 && vid < 0x0fff) ? "" : " (bogus)");
return buf;
}
pcp_str(const uint8_t pcp)
{
static char buf[sizeof("255 (bogus)")];
- nd_snprintf(buf, sizeof(buf), pcp <= 7 ? "%u" : "%u (bogus)", pcp);
+ snprintf(buf, sizeof(buf), "%u%s", pcp,
+ pcp <= 7 ? "" : " (bogus)");
return buf;
}
ND_TCHECK_LEN(cp, len);
ndo->ndo_vflag -= 3;
ND_PRINT(", frame decoding below\n");
- ether_print(ndo, cp, len, ndo->ndo_snapend - cp, NULL, NULL);
+ ether_print(ndo, cp, len, ND_BYTES_AVAILABLE_AFTER(cp), NULL, NULL);
ndo->ndo_vflag += 3;
return cp + len;
uint32_t wildcards;
uint16_t dl_type;
uint8_t nw_proto;
- u_char nw_bits;
+ u_int nw_bits;
const char *field_name;
/* wildcards */