From 95a19e0c5c622e8e886ff822ea48d28f7bceced4 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Thu, 30 Dec 2010 15:38:10 +0300 Subject: cli: removed old "show sessions" code shaper_tbf: add column "rate-limit" for "show sessions" --- accel-pptpd/extra/shaper_tbf.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'accel-pptpd/extra') diff --git a/accel-pptpd/extra/shaper_tbf.c b/accel-pptpd/extra/shaper_tbf.c index 940fa29..bed43e2 100644 --- a/accel-pptpd/extra/shaper_tbf.c +++ b/accel-pptpd/extra/shaper_tbf.c @@ -823,6 +823,16 @@ static int shaper_restore_exec(const char *cmd, char * const *f, int f_cnt, void return CLI_CMD_OK; } +static void print_rate(const struct ppp_t *ppp, char *buf) +{ + struct shaper_pd_t *pd = find_pd((struct ppp_t *)ppp, 0); + + if (pd && (pd->down_speed || pd->up_speed)) + sprintf(buf, "%i/%i", pd->down_speed, pd->up_speed); + else + *buf = 0; +} + static int clock_init(void) { FILE *fp; @@ -968,5 +978,6 @@ static void __init init(void) cli_register_simple_cmd2(shaper_change_exec, shaper_change_help, 2, "shaper", "change"); cli_register_simple_cmd2(shaper_restore_exec, shaper_restore_help, 2, "shaper", "restore"); + cli_show_ses_register("rate-limit", "rate limit down-stream/up-stream (Kbit)", print_rate); } -- cgit v1.2.3