X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/c9638df58e13230f9b84fb7ac33846fee804af43..HEAD:/print-decnet.c diff --git a/print-decnet.c b/print-decnet.c index 85ccf267..989776b4 100644 --- a/print-decnet.c +++ b/print-decnet.c @@ -20,16 +20,21 @@ */ /* \summary: DECnet printer */ +/* + * specification: Section 10.0 MESSAGES + * DECnet Digital Network Architecture + * Phase IV + * Routing Layer Functional Specification + * Order No. AA-X435A-TK + * Version 2.0.0 December 1983 + */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" #include #include -#include #define ND_LONGJMP_FROM_TCHECK #include "netdissect.h" @@ -53,7 +58,7 @@ typedef nd_uint32_t longword; /* 4 bytes field */ * Definitions for DECNET Phase IV protocol headers */ typedef union { - nd_byte dne_addr[MAC_ADDR_LEN]; /* full Ethernet address */ + nd_mac48 dne_addr; /* full Ethernet address */ struct { nd_byte dne_hiord[4]; /* DECnet HIORD prefix */ nd_byte dne_nodeaddr[2]; /* DECnet node address */ @@ -479,13 +484,18 @@ decnet_print(netdissect_options *ndo, ndo->ndo_protocol = "decnet"; if (length < sizeof(struct shorthdr)) { - ND_PRINT(" (length %u < %u)", length, (unsigned)sizeof(struct shorthdr)); + ND_PRINT(" (length %u < %zu)", length, sizeof(struct shorthdr)); goto invalid; } + /* + * This length does not seem to be in any specification, but it is present + * in the test case packet capture, which is consistent with the Wireshark + * protocol decoder. + */ pktlen = GET_LE_U_2(ap); if (pktlen < sizeof(struct shorthdr)) { - ND_PRINT(" (pktlen %u < %u)", pktlen, (unsigned)sizeof(struct shorthdr)); + ND_PRINT(" (pktlen %u < %zu)", pktlen, sizeof(struct shorthdr)); goto invalid; } if (pktlen > length) { @@ -530,7 +540,7 @@ decnet_print(netdissect_options *ndo, switch (mflags & RMF_MASK) { case RMF_LONG: if (length < sizeof(struct longhdr)) { - ND_PRINT(" (length %u < %u)", length, (unsigned)sizeof(struct longhdr)); + ND_PRINT(" (length %u < %zu)", length, sizeof(struct longhdr)); goto invalid; } ND_TCHECK_SIZE(&rhp->rh_long); @@ -800,7 +810,7 @@ print_nsp(netdissect_options *ndo, u_int dst, src, flags; if (nsplen < sizeof(struct nsphdr)) { - ND_PRINT(" (nsplen %u < %u)", nsplen, (unsigned)sizeof(struct nsphdr)); + ND_PRINT(" (nsplen %u < %zu)", nsplen, sizeof(struct nsphdr)); goto invalid; } flags = GET_U_1(nsphp->nh_flags);