Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk.h"
#include "asterisk/cli.h"
#include "asterisk/logger.h"
#include "asterisk/module.h"
#include "asterisk/utils.h"
#include "asterisk/stasis.h"
#include "asterisk/security_events.h"
#include "stir_shaken.h"
Go to the source code of this file.
Data Structures | |
struct | enum_name_xref_entry |
Macros | |
#define | AST_API_MODULE |
#define | generate_bool_handler_functions(param_name) |
#define | generate_enum_string_functions(param_name, default_value, ...) |
#define | print_acl_cert_store(cfg, a, max_name_len) |
Functions | |
char * | canonicalize_tn (const char *tn, char *dest_tn) |
Canonicalize a TN. More... | |
char * | canonicalize_tn_alloc (const char *tn) |
Canonicalize a TN into nre buffer. More... | |
static char * | cli_verify_cert (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
int | common_config_load (void) |
int | common_config_reload (void) |
int | common_config_unload (void) |
int | config_object_cli_show (void *obj, void *arg, void *data, int flags) |
Output configuration settings to the Asterisk CLI. More... | |
char * | config_object_tab_complete_name (const char *word, struct ao2_container *container) |
Tab completion for name matching with STIR/SHAKEN CLI commands. More... | |
generate_bool_handler_functions (check_tn_cert_public_url) | |
generate_bool_handler_functions (load_system_certs) | |
generate_bool_handler_functions (relax_x5u_path_restrictions) | |
generate_bool_handler_functions (relax_x5u_port_scheme_restrictions) | |
generate_bool_handler_functions (send_mky) | |
generate_bool_handler_functions (use_rfc9410_responses) | |
generate_enum_string_functions (attest_level, UNKNOWN, {attest_level_NOT_SET, "not_set"}, {attest_level_A, "A"}, {attest_level_B, "B"}, {attest_level_C, "C"},) | |
generate_enum_string_functions (endpoint_behavior, OFF, {endpoint_behavior_OFF, "off"}, {endpoint_behavior_OFF, "none"}, {endpoint_behavior_ATTEST, "attest"}, {endpoint_behavior_VERIFY, "verify"}, {endpoint_behavior_ON, "on"}, {endpoint_behavior_ON, "both"}) | |
generate_enum_string_functions (stir_shaken_failure_action, CONTINUE, {stir_shaken_failure_action_CONTINUE, "continue"}, {stir_shaken_failure_action_REJECT_REQUEST, "reject_request"}, {stir_shaken_failure_action_CONTINUE_RETURN_REASON, "continue_return_reason"},) | |
struct ast_sorcery * | get_sorcery (void) |
Retrieve the stir/shaken sorcery context. More... | |
static void | named_acl_changed_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | print_acl (int fd, struct ast_acl_list *acl_list, const char *prefix) |
static const char * | translate_value (const char *val) |
Variables | |
static struct ast_cli_entry | cli_commands [] |
struct stasis_subscription * | named_acl_changed_sub = NULL |
static struct ast_sorcery * | sorcery |
#define AST_API_MODULE |
Definition at line 28 of file common_config.c.
#define generate_bool_handler_functions | ( | param_name | ) |
Definition at line 39 of file common_config.c.
#define generate_enum_string_functions | ( | param_name, | |
default_value, | |||
... | |||
) |
Definition at line 77 of file common_config.c.
#define print_acl_cert_store | ( | cfg, | |
a, | |||
max_name_len | |||
) |
Definition at line 151 of file common_config.c.
char * canonicalize_tn | ( | const char * | tn, |
char * | dest_tn | ||
) |
Canonicalize a TN.
tn | TN to canonicalize |
dest_tn | Pointer to destination buffer to receive the new TN |
dest_tn | or NULL on failure |
Definition at line 266 of file common_config.c.
References ast_strlen_zero(), len(), NULL, S_OR, SCOPE_ENTER, and SCOPE_EXIT_RTN_VALUE.
Referenced by canonicalize_tn_alloc().
char * canonicalize_tn_alloc | ( | const char * | tn | ) |
Canonicalize a TN into nre buffer.
tn | TN to canonicalize |
dest_tn | (which must be freed with ast_free) or NULL on failure |
Definition at line 293 of file common_config.c.
References ast_malloc, ast_strlen_zero(), canonicalize_tn(), and NULL.
Referenced by ast_stir_shaken_as_ctx_create(), and ast_stir_shaken_vs_ctx_create().
|
static |
Definition at line 302 of file common_config.c.
References a, ao2_cleanup, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, config_object_tab_complete_name(), crypto_is_cert_trusted(), crypto_load_cert_from_file(), NULL, profile_get_all(), profile_get_cfg(), RAII_VAR, ast_cli_entry::usage, and vs_get_cfg().
int common_config_load | ( | void | ) |
Definition at line 420 of file common_config.c.
References ARRAY_LEN, as_load(), ast_cli_register_multiple, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_named_acl_change_type(), ast_security_topic(), ast_sorcery_open, cli_commands, common_config_unload(), named_acl_changed_cb(), named_acl_changed_sub, NULL, profile_load(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, sorcery, stasis_subscribe, stasis_subscription_accept_message_type(), tn_config_load(), and vs_load().
Referenced by load_module().
int common_config_reload | ( | void | ) |
Definition at line 369 of file common_config.c.
References as_reload(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, profile_reload(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, tn_config_reload(), and vs_reload().
Referenced by named_acl_changed_cb(), and reload_module().
int common_config_unload | ( | void | ) |
Definition at line 391 of file common_config.c.
References ARRAY_LEN, as_unload(), ast_cli_unregister_multiple(), ast_sorcery_unref, cli_commands, named_acl_changed_sub, NULL, profile_unload(), sorcery, stasis_unsubscribe(), tn_config_unload(), and vs_unload().
Referenced by common_config_load(), and unload_module().
int config_object_cli_show | ( | void * | obj, |
void * | arg, | ||
void * | data, | ||
int | flags | ||
) |
Output configuration settings to the Asterisk CLI.
obj | A sorcery object containing configuration data |
arg | Asterisk CLI argument object |
flags | ao2 container flags |
0 |
Definition at line 172 of file common_config.c.
References a, ast_cli(), AST_HANDLER_ONLY_STRING, ast_sorcery_object_get_id(), ast_sorcery_object_get_type(), ast_sorcery_objectset_create2(), ast_strings_equal(), ast_strlen_zero(), ast_variable_list_sort(), ast_variables_destroy(), config_object_type_profile, config_object_type_tn, config_object_type_verification, get_sorcery(), ast_variable::name, ast_variable::next, NULL, config_object_cli_data::object_type, options, print_acl_cert_store, config_object_cli_data::title, translate_value(), and ast_variable::value.
Referenced by attestation_show(), cli_eprofile_show(), cli_eprofile_show_all(), cli_profile_show(), cli_profile_show_all(), cli_tn_show(), cli_tn_show_all(), and cli_verification_show().
char * config_object_tab_complete_name | ( | const char * | word, |
struct ao2_container * | container | ||
) |
Tab completion for name matching with STIR/SHAKEN CLI commands.
word | The word to tab complete on |
container | The sorcery container to iterate through |
The | tab completion options |
Definition at line 240 of file common_config.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_cli_completion_add(), ast_sorcery_object_get_id(), ast_strdup, container, and NULL.
Referenced by cli_eprofile_show(), cli_profile_show(), cli_tn_show(), and cli_verify_cert().
generate_bool_handler_functions | ( | check_tn_cert_public_url | ) |
generate_bool_handler_functions | ( | load_system_certs | ) |
generate_bool_handler_functions | ( | relax_x5u_path_restrictions | ) |
generate_bool_handler_functions | ( | relax_x5u_port_scheme_restrictions | ) |
generate_bool_handler_functions | ( | send_mky | ) |
generate_bool_handler_functions | ( | use_rfc9410_responses | ) |
generate_enum_string_functions | ( | attest_level | , |
UNKNOWN | , | ||
{attest_level_NOT_SET, "not_set"} | , | ||
{attest_level_A, "A"} | , | ||
{attest_level_B, "B"} | , | ||
{attest_level_C, "C"} | |||
) |
generate_enum_string_functions | ( | endpoint_behavior | , |
OFF | , | ||
{endpoint_behavior_OFF, "off"} | , | ||
{endpoint_behavior_OFF, "none"} | , | ||
{endpoint_behavior_ATTEST, "attest"} | , | ||
{endpoint_behavior_VERIFY, "verify"} | , | ||
{endpoint_behavior_ON, "on"} | , | ||
{endpoint_behavior_ON, "both"} | |||
) |
generate_enum_string_functions | ( | stir_shaken_failure_action | , |
CONTINUE | , | ||
{stir_shaken_failure_action_CONTINUE, "continue"} | , | ||
{stir_shaken_failure_action_REJECT_REQUEST, "reject_request"} | , | ||
{stir_shaken_failure_action_CONTINUE_RETURN_REASON, "continue_return_reason"} | |||
) |
References stir_shaken_failure_action_CONTINUE.
struct ast_sorcery * get_sorcery | ( | void | ) |
Retrieve the stir/shaken sorcery context.
The | stir/shaken sorcery context |
Definition at line 34 of file common_config.c.
References sorcery.
Referenced by as_config_load(), as_config_reload(), as_get_cfg(), as_is_config_loaded(), config_object_cli_show(), create_effective_profile(), eprofile_get_all(), eprofile_get_cfg(), get_tn_all(), profile_get_all(), profile_get_cfg(), profile_load(), profile_reload(), tn_config_load(), tn_config_reload(), tn_get_cfg(), tn_get_etn(), vs_config_load(), vs_config_reload(), vs_get_cfg(), and vs_is_config_loaded().
|
static |
Definition at line 410 of file common_config.c.
References ast_log, ast_named_acl_change_type(), common_config_reload(), LOG_NOTICE, and stasis_message_type().
Referenced by common_config_load().
|
static |
Definition at line 135 of file common_config.c.
References ast_acl::acl, ast_cli(), ast_ha_output(), AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_strlen_zero(), ast_acl::list, and prefix.
|
static |
Definition at line 124 of file common_config.c.
Referenced by config_object_cli_show().
|
static |
Definition at line 365 of file common_config.c.
Referenced by common_config_load(), and common_config_unload().
struct stasis_subscription* named_acl_changed_sub = NULL |
Definition at line 32 of file common_config.c.
Referenced by common_config_load(), and common_config_unload().
|
static |
Definition at line 31 of file common_config.c.
Referenced by common_config_load(), common_config_unload(), and get_sorcery().