X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fpf.c;h=29f3a3d539f19ecefceb6d5f9c09201ef7fb8dd3;hp=da539a26ec4cd9f6b1026ed39f8903568f97e346;hb=633c3966f770e4d46651a2fe219a18d8a9907a9f;hpb=defd9a4014a34640b1228bbcb96e6aa99e8bbb37 diff --git a/src/pf.c b/src/pf.c index da539a26..29f3a3d5 100644 --- a/src/pf.c +++ b/src/pf.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 2010 Pierre-Yves Ritschard - * Copyright (c) 2011 Stefan Rinkes + * Copyright (c) 2010 Pierre-Yves Ritschard + * Copyright (c) 2011 Stefan Rinkes * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -13,24 +13,46 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Authors: + * Pierre-Yves Ritschard + * Stefan Rinkes */ #include "collectd.h" #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 + #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"; @@ -86,7 +108,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);