]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-msdp.c
On Solaris, for 64-bit builds, use the 64-bit pcap-config.
[tcpdump] / print-msdp.c
index bb3b95b89446c6dff5ecdeb2c17185b59ad565f6..7845116bdc7e03001d64b4e07a1ba2ece4441c60 100644 (file)
@@ -36,17 +36,16 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length)
        unsigned int type, len;
 
        ndo->ndo_protocol = "msdp";
-       ND_TCHECK_3(sp);
+       ND_PRINT(": ");
+       nd_print_protocol(ndo);
        /* See if we think we're at the beginning of a compound packet */
-       type = EXTRACT_U_1(sp);
-       len = EXTRACT_BE_U_2(sp + 1);
+       type = GET_U_1(sp);
+       len = GET_BE_U_2(sp + 1);
        if (len > 1500 || len < 3 || type == 0 || type > MSDP_TYPE_MAX)
                goto trunc;     /* not really truncated, but still not decodable */
-       ND_PRINT(" msdp:");
        while (length != 0) {
-               ND_TCHECK_3(sp);
-               type = EXTRACT_U_1(sp);
-               len = EXTRACT_BE_U_2(sp + 1);
+               type = GET_U_1(sp);
+               len = GET_BE_U_2(sp + 1);
                if (len > 1400 || ndo->ndo_vflag)
                        ND_PRINT(" [len %u]", len);
                if (len < 3)
@@ -62,22 +61,20 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length)
                                ND_PRINT(" SA");
                        else
                                ND_PRINT(" SA-Response");
-                       ND_TCHECK_1(sp);
-                       ND_PRINT(" %u entries", EXTRACT_U_1(sp));
-                       if ((u_int)((EXTRACT_U_1(sp) * 12) + 8) < len) {
+                       ND_PRINT(" %u entries", GET_U_1(sp));
+                       if ((u_int)((GET_U_1(sp) * 12) + 8) < len) {
                                ND_PRINT(" [w/data]");
                                if (ndo->ndo_vflag > 1) {
                                        ND_PRINT(" ");
                                        ip_print(ndo, sp +
-                                                EXTRACT_U_1(sp) * 12 + 8 - 3,
-                                                len - (EXTRACT_U_1(sp) * 12 + 8));
+                                                GET_U_1(sp) * 12 + 8 - 3,
+                                                len - (GET_U_1(sp) * 12 + 8));
                                }
                        }
                        break;
                case 2:
                        ND_PRINT(" SA-Request");
-                       ND_TCHECK_5(sp);
-                       ND_PRINT(" for %s", ipaddr_string(ndo, sp + 1));
+                       ND_PRINT(" for %s", GET_IPADDR_STRING(sp + 1));
                        break;
                case 4:
                        ND_PRINT(" Keepalive");
@@ -96,12 +93,5 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length)
        }
        return;
 trunc:
-       ND_PRINT(" [|msdp]");
+       nd_print_trunc(ndo);
 }
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 8
- * End:
- */