X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdns.c;h=f6c3504731cfe55bef6c810d3abe1d41a2e33624;hp=47da4e94c122e60dbd3084212e09e71cb3e5fbc1;hb=aff80830f1154a5b6c4da16a0b1033aafde14e24;hpb=4fd631aa4fc9aa2e5339a1531dc74915676844a4 diff --git a/src/dns.c b/src/dns.c index 47da4e94..f6c35047 100644 --- a/src/dns.c +++ b/src/dns.c @@ -59,8 +59,8 @@ static int select_numeric_qtype = 1; #define PCAP_SNAPLEN 1460 static char *pcap_device = NULL; -static counter_t tr_queries; -static counter_t tr_responses; +static derive_t tr_queries; +static derive_t tr_responses; static counter_list_t *qtype_list; static counter_list_t *opcode_list; static counter_list_t *rcode_list; @@ -299,13 +299,13 @@ static int dns_init (void) return (0); } /* int dns_init */ -static void submit_counter (const char *type, const char *type_instance, - counter_t value) +static void submit_derive (const char *type, const char *type_instance, + derive_t value) { value_t values[1]; value_list_t vl = VALUE_LIST_INIT; - values[0].counter = value; + values[0].derive = value; vl.values = values; vl.values_len = 1; @@ -315,15 +315,15 @@ static void submit_counter (const char *type, const char *type_instance, sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); plugin_dispatch_values (&vl); -} /* void submit_counter */ +} /* void submit_derive */ -static void submit_octets (counter_t queries, counter_t responses) +static void submit_octets (derive_t queries, derive_t responses) { value_t values[2]; value_list_t vl = VALUE_LIST_INIT; - values[0].counter = queries; - values[1].counter = responses; + values[0].derive = queries; + values[1].derive = responses; vl.values = values; vl.values_len = 2; @@ -332,7 +332,7 @@ static void submit_octets (counter_t queries, counter_t responses) sstrncpy (vl.type, "dns_octets", sizeof (vl.type)); plugin_dispatch_values (&vl); -} /* void submit_counter */ +} /* void submit_octets */ static int dns_read (void) { @@ -364,7 +364,7 @@ static int dns_read (void) for (i = 0; i < len; i++) { DEBUG ("dns plugin: qtype = %u; counter = %u;", keys[i], values[i]); - submit_counter ("dns_qtype", qtype_str (keys[i]), values[i]); + submit_derive ("dns_qtype", qtype_str (keys[i]), values[i]); } pthread_mutex_lock (&opcode_mutex); @@ -380,7 +380,7 @@ static int dns_read (void) for (i = 0; i < len; i++) { DEBUG ("dns plugin: opcode = %u; counter = %u;", keys[i], values[i]); - submit_counter ("dns_opcode", opcode_str (keys[i]), values[i]); + submit_derive ("dns_opcode", opcode_str (keys[i]), values[i]); } pthread_mutex_lock (&rcode_mutex); @@ -396,7 +396,7 @@ static int dns_read (void) for (i = 0; i < len; i++) { DEBUG ("dns plugin: rcode = %u; counter = %u;", keys[i], values[i]); - submit_counter ("dns_rcode", rcode_str (keys[i]), values[i]); + submit_derive ("dns_rcode", rcode_str (keys[i]), values[i]); } return (0);