summaryrefslogtreecommitdiffstats
path: root/plugins/check_dig.d/config.h
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-11-27 23:42:56 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-11-27 23:42:56 +0100
commitd91d02619d4c1330b871a5418e436b2f81db533a (patch)
tree68808e5cd64e652f52e491d6dd249e0ee92192d7 /plugins/check_dig.d/config.h
parent40405c07f91477d22b5e505b12ea3484a7e5f50f (diff)
downloadmonitoring-plugins-d91d02619d4c1330b871a5418e436b2f81db533a.tar.gz
check_dig: Move flag parsing to parameter processing and out of main
The processing of the forbid-flags and the require-flags parameter was done in the main function previous to this. Since no further information is actually needed during runtime, I moved the processing in the cli param processing stage to reduce actual complexity later.
Diffstat (limited to 'plugins/check_dig.d/config.h')
-rw-r--r--plugins/check_dig.d/config.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/check_dig.d/config.h b/plugins/check_dig.d/config.h
index 392848e5..dd1f58b5 100644
--- a/plugins/check_dig.d/config.h
+++ b/plugins/check_dig.d/config.h
@@ -8,6 +8,11 @@
8#define DEFAULT_TRIES 2 8#define DEFAULT_TRIES 2
9 9
10typedef struct { 10typedef struct {
11 char **items;
12 size_t count;
13} flag_list;
14
15typedef struct {
11 char *query_address; 16 char *query_address;
12 char *record_type; 17 char *record_type;
13 char *expected_address; 18 char *expected_address;
@@ -19,8 +24,8 @@ typedef struct {
19 24
20 double warning_interval; 25 double warning_interval;
21 double critical_interval; 26 double critical_interval;
22 char *require_flags; 27 flag_list require_flags;
23 char *forbid_flags; 28 flag_list forbid_flags;
24} check_dig_config; 29} check_dig_config;
25 30
26check_dig_config check_dig_config_init() { 31check_dig_config check_dig_config_init() {
@@ -36,9 +41,8 @@ check_dig_config check_dig_config_init() {
36 41
37 .warning_interval = UNDEFINED, 42 .warning_interval = UNDEFINED,
38 .critical_interval = UNDEFINED, 43 .critical_interval = UNDEFINED,
39 .require_flags = NULL, 44 .require_flags = {.count = 0, .items = NULL},
40 .forbid_flags = NULL, 45 .forbid_flags = {.count = 0, .items = NULL},
41
42 }; 46 };
43 return tmp; 47 return tmp;
44} 48}