]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-openflow-1.0.c
Rework "Update more link-layer dissectors to void functions"
[tcpdump] / print-openflow-1.0.c
index d1cafc5dae8e3a8a7400b93c395c7e7c0375cb13..71d8a7c1f215a3a508879b61cf31496120fe35ab 100644 (file)
@@ -6,7 +6,7 @@
  * 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
@@ -700,7 +700,7 @@ vlan_str(const uint16_t vid)
 
        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;
 }
@@ -709,7 +709,7 @@ static const char *
 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;
 }
@@ -813,7 +813,7 @@ of10_bsn_message_print(netdissect_options *ndo,
                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:
@@ -1128,7 +1128,7 @@ of10_packet_data_print(netdissect_options *ndo,
        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;
 
@@ -1155,7 +1155,7 @@ of10_phy_ports_print(netdissect_options *ndo,
                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);
@@ -1369,12 +1369,12 @@ of10_match_print(netdissect_options *ndo,
        /* 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);
@@ -1416,13 +1416,13 @@ of10_match_print(netdissect_options *ndo,
        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);
@@ -1546,7 +1546,7 @@ of10_actions_print(netdissect_options *ndo,
                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);
@@ -1556,7 +1556,7 @@ of10_actions_print(netdissect_options *ndo,
                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:
@@ -1727,7 +1727,7 @@ of10_port_mod_print(netdissect_options *ndo,
        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);