Change in osmo-sgsn[master]: VTY: Add gtp state-dir command

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

keith gerrit-no-reply at lists.osmocom.org
Tue Oct 20 13:22:38 UTC 2020


keith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/20798 )

Change subject: VTY: Add gtp state-dir command
......................................................................

VTY: Add gtp state-dir command

The SGSN initialises GTP with gtp_statedir of "./" which may
not be the desired path for writing the gsn_restart file.
When starting from systemd for example, we might write
to the system root.

This patch allows override via the config file.

Closes: OS#4820
Change-Id: Ib3ffb7fd6ea1d9b0286111d8c2cba9da5394ca58
---
M src/sgsn/sgsn_vty.c
M tests/test_nodes.vty
2 files changed, 15 insertions(+), 0 deletions(-)

Approvals:
  keith: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 14248d1..33a652c 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -186,6 +186,8 @@
 
 	vty_out(vty, "sgsn%s", VTY_NEWLINE);
 
+	vty_out(vty, " gtp state-dir %s%s",
+		g_cfg->gtp_statedir, VTY_NEWLINE);
 	vty_out(vty, " gtp local-ip %s%s",
 		inet_ntoa(g_cfg->gtp_listenaddr.sin_addr), VTY_NEWLINE);
 
@@ -315,6 +317,17 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_sgsn_state_dir, cfg_sgsn_state_dir_cmd,
+	"gtp state-dir PATH",
+	"GTP Parameters\n"
+	"Set the directory for the GTP State file\n"
+	"Local Directory\n")
+{
+	osmo_talloc_replace_string(sgsn, &sgsn->cfg.gtp_statedir, argv[0]);
+
+	return CMD_SUCCESS;
+}
+
 DEFUN(cfg_sgsn_bind_addr, cfg_sgsn_bind_addr_cmd,
 	"gtp local-ip A.B.C.D",
 	"GTP Parameters\n"
@@ -1432,6 +1445,7 @@
 
 	install_element(CONFIG_NODE, &cfg_sgsn_cmd);
 	install_node(&sgsn_node, config_write_sgsn);
+	install_element(SGSN_NODE, &cfg_sgsn_state_dir_cmd);
 	install_element(SGSN_NODE, &cfg_sgsn_bind_addr_cmd);
 	install_element(SGSN_NODE, &cfg_ggsn_remote_ip_cmd);
 	//install_element(SGSN_NODE, &cfg_ggsn_remote_port_cmd);
diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
index 18bccc8..109e2ec 100644
--- a/tests/test_nodes.vty
+++ b/tests/test_nodes.vty
@@ -27,6 +27,7 @@
 OsmoSGSN(config)# sgsn
 OsmoSGSN(config-sgsn)# list
 ...
+  gtp state-dir PATH
   gtp local-ip A.B.C.D
   ggsn <0-255> remote-ip A.B.C.D
   ggsn <0-255> gtp-version (0|1)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/20798
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ib3ffb7fd6ea1d9b0286111d8c2cba9da5394ca58
Gerrit-Change-Number: 20798
Gerrit-PatchSet: 4
Gerrit-Owner: keith <keith at rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: keith <keith at rhizomatica.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201020/fc468401/attachment.htm>


More information about the gerrit-log mailing list