summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3fdb559)
raw | patch | inline | side by side (parent: 3fdb559)
author | Stefan Rinkes <stefan.rinkes@gmail.com> | |
Thu, 14 Apr 2011 19:17:45 +0000 (21:17 +0200) | ||
committer | Stefan Rinkes <stefan.rinkes@gmail.com> | |
Thu, 14 Apr 2011 19:17:45 +0000 (21:17 +0200) |
src/pf.c | patch | blob | history |
diff --git a/src/pf.c b/src/pf.c
index 513634c0d0f84a997f596b2423fd4e616732e961..449567afb77b61ee1a19ee2dbb748cf7fab61276 100644 (file)
--- a/src/pf.c
+++ b/src/pf.c
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <unistd.h>
#ifndef TEST
#include "collectd.h"
+#include "common.h"
#include "plugin.h"
+#include "configfile.h"
#else
+#include <err.h>
typedef u_int64_t counter_t;
#endif
vl.values = values;
vl.values_len = 1;
- strlcpy(vl.host, hostname_g, sizeof(vl.host));
- strlcpy(vl.plugin, "pf", sizeof(vl.plugin));
- strlcpy(vl.type, type, sizeof(vl.type));
- strlcpy(vl.type_instance, inst, sizeof(vl.type_instance));
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "pf", sizeof (vl.plugin));
+ sstrncpy (vl.type, type, sizeof(vl.type));
+ sstrncpy (vl.type_instance, inst, sizeof(vl.type_instance));
plugin_dispatch_values(&vl);
#else
printf("%s.%s: %lld\n", type, inst, val);
struct pf_status status;
memset(&pd, '\0', sizeof(pd));
-
+
if ((pd.pd_dev = open(PF_SOCKET, O_RDWR)) == -1) {
return (-1);
}
plugin_register_init("pf", pf_init);
plugin_register_read("pf", pf_read);
}
-#endif
\ No newline at end of file
+#endif
+