Change in libosmocore[master]: gprs_ns2: add vty `nse <0-65535> restart sns`

lynxis lazus gerrit-no-reply at lists.osmocom.org
Tue Mar 2 09:15:16 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/23184 )


Change subject: gprs_ns2: add vty `nse <0-65535> restart sns`
......................................................................

gprs_ns2: add vty `nse <0-65535> restart sns`

Allow to restart SNS procedure and initiate a SNS-SIZE procedure with Reset.

Change-Id: Icb55d8449908d348ab10572eebcf971737fba00d
---
M src/gb/gprs_ns2_vty.c
1 file changed, 27 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/23184/1

diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index 6214907..f4c4c68 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -1895,6 +1895,32 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(nse_restart_sns, nse_restart_sns_cmd,
+      "nse <0-65535> restart sns",
+      "NS Entity ID (NSEI)\n"
+      "NS Entity ID (NSEI)\n"
+      "Restart SNS procedure\n"
+      "Restart SNS procedure\n")
+{
+	struct gprs_ns2_inst *nsi = vty_nsi;
+	struct gprs_ns2_nse *nse;
+
+	uint16_t id = atoi(argv[0]);
+	nse = gprs_ns2_nse_by_nsei(nsi, id);
+	if (!nse) {
+		vty_out(vty, "Could not find NSE for NSEI %u%s", id, VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	if (nse->dialect != GPRS_NS2_DIALECT_SNS) {
+		vty_out(vty, "Given NSEI %u doesn't use IP-SNS%s", id, VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	gprs_ns2_free_nsvcs(nse);
+	return CMD_SUCCESS;
+}
+
 DEFUN(nsvc_block, nsvc_block_cmd,
       "nsvc <0-65535> (block|unblock)",
       "NS Virtual Connection\n"
@@ -2034,6 +2060,7 @@
 
 	install_lib_element(ENABLE_NODE, &nsvc_force_unconf_cmd);
 	install_lib_element(ENABLE_NODE, &nsvc_block_cmd);
+	install_lib_element(ENABLE_NODE, &nse_restart_sns_cmd);
 
 	install_lib_element(CFG_LOG_NODE, &logging_fltr_nse_cmd);
 	install_lib_element(CFG_LOG_NODE, &logging_fltr_nsvc_cmd);

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Icb55d8449908d348ab10572eebcf971737fba00d
Gerrit-Change-Number: 23184
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210302/77871392/attachment.htm>


More information about the gerrit-log mailing list