]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add entries to unlang_frame_state_module_t to track tmpl expansion
authorNick Porter <nick@portercomputing.co.uk>
Fri, 3 Mar 2023 15:29:44 +0000 (15:29 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 10 Mar 2023 17:18:37 +0000 (17:18 +0000)
src/lib/unlang/module_priv.h

index 49291d769fea6f8f3cbca30f050fb0cd5aadc55a..03a0376cd5f7d8c22a9b796b391dd35628b21912 100644 (file)
@@ -42,6 +42,15 @@ typedef struct {
                                                                ///< to be allocated from.
 } unlang_module_t;
 
+/** What state the module env for the current call is in.
+ *
+ */
+typedef enum {
+       MOD_ENV_EXP_INIT = 0,           //!< Expansion not yet started.
+       MOD_ENV_EXP_PROC,               //!< Expansion in progress.
+       MOD_ENV_EXP_DONE                //!< All expansions done.
+} module_env_state_t;
+
 /** A module stack entry
  *
  * Represents a single module call on the unlang stack.
@@ -54,6 +63,9 @@ typedef struct {
                                                                ///< shared between all threads, so we can't
                                                                ///< cache thread-specific data in the #unlang_t.
 
+       module_env_state_t              env_state;              //!< State of the current call module_env.
+       module_env_parsed_t const       *last_expanded;         //!< Last environment tmpl expanded.
+       fr_value_box_list_t             tmpl_expanded;          //!< Value boxes produced by last expanded tmpl.
        void                            *env_data;              //!< Expanded per call module environment tmpls.
 
 #ifndef NDEBUG