| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
#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. | |
| char * | canonicalize_tn_alloc (const char *tn) | 
| Canonicalize a TN into nre buffer. | |
| 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. | |
| char * | config_object_tab_complete_name (const char *word, struct ao2_container *container) | 
| Tab completion for name matching with STIR/SHAKEN CLI commands. | |
| generate_bool_handler_functions (check_tn_cert_public_url) | |
| generate_bool_handler_functions (ignore_sip_date_header) | |
| 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. | |
| 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 78 of file common_config.c.
| #define print_acl_cert_store | ( | cfg, | |
| a, | |||
| max_name_len | |||
| ) | 
Definition at line 152 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 267 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 294 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 303 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_chain_from_file(), NULL, profile_get_all(), profile_get_cfg(), RAII_VAR, crypto_cert_store::STACK_OF(), ast_cli_entry::usage, and vs_get_cfg().
| int common_config_load | ( | void | ) | 
Definition at line 425 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 374 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 396 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 173 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 241 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 | ( | ignore_sip_date_header | ) | 
| 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 415 of file common_config.c.
References ast_log, ast_named_acl_change_type(), common_config_reload(), and LOG_NOTICE.
Referenced by common_config_load().
| 
 | static | 
Definition at line 136 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 125 of file common_config.c.
Referenced by config_object_cli_show().
| 
 | static | 
Definition at line 370 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().