aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-14 22:06:28 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-14 22:06:28 +0800
commite265db68b062d9726a82c6b50c1c397e4a2170b7 (patch)
tree4f393bfd7aa79c74eccefc9010491c2bb9b03259 /openbsc
parentfdc4a9386f64462511b044fa68a2c3901d936b12 (diff)
[nat] Allow to set the description for the bsc.
This will allow to add description to each BSC.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/bsc_nat.h2
-rw-r--r--openbsc/src/nat/bsc_nat_vty.c21
2 files changed, 23 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index ed1e5cd9e..455e46e71 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -149,6 +149,8 @@ struct bsc_config {
unsigned int lac;
int nr;
+ char *description;
+
/* imsi white and blacklist */
char *imsi_allow;
regex_t imsi_allow_re;
diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c
index 9688de3f8..f540f9375 100644
--- a/openbsc/src/nat/bsc_nat_vty.c
+++ b/openbsc/src/nat/bsc_nat_vty.c
@@ -74,6 +74,8 @@ static void config_write_bsc_single(struct vty *vty, struct bsc_config *bsc)
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);
+ if (bsc->description)
+ vty_out(vty, " description %s%s", bsc->description, VTY_NEWLINE);
}
static int config_write_bsc(struct vty *vty)
@@ -139,6 +141,11 @@ DEFUN(show_bsc_cfg, show_bsc_cfg_cmd, "show bsc config",
VTY_NEWLINE);
vty_out(vty, " paging forbidden: %d%s",
conf->forbid_paging, VTY_NEWLINE);
+ if (conf->description)
+ vty_out(vty, " description: %s%s", conf->description, VTY_NEWLINE);
+ else
+ vty_out(vty, " No description.%s", VTY_NEWLINE);
+
}
return CMD_SUCCESS;
@@ -390,6 +397,19 @@ DEFUN(cfg_bsc_paging,
return CMD_SUCCESS;
}
+DEFUN(cfg_bsc_desc,
+ cfg_bsc_desc_cmd,
+ "description DESC",
+ "Provide a description for the given BSC.")
+{
+ struct bsc_config *conf = vty->index;
+
+ if (conf->description)
+ talloc_free(conf->description);
+ conf->description = talloc_strdup(conf, argv[0]);
+ return CMD_SUCCESS;
+}
+
int bsc_nat_vty_init(struct bsc_nat *nat)
{
_nat = nat;
@@ -428,6 +448,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat)
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);
+ install_element(BSC_NODE, &cfg_bsc_desc_cmd);
mgcp_vty_init();