author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Thu, 17 Sep 2009 07:40:36 +0000 (09:40 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Thu, 17 Sep 2009 07:40:36 +0000 (09:40 +0200) |
README | patch | blob | history | |
configure.in | patch | blob | history | |
src/iptables.c | patch | blob | history |
index 2f80cc896475759d352c9ac21d3e87ba316c7070..6529a9002d306645075b888b0d4d36c744036465 100644 (file)
--- a/README
+++ b/README
If present, the uuid plugin will check for UUID from HAL.
<http://hal.freedesktop.org/>
- * libiptc (optional, if not found a version shipped with this distribution
- can be used if the Linux kernel headers are available)
+ * libiptc (optional)
For querying iptables counters.
<http://netfilter.org/>
+ If not found on the system, a version shipped with this distribution can
+ be used. It requires some Linux headers in /usr/include/linux. You can
+ force the build system to use the shipped version by specifying
+ --with-libiptc=shipped
+ when running the configure script.
+
* libjvm (optional)
Library that encapsulates the `Java Virtual Machine' (JVM). This library is
used by the Java plugin to execute Java bytecode. See “Configuring with
diff --git a/configure.in b/configure.in
index 0343acd096e590df4b0f4fa530c606bed1f3ef26..415ddd71c138f450f4759e4e327656f6c1c84b06 100644 (file)
--- a/configure.in
+++ b/configure.in
@@ -1463,16 +1463,21 @@ AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to l
with_libiptc="no (Linux only)"
fi
])
-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
+SAVE_CPPFLAGS="$CPPFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
+LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS"
+if test "x$with_libiptc" = "xyes"
then
- AC_CHECK_LIB(iptc, iptc_init,
+ AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
[
- AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
+ with_libiptc="no (Linux iptables headers not found)"
+ with_own_libiptc="no"
],
[
- with_libiptc="yes"
- with_own_libiptc="yes"
+#include "$srcdir/src/owniptc/ipt_kernel_headers.h"
])
+
fi
if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
then
with_own_libiptc="yes"
])
fi
-if test "x$with_libiptc" = "xyes"
-then
- SAVE_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
-
- AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
- [
- with_libiptc="no (Linux iptables headers not found - check KERNEL_DIR)"
- with_own_libiptc="no"
- ],
- [
-#include "$srcdir/src/owniptc/ipt_kernel_headers.h"
- ])
-
- CPPFLAGS="$SAVE_CPPFLAGS"
-fi
-if test "x$with_libiptc" = "xyes"
+if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
then
- SAVE_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
-
AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
[
#if OWN_LIBIPTC
# include <libiptc/libip6tc.h>
#endif
])
-
- CPPFLAGS="$SAVE_CPPFLAGS"
+fi
+if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
+then
+ AC_CHECK_LIB(iptc, iptc_init,
+ [
+ AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
+ ],
+ [
+ with_libiptc="yes"
+ with_own_libiptc="yes"
+ ])
fi
AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
then
AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
fi
+CPPFLAGS="$SAVE_CPPFLAGS"
+LDFLAGS="$SAVE_LDFLAGS"
# }}}
# --with-java {{{
diff --git a/src/iptables.c b/src/iptables.c
index 69cd39c48758f352d548764cd20b76f8617153b5..aa53074a641aae4acf9b8d98e0f6907591f04904 100644 (file)
--- a/src/iptables.c
+++ b/src/iptables.c
#if OWN_LIBIPTC
# include "owniptc/libiptc.h"
# include "owniptc/libip6tc.h"
-#else
+
+# define HAVE_IPTC_HANDLE_T 1
+# define HAVE_IP6TC_HANDLE_T 1
+
+#else /* if !OWN_LIBIPTC */
# include <libiptc/libiptc.h>
# include <libiptc/libip6tc.h>
-#endif
/*
* iptc_handle_t was available before libiptc was officially available as a
* this is somewhat hacky, I didn't find better way to solve that :-/
* -tokkee
*/
-#ifndef HAVE_IPTC_HANDLE_T
+# ifndef HAVE_IPTC_HANDLE_T
typedef struct iptc_handle iptc_handle_t;
-#endif
-#ifndef HAVE_IP6TC_HANDLE_T
+# endif
+# ifndef HAVE_IP6TC_HANDLE_T
typedef struct ip6tc_handle ip6tc_handle_t;
-#endif
+# endif
+#endif /* !OWN_LIBIPTC */
/*
* (Module-)Global variables