]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-nflog.c
Add EXTRACT_ calls.
[tcpdump] / print-nflog.c
index 95da4cba4f2dba97b6797e06fd5953ffdb4cb7ae..622743bfa80a26c5d80a33bce0db96ae4258c2f1 100644 (file)
  * DAMAGE.
  */
 
-#define NETDISSECT_REWORKED
+/* \summary: DLT_NFLOG printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
-#include "interface.h"
+#include "netdissect.h"
 
 #if defined(DLT_NFLOG) && defined(HAVE_PCAP_NFLOG_H)
 #include <pcap/nflog.h>
 
 static const struct tok nflog_values[] = {
        { AF_INET,              "IPv4" },
-#ifdef INET6
+#ifdef AF_INET6
        { AF_INET6,             "IPv6" },
-#endif /*INET6*/
+#endif /*AF_INET6*/
        { 0,                    NULL }
 };
 
@@ -76,12 +77,12 @@ nflog_if_print(netdissect_options *ndo,
        u_int caplen = h->caplen;
        u_int length = h->len;
 
-       if (caplen < (int) sizeof(nflog_hdr_t) || length < (int) sizeof(nflog_hdr_t)) {
+       if (caplen < sizeof(nflog_hdr_t) || length < sizeof(nflog_hdr_t)) {
                ND_PRINT((ndo, "[|nflog]"));
                return h_size;
        }
 
-       if (!(hdr->nflog_version) == 0) {
+       if (hdr->nflog_version != 0) {
                ND_PRINT((ndo, "version %u (unknown)", hdr->nflog_version));
                return h_size;
        }