25 #include <freeradius-devel/server/global_lib.h>
26 #include <freeradius-devel/server/main_config.h>
27 #include <freeradius-devel/util/atexit.h>
77 cf_log_err(cs,
"Failed evaluating configuration for libldap");
164 if (lib->
initialised && ((*p)->free)) (*p)->free();
182 static int8_t
_lib_cmp(
void const *one,
void const *two)
225 DEBUG2(
"#### Instantiating libraries ####");
227 if (lib->initialised)
continue;
229 DEBUG2(
"Instantiating %s", lib->autoinit->name);
#define fr_atexit_global(_func, _uctx)
Add a free function to the global free list.
#define CMP(_a, _b)
Same as CMP_PREFER_SMALLER use when you don't really care about ordering, you just want an ordering.
int cf_section_parse(TALLOC_CTX *ctx, void *base, CONF_SECTION *cs)
Parse a configuration section into user-supplied variables.
#define cf_section_rules_push(_cs, _rule)
A section grouping multiple CONF_PAIR.
CONF_SECTION * cf_section_find(CONF_SECTION const *cs, char const *name1, char const *name2)
Find a CONF_SECTION with name1 and optionally name2.
#define cf_log_err(_cf, _fmt,...)
#define cf_section_alloc(_ctx, _parent, _name1, _name2)
fr_dcursor_eval_t void const * uctx
#define fr_assert_msg(_x, _msg,...)
Calls panic_action ifndef NDEBUG, else logs error and causes the server to exit immediately with code...
fr_rb_node_t entry
Entry in tree of libraries.
static void lib_autofree(global_lib_autoinst_t *const *to_free)
Run free callbacks for external libraries no-longer in use.
int global_lib_init(void)
Initialise the global list of external libraries.
static int _lib_list_free_atexit(UNUSED void *uctx)
Free global list of libraries.
bool initialised
Has the init callback been run for this library.
static int lib_auto_instantiate(global_lib_autoinst_t *const *to_init)
Instantiate a list of libraries.
uint32_t instance_count
Number of current uses of this library.
static global_lib_list_t * lib_list
void global_lib_autofree(UNUSED dl_t const *module, void *symbol, UNUSED void *user_ctx)
Callback for freeing of "lib" symbols.
int global_lib_auto_instantiate(UNUSED dl_t const *module, void *symbol, UNUSED void *user_ctx)
Callback for creation of "lib" symbols.
global_lib_autoinst_t const global_lib_terminator
global_lib_autoinst_t const * autoinit
Autoinit structure used to manage this library.
int global_lib_instantiate(void)
Walk the tree of libraries and instantiate any which are pending.
static int lib_init_call(global_lib_inst_t *lib)
Parse the global config section for a library and call its init function.
static int8_t _lib_cmp(void const *one, void const *two)
Compare two fr_lib_t.
Structure to track use of libraries.
conf_parser_t const * config
Config parser for this library's global options.
char const * name
Name of library and section within global config.
lib_init_t init
Callback to initialise library.
void * inst
Module data to parse global config into.
Structure to define how to initialise libraries with global configuration.
main_config_t const * main_config
Main server configuration.
CONF_SECTION * root_cs
Root of the server config.
void * fr_rb_remove(fr_rb_tree_t *tree, void const *data)
#define fr_rb_inline_init(_tree, _type, _field, _data_cmp, _data_free)
Initialises a red black tree.
bool fr_rb_insert(fr_rb_tree_t *tree, void const *data)
#define fr_rb_inorder_foreach(_tree, _type, _iter)
void * fr_rb_find(fr_rb_tree_t const *tree, void const *data)
The main red black tree structure.
MEM(pair_append_request(&vp, attr_eap_aka_sim_identity) >=0)