From: Florian Forster Date: Fri, 1 Feb 2013 10:48:31 +0000 (+0100) Subject: pf plugin: Define {F,S}CNT_NAMES. X-Git-Tag: collectd-5.2.2~16 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=981d7e58b2ecce4456948cc2ec9b67bde02bbd07;p=collectd.git pf plugin: Define {F,S}CNT_NAMES. Apparently they are only defined in the pfctl sources, not in the system's header files for some reason. --- diff --git a/src/pf.c b/src/pf.c index 0fff6720..0332c3c1 100644 --- a/src/pf.c +++ b/src/pf.c @@ -27,10 +27,24 @@ #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";