From ec7ecab66f530bb00f6d9d166a2cbb1e89bbd713 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 2 May 2010 18:59:24 +0800 Subject: nat: Allow to only show statistics for a given BSC Cfg. --- openbsc/src/nat/bsc_nat_vty.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'openbsc') diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c index 7160d6967..e432325df 100644 --- a/openbsc/src/nat/bsc_nat_vty.c +++ b/openbsc/src/nat/bsc_nat_vty.c @@ -142,11 +142,16 @@ DEFUN(show_bsc_cfg, show_bsc_cfg_cmd, "show bsc config", DEFUN(show_stats, show_stats_cmd, - "show statistics", + "show statistics [NR]", SHOW_STR "Display network statistics") { struct bsc_config *conf; + int nr = -1; + + if (argc == 1) + nr = atoi(argv[0]); + vty_out(vty, "NAT statistics%s", VTY_NEWLINE); vty_out(vty, " SCCP Connections %lu total, %lu calls%s", counter_get(_nat->stats.sccp.conn), @@ -158,6 +163,9 @@ DEFUN(show_stats, counter_get(_nat->stats.bsc.auth_fail), VTY_NEWLINE); llist_for_each_entry(conf, &_nat->bsc_configs, entry) { + if (argc == 1 && nr != conf->nr) + continue; + vty_out(vty, " BSC lac: %d nr: %d%s", conf->lac, conf->nr, VTY_NEWLINE); vty_out(vty, " SCCP Connnections %lu total, %lu calls%s", -- cgit v1.2.3