diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2020-02-24 07:07:12 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2020-02-24 07:07:12 +0000 |
commit | 5939ebc8f74101bcd9e8f7ec508799560f3e6e96 (patch) | |
tree | 46042c3045b5c0d93a195dac4a43976951317850 /usr.sbin/radiusctl/parser.h | |
parent | 6ce3e859dd6a4f86875c0127a3a307d1c9c229bc (diff) |
add retries and timeouts for test packets.
the most important bit of this is that the command will exit after
a timeout period. this is currently handy if you're running radiusctl
as a check from relayd, because at the moment it to get confused
about who it's children are if you run a lot of checks too rapidly.
before timeouts were added, radiusctl would wait forever for a
reply, but a reply may never arrive because networks are unreliable,
and worse, computers are unreliable and may be down for extended
periods of time.
the number of retries, the interval between retries, and the overall
wait time can be tweaked via command line arguments. the defaults
are set to something that seems reasonable if you're running a test.
ok yasuoka@
Diffstat (limited to 'usr.sbin/radiusctl/parser.h')
-rw-r--r-- | usr.sbin/radiusctl/parser.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/usr.sbin/radiusctl/parser.h b/usr.sbin/radiusctl/parser.h index b84b4b4d29d..6fd0a6c30f7 100644 --- a/usr.sbin/radiusctl/parser.h +++ b/usr.sbin/radiusctl/parser.h @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.h,v 1.1 2015/07/21 04:06:04 yasuoka Exp $ */ +/* $OpenBSD: parser.h,v 1.2 2020/02/24 07:07:11 dlg Exp $ */ /* This file is derived from OpenBSD:src/usr.sbin/ikectl/parser.h 1.9 */ /* @@ -31,6 +31,18 @@ enum auth_method { MSCHAPV2 }; +#define TEST_TRIES_MIN 1 +#define TEST_TRIES_MAX 32 +#define TEST_TRIES_DEFAULT 3 + +#define TEST_INTERVAL_MIN 1 +#define TEST_INTERVAL_MAX 10 +#define TEST_INTERVAL_DEFAULT 2 + +#define TEST_MAXWAIT_MIN 3 +#define TEST_MAXWAIT_MAX 60 +#define TEST_MAXWAIT_DEFAULT 8 + struct parse_result { enum actions action; const char *hostname; @@ -40,6 +52,13 @@ struct parse_result { u_short port; int nas_port; enum auth_method auth_method; + + /* number of packets to try sending */ + unsigned int tries; + /* how long between packet sends */ + struct timeval interval; + /* overall process wait time for a reply */ + struct timeval maxwait; }; struct parse_result *parse(int, char *[]); |