#include "collectd.h"
-#include "common.h"
#include "plugin.h"
+#include "utils/common/common.h"
+#include "utils/dns/dns.h"
#include <poll.h>
-#include "utils_dns.h"
#include <pcap.h>
static int select_numeric_qtype = 1;
#define PCAP_SNAPLEN 1460
-static char *pcap_device = NULL;
+static char *pcap_device;
static derive_t tr_queries;
static derive_t tr_responses;
static counter_list_t *rcode_list;
static pthread_t listen_thread;
-static int listen_thread_init = 0;
+static int listen_thread_init;
/* The `traffic' mutex if for `tr_queries' and `tr_responses' */
static pthread_mutex_t traffic_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t qtype_mutex = PTHREAD_MUTEX_INITIALIZER;
status = plugin_thread_create(&listen_thread, NULL, dns_child_loop, (void *)0,
"dns listen");
if (status != 0) {
- char errbuf[1024];
- ERROR("dns plugin: pthread_create failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("dns plugin: pthread_create failed: %s", STRERRNO);
return -1;
}
static void submit_octets(derive_t queries, derive_t responses) {
value_t values[] = {
- {.derive = queries}, {.derive = responses},
+ {.derive = queries},
+ {.derive = responses},
};
value_list_t vl = VALUE_LIST_INIT;