aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-02 18:59:24 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-02 19:31:14 +0800
commitec7ecab66f530bb00f6d9d166a2cbb1e89bbd713 (patch)
tree076903d800412f5d4574652d5c87f6c98249c64b
parentd1287e379b284f5b27baa1edb185e0b74a221a7d (diff)
nat: Allow to only show statistics for a given BSC Cfg.
-rw-r--r--openbsc/src/nat/bsc_nat_vty.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c
index 7160d696..e432325d 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",