aboutsummaryrefslogtreecommitdiffstats
path: root/src/gbproxy/gb_proxy_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gbproxy/gb_proxy_vty.c')
-rw-r--r--src/gbproxy/gb_proxy_vty.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gbproxy/gb_proxy_vty.c b/src/gbproxy/gb_proxy_vty.c
index 92915fea0..4d0fa3d9d 100644
--- a/src/gbproxy/gb_proxy_vty.c
+++ b/src/gbproxy/gb_proxy_vty.c
@@ -29,6 +29,7 @@
#include <osmocom/core/talloc.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/rate_ctr.h>
+#include <osmocom/core/utils.h>
#include <osmocom/gprs/gprs_ns2.h>
#include <osmocom/gprs/bssgp_bvc_fsm.h>
@@ -188,6 +189,7 @@ static void sgsn_write_nri(struct vty *vty, struct gbproxy_sgsn *sgsn, bool verb
static void write_sgsn(struct vty *vty, struct gbproxy_sgsn *sgsn)
{
vty_out(vty, "sgsn nsei %u%s", sgsn->nse->nsei, VTY_NEWLINE);
+ vty_out(vty, " name %s%s", sgsn->name, VTY_NEWLINE);
vty_out(vty, " %sallow-attach%s", sgsn->pool.allow_attach ? "" : "no ", VTY_NEWLINE);
sgsn_write_nri(vty, sgsn, false);
}
@@ -256,6 +258,26 @@ free_nothing:
return CMD_WARNING;
}
+DEFUN(cfg_sgsn_name,
+ cfg_sgsn_name_cmd,
+ "name NAME",
+ "Configure the SGSN\n"
+ "Name the SGSN\n"
+ "The name\n")
+{
+ struct gbproxy_sgsn *sgsn = vty->index;
+ const char *name = argv[0];
+
+
+ osmo_talloc_replace_string(sgsn, &sgsn->name, name);
+ if (!sgsn->name) {
+ vty_out(vty, "%% Unable to set name for SGSN with nsei %05u%s", sgsn->nse->nsei, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN_ATTR(cfg_sgsn_nri_add, cfg_sgsn_nri_add_cmd,
"nri add <0-32767> [<0-32767>]",
NRI_STR "Add NRI value or range to the NRI mapping for this MSC\n"
@@ -647,6 +669,7 @@ int gbproxy_vty_init(void)
install_element(CONFIG_NODE, &cfg_sgsn_nsei_cmd);
install_node(&sgsn_node, config_write_sgsn);
+ install_element(SGSN_NODE, &cfg_sgsn_name_cmd);
install_element(SGSN_NODE, &cfg_sgsn_allow_attach_cmd);
install_element(SGSN_NODE, &cfg_sgsn_no_allow_attach_cmd);
install_element(SGSN_NODE, &cfg_sgsn_nri_add_cmd);