]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Checks if libnetfilter_log is found on the system
authorGiuseppe Longo <giuseppelng@gmail.com>
Tue, 10 Dec 2013 12:19:25 +0000 (13:19 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 23 May 2014 10:42:52 +0000 (12:42 +0200)
and enable it if it's specified.

configure.ac

index 86f8a74c55295c01afd17065ddb42ec5506fef4b..983d84825f616122ba5c2f62a9511fdf5d0f0bd7 100644 (file)
 
     AS_IF([test "x$enable_unixsocket" = "xyes"], [AC_DEFINE([BUILD_UNIX_SOCKET], [1], [Unix socket support enabled])])
 
-    #enable support for NFQUEUE
-    AC_ARG_ENABLE(nfqueue,
-           AS_HELP_STRING([--enable-nfqueue], [Enable NFQUEUE support for inline IDP]),,[enable_nfqueue=no])
-    AS_IF([test "x$enable_nfqueue" = "xyes"], [
-        CFLAGS="$CFLAGS -DNFQ"
-
   # libnfnetlink
     case $host in
     *-*-mingw32*)
             CPPFLAGS="${CPPFLAGS} -I${with_libnfnetlink_includes}"
         fi
 
-        AC_CHECK_HEADER(libnfnetlink/libnfnetlink.h,,[AC_ERROR(libnfnetlink.h not found ...)])
-
         if test "$with_libnfnetlink_libraries" != "no"; then
             LDFLAGS="${LDFLAGS}  -L${with_libnfnetlink_libraries}"
         fi
             echo "   for headers etc. when the --with-libnfnetlink-inlcudes directive"
             echo "   is used"
             echo
-            exit 1
         fi
         ;;
     esac
 
+    #enable support for NFQUEUE
+    AC_ARG_ENABLE(nfqueue,
+           AS_HELP_STRING([--enable-nfqueue], [Enable NFQUEUE support for inline IDP]),,[enable_nfqueue=no])
+    AS_IF([test "x$enable_nfqueue" = "xyes"], [
+        CFLAGS="$CFLAGS -DNFQ"
+
   #libnetfilter_queue
     AC_ARG_WITH(libnetfilter_queue_includes,
             [  --with-libnetfilter_queue-includes=DIR  libnetfilter_queue include directory],
     fi
   ])
 
+  # libnetfilter_log
+    AC_ARG_ENABLE(nflog,
+            AS_HELP_STRING([--enable-nflog],[Enable libnetfilter_log support]),
+                           [ enable_nflog="yes"],
+                           [ enable_nflog="no"])
+    AC_ARG_WITH(libnetfilter_log_includes,
+            [  --with-libnetfilter_log-includes=DIR  libnetfilter_log include directory],
+            [with_libnetfilter_log_includes="$withval"],[with_libnetfilter_log_includes="no"])
+    AC_ARG_WITH(libnetfilter_log_libraries,
+            [  --with-libnetfilter_log-libraries=DIR    libnetfilter_log library directory],
+            [with_libnetfilter_log_libraries="$withval"],[with_libnetfilter_log_libraries="no"])
+
+    if test "$enable_nflog" = "yes"; then
+        if test "$with_libnetfilter_log_includes" != "no"; then
+            CPPFLAGS="${CPPFLAGS} -I${with_libnetfilter_log_includes}"
+        fi
+
+        AC_CHECK_HEADER(libnetfilter_log/libnetfilter_log.h,,[AC_ERROR(libnetfilter_log.h not found ...)])
+
+        if test "$with_libnetfilter_log_libraries" != "no"; then
+            LDFLAGS="${LDFLAGS}  -L${with_libnetfilter_log_libraries}"
+        fi
+
+        NFLOG=""
+        AC_CHECK_LIB(netfilter_log, nflog_open,, NFLOG="no")
+
+        if test "$NFLOG" = "no"; then
+            echo
+            echo "   ERROR!  libnetfilter_log library not found, go get it"
+            echo "   from http://www.netfilter.org."
+            echo
+            exit 1
+        else
+            AC_DEFINE([HAVE_NFLOG],[1],[nflog available])
+            enable_nflog="yes"
+        fi
+    fi
+
   # prelude
     AC_ARG_ENABLE(prelude,
             AS_HELP_STRING([--enable-prelude], [Enable Prelude support for alerts]),,[enable_prelude=no])
@@ -1624,6 +1659,7 @@ SURICATA_BUILD_CONF="Suricata Configuration:
   AF_PACKET support:                       ${enable_af_packet}
   PF_RING support:                         ${enable_pfring}
   NFQueue support:                         ${enable_nfqueue}
+  NFLOG support:                           ${enable_nflog}
   IPFW support:                            ${enable_ipfw}
   DAG enabled:                             ${enable_dag}
   Napatech enabled:                        ${enable_napatech}