diff options
author | Mark Michelson <mmichelson@digium.com> | 2014-07-25 16:47:17 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2014-07-25 16:47:17 +0000 |
commit | dcf1ad14da48db3476dcaeeb3d3fb6b7d00a28ca (patch) | |
tree | bd9312d3192f4fbb97cb217093b85e75d1346cf6 /main/cli.c | |
parent | 355dc3d2ad98db624184a797206ccb88f4b8a526 (diff) |
Add module support level to ast_module_info structure. Print it in CLI "module show" .
ASTERISK-23919 #close
Reported by Malcolm Davenport
Review: https://reviewboard.asterisk.org/r/3802
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cli.c')
-rw-r--r-- | main/cli.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/main/cli.c b/main/cli.c index bb8e33e44..b7e5c1586 100644 --- a/main/cli.c +++ b/main/cli.c @@ -772,17 +772,20 @@ static char *handle_unload(struct ast_cli_entry *e, int cmd, struct ast_cli_args return CLI_SUCCESS; } -#define MODLIST_FORMAT "%-30s %-40.40s %-10d %s\n" -#define MODLIST_FORMAT2 "%-30s %-40.40s %-10s %s\n" +#define MODLIST_FORMAT "%-30s %-40.40s %-10d %-11s %13s\n" +#define MODLIST_FORMAT2 "%-30s %-40.40s %-10s %-11s %13s\n" AST_MUTEX_DEFINE_STATIC(climodentrylock); static int climodentryfd = -1; -static int modlist_modentry(const char *module, const char *description, int usecnt, const char *status, const char *like) +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) { /* Comparing the like with the module */ if (strcasestr(module, like) ) { - ast_cli(climodentryfd, MODLIST_FORMAT, module, description, usecnt, status); + ast_cli(climodentryfd, MODLIST_FORMAT, module, description, usecnt, + status, ast_module_support_level_to_string(support_level)); return 1; } return 0; @@ -909,7 +912,7 @@ static char *handle_modlist(struct ast_cli_entry *e, int cmd, struct ast_cli_arg ast_mutex_lock(&climodentrylock); climodentryfd = a->fd; /* global, protected by climodentrylock */ - ast_cli(a->fd, MODLIST_FORMAT2, "Module", "Description", "Use Count", "Status"); + ast_cli(a->fd, MODLIST_FORMAT2, "Module", "Description", "Use Count", "Status", "Support Level"); ast_cli(a->fd,"%d modules loaded\n", ast_update_module_list(modlist_modentry, like)); climodentryfd = -1; ast_mutex_unlock(&climodentrylock); |