* From: NetBSD: print-arcnet.c,v 1.2 2000/04/24 13:02:28 itojun Exp
*/
-#define NETDISSECT_REWORKED
+/* \summary: Attached Resource Computer NETwork (ARCNET) printer */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
-#include "interface.h"
+#include "netdissect.h"
#include "extract.h"
/*
u_int seqid = 0;
u_char arc_type;
- if (caplen < ARC_HDRLEN) {
+ if (caplen < ARC_HDRLEN || length < ARC_HDRLEN) {
ND_PRINT((ndo, "[|arcnet]"));
return (caplen);
}
}
if (phds) {
- if (caplen < ARC_HDRNEWLEN) {
+ if (caplen < ARC_HDRNEWLEN || length < ARC_HDRNEWLEN) {
arcnet_print(ndo, p, length, 0, 0, 0);
ND_PRINT((ndo, "[|phds]"));
return (caplen);
}
if (ap->arc_flag == 0xff) {
- if (caplen < ARC_HDRNEWLEN_EXC) {
+ if (caplen < ARC_HDRNEWLEN_EXC || length < ARC_HDRNEWLEN_EXC) {
arcnet_print(ndo, p, length, 0, 0, 0);
ND_PRINT((ndo, "[|phds extended]"));
return (caplen);
int archdrlen = 0;
u_char arc_type;
- if (caplen < ARC_LINUX_HDRLEN) {
+ if (caplen < ARC_LINUX_HDRLEN || length < ARC_LINUX_HDRLEN) {
ND_PRINT((ndo, "[|arcnet]"));
return (caplen);
}
switch (arc_type) {
default:
archdrlen = ARC_LINUX_HDRNEWLEN;
- if (caplen < ARC_LINUX_HDRNEWLEN) {
+ if (caplen < ARC_LINUX_HDRNEWLEN || length < ARC_LINUX_HDRNEWLEN) {
ND_PRINT((ndo, "[|arcnet]"));
return (caplen);
}
ip_print(ndo, p, length);
return (1);
-#ifdef INET6
case ARCTYPE_INET6:
ip6_print(ndo, p, length);
return (1);
-#endif /*INET6*/
case ARCTYPE_ARP_OLD:
case ARCTYPE_ARP: