]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ppi.c
NDOize more small decoders
[tcpdump] / print-ppi.c
index b3b71f27435d3ce90158426a2c98a4d8bd2ce9eb..de6ec4af4b94d72e4d58f63086cbb0a479205b1e 100644 (file)
@@ -7,13 +7,18 @@
 
 #include <tcpdump-stdinc.h>
 
-#include <stdio.h>
-#include <pcap.h>
-
 #include "netdissect.h"
 #include "interface.h"
 #include "extract.h"
-#include "ppi.h"
+
+typedef struct ppi_header {
+       uint8_t         ppi_ver;
+       uint8_t         ppi_flags;
+       uint16_t        ppi_len;
+       uint32_t        ppi_dlt;
+} ppi_header_t;
+
+#define        PPI_HDRLEN      8
 
 #ifdef DLT_PPI
 
@@ -21,10 +26,11 @@ static inline void
 ppi_header_print(struct netdissect_options *ndo, const u_char *bp, u_int length)
 {
        const ppi_header_t *hdr;
-       hdr = (const ppi_header_t *)bp;
        u_int32_t dlt;
        u_int16_t len;
 
+       hdr = (const ppi_header_t *)bp;
+
        len = EXTRACT_16BITS(&hdr->ppi_len);
        dlt = EXTRACT_32BITS(&hdr->ppi_dlt);