X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fpf.c;h=4e35cf661403bf4f84c72d462d820301a3cc1a22;hb=f86731f4fca466e89453b02bf185730e7d547898;hp=0fff6720706966c3ab9c351eedee0a23e60c23f1;hpb=f8287addd23543a970453e473829bd3d6c28bcdd;p=collectd.git diff --git a/src/pf.c b/src/pf.c index 0fff6720..4e35cf66 100644 --- a/src/pf.c +++ b/src/pf.c @@ -19,18 +19,39 @@ #include "plugin.h" #include "common.h" -#include -#include -#include +#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 + +#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";