Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Sorcery Configuration File Object Wizard. More...
#include "asterisk.h"
#include <regex.h>
#include "asterisk/module.h"
#include "asterisk/sorcery.h"
#include "asterisk/astobj2.h"
#include "asterisk/config.h"
#include "asterisk/uuid.h"
#include "asterisk/hashtab.h"
Go to the source code of this file.
Data Structures | |
struct | sorcery_config |
Structure for storing configuration file sourced objects. More... | |
struct | sorcery_config_fields_cmp_params |
Structure used for fields comparison. More... | |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | load_module (void) |
static void | sorcery_config_close (void *data) |
static void | sorcery_config_destructor (void *obj) |
Destructor function for sorcery config. More... | |
static int | sorcery_config_fields_cmp (void *obj, void *arg, int flags) |
static void | sorcery_config_internal_load (void *data, const struct ast_sorcery *sorcery, const char *type, unsigned int reload) |
static void | sorcery_config_load (void *data, const struct ast_sorcery *sorcery, const char *type) |
static void * | sorcery_config_open (const char *data) |
static void | sorcery_config_reload (void *data, const struct ast_sorcery *sorcery, const char *type) |
static void * | sorcery_config_retrieve_fields (const struct ast_sorcery *sorcery, void *data, const char *type, const struct ast_variable *fields) |
static void * | sorcery_config_retrieve_id (const struct ast_sorcery *sorcery, void *data, const char *type, const char *id) |
static void | sorcery_config_retrieve_multiple (const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const struct ast_variable *fields) |
static void | sorcery_config_retrieve_prefix (const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const char *prefix, const size_t prefix_len) |
static void | sorcery_config_retrieve_regex (const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const char *regex) |
static int | sorcery_is_configuration_met (const struct ast_sorcery *sorcery, const char *type, struct ast_category *category, struct sorcery_config *config) |
Internal function which determines if criteria has been met for considering an object set applicable. More... | |
static int | sorcery_is_criteria_met (struct ast_category *category, struct sorcery_config *config) |
Internal function which determines if a category matches based on criteria. More... | |
static int | sorcery_is_explicit_name_met (const struct ast_sorcery *sorcery, const char *type, struct ast_category *category, struct sorcery_config *config) |
Internal function which determines if a category matches based on explicit name. More... | |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "Sorcery Configuration File Object Wizard" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_REALTIME_DRIVER, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_sorcery_wizard | config_object_wizard |
Sorcery Configuration File Object Wizard.
Definition in file res_sorcery_config.c.
|
static |
Definition at line 567 of file res_sorcery_config.c.
|
static |
Definition at line 567 of file res_sorcery_config.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 567 of file res_sorcery_config.c.
|
static |
Definition at line 547 of file res_sorcery_config.c.
References AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_sorcery_wizard_register, and config_object_wizard.
|
static |
Definition at line 540 of file res_sorcery_config.c.
|
static |
Destructor function for sorcery config.
Definition at line 122 of file res_sorcery_config.c.
References ao2_global_obj_release, ast_free, ast_rwlock_destroy, ast_variables_destroy(), and config.
Referenced by sorcery_config_open().
|
static |
Definition at line 132 of file res_sorcery_config.c.
References ao2_link, ast_sorcery_object_get_id(), ast_sorcery_objectset_create, ast_variable_lists_match(), ast_variables_destroy(), CMP_MATCH, sorcery_config_fields_cmp_params::container, sorcery_config_fields_cmp_params::fields, NULL, sorcery_config_fields_cmp_params::prefix, sorcery_config_fields_cmp_params::prefix_len, RAII_VAR, sorcery_config_fields_cmp_params::regex, and sorcery_config_fields_cmp_params::sorcery.
Referenced by sorcery_config_retrieve_fields(), sorcery_config_retrieve_multiple(), sorcery_config_retrieve_prefix(), and sorcery_config_retrieve_regex().
|
static |
Definition at line 316 of file res_sorcery_config.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_cleanup, ao2_container_alloc_hash, ao2_find, ao2_global_obj_replace_unref, ao2_link, ast_category_browse_filtered(), ast_category_first(), ast_category_get_name(), ast_config_destroy(), ast_config_load2(), ast_debug, ast_is_prime(), ast_log, ast_sorcery_alloc(), ast_sorcery_object_has_dynamic_contents(), ast_sorcery_object_id_compare(), ast_sorcery_object_id_hash(), ast_sorcery_objectset_apply(), config, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, ast_flags::flags, LOG_ERROR, LOG_NOTICE, NULL, OBJ_SEARCH_KEY, RAII_VAR, reload(), sorcery, sorcery_config_retrieve_id(), sorcery_is_configuration_met(), and type.
Referenced by sorcery_config_load(), and sorcery_config_reload().
|
static |
Definition at line 450 of file res_sorcery_config.c.
References sorcery, sorcery_config_internal_load(), and type.
|
static |
Definition at line 460 of file res_sorcery_config.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_ref, ast_free, ast_log, ast_rwlock_init, ast_strdup, ast_strdupa, ast_strlen_zero(), ast_true(), ast_uuid_generate_str(), ast_variable_new, config, sorcery_config::filename, LOG_ERROR, name, ast_variable::next, NULL, sorcery_config_destructor(), strsep(), tmp(), and value.
|
static |
Definition at line 455 of file res_sorcery_config.c.
References sorcery, sorcery_config_internal_load(), and type.
|
static |
Definition at line 170 of file res_sorcery_config.c.
References ao2_callback, ao2_cleanup, ao2_global_obj_ref, config, sorcery_config_fields_cmp_params::fields, NULL, sorcery_config::objects, RAII_VAR, sorcery, sorcery_config_fields_cmp_params::sorcery, and sorcery_config_fields_cmp().
|
static |
Definition at line 188 of file res_sorcery_config.c.
References ao2_cleanup, ao2_find, ao2_global_obj_ref, config, NULL, OBJ_SEARCH_KEY, sorcery_config::objects, and RAII_VAR.
Referenced by sorcery_config_internal_load().
|
static |
Definition at line 196 of file res_sorcery_config.c.
References ao2_callback, ao2_cleanup, ao2_global_obj_ref, config, sorcery_config_fields_cmp_params::fields, OBJ_MULTIPLE, OBJ_NODATA, RAII_VAR, sorcery, sorcery_config_fields_cmp_params::sorcery, and sorcery_config_fields_cmp().
|
static |
Definition at line 236 of file res_sorcery_config.c.
References ao2_callback, ao2_cleanup, ao2_global_obj_ref, config, OBJ_MULTIPLE, OBJ_NODATA, prefix, sorcery_config_fields_cmp_params::prefix_len, RAII_VAR, sorcery, sorcery_config_fields_cmp_params::sorcery, and sorcery_config_fields_cmp().
|
static |
Definition at line 213 of file res_sorcery_config.c.
References ao2_callback, ao2_cleanup, ao2_global_obj_ref, ast_strlen_zero(), config, OBJ_MULTIPLE, OBJ_NODATA, RAII_VAR, regex(), sorcery, sorcery_config_fields_cmp_params::sorcery, and sorcery_config_fields_cmp().
|
static |
Internal function which determines if criteria has been met for considering an object set applicable.
Definition at line 300 of file res_sorcery_config.c.
References ast_strlen_zero(), config, sorcery, sorcery_is_criteria_met(), sorcery_is_explicit_name_met(), and type.
Referenced by sorcery_config_internal_load().
|
static |
Internal function which determines if a category matches based on criteria.
Definition at line 288 of file res_sorcery_config.c.
References ast_category_first(), ast_sorcery_changeset_create(), ast_variables_destroy(), config, NULL, and RAII_VAR.
Referenced by sorcery_is_configuration_met().
|
static |
Internal function which determines if a category matches based on explicit name.
Definition at line 255 of file res_sorcery_config.c.
References ao2_ref, ast_category_first(), ast_category_get_name(), ast_sorcery_get_object_type(), ast_sorcery_is_object_field_registered(), ast_strlen_zero(), config, ast_variable::name, ast_variable::next, sorcery, and type.
Referenced by sorcery_is_configuration_met().
|
static |
Definition at line 556 of file res_sorcery_config.c.
References ast_sorcery_wizard_unregister(), and config_object_wizard.
|
static |
Definition at line 567 of file res_sorcery_config.c.
|
static |
Definition at line 567 of file res_sorcery_config.c.
|
static |
Definition at line 107 of file res_sorcery_config.c.
Referenced by load_module(), and unload_module().