#include <stdio.h>
#include <dirent.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <asterisk/module.h>
#include <asterisk/options.h>
#include <asterisk/config.h>
#include <asterisk/logger.h>
#include <asterisk/channel.h>
#include <asterisk/term.h>
#include <asterisk/manager.h>
#include <asterisk/enum.h>
#include <asterisk/rtp.h>
#include <dlfcn.h>
#include <asterisk/md5.h>
#include <pthread.h>
#include "asterisk.h"
#include "astconf.h"
Include dependency graph for loader.c:
Go to the source code of this file.
Data Structures | |
struct | module |
struct | loadupdate |
Defines | |
#define | RTLD_NOW 0 |
Functions | |
AST_MUTEX_DEFINE_STATIC (modlock) | |
AST_MUTEX_DEFINE_STATIC (reloadlock) | |
int | ast_unload_resource (char *resource_name, int force) |
Unloads a module. | |
void | ast_module_reload (void) |
Reload all modules. | |
int | ast_load_resource (char *resource_name) |
Loads a module. | |
int | load_modules () |
void | ast_update_use_count (void) |
Notify when usecount has been changed. | |
int | ast_update_module_list (int(*modentry)(char *module, char *description, int usecnt)) |
Ask for a list of modules, descriptions, and use counts. | |
int | ast_loader_register (int(*v)(void)) |
Ask this procedure to be run with modules have been updated. | |
int | ast_loader_unregister (int(*v)(void)) |
No longer run me when modules are updated. |
|
Definition at line 39 of file loader.c. Referenced by ast_load_resource(), and dlopen(). |
|
Loads a module.
Definition at line 178 of file loader.c. References ast_config_AST_MODULE_DIR, ast_destroy(), ast_load(), ast_log(), AST_MODULE_CONFIG, ast_mutex_lock, ast_mutex_unlock, ast_true(), ast_unload_resource(), ast_update_use_count(), ast_variable_retrieve(), ast_verbose(), COLOR_BLACK, COLOR_BROWN, dlclose(), dlerror(), dlopen(), dlsym(), free, fully_booted, key(), LOG_WARNING, malloc, module::next, option_console, option_verbose, RTLD_GLOBAL, RTLD_LAZY, RTLD_NOW, term_color(), and VERBOSE_PREFIX_1. Referenced by load_modules().
|
|
Ask this procedure to be run with modules have been updated.
Definition at line 471 of file loader.c. References ast_log(), ast_mutex_lock, ast_mutex_unlock, LOG_WARNING, and malloc.
|
|
No longer run me when modules are updated.
Definition at line 487 of file loader.c. References ast_log(), ast_mutex_lock, ast_mutex_unlock, and LOG_WARNING.
|
|
Reload all modules. This reloads all modules set to load in asterisk. It does NOT run the unload routine and then loads them again, it runs the given reload routine. Definition at line 149 of file loader.c. References ast_enum_reload(), ast_lastreloadtime, ast_mutex_lock, ast_mutex_trylock, ast_mutex_unlock, ast_rtp_reload(), ast_verbose(), option_verbose, reload_manager(), and VERBOSE_PREFIX_3.
|
|
|
|
|
|
Unloads a module.
Definition at line 106 of file loader.c. References AST_FORCE_FIRM, ast_log(), ast_mutex_lock, ast_mutex_unlock, ast_update_use_count(), dlclose(), free, LOG_WARNING, and module::next. Referenced by ast_load_resource().
|
|
Ask for a list of modules, descriptions, and use counts.
Definition at line 455 of file loader.c. References ast_mutex_trylock, ast_mutex_unlock, and module::next.
|
|
Notify when usecount has been changed. This function goes through and calulates use counts. It also notifies anybody trying to keep track of them. Definition at line 439 of file loader.c. References ast_log(), ast_mutex_lock, ast_mutex_unlock, and LOG_WARNING. Referenced by ast_load_resource(), and ast_unload_resource().
|
|
Definition at line 352 of file loader.c. References ast_config_AST_MODULE_DIR, ast_destroy(), ast_load(), ast_load_resource(), ast_log(), AST_MODULE_CONFIG, ast_true(), ast_variable_browse(), ast_variable_retrieve(), ast_verbose(), COLOR_BRWHITE, LOG_DEBUG, LOG_WARNING, option_debug, option_quiet, option_verbose, term_color(), and VERBOSE_PREFIX_1. Referenced by main().
|