Use the header file for information about LINKTYPE_NFLOG files.
Don't build the NFLOG printer if we don't have that header file.
Fix some checks for pcap/XXX.h header files to look for
"tcpdump-stdinc.h" rather than <tcpdump-stdinc.h>, so that we don't fail
to find that header.
/* define if libpcap has pcap_list_datalinks() */
#undef HAVE_PCAP_LIST_DATALINKS
+/* Define to 1 if you have the <pcap/nflog.h> header file. */
+#undef HAVE_PCAP_NFLOG_H
+
/* Define to 1 if you have the `pcap_setdirection' function. */
#undef HAVE_PCAP_SETDIRECTION
CPPFLAGS="$CPPFLAGS $V_INCLS"
for ac_header in pcap/bluetooth.h
do :
- ac_fn_c_check_header_compile "$LINENO" "pcap/bluetooth.h" "ac_cv_header_pcap_bluetooth_h" "#include <tcpdump-stdinc.h>
+ ac_fn_c_check_header_compile "$LINENO" "pcap/bluetooth.h" "ac_cv_header_pcap_bluetooth_h" "#include \"tcpdump-stdinc.h\"
"
if test "x$ac_cv_header_pcap_bluetooth_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
done
+for ac_header in pcap/nflog.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "pcap/nflog.h" "ac_cv_header_pcap_nflog_h" "#include \"tcpdump-stdinc.h\"
+"
+if test "x$ac_cv_header_pcap_nflog_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_NFLOG_H 1
+_ACEOF
+
+fi
+
+done
+
for ac_header in pcap/usb.h
do :
- ac_fn_c_check_header_compile "$LINENO" "pcap/usb.h" "ac_cv_header_pcap_usb_h" "#include <tcpdump-stdinc.h>
+ ac_fn_c_check_header_compile "$LINENO" "pcap/usb.h" "ac_cv_header_pcap_usb_h" "#include \"tcpdump-stdinc.h\"
"
if test "x$ac_cv_header_pcap_usb_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#
savedcppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $V_INCLS"
-AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include <tcpdump-stdinc.h>])
-AC_CHECK_HEADERS(pcap/usb.h,,,[#include <tcpdump-stdinc.h>])
+AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include "tcpdump-stdinc.h"])
+AC_CHECK_HEADERS(pcap/nflog.h,,,[#include "tcpdump-stdinc.h"])
+AC_CHECK_HEADERS(pcap/usb.h,,,[#include "tcpdump-stdinc.h"])
CPPFLAGS="$savedcppflags"
AC_PROG_RANLIB
#include "netdissect.h"
#include "interface.h"
-/*
- * Structure of an NFLOG header and TLV parts, as described at
- * http://www.tcpdump.org/linktypes/LINKTYPE_NFLOG.html
- */
-typedef struct nflog_hdr {
- u_int8_t nflog_family; /* adress family */
- u_int8_t nflog_version; /* version */
- u_int16_t nflog_rid; /* resource ID */
-} nflog_hdr_t;
-
-typedef struct nflog_tlv {
- u_int16_t tlv_length; /* tlv length */
- u_int16_t tlv_type; /* tlv type */
- void* tlv_value; /* tlv value */
-} nflog_tlv_t;
-
-#ifdef DLT_NFLOG
-
-#define NFULA_PAYLOAD 9
+#if defined(DLT_NFLOG) && defined(HAVE_PCAP_NFLOG_H)
+#include <pcap/nflog.h>
static const struct tok nflog_values[] = {
{ AF_INET, "IPv4" },
switch (hdr->nflog_family) {
case AF_INET:
- ip_print(ndo, p, length);
+ ip_print(ndo, p, length);
break;
#ifdef INET6
return h_size;
}
-#endif /* DLT_NFLOG */
+#endif /* defined(DLT_NFLOG) && defined(HAVE_PCAP_NFLOG_H) */
#ifdef DLT_NETANALYZER_TRANSPARENT
{ netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT },
#endif
-#ifdef DLT_NFLOG
+#if defined(DLT_NFLOG) && defined(HAVE_PCAP_NFLOG_H)
{ nflog_if_print, DLT_NFLOG},
#endif
{ NULL, 0 },