summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2018-01-11 16:30:03 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2018-01-30 18:59:29 +0100
commita5bb47b6e097f234a8ce778acf63ab765c6b8a20 (patch)
tree7bc82497bbd1ea76d3099182d2694fa672ace1a8
parent6c44d3ad6eee3e4deffe36511d1afccbf1d7d4b5 (diff)
osmo-bsc_nat: Add a description for the MSC
-rw-r--r--openbsc/include/openbsc/bsc_nat.h1
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c2
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat_vty.c12
3 files changed, 14 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index c6085a133..4911ef7f5 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -238,6 +238,7 @@ struct msc_config {
/* imsi white and blacklist */
char *acc_lst_name;
+ char *desc;
char *token;
int nr;
struct bsc_nat *nat;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index d153d6183..6b331bd58 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1683,7 +1683,7 @@ int main(int argc, char **argv)
exit(1);
}
- msc_con->name = "main MSC";
+ msc_con->name = conf->desc;
msc_con->connection_loss = msc_connection_was_lost;
msc_con->connected = msc_connection_connected;
msc_con->write_queue.read_cb = ipaccess_msc_read_cb;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
index b0b6be0e8..1f7fe7df7 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
@@ -155,6 +155,7 @@ static int config_write_nat(struct vty *vty)
static void config_write_msc_single(struct vty *vty, struct msc_config *msc)
{
vty_out(vty, " msc %u%s", msc->nr, VTY_NEWLINE);
+ vty_out(vty, " desc %s%s", msc->desc, VTY_NEWLINE);
vty_out(vty, " ip %s%s", msc->main_dest->ip, VTY_NEWLINE);
vty_out(vty, " port %d%s", msc->main_dest->port, VTY_NEWLINE);
if (msc->token)
@@ -1100,6 +1101,16 @@ DEFUN(cfg_msc, cfg_msc_cmd, "msc MSC_NR",
return CMD_SUCCESS;
}
+DEFUN(cfg_msc_desc, cfg_msc_desc_cmd, "description NAME",
+ "MSC related configuration\n"
+ "Name of the MSC\n")
+{
+ struct msc_config *conf = vty->index;
+
+ osmo_talloc_replace_string(conf, &conf->desc, argv[0]);
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_msc_token, cfg_msc_token_cmd, "token TOKEN",
"Authentication token configuration\n"
"Token of the BSC, currently transferred in cleartext\n")
@@ -1424,6 +1435,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat)
/* MSC subgroups */
install_element(NAT_NODE, &cfg_msc_cmd);
install_node(&msc_node, config_write_msc);
+ install_element(NAT_MSC_NODE, &cfg_msc_desc_cmd);
install_element(NAT_MSC_NODE, &cfg_msc_token_cmd);
install_element(NAT_MSC_NODE, &cfg_msc_ip_cmd);
install_element(NAT_MSC_NODE, &cfg_msc_port_cmd);