]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-arp.c
ICMPv6: Fix some truncation codes
[tcpdump] / print-arp.c
index 897317dc744f2d81750b5d0ca3eda64540feb8f2..034a0566f5796d9e2e1cbf458e878c195314fc08 100644 (file)
 /* \summary: Address Resolution Protocol (ARP) printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include <string.h>
 
@@ -34,7 +34,6 @@
 #include "ethertype.h"
 #include "extract.h"
 
-static const char tstr[] = "[|ARP]";
 
 /*
  * Address Resolution Protocol.
@@ -266,7 +265,7 @@ atmarp_print(netdissect_options *ndo,
        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;
        }
@@ -349,7 +348,7 @@ atmarp_print(netdissect_options *ndo,
         return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 void
@@ -359,6 +358,7 @@ arp_print(netdissect_options *ndo,
        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);
 
@@ -385,7 +385,7 @@ arp_print(netdissect_options *ndo,
        }
 
        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;
        }
@@ -468,12 +468,5 @@ arp_print(netdissect_options *ndo,
 
        return;
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
-
-/*
- * Local Variables:
- * c-style: bsd
- * End:
- */
-