]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ppi.c
Note that interfaces may have numerical names.
[tcpdump] / print-ppi.c
index b9f765797ddd4c46cd9783604e9ec9c9e993ea37..3957154007e9f3fdaabd404109126c63c9c1cc30 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 {
@@ -56,6 +56,7 @@ ppi_print(netdissect_options *ndo,
        uint16_t len;
        uint32_t dlt;
        uint32_t hdrlen;
+       struct pcap_pkthdr nhdr;
 
        if (caplen < sizeof(ppi_header_t)) {
                ND_PRINT((ndo, "[|ppi]"));
@@ -86,7 +87,10 @@ ppi_print(netdissect_options *ndo,
        p += len;
 
        if ((printer = lookup_printer(dlt)) != NULL) {
-               hdrlen = printer(ndo, h, p);
+               nhdr = *h;
+               nhdr.caplen = caplen;
+               nhdr.len = length;
+               hdrlen = printer(ndo, &nhdr, p);
        } else {
                if (!ndo->ndo_eflag)
                        ppi_header_print(ndo, (const u_char *)hdr, length + len);