aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-25 16:25:47 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-25 16:25:47 +0800
commit520c1f12efb6cf5f270704e679d8b8ab6582dc39 (patch)
tree9cf410af13e0500a9dd28e0f56271c87c148bad6 /openbsc/src/nat
parent2f1a984d4fe0980a9961ff089dc410e49d988967 (diff)
nat: Print the statistics of the access-list matches
Print the statistics for the rule matches via the vty.
Diffstat (limited to 'openbsc/src/nat')
-rw-r--r--openbsc/src/nat/bsc_nat_vty.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c
index 4dbec0af4..0da686dc3 100644
--- a/openbsc/src/nat/bsc_nat_vty.c
+++ b/openbsc/src/nat/bsc_nat_vty.c
@@ -516,6 +516,23 @@ DEFUN(cfg_lst_no,
return CMD_SUCCESS;
}
+DEFUN(show_acc_lst,
+ show_acc_lst_cmd,
+ "show access-list NAME",
+ SHOW_STR "The name of the access list\n")
+{
+ struct bsc_nat_acc_lst *acc;
+ acc = bsc_nat_acc_lst_find(_nat, argv[0]);
+ if (!acc)
+ return CMD_WARNING;
+
+ vty_out(vty, "access-list %s%s", acc->name, VTY_NEWLINE);
+ vty_out_rate_ctr_group(vty, " ", acc->stats);
+
+ return CMD_SUCCESS;
+}
+
+
DEFUN(cfg_bsc_acc_lst_name,
cfg_bsc_acc_lst_name_cmd,
"access-list-name NAME",
@@ -590,6 +607,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat)
install_element_ve(&show_msc_cmd);
install_element_ve(&test_regex_cmd);
install_element_ve(&show_bsc_mgcp_cmd);
+ install_element_ve(&show_acc_lst_cmd);
/* nat group */
install_element(CONFIG_NODE, &cfg_nat_cmd);