summaryrefslogtreecommitdiffstats
path: root/plugins/check_tcp.d/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_tcp.d/config.h')
-rw-r--r--plugins/check_tcp.d/config.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/plugins/check_tcp.d/config.h b/plugins/check_tcp.d/config.h
new file mode 100644
index 00000000..41db7224
--- /dev/null
+++ b/plugins/check_tcp.d/config.h
@@ -0,0 +1,83 @@
1#pragma once
2
3#include "../../lib/utils_tcp.h"
4#include "output.h"
5#include <netinet/in.h>
6
7typedef struct {
8 char *server_address;
9 bool host_specified;
10 int server_port; // TODO can this be a uint16?
11
12 int protocol; /* most common is default */
13 char *service;
14 char *send;
15 char *quit;
16 char **server_expect;
17 size_t server_expect_count;
18#ifdef HAVE_SSL
19 bool use_tls;
20 char *sni;
21 bool sni_specified;
22 bool check_cert;
23 int days_till_exp_warn;
24 int days_till_exp_crit;
25#endif // HAVE_SSL
26 int match_flags;
27 int expect_mismatch_state;
28 unsigned int delay;
29
30 bool warning_time_set;
31 double warning_time;
32 bool critical_time_set;
33 double critical_time;
34
35 int econn_refuse_state;
36
37 ssize_t maxbytes;
38
39 bool hide_output;
40
41 bool output_format_set;
42 mp_output_format output_format;
43} check_tcp_config;
44
45check_tcp_config check_tcp_config_init() {
46 check_tcp_config result = {
47 .server_address = "127.0.0.1",
48 .host_specified = false,
49 .server_port = 0,
50
51 .protocol = IPPROTO_TCP,
52 .service = "TCP",
53 .send = NULL,
54 .quit = NULL,
55 .server_expect = NULL,
56 .server_expect_count = 0,
57#ifdef HAVE_SSL
58 .use_tls = false,
59 .sni = NULL,
60 .sni_specified = false,
61 .check_cert = false,
62 .days_till_exp_warn = 0,
63 .days_till_exp_crit = 0,
64#endif // HAVE_SSL
65 .match_flags = NP_MATCH_EXACT,
66 .expect_mismatch_state = STATE_WARNING,
67 .delay = 0,
68
69 .warning_time_set = false,
70 .warning_time = 0,
71 .critical_time_set = false,
72 .critical_time = 0,
73
74 .econn_refuse_state = STATE_CRITICAL,
75
76 .maxbytes = 0,
77
78 .hide_output = false,
79
80 .output_format_set = false,
81 };
82 return result;
83}