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

laforge gerrit-no-reply at lists.osmocom.org
Tue Mar 23 23:53:27 UTC 2021


laforge has submitted this change. ( 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, 10 insertions(+), 4 deletions(-)

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



diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index a769ad1..42ab2b2 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> [ip-sns-role-sgsn]",
       "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], "ip-sns-role-sgsn"))
+		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;
@@ -526,7 +531,8 @@
 
 	OSMO_ASSERT(vnse);
 
-	vty_out(vty, " nse %u%s", nse->nsei, VTY_NEWLINE);
+	vty_out(vty, " nse %u%s%s", nse->nsei,
+		nse->ip_sns_role_sgsn ? " ip-sns-role-sgsn" : "", VTY_NEWLINE);
 	switch (nse->dialect) {
 	case GPRS_NS2_DIALECT_SNS:
 		ns2_sns_write_vty(vty, nse);
diff --git a/tests/gb/gprs_ns2_vty.vty b/tests/gb/gprs_ns2_vty.vty
index f0253fc..f344bf3 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> [ip-sns-role-sgsn]
   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: 6
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
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/20210323/99cc41f4/attachment.htm>


More information about the gerrit-log mailing list