50 #define MAX_ALIAS_BUCKETS 53 73 const struct cli_alias *alias0 = obj, *alias1 = arg;
120 line += (strlen(alias->
alias));
138 for (i = e->
args + 1; i <= a->argc; i++) {
155 #define FORMAT "%-50.50s %-50.50s\n" 161 e->
command =
"cli show aliases";
163 "Usage: cli show aliases\n" 164 " Displays a list of aliased CLI commands.\n";
192 struct cli_alias *
alias;
208 if (strcmp(v->
name,
"template")) {
226 alias->
alias = ((
char *) alias) +
sizeof(*alias);
struct ast_variable * next
#define AST_CLI_DEFINE(fn, txt,...)
static void load_config(int reload)
Function called to load or reload the configuration file.
Asterisk main include file. File version handling, generic pbx functions.
static char * alias_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
CLI Command to display CLI Aliases.
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
static int alias_name_cb(void *obj, void *arg, int flags)
Callback for finding an alias based on name.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
int ast_cli_unregister(struct ast_cli_entry *e)
Unregisters a command or an array of commands.
descriptor for a cli entry.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define ao2_callback(c, flags, cb_fn, arg)
#define CONFIG_STATUS_FILEINVALID
Structure for variables, used for configurations and for channel variables.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define ast_str_alloca(init_len)
void ast_cli(int fd, const char *fmt,...)
#define ast_verb(level,...)
static int unload_module(void)
Function called to unload the module.
int args
This gets set in ast_cli_register()
#define ast_cli_register(e)
Registers a command or an array of commands.
Configuration File Parser.
static const char config_file[]
#define ast_config_load(filename, flags)
Load a config file.
static int alias_cmp_cb(void *obj, void *arg, int flags)
Comparison function used for aliases.
char *(* handler)(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
#define ao2_ref(o, delta)
void ast_config_destroy(struct ast_config *config)
Destroys a config.
ast_cli_command
calling arguments for new-style handlers.
#define CONFIG_STATUS_FILEUNCHANGED
static int alias_unregister_cb(void *obj, void *arg, int flags)
Callback for unregistering an alias.
#define MAX_ALIAS_BUCKETS
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static struct ast_generator generator
struct ast_cli_entry cli_entry
#define ao2_iterator_next(iter)
#define ao2_alloc(data_size, destructor_fn)
static int reload_module(void)
Function called to reload the module.
Module has failed to load, may be in an inconsistent state.
static int load_module(void)
Load the module.
#define ao2_find(container, arg, flags)
char * ast_cli_generator(const char *, const char *, int)
Readline madness Useful for readline, that's about it.
Structure used to handle boolean flags.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Standard Command Line Interface.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static int alias_hash_cb(const void *obj, const int flags)
Hashing function used for aliases.
static struct ao2_container * cli_aliases
static char * cli_alias_passthrough(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
Function which passes through an aliased CLI command to the real one.
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
#define ao2_link(container, obj)