summaryrefslogtreecommitdiff
path: root/accel-pptpd/ctrl/l2tp/l2tp.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pptpd/ctrl/l2tp/l2tp.c')
-rw-r--r--accel-pptpd/ctrl/l2tp/l2tp.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/accel-pptpd/ctrl/l2tp/l2tp.c b/accel-pptpd/ctrl/l2tp/l2tp.c
index 899ac6a..18ba6d0 100644
--- a/accel-pptpd/ctrl/l2tp/l2tp.c
+++ b/accel-pptpd/ctrl/l2tp/l2tp.c
@@ -1062,29 +1062,13 @@ static void start_udp_server(void)
static int show_stat_exec(const char *cmd, char * const *fields, int fields_cnt, void *client)
{
- char buf[128];
-
- if (cli_send(client, "l2tp:\r\n"))
- return CLI_CMD_FAILED;
-
- sprintf(buf, " starting: %u\r\n", stat_starting);
- if (cli_send(client, buf))
- return CLI_CMD_FAILED;
-
- sprintf(buf, " active: %u\r\n", stat_active);
- if (cli_send(client, buf))
- return CLI_CMD_FAILED;
+ cli_send(client, "l2tp:\r\n");
+ cli_sendv(client, " starting: %u\r\n", stat_starting);
+ cli_sendv(client, " active: %u\r\n", stat_active);
return CLI_CMD_OK;
}
-static const char *show_stat_hdr[] = {"show","stat"};
-static struct cli_simple_cmd_t show_stat_cmd = {
- .hdr_len = 2,
- .hdr = show_stat_hdr,
- .exec = show_stat_exec,
-};
-
static void __init l2tp_init(void)
{
char *opt;
@@ -1120,6 +1104,6 @@ static void __init l2tp_init(void)
start_udp_server();
- cli_register_simple_cmd(&show_stat_cmd);
+ cli_register_simple_cmd2(&show_stat_exec, NULL, 2, "show", "stat");
}