summaryrefslogtreecommitdiffstats
path: root/plugins/check_curl.d/check_curl_helpers.h
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2026-04-08 17:21:44 +0200
committerGitHub <noreply@github.com>2026-04-08 17:21:44 +0200
commit613cb60c96e21eaafb82b80a6b6d84b1b1f9729f (patch)
treeb8b0b26ea8b14b74cd92da272c213dccf5356fbd /plugins/check_curl.d/check_curl_helpers.h
parentddd1bd9fbd84b29fb169e592943d1fdfc8ad0d7e (diff)
downloadmonitoring-plugins-613cb60c96e21eaafb82b80a6b6d84b1b1f9729f.tar.gz
check_curl: Clean up (#2252)
* check_curl: remove unused variables * check_curl: run formatter on related files * check_curl_helpers: make code a bit more understandable * check_curl helpers: general api cleanup and code style
Diffstat (limited to 'plugins/check_curl.d/check_curl_helpers.h')
-rw-r--r--plugins/check_curl.d/check_curl_helpers.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/plugins/check_curl.d/check_curl_helpers.h b/plugins/check_curl.d/check_curl_helpers.h
index cc47bf9d..55df9bc1 100644
--- a/plugins/check_curl.d/check_curl_helpers.h
+++ b/plugins/check_curl.d/check_curl_helpers.h
@@ -127,11 +127,25 @@ mp_subcheck check_curl_certificate_checks(CURL *curl, X509 *cert, int warn_days_
127 int crit_days_till_exp); 127 int crit_days_till_exp);
128char *fmt_url(check_curl_working_state workingState); 128char *fmt_url(check_curl_working_state workingState);
129 129
130 130/* determine_hostname_resolver determines if the host or the proxy resolves the target hostname
131/* function that will determine if the host or the proxy resolves the target hostname 131returns RESOLVE_LOCALLY if requester resolves the hostname locally, RESOLVE_REMOTELY if proxy
132returns 0 if requester resolves the hostname locally, 1 if proxy resolves the hostname */ 132resolves the hostname */
133int determine_hostname_resolver(const check_curl_working_state working_state, const check_curl_static_curl_config config); 133bool hostname_gets_resolved_locally(const check_curl_working_state working_state);
134 134
135/* Checks if an IP is inside given CIDR region. Using /protocol_size or not specifying the prefix length performs an equality check. Supports both IPv4 and IPv6 135/* Checks if an IP is inside given CIDR region. Using /protocol_size or not specifying the prefix
136returns 1 if the target_ip address is inside the given cidr_region_or_ip_addr, 0 if its out. return codes < 0 mean an error has occurred. */ 136length performs an equality check. Supports both IPv4 and IPv6 returns 1 if the target_ip address is
137int ip_addr_inside_cidr(const char* cidr_region_or_ip_addr, const char* target_ip); 137inside the given cidr_region_or_ip_addr, 0 if its out. return codes < 0 mean an error has occurred.
138*/
139typedef enum {
140 NO_ERROR,
141 FAILED_STRDUP,
142 COULD_NOT_PARSE_SUBNET_LENGTH,
143 CIDR_REGION_INVALID,
144 CIDR_REGION_INVALID_PREFIX,
145 IP_CONTAINS_INVALID_CHARACTERS,
146} ip_addr_inside_error_code;
147typedef struct {
148 bool inside;
149 ip_addr_inside_error_code error;
150} ip_addr_inside;
151ip_addr_inside ip_addr_inside_cidr(const char *cidr_region_or_ip_addr, const char *target_ip);