aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-06-28 13:18:41 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-06-28 13:18:41 +0200
commit653bee7d02a1a1c827b54d235b644fec6a6f4683 (patch)
treecf58221ed95a32118b321980aa5d5301ec0aa6ad
parenta0f1196eda79de0e838b29eb91d9f31839f2f447 (diff)
filter: vty: Print policy list in cmd show access-list
-rw-r--r--src/libfilter/bsc_msg_vty.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/libfilter/bsc_msg_vty.c b/src/libfilter/bsc_msg_vty.c
index 9905365cf..b26f4f1a6 100644
--- a/src/libfilter/bsc_msg_vty.c
+++ b/src/libfilter/bsc_msg_vty.c
@@ -26,6 +26,22 @@
static struct llist_head *_acc_lst;
static void *_ctx;
+static void bsc_msg_acc_lst_write_one(struct vty *vty, struct bsc_msg_acc_lst *lst)
+{
+ struct bsc_msg_acc_lst_entry *entry;
+
+ llist_for_each_entry(entry, &lst->fltr_list, list) {
+ if (entry->imsi_allow)
+ vty_out(vty, " access-list %s imsi-allow %s%s",
+ lst->name, entry->imsi_allow, VTY_NEWLINE);
+ if (entry->imsi_deny)
+ vty_out(vty, " access-list %s imsi-deny %s %d %d%s",
+ lst->name, entry->imsi_deny,
+ entry->cm_reject_cause, entry->lu_reject_cause,
+ VTY_NEWLINE);
+ }
+}
+
DEFUN(cfg_lst_no,
cfg_lst_no_cmd,
"no access-list NAME",
@@ -52,6 +68,7 @@ DEFUN(show_acc_lst,
return CMD_WARNING;
vty_out(vty, "access-list %s%s", acc->name, VTY_NEWLINE);
+ bsc_msg_acc_lst_write_one(vty, acc);
vty_out_rate_ctr_group(vty, " ", acc->stats);
return CMD_SUCCESS;
@@ -111,22 +128,6 @@ DEFUN(cfg_lst_imsi_deny,
return CMD_SUCCESS;
}
-static void bsc_msg_acc_lst_write_one(struct vty *vty, struct bsc_msg_acc_lst *lst)
-{
- struct bsc_msg_acc_lst_entry *entry;
-
- llist_for_each_entry(entry, &lst->fltr_list, list) {
- if (entry->imsi_allow)
- vty_out(vty, " access-list %s imsi-allow %s%s",
- lst->name, entry->imsi_allow, VTY_NEWLINE);
- if (entry->imsi_deny)
- vty_out(vty, " access-list %s imsi-deny %s %d %d%s",
- lst->name, entry->imsi_deny,
- entry->cm_reject_cause, entry->lu_reject_cause,
- VTY_NEWLINE);
- }
-}
-
void bsc_msg_acc_lst_write(struct vty *vty)
{
struct bsc_msg_acc_lst *lst;