]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-atalk.c
IPv6: Print the protocol name before any test
[tcpdump] / print-atalk.c
index 4e1fa3d2163edd9c7536d0a6a2d3e277196edb76..659463a925c9b9c4c095d2f0443476034d0ec5b7 100644 (file)
@@ -125,9 +125,9 @@ struct aarp {
        nd_uint16_t     htype, ptype;
        nd_uint8_t      halen, palen;
        nd_uint16_t     op;
-       nd_mac_addr     hsaddr;
+       nd_mac48        hsaddr;
        uint8_t         psaddr[4];
-       nd_mac_addr     hdaddr;
+       nd_mac48        hdaddr;
        uint8_t         pdaddr[4];
 };
 
@@ -166,7 +166,7 @@ llap_print(netdissect_options *ndo,
        u_int hdrlen;
 
        ndo->ndo_protocol = "llap";
-       ND_LCHECKMSG_ZU(length, sizeof(*lp), "LLAP length");
+       ND_ICHECKMSG_ZU("LLAP length", length, <, sizeof(*lp));
        lp = (const struct LAP *)bp;
        bp += sizeof(*lp);
        length -= sizeof(*lp);
@@ -175,7 +175,7 @@ llap_print(netdissect_options *ndo,
 
        case lapShortDDP:
                ndo->ndo_protocol = "sddp";
-               ND_LCHECKMSG_U(length, ddpSSize, "SDDP length");
+               ND_ICHECKMSG_U("SDDP length", length, <, ddpSSize);
                sdp = (const struct atShortDDP *)bp;
                ND_PRINT("%s.%s",
                    ataddr_string(ndo, 0, GET_U_1(lp->src)),
@@ -192,7 +192,7 @@ llap_print(netdissect_options *ndo,
 
        case lapDDP:
                ndo->ndo_protocol = "ddp";
-               ND_LCHECKMSG_U(length, ddpSize, "DDP length");
+               ND_ICHECKMSG_U("DDP length", length, <, ddpSize);
                dp = (const struct atDDP *)bp;
                snet = GET_BE_U_2(dp->srcNet);
                ND_PRINT("%s.%s",
@@ -236,7 +236,7 @@ atalk_print(netdissect_options *ndo,
         if(!ndo->ndo_eflag)
             ND_PRINT("AT ");
 
-       ND_LCHECK_U(length, ddpSize);
+       ND_ICHECK_U(length, <, ddpSize);
        dp = (const struct atDDP *)bp;
        snet = GET_BE_U_2(dp->srcNet);
        ND_PRINT("%s.%s", ataddr_string(ndo, snet, GET_U_1(dp->srcNode)),
@@ -267,11 +267,11 @@ aarp_print(netdissect_options *ndo,
        ndo->ndo_protocol = "aarp";
        ND_PRINT("aarp ");
        ap = (const struct aarp *)bp;
-       ND_LCHECK_ZU(length, sizeof(*ap));
+       ND_ICHECK_ZU(length, <, sizeof(*ap));
        ND_TCHECK_SIZE(ap);
        if (GET_BE_U_2(ap->htype) == 1 &&
            GET_BE_U_2(ap->ptype) == ETHERTYPE_ATALK &&
-           GET_U_1(ap->halen) == MAC_ADDR_LEN && GET_U_1(ap->palen) == 4)
+           GET_U_1(ap->halen) == MAC48_LEN && GET_U_1(ap->palen) == 4)
                switch (GET_BE_U_2(ap->op)) {
 
                case 1:                         /* request */
@@ -279,7 +279,7 @@ aarp_print(netdissect_options *ndo,
                        return;
 
                case 2:                         /* response */
-                       ND_PRINT("reply %s is-at %s", AT(psaddr), GET_ETHERADDR_STRING(ap->hsaddr));
+                       ND_PRINT("reply %s is-at %s", AT(psaddr), GET_MAC48_STRING(ap->hsaddr));
                        return;
 
                case 3:                         /* probe (oy!) */
@@ -331,7 +331,7 @@ atp_print(netdissect_options *ndo,
        uint32_t data;
 
        ndo->ndo_protocol = "atp";
-       ND_LCHECKMSG_ZU(length, sizeof(*ap), "ATP length");
+       ND_ICHECKMSG_ZU("ATP length", length, <, sizeof(*ap));
        length -= sizeof(*ap);
        control = GET_U_1(ap->control);
        switch (control & 0xc0) {
@@ -459,7 +459,7 @@ nbp_print(netdissect_options *ndo,
        u_int i;
 
        /* must be room for at least one tuple */
-       ND_LCHECKMSG_U(length, nbpHeaderSize + 8, "undersized-nbp");
+       ND_ICHECKMSG_U("undersized-nbp", length, <, nbpHeaderSize + 8);
        length -= nbpHeaderSize;
        control = GET_U_1(np->control);
        ND_PRINT(" nbp-%s", tok2str(nbp_str, "0x%x", control & 0xf0));