X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7de355927bb4dac90db045d52a69bf95c841b807..5663cdab5ec8730ade9938c1ace64a4859d9ef7b:/print-arp.c?ds=inline diff --git a/print-arp.c b/print-arp.c index b5047a0d..d9a6535a 100644 --- a/print-arp.c +++ b/print-arp.c @@ -19,26 +19,23 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#ifndef lint -static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.66 2006-03-03 22:53:21 hannes Exp $ (LBL)"; -#endif - +#define NETDISSECT_REWORKED #ifdef HAVE_CONFIG_H #include "config.h" #endif #include -#include #include -#include "netdissect.h" +#include "interface.h" #include "addrtoname.h" #include "ether.h" #include "ethertype.h" #include "extract.h" /* must come after interface.h */ +static const char tstr[] = "[|ARP]"; + /* * Address Resolution Protocol. * @@ -190,7 +187,7 @@ atmarp_addr_print(netdissect_options *ndo, ND_PRINT((ndo, "")); else { ND_PRINT((ndo, "%s", linkaddr_string(ha, LINKADDR_ATM, ha_len))); - if (srca_len != 0) + if (srca_len != 0) ND_PRINT((ndo, ",%s", linkaddr_string(srca, LINKADDR_ATM, srca_len))); } @@ -211,7 +208,7 @@ atmarp_print(netdissect_options *ndo, op = ATMOP(ap); if (!ND_TTEST2(*aar_tpa(ap), ATMTPROTO_LEN(ap))) { - ND_PRINT((ndo, "[|ARP]")); + ND_PRINT((ndo, "%s", tstr)); ND_DEFAULTPRINT((const u_char *)ap, length); return; } @@ -237,9 +234,9 @@ atmarp_print(netdissect_options *ndo, } /* print operation */ - printf("%s%s ", - ndo->ndo_vflag ? ", " : "", - tok2str(arpop_values, "Unknown (%u)", op)); + ND_PRINT((ndo, "%s%s ", + ndo->ndo_vflag ? ", " : "", + tok2str(arpop_values, "Unknown (%u)", op))); switch (op) { @@ -289,7 +286,7 @@ atmarp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|ARP]")); + ND_PRINT((ndo, "%s", tstr)); } void @@ -306,7 +303,7 @@ arp_print(netdissect_options *ndo, pro = PRO(ap); op = OP(ap); - + /* if its ATM then call the ATM ARP printer for Frame-relay ARP most of the fields are similar to Ethernet so overload the Ethernet Printer @@ -325,7 +322,7 @@ arp_print(netdissect_options *ndo, } if (!ND_TTEST2(*ar_tpa(ap), PROTO_LEN(ap))) { - ND_PRINT((ndo, "[|ARP]")); + ND_PRINT((ndo, "%s", tstr)); ND_DEFAULTPRINT((const u_char *)ap, length); return; } @@ -352,9 +349,9 @@ arp_print(netdissect_options *ndo, } /* print operation */ - printf("%s%s ", - ndo->ndo_vflag ? ", " : "", - tok2str(arpop_values, "Unknown (%u)", op)); + ND_PRINT((ndo, "%s%s ", + ndo->ndo_vflag ? ", " : "", + tok2str(arpop_values, "Unknown (%u)", op))); switch (op) { @@ -406,7 +403,7 @@ arp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|ARP]")); + ND_PRINT((ndo, "%s", tstr)); } /*