.name = name,
.debug_name = name,
.ci = CF_TO_ITEM(server_cs),
- .actions = {
- .actions = {
- [RLM_MODULE_REJECT] = 0,
- [RLM_MODULE_FAIL] = MOD_ACTION_RETURN, /* Exit out of nested levels */
- [RLM_MODULE_OK] = 0,
- [RLM_MODULE_HANDLED] = 0,
- [RLM_MODULE_INVALID] = 0,
- [RLM_MODULE_DISALLOW] = 0,
- [RLM_MODULE_NOTFOUND] = 0,
- [RLM_MODULE_NOOP] = 0,
- [RLM_MODULE_UPDATED] = 0
- },
- .retry = RETRY_INIT,
- },
+ .actions = MOD_ACTIONS_FAIL_TIMEOUT_RETURN,
},
.cs = server_cs,
.type = UNLANG_TYPE_FINALLY,
.name = "finally",
.debug_name = "finally",
- .actions = {
- .actions = {
- [RLM_MODULE_REJECT] = 0,
- [RLM_MODULE_FAIL] = MOD_ACTION_RETURN, /* Exit out of nested levels */
- [RLM_MODULE_OK] = 0,
- [RLM_MODULE_HANDLED] = 0,
- [RLM_MODULE_INVALID] = 0,
- [RLM_MODULE_DISALLOW] = 0,
- [RLM_MODULE_NOTFOUND] = 0,
- [RLM_MODULE_NOOP] = 0,
- [RLM_MODULE_TIMEOUT] = MOD_ACTION_RETURN, /* Exit out of nested levels */
- [RLM_MODULE_UPDATED] = 0
- },
- .retry = RETRY_INIT,
- },
+ .actions = MOD_ACTIONS_FAIL_TIMEOUT_RETURN,
};
unlang_frame_state_finally_t *state;
.type = UNLANG_TYPE_FUNCTION,
.name = "function",
.debug_name = "function",
- .actions = {
- /*
- * By default, functions don't change the section rcode.
- * We can't make generalisations about what the intent
- * of the function callbacks are, so isntead of having
- * implicit, confusing behaviour, we always discard the
- * rcode UNLESS the function explicitly sets it.
- */
- .actions = {
- [RLM_MODULE_REJECT] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_FAIL] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_OK] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_HANDLED] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_INVALID] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_DISALLOW] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_NOTFOUND] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_NOOP] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_UPDATED] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_TIMEOUT] = MOD_ACTION_NOT_SET
- },
- .retry = RETRY_INIT,
- }
+ .actions = DEFAULT_MOD_ACTIONS,
};
/** Generic signal handler
*/
static unlang_t unlang_instruction = {
.debug_name = "top",
- .actions = {
- /*
- * By default, functions don't change the section rcode.
- * We can't make generalisations about what the intent
- * of the function callbacks are, so isntead of having
- * implicit, confusing behaviour, we always discard the
- * rcode UNLESS the function explicitly sets it.
- */
- .actions = {
- [RLM_MODULE_REJECT] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_FAIL] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_OK] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_HANDLED] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_INVALID] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_DISALLOW] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_NOTFOUND] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_NOOP] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_UPDATED] = MOD_ACTION_NOT_SET,
- [RLM_MODULE_TIMEOUT] = MOD_ACTION_NOT_SET
- },
- .retry = RETRY_INIT
- }
+ .actions = DEFAULT_MOD_ACTIONS,
};
unlang_stack_t *stack;
} unlang_mod_actions_t;
#define DEFAULT_MOD_ACTIONS { .actions = {}, .retry = RETRY_INIT }
+#define MOD_ACTIONS_FAIL_TIMEOUT_RETURN { .actions = { [RLM_MODULE_FAIL] = MOD_ACTION_RETURN, [RLM_MODULE_TIMEOUT] = MOD_ACTION_RETURN,}, .retry = RETRY_INIT }
extern unlang_mod_actions_t const mod_actions_authenticate;
extern unlang_mod_actions_t const mod_actions_authorize;
.type = UNLANG_TYPE_MODULE,
.name = mi->name,
.debug_name = mi->name,
- .actions = {
- .actions = {
- [RLM_MODULE_REJECT] = 0,
- [RLM_MODULE_FAIL] = MOD_ACTION_RETURN, /* Exit out of nested levels */
- [RLM_MODULE_OK] = 0,
- [RLM_MODULE_HANDLED] = 0,
- [RLM_MODULE_INVALID] = 0,
- [RLM_MODULE_DISALLOW] = 0,
- [RLM_MODULE_NOTFOUND] = 0,
- [RLM_MODULE_NOOP] = 0,
- [RLM_MODULE_UPDATED] = 0,
- [RLM_MODULE_TIMEOUT] = MOD_ACTION_RETURN, /* Exit out of nested levels */
- },
- .retry = RETRY_INIT,
- },
+ .actions = MOD_ACTIONS_FAIL_TIMEOUT_RETURN,
},
.mmc = {
.mi = mi,
.type = UNLANG_TYPE_TIMEOUT,
.name = "timeout",
.debug_name = "timeout",
- .actions = {
- .actions = {
- [RLM_MODULE_REJECT] = 0,
- [RLM_MODULE_FAIL] = MOD_ACTION_RETURN, /* Exit out of nested levels */
- [RLM_MODULE_OK] = 0,
- [RLM_MODULE_HANDLED] = 0,
- [RLM_MODULE_INVALID] = 0,
- [RLM_MODULE_DISALLOW] = 0,
- [RLM_MODULE_NOTFOUND] = 0,
- [RLM_MODULE_NOOP] = 0,
- [RLM_MODULE_TIMEOUT] = MOD_ACTION_RETURN, /* Exit out of nested levels */
- [RLM_MODULE_UPDATED] = 0
- },
- .retry = RETRY_INIT,
- },
+ .actions = MOD_ACTIONS_FAIL_TIMEOUT_RETURN,
};
unlang_frame_state_timeout_t *state;
.type = UNLANG_TYPE_TMPL,
.name = "tmpl",
.debug_name = "tmpl",
- .actions = {
- .actions = {
- [RLM_MODULE_REJECT] = 0,
- [RLM_MODULE_FAIL] = MOD_ACTION_RETURN,
- [RLM_MODULE_OK] = 0,
- [RLM_MODULE_HANDLED] = 0,
- [RLM_MODULE_INVALID] = 0,
- [RLM_MODULE_DISALLOW] = 0,
- [RLM_MODULE_NOTFOUND] = 0,
- [RLM_MODULE_NOOP] = 0,
- [RLM_MODULE_UPDATED] = 0
- },
- .retry = RETRY_INIT,
- },
+ .actions = MOD_ACTIONS_FAIL_TIMEOUT_RETURN,
};
static const unlang_t tmpl_instruction_fail = {
.type = UNLANG_TYPE_XLAT,
.name = "xlat",
.debug_name = "xlat",
- .actions = {
- .actions = {
- [RLM_MODULE_REJECT] = 0,
- [RLM_MODULE_FAIL] = MOD_ACTION_RETURN, /* Exit out of nested levels */
- [RLM_MODULE_OK] = 0,
- [RLM_MODULE_HANDLED] = 0,
- [RLM_MODULE_INVALID] = 0,
- [RLM_MODULE_DISALLOW] = 0,
- [RLM_MODULE_NOTFOUND] = 0,
- [RLM_MODULE_NOOP] = 0,
- [RLM_MODULE_UPDATED] = 0
- },
- .retry = RETRY_INIT,
- },
+ .actions = MOD_ACTIONS_FAIL_TIMEOUT_RETURN,
};
unlang_frame_state_xlat_t *state;