diff options
Diffstat (limited to 'plugins/check_ping.d/config.h')
-rw-r--r-- | plugins/check_ping.d/config.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/plugins/check_ping.d/config.h b/plugins/check_ping.d/config.h new file mode 100644 index 00000000..eb2735a7 --- /dev/null +++ b/plugins/check_ping.d/config.h | |||
@@ -0,0 +1,46 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "../../config.h" | ||
4 | #include <stddef.h> | ||
5 | #include <stdlib.h> | ||
6 | |||
7 | enum { | ||
8 | UNKNOWN_PACKET_LOSS = 200, /* 200% */ | ||
9 | DEFAULT_MAX_PACKETS = 5 /* default no. of ICMP ECHO packets */ | ||
10 | }; | ||
11 | |||
12 | #define UNKNOWN_TRIP_TIME -1.0 /* -1 seconds */ | ||
13 | |||
14 | #define MAX_ADDR_START 1 | ||
15 | |||
16 | typedef struct { | ||
17 | bool display_html; | ||
18 | int max_packets; | ||
19 | |||
20 | char **addresses; | ||
21 | size_t n_addresses; | ||
22 | |||
23 | int wpl; | ||
24 | int cpl; | ||
25 | double wrta; | ||
26 | double crta; | ||
27 | } check_ping_config; | ||
28 | |||
29 | check_ping_config check_ping_config_init() { | ||
30 | check_ping_config tmp = { | ||
31 | .display_html = false, | ||
32 | .max_packets = -1, | ||
33 | |||
34 | .addresses = NULL, | ||
35 | .n_addresses = 0, | ||
36 | |||
37 | .wpl = UNKNOWN_PACKET_LOSS, | ||
38 | .cpl = UNKNOWN_PACKET_LOSS, | ||
39 | .wrta = UNKNOWN_TRIP_TIME, | ||
40 | .crta = UNKNOWN_TRIP_TIME, | ||
41 | }; | ||
42 | |||
43 | tmp.addresses = calloc(MAX_ADDR_START, sizeof(char *)); | ||
44 | tmp.addresses[0] = NULL; | ||
45 | return tmp; | ||
46 | } | ||