Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk/cli.h"
Go to the source code of this file.
Data Structures | |
struct | ast_sip_cli_context |
CLI Formatter Context passed to all formatters. More... | |
struct | ast_sip_cli_formatter_entry |
CLI Formatter Registry Entry. More... | |
Macros | |
#define | CLI_DETAIL_FILLER " " |
#define | CLI_HEADER_FILLER ".........................................................................................." |
#define | CLI_INDENT_TO_SPACES(x) ((x * 2) + 1 + CLI_MAX_TITLE_NAME) |
#define | CLI_LAST_TABSTOP 62 |
#define | CLI_MAX_TITLE_NAME 8 |
#define | CLI_MAX_WIDTH 90 |
Functions | |
int | ast_sip_cli_print_sorcery_objectset (void *obj, void *arg, int flags) |
Prints a sorcery object's ast_variable list. More... | |
char * | ast_sip_cli_traverse_objects (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
struct ast_sip_cli_formatter_entry * | ast_sip_lookup_cli_formatter (const char *name) |
Looks up a CLI formatter by type. More... | |
int | ast_sip_register_cli_formatter (struct ast_sip_cli_formatter_entry *formatter) |
Registers a CLI formatter. More... | |
int | ast_sip_unregister_cli_formatter (struct ast_sip_cli_formatter_entry *formatter) |
Unregisters a CLI formatter. More... | |
#define CLI_DETAIL_FILLER " " |
Definition at line 25 of file res_pjsip_cli.h.
#define CLI_HEADER_FILLER ".........................................................................................." |
Definition at line 24 of file res_pjsip_cli.h.
#define CLI_INDENT_TO_SPACES | ( | x | ) | ((x * 2) + 1 + CLI_MAX_TITLE_NAME) |
Definition at line 29 of file res_pjsip_cli.h.
#define CLI_LAST_TABSTOP 62 |
Definition at line 27 of file res_pjsip_cli.h.
#define CLI_MAX_TITLE_NAME 8 |
Definition at line 28 of file res_pjsip_cli.h.
#define CLI_MAX_WIDTH 90 |
Definition at line 26 of file res_pjsip_cli.h.
int ast_sip_cli_print_sorcery_objectset | ( | void * | obj, |
void * | arg, | ||
int | flags | ||
) |
Prints a sorcery object's ast_variable list.
obj | The sorcery object |
arg | The ast_sip_cli_context |
flags |
0 | Success, non-zero on failure |
Definition at line 36 of file pjsip_cli.c.
References ast_alloca, ast_sip_get_sorcery(), ast_sorcery_objectset_create, ast_str_append(), ast_variable_list_sort(), ast_variables_destroy(), voicemailpwcheck::context, ast_variable::name, ast_variable::next, and ast_variable::value.
Referenced by cli_aor_print_body(), cli_endpoint_print_body(), cli_print_body(), sip_cli_print_global(), and sip_cli_print_system().
char * ast_sip_cli_traverse_objects | ( | struct ast_cli_entry * | e, |
int | cmd, | ||
struct ast_cli_args * | a | ||
) |
Definition at line 109 of file pjsip_cli.c.
References a, ao2_callback, ao2_cleanup, ao2_container_count(), ast_cli(), ast_copy_string(), ast_ends_with(), ast_free, ast_log, ast_sip_lookup_cli_formatter(), ast_str_append(), ast_str_create, ast_strlen_zero(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::cmda, complete_show_sorcery_object(), container, voicemailpwcheck::context, dump_str_and_free(), LOG_ERROR, NULL, OBJ_NODATA, RAII_VAR, and regex().
Referenced by my_cli_traverse_objects().
struct ast_sip_cli_formatter_entry * ast_sip_lookup_cli_formatter | ( | const char * | name | ) |
Looks up a CLI formatter by type.
name | The name of the formatter, usually the sorcery object type. |
Pointer | to formatter entry structure |
Definition at line 305 of file pjsip_cli.c.
References ao2_find, formatter_registry, name, OBJ_NOLOCK, and OBJ_SEARCH_KEY.
Referenced by ast_sip_cli_traverse_objects(), cli_aor_print_body(), cli_aor_print_header(), cli_endpoint_print_child_body(), and cli_endpoint_print_child_header().
int ast_sip_register_cli_formatter | ( | struct ast_sip_cli_formatter_entry * | formatter | ) |
Registers a CLI formatter.
formatter | An ao2_callback_fn that outputs the formatted data. |
0 | Success, non-zero on failure |
Definition at line 310 of file pjsip_cli.c.
References ao2_link, ast_assert, formatter_registry, ast_sip_cli_formatter_entry::get_container, ast_sip_cli_formatter_entry::get_id, ast_sip_cli_formatter_entry::iterate, ast_sip_cli_formatter_entry::name, NULL, ast_sip_cli_formatter_entry::print_body, ast_sip_cli_formatter_entry::print_header, and ast_sip_cli_formatter_entry::retrieve_by_id.
Referenced by ast_res_pjsip_initialize_configuration(), ast_sip_initialize_distributor(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_sorcery_transport(), load_module(), and pjsip_channel_cli_register().
int ast_sip_unregister_cli_formatter | ( | struct ast_sip_cli_formatter_entry * | formatter | ) |
Unregisters a CLI formatter.
formatter | The name of the formatter, usually the sorcery object type. |
0 | Success, non-zero on failure |
Definition at line 326 of file pjsip_cli.c.
References ao2_ref, ao2_unlink_flags, ao2_unlock, ao2_wrlock, formatter_registry, and OBJ_NOLOCK.
Referenced by ast_res_pjsip_destroy_configuration(), ast_sip_destroy_distributor(), ast_sip_destroy_sorcery_auth(), ast_sip_destroy_sorcery_location(), ast_sip_destroy_sorcery_transport(), pjsip_channel_cli_unregister(), and unload_module().