* up bogus values of selected message fields and decodes partially captured
* messages up to the snapshot end. It is based on the specification below:
*
- * [OF10] http://www.openflow.org/documents/openflow-spec-v1.0.0.pdf
+ * [OF10] https://web.archive.org/web/20160402132157/http://archive.openflow.org/documents/openflow-spec-v1.0.0.pdf
*
* Most functions in this file take 3 arguments into account:
* * cp -- the pointer to the first octet to decode
if (vid == OFP_VLAN_NONE)
return "NONE";
- nd_snprintf(buf, sizeof(buf), "%u%s", 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), "%u%s", pcp,
+ snprintf(buf, sizeof(buf), "%u%s", pcp,
pcp <= 7 ? "" : " (bogus)");
return buf;
}
cp += 3;
/* mask */
ND_TCHECK_4(cp);
- ND_PRINT(", mask %s", ipaddr_string(ndo, cp));
+ ND_PRINT(", mask %s", GET_IPADDR_STRING(cp));
cp += 4;
break;
case BSN_SET_MIRRORING:
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;
cp += 2;
/* hw_addr */
ND_TCHECK_LEN(cp, MAC_ADDR_LEN);
- ND_PRINT(", hw_addr %s", etheraddr_string(ndo, cp));
+ ND_PRINT(", hw_addr %s", GET_ETHERADDR_STRING(cp));
cp += MAC_ADDR_LEN;
/* name */
ND_TCHECK_LEN(cp, OFP_MAX_PORT_NAME_LEN);
/* dl_src */
ND_TCHECK_LEN(cp, MAC_ADDR_LEN);
if (! (wildcards & OFPFW_DL_SRC))
- ND_PRINT("%smatch dl_src %s", pfx, etheraddr_string(ndo, cp));
+ ND_PRINT("%smatch dl_src %s", pfx, GET_ETHERADDR_STRING(cp));
cp += MAC_ADDR_LEN;
/* dl_dst */
ND_TCHECK_LEN(cp, MAC_ADDR_LEN);
if (! (wildcards & OFPFW_DL_DST))
- ND_PRINT("%smatch dl_dst %s", pfx, etheraddr_string(ndo, cp));
+ ND_PRINT("%smatch dl_dst %s", pfx, GET_ETHERADDR_STRING(cp));
cp += MAC_ADDR_LEN;
/* dl_vlan */
ND_TCHECK_2(cp);
ND_TCHECK_4(cp);
nw_bits = (wildcards & OFPFW_NW_SRC_MASK) >> OFPFW_NW_SRC_SHIFT;
if (nw_bits < 32)
- ND_PRINT("%smatch nw_src %s/%u", pfx, ipaddr_string(ndo, cp), 32 - nw_bits);
+ ND_PRINT("%smatch nw_src %s/%u", pfx, GET_IPADDR_STRING(cp), 32 - nw_bits);
cp += 4;
/* nw_dst */
ND_TCHECK_4(cp);
nw_bits = (wildcards & OFPFW_NW_DST_MASK) >> OFPFW_NW_DST_SHIFT;
if (nw_bits < 32)
- ND_PRINT("%smatch nw_dst %s/%u", pfx, ipaddr_string(ndo, cp), 32 - nw_bits);
+ ND_PRINT("%smatch nw_dst %s/%u", pfx, GET_IPADDR_STRING(cp), 32 - nw_bits);
cp += 4;
/* tp_src */
ND_TCHECK_2(cp);
case OFPAT_SET_DL_DST:
/* dl_addr */
ND_TCHECK_LEN(cp, MAC_ADDR_LEN);
- ND_PRINT(", dl_addr %s", etheraddr_string(ndo, cp));
+ ND_PRINT(", dl_addr %s", GET_ETHERADDR_STRING(cp));
cp += MAC_ADDR_LEN;
/* pad */
ND_TCHECK_6(cp);
case OFPAT_SET_NW_DST:
/* nw_addr */
ND_TCHECK_4(cp);
- ND_PRINT(", nw_addr %s", ipaddr_string(ndo, cp));
+ ND_PRINT(", nw_addr %s", GET_IPADDR_STRING(cp));
cp += 4;
break;
case OFPAT_SET_NW_TOS:
cp += 2;
/* hw_addr */
ND_TCHECK_LEN(cp, MAC_ADDR_LEN);
- ND_PRINT(", hw_addr %s", etheraddr_string(ndo, cp));
+ ND_PRINT(", hw_addr %s", GET_ETHERADDR_STRING(cp));
cp += MAC_ADDR_LEN;
/* config */
ND_TCHECK_4(cp);