summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 80eb35c)
raw | patch | inline | side by side (parent: 80eb35c)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 3 Oct 2006 16:39:10 +0000 (18:39 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 3 Oct 2006 16:39:10 +0000 (18:39 +0200) |
src/named.c | patch | blob | history |
diff --git a/src/named.c b/src/named.c
index 41a5776eae7e67c390b8cbd5bc4a100afcc3c3ef..2ff92b9b13f9e450071f1b5c66b9801f6b6adced 100644 (file)
--- a/src/named.c
+++ b/src/named.c
#include "collectd.h"
#include "common.h"
#include "plugin.h"
+#include "configfile.h"
+#include "utils_debug.h"
+
+#if HAVE_SYS_POLL_H
+# include <sys/poll.h>
+#endif
#define MODULE_NAME "named"
# define NAMED_HAVE_READ 0
#endif
-static char qtype_file = "named/qtype-%s.rrd";
+static char *qtype_file = "named/qtype-%s.rrd";
static char *qtype_ds_def[] =
{
#endif /* NAMED_HAVE_CONFIG */
#if HAVE_LIBPCAP
+#define PCAP_SNAPLEN 1460
static char *pcap_device = NULL;
static int pipe_fd;
#endif
#if NAMED_HAVE_CONFIG
-static int traffic_config (char *key, char *value)
+static int named_config (char *key, char *value)
{
#if HAVE_LIBPCAP
if (strcasecmp (key, "Interface") == 0)
int status;
/* Passing `pcap_device == NULL' is okay and the same as passign "any" */
- pcap_obj = pcap_open_live (pcap_device, /* Not promiscuous */ 0,
- /* no read timeout */ 0, pcap_error);
+ pcap_obj = pcap_open_live (pcap_device,
+ PCAP_SNAPLEN,
+ 0 /* Not promiscuous */,
+ 0 /* no read timeout */,
+ pcap_error);
if (pcap_obj == NULL)
{
syslog (LOG_ERR, "named plugin: Opening interface `%s' failed: %s",
syslog (LOG_NOTICE, "named plugin: Pipe closed. Exiting.");
break;
}
- else if (poss_fds[0].revents & POLLOUT)
+ else if (poll_fds[0].revents & POLLOUT)
{
if (named_child_send_data () < 0)
{
strerror (errno));
close (pipe_fds[0]);
close (pipe_fds[1]);
- pcap_close (pcap_obj);
return;
}
else if (pid_child != 0)