summaryrefslogtreecommitdiffstats
path: root/plugins/check_dns.d
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-03-08 13:05:57 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-03-09 12:04:40 +0100
commit65794e31374b3aa6e1f2c03d090b52e137df13e6 (patch)
tree1b7e90bcff95401af6f2730f6de9115dbba4fdfa /plugins/check_dns.d
parent230054f94d8b6f90076c3cc25c9c36e7b3747c74 (diff)
downloadmonitoring-plugins-65794e31374b3aa6e1f2c03d090b52e137df13e6.tar.gz
Refactor check_dns
Diffstat (limited to 'plugins/check_dns.d')
-rw-r--r--plugins/check_dns.d/config.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/check_dns.d/config.h b/plugins/check_dns.d/config.h
new file mode 100644
index 00000000..9ec4eb82
--- /dev/null
+++ b/plugins/check_dns.d/config.h
@@ -0,0 +1,34 @@
1#pragma once
2
3#include "../../config.h"
4#include "thresholds.h"
5#include <stddef.h>
6
7#define ADDRESS_LENGTH 256
8
9typedef struct {
10 bool all_match;
11 char dns_server[ADDRESS_LENGTH];
12 char query_address[ADDRESS_LENGTH];
13 bool expect_nxdomain;
14 bool expect_authority;
15 char **expected_address;
16 size_t expected_address_cnt;
17
18 thresholds *time_thresholds;
19} check_dns_config;
20
21check_dns_config check_dns_config_init() {
22 check_dns_config tmp = {
23 .all_match = false,
24 .dns_server = "",
25 .query_address = "",
26 .expect_nxdomain = false,
27 .expect_authority = false,
28 .expected_address = NULL,
29 .expected_address_cnt = 0,
30
31 .time_thresholds = NULL,
32 };
33 return tmp;
34}