#include "ethertype.h"
#include "extract.h"
-static const char tstr[] = "[|ARP]";
/*
* Address Resolution Protocol.
#define ATMTPA(ap) (aar_tpa(ap))
static int
-isnonzero(const u_char *a, size_t len)
+isnonzero(netdissect_options *ndo, const u_char *a, size_t len)
{
while (len > 0) {
if (EXTRACT_U_1(a) != 0)
op = ATMOP(ap);
if (!ND_TTEST_LEN(aar_tpa(ap), ATMTPROTO_LEN(ap))) {
- ND_PRINT("%s", tstr);
+ nd_print_trunc(ndo);
ND_DEFAULTPRINT((const u_char *)ap, length);
return;
}
return;
trunc:
- ND_PRINT("%s", tstr);
+ nd_print_trunc(ndo);
}
void
const struct arp_pkthdr *ap;
u_short pro, hrd, op, linkaddr;
+ ndo->ndo_protocol = "arp";
ap = (const struct arp_pkthdr *)bp;
ND_TCHECK_SIZE(ap);
}
if (!ND_TTEST_LEN(TPA(ap), PROTO_LEN(ap))) {
- ND_PRINT("%s", tstr);
+ nd_print_trunc(ndo);
ND_DEFAULTPRINT((const u_char *)ap, length);
return;
}
case ARPOP_REQUEST:
ND_PRINT("who-has ");
tpaddr_print_ip(ndo, ap, pro);
- if (isnonzero((const u_char *)THA(ap), HRD_LEN(ap)))
+ if (isnonzero(ndo, (const u_char *)THA(ap), HRD_LEN(ap)))
ND_PRINT(" (%s)",
linkaddr_string(ndo, THA(ap), linkaddr, HRD_LEN(ap)));
ND_PRINT(" tell ");
return;
trunc:
- ND_PRINT("%s", tstr);
+ nd_print_trunc(ndo);
}
-
-/*
- * Local Variables:
- * c-style: bsd
- * End:
- */
-