summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/check_dns.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 911853b..e5ca581 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -39,11 +39,11 @@ const char *email = "devel@monitoring-plugins.org";
39#include "netutils.h" 39#include "netutils.h"
40#include "runcmd.h" 40#include "runcmd.h"
41 41
42static int process_arguments(int, char **); 42static int process_arguments(int /*argc*/, char ** /*argv*/);
43static int validate_arguments(void); 43static int validate_arguments(void);
44static int error_scan(char *, bool *); 44static int error_scan(char * /*input_buffer*/, bool *);
45static bool ip_match_cidr(const char *, const char *); 45static bool ip_match_cidr(const char * /*addr*/, const char * /*cidr_ro*/);
46static unsigned long ip2long(const char *); 46static unsigned long ip2long(const char * /*src*/);
47static void print_help(void); 47static void print_help(void);
48void print_usage(void); 48void print_usage(void);
49 49
@@ -81,7 +81,8 @@ int main(int argc, char **argv) {
81 long microsec; 81 long microsec;
82 struct timeval tv; 82 struct timeval tv;
83 bool parse_address = false; /* This flag scans for Address: but only after Name: */ 83 bool parse_address = false; /* This flag scans for Address: but only after Name: */
84 output chld_out, chld_err; 84 output chld_out;
85 output chld_err;
85 bool is_nxdomain = false; 86 bool is_nxdomain = false;
86 87
87 setlocale(LC_ALL, ""); 88 setlocale(LC_ALL, "");
@@ -204,7 +205,8 @@ int main(int argc, char **argv) {
204 } 205 }
205 206
206 if (addresses) { 207 if (addresses) {
207 int i, slen; 208 int i;
209 int slen;
208 char *adrp; 210 char *adrp;
209 qsort(addresses, n_addresses, sizeof(*addresses), qstrcmp); 211 qsort(addresses, n_addresses, sizeof(*addresses), qstrcmp);
210 for (i = 0, slen = 1; i < n_addresses; i++) { 212 for (i = 0, slen = 1; i < n_addresses; i++) {
@@ -303,7 +305,9 @@ int main(int argc, char **argv) {
303} 305}
304 306
305bool ip_match_cidr(const char *addr, const char *cidr_ro) { 307bool ip_match_cidr(const char *addr, const char *cidr_ro) {
306 char *subnet, *mask_c, *cidr = strdup(cidr_ro); 308 char *subnet;
309 char *mask_c;
310 char *cidr = strdup(cidr_ro);
307 int mask; 311 int mask;
308 subnet = strtok(cidr, "/"); 312 subnet = strtok(cidr, "/");
309 mask_c = strtok(NULL, "\0"); 313 mask_c = strtok(NULL, "\0");
@@ -505,7 +509,7 @@ int process_arguments(int argc, char **argv) {
505 return validate_arguments(); 509 return validate_arguments();
506} 510}
507 511
508int validate_arguments() { 512int validate_arguments(void) {
509 if (query_address[0] == 0) { 513 if (query_address[0] == 0) {
510 printf("missing --host argument\n"); 514 printf("missing --host argument\n");
511 return ERROR; 515 return ERROR;