]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use module_t as the common set of fields in loadable modules
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 2 Mar 2022 21:18:50 +0000 (15:18 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 3 Mar 2022 02:35:51 +0000 (20:35 -0600)
138 files changed:
src/lib/eap/submodule.h
src/lib/io/master.c
src/lib/server/dl_module.h
src/lib/server/module.c
src/lib/server/module.h
src/lib/server/module_rlm.c
src/lib/server/module_rlm.h
src/lib/server/process.h
src/lib/unlang/compile.c
src/listen/arp/proto_arp.c
src/listen/arp/proto_arp_ethernet.c
src/listen/control/proto_control.c
src/listen/control/proto_control_unix.c
src/listen/cron/proto_cron.c
src/listen/cron/proto_cron_crontab.c
src/listen/detail/proto_detail.c
src/listen/detail/proto_detail_file.c
src/listen/detail/proto_detail_work.c
src/listen/dhcpv4/proto_dhcpv4.c
src/listen/dhcpv4/proto_dhcpv4_udp.c
src/listen/dhcpv6/proto_dhcpv6.c
src/listen/dhcpv6/proto_dhcpv6_udp.c
src/listen/dns/proto_dns.c
src/listen/dns/proto_dns_udp.c
src/listen/load/proto_load.c
src/listen/load/proto_load_step.c
src/listen/radius/proto_radius.c
src/listen/radius/proto_radius_tcp.c
src/listen/radius/proto_radius_udp.c
src/listen/tacacs/proto_tacacs.c
src/listen/tacacs/proto_tacacs_tcp.c
src/listen/vmps/proto_vmps.c
src/listen/vmps/proto_vmps_udp.c
src/modules/proto_bfd/proto_bfd.c
src/modules/proto_ldap_sync/proto_ldap_sync.c
src/modules/rlm_always/rlm_always.c
src/modules/rlm_attr_filter/rlm_attr_filter.c
src/modules/rlm_cache/drivers/rlm_cache_memcached/rlm_cache_memcached.c
src/modules/rlm_cache/drivers/rlm_cache_rbtree/rlm_cache_rbtree.c
src/modules/rlm_cache/drivers/rlm_cache_redis/rlm_cache_redis.c
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_cache/rlm_cache.h
src/modules/rlm_chap/rlm_chap.c
src/modules/rlm_cipher/rlm_cipher.c
src/modules/rlm_client/rlm_client.c
src/modules/rlm_couchbase/rlm_couchbase.c
src/modules/rlm_csv/rlm_csv.c
src/modules/rlm_date/rlm_date.c
src/modules/rlm_delay/rlm_delay.c
src/modules/rlm_detail/rlm_detail.c
src/modules/rlm_dhcpv4/rlm_dhcpv4.c
src/modules/rlm_dict/rlm_dict.c
src/modules/rlm_digest/rlm_digest.c
src/modules/rlm_eap/rlm_eap.c
src/modules/rlm_eap/types/rlm_eap_aka/rlm_eap_aka.c
src/modules/rlm_eap/types/rlm_eap_aka_prime/rlm_eap_aka_prime.c
src/modules/rlm_eap/types/rlm_eap_fast/rlm_eap_fast.c
src/modules/rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c
src/modules/rlm_eap/types/rlm_eap_md5/rlm_eap_md5.c
src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c
src/modules/rlm_eap/types/rlm_eap_peap/rlm_eap_peap.c
src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c
src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c
src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c
src/modules/rlm_eap/types/rlm_eap_ttls/rlm_eap_ttls.c
src/modules/rlm_escape/rlm_escape.c
src/modules/rlm_exec/rlm_exec.c
src/modules/rlm_expr/rlm_expr.c
src/modules/rlm_files/rlm_files.c
src/modules/rlm_icmp/rlm_icmp.c
src/modules/rlm_idn/rlm_idn.c
src/modules/rlm_imap/rlm_imap.c
src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c
src/modules/rlm_json/rlm_json.c
src/modules/rlm_krb5/rlm_krb5.c
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_linelog/rlm_linelog.c
src/modules/rlm_logintime/rlm_logintime.c
src/modules/rlm_logtee/rlm_logtee.c
src/modules/rlm_lua/rlm_lua.c
src/modules/rlm_mruby/rlm_mruby.c
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_opendirectory/rlm_opendirectory.c
src/modules/rlm_pam/rlm_pam.c
src/modules/rlm_pap/rlm_pap.c
src/modules/rlm_passwd/rlm_passwd.c
src/modules/rlm_perl/rlm_perl.c
src/modules/rlm_python/rlm_python.c
src/modules/rlm_radius/rlm_radius.h
src/modules/rlm_radius/rlm_radius_udp.c
src/modules/rlm_radutmp/rlm_radutmp.c
src/modules/rlm_redis/rlm_redis.c
src/modules/rlm_redis_ippool/rlm_redis_ippool.c
src/modules/rlm_rediswho/rlm_rediswho.c
src/modules/rlm_rest/rlm_rest.c
src/modules/rlm_securid/rlm_securid.c
src/modules/rlm_sigtran/rlm_sigtran.c
src/modules/rlm_smtp/rlm_smtp.c
src/modules/rlm_soh/rlm_soh.c
src/modules/rlm_sometimes/rlm_sometimes.c
src/modules/rlm_sql/drivers/rlm_sql_cassandra/rlm_sql_cassandra.c
src/modules/rlm_sql/drivers/rlm_sql_db2/rlm_sql_db2.c
src/modules/rlm_sql/drivers/rlm_sql_firebird/rlm_sql_firebird.c
src/modules/rlm_sql/drivers/rlm_sql_freetds/rlm_sql_freetds.c
src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c
src/modules/rlm_sql/drivers/rlm_sql_null/rlm_sql_null.c
src/modules/rlm_sql/drivers/rlm_sql_oracle/rlm_sql_oracle.c
src/modules/rlm_sql/drivers/rlm_sql_postgresql/rlm_sql_postgresql.c
src/modules/rlm_sql/drivers/rlm_sql_sqlite/rlm_sql_sqlite.c
src/modules/rlm_sql/drivers/rlm_sql_unixodbc/rlm_sql_unixodbc.c
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_sql/rlm_sql.h
src/modules/rlm_sqlcounter/rlm_sqlcounter.c
src/modules/rlm_sqlippool/rlm_sqlippool.c
src/modules/rlm_stats/rlm_stats.c
src/modules/rlm_test/rlm_test.c
src/modules/rlm_totp/rlm_totp.c
src/modules/rlm_unbound/rlm_unbound.c
src/modules/rlm_unix/rlm_unix.c
src/modules/rlm_unpack/rlm_unpack.c
src/modules/rlm_utf8/rlm_utf8.c
src/modules/rlm_wimax/rlm_wimax.c
src/modules/rlm_winbind/rlm_winbind.c
src/modules/rlm_yubikey/rlm_yubikey.c
src/process/arp/base.c
src/process/control/base.c
src/process/dhcpv4/base.c
src/process/dhcpv6/base.c
src/process/dns/base.c
src/process/eap_aka/base.c
src/process/eap_aka_prime/base.c
src/process/eap_sim/base.c
src/process/radius/base.c
src/process/tacacs/base.c
src/process/tls/base.c
src/process/ttls/base.c
src/process/vmps/base.c
src/protocols/ethernet/ethernet.c

index b1bd7e30bca4ddd10ae3a71bd1fd87b507ed3ee0..0e4e04b4ab041fadf13e2de758402b9d1a065cc7 100644 (file)
@@ -47,9 +47,7 @@ typedef eap_type_t (*eap_type_identity_t)(void *inst, char const *id, size_t id_
  *
  */
 typedef struct {
-       DL_MODULE_COMMON;                               //!< Common fields to all loadable modules.
-       FR_MODULE_COMMON;                               //!< Common fields for all instantiated modules.
-       FR_MODULE_THREADED_COMMON;                      //!< Common fields for threaded modules.
+       module_t                        common;                 //!< Common fields provided by all modules.
 
        eap_type_t                      provides[MAX_PROVIDED_METHODS]; //!< Allow the module to register itself for more
                                                                        ///< than one EAP-Method.
index a92848cab401b6277594dd459ec82a51ade06de7..0a5c8401f7745c51d7c7997685a3ec50c0afa04e 100644 (file)
@@ -3045,7 +3045,7 @@ int fr_master_io_listen(TALLOC_CTX *ctx, fr_io_instance_t *inst, fr_schedule_t *
 
 
 fr_app_io_t fr_master_app_io = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "radius_master_io",
 
        .bootstrap              = mod_bootstrap,
index def61141a63dbcd223c6b84e959e7e9336aced3f..c67ecaa8015a15d4c0e5c0832d4ba568f64564d6 100644 (file)
@@ -62,7 +62,7 @@ typedef struct dl_module_instance_s dl_module_inst_t;
 /** Stop people using different module/library/server versions together
  *
  */
-#define RLM_MODULE_INIT RADIUSD_MAGIC_NUMBER
+#define MODULE_MAGIC_INIT RADIUSD_MAGIC_NUMBER
 
 typedef enum {
        DL_MODULE_TYPE_MODULE = 0,      //!< Standard loadable module.
index 907cf05f9f0b75c58aef349b3686015efa2c21e7..2c5a7cf0da6b313d6037417f271638b5cda30907 100644 (file)
@@ -535,7 +535,7 @@ int module_instantiate(void *instance)
         *
         *      If it isn't, we create a mutex.
         */
-       if ((mi->module->type & RLM_TYPE_THREAD_UNSAFE) != 0) {
+       if ((mi->module->type & MODULE_TYPE_THREAD_UNSAFE) != 0) {
                mi->mutex = talloc_zero(mi, pthread_mutex_t);
 
                /*
index e4db1181b0e889e9c4a589f69dc1a1056198fa6a..0c0d6e6724074dd1e13054b21e3a02c67927b493 100644 (file)
@@ -41,13 +41,13 @@ typedef struct module_method_names_s                module_method_names_t;
 typedef struct module_instance_s               module_instance_t;
 typedef struct module_thread_instance_s                module_thread_instance_t;
 
-#define RLM_TYPE_THREAD_SAFE   (0 << 0)        //!< Module is threadsafe.
-#define RLM_TYPE_THREAD_UNSAFE (1 << 0)        //!< Module is not threadsafe.
-                                               //!< Server will protect calls
-                                               //!< with mutex.
-#define RLM_TYPE_RESUMABLE             (1 << 2)        //!< does yield / resume
+#define MODULE_TYPE_THREAD_SAFE                (0 << 0)        //!< Module is threadsafe.
+#define MODULE_TYPE_THREAD_UNSAFE      (1 << 0)        //!< Module is not threadsafe.
+                                                       //!< Server will protect calls
+                                                       //!< with mutex.
+#define MODULE_TYPE_RESUMABLE          (1 << 2)        //!< does yield / resume
 
-#define RLM_TYPE_RETRY         (1 << 3)        //!< can handle retries
+#define MODULE_TYPE_RETRY              (1 << 3)        //!< can handle retries
 
 /** Module section callback
  *
@@ -97,24 +97,6 @@ typedef int (*module_thread_instantiate_t)(module_thread_inst_ctx_t const *mctx)
  */
 typedef int (*module_thread_detach_t)(module_thread_inst_ctx_t const *mctx);
 
-#define FR_MODULE_COMMON \
-       struct { \
-               module_instantiate_t            bootstrap;              \
-               module_instantiate_t            instantiate;            \
-               int                             type;   /* flags */     \
-       }
-
-/** Common fields for the interface struct modules export
- *
- */
-#define FR_MODULE_THREADED_COMMON \
-       struct { \
-               module_thread_instantiate_t     thread_instantiate;     \
-               module_thread_detach_t          thread_detach;          \
-               char const                      *thread_inst_type;      \
-               size_t                          thread_inst_size;       \
-       }
-
 #ifdef __cplusplus
 }
 #endif
@@ -132,18 +114,6 @@ typedef int (*module_thread_detach_t)(module_thread_inst_ctx_t const *mctx);
 extern "C" {
 #endif
 
-/** Common fields for submodules
- *
- * This should either be the first field in the structure exported from
- * the submodule or the submodule should export an identical set of fields
- * in the same order, preferably using the macros above.
- */
-struct submodule_s {
-       DL_MODULE_COMMON;                               //!< Common fields for all loadable modules.
-       FR_MODULE_COMMON;                               //!< Common fields for all instantiated modules.
-       FR_MODULE_THREADED_COMMON;                      //!< Common fields for threaded modules.
-};
-
 /** Named methods exported by a module
  *
  */
@@ -162,13 +132,15 @@ struct module_method_names_s {
  * within the module to different sections.
  */
 struct module_s {
-       DL_MODULE_COMMON;                                       //!< Common fields for all loadable modules.
-       FR_MODULE_COMMON;                                       //!< Common fields for all instantiated modules.
-       FR_MODULE_THREADED_COMMON;                              //!< Common fields for threaded modules.
-
-       module_method_t                 methods[MOD_COUNT];     //!< Pointers to the various section callbacks.
-       module_method_names_t const     *method_names;          //!< named methods
-       fr_dict_t const                 **dict;                 //!< pointer to local fr_dict_t*
+       DL_MODULE_COMMON;               //!< Common fields for all loadable modules.
+
+       module_instantiate_t            bootstrap;
+       module_instantiate_t            instantiate;
+       int                             type;   /* flags */
+       module_thread_instantiate_t     thread_instantiate;
+       module_thread_detach_t          thread_detach;
+       char const                      *thread_inst_type;
+       size_t                          thread_inst_size;
 };
 
 /** Per instance data
index ea891e28fadaa5d96cea56224b7b5ba060db7bae..8b2559d73a0fd2cb9cc04da6bf4d6e134e55217c 100644 (file)
@@ -432,6 +432,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co
        module_instance_t               *mi;
        module_method_names_t const     *methods;
        char const                      *method_name1, *method_name2;
+       module_rlm_t const              *mrlm;
 
        if (method) *method = NULL;
 
@@ -451,23 +452,25 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co
         */
        mi = module_by_name(NULL, name);
        if (mi) {
-               virtual_server_method_t const *allowed_list;
+               virtual_server_method_t const   *allowed_list;
 
                if (!method) return mi;
 
+               mrlm = module_rlm_from_module(mi->module);
+
                /*
                 *      We're not searching for a named method, OR the
                 *      module has no named methods.  Try to return a
                 *      method based on the component.
                 */
-               if (!method_name1 || !mi->module->method_names) goto return_component;
+               if (!method_name1 || !mrlm->method_names) goto return_component;
 
                /*
                 *      Walk through the module, finding a matching
                 *      method.
                 */
-               for (j = 0; mi->module->method_names[j].name1 != NULL; j++) {
-                       methods = &mi->module->method_names[j];
+               for (j = 0; mrlm->method_names[j].name1 != NULL; j++) {
+                       methods = &mrlm->method_names[j];
 
                        /*
                         *      Wildcard match name1, we're
@@ -538,8 +541,8 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co
                        int k;
                        virtual_server_method_t const *allowed = &allowed_list[j];
 
-                       for (k = 0; mi->module->method_names[k].name1 != NULL; k++) {
-                               methods = &mi->module->method_names[k];
+                       for (k = 0; mrlm->method_names[k].name1 != NULL; k++) {
+                               methods = &mrlm->method_names[k];
 
                                fr_assert(methods->name1 != CF_IDENT_ANY); /* should have been caught above */
 
@@ -574,8 +577,8 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co
                 *      No matching method.  Just return a method
                 *      based on the component.
                 */
-               if (component && mi->module->methods[*component]) {
-                       *method = mi->module->methods[*component];
+               if (component && mrlm->methods[*component]) {
+                       *method = mrlm->methods[*component];
                }
 
                /*
@@ -625,6 +628,8 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co
                return NULL;
        }
 
+       mrlm = module_rlm_from_module(mi->module);
+
        /*
         *      We have a module, but the caller doesn't care about
         *      method or names, so just return the module.
@@ -655,7 +660,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co
                         */
                        if (component) {
                                *component = i;
-                               if (method) *method = mi->module->methods[*component];
+                               if (method) *method = mrlm->methods[*component];
                        }
 
                        /*
@@ -673,7 +678,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co
        /*
         *      We've found the module, but it has no named methods.
         */
-       if (!mi->module->method_names) {
+       if (!mrlm->method_names) {
                *name1 = name + (p - inst_name);
                *name2 = NULL;
                talloc_free(inst_name);
@@ -686,8 +691,8 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co
         *      matches anything else.
         */
        if (!q) {
-               for (j = 0; mi->module->method_names[j].name1 != NULL; j++) {
-                       methods = &mi->module->method_names[j];
+               for (j = 0; mrlm->method_names[j].name1 != NULL; j++) {
+                       methods = &mrlm->method_names[j];
 
                        /*
                         *      If we do not have the second $method, then ignore it!
@@ -743,8 +748,8 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co
         *
         *      Loop over the method names, seeing if we have a match.
         */
-       for (j = 0; mi->module->method_names[j].name1 != NULL; j++) {
-               methods = &mi->module->method_names[j];
+       for (j = 0; mrlm->method_names[j].name1 != NULL; j++) {
+               methods = &mrlm->method_names[j];
 
                /*
                 *      If name1 doesn't match, skip it.
@@ -1011,7 +1016,7 @@ int modules_rlm_bootstrap(CONF_SECTION *root)
                 *      Compile the default "actions" subsection, which includes retries.
                 */
                actions = cf_section_find(subcs, "actions", NULL);
-               if (actions && unlang_compile_actions(&mi->actions, actions, (mi->module->type & RLM_TYPE_RETRY) != 0)) {
+               if (actions && unlang_compile_actions(&mi->actions, actions, (mi->module->type & MODULE_TYPE_RETRY) != 0)) {
                        talloc_free(mi);
                        return -1;
                }
index 620914c94d8c12e962fd558d90b113877208fe9d..5a3a9de4ef9e60df91b475321648f72f6d236042 100644 (file)
@@ -33,6 +33,22 @@ extern "C" {
 
 extern char const *section_type_value[MOD_COUNT];
 
+typedef struct {
+       module_t                        common;                 //!< Common fields presented by all modules.
+
+       module_method_t                 methods[MOD_COUNT];     //!< Pointers to the various section callbacks.
+       module_method_names_t const     *method_names;          //!< named methods
+       fr_dict_t const                 **dict;                 //!< pointer to local fr_dict_t*
+} module_rlm_t;
+
+/** Cast a module_t to a module_rlm_t
+ *
+ */
+static inline module_rlm_t const *module_rlm_from_module(module_t const *module)
+{
+       return (module_rlm_t const *)module;
+}
+
 /** @name Convenience wrappers around other internal APIs to make them easier to instantiate with modules
  *
  * @{
index d44127ccbe374fefdb594e3f605c537b6fe4b4c8..955bf68709b135e51684711d89e954666f3b7b99 100644 (file)
@@ -53,7 +53,9 @@ extern "C" {
  */
 typedef struct fr_process_module_s {
        DL_MODULE_COMMON;                               //!< Common fields for all loadable modules.
-       FR_MODULE_COMMON;                               //!< bootstrap, instantiate
+       module_instantiate_t            bootstrap;
+       module_instantiate_t            instantiate;
+       int                             type;   /* flags */
 
        module_method_t                 process;        //!< Process packets
        virtual_server_compile_t const  *compile_list;  //!< list of processing sections
index 1875c55933568dff350cf31c86e7540352c1c07f..5e129c7a3e65e18c5165295fcb7386cd83cddd1d 100644 (file)
@@ -3978,18 +3978,19 @@ static unlang_t *compile_module(unlang_t *parent, unlang_compile_t *unlang_ctx,
                                CONF_ITEM *ci, module_instance_t *inst, module_method_t method,
                                char const *realname)
 {
+       module_rlm_t const *mrlm = module_rlm_from_module(inst->module);
        unlang_t *c;
        unlang_module_t *single;
 
        /*
         *      Can't use "chap" in "dhcp".
         */
-       if (inst->module->dict && *inst->module->dict && unlang_ctx->rules && unlang_ctx->rules->attr.dict_def &&
+       if (mrlm->dict && *mrlm->dict && unlang_ctx->rules && unlang_ctx->rules->attr.dict_def &&
            (unlang_ctx->rules->attr.dict_def != fr_dict_internal()) &&
-           (*(inst->module->dict) != unlang_ctx->rules->attr.dict_def)) {
+           (*(mrlm->dict) != unlang_ctx->rules->attr.dict_def)) {
                cf_log_err(ci, "The \"%s\" module can only used with 'namespace = %s'.  It cannot be used with 'namespace = %s'.",
                           inst->module->name,
-                          fr_dict_root(*inst->module->dict)->name,
+                          fr_dict_root(*mrlm->dict)->name,
                           fr_dict_root(unlang_ctx->rules->attr.dict_def)->name);
                return NULL;
        }
@@ -4045,7 +4046,7 @@ static unlang_t *compile_module(unlang_t *parent, unlang_compile_t *unlang_ctx,
         */
        if (cf_item_is_section(ci) &&
            !unlang_compile_actions(&c->actions, cf_item_to_section(ci),
-                                   (inst->module->type & RLM_TYPE_RETRY) != 0)) {
+                                   (inst->module->type & MODULE_TYPE_RETRY) != 0)) {
                    talloc_free(c);
                    return NULL;
        }
@@ -4255,8 +4256,8 @@ check_for_module:
         */
        UPDATE_CTX2;
        inst = module_rlm_by_name_and_method(&method, &unlang_ctx2.component,
-                                        &unlang_ctx2.section_name1, &unlang_ctx2.section_name2,
-                                        realname);
+                                            &unlang_ctx2.section_name1, &unlang_ctx2.section_name2,
+                                            realname);
        if (inst) {
                c = compile_module(parent, &unlang_ctx2, ci, inst, method, realname);
                goto allocate_number;
index eff412c78b2c0d273d271dd4e0d4fb948ed4014d..e45679e5ee15387ecf16e2bdd2bcc675648a77a2 100644 (file)
@@ -300,7 +300,7 @@ static void mod_unload(void)
 }
 
 fr_app_t proto_arp = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "arp",
        .config                 = proto_arp_config,
        .inst_size              = sizeof(proto_arp_t),
index 954cfda133933eea737e8c08627bff2b1508d3e5..0fdf6cbfef212edc605e316f193c31b9cb055634 100644 (file)
@@ -227,7 +227,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *cs)
 
 
 fr_app_io_t proto_arp_ethernet = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "arp_ethernet",
        .config                 = arp_listen_config,
        .inst_size              = sizeof(proto_arp_ethernet_t),
index 2f5b2cdc045a1f92e79387a1ee0c9d4ee1bae70b..7a4fe1319045c4fc6f620c88045ca5a7fdf7bf12 100644 (file)
@@ -218,7 +218,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf)
 }
 
 fr_app_t proto_control = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "control",
        .config                 = proto_control_config,
        .inst_size              = sizeof(proto_control_t),
index e6cea08281c19ced565d6f0cc775ba06fde64958..e562b06064aa3f9a0477df3d17d6023fe16e8c61 100644 (file)
@@ -1179,7 +1179,7 @@ static RADCLIENT *mod_client_find(fr_listen_t *li, UNUSED fr_ipaddr_t const *ipa
 
 extern fr_app_io_t proto_control_unix;
 fr_app_io_t proto_control_unix = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "control_unix",
        .config                 = unix_listen_config,
        .inst_size              = sizeof(proto_control_unix_t),
index a2d139bff9fbe56f6a4e085e9fae626fe2defa60..0cee760d30cef0716dfc85d28cf41ed0274540ba 100644 (file)
@@ -322,7 +322,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf)
 
 
 fr_app_t proto_cron = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "cron",
        .config                 = proto_cron_config,
        .inst_size              = sizeof(proto_cron_t),
index 5fc6e70f8a4cbbfbe9486bf5884c6d51ffae6fee..3709d368f025c8a48050f372673cf96837d20d72 100644 (file)
@@ -752,7 +752,7 @@ static int mod_instantiate(void *instance, CONF_SECTION *cs)
 }
 
 fr_app_io_t proto_cron_crontab = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "cron_crontab",
        .config                 = crontab_listen_config,
        .inst_size              = sizeof(proto_cron_crontab_t),
index 090e06c5dbf0af4a412942f39d8a8bd1a267103f..84c4eebcefb6ffc02ee425b416fecf380bf90d75 100644 (file)
@@ -570,7 +570,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf)
 
 
 fr_app_t proto_detail = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "detail",
        .config                 = proto_detail_config,
        .inst_size              = sizeof(proto_detail_t),
index 2f544e7f668686ddd2b6ada85838844728735387..3dec2c463df9bf34726c963ebb119a7cc91fc957 100644 (file)
@@ -740,7 +740,7 @@ static int mod_close(fr_listen_t *li)
  */
 extern fr_app_io_t proto_detail_file;
 fr_app_io_t proto_detail_file = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "detail_file",
        .config                 = file_listen_config,
        .inst_size              = sizeof(proto_detail_file_t),
index ba8a64aeebb8f601f26836245a8f91f99d7931ef..3e9f7acdc5c48fe48612850b1c9bf3d84551c790 100644 (file)
@@ -882,7 +882,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *cs)
  */
 extern fr_app_io_t proto_detail_work;
 fr_app_io_t proto_detail_work = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "detail_work",
        .config                 = file_listen_config,
        .inst_size              = sizeof(proto_detail_work_t),
index e30411bebca591515965dc183ebc64adde282952..8682e33342ed884c4a5449429626fd72101c5e13 100644 (file)
@@ -499,7 +499,7 @@ static void mod_unload(void)
 }
 
 fr_app_t proto_dhcpv4 = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "dhcpv4",
        .config                 = proto_dhcpv4_config,
        .inst_size              = sizeof(proto_dhcpv4_t),
index 5eb49fe21fc4a9f165235be31d55ffcca87181bd..36a620fd297e692b7a7b9178f4854b87802e7153 100644 (file)
@@ -801,7 +801,7 @@ static RADCLIENT *mod_client_find(fr_listen_t *li, fr_ipaddr_t const *ipaddr, in
 }
 
 fr_app_io_t proto_dhcpv4_udp = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "dhcpv4_udp",
        .config                 = udp_listen_config,
        .inst_size              = sizeof(proto_dhcpv4_udp_t),
index 8f76a82c7a2c34c6143d04476e9c9dbc5ebf845a..51c0a00c1a284065018864aba878b5a275fc7071 100644 (file)
@@ -496,7 +496,7 @@ static void mod_unload(void)
 }
 
 fr_app_t proto_dhcpv6 = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "dhcpv6",
        .config                 = proto_dhcpv6_config,
        .inst_size              = sizeof(proto_dhcpv6_t),
index a894c88f88f9ecc6267098e68f92f3ac2d590c33..3a02949cf24d172275e8ae7ba69051edb4c2057a 100644 (file)
@@ -649,7 +649,7 @@ static RADCLIENT *mod_client_find(fr_listen_t *li, fr_ipaddr_t const *ipaddr, in
 }
 
 fr_app_io_t proto_dhcpv6_udp = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "dhcpv6_udp",
        .config                 = udp_listen_config,
        .inst_size              = sizeof(proto_dhcpv6_udp_t),
index 7978174f8b3ad4be672e707909063ec0578bfde6..42c1a70236f467c4408e99d40bdf7e40ff33623a 100644 (file)
@@ -441,7 +441,7 @@ static void mod_unload(void)
 }
 
 fr_app_t proto_dns = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "dns",
        .config                 = proto_dns_config,
        .inst_size              = sizeof(proto_dns_t),
index 17fe82441f30e1231f8d0fe4a752f2f37a016980..3b15303eb4ed77518e9ab668817c298b827dc3e1 100644 (file)
@@ -444,7 +444,7 @@ static RADCLIENT *mod_client_find(fr_listen_t *li, fr_ipaddr_t const *ipaddr, in
 }
 
 fr_app_io_t proto_dns_udp = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "dns_udp",
        .config                 = udp_listen_config,
        .inst_size              = sizeof(proto_dns_udp_t),
index e54a2b18e827eaee4afe5e45b6446b07ff713ef7..75f1e4cbd7172bd3150bbf6e74a95bf98957f7a7 100644 (file)
@@ -324,7 +324,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf)
 
 
 fr_app_t proto_load = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "load",
        .config                 = proto_load_config,
        .inst_size              = sizeof(proto_load_t),
index 588b5da38f4f8536b84b8837c0585be118db1dbe..2e47bfd1d6918437f82c1ea3809d6749fe88c335 100644 (file)
@@ -435,7 +435,7 @@ static int mod_instantiate(void *instance, CONF_SECTION *cs)
 }
 
 fr_app_io_t proto_load_step = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "load_step",
        .config                 = load_listen_config,
        .inst_size              = sizeof(proto_load_step_t),
index 425c10cf1ffe513bcf9541c8cd98c26ecc92ed0f..0af6899bd9835edf091750735ac6fd377a29a6e7 100644 (file)
@@ -582,7 +582,7 @@ static void mod_unload(void)
 }
 
 fr_app_t proto_radius = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "radius",
        .config                 = proto_radius_config,
        .inst_size              = sizeof(proto_radius_t),
index 9b5a1e90be89df12d451dbf25013b5a2184f372d..25043961ad483af55ff5bbdedae76577e51754c7 100644 (file)
@@ -578,7 +578,7 @@ static RADCLIENT *mod_client_find(UNUSED fr_listen_t *li, fr_ipaddr_t const *ipa
 }
 
 fr_app_io_t proto_radius_tcp = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "radius_tcp",
        .config                 = tcp_listen_config,
        .inst_size              = sizeof(proto_radius_tcp_t),
index 0cbe701415ddd843f7f82d3a52e1a6ffadf2d574..883b14188fd7adb7498af7beac88aabb7d5b8e42 100644 (file)
@@ -685,7 +685,7 @@ static RADCLIENT *mod_client_find(fr_listen_t *li, fr_ipaddr_t const *ipaddr, in
 }
 
 fr_app_io_t proto_radius_udp = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "radius_udp",
        .config                 = udp_listen_config,
        .inst_size              = sizeof(proto_radius_udp_t),
index 63ea2cd6bbb3f6dbbe3e16e9c38fdcf4174644b8..f41bc32c7e8cc4df9e2ce7cf063203b7d8cafd9e 100644 (file)
@@ -554,7 +554,7 @@ static void mod_unload(void)
 }
 
 fr_app_t proto_tacacs = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "tacacs",
        .config                 = proto_tacacs_config,
        .inst_size              = sizeof(proto_tacacs_t),
index a70f8877e672432a5c6a61e6045b35bb25a58475..e73f2c7a9eaed3ad9be9ec829cef9e55a55294fc 100644 (file)
@@ -469,7 +469,7 @@ static RADCLIENT *mod_client_find(UNUSED fr_listen_t *li, fr_ipaddr_t const *ipa
 }
 
 fr_app_io_t proto_tacacs_tcp = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "tacacs_tcp",
        .config                 = tcp_listen_config,
        .inst_size              = sizeof(proto_tacacs_tcp_t),
index bb87aaa4704a533f0c58d61739c1ca1d15db2ad3..8eb02c65f272f07c1488db71df6b7244ddee2bb6 100644 (file)
@@ -467,7 +467,7 @@ static void mod_unload(void)
 }
 
 fr_app_t proto_vmps = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "vmps",
        .config                 = proto_vmps_config,
        .inst_size              = sizeof(proto_vmps_t),
index 72f643c40aca484242db7e67bbc2f660f91ead45..fed2f6e1fa5c5824e0500dedee574e7218fe7f29 100644 (file)
@@ -502,7 +502,7 @@ static char const *mod_name(fr_listen_t *li)
 }
 
 fr_app_io_t proto_vmps_udp = {
-       .magic                  = RLM_MODULE_INIT,
+       .magic                  = MODULE_MAGIC_INIT,
        .name                   = "vmps_udp",
        .config                 = udp_listen_config,
        .inst_size              = sizeof(proto_vmps_udp_t),
index d4af1e640d12003497f02be550b5ae6eb1ecf4f8..24b655391eb9f439c9f46efde7dcd3ffde65b303 100644 (file)
@@ -1840,7 +1840,7 @@ static int bfd_socket_compile(CONF_SECTION *server_cs, UNUSED CONF_SECTION *list
 
 extern rad_protocol_t proto_bfd;
 rad_protocol_t proto_bfd = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "bfd",
        .inst_size      = sizeof(bfd_socket_t),
        .transports     = TRANSPORT_UDP,
index 808d80a7758043dea35d1620794173d95b79959a..3b7db33528942c1b7167eb3a438022207267a37b 100644 (file)
@@ -1263,7 +1263,7 @@ static void proto_ldap_unload(void)
 
 extern rad_protocol_t proto_ldap_sync;
 rad_protocol_t proto_ldap_sync = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "ldap_sync",
        .inst_size      = sizeof(proto_ldap_inst_t),
        .transports     = TRANSPORT_NONE,
index a3c47cf59bb07060324efe0e92a0c57fbb496580..7964948fc111e748634e98d8b7990f6b8e196ba8 100644 (file)
@@ -158,14 +158,16 @@ static unlang_action_t CC_HINT(nonnull) mod_always_return(rlm_rcode_t *p_result,
        RETURN_MODULE_RCODE(inst->rcode);
 }
 
-extern module_t rlm_always;
-module_t rlm_always = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "always",
-       .inst_size      = sizeof(rlm_always_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_always;
+module_rlm_t rlm_always = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "always",
+               .inst_size      = sizeof(rlm_always_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate,
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_always_return,
                [MOD_AUTHORIZE]         = mod_always_return,
index 64d6d8ac4abc06666cb05ebdeb894574af6944d9..10f54784713d9b4d6318baddc155739d63531d88 100644 (file)
@@ -367,13 +367,15 @@ RLM_AF_FUNC(preacct, packet, request)
 RLM_AF_FUNC(accounting, reply, reply)
 
 /* globally exported name */
-extern module_t rlm_attr_filter;
-module_t rlm_attr_filter = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "attr_filter",
-       .inst_size      = sizeof(rlm_attr_filter_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_attr_filter;
+module_rlm_t rlm_attr_filter = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "attr_filter",
+               .inst_size      = sizeof(rlm_attr_filter_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate,
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize,
                [MOD_PREACCT]           = mod_preacct,
index 432a846c6607e4c757cce9b8307ad75028a782aa..787646016f7580a21161060318164b58856b048d 100644 (file)
@@ -316,13 +316,15 @@ static int mod_conn_reconnect(void **handle, UNUSED rlm_cache_config_t const *co
 
 extern rlm_cache_driver_t rlm_cache_memcached;
 rlm_cache_driver_t rlm_cache_memcached = {
-       .name           = "rlm_cache_memcached",
-       .magic          = RLM_MODULE_INIT,
-       .inst_size      = sizeof(rlm_cache_memcached_t),
-       .config         = driver_config,
-
-       .onload         = mod_load,
-       .instantiate    = mod_instantiate,
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "rlm_cache_memcached",
+               .inst_size      = sizeof(rlm_cache_memcached_t),
+               .config         = driver_config,
+
+               .onload         = mod_load,
+               .instantiate    = mod_instantiate
+       },
 
        .free           = cache_entry_free,
 
index 6cc4c7f91e7d3d4ee8223f58e650490c789d4a44..4701ecd019d5e7b64ec0b1b4f0a9f6f81d916f67 100644 (file)
@@ -333,12 +333,14 @@ static void cache_release(UNUSED rlm_cache_config_t const *config, void *instanc
 
 extern rlm_cache_driver_t rlm_cache_rbtree;
 rlm_cache_driver_t rlm_cache_rbtree = {
-       .name           = "rlm_cache_rbtree",
-       .magic          = RLM_MODULE_INIT,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
-       .inst_size      = sizeof(rlm_cache_rbtree_t),
-       .inst_type      = "rlm_cache_rbtree_t",
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "rlm_cache_rbtree",
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach,
+               .inst_size      = sizeof(rlm_cache_rbtree_t),
+               .inst_type      = "rlm_cache_rbtree_t",
+       },
        .alloc          = cache_entry_alloc,
 
        .find           = cache_entry_find,
index 7b328873154012af77c1319fc001f0291c5010ba..29dd1cfc67b504f0590c0207ee4ca67375a0f0c5 100644 (file)
@@ -471,14 +471,15 @@ static cache_status_t cache_entry_expire(UNUSED rlm_cache_config_t const *config
 
 extern rlm_cache_driver_t rlm_cache_redis;
 rlm_cache_driver_t rlm_cache_redis = {
-       .name           = "rlm_cache_redis",
-       .magic          = RLM_MODULE_INIT,
-       .onload         = mod_load,
-       .instantiate    = mod_instantiate,
-       .inst_size      = sizeof(rlm_cache_redis_t),
-       .config         = driver_config,
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "rlm_cache_redis",
+               .onload         = mod_load,
+               .instantiate    = mod_instantiate,
+               .inst_size      = sizeof(rlm_cache_redis_t),
+               .config         = driver_config,
+       },
        .free           = cache_entry_free,
-
        .find           = cache_entry_find,
        .insert         = cache_entry_insert,
        .expire         = cache_entry_expire,
index ef093674f0e24d420a428894b9973c8f703a8634..9bac5e9bd4c10c3142ba0ec345f662b53f4f5859 100644 (file)
@@ -33,7 +33,7 @@ RCSID("$Id$")
 
 #include "rlm_cache.h"
 
-extern module_t rlm_cache;
+extern module_rlm_t rlm_cache;
 
 static const CONF_PARSER module_config[] = {
        { FR_CONF_OFFSET("driver", FR_TYPE_STRING, rlm_cache_config_t, driver_name), .dflt = "rlm_cache_rbtree" },
@@ -997,7 +997,7 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
        /*
         *      Non optional fields and callbacks
         */
-       fr_assert(inst->driver->name);
+       fr_assert(inst->driver->common.name);
        fr_assert(inst->driver->find);
        fr_assert(inst->driver->insert);
        fr_assert(inst->driver->expire);
@@ -1397,18 +1397,20 @@ finish:
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-module_t rlm_cache = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "cache",
-       .inst_size      = sizeof(rlm_cache_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
+module_rlm_t rlm_cache = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "cache",
+               .inst_size      = sizeof(rlm_cache_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_cache_it,
                [MOD_PREACCT]           = mod_cache_it,
index 90f067a71db9948814218da3588773a9be4dec90..082f8e8adf59480770c8f77b29a7ad8b500a9d10 100644 (file)
@@ -263,9 +263,7 @@ typedef int         (*cache_reconnect_t)(rlm_cache_handle_t **handle, rlm_cache_config_
                                             void *instance, request_t *request);
 
 struct rlm_cache_driver_s {
-       DL_MODULE_COMMON;                                       //!< Common fields for all loadable modules.
-       FR_MODULE_COMMON;                                       //!< Common fields for all instantiated modules.
-       FR_MODULE_THREADED_COMMON;                              //!< Common fields for threaded modules.
+       module_t                        common;                 //!< Common fields for all loadable modules.
 
        cache_entry_alloc_t             alloc;                  //!< (optional) Allocate a new entry.
        cache_entry_free_t              free;                   //!< (optional) Free memory used by an entry.
index 34a1a1d06304b373e1d4f1387dd31dea0003fbfd..e0541bc91e3fcd5b8b41804bca20856b50dba98d 100644 (file)
@@ -309,18 +309,20 @@ static void mod_unload(void)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_chap;
-module_t rlm_chap = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "chap",
-       .inst_size      = sizeof(rlm_chap_t),
-       .onload         = mod_load,
-       .unload         = mod_unload,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_chap;
+module_rlm_t rlm_chap = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "chap",
+               .inst_size      = sizeof(rlm_chap_t),
+               .onload         = mod_load,
+               .unload         = mod_unload,
+               .instantiate    = mod_instantiate
+       },
        .dict           = &dict_radius,
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
index 347b6b6fcad878247bd0a6839bed70e5b46481c3..b02049c81c240135566a90bd845eeb106b17802c 100644 (file)
@@ -1375,18 +1375,20 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_cipher;
-module_t rlm_cipher = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "cipher",
-       .type                   = RLM_TYPE_THREAD_SAFE,
-       .inst_size              = sizeof(rlm_cipher_t),
-       .thread_inst_size       = sizeof(rlm_cipher_rsa_thread_inst_t),
-       .config                 = module_config,
-       .bootstrap              = mod_bootstrap,
-       .thread_instantiate     = mod_thread_instantiate,
+extern module_rlm_t rlm_cipher;
+module_rlm_t rlm_cipher = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "cipher",
+               .type                   = MODULE_TYPE_THREAD_SAFE,
+               .inst_size              = sizeof(rlm_cipher_t),
+               .thread_inst_size       = sizeof(rlm_cipher_rsa_thread_inst_t),
+               .config                 = module_config,
+               .bootstrap              = mod_bootstrap,
+               .thread_instantiate     = mod_thread_instantiate
+       }
 };
index b66592729ac63930085dfbc34d5633465fe8d41f..8266f9f47dee02a6e847698af7954004f9c31e56 100644 (file)
@@ -371,17 +371,19 @@ static void mod_unload(void)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_client;
-module_t rlm_client = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "dynamic_clients",
-       .type           = RLM_TYPE_THREAD_SAFE,         /* type */
-       .onload         = mod_load,
-       .unload         = mod_unload,
+extern module_rlm_t rlm_client;
+module_rlm_t rlm_client = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "dynamic_clients",
+               .type           = MODULE_TYPE_THREAD_SAFE,              /* type */
+               .onload         = mod_load,
+               .unload         = mod_unload
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize
        },
index 8ae4ee915b4aee5577c3446876890d45e7964888..9abf2451518d78da91fdb719382e779ad77bd646 100644 (file)
@@ -545,16 +545,18 @@ static int mod_load(void)
 /*
  * Hook into the FreeRADIUS module system.
  */
-extern module_t rlm_couchbase;
-module_t rlm_couchbase = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "couchbase",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_couchbase_t),
-       .config         = module_config,
-       .onload         = mod_load,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
+extern module_rlm_t rlm_couchbase;
+module_rlm_t rlm_couchbase = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "couchbase",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_couchbase_t),
+               .config         = module_config,
+               .onload         = mod_load,
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach
+       }
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize,
                [MOD_ACCOUNTING]        = mod_accounting,
index 65f6543fbbb8373e3e1cf513efa50b22b3ff299a..adb5bb9dcf23c8c08bb98113dbc8784a91e2d674 100644 (file)
@@ -1045,16 +1045,17 @@ static unlang_action_t CC_HINT(nonnull) mod_process(rlm_rcode_t *p_result, modul
        RETURN_MODULE_RCODE(rcode);
 }
 
-extern module_t rlm_csv;
-module_t rlm_csv = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "csv",
-       .type           = 0,
-       .inst_size      = sizeof(rlm_csv_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
-
+extern module_rlm_t rlm_csv;
+module_rlm_t rlm_csv = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "csv",
+               .type           = 0,
+               .inst_size      = sizeof(rlm_csv_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate,
+       },
        .method_names = (module_method_names_t[]){
                { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,  .method = mod_process },
 
index 6d9adf35a6071604f7466727a6da2ffe98461b6d..4186b4ad2d47f56d7190e8c9befe41605c0ed0d7 100644 (file)
@@ -230,12 +230,14 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
        return 0;
 }
 
-extern module_t rlm_date;
-module_t rlm_date = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "date",
-       .inst_size      = sizeof(rlm_date_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap
+extern module_rlm_t rlm_date;
+module_rlm_t rlm_date = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "date",
+               .inst_size      = sizeof(rlm_date_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap
+       }
 };
 
index a4c72c384e6350d34788e63cc7fd9d3e0dde9222..18664a4da23cb837be8a2da27ad8c120ded5d2e4 100644 (file)
@@ -270,14 +270,16 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
        return 0;
 }
 
-extern module_t rlm_delay;
-module_t rlm_delay = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "delay",
-       .type           = 0,
-       .inst_size      = sizeof(rlm_delay_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
+extern module_rlm_t rlm_delay;
+module_rlm_t rlm_delay = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "delay",
+               .type           = 0,
+               .inst_size      = sizeof(rlm_delay_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap
+       },
        .methods = {
                [MOD_PREACCT]           = mod_delay,
                [MOD_AUTHORIZE]         = mod_delay,
index 2d4cd84895a68cf2262b7c31439279177d732fe3..14790dc82704cab65d2aa1bd24ff96a8410e8f59 100644 (file)
@@ -464,13 +464,15 @@ static unlang_action_t CC_HINT(nonnull) mod_post_auth(rlm_rcode_t *p_result, mod
 
 
 /* globally exported name */
-extern module_t rlm_detail;
-module_t rlm_detail = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "detail",
-       .inst_size      = sizeof(rlm_detail_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_detail;
+module_rlm_t rlm_detail = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "detail",
+               .inst_size      = sizeof(rlm_detail_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize,
                [MOD_PREACCT]           = mod_accounting,
index 05cfd0e9b96e157eeb8de8a1006c59b7e72d6818..70712eea040556d0d488887af4ee0d697080b1be 100644 (file)
@@ -314,19 +314,20 @@ static unlang_action_t CC_HINT(nonnull) mod_process(rlm_rcode_t *p_result, modul
        return unlang_module_yield(request, dhcpv4_resume, NULL, d);
 }
 
-extern module_t rlm_dhcpv4;
-module_t rlm_dhcpv4 = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "dhcpv4",
-       .inst_size      = sizeof(rlm_dhcpv4_t),
-       .bootstrap      = mod_bootstrap,
-
-       .config                 = module_config,
-
-       .thread_inst_size = sizeof(rlm_dhcpv4_thread_t),
-       .thread_inst_type = "rlm_dhcpv4_thread_t",
-       .thread_instantiate = mod_thread_instantiate,
-
+extern module_rlm_t rlm_dhcpv4;
+module_rlm_t rlm_dhcpv4 = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "dhcpv4",
+               .inst_size              = sizeof(rlm_dhcpv4_t),
+               .bootstrap              = mod_bootstrap,
+
+               .config                 = module_config,
+
+               .thread_inst_size       = sizeof(rlm_dhcpv4_thread_t),
+               .thread_inst_type       = "rlm_dhcpv4_thread_t",
+               .thread_instantiate     = mod_thread_instantiate
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_process,
                [MOD_POST_AUTH]         = mod_process,
index e7853739444799a8a27c2c12c57ab67f4dc802bf..5a5e5377f36a88b7f3a9a09e9cebcf6e0fd4afa7 100644 (file)
@@ -252,9 +252,11 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
        return 0;
 }
 
-extern module_t rlm_dict;
-module_t rlm_dict = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "dict",
-       .bootstrap      = mod_bootstrap,
+extern module_rlm_t rlm_dict;
+module_rlm_t rlm_dict = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "dict",
+               .bootstrap      = mod_bootstrap
+       }
 };
index c6c7eb805ddcc4a49e54d3c2432b3bacbb58e97f..649aafb19767142b39ca6d5a9cb2753caab393b9 100644 (file)
@@ -468,16 +468,18 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_digest;
-module_t rlm_digest = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "digest",
-       .inst_size      = sizeof(rlm_digest_t),
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_digest;
+module_rlm_t rlm_digest = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "digest",
+               .inst_size      = sizeof(rlm_digest_t),
+               .instantiate    = mod_instantiate,
+       },
        .dict           = &dict_radius,
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
index 71fe286925409160d686017bb53b1d2c960b6570..d4977e768cb5a0da5dfe3218e6f8057ee01530be 100644 (file)
@@ -36,7 +36,7 @@ RCSID("$Id$")
 #include <freeradius-devel/unlang/module.h>
 #include "rlm_eap.h"
 
-extern module_t rlm_eap;
+extern module_rlm_t rlm_eap;
 
 /** Resume context for calling a submodule
  *
@@ -776,7 +776,7 @@ static unlang_action_t eap_method_select(rlm_rcode_t *p_result, module_ctx_t con
 
        method = &inst->methods[eap_session->type];
 
-       RDEBUG2("Calling submodule %s", method->submodule->name);
+       RDEBUG2("Calling submodule %s", method->submodule->common.name);
 
        /*
         *      Allocate a new subrequest
@@ -1205,15 +1205,17 @@ static void mod_unload(void)
  *     The module name should be the only globally exported symbol.
  *     That is, everything else should be 'static'.
  */
-module_t rlm_eap = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "eap",
-       .inst_size      = sizeof(rlm_eap_t),
-       .config         = module_config,
-       .onload         = mod_load,
-       .unload         = mod_unload,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
+module_rlm_t rlm_eap = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "eap",
+               .inst_size      = sizeof(rlm_eap_t),
+               .config         = module_config,
+               .onload         = mod_load,
+               .unload         = mod_unload,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate,
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize,
index 329789fb9ba9f85dc498c6ec72bf6c8ae5c38977..4cb59c83ee779a01a7e44cff3053f938f49aa609 100644 (file)
@@ -117,20 +117,20 @@ static void mod_unload(void)
  *     That is, everything else should be 'static'.
  */
 rlm_eap_submodule_t rlm_eap_aka = {
-       .name           = "eap_aka",
-       .magic          = RLM_MODULE_INIT,
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "eap_aka",
 
-       .provides       = { FR_EAP_METHOD_AKA },
-
-       .inst_size      = sizeof(eap_aka_sim_module_conf_t),
-       .inst_type      = "eap_aka_sim_module_conf_t",
-       .config         = submodule_config,
+               .inst_size      = sizeof(eap_aka_sim_module_conf_t),
+               .inst_type      = "eap_aka_sim_module_conf_t",
+               .config         = submodule_config,
 
-       .onload         = mod_load,
-       .unload         = mod_unload,
-
-       .instantiate    = mod_instantiate,
+               .onload         = mod_load,
+               .unload         = mod_unload,
 
+               .instantiate    = mod_instantiate,
+       },
+       .provides       = { FR_EAP_METHOD_AKA },
        .type_identity  = mod_type_identity,
        .session_init   = mod_session_init,
        .namespace      = &dict_eap_aka_sim
index 9ae92d6cb5b6c6fe85c1f24b5314f7be674ce679..2bcf4865b5549c24ea9ede0614cbf2226db6a489 100644 (file)
@@ -95,20 +95,20 @@ static void mod_unload(void)
  *     That is, everything else should be 'static'.
  */
 rlm_eap_submodule_t rlm_eap_aka_prime = {
-       .name           = "eap_aka_prime",
-       .magic          = RLM_MODULE_INIT,
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "eap_aka_prime",
 
-       .provides       = { FR_EAP_METHOD_AKA_PRIME },
-
-       .inst_size      = sizeof(eap_aka_sim_module_conf_t),
-       .inst_type      = "eap_aka_sim_module_conf_t",
-       .config         = submodule_config,
+               .inst_size      = sizeof(eap_aka_sim_module_conf_t),
+               .inst_type      = "eap_aka_sim_module_conf_t",
+               .config         = submodule_config,
 
-       .onload         = mod_load,
-       .unload         = mod_unload,
-
-       .instantiate    = mod_instantiate,
+               .onload         = mod_load,
+               .unload         = mod_unload,
 
+               .instantiate    = mod_instantiate,
+       },
+       .provides       = { FR_EAP_METHOD_AKA_PRIME },
        .type_identity  = mod_type_identity,
        .session_init   = mod_session_init,
        .namespace      = &dict_eap_aka_sim
index cda9f7897f5635eb9011addb69103fadb042412e..fe36844a25269783576cd0668613289f4e5a588f 100644 (file)
@@ -686,17 +686,18 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
  */
 extern rlm_eap_submodule_t rlm_eap_fast;
 rlm_eap_submodule_t rlm_eap_fast = {
-       .name                   = "eap_fast",
-       .magic                  = RLM_MODULE_INIT,
-
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "eap_fast",
+
+               .inst_size              = sizeof(rlm_eap_fast_t),
+               .config                 = submodule_config,
+               .instantiate            = mod_instantiate,      /* Create new submodule instance */
+
+               .thread_inst_size       = sizeof(rlm_eap_fast_thread_t),
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach,
+       },
        .provides               = { FR_EAP_METHOD_FAST },
-       .inst_size              = sizeof(rlm_eap_fast_t),
-       .config                 = submodule_config,
-       .instantiate            = mod_instantiate,      /* Create new submodule instance */
-
-       .thread_inst_size       = sizeof(rlm_eap_fast_thread_t),
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
-
        .session_init           = mod_session_init,     /* Initialise a new EAP session */
 };
index 8797c6da643e813ff6edcb6e9f53e5524fd1f81f..bc95429f7f7de239585d8c850fad746e530607ff 100644 (file)
@@ -237,14 +237,13 @@ static unlang_action_t mod_session_init(rlm_rcode_t *p_result, module_ctx_t cons
  */
 extern rlm_eap_submodule_t rlm_eap_gtc;
 rlm_eap_submodule_t rlm_eap_gtc = {
-       .name           = "eap_gtc",
-       .magic          = RLM_MODULE_INIT,
-
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "eap_gtc",
+               .inst_size      = sizeof(rlm_eap_gtc_t),
+               .config         = submodule_config,
+       },
        .provides       = { FR_EAP_METHOD_GTC },
-       .inst_size      = sizeof(rlm_eap_gtc_t),
-       .config         = submodule_config,
-
        .session_init   = mod_session_init,     /* Initialise a new EAP session */
-
        .clone_parent_lists = true              /* HACK */
 };
index 62aaf1870e3df77362ccd4cb8cc98d2b4b8c0b19..8aff65ee19d9605cdc242fc709bdf934bfb61dc9 100644 (file)
@@ -172,9 +172,10 @@ static unlang_action_t mod_session_init(rlm_rcode_t *p_result, UNUSED module_ctx
  */
 extern rlm_eap_submodule_t rlm_eap_md5;
 rlm_eap_submodule_t rlm_eap_md5 = {
-       .name           = "eap_md5",
-
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "eap_md5"
+       },
        .provides       = { FR_EAP_METHOD_MD5 },
-       .magic          = RLM_MODULE_INIT,
        .session_init   = mod_session_init,     /* Initialise a new EAP session */
 };
index be6db1a9ae0a3c264e073214553cee8f66b31058..2dba727103573108706085592c5c66c4675b7a36 100644 (file)
@@ -893,14 +893,14 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
  */
 extern rlm_eap_submodule_t rlm_eap_mschapv2;
 rlm_eap_submodule_t rlm_eap_mschapv2 = {
-       .name           = "eap_mschapv2",
-       .magic          = RLM_MODULE_INIT,
-
+       .common = {
+               .name           = "eap_mschapv2",
+               .magic          = MODULE_MAGIC_INIT,
+               .inst_size      = sizeof(rlm_eap_mschapv2_t),
+               .config         = submodule_config,
+               .instantiate    = mod_instantiate,      /* Create new submodule instance */
+       },
        .provides       = { FR_EAP_METHOD_MSCHAPV2 },
-       .inst_size      = sizeof(rlm_eap_mschapv2_t),
-       .config         = submodule_config,
-       .instantiate    = mod_instantiate,      /* Create new submodule instance */
-
        .session_init   = mod_session_init,     /* Initialise a new EAP session */
        .clone_parent_lists = false             /* HACK */
 };
index a34a42b6d0d5c193ef2589d265b596eb9c94c280..3ca0a6633b705296c9bbd5c4914409eb05dbcb90 100644 (file)
@@ -419,19 +419,19 @@ static void mod_unload(void)
  */
 extern rlm_eap_submodule_t rlm_eap_peap;
 rlm_eap_submodule_t rlm_eap_peap = {
-       .name                   = "eap_peap",
-       .magic                  = RLM_MODULE_INIT,
-
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "eap_peap",
+               .inst_size              = sizeof(rlm_eap_peap_t),
+               .config                 = submodule_config,
+               .onload                 = mod_load,
+               .unload                 = mod_unload,
+               .instantiate            = mod_instantiate,
+
+               .thread_inst_size       = sizeof(rlm_eap_peap_thread_t),
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach,
+       },
        .provides               = { FR_EAP_METHOD_PEAP },
-       .inst_size              = sizeof(rlm_eap_peap_t),
-       .config                 = submodule_config,
-       .onload                 = mod_load,
-       .unload                 = mod_unload,
-       .instantiate            = mod_instantiate,
-
-       .thread_inst_size       = sizeof(rlm_eap_peap_thread_t),
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
-
        .session_init           = mod_session_init,     /* Initialise a new EAP session */
 };
index 433c241bafdb020155f6b2df00bf678a22b3426e..87a8c584e9173fda70ea5727b4c0964109e08e6e 100644 (file)
@@ -585,15 +585,15 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
 
 extern rlm_eap_submodule_t rlm_eap_pwd;
 rlm_eap_submodule_t rlm_eap_pwd = {
-       .name           = "eap_pwd",
-       .magic          = RLM_MODULE_INIT,
-
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "eap_pwd",
+               .inst_size      = sizeof(rlm_eap_pwd_t),
+               .config         = submodule_config,
+               .instantiate    = mod_instantiate,      /* Create new submodule instance */
+               .detach         = mod_detach
+       },
        .provides       = { FR_EAP_METHOD_PWD },
-       .inst_size      = sizeof(rlm_eap_pwd_t),
-       .config         = submodule_config,
-       .instantiate    = mod_instantiate,      /* Create new submodule instance */
-       .detach         = mod_detach,
-
        .session_init   = mod_session_init,     /* Create the initial request */
 };
 
index 1bc60593cefdcd7ff90280d381f3542f3f3ed6a1..e6cfca7839b292d4b00ab0e8ed494323d5b1f859 100644 (file)
@@ -94,20 +94,19 @@ static void mod_unload(void)
  *     That is, everything else should be 'static'.
  */
 rlm_eap_submodule_t rlm_eap_sim = {
-       .name           = "eap_sim",
-       .magic          = RLM_MODULE_INIT,
-
+       .common = {
+               .name           = "eap_sim",
+               .magic          = MODULE_MAGIC_INIT,
+               .inst_size      = sizeof(eap_aka_sim_module_conf_t),
+               .inst_type      = "eap_aka_sim_module_conf_t",
+               .config         = submodule_config,
+
+               .onload         = mod_load,
+               .unload         = mod_unload,
+
+               .instantiate    = mod_instantiate
+       },
        .provides       = { FR_EAP_METHOD_SIM },
-
-       .inst_size      = sizeof(eap_aka_sim_module_conf_t),
-       .inst_type      = "eap_aka_sim_module_conf_t",
-       .config         = submodule_config,
-
-       .onload         = mod_load,
-       .unload         = mod_unload,
-
-       .instantiate    = mod_instantiate,
-
        .type_identity  = mod_type_identity,
        .session_init   = mod_session_init,     /* Initialise a new EAP session */
        .namespace      = &dict_eap_aka_sim
index 989d9d155dfb33a3af7af0e52bc8d60862cf8ad7..729340e5cfec4234ab3e24fac3153232dd0a82a4 100644 (file)
@@ -278,17 +278,17 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
  */
 extern rlm_eap_submodule_t rlm_eap_tls;
 rlm_eap_submodule_t rlm_eap_tls = {
-       .name                   = "eap_tls",
-       .magic                  = RLM_MODULE_INIT,
-
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "eap_tls",
+               .inst_size              = sizeof(rlm_eap_tls_t),
+               .config                 = submodule_config,
+               .instantiate            = mod_instantiate,      /* Create new submodule instance */
+
+               .thread_inst_size       = sizeof(rlm_eap_tls_thread_t),
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach,
+       },
        .provides               = { FR_EAP_METHOD_TLS },
-       .inst_size              = sizeof(rlm_eap_tls_t),
-       .config                 = submodule_config,
-       .instantiate            = mod_instantiate,      /* Create new submodule instance */
-
-       .thread_inst_size       = sizeof(rlm_eap_tls_thread_t),
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
-
        .session_init           = mod_session_init,     /* Initialise a new EAP session */
 };
index d091792cf54bdae55f8dc488240c17dde2474617..ebee17a273de30b859ae6fac794e39fe39deb82d 100644 (file)
@@ -382,17 +382,18 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
  */
 extern rlm_eap_submodule_t rlm_eap_ttls;
 rlm_eap_submodule_t rlm_eap_ttls = {
-       .name                   = "eap_ttls",
-       .magic                  = RLM_MODULE_INIT,
-
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "eap_ttls",
+
+               .inst_size              = sizeof(rlm_eap_ttls_t),
+               .config                 = submodule_config,
+               .instantiate            = mod_instantiate,      /* Create new submodule instance */
+
+               .thread_inst_size       = sizeof(rlm_eap_ttls_thread_t),
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach,
+       },
        .provides               = { FR_EAP_METHOD_TTLS },
-       .inst_size              = sizeof(rlm_eap_ttls_t),
-       .config                 = submodule_config,
-       .instantiate            = mod_instantiate,      /* Create new submodule instance */
-
-       .thread_inst_size       = sizeof(rlm_eap_ttls_thread_t),
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
-
        .session_init           = mod_session_init,     /* Initialise a new EAP session */
 };
index 5f9fa1dfe7721882fad12d510e93637558b76f8b..6d5fe3da71ade035bc3b7a621d2b9d5cca1d9603 100644 (file)
@@ -204,15 +204,17 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_escape;
-module_t rlm_escape = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "escape",
-       .inst_size      = sizeof(rlm_escape_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
+extern module_rlm_t rlm_escape;
+module_rlm_t rlm_escape = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "escape",
+               .inst_size      = sizeof(rlm_escape_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap
+       }
 };
index 4e6c14ed4e71955ee4f94f2548c6f4aa7d0607a8..e22687fe14c664cb0d665ccb8b7723c308dbea0c 100644 (file)
@@ -466,19 +466,21 @@ static unlang_action_t CC_HINT(nonnull) mod_exec_dispatch(rlm_rcode_t *p_result,
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_exec;
-module_t rlm_exec = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "exec",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_exec_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_exec;
+module_rlm_t rlm_exec = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "exec",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_exec_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_exec_dispatch,
                [MOD_AUTHORIZE]         = mod_exec_dispatch,
index 66f3306a76e48fc59e3ea56509c6617af9612f44..f869c9c3ac60cfc8cde872e92f102ecf1212085e 100644 (file)
@@ -615,13 +615,15 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_expr;
-module_t rlm_expr = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "expr",
-       .bootstrap      = mod_bootstrap,
+extern module_rlm_t rlm_expr;
+module_rlm_t rlm_expr = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "expr",
+               .bootstrap      = mod_bootstrap
+       }
 };
index 36fddea4ed06d75e6b3a1a33e02294b0e405e666..726f4e1185406ce276ceb2efe7af6e77c50e0a2b 100644 (file)
@@ -670,13 +670,15 @@ static unlang_action_t CC_HINT(nonnull) mod_post_auth(rlm_rcode_t *p_result, mod
 
 
 /* globally exported name */
-extern module_t rlm_files;
-module_t rlm_files = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "files",
-       .inst_size      = sizeof(rlm_files_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_files;
+module_rlm_t rlm_files = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "files",
+               .inst_size      = sizeof(rlm_files_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize,
index 824f4514fa83eb226b84b97a722bb0949110008c..16e6cbece6757ccdffeaa122870c516f5644449e 100644 (file)
@@ -542,21 +542,22 @@ static int mod_thread_detach(module_thread_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_icmp;
-module_t rlm_icmp = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "icmp",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_icmp_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
-
-       .thread_inst_size = sizeof(rlm_icmp_thread_t),
-       .thread_inst_type = "rlm_icmp_thread_t",
-       .thread_instantiate = mod_thread_instantiate,
-       .thread_detach  = mod_thread_detach,
+extern module_rlm_t rlm_icmp;
+module_rlm_t rlm_icmp = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "icmp",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_icmp_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap,
+               .thread_inst_size = sizeof(rlm_icmp_thread_t),
+               .thread_inst_type = "rlm_icmp_thread_t",
+               .thread_instantiate = mod_thread_instantiate,
+               .thread_detach  = mod_thread_detach
+       }
 };
index 42f2479ba012be4c5c5c05a2dc268c021132c15a..99936efa0937b3cd20f44ff1206b715ab24cfaf9 100644 (file)
@@ -155,12 +155,14 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
        return 0;
 }
 
-extern module_t rlm_idn;
-module_t rlm_idn = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "idn",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_idn_t),
-       .config         = mod_config,
-       .bootstrap      = mod_bootstrap
+extern module_rlm_t rlm_idn;
+module_rlm_t rlm_idn = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "idn",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_idn_t),
+               .config         = mod_config,
+               .bootstrap      = mod_bootstrap
+       }
 };
index 097a359ddaba01b7feb43907f45d726877999adb..e03958d2083d274689c354b1d813e400c49095af 100644 (file)
@@ -212,23 +212,24 @@ static int mod_thread_detach(module_thread_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_imap;
-module_t rlm_imap = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "imap",
-       .type                   = RLM_TYPE_THREAD_SAFE,
-       .inst_size              = sizeof(rlm_imap_t),
-       .thread_inst_size       = sizeof(rlm_imap_thread_t),
-       .config                 = module_config,
-       .onload                 = mod_load,
-       .unload                 = mod_unload,
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
-
+extern module_rlm_t rlm_imap;
+module_rlm_t rlm_imap = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "imap",
+               .type                   = MODULE_TYPE_THREAD_SAFE,
+               .inst_size              = sizeof(rlm_imap_t),
+               .thread_inst_size       = sizeof(rlm_imap_thread_t),
+               .config                 = module_config,
+               .onload                 = mod_load,
+               .unload                 = mod_unload,
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach,
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
        },
index 69ba7cd20afbbdd593c17a15c32727ab295047b9..a43c8e7cd74f3f252e3ffa1bb8595c4377a871ee 100644 (file)
@@ -2234,14 +2234,15 @@ static unlang_action_t CC_HINT(nonnull) mod_post_auth(rlm_rcode_t *p_result, mod
        RETURN_MODULE_OK;
 }
 
-extern module_t rlm_isc_dhcp;
-module_t rlm_isc_dhcp = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "isc_dhcp",
-       .type           = 0,
-       .inst_size      = sizeof(rlm_isc_dhcp_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_isc_dhcp;
+module_rlm_t rlm_isc_dhcp = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "isc_dhcp",
+               .inst_size      = sizeof(rlm_isc_dhcp_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate
+       },
 
        .methods = {
                [MOD_AUTHORIZE] = mod_authorize,
index 03a28c302da3ea644ca99e88f2f6e07e0527f614..56d1f4a58eb53f8a366157a3d2ac2ad991444621 100644 (file)
@@ -563,17 +563,19 @@ static int mod_load(void)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_json;
-module_t rlm_json = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "json",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .onload         = mod_load,
-       .config         = module_config,
-       .inst_size      = sizeof(rlm_json_t),
-       .bootstrap      = mod_bootstrap,
+extern module_rlm_t rlm_json;
+module_rlm_t rlm_json = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "json",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .onload         = mod_load,
+               .config         = module_config,
+               .inst_size      = sizeof(rlm_json_t),
+               .bootstrap      = mod_bootstrap
+       }
 };
index 0c0ea469bfcc76ab26d0aa47f6aa448053a3311c..16cc5ef1a0c56f2770139bbd33c5d637c285b5de 100644 (file)
@@ -488,17 +488,21 @@ cleanup:
 
 #endif /* MIT_KRB5 */
 
-extern module_t rlm_krb5;
-module_t rlm_krb5 = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "krb5",
+extern module_rlm_t rlm_krb5;
+module_rlm_t rlm_krb5 = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "krb5",
 #ifdef KRB5_IS_THREAD_SAFE
-       .type           = RLM_TYPE_THREAD_SAFE,
+               .type           = MODULE_TYPE_THREAD_SAFE,
+#else
+               .type           = MODULE_TYPE_THREAD_UNSAFE,
 #endif
-       .inst_size      = sizeof(rlm_krb5_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
+               .inst_size      = sizeof(rlm_krb5_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate
        },
index 4d5606372e34d79c16da908877dbd94ea66f9329..6f069e226eb749b51d7259ab004ac2dc04b5c3ea 100644 (file)
@@ -2354,22 +2354,24 @@ static void mod_unload(void)
 }
 
 /* globally exported name */
-extern module_t rlm_ldap;
-module_t rlm_ldap = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "ldap",
-       .type           = 0,
-       .inst_size      = sizeof(rlm_ldap_t),
-       .config         = module_config,
-       .onload         = mod_load,
-       .unload         = mod_unload,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
-       .thread_inst_size       = sizeof(fr_ldap_thread_t),
-       .thread_inst_type       = "fr_ldap_thread_t",
-       .thread_instantiate     = mod_thread_instatiate,
-       .thread_detach          = mod_thread_detach,
+extern module_rlm_t rlm_ldap;
+module_rlm_t rlm_ldap = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "ldap",
+               .type           = 0,
+               .inst_size      = sizeof(rlm_ldap_t),
+               .config         = module_config,
+               .onload         = mod_load,
+               .unload         = mod_unload,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach,
+               .thread_inst_size       = sizeof(fr_ldap_thread_t),
+               .thread_inst_type       = "fr_ldap_thread_t",
+               .thread_instantiate     = mod_thread_instatiate,
+               .thread_detach          = mod_thread_detach,
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize,
index 014af20092c09f2e9b1a1b2ec3f0c9ef7aa1d14a..d7471e89e0d9b11155d290e6c6fcb4eb1ac79d95 100644 (file)
@@ -790,14 +790,16 @@ finish:
 /*
  *     Externally visible module definition.
  */
-extern module_t rlm_linelog;
-module_t rlm_linelog = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "linelog",
-       .inst_size      = sizeof(rlm_linelog_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
+extern module_rlm_t rlm_linelog;
+module_rlm_t rlm_linelog = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "linelog",
+               .inst_size      = sizeof(rlm_linelog_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_do_linelog,
                [MOD_AUTHORIZE]         = mod_do_linelog,
index f250462bdcdae5ac012f808e40fa30090defbce6..b6f907dd7d59b078facd5bbb3af127b0a2cb7d94 100644 (file)
@@ -256,17 +256,19 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_logintime;
-module_t rlm_logintime = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "logintime",
-       .inst_size      = sizeof(rlm_logintime_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_logintime;
+module_rlm_t rlm_logintime = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "logintime",
+               .inst_size      = sizeof(rlm_logintime_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize,
                [MOD_POST_AUTH]         = mod_authorize
index df624f3fe5a29e2069b13ec5d52baf932e11f837..84e2a5e27e9ac43c7dae55be54c596c2ad093d88 100644 (file)
@@ -652,16 +652,17 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
 /*
  *     Externally visible module definition.
  */
-extern module_t rlm_logtee;
-module_t rlm_logtee = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "logtee",
-       .inst_size              = sizeof(rlm_logtee_t),
-       .thread_inst_size       = sizeof(rlm_logtee_thread_t),
-       .config                 = module_config,
-       .instantiate            = mod_instantiate,
-       .thread_instantiate     = mod_thread_instantiate,
-
+extern module_rlm_t rlm_logtee;
+module_rlm_t rlm_logtee = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "logtee",
+               .inst_size              = sizeof(rlm_logtee_t),
+               .thread_inst_size       = sizeof(rlm_logtee_thread_t),
+               .config                 = module_config,
+               .instantiate            = mod_instantiate,
+               .thread_instantiate     = mod_thread_instantiate,
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_insert_logtee,
                [MOD_AUTHORIZE]         = mod_insert_logtee,
index f88a9ddfb56551f8d7f4c1d1bb8573f1834a16ca..8d274aeb30a44d317956a0f5a69b2ad483de6d73 100644 (file)
@@ -160,26 +160,27 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_lua;
-module_t rlm_lua = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "lua",
-       .type                   = RLM_TYPE_THREAD_SAFE,
-       .inst_size              = sizeof(rlm_lua_t),
-
-       .thread_inst_size       = sizeof(rlm_lua_thread_t),
-
-       .config                 = module_config,
-       .instantiate            = mod_instantiate,
-       .thread_instantiate     = mod_thread_instantiate,
-
-       .detach                 = mod_detach,
-       .thread_detach          = mod_thread_detach,
-
+extern module_rlm_t rlm_lua;
+module_rlm_t rlm_lua = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "lua",
+               .type                   = MODULE_TYPE_THREAD_SAFE,
+               .inst_size              = sizeof(rlm_lua_t),
+
+               .thread_inst_size       = sizeof(rlm_lua_thread_t),
+
+               .config                 = module_config,
+               .instantiate            = mod_instantiate,
+               .thread_instantiate     = mod_thread_instantiate,
+
+               .detach                 = mod_detach,
+               .thread_detach          = mod_thread_detach
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize,
index 3ff93b904b4c2193107dba0af990e42c5559402e..ac7591959ea7bd3a2b31bf7532d501f01d586db7 100644 (file)
@@ -503,19 +503,21 @@ static int mod_detach(module_detach_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_mruby;
-module_t rlm_mruby = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "mruby",
-       .type           = RLM_TYPE_THREAD_UNSAFE, /* Not sure */
-       .inst_size      = sizeof(rlm_mruby_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
+extern module_rlm_t rlm_mruby;
+module_rlm_t rlm_mruby = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "mruby",
+               .type           = MODULE_TYPE_THREAD_UNSAFE, /* Not sure */
+               .inst_size      = sizeof(rlm_mruby_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach,
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize,
index 1216a01a353713505716b151fe3d7c2bf06c78fc..5fb455c7b5b0e8b1f95e61c0bcd4d842bbeebd15 100644 (file)
@@ -2302,16 +2302,17 @@ static int mod_detach(
 }
 
 
-extern module_t rlm_mschap;
-module_t rlm_mschap = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "mschap",
-       .type           = 0,
-       .inst_size      = sizeof(rlm_mschap_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
+extern module_rlm_t rlm_mschap;
+module_rlm_t rlm_mschap = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "mschap",
+               .inst_size      = sizeof(rlm_mschap_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize
index 7929a35d336a1c090a6ce2e95d6b3ed902a671ab..bb168ac7e1ab3b08492ab0fb43c7e7b759bf2df1 100644 (file)
@@ -528,13 +528,15 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
 }
 
 /* globally exported name */
-extern module_t rlm_opendirectory;
-module_t rlm_opendirectory = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "opendirectory",
-       .inst_size      = sizeof(rlm_opendirectory_t),
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_opendirectory;
+module_rlm_t rlm_opendirectory = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "opendirectory",
+               .inst_size      = sizeof(rlm_opendirectory_t),
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize
index 2da807c0ea97a727ca33921458ecee862a942f93..cd20b255654aa0bf56ff5ce5bc084ac8121e48db 100644 (file)
@@ -267,14 +267,16 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(rlm_rcode_t *p_result,
        RETURN_MODULE_OK;
 }
 
-extern module_t rlm_pam;
-module_t rlm_pam = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "pam",
-       .type           = RLM_TYPE_THREAD_UNSAFE,       /* The PAM libraries are not thread-safe */
-       .inst_size      = sizeof(rlm_pam_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_pam;
+module_rlm_t rlm_pam = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "pam",
+               .type           = MODULE_TYPE_THREAD_UNSAFE,    /* The PAM libraries are not thread-safe */
+               .inst_size      = sizeof(rlm_pam_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate
        },
index 12e40a16cb3de08d8e04fe551ca27446b7b2594e..ecdb98fe9f90fefd7bdf8026525bc0cef4b8c64f 100644 (file)
@@ -1067,19 +1067,21 @@ static void mod_unload(void)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_pap;
-module_t rlm_pap = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "pap",
-       .inst_size      = sizeof(rlm_pap_t),
-       .onload         = mod_load,
-       .unload         = mod_unload,
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_pap;
+module_rlm_t rlm_pap = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "pap",
+               .inst_size      = sizeof(rlm_pap_t),
+               .onload         = mod_load,
+               .unload         = mod_unload,
+               .config         = module_config,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize
index df2f76bff7ce397890a6435859fd4a3381295fa7..06ce2695e2e447c45771bd2ccd9512c94c5b753a 100644 (file)
@@ -608,14 +608,16 @@ static unlang_action_t CC_HINT(nonnull) mod_passwd_map(rlm_rcode_t *p_result, mo
        RETURN_MODULE_OK;
 }
 
-extern module_t rlm_passwd;
-module_t rlm_passwd = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "passwd",
-       .inst_size      = sizeof(rlm_passwd_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
+extern module_rlm_t rlm_passwd;
+module_rlm_t rlm_passwd = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "passwd",
+               .inst_size      = sizeof(rlm_passwd_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_passwd_map,
                [MOD_ACCOUNTING]        = mod_passwd_map,
index 61f8dfa28df067e34ee089dc4a346469f6b2a300..c4cedb4ed832dc5c982b554033f33b8c7f5c933c 100644 (file)
@@ -1230,28 +1230,29 @@ static void mod_unload(void)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_perl;
-module_t rlm_perl = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "perl",
-       .type                   = RLM_TYPE_THREAD_SAFE,
-       .inst_size              = sizeof(rlm_perl_t),
-
-       .config                 = module_config,
-       .onload                 = mod_load,
-       .unload                 = mod_unload,
-       .bootstrap              = mod_bootstrap,
-       .instantiate            = mod_instantiate,
-       .detach                 = mod_detach,
-
-       .thread_inst_size       = sizeof(rlm_perl_thread_t),
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
-
+extern module_rlm_t rlm_perl;
+module_rlm_t rlm_perl = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "perl",
+               .type                   = MODULE_TYPE_THREAD_SAFE,
+               .inst_size              = sizeof(rlm_perl_t),
+
+               .config                 = module_config,
+               .onload                 = mod_load,
+               .unload                 = mod_unload,
+               .bootstrap              = mod_bootstrap,
+               .instantiate            = mod_instantiate,
+               .detach                 = mod_detach,
+
+               .thread_inst_size       = sizeof(rlm_perl_thread_t),
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach,
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize,
index 97c0e174704be6754bb85b41de6c1eae164bfc47..db677d868604995359baf10811d91ca78560d99b 100644 (file)
@@ -1152,29 +1152,30 @@ static void mod_unload(void)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_python;
-module_t rlm_python = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "python",
-       .type                   = RLM_TYPE_THREAD_SAFE,
+extern module_rlm_t rlm_python;
+module_rlm_t rlm_python = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "python",
+               .type                   = MODULE_TYPE_THREAD_SAFE,
 
-       .inst_size              = sizeof(rlm_python_t),
-       .thread_inst_size       = sizeof(rlm_python_thread_t),
+               .inst_size              = sizeof(rlm_python_t),
+               .thread_inst_size       = sizeof(rlm_python_thread_t),
 
-       .config                 = module_config,
-       .onload                 = mod_load,
-       .unload                 = mod_unload,
+               .config                 = module_config,
+               .onload                 = mod_load,
+               .unload                 = mod_unload,
 
-       .instantiate            = mod_instantiate,
-       .detach                 = mod_detach,
-
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
+               .instantiate            = mod_instantiate,
+               .detach                 = mod_detach,
 
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize,
index 42df44d7b3992ea0a49a6d6937a1069fdd55e545..ad49fc0f6e22c1d306d37c5af035b1c9e017e717 100644 (file)
 typedef struct rlm_radius_s rlm_radius_t;
 typedef struct rlm_radius_io_s rlm_radius_io_t;
 
-/** Per-thread instance data
- *
- * Contains buffers and connection handles specific to the thread.
- */
-typedef struct {
-       void                    *io_thread;             //!< thread context for the IO submodule
-} rlm_radius_thread_t;
-
 /*
  *     Define a structure for our module configuration.
  */
 struct rlm_radius_s {
        char const              *name;
-       dl_module_inst_t        *io_submodule;          //!< As provided by the transport_parse
-       rlm_radius_io_t const   *io;                    //!< Easy access to the IO handle
-       void                    *io_instance;           //!< Easy access to the IO instance
-       CONF_SECTION            *io_conf;               //!< Easy access to the IO config section
+       module_instance_t       *io_submodule;
+       rlm_radius_io_t const   *io;                    //!< Public symbol exported by the submodule.
 
        fr_time_delta_t         response_window;
        fr_time_delta_t         zombie_period;
@@ -89,11 +79,8 @@ typedef unlang_action_t (*rlm_radius_io_enqueue_t)(rlm_rcode_t *p_result, void *
  * This structure is exported by client I/O modules e.g. rlm_radius_udp.
  */
 struct rlm_radius_io_s {
-       DL_MODULE_COMMON;                               //!< Common fields to all loadable modules.
-       FR_MODULE_COMMON;
-       FR_MODULE_THREADED_COMMON;
-
-       rlm_radius_io_enqueue_t         enqueue;        //!< Enqueue a request_t with an IO submodule.
-       unlang_module_signal_t  signal;         //!< Send a signal to an IO module.
-       unlang_module_resume_t  resume;         //!< Resume a request, and get rcode.
+       module_t                common;                 //!< Common fields to all loadable modules.
+       rlm_radius_io_enqueue_t enqueue;                //!< Enqueue a request_t with an IO submodule.
+       unlang_module_signal_t  signal;                 //!< Send a signal to an IO module.
+       unlang_module_resume_t  resume;                 //!< Resume a request, and get rcode.
 };
index d1e141edc9f8babb1698dcbeddc7c4fde1ad79be..ef33dcfe5cb29ec58e17e833ee73ca81fac68943 100644 (file)
@@ -2954,17 +2954,18 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
 
 extern rlm_radius_io_t rlm_radius_udp;
 rlm_radius_io_t rlm_radius_udp = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "radius_udp",
-       .inst_size              = sizeof(rlm_radius_udp_t),
-
-       .thread_inst_size       = sizeof(udp_thread_t),
-       .thread_inst_type       = "udp_thread_t",
-
-       .config                 = module_config,
-       .instantiate            = mod_instantiate,
-       .thread_instantiate     = mod_thread_instantiate,
-
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "radius_udp",
+               .inst_size              = sizeof(rlm_radius_udp_t),
+
+               .thread_inst_size       = sizeof(udp_thread_t),
+               .thread_inst_type       = "udp_thread_t",
+
+               .config                 = module_config,
+               .instantiate            = mod_instantiate,
+               .thread_instantiate     = mod_thread_instantiate,
+       },
        .enqueue                = mod_enqueue,
        .signal                 = mod_signal,
        .resume                 = mod_resume,
index 9f99bcec6afba53f7bd4eb5bf342bed4cef570f6..f6add71f4d8854b15152a18b14a417b8cb02f1d3 100644 (file)
@@ -557,13 +557,15 @@ static unlang_action_t CC_HINT(nonnull) mod_accounting(rlm_rcode_t *p_result, mo
 }
 
 /* globally exported name */
-extern module_t rlm_radutmp;
-module_t rlm_radutmp = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "radutmp",
-       .type           = RLM_TYPE_THREAD_UNSAFE,
-       .inst_size      = sizeof(rlm_radutmp_t),
-       .config         = module_config,
+extern module_rlm_t rlm_radutmp;
+module_rlm_t rlm_radutmp = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "radutmp",
+               .type           = MODULE_TYPE_THREAD_UNSAFE,
+               .inst_size      = sizeof(rlm_radutmp_t),
+               .config         = module_config
+       },
        .methods = {
                [MOD_ACCOUNTING]        = mod_accounting,
        },
index e28e63e2a5803329465e5756bda6598c1cf392db..4c16ac44b0b002d12d6f766e018d51b63ea0cc03 100644 (file)
@@ -488,14 +488,16 @@ static int mod_load(void)
        return 0;
 }
 
-extern module_t rlm_redis;
-module_t rlm_redis = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "redis",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_redis_t),
-       .config         = module_config,
-       .onload         = mod_load,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_redis;
+module_rlm_t rlm_redis = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "redis",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_redis_t),
+               .config         = module_config,
+               .onload         = mod_load,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate
+       }
 };
index e66d947d19ad59431fcec1ce331294523b999c83..bb7cc8531d5ccba6804ff4960b4a0d6aeed64759 100644 (file)
@@ -1427,15 +1427,17 @@ static int mod_load(void)
        return 0;
 }
 
-extern module_t rlm_redis_ippool;
-module_t rlm_redis_ippool = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "redis",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_redis_ippool_t),
-       .config         = module_config,
-       .onload         = mod_load,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_redis_ippool;
+module_rlm_t rlm_redis_ippool = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "redis",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_redis_ippool_t),
+               .config         = module_config,
+               .onload         = mod_load,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_ACCOUNTING]        = mod_accounting,
                [MOD_AUTHORIZE]         = mod_authorize,
index e73c8148f6ec5450a0a7239ff43d972abc41ed6c..6b159bb49e4dc35bf64c1ac9d6b87ce9f8ed05a5 100644 (file)
@@ -247,15 +247,17 @@ static int mod_load(void)
        return 0;
 }
 
-extern module_t rlm_rediswho;
-module_t rlm_rediswho = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "rediswho",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_rediswho_t),
-       .config         = module_config,
-       .onload         = mod_load,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_rediswho;
+module_rlm_t rlm_rediswho = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "rediswho",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_rediswho_t),
+               .config         = module_config,
+               .onload         = mod_load,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_ACCOUNTING]        = mod_accounting
        },
index 1cc70c12a0818d21bd9751cfb348e9654292103c..13c38b3892301412579204323acbd543c1cd3f5f 100644 (file)
@@ -1231,24 +1231,26 @@ static void mod_unload(void)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_rest;
-module_t rlm_rest = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "rest",
-       .type                   = RLM_TYPE_THREAD_SAFE,
-       .inst_size              = sizeof(rlm_rest_t),
-       .thread_inst_size       = sizeof(rlm_rest_thread_t),
-       .config                 = module_config,
-       .onload                 = mod_load,
-       .unload                 = mod_unload,
-       .bootstrap              = mod_bootstrap,
-       .instantiate            = instantiate,
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
+extern module_rlm_t rlm_rest;
+module_rlm_t rlm_rest = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "rest",
+               .type                   = MODULE_TYPE_THREAD_SAFE,
+               .inst_size              = sizeof(rlm_rest_t),
+               .thread_inst_size       = sizeof(rlm_rest_thread_t),
+               .config                 = module_config,
+               .onload                 = mod_load,
+               .unload                 = mod_unload,
+               .bootstrap              = mod_bootstrap,
+               .instantiate            = instantiate,
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize,
index f5a635fb78e1318be5c1579b3b6e1238869be1a2..4bb6791fdfa0f24800d9ae6e795f89c102da1d5e 100644 (file)
@@ -546,18 +546,20 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(rlm_rcode_t *p_result,
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_securid;
-module_t rlm_securid = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "securid",
-       .inst_size      = sizeof(rlm_securid_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
+extern module_rlm_t rlm_securid;
+module_rlm_t rlm_securid = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "securid",
+               .inst_size      = sizeof(rlm_securid_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate
        },
index b98b777936c45749a2a474d56d78324c88969b91..6b5bb79340410175c289bdf2e5e6600ed4297bc5 100644 (file)
@@ -417,22 +417,24 @@ static int mod_detach(module_detach_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_sigtran;
-module_t rlm_sigtran = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "sigtran",
-       .type                   = RLM_TYPE_THREAD_SAFE | RLM_TYPE_RESUMABLE,
-       .inst_size              = sizeof(rlm_sigtran_t),
-       .thread_inst_size       = sizeof(rlm_sigtran_thread_t),
-       .config                 = module_config,
-       .instantiate            = mod_instantiate,
-       .detach                 = mod_detach,
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
+extern module_rlm_t rlm_sigtran;
+module_rlm_t rlm_sigtran = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "sigtran",
+               .type                   = MODULE_TYPE_THREAD_SAFE | MODULE_TYPE_RESUMABLE,
+               .inst_size              = sizeof(rlm_sigtran_t),
+               .thread_inst_size       = sizeof(rlm_sigtran_thread_t),
+               .config                 = module_config,
+               .instantiate            = mod_instantiate,
+               .detach                 = mod_detach,
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize,
        }
index c93b0435ce3d58b5d9b607d5802feaac6fa83cb0..692476c780a8a0482832fa66af5e113308718c56 100644 (file)
@@ -1104,25 +1104,26 @@ static int mod_thread_detach(module_thread_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_smtp;
-module_t rlm_smtp = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "smtp",
-       .type                   = RLM_TYPE_THREAD_SAFE,
-       .inst_size              = sizeof(rlm_smtp_t),
-       .thread_inst_size       = sizeof(rlm_smtp_thread_t),
-       .config                 = module_config,
-       .bootstrap              = mod_bootstrap,
-       .instantiate            = mod_instantiate,
-       .onload                 = mod_load,
-       .unload                 = mod_unload,
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
-
+extern module_rlm_t rlm_smtp;
+module_rlm_t rlm_smtp = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "smtp",
+               .type                   = MODULE_TYPE_THREAD_SAFE,
+               .inst_size              = sizeof(rlm_smtp_t),
+               .thread_inst_size       = sizeof(rlm_smtp_thread_t),
+               .config                 = module_config,
+               .bootstrap              = mod_bootstrap,
+               .instantiate            = mod_instantiate,
+               .onload                 = mod_load,
+               .unload                 = mod_unload,
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach,
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize,
index 0d5d73a0540438da370bbf7cf7c6bd0b7136089a..99d90055de911ee89b303075ed3140c294c275fc 100644 (file)
@@ -291,16 +291,18 @@ static void mod_unload(void)
        fr_soh_free();
 }
 
-extern module_t rlm_soh;
-module_t rlm_soh = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "soh",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_soh_t),
-       .config         = module_config,
-       .onload         = mod_load,
-       .unload         = mod_unload,
-       .bootstrap      = mod_bootstrap,
+extern module_rlm_t rlm_soh;
+module_rlm_t rlm_soh = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "soh",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_soh_t),
+               .config         = module_config,
+               .onload         = mod_load,
+               .unload         = mod_unload,
+               .bootstrap      = mod_bootstrap
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize,
                [MOD_POST_AUTH]         = mod_post_auth
index 7ca69d91af3afa7d96696e8b8eb09c937bf25d97..135a6fd68300de5b04d3885a457d73e463f8fe4d 100644 (file)
@@ -153,13 +153,15 @@ static unlang_action_t CC_HINT(nonnull) mod_sometimes_reply(rlm_rcode_t *p_resul
        return sometimes_return(p_result, mctx, request, request->reply, NULL);
 }
 
-extern module_t rlm_sometimes;
-module_t rlm_sometimes = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "sometimes",
-       .inst_size      = sizeof(rlm_sometimes_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_sometimes;
+module_rlm_t rlm_sometimes = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "sometimes",
+               .inst_size      = sizeof(rlm_sometimes_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_sometimes_packet,
                [MOD_AUTHORIZE]         = mod_sometimes_packet,
index 4c85da631e59a350d7b18539205a169e35210afd..fd9364889cb17d5b655b017cdd436c0fb2bab090 100644 (file)
@@ -719,13 +719,14 @@ static int mod_detach(module_detach_ctx_t const *mctx)
        return 0;
 }
 
-static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_SECTION *cs)
+static int mod_instantiate(module_inst_ctx_t const *mctx)
 {
-       bool                            do_tls = false;
-       bool                            do_latency_aware_routing = false;
-       rlm_sql_cassandra_t             *inst = talloc_get_type_abort(instance, rlm_sql_cassandra_t);
-
-       CassCluster *cluster;
+       rlm_sql_t const         *parent = talloc_get_type_abort(mctx->inst->parent->data, rlm_sql_t);
+       rlm_sql_config_t const  *config = &parent->config;
+       rlm_sql_cassandra_t     *inst = talloc_get_type_abort(mctx->inst, rlm_sql_cassandra_t);
+       bool                    do_tls = false;
+       bool                    do_latency_aware_routing = false;
+       CassCluster             *cluster;
 
 #define DO_CASS_OPTION(_opt, _x) \
 do {\
@@ -746,8 +747,8 @@ do {\
         *      This has to be done before we call cf_section_parse
         *      as it sets default values, and creates the section.
         */
-       if (cf_section_find(cs, "tls", NULL)) do_tls = true;
-       if (cf_section_find(cs, "latency_aware_routing", NULL)) do_latency_aware_routing = true;
+       if (cf_section_find(mctx->inst->conf, "tls", NULL)) do_tls = true;
+       if (cf_section_find(mctx->inst->conf, "latency_aware_routing", NULL)) do_latency_aware_routing = true;
 
        DEBUG4("Configuring CassCluster structure");
        cluster = inst->cluster = cass_cluster_new();
index 8243307c5d4730d0c3891741d7ab090fe99656e7..381da7ea92b984b84129a0c922ea288dbe50ba52 100644 (file)
@@ -287,8 +287,10 @@ static int sql_affected_rows(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t c
 /* Exported to rlm_sql */
 extern rlm_sql_driver_t rlm_sql_db2;
 rlm_sql_driver_t rlm_sql_db2 = {
-       .name                           = "rlm_sql_db2",
-       .magic                          = RLM_MODULE_INIT,
+       .common = {
+               .magic                          = MODULE_MAGIC_INIT,
+               .name                           = "rlm_sql_db2",
+       },
        .sql_socket_init                = sql_socket_init,
        .sql_query                      = sql_query,
        .sql_select_query               = sql_select_query,
index 669abe22ab7f1b912e481d1ba8b53e5e33b7180e..be6ef061024430c56368410d28bc7ecd56d57f50 100644 (file)
@@ -293,8 +293,10 @@ static int sql_affected_rows(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t c
 /* Exported to rlm_sql */
 extern rlm_sql_driver_t rlm_sql_firebird;
 rlm_sql_driver_t rlm_sql_firebird = {
-       .name                           = "rlm_sql_firebird",
-       .magic                          = RLM_MODULE_INIT,
+       .common = {
+               .name                           = "rlm_sql_firebird",
+               .magic                          = MODULE_MAGIC_INIT
+       },
        .sql_socket_init                = sql_socket_init,
        .sql_query                      = sql_query,
        .sql_select_query               = sql_select_query,
index 905745ac5393126c409971756649987f2b61a940..e33f82b715f46ea7bdca453ee837093156d285df 100644 (file)
@@ -803,8 +803,10 @@ error:
 /* Exported to rlm_sql */
 extern rlm_sql_driver_t rlm_sql_freetds;
 rlm_sql_driver_t rlm_sql_freetds = {
-       .name                           = "rlm_sql_freetds",
-       .magic                          = RLM_MODULE_INIT,
+       .common = {
+               .magic                          = MODULE_MAGIC_INIT,
+               .name                           = "rlm_sql_freetds"
+       },
        .sql_socket_init                = sql_socket_init,
        .sql_query                      = sql_query,
        .sql_select_query               = sql_select_query,
index e2b9abc40f55f69ae73e9f355c8103b1d56c0b04..b75eee19b2b003ff83af1b1f3acc6f3d4b0cd7cd 100644 (file)
@@ -167,9 +167,9 @@ static int _sql_socket_destructor(rlm_sql_mysql_conn_t *conn)
        return 0;
 }
 
-static int mod_instantiate(UNUSED rlm_sql_config_t const *config, void *instance, UNUSED CONF_SECTION *cs)
+static int mod_instantiate(module_inst_ctx_t const *mctx)
 {
-       rlm_sql_mysql_t         *inst = talloc_get_type_abort(instance, rlm_sql_mysql_t);
+       rlm_sql_mysql_t         *inst = talloc_get_type_abort(mctx->inst->data, rlm_sql_mysql_t);
        int                     warnings;
 
        warnings = fr_table_value_by_str(server_warnings_table, inst->warnings_str, -1);
@@ -843,14 +843,16 @@ static size_t sql_escape_func(UNUSED request_t *request, char *out, size_t outle
 /* Exported to rlm_sql */
 extern rlm_sql_driver_t rlm_sql_mysql;
 rlm_sql_driver_t rlm_sql_mysql = {
-       .name                           = "rlm_sql_mysql",
-       .magic                          = RLM_MODULE_INIT,
+       .common = {
+               .name                           = "rlm_sql_mysql",
+               .magic                          = MODULE_MAGIC_INIT,
+               .inst_size                      = sizeof(rlm_sql_mysql_t),
+               .onload                         = mod_load,
+               .unload                         = mod_unload,
+               .config                         = driver_config,
+               .instantiate                    = mod_instantiate
+       },
        .flags                          = RLM_SQL_RCODE_FLAGS_ALT_QUERY,
-       .inst_size                      = sizeof(rlm_sql_mysql_t),
-       .onload                         = mod_load,
-       .unload                         = mod_unload,
-       .config                         = driver_config,
-       .instantiate                    = mod_instantiate,
        .sql_socket_init                = sql_socket_init,
        .sql_query                      = sql_query,
        .sql_select_query               = sql_select_query,
index 1afa8a69af6059b84667de4ba32e512678a035ea..7e15b0854da4e829126ce91f385d0f5fb58287fd 100644 (file)
@@ -98,8 +98,10 @@ static int sql_affected_rows(UNUSED rlm_sql_handle_t * handle, UNUSED rlm_sql_co
 /* Exported to rlm_sql */
 extern rlm_sql_driver_t rlm_sql_null;
 rlm_sql_driver_t rlm_sql_null = {
-       .name                           = "rlm_sql_null",
-       .magic                          = RLM_MODULE_INIT,
+       .common = {
+               .magic                          = MODULE_MAGIC_INIT,
+               .name                           = "rlm_sql_null"
+       },
        .sql_socket_init                = sql_socket_init,
        .sql_query                      = sql_query,
        .sql_select_query               = sql_select_query,
index 016f295b068041605bf35037dde11d8fb94cf5f2..27d1762eccb2514eca005be96c3e41c3e19ceb52 100644 (file)
@@ -153,16 +153,18 @@ static int mod_detach(module_detach_ctx_t const *mctx)
        return 0;
 }
 
-static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_SECTION *conf)
+static int mod_instantiate(module_inst_ctx_t const *mctx)
 {
-       char  errbuff[512];
-       sb4 errcode = 0;
-       rlm_sql_oracle_t        *inst = talloc_get_type_abort(instance, rlm_sql_oracle_t);
-       OraText *sql_password = NULL;
-       OraText *sql_login = NULL;
-
-       if (!cf_section_find(conf, "spool", NULL)) {
-               ERROR("Couldn't load configuration of session pool(\"spool\" section in driver config)");
+       rlm_sql_t const         *parent = talloc_get_type_abort(mctx->inst->parent->data, rlm_sql_t);
+       rlm_sql_config_t const  *config = &parent->config;
+       rlm_sql_oracle_t        *inst = talloc_get_type_abort(mctx->inst, rlm_sql_oracle_t);
+       char                    errbuff[512];
+       sb4                     errcode = 0;
+       OraText                 *sql_password = NULL;
+       OraText                 *sql_login = NULL;
+
+       if (!cf_section_find(mctx->inst->conf, "spool", NULL)) {
+               ERROR("Couldn't load mctx->configuration of session pool(\"spool\" section in driver mctx->config)");
                return RLM_SQL_ERROR;
        }
 
@@ -202,12 +204,12 @@ static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_
        memcpy(&sql_password, config->sql_password, sizeof(sql_password));
 
        if (OCISessionPoolCreate((dvoid *)inst->env, (dvoid *)inst->error, (dvoid *)inst->pool,
-                       (OraText**)&inst->pool_name, (ub4*)&inst->pool_name_len,
-                       (CONST OraText *)config->sql_db, strlen(config->sql_db),
-                       inst->spool_min, inst->spool_max, inst->spool_inc,
-                       sql_login, strlen(config->sql_login),
-                       sql_password, strlen(config->sql_password),
-                       OCI_SPC_STMTCACHE | OCI_SPC_HOMOGENEOUS)) {
+                                (OraText**)&inst->pool_name, (ub4*)&inst->pool_name_len,
+                                (CONST OraText *)config->sql_db, strlen(config->sql_db),
+                                inst->spool_min, inst->spool_max, inst->spool_inc,
+                                sql_login, strlen(config->sql_login),
+                                sql_password, strlen(config->sql_password),
+                                OCI_SPC_STMTCACHE | OCI_SPC_HOMOGENEOUS)) {
 
                errbuff[0] = '\0';
                OCIErrorGet((dvoid *) inst->error, 1, (OraText *) NULL, &errcode, (OraText *) errbuff,
@@ -610,12 +612,14 @@ static int sql_affected_rows(rlm_sql_handle_t *handle, rlm_sql_config_t const *c
 /* Exported to rlm_sql */
 extern rlm_sql_driver_t rlm_sql_oracle;
 rlm_sql_driver_t rlm_sql_oracle = {
-       .name                           = "rlm_sql_oracle",
-       .magic                          = RLM_MODULE_INIT,
-       .inst_size                      = sizeof(rlm_sql_oracle_t),
-       .config                         = driver_config,
-       .instantiate                    = mod_instantiate,
-       .detach                         = mod_detach,
+       .common = {
+               .name                           = "rlm_sql_oracle",
+               .magic                          = MODULE_MAGIC_INIT,
+               .inst_size                      = sizeof(rlm_sql_oracle_t),
+               .config                         = driver_config,
+               .instantiate                    = mod_instantiate,
+               .detach                         = mod_detach
+       },
        .sql_socket_init                = sql_socket_init,
        .sql_query                      = sql_query,
        .sql_select_query               = sql_select_query,
index 99dd9e90c0b5ac75c452527ff372a1e9ed1e494b..334f7d968a9f7e125a2740025dfa9011460bfee5 100644 (file)
@@ -544,9 +544,11 @@ static size_t sql_escape_func(request_t *request, char *out, size_t outlen, char
        return ret;
 }
 
-static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_SECTION *conf)
+static int mod_instantiate(module_inst_ctx_t const *mctx)
 {
-       rlm_sql_postgresql_t    *inst = talloc_get_type_abort(instance, rlm_sql_postgresql_t);
+       rlm_sql_t const         *parent = talloc_get_type_abort(mctx->inst->parent->data, rlm_sql_t);
+       rlm_sql_config_t const  *config = &parent->config;
+       rlm_sql_postgresql_t    *inst = talloc_get_type_abort(mctx->inst, rlm_sql_postgresql_t);
        char                    application_name[NAMEDATALEN];
        char                    *db_string;
 
@@ -557,7 +559,7 @@ static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_
                CONF_SECTION    *cs;
                char const      *name;
 
-               cs = cf_item_to_section(cf_parent(conf));
+               cs = cf_item_to_section(cf_parent(mctx->inst->conf));
 
                name = cf_section_name2(cs);
                if (!name) name = cf_section_name1(cs);
@@ -645,7 +647,7 @@ static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_
        {
                CONF_SECTION *cs;
 
-               cs = cf_section_find(conf, "states", NULL);
+               cs = cf_section_find(mctx->inst->conf, "states", NULL);
                if (cs && (sql_state_entries_from_cs(inst->states, cs) < 0)) return -1;
        }
 
@@ -667,13 +669,15 @@ static int mod_load(void)
 /* Exported to rlm_sql */
 extern rlm_sql_driver_t rlm_sql_postgresql;
 rlm_sql_driver_t rlm_sql_postgresql = {
-       .name                           = "rlm_sql_postgresql",
-       .magic                          = RLM_MODULE_INIT,
+       .common = {
+               .magic                          = MODULE_MAGIC_INIT,
+               .name                           = "rlm_sql_postgresql",
+               .inst_size                      = sizeof(rlm_sql_postgresql_t),
+               .onload                         = mod_load,
+               .config                         = driver_config,
+               .instantiate                    = mod_instantiate
+       },
        .flags                          = RLM_SQL_RCODE_FLAGS_ALT_QUERY,
-       .inst_size                      = sizeof(rlm_sql_postgresql_t),
-       .onload                         = mod_load,
-       .config                         = driver_config,
-       .instantiate                    = mod_instantiate,
        .sql_socket_init                = sql_socket_init,
        .sql_query                      = sql_query,
        .sql_select_query               = sql_select_query,
index 84c358e7dbdec87d6264417947a5ea4d1eba7a8f..78b3b1b033a217618cff09401e19aecd4d3c97fe 100644 (file)
@@ -683,10 +683,12 @@ static int sql_affected_rows(rlm_sql_handle_t *handle,
        return -1;
 }
 
-static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_SECTION *cs)
+static int mod_instantiate(module_inst_ctx_t const *mctx)
 {
+       rlm_sql_t const         *parent = talloc_get_type_abort(mctx->inst->parent->data, rlm_sql_t);
+       rlm_sql_config_t const  *config = &parent->config;
+       rlm_sql_sqlite_t        *inst = talloc_get_type_abort(mctx->inst, rlm_sql_sqlite_t);
        bool                    exists;
-       rlm_sql_sqlite_t        *inst = talloc_get_type_abort(instance, rlm_sql_sqlite_t);
        struct stat             buf;
 
        if (!inst->filename) {
@@ -703,7 +705,7 @@ static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_
                return -1;
        }
 
-       if (cf_pair_find(cs, "bootstrap")) {
+       if (cf_pair_find(mctx->inst->conf, "bootstrap")) {
                inst->bootstrap = true;
        }
 
@@ -722,10 +724,10 @@ static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_
                if (p) {
                        size_t len = (p - inst->filename) + 1;
 
-                       buff = talloc_array(cs, char, len);
+                       buff = talloc_array(mctx->inst->conf, char, len);
                        strlcpy(buff, inst->filename, len);
                } else {
-                       MEM(buff = talloc_typed_strdup(cs, inst->filename));
+                       MEM(buff = talloc_typed_strdup(mctx->inst->conf, inst->filename));
                }
 
                ret = fr_mkdir(NULL, buff, -1, 0700, NULL, NULL);
@@ -758,13 +760,13 @@ static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_
                /*
                 *      Execute multiple bootstrap SQL files in order
                 */
-               for (cp = cf_pair_find(cs, "bootstrap");
+               for (cp = cf_pair_find(mctx->inst->conf, "bootstrap");
                     cp;
-                    cp = cf_pair_find_next(cs, cp, "bootstrap")) {
+                    cp = cf_pair_find_next(mctx->inst->conf, cp, "bootstrap")) {
                        p = cf_pair_value(cp);
                        if (!p) continue;
 
-                       ret = sql_loadfile(cs, db, p);
+                       ret = sql_loadfile(mctx->inst->conf, db, p);
                        if (ret < 0) goto unlink;
                }
 
@@ -812,13 +814,15 @@ static int mod_load(void)
 /* Exported to rlm_sql */
 extern rlm_sql_driver_t rlm_sql_sqlite;
 rlm_sql_driver_t rlm_sql_sqlite = {
-       .name                           = "rlm_sql_sqlite",
-       .magic                          = RLM_MODULE_INIT,
+       .common = {
+               .name                           = "rlm_sql_sqlite",
+               .magic                          = MODULE_MAGIC_INIT,
+               .inst_size                      = sizeof(rlm_sql_sqlite_t),
+               .config                         = driver_config,
+               .onload                         = mod_load,
+               .instantiate                    = mod_instantiate
+       },
        .flags                          = RLM_SQL_RCODE_FLAGS_ALT_QUERY,
-       .inst_size                      = sizeof(rlm_sql_sqlite_t),
-       .config                         = driver_config,
-       .onload                         = mod_load,
-       .instantiate                    = mod_instantiate,
        .sql_socket_init                = sql_socket_init,
        .sql_query                      = sql_query,
        .sql_select_query               = sql_select_query,
index ab5d2e276e3ef6bfff9635bbbab44f291f521d09..855a9b850a2cf15eadae710126feb6e15c52466f 100644 (file)
@@ -389,8 +389,10 @@ static int sql_affected_rows(rlm_sql_handle_t *handle, rlm_sql_config_t const *c
 /* Exported to rlm_sql */
 extern rlm_sql_driver_t rlm_sql_unixodbc;
 rlm_sql_driver_t rlm_sql_unixodbc = {
-       .name                           = "rlm_sql_unixodbc",
-       .magic                          = RLM_MODULE_INIT,
+       .common = {
+               .magic                          = MODULE_MAGIC_INIT,
+               .name                           = "rlm_sql_unixodbc"
+       },
        .sql_socket_init                = sql_socket_init,
        .sql_query                      = sql_query,
        .sql_select_query               = sql_select_query,
index 0b8d8fb89bed86652af927e4bb6f7c9f932fbe0d..b93c429b6d862280f6eccfa6c69f83519a575757 100644 (file)
@@ -42,7 +42,7 @@ RCSID("$Id$")
 
 #include "rlm_sql.h"
 
-extern module_t rlm_sql;
+extern module_rlm_t rlm_sql;
 
 /*
  *     So we can do pass2 xlat checks on the queries.
@@ -1051,7 +1051,7 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
        }
        inst->driver = (rlm_sql_driver_t const *)inst->driver_inst->module->common;
 
-       fr_assert(!inst->driver->inst_size || inst->driver_inst->data);
+       fr_assert(!inst->driver->common.inst_size || inst->driver_inst->data);
 
        /*
         *      Call the driver's instantiate function (if set)
@@ -1664,15 +1664,17 @@ static unlang_action_t CC_HINT(nonnull) mod_post_auth(rlm_rcode_t *p_result, mod
 
 
 /* globally exported name */
-module_t rlm_sql = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "sql",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_sql_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
-       .detach         = mod_detach,
+module_rlm_t rlm_sql = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "sql",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_sql_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate,
+               .detach         = mod_detach
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize,
                [MOD_ACCOUNTING]        = mod_accounting,
index c9c24d5ad94c13f7110dc0f648e539aff8be5958..427020f85139bfdc5f8ea5f5bc08dc38243f7c0f 100644 (file)
@@ -185,7 +185,7 @@ typedef size_t (*sql_error_t)(TALLOC_CTX *ctx, sql_log_entry_t out[], size_t out
                              rlm_sql_config_t const *config);
 
 typedef struct {
-       DL_MODULE_COMMON;                               //!< Common fields to all loadable modules.
+       module_t        common;                         //!< Common fields for all loadable modules.
 
        int             flags;
 
index b5140d5859300bdc95f27eb1bc3f66a230cd669a..c68632c8d264e26467cf12ee142821fa929897dc 100644 (file)
@@ -626,19 +626,21 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_sqlcounter;
-module_t rlm_sqlcounter = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "sqlcounter",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_sqlcounter_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_sqlcounter;
+module_rlm_t rlm_sqlcounter = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "sqlcounter",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_sqlcounter_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate,
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize
        },
index a6f886b3a72296877a45f7c87d6a91045a0bdb6a..87375e6db4800019c8673293b04d8775037ebb1c 100644 (file)
@@ -850,19 +850,21 @@ static unlang_action_t CC_HINT(nonnull) mod_accounting(rlm_rcode_t *p_result, mo
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_sqlippool;
-module_t rlm_sqlippool = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "sqlippool",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_sqlippool_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_sqlippool;
+module_rlm_t rlm_sqlippool = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "sqlippool",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_sqlippool_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate
+       },
        .methods = {
                [MOD_ACCOUNTING]        = mod_accounting,
                [MOD_POST_AUTH]         = mod_alloc
index 97fabc2af0b51b013c57edce8c469fe2d66e1020..7ce02a23d4ce29d28b06d9679a37530d13ff5d58 100644 (file)
@@ -427,22 +427,24 @@ static int mod_detach(module_detach_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_stats;
-
-module_t rlm_stats = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "stats",
-       .inst_size              = sizeof(rlm_stats_t),
-       .thread_inst_size       = sizeof(rlm_stats_thread_t),
-       .config                 = module_config,
-       .instantiate            = mod_instantiate,
-       .detach                 = mod_detach,
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
+extern module_rlm_t rlm_stats;
+
+module_rlm_t rlm_stats = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "stats",
+               .inst_size              = sizeof(rlm_stats_t),
+               .thread_inst_size       = sizeof(rlm_stats_thread_t),
+               .config                 = module_config,
+               .instantiate            = mod_instantiate,
+               .detach                 = mod_detach,
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_stats, /* @mod_stats_query */
                [MOD_POST_AUTH]         = mod_stats,
index ae0e48d9437f309147f32d4ffcc12c45bbdbc713..1469db485a72bedbbc6cef1735809f6ca046dd57 100644 (file)
@@ -502,21 +502,23 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_test;
-module_t rlm_test = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "test",
-       .type                   = RLM_TYPE_THREAD_SAFE | RLM_TYPE_RETRY,
-       .inst_size              = sizeof(rlm_test_t),
-       .thread_inst_size       = sizeof(rlm_test_thread_t),
-       .config                 = module_config,
-       .bootstrap              = mod_bootstrap,
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
+extern module_rlm_t rlm_test;
+module_rlm_t rlm_test = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "test",
+               .type                   = MODULE_TYPE_THREAD_SAFE | MODULE_TYPE_RETRY,
+               .inst_size              = sizeof(rlm_test_t),
+               .thread_inst_size       = sizeof(rlm_test_thread_t),
+               .config                 = module_config,
+               .bootstrap              = mod_bootstrap,
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize,
index 5d645ba1545ce88da65c7949e1cf23ccb7b051ee..0c652162bb003925ff1a067f4d23ff5bab3526ab 100644 (file)
@@ -282,15 +282,17 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(rlm_rcode_t *p_result,
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_totp;
-module_t rlm_totp = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "totp",
-       .type           = RLM_TYPE_THREAD_SAFE,
+extern module_rlm_t rlm_totp;
+module_rlm_t rlm_totp = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "totp",
+               .type           = MODULE_TYPE_THREAD_SAFE
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
        },
index f58320cafd8280970637e4a7bfc3580bd3826e23..b0a218bc64cd90c209d15ee41acebe8d52191554 100644 (file)
@@ -495,17 +495,19 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
        return 0;
 }
 
-extern module_t rlm_unbound;
-module_t rlm_unbound = {
-       .magic                  = RLM_MODULE_INIT,
-       .name                   = "unbound",
-       .type                   = RLM_TYPE_THREAD_SAFE,
-       .inst_size              = sizeof(rlm_unbound_t),
-       .config                 = module_config,
-       .bootstrap              = mod_bootstrap,
-
-       .thread_inst_size       = sizeof(rlm_unbound_thread_t),
-       .thread_inst_type       = "rlm_unbound_thread_t",
-       .thread_instantiate     = mod_thread_instantiate,
-       .thread_detach          = mod_thread_detach,
+extern module_rlm_t rlm_unbound;
+module_rlm_t rlm_unbound = {
+       .common = {
+               .magic                  = MODULE_MAGIC_INIT,
+               .name                   = "unbound",
+               .type                   = MODULE_TYPE_THREAD_SAFE,
+               .inst_size              = sizeof(rlm_unbound_t),
+               .config                 = module_config,
+               .bootstrap              = mod_bootstrap,
+
+               .thread_inst_size       = sizeof(rlm_unbound_thread_t),
+               .thread_inst_type       = "rlm_unbound_thread_t",
+               .thread_instantiate     = mod_thread_instantiate,
+               .thread_detach          = mod_thread_detach
+       }
 };
index fef21550ef6f6ee588289d27f32d161d08078e8f..8771c4d8d0565bcb631fa22745b4269265be798a 100644 (file)
@@ -506,14 +506,16 @@ static unlang_action_t CC_HINT(nonnull) mod_accounting(rlm_rcode_t *p_result, mo
 }
 
 /* globally exported name */
-extern module_t rlm_unix;
-module_t rlm_unix = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "unix",
-       .type           = RLM_TYPE_THREAD_UNSAFE,
-       .inst_size      = sizeof(rlm_unix_t),
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
+extern module_rlm_t rlm_unix;
+module_rlm_t rlm_unix = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "unix",
+               .type           = MODULE_TYPE_THREAD_UNSAFE,
+               .inst_size      = sizeof(rlm_unix_t),
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize,
                [MOD_ACCOUNTING]        = mod_accounting
index ab9906cd9e22274ccabdff1546f656d2baeb5a34..adc6b7fe2636748bc8596d6656c76718d976cd2d 100644 (file)
@@ -144,14 +144,16 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_unpack;
-module_t rlm_unpack = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "unpack",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .bootstrap      = mod_bootstrap
+extern module_rlm_t rlm_unpack;
+module_rlm_t rlm_unpack = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "unpack",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .bootstrap      = mod_bootstrap
+       }
 };
index 9538e0381f4cf26f095762f1d95a3310bada2073..87056ca4b8d3d6c7c7f7ec0faf7c63c6475a10ad 100644 (file)
@@ -53,15 +53,17 @@ static unlang_action_t CC_HINT(nonnull) mod_utf8_clean(rlm_rcode_t *p_result, UN
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_utf8;
-module_t rlm_utf8 = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "utf8",
-       .type           = RLM_TYPE_THREAD_SAFE,
+extern module_rlm_t rlm_utf8;
+module_rlm_t rlm_utf8 = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "utf8",
+               .type           = MODULE_TYPE_THREAD_SAFE
+       },
        .methods = {
                [MOD_AUTHORIZE]         = mod_utf8_clean,
                [MOD_PREACCT]           = mod_utf8_clean,
index dd5197772b4c6b2002386f50e82e9308cf17dc74..5e4feb8d285a8e906519ba5ae287900159666ae8 100644 (file)
@@ -449,17 +449,19 @@ static unlang_action_t CC_HINT(nonnull) mod_post_auth(rlm_rcode_t *p_result, mod
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_wimax;
-module_t rlm_wimax = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "wimax",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_wimax_t),
-       .config         = module_config,
+extern module_rlm_t rlm_wimax;
+module_rlm_t rlm_wimax = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "wimax",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_wimax_t),
+               .config         = module_config,
+       },
        .dict           = &dict_radius,
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize,
index f86979d38ac1afe71d715c3ce80903a5856b3793..104cfbb76d57ea7053c5d99f11a60fc6ec6753ae 100644 (file)
@@ -550,19 +550,21 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(rlm_rcode_t *p_result,
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_winbind;
-module_t rlm_winbind = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "winbind",
-       .inst_size      = sizeof(rlm_winbind_t),
-       .config         = module_config,
-       .instantiate    = mod_instantiate,
-       .bootstrap      = mod_bootstrap,
-       .detach         = mod_detach,
+extern module_rlm_t rlm_winbind;
+module_rlm_t rlm_winbind = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "winbind",
+               .inst_size      = sizeof(rlm_winbind_t),
+               .config         = module_config,
+               .instantiate    = mod_instantiate,
+               .bootstrap      = mod_bootstrap,
+               .detach         = mod_detach
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize
index 5aa567d042139677a7b928ad426a206678581c56..5b388015307e0422b68a2fd0a3e7739e0df2a5b9 100644 (file)
@@ -450,24 +450,26 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(rlm_rcode_t *p_result,
  *     That is, everything else should be 'static'.
  *
  *     If the module needs to temporarily modify it's instantiation
- *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
  *     The server will then take care of ensuring that the module
  *     is single-threaded.
  */
-extern module_t rlm_yubikey;
-module_t rlm_yubikey = {
-       .magic          = RLM_MODULE_INIT,
-       .name           = "yubikey",
-       .type           = RLM_TYPE_THREAD_SAFE,
-       .inst_size      = sizeof(rlm_yubikey_t),
-       .onload         = mod_load,
-       .unload         = mod_unload,
-       .config         = module_config,
-       .bootstrap      = mod_bootstrap,
-       .instantiate    = mod_instantiate,
+extern module_rlm_t rlm_yubikey;
+module_rlm_t rlm_yubikey = {
+       .common = {
+               .magic          = MODULE_MAGIC_INIT,
+               .name           = "yubikey",
+               .type           = MODULE_TYPE_THREAD_SAFE,
+               .inst_size      = sizeof(rlm_yubikey_t),
+               .onload         = mod_load,
+               .unload         = mod_unload,
+               .config         = module_config,
+               .bootstrap      = mod_bootstrap,
+               .instantiate    = mod_instantiate,
 #ifdef HAVE_YKCLIENT
-       .detach         = mod_detach,
+               .detach         = mod_detach,
 #endif
+       },
        .methods = {
                [MOD_AUTHENTICATE]      = mod_authenticate,
                [MOD_AUTHORIZE]         = mod_authorize
index 49782421ec15e8b8ebd4586ab5fb238d484d0c45..f84bf757c8ee9e406994ee53e36e7cfd14c48b51 100644 (file)
@@ -242,7 +242,7 @@ static const virtual_server_compile_t compile_list[] = {
 
 extern fr_process_module_t process_arp;
 fr_process_module_t process_arp = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_arp",
        .inst_size      = sizeof(process_arp_t),
        .process        = mod_process,
index 80e245c58c597fbf3875bda0ca47fd2543904412..b75181b80864c8444bcb0828818f2cb19988021a 100644 (file)
@@ -51,7 +51,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, UNUSED module_ctx_t co
 
 extern fr_process_module_t process_control;
 fr_process_module_t process_control = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_control",
        .process        = mod_process,
        .dict           = &dict_freeradius,
index 56692448f28a20f0169a21529071ec728a96e72e..9a989e673ffc8d6c6283fdf47844cd4666ce7738 100644 (file)
@@ -451,7 +451,7 @@ static const virtual_server_compile_t compile_list[] = {
 
 extern fr_process_module_t process_dhcpv4;
 fr_process_module_t process_dhcpv4 = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_dhcpv4",
        .inst_size      = sizeof(process_dhcpv4_t),
        .process        = mod_process,
index be83a985b5f4265656dd1f772fe505f3c0ed9df0..84d3e62daf9a0792b24b7f90375810dc965bedd5 100644 (file)
@@ -1231,7 +1231,7 @@ static fr_process_state_t const process_state[] = {
 
 extern fr_process_module_t process_dhcpv6;
 fr_process_module_t process_dhcpv6 = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_dhcpv6",
        .config         = dhcpv6_process_config,
        .inst_size      = sizeof(process_dhcpv6_t),
index c8f8d14406db9939eae1cf8facb8dc6adee56802..9734bbb9f2339215adff1c57f2e9cb37e5a7bd50 100644 (file)
@@ -190,7 +190,7 @@ static const virtual_server_compile_t compile_list[] = {
 
 extern fr_process_module_t process_dns;
 fr_process_module_t process_dns = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_dns",
        .inst_size      = sizeof(process_dns_t),
        .process        = mod_process,
index 1a4831bc3268ff01ccf801d4b7f945adbcfc6490..275c128a200d8c7df317a503ab07a3a248f8f33e 100644 (file)
@@ -265,7 +265,7 @@ static void mod_unload(void)
 
 extern fr_process_module_t process_eap_aka;
 fr_process_module_t process_eap_aka = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_eap_aka",
        .onload         = mod_load,
        .unload         = mod_unload,
index d80c344c632caa9407b9240bf51f43288d1537cb..30551213240b6bb24eb525429ca2e17ad2a95460 100644 (file)
@@ -266,7 +266,7 @@ static void mod_unload(void)
 
 extern fr_process_module_t process_eap_aka_prime;
 fr_process_module_t process_eap_aka_prime = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_eap_aka_prime",
        .onload         = mod_load,
        .unload         = mod_unload,
index d77042d4e318b05216dddf09027fc4faf8d9dd08..a05a6c9a93ee83591f647cc5c797d06814db68ad 100644 (file)
@@ -253,7 +253,7 @@ static void mod_unload(void)
 
 extern fr_process_module_t process_eap_sim;
 fr_process_module_t process_eap_sim = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_eap_sim",
        .onload         = mod_load,
        .unload         = mod_unload,
index 14cf41b04a33c0c3866aaf6ce0472a4447815610..2cff7ce919651cdece4de67cef2a459c359cab76 100644 (file)
@@ -1125,7 +1125,7 @@ static virtual_server_compile_t const compile_list[] = {
 
 extern fr_process_module_t process_radius;
 fr_process_module_t process_radius = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_radius",
        .config         = config,
        .inst_size      = sizeof(process_radius_t),
index 68f8371b7901332847a307c771474f38b88d31c2..07886e95f6d2a89d1cc94816cb6a12ea3e2974fe 100644 (file)
@@ -705,7 +705,7 @@ static virtual_server_compile_t compile_list[] = {
 
 extern fr_process_module_t process_tacacs;
 fr_process_module_t process_tacacs = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_tacacs",
        .config         = config,
        .inst_size      = sizeof(process_tacacs_t),
index e47774d57ae036fa1e433d73df256a6d00575188..d18b62d0def8d1fbbb6f8b36166f56925e36b27d 100644 (file)
@@ -181,7 +181,7 @@ static const virtual_server_compile_t compile_list[] = {
 
 extern fr_process_module_t process_tls;
 fr_process_module_t process_tls = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_tls",
        .inst_size      = sizeof(process_tls_t),
        .process        = mod_process,
index 6d3863773ce6e85fd10b60da31cfe73cba939d3d..13e3123afeb5efcd0d5c2af657672ca2f9000e22 100644 (file)
@@ -819,7 +819,7 @@ static virtual_server_compile_t const compile_list[] = {
 
 extern fr_process_module_t process_ttls;
 fr_process_module_t process_ttls = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_ttls",
        .config         = config,
        .inst_size      = sizeof(process_ttls_t),
index dc80e9396b4f2f7772a233f273cbd970529cb2b6..c613c73ae84a11d389f7bf7160dd88c7bc7b850c 100644 (file)
@@ -259,7 +259,7 @@ static const virtual_server_compile_t compile_list[] = {
 
 extern fr_process_module_t process_vmps;
 fr_process_module_t process_vmps = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "process_vmps",
        .inst_size      = sizeof(process_vmps_t),
 
index 193b1eefe7efced55d066dcf9f98a193ad745e56..6bc1bca75d3fba2c2f02f5c6498bbc0bc9bf6e89 100644 (file)
@@ -401,7 +401,7 @@ static int fr_ethernet_set_option(void *proto_ctx, fr_proto_opt_group_t group, i
 
 extern fr_proto_lib_t const libfreeradius_ethernet;
 fr_proto_lib_t const libfreeradius_ethernet = {
-       .magic          = RLM_MODULE_INIT,
+       .magic          = MODULE_MAGIC_INIT,
        .name           = "ethernet",
        .inst_size      = sizeof(fr_ethernet_proto_ctx_t),