Asterisk - The Open Source Telephony Project GIT-master-1f1c5bb
|
#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 | CONFIG_TYPE "tn" |
#define | DEFAULT_attest_level attest_level_NOT_SET |
#define | DEFAULT_check_tn_cert_public_url check_tn_cert_public_url_NO |
#define | DEFAULT_private_key_file NULL |
#define | DEFAULT_public_cert_url NULL |
#define | DEFAULT_send_mky send_mky_NO |
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_sorcery_enum_from_str (generate_sorcery_enum_to_str(tn_cfg, generate_sorcery_enum_to_str(acfg_common., check_tn_cert_public_url, UNKNOWN) | |
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) |
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 CONFIG_TYPE "tn" |
Definition at line 29 of file tn_config.c.
#define DEFAULT_attest_level attest_level_NOT_SET |
Definition at line 34 of file tn_config.c.
#define DEFAULT_check_tn_cert_public_url check_tn_cert_public_url_NO |
Definition at line 31 of file tn_config.c.
#define DEFAULT_private_key_file NULL |
Definition at line 32 of file tn_config.c.
#define DEFAULT_public_cert_url NULL |
Definition at line 33 of file tn_config.c.
#define DEFAULT_send_mky send_mky_NO |
Definition at line 35 of file tn_config.c.
|
static |
Definition at line 203 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 167 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 100 of file tn_config.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, init_tn(), and NULL.
Referenced by tn_get_etn().
generate_sorcery_enum_from_str | ( | generate_sorcery_enum_to_str( | tn_cfg, |
generate_sorcery_enum_to_str( | acfg_common., | ||
check_tn_cert_public_url | , | ||
UNKNOWN | |||
) |
Definition at line 48 of file tn_config.c.
References acfg_cleanup(), tn_cfg::acfg_common, and ast_string_field_free_memory.
|
static |
Definition at line 42 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 65 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 84 of file tn_config.c.
References ao2_cleanup, ast_sorcery_generic_alloc(), init_tn(), and NULL.
Referenced by tn_config_load().
|
static |
Definition at line 154 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 258 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 243 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 250 of file tn_config.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), and stir_shaken_certificate_cli.
Referenced by common_config_unload().
struct tn_cfg * tn_get_cfg | ( | const char * | id | ) |
Definition at line 37 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 116 of file tn_config.c.
References profile_cfg::acfg_common, tn_cfg::acfg_common, ao2_cleanup, as_copy_cfg_common(), ast_sorcery_retrieve_by_id(), CONFIG_TYPE, etn_alloc(), get_sorcery(), NULL, RAII_VAR, and S_OR.
Referenced by ast_stir_shaken_as_ctx_create().
|
static |
Definition at line 238 of file tn_config.c.
Referenced by tn_config_load(), and tn_config_unload().