From: Alan T. DeKok Date: Wed, 25 Aug 2021 13:06:23 +0000 (-0400) Subject: add "retry" subsection to actions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a0e1d3f5f719cb89c81641ea8d4762b7beaace7;p=thirdparty%2Ffreeradius-server.git add "retry" subsection to actions --- diff --git a/src/lib/unlang/call.c b/src/lib/unlang/call.c index 84d56de20a2..d8bc70ceb51 100644 --- a/src/lib/unlang/call.c +++ b/src/lib/unlang/call.c @@ -176,6 +176,7 @@ unlang_action_t unlang_call_push(request_t *request, CONF_SECTION *server_cs, bo [RLM_MODULE_NOOP] = 0, [RLM_MODULE_UPDATED] = 0 }, + .retry = RETRY_INIT, }, } }, diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 714454168a7..0c85a6a8556 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -99,63 +99,78 @@ static const unlang_actions_t default_actions[MOD_COUNT] = { /* authenticate */ { - MOD_ACTION_RETURN, /* reject */ - MOD_ACTION_RETURN, /* fail */ - 4, /* ok */ - MOD_ACTION_RETURN, /* handled */ - MOD_ACTION_RETURN, /* invalid */ - MOD_ACTION_RETURN, /* disallow */ - 1, /* notfound */ - 2, /* noop */ - 3 /* updated */ + .actions = { + MOD_ACTION_RETURN, /* reject */ + MOD_ACTION_RETURN, /* fail */ + 4, /* ok */ + MOD_ACTION_RETURN, /* handled */ + MOD_ACTION_RETURN, /* invalid */ + MOD_ACTION_RETURN, /* disallow */ + 1, /* notfound */ + 2, /* noop */ + 3 /* updated */ + }, + .retry = RETRY_INIT, }, /* authorize */ { - MOD_ACTION_RETURN, /* reject */ - MOD_ACTION_RETURN, /* fail */ - 3, /* ok */ - MOD_ACTION_RETURN, /* handled */ - MOD_ACTION_RETURN, /* invalid */ - MOD_ACTION_RETURN, /* disallow */ - 1, /* notfound */ - 2, /* noop */ - 4 /* updated */ + .actions = { + MOD_ACTION_RETURN, /* reject */ + MOD_ACTION_RETURN, /* fail */ + 3, /* ok */ + MOD_ACTION_RETURN, /* handled */ + MOD_ACTION_RETURN, /* invalid */ + MOD_ACTION_RETURN, /* disallow */ + 1, /* notfound */ + 2, /* noop */ + 4 /* updated */ + }, + .retry = RETRY_INIT, }, /* preacct */ { - MOD_ACTION_RETURN, /* reject */ - MOD_ACTION_RETURN, /* fail */ - 2, /* ok */ - MOD_ACTION_RETURN, /* handled */ - MOD_ACTION_RETURN, /* invalid */ - MOD_ACTION_RETURN, /* disallow */ - MOD_ACTION_RETURN, /* notfound */ - 1, /* noop */ - 3 /* updated */ + .actions = { + MOD_ACTION_RETURN, /* reject */ + MOD_ACTION_RETURN, /* fail */ + 2, /* ok */ + MOD_ACTION_RETURN, /* handled */ + MOD_ACTION_RETURN, /* invalid */ + MOD_ACTION_RETURN, /* disallow */ + MOD_ACTION_RETURN, /* notfound */ + 1, /* noop */ + 3 /* updated */ + }, + .retry = RETRY_INIT, }, /* accounting */ { - MOD_ACTION_RETURN, /* reject */ - MOD_ACTION_RETURN, /* fail */ - 2, /* ok */ - MOD_ACTION_RETURN, /* handled */ - MOD_ACTION_RETURN, /* invalid */ - MOD_ACTION_RETURN, /* disallow */ - MOD_ACTION_RETURN, /* notfound */ - 1, /* noop */ - 3 /* updated */ + .actions = { + MOD_ACTION_RETURN, /* reject */ + MOD_ACTION_RETURN, /* fail */ + 2, /* ok */ + MOD_ACTION_RETURN, /* handled */ + MOD_ACTION_RETURN, /* invalid */ + MOD_ACTION_RETURN, /* disallow */ + MOD_ACTION_RETURN, /* notfound */ + 1, /* noop */ + 3 /* updated */ + }, + .retry = RETRY_INIT, }, /* post-auth */ { - MOD_ACTION_RETURN, /* reject */ - MOD_ACTION_RETURN, /* fail */ - 3, /* ok */ - MOD_ACTION_RETURN, /* handled */ - MOD_ACTION_RETURN, /* invalid */ - MOD_ACTION_RETURN, /* disallow */ - 1, /* notfound */ - 2, /* noop */ - 4 /* updated */ + .actions = { + MOD_ACTION_RETURN, /* reject */ + MOD_ACTION_RETURN, /* fail */ + 3, /* ok */ + MOD_ACTION_RETURN, /* handled */ + MOD_ACTION_RETURN, /* invalid */ + MOD_ACTION_RETURN, /* disallow */ + 1, /* notfound */ + 2, /* noop */ + 4 /* updated */ + }, + .retry = RETRY_INIT, } }; diff --git a/src/lib/unlang/compile.h b/src/lib/unlang/compile.h index 6f23fd99d91..035cdadd7cb 100644 --- a/src/lib/unlang/compile.h +++ b/src/lib/unlang/compile.h @@ -31,9 +31,11 @@ extern "C" { #include #include #include +#include typedef struct { - int actions[RLM_MODULE_NUMCODES]; + int actions[RLM_MODULE_NUMCODES]; + fr_retry_config_t retry; } unlang_actions_t; int unlang_compile(CONF_SECTION *cs, rlm_components_t component, tmpl_rules_t const *rules, void **instruction); diff --git a/src/lib/unlang/function.c b/src/lib/unlang/function.c index 063c9b8602a..69616d88ce1 100644 --- a/src/lib/unlang/function.c +++ b/src/lib/unlang/function.c @@ -60,6 +60,7 @@ static unlang_t function_instruction = { [RLM_MODULE_NOOP] = 0, [RLM_MODULE_UPDATED] = 0 }, + .retry = RETRY_INIT, }, }; diff --git a/src/lib/unlang/module.c b/src/lib/unlang/module.c index 668cc8507c4..75e6d6004ac 100644 --- a/src/lib/unlang/module.c +++ b/src/lib/unlang/module.c @@ -374,6 +374,7 @@ int unlang_module_push(rlm_rcode_t *p_result, request_t *request, [RLM_MODULE_NOOP] = 0, [RLM_MODULE_UPDATED] = 0 }, + .retry = RETRY_INIT, }, }, .instance = module_instance, diff --git a/src/lib/unlang/subrequest_child.c b/src/lib/unlang/subrequest_child.c index 21d8969e0e5..bc87d93fcf0 100644 --- a/src/lib/unlang/subrequest_child.c +++ b/src/lib/unlang/subrequest_child.c @@ -397,9 +397,10 @@ int unlang_subrequest_child_op_init(void) [RLM_MODULE_INVALID] = 0, [RLM_MODULE_DISALLOW] = 0, [RLM_MODULE_NOTFOUND] = 0, - [RLM_MODULE_NOOP] = 0, + [RLM_MODULE_NOOP] = 0, [RLM_MODULE_UPDATED] = 0 }, + .retry = RETRY_INIT, }, } } diff --git a/src/lib/unlang/tmpl.c b/src/lib/unlang/tmpl.c index ac8bd63ccc0..f06959ccc31 100644 --- a/src/lib/unlang/tmpl.c +++ b/src/lib/unlang/tmpl.c @@ -148,6 +148,7 @@ int unlang_tmpl_push(TALLOC_CTX *ctx, fr_value_box_list_t *out, request_t *reque [RLM_MODULE_NOOP] = 0, [RLM_MODULE_UPDATED] = 0 }, + .retry = RETRY_INIT, }, }; diff --git a/src/lib/unlang/xlat.c b/src/lib/unlang/xlat.c index 446b88c6134..6c590920482 100644 --- a/src/lib/unlang/xlat.c +++ b/src/lib/unlang/xlat.c @@ -90,6 +90,7 @@ static unlang_t xlat_instruction = { [RLM_MODULE_NOOP] = 0, [RLM_MODULE_UPDATED] = 0 }, + .retry = RETRY_INIT, }, };