summaryrefslogtreecommitdiffstats
path: root/plugins/check_dns.d
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-03-09 15:53:59 +0100
committerGitHub <noreply@github.com>2025-03-09 15:53:59 +0100
commit75568a3409fccdebf01446312a9f109cc1a11d15 (patch)
tree6988afc5958a9ae0bf8f63b6d579281dc7c061e6 /plugins/check_dns.d
parent6dbc84f93595be81aee4de4ac3122b942047c22d (diff)
parent16cb24807db5b1bd20e2b31a15bda7940f1145bd (diff)
downloadmonitoring-plugins-75568a3409fccdebf01446312a9f109cc1a11d15.tar.gz
Merge pull request #2078 from RincewindsHat/refactor/check_dns
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}