26 RCSIDH(dl_module_h,
"$Id: edfd9405472ea657c557139f2c8791fd1dc62b9c $")
29 # error FreeRADIUS needs a working dlopen()
34 #include <freeradius-devel/server/cf_parse.h>
35 #include <freeradius-devel/util/dl.h>
36 #include <freeradius-devel/util/rb.h>
37 #include <freeradius-devel/util/version.h>
44 # error _CONST can only be defined in the local header
46 #ifndef _DL_MODULE_PRIVATE
53 # define DL_EXTENSION ".dylib"
55 # define DL_EXTENSION ".dll"
57 # define DL_EXTENSION ".so"
63 #define MODULE_MAGIC_INIT RADIUSD_MAGIC_NUMBER
76 #define DL_PRIORITY_DICT 30
77 #define DL_PRIORITY_DICT_ATTR 29
78 #define DL_PRIORITY_DICT_ENUM 28
79 #define DL_PRIORITY_LIB 20
80 #define DL_PRIORITY_BOOTSTRAP 10
98 #define DL_MODULE_COMMON \
102 dl_module_onload_t onload; \
103 dl_module_unload_t unload; \
A section grouping multiple CONF_PAIR.
static dl_module_loader_t * dl_module_loader
Wrapper struct around dl_loader_t.
char const * dl_module_search_path(void)
dl_t *_CONST dl
Dynamic loader handle.
dl_module_common_t * exported
Symbol exported by the module, containing its public functions, name and behaviour control flags.
dl_module_t const *_CONST parent
of this module.
dl_module_type_t _CONST type
of this module.
@ DL_MODULE_TYPE_PROTO
Protocol module.
@ DL_MODULE_TYPE_SUBMODULE
Driver (or method in the case of EAP)
@ DL_MODULE_TYPE_MODULE
Standard loadable module.
@ DL_MODULE_TYPE_PROCESS
protocol processor.
char const *_CONST name
Name of the module. The name passed to dl_module_alloc.
fr_table_num_sorted_t const dl_module_type_prefix[]
Name prefixes matching the types of loadable module.
int(* dl_module_onload_t)(void)
Callback to call when a module is first loaded.
void(* dl_module_unload_t)(void)
Callback when a module is destroyed.
dl_module_loader_t * dl_module_loader_init(char const *lib_dir)
Initialise structures needed by the dynamic linker.
dl_module_loader_t *_CONST loader
Loader that owns this dl.
CONF_SECTION *_CONST conf
The module's global configuration (as opposed to the instance, configuration).
dl_module_t * dl_module_alloc(dl_module_t const *parent, char const *name, dl_module_type_t type)
Load a module library using dlopen() or return a previously loaded module from the cache.
dl_loader_t * dl_loader_from_module_loader(dl_module_loader_t *dl_module_loader)
unsigned int refs
Number of references to this module.
size_t dl_module_type_prefix_len
int dl_module_free(dl_module_t *dl_module)
Free a dl_module (when there are no more references to it)
Fields common to all types of loadable modules.
fr_aka_sim_id_type_t type
An element in a lexicographically sorted array of name to num mappings.