summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <voitov.e@gmail.com>2021-04-27 14:10:03 +0300
committerroot <voitov.e@gmail.com>2021-04-27 14:10:03 +0300
commit4b52c1a3590b43ca892c460d9b1478e1da742156 (patch)
treecbb32523b02720ca4877fa8a6c684f0a788d0e18
parent3b74e1088af7b525880b386136c0330bbed377a0 (diff)
downloadaccel-ppp-4b52c1a3590b43ca892c460d9b1478e1da742156.tar.gz
accel-ppp-4b52c1a3590b43ca892c460d9b1478e1da742156.zip
Add 'show version' command in CLI
-rw-r--r--accel-pppd/cli/std_cmd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/accel-pppd/cli/std_cmd.c b/accel-pppd/cli/std_cmd.c
index e752918..e22ea76 100644
--- a/accel-pppd/cli/std_cmd.c
+++ b/accel-pppd/cli/std_cmd.c
@@ -84,6 +84,17 @@ static void show_stat_help(char * const *fields, int fields_cnt, void *client)
}
//=============================
+static int show_version_exec(const char *cmd, char * const *fields, int fields_cnt, void *client)
+{
+ cli_sendv(client, "%s\r\n", ACCEL_PPP_VERSION);
+}
+
+static void show_version_help(char * const *fields, int fields_cnt, void *client)
+{
+ cli_send(client, "show version - shows version of running accel-pppd\r\n");
+}
+//=============================
+
static int exit_exec(const char *cmd, char * const *fields, int fields_cnt, void *client)
{
return CLI_CMD_EXIT;
@@ -381,6 +392,7 @@ static void restart_help(char * const *fields, int fields_cnt, void *client)
static void init(void)
{
cli_register_simple_cmd2(show_stat_exec, show_stat_help, 2, "show", "stat");
+ cli_register_simple_cmd2(show_version_exec, show_version_help, 2, "show", "version");
cli_register_simple_cmd2(terminate_exec, terminate_help, 1, "terminate");
cli_register_simple_cmd2(reload_exec, reload_help, 1, "reload");
cli_register_simple_cmd2(restart_exec, restart_help, 1, "restart");