]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Move xlat instruction into the function that uses it
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 1 Dec 2021 14:39:49 +0000 (08:39 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 1 Dec 2021 20:06:55 +0000 (14:06 -0600)
src/lib/unlang/xlat.c

index f8f105b57b8ac23ce21349f830a2df99316407c8..b5086b339bec4a78f2f0241950cc905da494b644 100644 (file)
@@ -70,30 +70,6 @@ typedef struct {
        fr_event_timer_t const          *ev;                            //!< Event in this worker's event heap.
 } unlang_xlat_event_t;
 
-
-/** Static instruction for performing xlat evaluations
- *
- */
-static unlang_t xlat_instruction = {
-       .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,
-       },
-};
-
 /** Frees an unlang event, removing it from the request's event loop
  *
  * @param[in] ev       The event to free.
@@ -199,6 +175,28 @@ int unlang_xlat_event_timeout_add(request_t *request, fr_unlang_xlat_timeout_t c
 int unlang_xlat_push(TALLOC_CTX *ctx, fr_value_box_list_t *out,
                     request_t *request, xlat_exp_t const *exp, bool top_frame)
 {
+       /** Static instruction for performing xlat evaluations
+        *
+        */
+       static unlang_t xlat_instruction = {
+               .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,
+               },
+       };
 
        unlang_frame_state_xlat_t       *state;
        unlang_stack_t                  *stack = request->stack;