Asterisk - The Open Source Telephony Project GIT-master-3dae2cf
|
#include "asterisk.h"
#include <sys/stat.h>
#include "asterisk/cli.h"
#include "asterisk/module.h"
#include "asterisk/sorcery.h"
#include "stir_shaken.h"
Go to the source code of this file.
Macros | |
#define | _TRACE_PREFIX_ "tc",__LINE__, "" |
#define | CONFIG_TYPE "tn" |
#define | DEFAULT_attest_level attest_level_NOT_SET |
#define | DEFAULT_check_tn_cert_public_url check_tn_cert_public_url_NOT_SET |
#define | DEFAULT_private_key_file NULL |
#define | DEFAULT_public_cert_url NULL |
#define | DEFAULT_send_mky send_mky_NOT_SET |
Functions | |
static char * | cli_tn_show (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | cli_tn_show_all (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static void * | etn_alloc (const char *name) |
generate_acfg_common_sorcery_handlers (tn_cfg) | |
static struct ao2_container * | get_tn_all (void) |
static int | init_tn (struct tn_cfg *cfg) |
static void * | tn_alloc (const char *name) |
static int | tn_apply (const struct ast_sorcery *sorcery, void *obj) |
int | tn_config_load (void) |
int | tn_config_reload (void) |
int | tn_config_unload (void) |
static void | tn_destructor (void *obj) |
struct tn_cfg * | tn_get_cfg (const char *id) |
struct tn_cfg * | tn_get_etn (const char *id, struct profile_cfg *eprofile) |
Variables | |
static struct ast_cli_entry | stir_shaken_certificate_cli [] |
#define _TRACE_PREFIX_ "tc",__LINE__, "" |
Definition at line 19 of file tn_config.c.
#define CONFIG_TYPE "tn" |
Definition at line 31 of file tn_config.c.
#define DEFAULT_attest_level attest_level_NOT_SET |
Definition at line 36 of file tn_config.c.
#define DEFAULT_check_tn_cert_public_url check_tn_cert_public_url_NOT_SET |
Definition at line 33 of file tn_config.c.
#define DEFAULT_private_key_file NULL |
Definition at line 34 of file tn_config.c.
#define DEFAULT_public_cert_url NULL |
Definition at line 35 of file tn_config.c.
#define DEFAULT_send_mky send_mky_NOT_SET |
Definition at line 37 of file tn_config.c.
|
static |
Definition at line 213 of file tn_config.c.
References a, ao2_cleanup, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, config_object_cli_show(), config_object_tab_complete_name(), config_object_type_tn, get_tn_all(), NULL, config_object_cli_data::title, tn_get_cfg(), and ast_cli_entry::usage.
|
static |
Definition at line 177 of file tn_config.c.
References a, ao2_callback_data, ao2_cleanup, ao2_container_count(), ao2_ref, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, config_object_cli_show(), config_object_type_tn, container, get_tn_all(), NULL, OBJ_NODATA, config_object_cli_data::title, and ast_cli_entry::usage.
|
static |
Definition at line 95 of file tn_config.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, init_tn(), NULL, and tn_destructor().
Referenced by tn_get_etn().
generate_acfg_common_sorcery_handlers | ( | tn_cfg | ) |
|
static |
Definition at line 44 of file tn_config.c.
References AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_retrieve_by_fields(), CONFIG_TYPE, get_sorcery(), and NULL.
Referenced by cli_tn_show(), and cli_tn_show_all().
|
static |
Definition at line 60 of file tn_config.c.
References tn_cfg::acfg_common, and ast_string_field_init.
Referenced by etn_alloc(), and tn_alloc().
|
static |
Definition at line 79 of file tn_config.c.
References ao2_cleanup, ast_sorcery_generic_alloc(), init_tn(), NULL, and tn_destructor().
Referenced by tn_config_load().
|
static |
Definition at line 164 of file tn_config.c.
References tn_cfg::acfg_common, as_check_common_config(), and ast_sorcery_object_get_id().
Referenced by tn_config_load().
int tn_config_load | ( | void | ) |
Definition at line 268 of file tn_config.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_sorcery_apply_default, ast_sorcery_load_object(), ast_sorcery_object_field_register, ast_sorcery_object_register, CONFIG_TYPE, get_sorcery(), LOG_ERROR, NULL, OPT_NOOP_T, register_common_attestation_fields, sorcery, stir_shaken_certificate_cli, tn_alloc(), and tn_apply().
Referenced by common_config_load().
int tn_config_reload | ( | void | ) |
Definition at line 253 of file tn_config.c.
References AST_MODULE_LOAD_SUCCESS, ast_sorcery_force_reload_object(), CONFIG_TYPE, get_sorcery(), and sorcery.
Referenced by common_config_reload().
int tn_config_unload | ( | void | ) |
Definition at line 260 of file tn_config.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), and stir_shaken_certificate_cli.
Referenced by common_config_unload().
|
static |
Definition at line 52 of file tn_config.c.
References acfg_cleanup(), tn_cfg::acfg_common, and ast_string_field_free_memory.
Referenced by etn_alloc(), and tn_alloc().
struct tn_cfg * tn_get_cfg | ( | const char * | id | ) |
Definition at line 39 of file tn_config.c.
References ast_sorcery_retrieve_by_id(), CONFIG_TYPE, and get_sorcery().
Referenced by cli_tn_show().
struct tn_cfg * tn_get_etn | ( | const char * | id, |
struct profile_cfg * | eprofile | ||
) |
Definition at line 111 of file tn_config.c.
References profile_cfg::acfg_common, ao2_bump, ao2_cleanup, as_copy_cfg_common(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_id(), ast_strlen_zero(), ast_trace, CONFIG_TYPE, etn_alloc(), get_sorcery(), NULL, RAII_VAR, S_OR, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and profile_cfg::unknown_tn_attest_level.
Referenced by ast_stir_shaken_as_ctx_create().
|
static |
Definition at line 248 of file tn_config.c.
Referenced by tn_config_load(), and tn_config_unload().