X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fpf.c;h=4e35cf661403bf4f84c72d462d820301a3cc1a22;hb=5d9d056df591e3a8e7e434e15c65a5565d2fe52d;hp=8dc6d83b638783d799afdcdd3f163d1a152a8d80;hpb=96fb8673622dfeed08cf197632bb21dab29acaef;p=collectd.git diff --git a/src/pf.c b/src/pf.c index 8dc6d83b..4e35cf66 100644 --- a/src/pf.c +++ b/src/pf.c @@ -17,19 +17,41 @@ #include "collectd.h" #include "plugin.h" +#include "common.h" + +#if HAVE_SYS_IOCTL_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +#if HAVE_NET_IF_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif -#include -#include -#include #include -#include -#include -#include + +#ifndef FCNT_NAMES +# if FCNT_MAX != 3 +# error "Unexpected value for FCNT_MAX" +# endif +# define FCNT_NAMES {"search", "insert", "removals", NULL}; +#endif + +#ifndef SCNT_NAMES +# if SCNT_MAX != 3 +# error "Unexpected value for SCNT_MAX" +# endif +# define SCNT_NAMES {"search", "insert", "removals", NULL}; +#endif static char const *pf_reasons[PFRES_MAX+1] = PFRES_NAMES; static char const *pf_lcounters[LCNT_MAX+1] = LCNT_NAMES; static char const *pf_fcounters[FCNT_MAX+1] = FCNT_NAMES; -static char const *pf_scounters[FCNT_MAX+1] = FCNT_NAMES; +static char const *pf_scounters[SCNT_MAX+1] = SCNT_NAMES; static char const *pf_device = "/dev/pf"; @@ -85,7 +107,7 @@ static int pf_read (void) close (fd); fd = -1; - if (!status.running) + if (!state.running) { WARNING ("pf plugin: PF is not running."); return (-1);