]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Define module_method_env_t and add to module_method_name_t
authorNick Porter <nick@portercomputing.co.uk>
Mon, 27 Feb 2023 15:59:20 +0000 (15:59 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 10 Mar 2023 17:18:34 +0000 (17:18 +0000)
Links lists of module_env_t with module methods and the data structures
which the evaluated tmpls will populate.

src/lib/server/module.h

index b4bdfc6e14a5222f72682e06416a47ac578ecd45..48e8c977eb1492ffcab9eb50d7775a9257407a7e 100644 (file)
@@ -43,6 +43,7 @@ typedef struct module_instance_s              module_instance_t;
 typedef struct module_thread_instance_s                module_thread_instance_t;
 typedef struct module_env_s                    module_env_t;
 typedef struct module_env_parsed_s             module_env_parsed_t;
+typedef struct module_method_env_s             module_method_env_t;
 typedef struct module_list_t                   module_list_t;
 
 #define MODULE_TYPE_THREAD_SAFE                (0 << 0)        //!< Module is threadsafe.
@@ -122,14 +123,21 @@ extern "C" {
 FR_DLIST_TYPES(mod_env_parsed)
 FR_DLIST_TYPEDEFS(mod_env_parsed, mod_env_parsed_head_t, mod_env_parsed_entry_t)
 
+struct module_method_env_s {
+       size_t                          inst_size;              //!< Size of per call module env.
+       char const                      *inst_type;             //!< Type of per call module env.
+       module_env_t const              *env;                   //!< Parsing rules for module method env.
+};
+
 /** Named methods exported by a module
  *
  */
 struct module_method_name_s {
-       char const              *name1;                 //!< i.e. "recv", "send", "process"
-       char const              *name2;                 //!< The packet type i.e Access-Request, Access-Reject.
+       char const                      *name1;                 //!< i.e. "recv", "send", "process"
+       char const                      *name2;                 //!< The packet type i.e Access-Request, Access-Reject.
 
-       module_method_t         method;                 //!< Module method to call
+       module_method_t                 method;                 //!< Module method to call
+       module_method_env_t const       *method_env;            //!< Call specific conf parsing.
 };
 
 #define MODULE_NAME_TERMINATOR { NULL }