aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat_vty.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-21 19:05:14 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:15 +0800
commit62e5843a61ffde9788513447cec6909c3466c685 (patch)
tree94c8c6d0314875eb8615dcd897627ba5cbb90c20 /openbsc/src/nat/bsc_nat_vty.c
parentb5513caaf8a683c082ccf3daa61682ca5a25bbf1 (diff)
[nat] Add option to forbid the paging to the BSC.
This can be done for testing purposes and to allow making a BTS crash that can not handle paging requests properly.
Diffstat (limited to 'openbsc/src/nat/bsc_nat_vty.c')
-rw-r--r--openbsc/src/nat/bsc_nat_vty.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c
index a03b5d178..d8b6040c7 100644
--- a/openbsc/src/nat/bsc_nat_vty.c
+++ b/openbsc/src/nat/bsc_nat_vty.c
@@ -69,6 +69,7 @@ static void config_write_bsc_single(struct vty *vty, struct bsc_config *bsc)
vty_out(vty, " imsi allow %s%s", bsc->imsi_allow, VTY_NEWLINE);
if (bsc->imsi_deny)
vty_out(vty, " imsi deny %s%s", bsc->imsi_deny, VTY_NEWLINE);
+ vty_out(vty, " paging forbidden %d%s", bsc->forbid_paging, VTY_NEWLINE);
}
static int config_write_bsc(struct vty *vty)
@@ -128,6 +129,8 @@ DEFUN(show_bsc_cfg, show_bsc_cfg_cmd, "bsc config show",
conf->imsi_allow ? conf->imsi_allow: "any",
conf->imsi_deny ? conf->imsi_deny : "none",
VTY_NEWLINE);
+ vty_out(vty, " paging forbidden: %d%s",
+ conf->forbid_paging, VTY_NEWLINE);
}
return CMD_SUCCESS;
@@ -315,6 +318,21 @@ DEFUN(cfg_bsc_imsi_deny,
return CMD_SUCCESS;
}
+DEFUN(cfg_bsc_paging,
+ cfg_bsc_paging_cmd,
+ "paging forbidden (0|1)",
+ "Forbid sending PAGING REQUESTS to the BSC.")
+{
+ struct bsc_config *conf = vty->index;
+
+ if (strcmp("1", argv[1]) == 0)
+ conf->forbid_paging = 1;
+ else
+ conf->forbid_paging = 0;
+
+ return CMD_SUCCESS;
+}
+
int bsc_nat_vty_init(struct bsc_nat *nat)
{
_nat = nat;
@@ -347,6 +365,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat)
install_element(BSC_NODE, &cfg_bsc_lac_cmd);
install_element(BSC_NODE, &cfg_bsc_imsi_allow_cmd);
install_element(BSC_NODE, &cfg_bsc_imsi_deny_cmd);
+ install_element(BSC_NODE, &cfg_bsc_paging_cmd);
mgcp_vty_init();