* https://web.archive.org/web/20161025044402/http://brantleycoilecompany.com/AoEr11.pdf
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
+#define ND_LONGJMP_FROM_TCHECK
#include "netdissect.h"
#include "extract.h"
#include "addrtoname.h"
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 }
};
#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 }
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 */
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
/* 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
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++) {
cp += 1;
len -= 1;
/* Ethernet Address */
- ND_PRINT(", Ethernet Address: %s", GET_ETHERADDR_STRING(cp));
- cp += MAC_ADDR_LEN;
- len -= MAC_ADDR_LEN;
+ ND_PRINT(", Ethernet Address: %s", GET_MAC48_STRING(cp));
+ cp += MAC48_LEN;
+ len -= MAC48_LEN;
}
return;
invalid:
nd_print_invalid(ndo);
ND_TCHECK_LEN(cp, len);
- return;
-trunc:
- nd_trunc(ndo);
}
static void
{
uint8_t nmacs, i;
- if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % MAC_ADDR_LEN)
+ if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % MAC48_LEN)
goto invalid;
/* RCmd */
ND_PRINT("\n\tRCmd: %s",
cp += 1;
len -= 1;
ND_PRINT(", NMacs: %u", nmacs);
- if (nmacs * MAC_ADDR_LEN != len)
+ if (nmacs * MAC48_LEN != len)
goto invalid;
/* addresses */
for (i = 0; i < nmacs; i++) {
- ND_PRINT("\n\tEthernet Address %u: %s", i, GET_ETHERADDR_STRING(cp));
- cp += MAC_ADDR_LEN;
- len -= MAC_ADDR_LEN;
+ ND_PRINT("\n\tEthernet Address %u: %s", i, GET_MAC48_STRING(cp));
+ cp += MAC48_LEN;
+ len -= MAC48_LEN;
}
return;
invalid:
nd_print_invalid(ndo);
ND_TCHECK_LEN(cp, len);
- return;
-trunc:
- nd_trunc(ndo);
}
/* cp points to the Ver/Flags octet */
invalid:
nd_print_invalid(ndo);
ND_TCHECK_LEN(cp, len);
- return;
-trunc:
- nd_trunc(ndo);
}
void
invalid:
nd_print_invalid(ndo);
ND_TCHECK_LEN(cp, len);
- return;
-trunc:
- nd_trunc(ndo);
}