aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-12 12:33:27 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-13 09:47:22 +0200
commit61e73eec3f7eeb6bbb76517427fae07fce098304 (patch)
treecf47d57970722ac2d12779aa78f2f01804777bdc /openbsc
parent1aa2798919f7d517cebf6d211e78e9271b2ee07f (diff)
[nat] Add show statistics to the nat
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/nat/bsc_nat_vty.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c
index c8e91f79d..6ed1e724d 100644
--- a/openbsc/src/nat/bsc_nat_vty.c
+++ b/openbsc/src/nat/bsc_nat_vty.c
@@ -119,6 +119,35 @@ DEFUN(show_bsc_cfg, show_bsc_cfg_cmd, "bsc config show",
return CMD_SUCCESS;
}
+DEFUN(show_stats,
+ show_stats_cmd,
+ "show statistics",
+ SHOW_STR "Display network statistics\n")
+{
+ struct bsc_config *conf;
+
+ vty_out(vty, "NAT statistics%s", VTY_NEWLINE);
+ vty_out(vty, " SCCP Connections %lu total, %lu calls%s",
+ counter_get(_nat->stats.sccp.conn),
+ counter_get(_nat->stats.sccp.calls), VTY_NEWLINE);
+ vty_out(vty, " MSC Connections %lu%s",
+ counter_get(_nat->stats.msc.reconn), VTY_NEWLINE);
+ vty_out(vty, " BSC Connections %lu total, %lu auth failed.%s",
+ counter_get(_nat->stats.bsc.reconn),
+ counter_get(_nat->stats.bsc.auth_fail), VTY_NEWLINE);
+
+ llist_for_each_entry(conf, &_nat->bsc_configs, entry) {
+ 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",
+ counter_get(conf->stats.sccp.conn),
+ counter_get(conf->stats.sccp.calls), VTY_NEWLINE);
+ vty_out(vty, " BSC Connections %lu total%s",
+ counter_get(conf->stats.net.reconn), VTY_NEWLINE);
+ }
+
+ return CMD_SUCCESS;
+}
DEFUN(cfg_nat, cfg_nat_cmd, "nat", "Configute the NAT")
{
@@ -207,6 +236,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat)
install_element(VIEW_NODE, &show_sccp_cmd);
install_element(VIEW_NODE, &show_bsc_cmd);
install_element(VIEW_NODE, &show_bsc_cfg_cmd);
+ install_element(VIEW_NODE, &show_stats_cmd);
openbsc_vty_add_cmds();