From cf48162487d6f042af084ee436acdd7a2db0cbfd Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 11 Mar 2025 02:43:51 +0100 Subject: Refactor check_fping --- plugins/check_fping.d/config.h | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 plugins/check_fping.d/config.h (limited to 'plugins/check_fping.d/config.h') diff --git a/plugins/check_fping.d/config.h b/plugins/check_fping.d/config.h new file mode 100644 index 00000000..a0697bf3 --- /dev/null +++ b/plugins/check_fping.d/config.h @@ -0,0 +1,58 @@ +#pragma once + +#include "../../config.h" +#include + +enum { + PACKET_SIZE = 56, + PACKET_COUNT = 1, +}; + +typedef struct { + char *server_name; + char *sourceip; + char *sourceif; + int packet_size; + int packet_count; + int target_timeout; + int packet_interval; + bool randomize_packet_data; + bool dontfrag; + bool alive_p; + + double crta; + bool crta_p; + double wrta; + bool wrta_p; + + int cpl; + bool cpl_p; + int wpl; + bool wpl_p; +} check_fping_config; + +check_fping_config check_fping_config_init() { + check_fping_config tmp = { + .server_name = NULL, + .sourceip = NULL, + .sourceif = NULL, + .packet_size = PACKET_SIZE, + .packet_count = PACKET_COUNT, + .target_timeout = 0, + .packet_interval = 0, + .randomize_packet_data = false, + .dontfrag = false, + .alive_p = false, + + .crta = 0, + .crta_p = false, + .wrta = 0, + .wrta_p = false, + + .cpl = 0, + .cpl_p = false, + .wpl = 0, + .wpl_p = false, + }; + return tmp; +} -- cgit v1.2.3-74-g34f1