]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
They're frame states not stack states
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 20 Jan 2018 18:52:23 +0000 (11:52 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 20 Jan 2018 18:52:23 +0000 (11:52 -0700)
src/main/unlang_interpret.c
src/main/unlang_op.c
src/main/unlang_priv.h
src/main/xlat_unlang.c

index 318186c2478bd71f0c696b0e8b35766a0b000a69..60d5b06140857049c263525d3dd753f9f43ad989 100644 (file)
@@ -816,7 +816,7 @@ void *unlang_stack_alloc(TALLOC_CTX *ctx)
         *      This number is pretty arbitrary, but it seems
         *      like too low level to make into a tuneable.
         */
-       return talloc_pooled_object(ctx, unlang_stack_t, UNLANG_STACK_MAX / 4, sizeof(unlang_stack_state_t));
+       return talloc_pooled_object(ctx, unlang_stack_t, UNLANG_STACK_MAX / 4, sizeof(unlang_frame_state_t));
 #else
        return talloc_zero(ctx, unlang_stack_t);
 #endif
@@ -965,8 +965,8 @@ int unlang_event_timeout_add(REQUEST *request, fr_unlang_module_timeout_t callba
        unlang_stack_frame_t            *frame = &stack->frame[stack->depth];
        unlang_event_t                  *ev;
        unlang_module_call_t            *sp;
-       unlang_stack_state_modcall_t    *ms = talloc_get_type_abort(frame->state,
-                                                                   unlang_stack_state_modcall_t);
+       unlang_frame_state_modcall_t    *ms = talloc_get_type_abort(frame->state,
+                                                                   unlang_frame_state_modcall_t);
 
        rad_assert(stack->depth > 0);
        rad_assert((frame->instruction->type == UNLANG_TYPE_MODULE_CALL) ||
@@ -1047,8 +1047,8 @@ int unlang_event_fd_add(REQUEST *request,
        unlang_stack_frame_t            *frame = &stack->frame[stack->depth];
        unlang_event_t                  *ev;
        unlang_module_call_t            *sp;
-       unlang_stack_state_modcall_t    *ms = talloc_get_type_abort(frame->state,
-                                                                              unlang_stack_state_modcall_t);
+       unlang_frame_state_modcall_t    *ms = talloc_get_type_abort(frame->state,
+                                                                              unlang_frame_state_modcall_t);
 
        rad_assert(stack->depth > 0);
 
index db1560510f7d033a94e967bf32da8eb554ba9f13..dea019f88864d79a26bce0c06a138ec4caa4714d 100644 (file)
@@ -1532,7 +1532,7 @@ static unlang_action_t unlang_module_call(REQUEST *request,
        unlang_stack_t                  *stack = request->stack;
        unlang_stack_frame_t            *frame = &stack->frame[stack->depth];
        unlang_t                        *instruction = frame->instruction;
-       unlang_stack_state_modcall_t    *ms;
+       unlang_frame_state_modcall_t    *ms;
 
 #ifndef NDEBUG
        int unlang_indent               = request->log.unlang_indent;
@@ -1556,7 +1556,7 @@ static unlang_action_t unlang_module_call(REQUEST *request,
                goto done;
        }
 
-       frame->state = ms = talloc_zero(stack, unlang_stack_state_modcall_t);
+       frame->state = ms = talloc_zero(stack, unlang_frame_state_modcall_t);
 
        /*
         *      Grab the thread/module specific data if any exists.
@@ -1625,7 +1625,7 @@ static void unlang_module_signal(REQUEST *request, void *rctx, fr_state_signal_t
        unlang_resume_t                 *mr;
        unlang_module_call_t            *mc;
 
-       unlang_stack_state_modcall_t    *ms = NULL;
+       unlang_frame_state_modcall_t    *ms = NULL;
 
        rad_assert(stack->depth > 0);
 
@@ -1635,7 +1635,7 @@ static void unlang_module_signal(REQUEST *request, void *rctx, fr_state_signal_t
        if (!mr->signal) return;
 
        mc = unlang_generic_to_module_call(mr->parent);
-       ms = talloc_get_type_abort(frame->state, unlang_stack_state_modcall_t);
+       ms = talloc_get_type_abort(frame->state, unlang_frame_state_modcall_t);
 
        ((fr_unlang_module_signal_t)mr->signal)(request,
                                                mc->module_instance->dl_inst->data, ms->thread->data,
@@ -1650,11 +1650,11 @@ static unlang_action_t unlang_module_resume(REQUEST *request, rlm_rcode_t *presu
        unlang_resume_t                 *mr = unlang_generic_to_resume(instruction);
        unlang_module_call_t            *mc = unlang_generic_to_module_call(mr->parent);
 
-       unlang_stack_state_modcall_t    *ms = NULL;
+       unlang_frame_state_modcall_t    *ms = NULL;
 
        rad_assert(mr->parent->type == UNLANG_TYPE_MODULE_CALL);
 
-       ms = talloc_get_type_abort(frame->state, unlang_stack_state_modcall_t);
+       ms = talloc_get_type_abort(frame->state, unlang_frame_state_modcall_t);
 
        /*
         *      Lock is noop unless instance->mutex is set.
index 35f082616a98175ee471c7b50c2f56b7df8ee7fe..39499bd1c4044fa2808aa3123130304a4085af8d 100644 (file)
@@ -224,7 +224,7 @@ typedef struct {
  */
 typedef struct {
        module_thread_instance_t *thread;                       //!< thread-local data for this module
-} unlang_stack_state_modcall_t;
+} unlang_frame_state_modcall_t;
 
 /** State of a foreach loop
  *
@@ -239,7 +239,7 @@ typedef struct {
 #ifndef NDEBUG
        int                     indent;                         //!< for catching indentation issues
 #endif
-} unlang_stack_state_foreach_t;
+} unlang_frame_state_foreach_t;
 
 /** State of a redundant operation
  *
@@ -247,7 +247,7 @@ typedef struct {
 typedef struct {
        unlang_t                *child;
        unlang_t                *found;
-} unlang_stack_state_redundant_t;
+} unlang_frame_state_redundant_t;
 
 /** Our interpreter stack, as distinct from the C stack
  *
@@ -291,8 +291,8 @@ typedef struct {
        bool                    top_frame : 1;                  //!< are we the top frame of the stack?
 
        union {
-               unlang_stack_state_foreach_t    foreach;        //!< Foreach iterator state.
-               unlang_stack_state_redundant_t  redundant;      //!< Redundant section state.
+               unlang_frame_state_foreach_t    foreach;        //!< Foreach iterator state.
+               unlang_frame_state_redundant_t  redundant;      //!< Redundant section state.
        };
 } unlang_stack_frame_t;
 
index fecfb579a7f1af805b89abc7093d4b66bc80cb79..e8ce167b38f0de67904b7be5e64d1fd94e1341a4 100644 (file)
@@ -38,7 +38,7 @@ RCSID("$Id$")
 typedef struct {
        fr_value_box_t          *result;                        //!< Where to store the result of the
                                                                ///< xlat expansion. This is usually discarded.
-} unlang_stack_state_xlat_inline_t;
+} unlang_frame_state_xlat_inline_t;
 
 /** State of an xlat expansion
  *
@@ -58,7 +58,7 @@ typedef struct {
                                                                ///< asynchronous xlat functions.
        bool                    alternate;                      //!< record which alternate branch we
                                                                ///< previously took.
-} unlang_stack_state_xlat_t;
+} unlang_frame_state_xlat_t;
 
 /** Static instruction for performing xlat evaluations
  *
@@ -93,7 +93,7 @@ void xlat_unlang_push(TALLOC_CTX *ctx, fr_value_box_t **out,
                      REQUEST *request, xlat_exp_t const *exp, bool top_frame)
 {
 
-       unlang_stack_state_xlat_t       *state;
+       unlang_frame_state_xlat_t       *state;
        unlang_stack_t                  *stack = request->stack;
        unlang_stack_frame_t            *frame;
 
@@ -106,7 +106,7 @@ void xlat_unlang_push(TALLOC_CTX *ctx, fr_value_box_t **out,
        /*
         *      Allocate its state, and setup a cursor for the xlat nodes
         */
-       frame->state = state = talloc_zero(stack, unlang_stack_state_xlat_t);
+       frame->state = state = talloc_zero(stack, unlang_frame_state_xlat_t);
        state->exp = exp;
 
        fr_cursor_init(&state->values, out);
@@ -124,7 +124,7 @@ static unlang_action_t xlat_unlang(REQUEST *request,
 {
        unlang_stack_t                  *stack = request->stack;
        unlang_stack_frame_t            *frame = &stack->frame[stack->depth];
-       unlang_stack_state_xlat_t       *xs = talloc_get_type_abort(frame->state, unlang_stack_state_xlat_t);
+       unlang_frame_state_xlat_t       *xs = talloc_get_type_abort(frame->state, unlang_frame_state_xlat_t);
        xlat_exp_t const                *child = NULL;
        xlat_action_t                   xa;
 
@@ -233,7 +233,7 @@ static unlang_action_t xlat_unlang_resume(REQUEST *request, rlm_rcode_t *presult
        unlang_stack_frame_t            *frame = &stack->frame[stack->depth];
        unlang_t                        *instruction = frame->instruction;
        unlang_resume_t                 *mr = unlang_generic_to_resume(instruction);
-       unlang_stack_state_xlat_t       *xs = talloc_get_type_abort(frame->state, unlang_stack_state_xlat_t);
+       unlang_frame_state_xlat_t       *xs = talloc_get_type_abort(frame->state, unlang_frame_state_xlat_t);
        xlat_action_t                   xa;
 
        xa = xlat_frame_eval_resume(xs->ctx, &xs->values, mr->callback, xs->exp, request, &xs->result, rctx);
@@ -274,9 +274,9 @@ static unlang_action_t xlat_unlang_inline(REQUEST *request,
 
        if (!mx->exec) {
                TALLOC_CTX *pool;
-               unlang_stack_state_xlat_inline_t *state;
+               unlang_frame_state_xlat_inline_t *state;
 
-               MEM(frame->state = state = talloc_zero(stack, unlang_stack_state_xlat_inline_t));
+               MEM(frame->state = state = talloc_zero(stack, unlang_frame_state_xlat_inline_t));
                MEM(pool = talloc_pool(frame->state, 1024));    /* Pool to absorb some allocs */
 
                xlat_unlang_push(pool, &state->result, request, mx->exp, false);