]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ppi.c
Default to first interface from pcap_findalldevs()
[tcpdump] / print-ppi.c
index dde1cdb0be51de95ade781f047080e64c99aa86c..ddf674d261fd44fa00f10bf286990ccd04156b11 100644 (file)
@@ -6,9 +6,9 @@
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "extract.h"
 
 typedef struct ppi_header {
@@ -50,7 +50,7 @@ ppi_print(netdissect_options *ndo,
                const struct pcap_pkthdr *h, const u_char *p)
 {
        if_printer printer;
-       ppi_header_t *hdr;
+       const ppi_header_t *hdr;
        u_int caplen = h->caplen;
        u_int length = h->len;
        uint16_t len;
@@ -62,7 +62,7 @@ ppi_print(netdissect_options *ndo,
                return (caplen);
        }
 
-       hdr = (ppi_header_t *)p;
+       hdr = (const ppi_header_t *)p;
        len = EXTRACT_LE_16BITS(&hdr->ppi_len);
        if (caplen < len) {
                /*
@@ -89,7 +89,7 @@ ppi_print(netdissect_options *ndo,
                hdrlen = printer(ndo, h, p);
        } else {
                if (!ndo->ndo_eflag)
-                       ppi_header_print(ndo, (u_char *)hdr, length + len);
+                       ppi_header_print(ndo, (const u_char *)hdr, length + len);
 
                if (!ndo->ndo_suppress_default_print)
                        ND_DEFAULTPRINT(p, caplen);