Skip to content
Permalink
Browse files

remove priority from unlang_op_call_t

it is now handled by the main interpret loop
  • Loading branch information
alandekok committed Sep 26, 2019
1 parent dcca3b7 commit 0960fb420b42f2be874908570254a42925ecde50
@@ -94,8 +94,7 @@ static unlang_action_t unlang_call_resume(REQUEST *request, rlm_rcode_t *presult
return UNLANG_ACTION_CALCULATE_RESULT;
}

static unlang_action_t unlang_call(REQUEST *request,
rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_call(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -27,8 +27,7 @@ RCSID("$Id$")
#include "unlang_priv.h"
#include "group_priv.h"

static unlang_action_t unlang_if(REQUEST *request,
rlm_rcode_t *presult, int *priority)
static unlang_action_t unlang_if(REQUEST *request, rlm_rcode_t *presult)
{
int condition;
unlang_stack_t *stack = request->stack;
@@ -60,9 +59,6 @@ static unlang_action_t unlang_if(REQUEST *request,
*/
if (!condition) {
RDEBUG2("...");

if (*presult != RLM_MODULE_UNKNOWN) *priority = instruction->actions[*presult];

return UNLANG_ACTION_EXECUTE_NEXT;
}

@@ -79,7 +75,7 @@ static unlang_action_t unlang_if(REQUEST *request,
/*
* We took the "if". Go recurse into its' children.
*/
return unlang_group(request, presult, priority);
return unlang_group(request, presult);
}

void unlang_condition_init(void)
@@ -72,8 +72,7 @@ static int _free_unlang_frame_state_foreach(unlang_frame_state_foreach_t *state)
return 0;
}

static unlang_action_t unlang_foreach_next(REQUEST *request,
rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_foreach_next(REQUEST *request, rlm_rcode_t *presult)
{
VALUE_PAIR *vp;
unlang_stack_t *stack = request->stack;
@@ -120,8 +119,7 @@ static unlang_action_t unlang_foreach_next(REQUEST *request,
}


static unlang_action_t unlang_foreach(REQUEST *request,
rlm_rcode_t *presult, int *priority)
static unlang_action_t unlang_foreach(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -183,10 +181,10 @@ static unlang_action_t unlang_foreach(REQUEST *request,
talloc_set_destructor(foreach, _free_unlang_frame_state_foreach);

frame->process = unlang_foreach_next;
return unlang_foreach_next(request, presult, priority);
return unlang_foreach_next(request, presult);
}

static unlang_action_t unlang_break(REQUEST *request, rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_break(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -60,10 +60,8 @@ static unlang_t function_instruction = {
*
* @param[in] request The current request.
* @param[out] presult The frame result. Always set to RLM_MODULE_OK (fixme?).
* @param[out] priority of the result.
*/
static unlang_action_t unlang_function_call(REQUEST *request,
rlm_rcode_t *presult, int *priority)
static unlang_action_t unlang_function_call(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -78,9 +76,9 @@ static unlang_action_t unlang_function_call(REQUEST *request,
caller = request->module;
request->module = NULL;
if (!is_repeatable(frame)) {
ua = state->func(request, presult, priority, state->uctx);
ua = state->func(request, presult, NULL, state->uctx);
} else {
ua = state->repeat(request, presult, priority, state->uctx);
ua = state->repeat(request, presult, NULL, state->uctx);
}
request->module = caller;

@@ -27,8 +27,7 @@ RCSID("$Id$")
#include "unlang_priv.h"
#include "group_priv.h"

unlang_action_t unlang_group(REQUEST *request,
UNUSED rlm_rcode_t *result, UNUSED int *priority)
unlang_action_t unlang_group(REQUEST *request, UNUSED rlm_rcode_t *result)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -51,8 +50,7 @@ unlang_action_t unlang_group(REQUEST *request,
return UNLANG_ACTION_PUSHED_CHILD;
}

static unlang_action_t unlang_policy(REQUEST *request,
rlm_rcode_t *result, int *priority)
static unlang_action_t unlang_policy(REQUEST *request, rlm_rcode_t *result)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -62,7 +60,7 @@ static unlang_action_t unlang_policy(REQUEST *request,
*/
return_point_set(frame);

return unlang_group(request, result, priority);
return unlang_group(request, result);
}


@@ -29,8 +29,7 @@
extern "C" {
#endif

unlang_action_t unlang_group(REQUEST *request,
UNUSED rlm_rcode_t *result, UNUSED int *priority);
unlang_action_t unlang_group(REQUEST *request, UNUSED rlm_rcode_t *result);

#ifdef __cplusplus
}
@@ -525,7 +525,7 @@ static inline unlang_frame_action_t frame_eval(REQUEST *request, unlang_stack_fr
unlang_ops[instruction->type].name);

rad_assert(frame->process != NULL);
action = frame->process(request, result, priority);
action = frame->process(request, result);

RDEBUG4("** [%i] %s << %s (%d)", stack->depth, __FUNCTION__,
fr_table_str_by_value(unlang_action_table, action, "<INVALID>"), *priority);
@@ -1276,9 +1276,8 @@ void unlang_interpret_resumable(REQUEST *request)
*
* @param[in] request to be resumed.
* @param[out] presult the rcode returned by the resume function.
* @param[out] priority associated with the rcode.
*/
static unlang_action_t unlang_interpret_resume_dispatch(REQUEST *request, rlm_rcode_t *presult, int *priority)
static unlang_action_t unlang_interpret_resume_dispatch(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -1315,7 +1314,6 @@ static unlang_action_t unlang_interpret_resume_dispatch(REQUEST *request, rlm_rc
if (*presult != RLM_MODULE_YIELD) {
rad_assert(*presult >= RLM_MODULE_REJECT);
rad_assert(*presult < RLM_MODULE_NUMCODES);
*priority = instruction->actions[*presult];
}

return action;
@@ -37,10 +37,9 @@ extern "C" {
*
* @param[in] request The current request.
* @param[in,out] presult Pointer to the current rcode, may be modified by the function.
* @param[in,out] priority Pointer to the current priority, may be modified by the function.
* @return an action for the interpreter to perform.
*/
typedef unlang_action_t (*unlang_op_call_t)(REQUEST *request, rlm_rcode_t *presult, int *priority);
typedef unlang_action_t (*unlang_op_call_t)(REQUEST *request, rlm_rcode_t *presult);

/** Function to call if the initial function yielded and the request was signalled
*
@@ -27,8 +27,7 @@

#define unlang_redundant_load_balance unlang_load_balance

static unlang_action_t unlang_load_balance_next(REQUEST *request,
rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_load_balance_next(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -98,8 +97,7 @@ static unlang_action_t unlang_load_balance_next(REQUEST *request,
return UNLANG_ACTION_PUSHED_CHILD;
}

static unlang_action_t unlang_load_balance(REQUEST *request,
rlm_rcode_t *presult, int *priority)
static unlang_action_t unlang_load_balance(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -277,7 +275,7 @@ static unlang_action_t unlang_load_balance(REQUEST *request,
redundant->child = NULL;

frame->process = unlang_load_balance_next;
return unlang_load_balance_next(request, presult, priority);
return unlang_load_balance_next(request, presult);
}

void unlang_load_balance_init(void)
@@ -63,7 +63,7 @@ typedef struct {
fr_value_box_t *src_result; //!< Result of expanding the map source.
} unlang_frame_state_map_proc_t;

static unlang_action_t unlang_update_apply(REQUEST *request, rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_update_apply(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -101,7 +101,7 @@ static unlang_action_t unlang_update_apply(REQUEST *request, rlm_rcode_t *presul
return UNLANG_ACTION_CALCULATE_RESULT;
}

static unlang_action_t unlang_update_create(REQUEST *request, rlm_rcode_t *presult, int *priority)
static unlang_action_t unlang_update_create(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -206,7 +206,7 @@ static unlang_action_t unlang_update_create(REQUEST *request, rlm_rcode_t *presu
};

frame->process = unlang_update_apply;
return unlang_update_apply(request, presult, priority);
return unlang_update_apply(request, presult);
}


@@ -222,7 +222,7 @@ static unlang_action_t unlang_update_create(REQUEST *request, rlm_rcode_t *presu
* If one map fails in the evaluation phase, no more maps are processed, and the current
* result is discarded.
*/
static unlang_action_t unlang_update(REQUEST *request, rlm_rcode_t *presult, int *priority)
static unlang_action_t unlang_update(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -254,10 +254,10 @@ static unlang_action_t unlang_update(REQUEST *request, rlm_rcode_t *presult, int
repeatable_set(frame);

frame->process = unlang_update_create;
return unlang_update_create(request, presult, priority);
return unlang_update_create(request, presult);
}

static unlang_action_t unlang_map(REQUEST *request, rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_map(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -581,7 +581,7 @@ static inline void safe_unlock(module_instance_t *instance)
if (instance->mutex) pthread_mutex_unlock(instance->mutex);
}

static unlang_action_t unlang_module(REQUEST *request, rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_module(REQUEST *request, rlm_rcode_t *presult)
{
unlang_module_t *sp;
unlang_stack_t *stack = request->stack;
@@ -111,7 +111,7 @@ static rlm_rcode_t unlang_parallel_run(REQUEST *request, unlang_parallel_t *stat
* Detach the child, and insert
* it into the backlog.
*/
if (unlang_detach(child, &result, &priority) == UNLANG_ACTION_CALCULATE_RESULT) {
if (unlang_detach(child, &result) == UNLANG_ACTION_CALCULATE_RESULT) {
talloc_free(child);
done = CHILD_DONE;
state->result = RLM_MODULE_FAIL;
@@ -356,8 +356,7 @@ static unlang_action_t unlang_parallel_resume(REQUEST *request, rlm_rcode_t *pre
return UNLANG_ACTION_YIELD;
}

static unlang_action_t unlang_parallel(REQUEST *request,
rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_parallel(REQUEST *request, rlm_rcode_t *presult)
{
int i;
rlm_rcode_t rcode;
@@ -27,7 +27,7 @@ RCSID("$Id$")
#include "unlang_priv.h"
#include "return_priv.h"

unlang_action_t unlang_return(REQUEST *request, rlm_rcode_t *presult, UNUSED int *priority)
unlang_action_t unlang_return(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -29,8 +29,7 @@
extern "C" {
#endif

unlang_action_t unlang_return(REQUEST *request,
UNUSED rlm_rcode_t *result, UNUSED int *priority);
unlang_action_t unlang_return(REQUEST *request, UNUSED rlm_rcode_t *result);

#ifdef __cplusplus
}
@@ -131,8 +131,7 @@ static unlang_action_t unlang_subrequest_resume(REQUEST *request, rlm_rcode_t *p
return UNLANG_ACTION_YIELD;
}

static unlang_action_t unlang_subrequest(REQUEST *request,
rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_subrequest(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -293,8 +292,7 @@ static unlang_action_t unlang_subrequest(REQUEST *request,
return UNLANG_ACTION_YIELD;
}

unlang_action_t unlang_detach(REQUEST *request,
rlm_rcode_t *presult, UNUSED int *priority)
unlang_action_t unlang_detach(REQUEST *request, rlm_rcode_t *presult)
{
VALUE_PAIR *vp;
unlang_stack_t *stack = request->stack;
@@ -41,8 +41,7 @@ void unlang_subrequest_free(REQUEST **child);

void unlang_subrequest_push(rlm_rcode_t *out, REQUEST *child, bool top_frame);

unlang_action_t unlang_detach(REQUEST *request,
rlm_rcode_t *presult, int *priority);
unlang_action_t unlang_detach(REQUEST *request, rlm_rcode_t *presult);

#ifdef __cplusplus
}
@@ -27,8 +27,7 @@ RCSID("$Id$")
#include "unlang_priv.h"
#include "group_priv.h"

static unlang_action_t unlang_switch(REQUEST *request,
UNUSED rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_switch(REQUEST *request, UNUSED rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -171,8 +170,7 @@ static unlang_action_t unlang_switch(REQUEST *request,
}


static unlang_action_t unlang_case(REQUEST *request,
rlm_rcode_t *presult, int *priority)
static unlang_action_t unlang_case(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -186,7 +184,7 @@ static unlang_action_t unlang_case(REQUEST *request,
return UNLANG_ACTION_CALCULATE_RESULT;
}

return unlang_group(request, presult, priority);
return unlang_group(request, presult);
}

void unlang_switch_init(void)
@@ -232,8 +232,7 @@ void unlang_xlat_push(TALLOC_CTX *ctx, fr_value_box_t **out,
* Calls the xlat interpreter and translates its wants and needs into
* unlang_action_t codes.
*/
static unlang_action_t unlang_xlat(REQUEST *request,
rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_xlat(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
@@ -410,8 +409,7 @@ static unlang_action_t unlang_xlat_resume(REQUEST *request, rlm_rcode_t *presult
/** Evaluates "naked" xlats in the config
*
*/
static unlang_action_t unlang_xlat_inline(REQUEST *request,
UNUSED rlm_rcode_t *presult, UNUSED int *priority)
static unlang_action_t unlang_xlat_inline(REQUEST *request, UNUSED rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];

0 comments on commit 0960fb4

Please sign in to comment.
You can’t perform that action at this time.