]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-null.c
Default to first interface from pcap_findalldevs()
[tcpdump] / print-null.c
index 16330b9431dd82e0f7b173b4cffbc2da3770b69c..6e05a138d1779abacfa83898db63fd81a7940393 100644 (file)
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
 #include <string.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "af.h"
 
 /*
@@ -82,7 +82,7 @@ null_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
                return (NULL_HDRLEN);
        }
 
-       memcpy((char *)&family, (char *)p, sizeof(family));
+       memcpy((char *)&family, (const char *)p, sizeof(family));
 
        /*
         * This isn't necessarily in our host byte order; if this is
@@ -108,20 +108,18 @@ null_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
                ip_print(ndo, p, length);
                break;
 
-#ifdef INET6
        case BSD_AFNUM_INET6_BSD:
        case BSD_AFNUM_INET6_FREEBSD:
        case BSD_AFNUM_INET6_DARWIN:
                ip6_print(ndo, p, length);
                break;
-#endif
 
        case BSD_AFNUM_ISO:
-               isoclns_print(p, length, caplen);
+               isoclns_print(ndo, p, length, caplen);
                break;
 
        case BSD_AFNUM_APPLETALK:
-               atalk_print(p, length);
+               atalk_print(ndo, p, length);
                break;
 
        case BSD_AFNUM_IPX:
@@ -133,7 +131,7 @@ null_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
                if (!ndo->ndo_eflag)
                        null_hdr_print(ndo, family, length + NULL_HDRLEN);
                if (!ndo->ndo_suppress_default_print)
-                       ndo->ndo_default_print(ndo, p, caplen);
+                       ND_DEFAULTPRINT(p, caplen);
        }
 
        return (NULL_HDRLEN);