diff --git a/src/dns.c b/src/dns.c
index 56df1845ad512a3ea3c2e0f3f6061cd7760bb097..11dc287425fde2e2bc725fb67ccd8481ed536202 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
#include "common.h"
#include "plugin.h"
#include "configfile.h"
-#include "utils_debug.h"
#if HAVE_LIBPCAP && HAVE_LIBPTHREAD
# include "utils_dns.h"
@@ -117,14 +116,14 @@ static counter_list_t *counter_list_search (counter_list_t **list, unsigned int
{
counter_list_t *entry;
- DBG ("counter_list_search (list = %p, key = %u)",
+ DEBUG ("counter_list_search (list = %p, key = %u)",
(void *) *list, key);
for (entry = *list; entry != NULL; entry = entry->next)
if (entry->key == key)
break;
- DBG ("return (%p)", (void *) entry);
+ DEBUG ("return (%p)", (void *) entry);
return (entry);
}
{
counter_list_t *entry;
- DBG ("counter_list_create (list = %p, key = %u, value = %u)",
+ DEBUG ("counter_list_create (list = %p, key = %u, value = %u)",
(void *) *list, key, value);
entry = (counter_list_t *) malloc (sizeof (counter_list_t));
last->next = entry;
}
- DBG ("return (%p)", (void *) entry);
+ DEBUG ("return (%p)", (void *) entry);
return (entry);
}
{
counter_list_t *entry;
- DBG ("counter_list_add (list = %p, key = %u, increment = %u)",
+ DEBUG ("counter_list_add (list = %p, key = %u, increment = %u)",
(void *) *list, key, increment);
entry = counter_list_search (list, key);
{
counter_list_create (list, key, increment);
}
- DBG ("return ()");
+ DEBUG ("return ()");
}
static int dns_config (const char *key, const char *value)
}
/* Passing `pcap_device == NULL' is okay and the same as passign "any" */
- DBG ("Creating PCAP object..");
+ DEBUG ("Creating PCAP object..");
pcap_obj = pcap_open_live (pcap_device,
PCAP_SNAPLEN,
0 /* Not promiscuous */,
pcap_error);
if (pcap_obj == NULL)
{
- syslog (LOG_ERR, "dns plugin: Opening interface `%s' "
+ ERROR ("dns plugin: Opening interface `%s' "
"failed: %s",
(pcap_device != NULL) ? pcap_device : "any",
pcap_error);
memset (&fp, 0, sizeof (fp));
if (pcap_compile (pcap_obj, &fp, "udp port 53", 1, 0) < 0)
{
- DBG ("pcap_compile failed");
- syslog (LOG_ERR, "dns plugin: pcap_compile failed");
+ DEBUG ("pcap_compile failed");
+ ERROR ("dns plugin: pcap_compile failed");
return (NULL);
}
if (pcap_setfilter (pcap_obj, &fp) < 0)
{
- DBG ("pcap_setfilter failed");
- syslog (LOG_ERR, "dns plugin: pcap_setfilter failed");
+ DEBUG ("pcap_setfilter failed");
+ ERROR ("dns plugin: pcap_setfilter failed");
return (NULL);
}
- DBG ("PCAP object created.");
+ DEBUG ("PCAP object created.");
dnstop_set_pcap_obj (pcap_obj);
dnstop_set_callback (dns_child_callback);
handle_pcap /* callback */,
NULL /* Whatever this means.. */);
if (status < 0)
- syslog (LOG_ERR, "dns plugin: Listener thread is exiting "
+ ERROR ("dns plugin: Listener thread is exiting "
"abnormally: %s", pcap_geterr (pcap_obj));
- DBG ("child is exiting");
+ DEBUG ("child is exiting");
pcap_close (pcap_obj);
listen_thread_init = 0;
(void *) 0);
if (status != 0)
{
- syslog (LOG_ERR, "dns plugin: pthread_create failed: %s",
+ ERROR ("dns plugin: pthread_create failed: %s",
strerror (status));
return (-1);
}
for (i = 0; i < len; i++)
{
- DBG ("qtype = %u; counter = %u;", keys[i], values[i]);
+ DEBUG ("qtype = %u; counter = %u;", keys[i], values[i]);
submit_counter ("dns_qtype", qtype_str (keys[i]), values[i]);
}
for (i = 0; i < len; i++)
{
- DBG ("opcode = %u; counter = %u;", keys[i], values[i]);
+ DEBUG ("opcode = %u; counter = %u;", keys[i], values[i]);
submit_counter ("dns_opcode", opcode_str (keys[i]), values[i]);
}
for (i = 0; i < len; i++)
{
- DBG ("rcode = %u; counter = %u;", keys[i], values[i]);
+ DEBUG ("rcode = %u; counter = %u;", keys[i], values[i]);
submit_counter ("dns_rcode", rcode_str (keys[i]), values[i]);
}