]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-chdlc.c
ICMPv6: Add the IPv6-Only flag
[tcpdump] / print-chdlc.c
index 73e4909bf2d2cbd99df489e308091779d69b8dfd..bd3133bb646c0b2dbae1b31f52f93c757790c551 100644 (file)
@@ -22,7 +22,7 @@
 /* \summary: Cisco HDLC printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include "netdissect-stdinc.h"
@@ -47,6 +47,7 @@ static const struct tok chdlc_cast_values[] = {
 u_int
 chdlc_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
+       ndo->ndo_protocol = "chdlc_if";
        return chdlc_print(ndo, p, h->len);
 }
 
@@ -56,6 +57,7 @@ chdlc_print(netdissect_options *ndo, const u_char *p, u_int length)
        u_int proto;
        const u_char *bp = p;
 
+       ndo->ndo_protocol = "chdlc";
        if (length < CHDLC_HDRLEN)
                goto trunc;
        ND_TCHECK_LEN(p, CHDLC_HDRLEN);
@@ -111,7 +113,7 @@ chdlc_print(netdissect_options *ndo, const u_char *p, u_int length)
        return (CHDLC_HDRLEN);
 
 trunc:
-       ND_PRINT("[|chdlc]");
+       nd_print_trunc(ndo);
        return ndo->ndo_snapend - bp;
 }
 
@@ -145,6 +147,7 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length)
        const struct cisco_slarp *slarp;
         u_int sec,min,hrs,days;
 
+       ndo->ndo_protocol = "chdlc_slarp";
        ND_PRINT("SLARP (length: %u), ",length);
        if (length < SLARP_MIN_LEN)
                goto trunc;
@@ -166,8 +169,8 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length)
                break;
        case SLARP_REPLY:
                ND_PRINT("reply %s/%s",
-                       ipaddr_string(ndo, &slarp->un.addr.addr),
-                       ipaddr_string(ndo, &slarp->un.addr.mask));
+                       ipaddr_string(ndo, slarp->un.addr.addr),
+                       ipaddr_string(ndo, slarp->un.addr.mask));
                break;
        case SLARP_KEEPALIVE:
                ND_PRINT("keepalive: mineseen=0x%08x, yourseen=0x%08x, reliability=0x%04x",
@@ -199,13 +202,5 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length)
        return;
 
 trunc:
-       ND_PRINT("[|slarp]");
+       nd_print_trunc(ndo);
 }
-
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 8
- * End:
- */