From a5bb47b6e097f234a8ce778acf63ab765c6b8a20 Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Thu, 11 Jan 2018 16:30:03 +0100 Subject: osmo-bsc_nat: Add a description for the MSC Change-Id: I84b713487117108f0978b86bd86d8fe98dc6fb93 --- openbsc/include/openbsc/bsc_nat.h | 1 + openbsc/src/osmo-bsc_nat/bsc_nat.c | 2 +- openbsc/src/osmo-bsc_nat/bsc_nat_vty.c | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3