Change in libosmocore[master]: gprs_ns2_vty: Allow creating NSE in sgsn-role

laforge gerrit-no-reply at lists.osmocom.org
Fri Mar 19 12:38:54 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/23408 )


Change subject: gprs_ns2_vty: Allow creating NSE in sgsn-role
......................................................................

gprs_ns2_vty: Allow creating NSE in sgsn-role

Change-Id: I694fa6c80d04d13cb1afaae93a9ae43b6dfd2207
Related: OS#3373
---
M src/gb/gprs_ns2_vty.c
M tests/gb/gprs_ns2_vty.vty
2 files changed, 8 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/08/23408/1

diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index a769ad1..3b006f1 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -270,15 +270,19 @@
 }
 
 DEFUN(cfg_ns_nsei, cfg_ns_nsei_cmd,
-      "nse <0-65535>",
+      "nse <0-65535> [sgsn-role]",
       "Persistent NS Entity\n"
       "NS Entity ID (NSEI)\n"
+      "Create NSE in SGSN role (default: BSS)\n"
       )
 {
 	struct gprs_ns2_nse *nse;
 	struct vty_nse *vnse;
 	uint16_t nsei = atoi(argv[0]);
+	bool sgsn_role = false;
 	bool free_vnse = false;
+	if (argc > 1 && !strcmp(argv[1], "sgsn-role"))
+		sgsn_role = true;
 
 	vnse = vty_nse_by_nsei(nsei);
 	if (!vnse) {
@@ -292,7 +296,8 @@
 
 	nse = gprs_ns2_nse_by_nsei(vty_nsi, nsei);
 	if (!nse) {
-		nse = gprs_ns2_create_nse(vty_nsi, nsei, GPRS_NS2_LL_UNDEF, GPRS_NS2_DIALECT_UNDEF);
+		nse = gprs_ns2_create_nse2(vty_nsi, nsei, GPRS_NS2_LL_UNDEF, GPRS_NS2_DIALECT_UNDEF,
+					   sgsn_role);
 		if (!nse) {
 			vty_out(vty, "Failed to create NSE!%s", VTY_NEWLINE);
 			goto err;
diff --git a/tests/gb/gprs_ns2_vty.vty b/tests/gb/gprs_ns2_vty.vty
index f0253fc..952dc37 100644
--- a/tests/gb/gprs_ns2_vty.vty
+++ b/tests/gb/gprs_ns2_vty.vty
@@ -18,7 +18,7 @@
 OsmoNSdummy(config-ns)# list
 ...
   timer (tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries|tsns-prov|tsns-size-retries|tsns-config-retries) <0-65535>
-  nse <0-65535>
+  nse <0-65535> [sgsn-role]
   no nse <0-65535>
   bind (fr|udp) ID
   no bind ID

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I694fa6c80d04d13cb1afaae93a9ae43b6dfd2207
Gerrit-Change-Number: 23408
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210319/fc5f9626/attachment.htm>


More information about the gerrit-log mailing list