]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ipcomp.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-ipcomp.c
index 58cb1b18a957cfbcb8bebc38c3c65f5e6d982ba1..a88f679750621343fa716dfcaae59f55df1ca1f8 100644 (file)
 
 /* \summary: IP Payload Compression Protocol (IPComp) printer */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include <config.h>
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include "netdissect.h"
 #include "extract.h"
@@ -42,11 +40,11 @@ ipcomp_print(netdissect_options *ndo, const u_char *bp)
        const struct ipcomp *ipcomp;
        uint16_t cpi;
 
+       ndo->ndo_protocol = "ipcomp";
        ipcomp = (const struct ipcomp *)bp;
-       ND_TCHECK(*ipcomp);
-       cpi = EXTRACT_BE_U_2(ipcomp->comp_cpi);
+       cpi = GET_BE_U_2(ipcomp->comp_cpi);
 
-       ND_PRINT((ndo, "IPComp(cpi=0x%04x)", cpi));
+       ND_PRINT("IPComp(cpi=0x%04x)", cpi);
 
        /*
         * XXX - based on the CPI, we could decompress the packet here.
@@ -61,9 +59,4 @@ ipcomp_print(netdissect_options *ndo, const u_char *bp)
         * stops - there's nothing more it can do with a compressed
         * payload.
         */
-       return;
-
-trunc:
-       ND_PRINT((ndo, "[|IPCOMP]"));
-       return;
 }