diff options
author | Kozlov Dmitry <dima@server> | 2010-12-30 15:38:10 +0300 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2010-12-30 15:38:16 +0300 |
commit | 95a19e0c5c622e8e886ff822ea48d28f7bceced4 (patch) | |
tree | c7603734bbe8e792855c48d1d4d630cbc16c4f91 /accel-pptpd/extra | |
parent | 124c5fc81f2bfa14d60f645257cfc4d978756c54 (diff) | |
download | accel-ppp-95a19e0c5c622e8e886ff822ea48d28f7bceced4.tar.gz accel-ppp-95a19e0c5c622e8e886ff822ea48d28f7bceced4.zip |
cli: removed old "show sessions" code
shaper_tbf: add column "rate-limit" for "show sessions"
Diffstat (limited to 'accel-pptpd/extra')
-rw-r--r-- | accel-pptpd/extra/shaper_tbf.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/accel-pptpd/extra/shaper_tbf.c b/accel-pptpd/extra/shaper_tbf.c index 940fa297..bed43e2f 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); } |