X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/1cde6435df23876fb88998e38739def0dc7dca47..1a04b92e365f5ed01ca38619b41bcc4fc9cbd63c:/print-nflog.c diff --git a/print-nflog.c b/print-nflog.c index bb375c10..622743bf 100644 --- a/print-nflog.c +++ b/print-nflog.c @@ -25,22 +25,25 @@ * DAMAGE. */ -#define NETDISSECT_REWORKED +/* \summary: DLT_NFLOG printer */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include -#include "interface.h" +#include "netdissect.h" #if defined(DLT_NFLOG) && defined(HAVE_PCAP_NFLOG_H) #include static const struct tok nflog_values[] = { { AF_INET, "IPv4" }, +#ifdef AF_INET6 { AF_INET6, "IPv6" }, - { 0, NULL } +#endif /*AF_INET6*/ + { 0, NULL } }; static inline void @@ -69,17 +72,17 @@ nflog_if_print(netdissect_options *ndo, { const nflog_hdr_t *hdr = (const nflog_hdr_t *)p; const nflog_tlv_t *tlv; - u_int16_t size; - u_int16_t h_size = sizeof(nflog_hdr_t); + uint16_t size; + uint16_t h_size = sizeof(nflog_hdr_t); 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; } @@ -143,11 +146,11 @@ nflog_if_print(netdissect_options *ndo, ip_print(ndo, p, length); break; -#ifdef INET6 +#ifdef AF_INET6 case AF_INET6: ip6_print(ndo, p, length); break; -#endif /*INET6*/ +#endif /* AF_INET6 */ default: if (!ndo->ndo_eflag)