summaryrefslogtreecommitdiffstats
path: root/plugins/check_fping.d/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_fping.d/config.h')
-rw-r--r--plugins/check_fping.d/config.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/plugins/check_fping.d/config.h b/plugins/check_fping.d/config.h
new file mode 100644
index 00000000..d95e9ded
--- /dev/null
+++ b/plugins/check_fping.d/config.h
@@ -0,0 +1,82 @@
1#pragma once
2
3#include "../../config.h"
4#include <stddef.h>
5
6enum {
7 PACKET_SIZE = 56,
8 PACKET_COUNT = 1,
9};
10
11typedef struct {
12 char *server_name;
13 char *sourceip;
14 char *sourceif;
15 int packet_size;
16 int packet_count;
17 int target_timeout;
18 int packet_interval;
19 bool randomize_packet_data;
20 bool dontfrag;
21 bool alive_p;
22
23 double crta;
24 bool crta_p;
25 double wrta;
26 bool wrta_p;
27
28 int cpl;
29 bool cpl_p;
30 int wpl;
31 bool wpl_p;
32
33 // only available with fping version >= 5.2
34 // for a given uint _fwmark_ fping sets _fwmark_ as a firewall mark
35 // in the packets
36 unsigned int fwmark;
37 bool fwmark_set;
38
39
40 // only available with fping version >= 5.3
41 // Setting icmp_timestamp tells fping to use ICMP Timestamp (ICMP type 13) instead
42 // of ICMP Echo
43 bool icmp_timestamp;
44
45 // Setting check_source lets fping discard replies which are not from the target address
46 bool check_source;
47} check_fping_config;
48
49check_fping_config check_fping_config_init() {
50 check_fping_config tmp = {
51 .server_name = NULL,
52 .sourceip = NULL,
53 .sourceif = NULL,
54 .packet_size = PACKET_SIZE,
55 .packet_count = PACKET_COUNT,
56 .target_timeout = 0,
57 .packet_interval = 0,
58 .randomize_packet_data = false,
59 .dontfrag = false,
60 .alive_p = false,
61
62 .crta = 0,
63 .crta_p = false,
64 .wrta = 0,
65 .wrta_p = false,
66
67 .cpl = 0,
68 .cpl_p = false,
69 .wpl = 0,
70 .wpl_p = false,
71
72 // only available with fping version >= 5.2
73 .fwmark = 0,
74 .fwmark_set = false, // just to be deterministic
75
76 // only available with fping version >= 5.3
77 .icmp_timestamp = false,
78 .check_source = false,
79
80 };
81 return tmp;
82}