]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-aoe.c
bgp: Parse BGP extended message support capability
[tcpdump] / print-aoe.c
index 4ede55dc3662d7a77c001c3f4f62cad64e43bd3f..9704fd87ed56823f0b5709312741db0aed63e60b 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "netdissect-stdinc.h"
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "extract.h"
 #include "addrtoname.h"
@@ -71,8 +72,8 @@ static const struct tok cmdcode_str[] = {
 static const struct tok aoev1_flag_str[] = {
        { AOEV1_FLAG_R, "Response" },
        { AOEV1_FLAG_E, "Error"    },
-       { 0x02,         "MBZ-0x02" },
-       { 0x01,         "MBZ-0x01" },
+       { 0x02,         "MBZ-1"    },
+       { 0x01,         "MBZ-0"    },
        { 0, NULL }
 };
 
@@ -91,13 +92,13 @@ static const struct tok aoev1_errcode_str[] = {
 #define AOEV1_AFLAG_A 0x02
 #define AOEV1_AFLAG_W 0x01
 
-static const struct tok aoev1_aflag_str[] = {
-       { 0x08,          "MBZ-0x08" },
+static const struct tok aoev1_aflag_bitmap_str[] = {
+       { 0x80,          "MBZ-7"    },
        { AOEV1_AFLAG_E, "Ext48"    },
-       { 0x06,          "MBZ-0x06" },
+       { 0x20,          "MBZ-5"    },
        { AOEV1_AFLAG_D, "Device"   },
-       { 0x04,          "MBZ-0x04" },
-       { 0x03,          "MBZ-0x03" },
+       { 0x08,          "MBZ-3"    },
+       { 0x04,          "MBZ-2"    },
        { AOEV1_AFLAG_A, "Async"    },
        { AOEV1_AFLAG_W, "Write"    },
        { 0, NULL }
@@ -147,7 +148,7 @@ aoev1_issue_print(netdissect_options *ndo,
                goto invalid;
        /* AFlags */
        ND_PRINT("\n\tAFlags: [%s]",
-                bittok2str(aoev1_aflag_str, "none", GET_U_1(cp)));
+                bittok2str(aoev1_aflag_bitmap_str, "none", GET_U_1(cp)));
        cp += 1;
        len -= 1;
        /* Err/Feature */
@@ -191,16 +192,13 @@ aoev1_issue_print(netdissect_options *ndo,
        cp += 2;
        len -= 2;
        /* Data */
-       if (len > AOEV1_ISSUE_ARG_LEN)
+       if (len)
                ND_PRINT("\n\tData: %u bytes", len);
        return;
 
 invalid:
        nd_print_invalid(ndo);
        ND_TCHECK_LEN(cp, len);
-       return;
-trunc:
-       nd_trunc(ndo);
 }
 
 static void
@@ -237,16 +235,13 @@ aoev1_query_print(netdissect_options *ndo,
        /* Config String */
        if (cslen) {
                ND_PRINT("\n\tConfig String (length %u): ", cslen);
-               (void)nd_printn(ndo, cp, cslen, NULL);
+               nd_printjn(ndo, cp, cslen);
        }
        return;
 
 invalid:
        nd_print_invalid(ndo);
        ND_TCHECK_LEN(cp, len);
-       return;
-trunc:
-       nd_trunc(ndo);
 }
 
 static void
@@ -275,7 +270,7 @@ aoev1_mac_print(netdissect_options *ndo,
        cp += 1;
        len -= 1;
        ND_PRINT(", Dir Count: %u", dircount);
-       if (dircount * 8 > len)
+       if (dircount * 8U > len)
                goto invalid;
        /* directives */
        for (i = 0; i < dircount; i++) {
@@ -297,9 +292,6 @@ aoev1_mac_print(netdissect_options *ndo,
 invalid:
        nd_print_invalid(ndo);
        ND_TCHECK_LEN(cp, len);
-       return;
-trunc:
-       nd_trunc(ndo);
 }
 
 static void
@@ -333,9 +325,6 @@ aoev1_reserve_print(netdissect_options *ndo,
 invalid:
        nd_print_invalid(ndo);
        ND_TCHECK_LEN(cp, len);
-       return;
-trunc:
-       nd_trunc(ndo);
 }
 
 /* cp points to the Ver/Flags octet */
@@ -392,9 +381,6 @@ aoev1_print(netdissect_options *ndo,
 invalid:
        nd_print_invalid(ndo);
        ND_TCHECK_LEN(cp, len);
-       return;
-trunc:
-       nd_trunc(ndo);
 }
 
 void
@@ -423,8 +409,5 @@ aoe_print(netdissect_options *ndo,
 invalid:
        nd_print_invalid(ndo);
        ND_TCHECK_LEN(cp, len);
-       return;
-trunc:
-       nd_trunc(ndo);
 }