Merge branch 'sb/iptables'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Wed, 14 Mar 2007 22:24:38 +0000 (23:24 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Wed, 14 Mar 2007 22:24:38 +0000 (23:24 +0100)
Conflicts:

configure.in
src/Makefile.am
src/collectd.conf.in

1  2 
configure.in
src/Makefile.am
src/collectd.conf.in

diff --combined configure.in
@@@ -309,7 -309,9 +309,9 @@@ AC_CHECK_HEADERS(net/if_arp.h
  AC_CHECK_HEADERS(net/if_ppp.h)
  AC_CHECK_HEADERS(netinet/if_ether.h)
  
- dnl Checking for libraries
+ #
+ # Checking for libraries
+ #
  AC_CHECK_LIB(m, ext)
  
  #
@@@ -927,6 -929,45 +929,45 @@@ AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$c
        [Wether or not to use the pcap library])
  AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
  
+ AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
+ [
+       if test "x$withval" != "xno" && test "x$withval" != "xyes"
+       then
+               LDFLAGS="$LDFLAGS -L$withval/lib"
+               CPPFLAGS="$CPPFLAGS -I$withval/include"
+               with_libiptc="yes"
+       fi
+ ],
+ [
+       if test "x$ac_system" = "xLinux"
+       then
+               with_libiptc="yes"
+       else
+               with_libiptc="no (Linux only)"
+       fi
+ ])
+ if test "x$with_libiptc" = "xyes"
+ then
+       AC_CHECK_LIB(iptc, iptc_init,
+       [
+               AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
+       ], [with_libiptc="no (libiptc not found)"])
+ fi
+ if test "x$with_libiptc" = "xyes"
+ then
+       AC_CHECK_HEADERS(libiptc/libiptc.h,
+       [
+               AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
+       ], [with_libiptc="no (libiptc/libiptc.h not found)"])
+ fi
+ if test "x$with_libiptc" = "xyes"
+ then
+       collect_libiptc=1
+ else
+       collect_libiptc=0
+ fi
+ AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
  # Define `step' and `hearbeat' values..
  declare -i collectd_step=10
  declare -i collectd_heartbeat=25
@@@ -1046,14 -1087,14 +1087,15 @@@ AC_COLLECTD([dns],       [disable], [mo
  AC_COLLECTD([email],     [disable], [module], [email statistics])
  AC_COLLECTD([quota],     [enable],  [module], [quota statistics (experimental)])
  AC_COLLECTD([hddtemp],   [disable], [module], [hdd temperature statistics])
+ AC_COLLECTD([iptables],  [disable], [module], [IPtables statistics])
 +AC_COLLECTD([irq],       [disable], [module], [irq statistics])
  AC_COLLECTD([load],      [disable], [module], [system load statistics])
  AC_COLLECTD([mbmon],     [disable], [module], [motherboard monitor statistics])
  AC_COLLECTD([memory],    [disable], [module], [memory statistics])
  AC_COLLECTD([multimeter],[disable], [module], [multimeter statistics])
  AC_COLLECTD([mysql],     [disable], [module], [mysql statistics])
  AC_COLLECTD([nfs],       [disable], [module], [nfs statistics])
 -AC_COLLECTD([ntpd],      [disable], [module], [nfs statistics])
 +AC_COLLECTD([ntpd],      [disable], [module], [ntpd statistics])
  AC_COLLECTD([ping],      [disable], [module], [ping statistics])
  AC_COLLECTD([processes], [disable], [module], [processes statistics])
  AC_COLLECTD([sensors],   [disable], [module], [lm_sensors statistics])
@@@ -1080,6 -1121,7 +1122,7 @@@ Configuration
      libkstat  . . . . . $with_kstat
      libmysql  . . . . . $with_libmysql
      libpcap . . . . . . $with_libpcap
+     libiptc . . . . . . $with_libiptc
      libpthread  . . . . $with_libpthread
  
    Features:
      dns . . . . . . . . $enable_dns
      email . . . . . . . $enable_email
      hddtemp . . . . . . $enable_hddtemp
 +    irq . . . . . . . . $enable_irq
++    iptables  . . . . . $enable_iptables
      load  . . . . . . . $enable_load
      mbmon . . . . . . . $enable_mbmon
      memory  . . . . . . $enable_memory
diff --combined src/Makefile.am
@@@ -208,14 -208,17 +208,25 @@@ collectd_LDADD += "-dlopen" hddtemp.l
  collectd_DEPENDENCIES += hddtemp.la
  endif
  
+ if BUILD_MODULE_IPTABLES
+ pkglib_LTLIBRARIES += iptables.la
+ iptables_la_SOURCES = iptables.c
+ iptables_la_LDFLAGS = -module -avoid-version
+ if BUILD_WITH_LIBIPTC
+ iptables_la_LDFLAGS += -liptc
+ endif
+ collectd_LDADD += "-dlopen" iptables.la
+ collectd_DEPENDENCIES += iptables.la
+ endif
 +if BUILD_MODULE_IRQ
 +pkglib_LTLIBRARIES += irq.la
 +irq_la_SOURCES = irq.c
 +irq_la_LDFLAGS = -module -avoid-version
 +collectd_LDADD += "-dlopen" irq.la
 +collectd_DEPENDENCIES += irq.la
 +endif
 +
  if BUILD_MODULE_LOAD
  pkglib_LTLIBRARIES += load.la
  load_la_SOURCES = load.c
diff --combined src/collectd.conf.in
@@@ -30,7 -30,7 +30,8 @@@
  @BUILD_MODULE_DISK_TRUE@LoadPlugin disk
  @BUILD_MODULE_DNS_TRUE@LoadPlugin dns
  @BUILD_MODULE_HDDTEMP_TRUE@LoadPlugin hddtemp
+ @BUILD_MODULE_IPTABLES_TRUE@LoadPlugin iptables
 +@BUILD_MODULE_IRQ_TRUE@LoadPlugin irq
  @BUILD_MODULE_LOAD_TRUE@LoadPlugin load
  @BUILD_MODULE_MBMON_TRUE@LoadPlugin mbmon
  @BUILD_MODULE_MEMORY_TRUE@LoadPlugin memory
  #     Port 7634
  #</Plugin>
  
+ #<Plugin iptables>
+ #     Chain table chain
+ #</Plugin>
 +#<Plugin irq>
 +#     Irq 7
 +#     Irq 8
 +#     Irq 9
 +#     IgnoreSelected true
 +#</Plugin>
 +
  #<Plugin mbmon>
  #     Host 127.0.0.1
  #     Port 411