diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-03-25 01:40:06 (GMT) |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-03-25 01:40:06 (GMT) |
commit | 386b791af2a5c9d95531d2ca047dd8ffc12bcb2e (patch) | |
tree | 8ee5cd653d314e7e097da9fc5ea26642cd7d7769 /plugins/netutils.h | |
parent | ab3ada9aacd82356a6e5205f3ae26bbff55524db (diff) | |
download | monitoring-plugins-386b791af2a5c9d95531d2ca047dd8ffc12bcb2e.tar.gz |
Make socket alarm handler customisable (like c459ca07)
Diffstat (limited to 'plugins/netutils.h')
-rw-r--r-- | plugins/netutils.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/netutils.h b/plugins/netutils.h index 6bc5386..b479b74 100644 --- a/plugins/netutils.h +++ b/plugins/netutils.h | |||
@@ -45,8 +45,6 @@ | |||
45 | # endif /* UNIX_PATH_MAX */ | 45 | # endif /* UNIX_PATH_MAX */ |
46 | #endif /* HAVE_SYS_UN_H */ | 46 | #endif /* HAVE_SYS_UN_H */ |
47 | 47 | ||
48 | RETSIGTYPE socket_timeout_alarm_handler (int) __attribute__((noreturn)); | ||
49 | |||
50 | /* process_request and wrapper macros */ | 48 | /* process_request and wrapper macros */ |
51 | #define process_tcp_request(addr, port, sbuf, rbuf, rsize) \ | 49 | #define process_tcp_request(addr, port, sbuf, rbuf, rsize) \ |
52 | process_request(addr, port, IPPROTO_TCP, sbuf, rbuf, rsize) | 50 | process_request(addr, port, IPPROTO_TCP, sbuf, rbuf, rsize) |
@@ -83,7 +81,16 @@ void host_or_die(const char *str); | |||
83 | # define is_hostname(addr) resolve_host_or_addr(addr, AF_INET) | 81 | # define is_hostname(addr) resolve_host_or_addr(addr, AF_INET) |
84 | #endif | 82 | #endif |
85 | 83 | ||
84 | #ifdef LOCAL_TIMEOUT_ALARM_HANDLER | ||
86 | extern unsigned int socket_timeout; | 85 | extern unsigned int socket_timeout; |
86 | extern int socket_timeout_state; | ||
87 | RETSIGTYPE socket_timeout_alarm_handler (int) __attribute__((noreturn)); | ||
88 | #else | ||
89 | unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT; | ||
90 | unsigned int socket_timeout_state = STATE_CRITICAL; | ||
91 | extern RETSIGTYPE socket_timeout_alarm_handler (int) __attribute__((noreturn)); | ||
92 | #endif | ||
93 | |||
87 | extern int econn_refuse_state; | 94 | extern int econn_refuse_state; |
88 | extern int was_refused; | 95 | extern int was_refused; |
89 | extern int address_family; | 96 | extern int address_family; |