Asterisk - The Open Source Telephony Project
GIT-master-a24979a
|
Standard Command Line Interface. More...
#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/paths.h"
#include <signal.h>
#include <ctype.h>
#include <regex.h>
#include <pwd.h>
#include <grp.h>
#include "asterisk/cli.h"
#include "asterisk/linkedlists.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/channel.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/lock.h"
#include "asterisk/threadstorage.h"
#include "asterisk/logger_category.h"
#include "asterisk/translate.h"
#include "asterisk/bridge.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_bridges.h"
#include "asterisk/vector.h"
#include "asterisk/stream.h"
Go to the source code of this file.
Data Structures | |
struct | channel_set_debug_args |
struct | cli_perm |
List of restrictions per user. More... | |
struct | cli_perm_head |
struct | cli_perms |
List of users and permissions. More... | |
struct | helpers |
struct | module_level |
map a debug or verbose level to a module name More... | |
struct | module_level_list |
struct | usergroup_cli_perm |
list of users to apply restrictions. More... | |
Macros | |
#define | AST_CLI_INITLEN 256 |
Initial buffer size for resulting strings in ast_cli() More... | |
#define | CONCISE_FORMAT_STRING "%s!%s!%s!%d!%s!%s!%s!%s!%s!%s!%d!%s!%s!%s\n" |
#define | DAY (HOUR*24) |
#define | DEBUG_HANDLER 0 |
#define | FORMAT_STRING "%-20.20s %-20.20s %-7.7s %-30.30s\n" |
#define | FORMAT_STRING "%-25s %-20s %-20s\n" |
#define | FORMAT_STRING2 "%-20.20s %-20.20s %-7.7s %-30.30s\n" |
#define | HOUR (MINUTE*60) |
#define | MINUTE (SECOND*60) |
#define | MODLIST_FORMAT "%-30s %-40.40s %-10d %-11s %13s\n" |
#define | MODLIST_FORMAT2 "%-30s %-40.40s %-10s %-11s %13s\n" |
#define | NEEDCOMMA(x) ((x) ? ", " : "") /* define if we need a comma */ |
#define | SECOND (1) |
#define | TRACE_HANDLER 1 |
#define | VERBOSE_FORMAT_STRING "%-20.20s %-20.20s %-16.16s %4d %-7.7s %-12.12s %-25.25s %-15.15s %8.8s %-11.11s %-11.11s %-20.20s\n" |
#define | VERBOSE_FORMAT_STRING2 "%-20.20s %-20.20s %-16.16s %-4.4s %-7.7s %-12.12s %-25.25s %-15.15s %8.8s %-11.11s %-11.11s %-20.20s\n" |
#define | VERBOSE_HANDLER 2 |
#define | WEEK (DAY*7) |
#define | YEAR (DAY*365) |
Functions | |
static char * | __ast_cli_generator (const char *text, const char *word, int state, int lock) |
int | __ast_cli_register (struct ast_cli_entry *e, struct ast_module *module) |
int | __ast_cli_register_multiple (struct ast_cli_entry *e, int len, struct ast_module *module) |
static void | __init_ast_cli_buf (void) |
static int | allowed_on_shutdown (struct ast_cli_entry *e) |
void | ast_builtins_init (void) |
initialize the _full_cmd string in * each of the builtins. More... | |
void | ast_cli (int fd, const char *fmt,...) |
int | ast_cli_allow_at_shutdown (struct ast_cli_entry *e) |
Allow a CLI command to be executed while Asterisk is shutting down. More... | |
int | ast_cli_command_full (int uid, int gid, int fd, const char *s) |
Interprets a command Interpret a command s, sending output to fd if uid:gid has permissions to run this command. uid = CLI_NO_PERMS to avoid checking user permissions gid = CLI_NO_PERMS to avoid checking group permissions. More... | |
int | ast_cli_command_multiple_full (int uid, int gid, int fd, size_t size, const char *s) |
Executes multiple CLI commands Interpret strings separated by NULL and execute each one, sending output to fd if uid has permissions, uid = CLI_NO_PERMS to avoid checking users permissions. gid = CLI_NO_PERMS to avoid checking group permissions. More... | |
char * | ast_cli_complete (const char *word, const char *const choices[], int state) |
int | ast_cli_completion_add (char *value) |
Add a result to a request for completion options. More... | |
char ** | ast_cli_completion_matches (const char *text, const char *word) |
Generates a NULL-terminated array of strings that 1) begin with the string in the second parameter, and 2) are valid in a command after the string in the first parameter. More... | |
struct ast_vector_string * | ast_cli_completion_vector (const char *text, const char *word) |
Generates a vector of strings for CLI completion. More... | |
char * | ast_cli_generator (const char *text, const char *word, int state) |
Readline madness Useful for readline, that's about it. More... | |
int | ast_cli_perms_init (int reload) |
void | ast_cli_print_timestr_fromseconds (int fd, int seconds, const char *prefix) |
Print on cli a duration in seconds in format s year(s), s week(s), s day(s), s hour(s), s second(s) More... | |
int | ast_cli_unregister (struct ast_cli_entry *e) |
Unregisters a command or an array of commands. More... | |
int | ast_cli_unregister_multiple (struct ast_cli_entry *e, int len) |
Unregister multiple commands. More... | |
char * | ast_complete_channels (const char *line, const char *word, int pos, int state, int rpos) |
Command completion for the list of active channels. More... | |
unsigned int | ast_debug_get_by_module (const char *module) |
Get the debug level for a module. More... | |
AST_THREADSTORAGE_RAW (completion_storage) | |
unsigned int | ast_trace_get_by_module (const char *module) |
Get the trace level for a module. More... | |
static int | channel_set_debug (void *obj, void *arg, void *data, int flags) |
static int | cli_completion_vector_add (struct ast_vector_string *vec, char *value) |
static int | cli_has_permissions (int uid, int gid, const char *command) |
static int | cli_is_registered (struct ast_cli_entry *e) |
static struct ast_cli_entry * | cli_next (struct ast_cli_entry *e) |
static void | cli_shutdown (void) |
static char * | complete_number (const char *partial, unsigned int min, unsigned int max, int n) |
static void | destroy_user_perms (void) |
cleanup (free) cli_perms linkedlist. More... | |
static char * | find_best (const char *argv[]) |
static struct ast_cli_entry * | find_cli (const char *const cmds[], int match_type) |
static struct module_level * | find_module_level (const char *module, struct module_level_list *mll) |
Find the module level setting. More... | |
static char * | group_show_channels (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_chanlist (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_check_permissions (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
handles CLI command 'cli check permissions' More... | |
static char * | handle_cli_malloc_trim (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_reload_permissions (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
handles CLI command 'cli reload permissions' More... | |
static char * | handle_cli_show_permissions (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
handles CLI command 'cli show permissions' More... | |
static char * | handle_cli_wait_fullybooted (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_commandmatchesarray (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_core_reload (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_core_set_debug_channel (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_debug (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_debug_category (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_debug_or_trace (int handler, struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_help (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_load (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_logger_mute (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_modlist (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_nodebugchan_deprecated (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_refresh (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_reload (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_showcalls (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_showchan (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_showuptime (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_softhangup (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_trace (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_unload (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_verbose (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | help1 (int fd, const char *const match[], int locked) |
helper for final part of handle_help if locked = 1, assume the list is already locked More... | |
static char * | is_prefix (const char *word, const char *token, int pos, int *actual) |
if word is a valid prefix for token, returns the pos-th match as a malloced string, or NULL otherwise. Always tell in *actual how many matches we got. More... | |
static int | modlist_modentry (const char *module, const char *description, int usecnt, const char *status, const char *like, enum ast_module_support_level support_level) |
static int | more_words (const char *const *dst) |
returns true if there are more words to match More... | |
static char * | parse_args (const char *s, int *argc, const char *argv[], int max, int *trailingwhitespace) |
static void | print_uptimestr (int fd, struct timeval timeval, const char *prefix, int printsec) |
static void | remove_shutdown_command (struct ast_cli_entry *e) |
static int | set_full_cmd (struct ast_cli_entry *e) |
static void | status_debug_verbose (struct ast_cli_args *a, int handler, int old_val, int cur_val) |
static int | word_match (const char *cmd, const char *cli_word) |
Variables | |
static struct ast_threadstorage | ast_cli_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_ast_cli_buf , .custom_init = NULL , } |
static struct ast_cli_entry | cli_cli [] |
static int | cli_default_perm = 1 |
Default permissions value 1=Permit 0=Deny. More... | |
static struct cli_perms | cli_perms = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static const char | cli_rsvd [] = "[]{}|*%" |
static int | climodentryfd = -1 |
static ast_mutex_t | climodentrylock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
static struct module_level_list | debug_modules = AST_RWLIST_HEAD_INIT_VALUE |
static struct helpers | helpers = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static const char | perms_config [] = "cli_permissions.conf" |
CLI permissions config file. More... | |
static ast_mutex_t | permsconfiglock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
mutex used to prevent a user from running the 'cli reload permissions' command while it is already running. More... | |
struct { | |
size_t current | |
struct ast_cli_entry ** elems | |
size_t max | |
} | shutdown_commands |
static ast_rwlock_t | shutdown_commands_lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } |
static struct module_level_list | trace_modules = AST_RWLIST_HEAD_INIT_VALUE |
Standard Command Line Interface.
Definition in file main/cli.c.
#define AST_CLI_INITLEN 256 |
Initial buffer size for resulting strings in ast_cli()
Definition at line 116 of file main/cli.c.
#define CONCISE_FORMAT_STRING "%s!%s!%s!%d!%s!%s!%s!%s!%s!%s!%d!%s!%s!%s\n" |
#define DAY (HOUR*24) |
#define DEBUG_HANDLER 0 |
Definition at line 403 of file main/cli.c.
#define FORMAT_STRING "%-20.20s %-20.20s %-7.7s %-30.30s\n" |
#define FORMAT_STRING "%-25s %-20s %-20s\n" |
#define FORMAT_STRING2 "%-20.20s %-20.20s %-7.7s %-30.30s\n" |
#define HOUR (MINUTE*60) |
#define MINUTE (SECOND*60) |
#define MODLIST_FORMAT "%-30s %-40.40s %-10d %-11s %13s\n" |
Definition at line 889 of file main/cli.c.
#define MODLIST_FORMAT2 "%-30s %-40.40s %-10s %-11s %13s\n" |
Definition at line 890 of file main/cli.c.
#define SECOND (1) |
#define TRACE_HANDLER 1 |
Definition at line 404 of file main/cli.c.
#define VERBOSE_FORMAT_STRING "%-20.20s %-20.20s %-16.16s %4d %-7.7s %-12.12s %-25.25s %-15.15s %8.8s %-11.11s %-11.11s %-20.20s\n" |
#define VERBOSE_FORMAT_STRING2 "%-20.20s %-20.20s %-16.16s %-4.4s %-7.7s %-12.12s %-25.25s %-15.15s %8.8s %-11.11s %-11.11s %-20.20s\n" |
#define VERBOSE_HANDLER 2 |
Definition at line 405 of file main/cli.c.
#define WEEK (DAY*7) |
#define YEAR (DAY*365) |
|
static |
Definition at line 2863 of file main/cli.c.
References a, ast_cli_args::argv, ARRAY_LEN, ast_free, ast_join, AST_MAX_ARGS, ast_module_running_ref, ast_module_unref, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_strlen_zero(), CLI_GENERATE, cli_next(), ast_cli_entry::cmda, ast_cli_entry::command, ast_cli_entry::handler, is_prefix(), lock, ast_cli_entry::module, more_words(), NULL, parse_args(), text, and word_match().
Referenced by ast_cli_generator(), and handle_help().
int __ast_cli_register | ( | struct ast_cli_entry * | e, |
struct ast_module * | module | ||
) |
Definition at line 2454 of file main/cli.c.
References ast_cli_entry::_full_cmd, a, ast_free, ast_log, AST_MAX_CMD_LEN, AST_RWLIST_INSERT_BEFORE_CURRENT, AST_RWLIST_INSERT_TAIL, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_skip_blanks(), ast_skip_nonblanks(), ast_strdup, ast_strlen_zero(), CLI_INIT, cli_is_registered(), ast_cli_entry::cmda, ast_cli_entry::cmdlen, ast_cli_entry::command, done, find_cli(), ast_cli_entry::handler, len(), LOG_WARNING, ast_cli_entry::module, NULL, S_OR, and set_full_cmd().
Referenced by __ast_cli_register_multiple().
int __ast_cli_register_multiple | ( | struct ast_cli_entry * | e, |
int | len, | ||
struct ast_module * | module | ||
) |
Definition at line 2531 of file main/cli.c.
References __ast_cli_register(), and len().
|
static |
Definition at line 110 of file main/cli.c.
|
static |
Definition at line 2956 of file main/cli.c.
References ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, shutdown_commands, and shutdown_commands_lock.
Referenced by ast_cli_command_full().
void ast_builtins_init | ( | void | ) |
initialize the _full_cmd string in * each of the builtins.
Provided by cli.c
Definition at line 2243 of file main/cli.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_register_cleanup(), AST_VECTOR_INIT, cli_cli, cli_shutdown(), and shutdown_commands.
Referenced by asterisk_daemon().
void ast_cli | ( | int | fd, |
const char * | fmt, | ||
... | |||
) |
Definition at line 118 of file main/cli.c.
References ast_carefulwrite(), ast_cli_buf, AST_CLI_INITLEN, AST_DYNSTR_BUILD_FAILED, ast_str_buffer(), ast_str_set_va(), ast_str_strlen(), ast_str_thread_get(), and buf.
Referenced by ast_cli_command_full(), channel_set_debug(), group_show_channels(), handle_chanlist(), handle_cli_check_permissions(), handle_cli_malloc_trim(), handle_cli_show_permissions(), handle_cli_wait_fullybooted(), handle_commandmatchesarray(), handle_core_set_debug_channel(), handle_debug_or_trace(), handle_help(), handle_load(), handle_modlist(), handle_refresh(), handle_reload(), handle_showcalls(), handle_showchan(), handle_softhangup(), handle_unload(), help1(), modlist_modentry(), print_uptimestr(), and status_debug_verbose().
int ast_cli_allow_at_shutdown | ( | struct ast_cli_entry * | e | ) |
Allow a CLI command to be executed while Asterisk is shutting down.
CLI commands by defeault are disabled when Asterisk is shutting down. This is to ensure the safety of the shutdown since CLI commands may attempt to access resources that have been freed as a result of the shutdown.
If a CLI command should be allowed at shutdown, then the best way to enable this is to call ast_cli_allow_at_shutdown during the CLI_INIT state of the CLI handler.
Definition at line 3060 of file main/cli.c.
References ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_APPEND, shutdown_commands, and shutdown_commands_lock.
Referenced by handle_abort_shutdown(), handle_restart_gracefully(), handle_restart_now(), handle_restart_when_convenient(), handle_stop_gracefully(), handle_stop_now(), and handle_stop_when_convenient().
int ast_cli_command_full | ( | int | uid, |
int | gid, | ||
int | fd, | ||
const char * | s | ||
) |
Interprets a command Interpret a command s, sending output to fd if uid:gid has permissions to run this command. uid = CLI_NO_PERMS to avoid checking user permissions gid = CLI_NO_PERMS to avoid checking group permissions.
uid | User ID that is trying to run the command. |
gid | Group ID that is trying to run the command. |
fd | pipe |
s | incoming string |
0 | on success |
-1 | on failure |
Definition at line 2973 of file main/cli.c.
References a, allowed_on_shutdown(), args, ast_atomic_fetchadd_int(), ast_cli(), ast_free, ast_join, AST_MAX_ARGS, ast_module_running_ref, ast_module_unref, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_shutting_down(), CLI_FAILURE, CLI_HANDLER, cli_has_permissions(), CLI_SHOWUSAGE, CLI_SUCCESS, done, ast_cli_args::fd, find_best(), find_cli(), ast_cli_entry::handler, ast_cli_entry::inuse, ast_cli_entry::module, NULL, parse_args(), RESULT_FAILURE, RESULT_SUCCESS, retval, S_OR, tmp(), and ast_cli_entry::usage.
Referenced by ast_cli_command_multiple_full().
int ast_cli_command_multiple_full | ( | int | uid, |
int | gid, | ||
int | fd, | ||
size_t | size, | ||
const char * | s | ||
) |
Executes multiple CLI commands Interpret strings separated by NULL and execute each one, sending output to fd if uid has permissions, uid = CLI_NO_PERMS to avoid checking users permissions. gid = CLI_NO_PERMS to avoid checking group permissions.
uid | User ID that is trying to run the command. |
gid | Group ID that is trying to run the command. |
fd | pipe |
size | is the total size of the string |
s | incoming string |
Definition at line 3038 of file main/cli.c.
References ast_cli_command_full(), and ast_cli_args::fd.
Referenced by netconsole().
char* ast_cli_complete | ( | const char * | word, |
const char *const | choices[], | ||
int | pos | ||
) |
Helper function to generate cli entries from a NULL-terminated array. Returns the n-th matching entry from the array, or NULL if not found. Can be used to implement generate() for static entries as below (in this example we complete the word in position 2):
Definition at line 1843 of file main/cli.c.
References ast_cli_completion_add(), ast_strdup, ast_strlen_zero(), len(), and NULL.
Referenced by cli_odbc_read(), complete_skinny_reset(), complete_skinny_show_line(), handle_bridge_kick_channel(), handle_cli_iax2_prune_realtime(), handle_core_set_debug_channel(), handle_orig(), handle_showcalls(), handle_softhangup(), sip_prune_realtime(), sip_qualify_peer(), sip_show_peer(), sip_show_user(), and sorcery_memory_cache_stale().
int ast_cli_completion_add | ( | char * | value | ) |
Add a result to a request for completion options.
value | A completion option text. |
0 | Success |
-1 | Failure |
This is an alternative to returning individual values from CLI_GENERATE. Instead of repeatedly being asked for the next match and having to start over, you can call this function repeatedly from your own stateful loop. When all matches have been added you can return NULL from the CLI_GENERATE function.
Definition at line 2760 of file main/cli.c.
References ast_threadstorage_get_ptr(), cli_completion_vector_add(), and value.
Referenced by aeap_tab_complete_name(), ast_cli_complete(), ast_complete_applications(), ast_complete_channels(), category_complete(), cli_complete_endpoint(), cli_complete_show(), cli_complete_uri(), complete_bridge_live_search(), complete_bridge_participant(), complete_bridge_technology(), complete_channeltypes(), complete_config_module(), complete_config_option(), complete_config_type(), complete_core_id(), complete_country(), complete_indications(), complete_show_sorcery_object(), complete_trans_path_choice(), handle_cli_config_reload(), handle_debug_category(), handle_showmanager(), handle_showmancmd(), module_load_helper_on_file(), stir_shaken_tab_complete_name(), topic_complete_name(), and tps_taskprocessor_tab_complete().
char** ast_cli_completion_matches | ( | const char * | text, |
const char * | word | ||
) |
Generates a NULL-terminated array of strings that 1) begin with the string in the second parameter, and 2) are valid in a command after the string in the first parameter.
The first entry (offset 0) of the result is the longest common substring in the results, useful to extend the string that has been completed. Subsequent entries are all possible values, followed by a NULL. All strings and the array itself are malloc'ed and must be freed by the caller.
Definition at line 2704 of file main/cli.c.
References ast_cli_completion_vector(), ast_free, AST_VECTOR_APPEND, AST_VECTOR_CALLBACK_VOID, AST_VECTOR_PTR_FREE, AST_VECTOR_STEAL_ELEMENTS, NULL, and text.
Referenced by handle_commandmatchesarray().
struct ast_vector_string* ast_cli_completion_vector | ( | const char * | text, |
const char * | word | ||
) |
Generates a vector of strings for CLI completion.
text | Complete input being matched. |
word | Current word being matched |
The results contain strings that both: 1) Begin with the string in word. 2) Are valid in a command after the string in text.
The first entry (offset 0) of the result is the longest common substring in the results, useful to extend the string that has been completed. Subsequent entries are all possible values.
Definition at line 2765 of file main/cli.c.
References ast_assert, ast_calloc, ast_cli_generator(), ast_free, ast_log, ast_strndup, ast_threadstorage_get_ptr(), ast_threadstorage_set_ptr(), AST_VECTOR_CALLBACK_VOID, AST_VECTOR_GET, AST_VECTOR_INSERT_AT, AST_VECTOR_PTR_FREE, AST_VECTOR_REMOVE, AST_VECTOR_SIZE, cli_completion_vector_add(), LOG_ERROR, NULL, and text.
Referenced by ast_cli_completion_matches(), AST_TEST_DEFINE(), and cli_complete().
char* ast_cli_generator | ( | const char * | text, |
const char * | word, | ||
int | state | ||
) |
Readline madness Useful for readline, that's about it.
0 | on success |
-1 | on failure |
Only call this function to proxy the CLI generator to another.
Definition at line 2951 of file main/cli.c.
References __ast_cli_generator(), and text.
Referenced by ast_cli_completion_vector(), cli_alias_passthrough(), and handle_cli_check_permissions().
int ast_cli_perms_init | ( | int | reload | ) |
Provided by cli.c
Definition at line 2115 of file main/cli.c.
References ast_calloc, ast_category_browse(), ast_config_destroy(), ast_config_load2(), ast_free, AST_LIST_INSERT_TAIL, AST_LIST_TRAVERSE, ast_log, ast_mutex_trylock, ast_mutex_unlock, AST_RWLIST_INSERT_TAIL, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_strdup, ast_strlen_zero(), ast_variable_browse(), cli_default_perm, cli_perm::command, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEUNCHANGED, destroy_user_perms(), usergroup_cli_perm::gid, LOG_NOTICE, LOG_WARNING, ast_variable::name, ast_variable::next, NULL, cli_perm::permit, usergroup_cli_perm::perms, perms_config, permsconfiglock, reload(), usergroup_cli_perm::uid, and ast_variable::value.
Referenced by asterisk_daemon(), and handle_cli_reload_permissions().
void ast_cli_print_timestr_fromseconds | ( | int | fd, |
int | seconds, | ||
const char * | prefix | ||
) |
Print on cli a duration in seconds in format s year(s), s week(s), s day(s), s hour(s), s second(s)
fd | fd to print by ast_cli |
seconds | The time (in seconds) to print |
prefix | A Prefix string to add before of duration formatted |
Definition at line 3055 of file main/cli.c.
References ast_tv(), ast_cli_args::fd, prefix, and print_uptimestr().
Referenced by handle_cdr_pgsql_status().
int ast_cli_unregister | ( | struct ast_cli_entry * | e | ) |
Unregisters a command or an array of commands.
e | which cli entry to unregister Unregister your own command. You must pass a completed ast_cli_entry structure |
Definition at line 2431 of file main/cli.c.
References ast_cli_entry::_full_cmd, ast_free, ast_log, AST_RWLIST_REMOVE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_cli_entry::cmda, ast_cli_entry::command, ast_cli_entry::handler, ast_cli_entry::inuse, ast_cli_entry::list, LOG_WARNING, NULL, remove_shutdown_command(), and ast_cli_entry::usage.
Referenced by aco_deinit(), alias_unregister_cb(), ast_cli_unregister_multiple(), unload_module(), and xmldoc_unload_documentation().
int ast_cli_unregister_multiple | ( | struct ast_cli_entry * | e, |
int | len | ||
) |
Unregister multiple commands.
e | pointer to first cli entry to unregister |
len | number of entries to unregister |
Definition at line 2542 of file main/cli.c.
References ast_cli_unregister(), and len().
Referenced by cli_shutdown().
char* ast_complete_channels | ( | const char * | line, |
const char * | word, | ||
int | pos, | ||
int | state, | ||
int | rpos | ||
) |
Command completion for the list of active channels.
This can be called from a CLI command completion function that wants to complete from the list of active channels. 'rpos' is the required position in the command. This function will return NULL immediately if 'rpos' is not the same as the current position, 'pos'.
Definition at line 1862 of file main/cli.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_channel_cache_all(), ast_cli_completion_add(), ast_strdup, ast_channel_snapshot::base, ast_channel_snapshot_base::name, NULL, and state.
Referenced by handle_cli_agi_add_cmd(), handle_cli_mixmonitor(), handle_core_set_debug_channel(), handle_redirect(), handle_remb_set(), handle_set_chanvar(), handle_show_chanvar(), handle_show_hangup_channel(), handle_showchan(), and handle_softhangup().
unsigned int ast_debug_get_by_module | ( | const char * | module | ) |
Get the debug level for a module.
module | the name of module |
Definition at line 136 of file main/cli.c.
References AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, debug_modules, and module_level::level.
AST_THREADSTORAGE_RAW | ( | completion_storage | ) |
unsigned int ast_trace_get_by_module | ( | const char * | module | ) |
Get the trace level for a module.
module | the name of module |
Definition at line 153 of file main/cli.c.
References AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, module_level::level, and trace_modules.
|
static |
Definition at line 1484 of file main/cli.c.
References args, ast_channel_fin(), ast_channel_fin_set(), ast_channel_fout(), ast_channel_fout_set(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_cli(), and DEBUGCHAN_FLAG.
Referenced by handle_core_set_debug_channel().
|
static |
Definition at line 2739 of file main/cli.c.
References ast_free, ast_threadstorage_set_ptr(), AST_VECTOR_ADD_SORTED, AST_VECTOR_CALLBACK_VOID, AST_VECTOR_FREE, NULL, and value.
Referenced by ast_cli_completion_add(), and ast_cli_completion_vector().
|
static |
Definition at line 183 of file main/cli.c.
References AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, cli_default_perm, CLI_NO_PERMS, cli_perm::command, usergroup_cli_perm::gid, cli_perm::list, NULL, cli_perm::permit, usergroup_cli_perm::perms, and usergroup_cli_perm::uid.
Referenced by ast_cli_command_full(), and handle_cli_check_permissions().
|
static |
Definition at line 2412 of file main/cli.c.
References cli_next(), and NULL.
Referenced by __ast_cli_register().
|
static |
Definition at line 961 of file main/cli.c.
References AST_LIST_FIRST, AST_LIST_NEXT, and ast_cli_entry::list.
Referenced by __ast_cli_generator(), cli_is_registered(), find_cli(), handle_cli_check_permissions(), and help1().
|
static |
Definition at line 2237 of file main/cli.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), and cli_cli.
Referenced by ast_builtins_init().
|
static |
Definition at line 363 of file main/cli.c.
References ast_strdup, ast_strlen_zero(), max, min, and NULL.
Referenced by handle_debug(), handle_trace(), and handle_verbose().
|
static |
cleanup (free) cli_perms linkedlist.
Definition at line 2099 of file main/cli.c.
References ast_free, AST_LIST_REMOVE_HEAD, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, cli_perm::command, usergroup_cli_perm::list, and usergroup_cli_perm::perms.
Referenced by ast_cli_perms_init().
|
static |
Definition at line 2394 of file main/cli.c.
References ast_join, AST_MAX_CMD_LEN, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, find_cli(), and NULL.
Referenced by ast_cli_command_full().
|
static |
Definition at line 2350 of file main/cli.c.
References ast_strlen_zero(), cli_next(), NULL, and word_match().
Referenced by __ast_cli_register(), ast_cli_command_full(), find_best(), and handle_help().
|
static |
Find the module level setting.
module | Module name to look for. |
mll | List to search. |
level | struct found on success. |
NULL | not found. |
Definition at line 351 of file main/cli.c.
References AST_LIST_TRAVERSE, and NULL.
Referenced by handle_debug_or_trace().
|
static |
Definition at line 1897 of file main/cli.c.
References a, ast_app_group_list_head(), ast_app_group_list_rdlock(), ast_app_group_list_unlock(), ast_channel_name(), ast_cli(), AST_LIST_NEXT, ast_strlen_zero(), ast_group_info::category, ast_group_info::chan, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ESS, FORMAT_STRING, ast_group_info::group, ast_group_info::group_list, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1099 of file main/cli.c.
References a, ast_channel_snapshot_peer::account, ast_channel_snapshot_base::accountcode, ast_channel_snapshot::amaflags, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_channel_snapshot_dialplan::appl, ast_cli_entry::args, ast_active_calls(), ast_active_channels(), ast_channel_cache_by_name(), ast_cli(), ast_option_maxcalls, ast_processed_calls(), ast_state2str(), ast_strlen_zero(), ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), ast_channel_snapshot::base, ast_channel_snapshot::bridge, ast_channel_snapshot::caller, channels, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, CONCISE_FORMAT_STRING, ast_channel_snapshot_dialplan::context, ast_channel_snapshot_base::creationtime, ast_channel_snapshot_dialplan::data, ast_channel_snapshot::dialplan, ESS, ast_channel_snapshot_dialplan::exten, FORMAT_STRING, FORMAT_STRING2, ast_channel_snapshot_bridge::id, ast_channel_snapshot_base::name, NULL, ast_channel_snapshot_caller::number, ast_channel_snapshot::peer, ast_channel_snapshot_dialplan::priority, S_OR, ast_channel_snapshot::state, ast_channel_snapshot_base::uniqueid, ast_cli_entry::usage, VERBOSE_FORMAT_STRING, and VERBOSE_FORMAT_STRING2.
|
static |
handles CLI command 'cli check permissions'
Definition at line 1348 of file main/cli.c.
References ast_cli_entry::_full_cmd, a, ast_cli(), ast_cli_generator(), ast_join, AST_MAX_ARGS, ast_strdupa, ast_strlen_zero(), CLI_FAILURE, CLI_GENERATE, cli_has_permissions(), CLI_INIT, cli_next(), CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, S_OR, ast_cli_entry::summary, tmp(), and ast_cli_entry::usage.
|
static |
Definition at line 1988 of file main/cli.c.
References a, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
handles CLI command 'cli reload permissions'
Definition at line 1329 of file main/cli.c.
References ast_cli_perms_init(), CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
handles CLI command 'cli show permissions'
Definition at line 1284 of file main/cli.c.
References a, ast_cli(), AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, cli_perm::command, usergroup_cli_perm::gid, NULL, cli_perm::permit, usergroup_cli_perm::perms, usergroup_cli_perm::uid, and ast_cli_entry::usage.
|
static |
Definition at line 1951 of file main/cli.c.
References a, ast_cli(), AST_OPT_FLAG_FULLY_BOOTED, ast_options, ast_test_flag, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1425 of file main/cli.c.
References a, ast_cli(), AST_CLI_COMPLETE_EOF, ast_cli_completion_matches(), ast_free, ast_malloc, ast_realloc, buf, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, len(), NULL, and ast_cli_entry::usage.
|
static |
Definition at line 319 of file main/cli.c.
References a, ast_cli_entry::args, ast_module_reload(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1508 of file main/cli.c.
References a, ast_cli_entry::args, args, ast_channel_callback(), ast_channel_get_by_name(), ast_channel_unref, ast_cli(), ast_cli_complete(), ast_complete_channels(), c, channel_set_debug(), CLI_GENERATE, CLI_HANDLER, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, DEBUGCHAN_FLAG, global_fin, global_fout, NULL, OBJ_MULTIPLE, OBJ_NODATA, and ast_cli_entry::usage.
Referenced by handle_nodebugchan_deprecated().
|
static |
Definition at line 572 of file main/cli.c.
References a, ast_module_helper(), AST_MODULE_HELPER_RUNNING, ast_strdup, ast_strlen_zero(), CLI_GENERATE, CLI_INIT, ast_cli_entry::command, complete_number(), DEBUG_HANDLER, handle_debug_or_trace(), NULL, S_OR, and ast_cli_entry::usage.
|
static |
Definition at line 1574 of file main/cli.c.
References a, ast_cli_entry::args, ast_cli_completion_add(), ast_debug_category_complete(), ast_debug_category_set_sublevels(), AST_LOG_CATEGORY_DISABLED, AST_LOG_CATEGORY_ENABLED, ast_strdup, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, S_OR, and ast_cli_entry::usage.
|
static |
Definition at line 449 of file main/cli.c.
References a, ast_cli_entry::args, ast_calloc, ast_clear_flag, ast_cli(), ast_free, AST_OPT_FLAG_DEBUG_MODULE, AST_OPT_FLAG_TRACE_MODULE, ast_options, AST_RWLIST_EMPTY, AST_RWLIST_INSERT_TAIL, AST_RWLIST_REMOVE, AST_RWLIST_REMOVE_HEAD, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_set_flag, ast_strdupa, CLI_FAILURE, CLI_SHOWUSAGE, CLI_SUCCESS, DEBUG_HANDLER, debug_modules, find_module_level(), handler(), module_level::level, option_debug, option_trace, status_debug_verbose(), and trace_modules.
Referenced by handle_debug(), and handle_trace().
|
static |
Definition at line 2586 of file main/cli.c.
References __ast_cli_generator(), a, ast_cli_entry::args, ast_cli(), ast_join, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, find_cli(), help1(), NULL, and ast_cli_entry::usage.
|
static |
Definition at line 240 of file main/cli.c.
References a, ast_cli_entry::args, ast_cli(), ast_load_resource(), ast_module_helper(), AST_MODULE_HELPER_LOAD, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 783 of file main/cli.c.
References a, ast_console_toggle_mute(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1003 of file main/cli.c.
References a, ast_cli_entry::args, ast_cli(), ast_module_helper(), AST_MODULE_HELPER_LOADED, ast_mutex_lock, ast_mutex_unlock, ast_update_module_list(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, climodentryfd, climodentrylock, ast_cli_entry::command, MODLIST_FORMAT2, modlist_modentry(), NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1615 of file main/cli.c.
References a, ast_cli_entry::args, CLI_HANDLER, CLI_INIT, CLI_SHOWUSAGE, ast_cli_entry::command, handle_core_set_debug_channel(), and NULL.
|
static |
Definition at line 808 of file main/cli.c.
References a, ast_cli_entry::args, ast_cli(), AST_FORCE_SOFT, ast_load_resource(), ast_module_helper(), AST_MODULE_HELPER_UNLOAD, ast_unload_resource(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 268 of file main/cli.c.
References a, ast_cli_entry::args, ast_cli(), ast_module_helper(), AST_MODULE_HELPER_RELOAD, ast_module_reload(), AST_MODULE_RELOAD_ERROR, AST_MODULE_RELOAD_IN_PROGRESS, AST_MODULE_RELOAD_NOT_FOUND, AST_MODULE_RELOAD_NOT_IMPLEMENTED, AST_MODULE_RELOAD_QUEUED, AST_MODULE_RELOAD_SUCCESS, AST_MODULE_RELOAD_UNINITIALIZED, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1043 of file main/cli.c.
References a, ast_cli_entry::args, ast_active_calls(), ast_cli(), ast_cli_complete(), ast_option_maxcalls, ast_processed_calls(), ast_startuptime, ast_tvnow(), ast_tvsub(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, ast_cli_entry::command, ESS, NULL, print_uptimestr(), RESULT_SUCCESS, and ast_cli_entry::usage.
|
static |
< Buffer for CDR variables.
< Accumulation buffer for all output.
Definition at line 1642 of file main/cli.c.
References a, ao2_cleanup, ast_callid_strnprint(), ast_cdr_serialize_variables(), AST_CHAN_TP_INTERNAL, ast_channel_appl(), ast_channel_caller(), ast_channel_callgroup(), ast_channel_callid(), ast_channel_connected(), ast_channel_connected_effective_id(), ast_channel_context(), ast_channel_creationtime(), ast_channel_data(), ast_channel_dialed(), ast_channel_exten(), ast_channel_get_bridge(), ast_channel_get_by_name(), ast_channel_get_stream_topology(), ast_channel_language(), ast_channel_linkedid(), ast_channel_lock, ast_channel_name(), ast_channel_nativeformats(), ast_channel_pickupgroup(), ast_channel_priority(), ast_channel_readformat(), ast_channel_readtrans(), ast_channel_tech(), ast_channel_uniqueid(), ast_channel_unlock, ast_channel_unref, ast_channel_varshead(), ast_channel_whentohangup(), ast_channel_writeformat(), ast_channel_writetrans(), ast_cli(), ast_codec_media_type2str(), ast_complete_channels(), ast_format_cap_get_names(), AST_FORMAT_CAP_NAMES_LEN, ast_format_get_name(), ast_free, AST_LIST_TRAVERSE, ast_state2str(), ast_str_alloca, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_strlen(), ast_str_thread_get(), ast_stream_get_formats(), ast_stream_get_group(), ast_stream_get_metadata_list(), ast_stream_get_name(), ast_stream_get_state(), ast_stream_get_type(), ast_stream_state2str(), ast_stream_topology_get_count(), ast_stream_topology_get_stream(), ast_translate_path_to_str(), ast_tvnow(), ast_tvzero(), ast_var_name(), ast_var_value(), ast_variables_destroy(), ast_bridge::callid, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, min, name, ast_variable::name, ast_variable::next, NULL, S_COR, S_OR, type, ast_bridge::uniqueid, ast_cli_entry::usage, ast_variable::value, and var.
|
static |
Definition at line 970 of file main/cli.c.
References a, ast_cli_entry::args, ast_lastreloadtime, ast_startuptime, ast_tvnow(), ast_tvsub(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, print_uptimestr(), and ast_cli_entry::usage.
|
static |
Definition at line 1227 of file main/cli.c.
References a, ast_cli_entry::args, ast_channel_get_by_name(), ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_channel_unref, ast_cli(), ast_cli_complete(), ast_complete_channels(), ast_softhangup(), AST_SOFTHANGUP_EXPLICIT, c, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 630 of file main/cli.c.
References a, ast_module_helper(), AST_MODULE_HELPER_RUNNING, ast_strdup, ast_strlen_zero(), CLI_GENERATE, CLI_INIT, ast_cli_entry::command, complete_number(), handle_debug_or_trace(), NULL, S_OR, TRACE_HANDLER, and ast_cli_entry::usage.
|
static |
Definition at line 840 of file main/cli.c.
References a, ast_cli_entry::args, ast_cli(), AST_FORCE_FIRM, AST_FORCE_HARD, AST_FORCE_SOFT, ast_module_helper(), AST_MODULE_HELPER_UNLOAD, ast_unload_resource(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 683 of file main/cli.c.
References a, ast_cli_entry::args, ast_strdup, ast_strlen_zero(), ast_verb_console_get(), ast_verb_console_set(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_number(), NULL, S_OR, status_debug_verbose(), ast_cli_entry::usage, and VERBOSE_HANDLER.
|
static |
helper for final part of handle_help if locked = 1, assume the list is already locked
Definition at line 2556 of file main/cli.c.
References ast_cli_entry::_full_cmd, ast_cli(), ast_join, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, cli_next(), CLI_SUCCESS, len(), match(), NULL, S_OR, and ast_cli_entry::summary.
Referenced by handle_help().
|
static |
if word is a valid prefix for token, returns the pos-th match as a malloced string, or NULL otherwise. Always tell in *actual how many matches we got.
Definition at line 2300 of file main/cli.c.
References ast_strdup, ast_strdupa, ast_strlen_zero(), cli_rsvd, NULL, strsep(), and t1.
Referenced by __ast_cli_generator().
|
static |
Definition at line 895 of file main/cli.c.
References ast_cli(), ast_module_support_level_to_string(), climodentryfd, MODLIST_FORMAT, status, strcasestr(), and usecnt.
Referenced by handle_modlist().
|
static |
returns true if there are more words to match
Definition at line 2850 of file main/cli.c.
Referenced by __ast_cli_generator().
|
static |
Definition at line 2632 of file main/cli.c.
References ast_log, ast_strdup, dummy(), LOG_WARNING, max, and NULL.
Referenced by __ast_cli_generator(), and ast_cli_command_full().
|
static |
Definition at line 908 of file main/cli.c.
References ast_cli(), ast_str_alloca, ast_str_append(), ast_str_buffer(), ast_str_strlen(), DAY, ESS, HOUR, MINUTE, NEEDCOMMA, out, prefix, WEEK, and YEAR.
Referenced by ast_cli_print_timestr_fromseconds(), handle_showcalls(), and handle_showuptime().
|
static |
Definition at line 2424 of file main/cli.c.
References ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_REMOVE_ELEM_UNORDERED, shutdown_commands, and shutdown_commands_lock.
Referenced by ast_cli_unregister().
|
static |
initialize the _full_cmd string and related parameters, return 0 on success, -1 on error.
Definition at line 2080 of file main/cli.c.
References ast_cli_entry::_full_cmd, ast_cli_entry::args, ast_join, ast_log, ast_strdup, buf, cli_rsvd, ast_cli_entry::cmda, ast_cli_entry::cmdlen, and LOG_WARNING.
Referenced by __ast_cli_register().
|
static |
Definition at line 407 of file main/cli.c.
References a, ast_cli(), DEBUG_HANDLER, handler(), TRACE_HANDLER, and VERBOSE_HANDLER.
Referenced by handle_debug_or_trace(), and handle_verbose().
|
static |
match a word in the CLI entry. returns -1 on mismatch, 0 on match of an optional word, 1 on match of a full word.
The pattern can be any_word match for equal [foo|bar|baz] optionally, one of these words {foo|bar|baz} exactly, one of these words % any word
Definition at line 2261 of file main/cli.c.
References ast_strlen_zero(), cli_rsvd, and strcasestr().
Referenced by __ast_cli_generator(), and find_cli().
|
static |
Definition at line 110 of file main/cli.c.
Referenced by ast_cli().
|
static |
Definition at line 2014 of file main/cli.c.
Referenced by ast_builtins_init(), and cli_shutdown().
|
static |
Default permissions value 1=Permit 0=Deny.
Definition at line 87 of file main/cli.c.
Referenced by ast_cli_perms_init(), and cli_has_permissions().
|
static |
|
static |
Some regexp characters in cli arguments are reserved and used as separators.
Definition at line 2074 of file main/cli.c.
Referenced by is_prefix(), set_full_cmd(), and word_match().
|
static |
Definition at line 893 of file main/cli.c.
Referenced by handle_modlist(), and modlist_modentry().
|
static |
Definition at line 892 of file main/cli.c.
Referenced by handle_modlist().
size_t current |
Definition at line 113 of file main/cli.c.
Referenced by __ast_bridge_technology_register(), actual_load_config(), add_pattern_node(), adsi_read_encoded_dtmf(), already_in_tree(), announce_thread(), ast_append_acl(), ast_bridge_technology_unregister(), ast_channel_inherit_variables(), ast_duplicate_ha_list(), ast_free_acl_list(), ast_get_srv(), ast_sched_clean_by_callback(), ast_sched_runq(), ast_sip_register_endpoint_identifier_with_name(), ast_tone_zone_destructor(), ast_translate(), build_node_children(), channel_do_masquerade(), check_regcontext(), clear_mixmonitor_recipient_list(), clone_variables(), create_virtual_subscriptions(), dns_naptr_sort(), dns_srv_sort(), do_devstate_changes(), empty_columns(), find_best_technology(), find_sequence(), frame_cache_cleanup(), free_vm_users(), get_lock(), indicate_connected_line(), inherit_channel_vars_from_id(), leave_queue(), lintocodec2_frameout(), lintogsm_frameout(), lintolpc10_frameout(), lintospeex_frameout(), load_password(), my_unload_module(), origin_allowed(), ospauth_exec(), ospfinished_exec(), osplookup_exec(), ospnext_exec(), payload_mapping_rx_clear_primary(), payload_mapping_tx_is_present(), process_weights(), send_message(), sip_call(), skinny_call(), speech_background(), srv_callback(), substitute_escapes(), transmit_invite(), and unload_module().
|
static |
lists of module names and their debug/trace levels
Definition at line 91 of file main/cli.c.
Referenced by ast_debug_get_by_module(), and handle_debug_or_trace().
struct ast_cli_entry* * elems |
Definition at line 113 of file main/cli.c.
|
static |
size_t max |
Definition at line 113 of file main/cli.c.
Referenced by complete_number(), and parse_args().
|
static |
CLI permissions config file.
Definition at line 85 of file main/cli.c.
Referenced by ast_cli_perms_init().
|
static |
mutex used to prevent a user from running the 'cli reload permissions' command while it is already running.
Definition at line 91 of file main/cli.c.
Referenced by ast_cli_perms_init().
struct { ... } shutdown_commands |
Referenced by allowed_on_shutdown(), ast_builtins_init(), ast_cli_allow_at_shutdown(), and remove_shutdown_command().
|
static |
Definition at line 112 of file main/cli.c.
Referenced by allowed_on_shutdown(), ast_cli_allow_at_shutdown(), and remove_shutdown_command().
|
static |
Definition at line 91 of file main/cli.c.
Referenced by ast_trace_get_by_module(), and handle_debug_or_trace().