Change in osmo-pcu[master]: ns2: follow ns2 dialect changes

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/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Dec 16 12:00:40 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/21728 )

Change subject: ns2: follow ns2 dialect changes
......................................................................

ns2: follow ns2 dialect changes

NS2 introduce a ns dialect to differentiate
between the 4 possible dialects.

Related: OS#4472, OS#4890
Depends: libosmocore.git Ia118bb6f994845d84db09de7a94856f5ca573404
Change-Id: I16dc82c38eb75c2b9d1197640a955fec7df84efc
---
M src/bts.h
M src/gprs_bssgp_pcu.cpp
M src/pcu_vty.c
3 files changed, 13 insertions(+), 9 deletions(-)

Approvals:
  laforge: Looks good to me, approved; Verified



diff --git a/src/bts.h b/src/bts.h
index fd52067..055b131 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -23,17 +23,23 @@
 
 #ifdef __cplusplus
 extern "C" {
+#endif
+
 #include <osmocom/core/linuxlist.h>
 #include <osmocom/core/rate_ctr.h>
 #include <osmocom/core/stat_item.h>
 #include <osmocom/core/tdef.h>
+#include <osmocom/gprs/gprs_ns2.h>
 #include <osmocom/gsm/l1sap.h>
 #include <osmocom/gsm/protocol/gsm_04_08.h>
 #include <osmocom/gsm/gsm48.h>
 #include "mslot_class.h"
 #include "gsm_rlcmac.h"
+#ifdef __cplusplus
 }
+#endif
 
+#ifdef __cplusplus
 #include "poll_controller.h"
 #include "sba.h"
 #include "tbf.h"
@@ -170,7 +176,7 @@
 	char *pcu_sock_path;
 
 	/* Are we talking Gb with IP-SNS (true) or classic Gb? */
-	bool gb_dialect_sns;
+	enum gprs_ns2_dialect ns_dialect;
 
 	/* Packet Application Information (3GPP TS 44.060 11.2.47, usually ETWS primary message). We don't need to store
 	 * more than one message, because they get sent so rarely. */
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 934d8fc..4d24d2e 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -984,7 +984,7 @@
 	bts->nse = gprs_ns2_nse_by_nsei(bts->nsi, nsei);
 	if (!bts->nse)
 		bts->nse = gprs_ns2_create_nse(bts->nsi, nsei,
-					       GPRS_NS2_LL_UDP);
+					       GPRS_NS2_LL_UDP, bts->ns_dialect);
 
 	if (!bts->nse) {
 		LOGP(DBSSGP, LOGL_ERROR, "Failed to create NSE\n");
@@ -997,7 +997,7 @@
 			continue;
 
 		/* FIXME: for SNS we just use the first successful NS-VC instead of all for the initial connect */
-		if (bts->gb_dialect_sns) {
+		if (bts->ns_dialect == NS2_DIALECT_SNS) {
 			rc = gprs_ns2_ip_connect_sns(bind[i], &remote[i], nsei);
 			if (!rc)
 				return rc;
@@ -1066,7 +1066,7 @@
 		gprs_ns2_free_nses(bts->nsi);
 		gprs_ns2_free_binds(bts->nsi);
 		rc = ns_create_nsvc(bts, nsei, local, remote, nsvci, valid);
-	} else if (bts->gb_dialect_sns) {
+	} else if (bts->ns_dialect == NS2_DIALECT_SNS) {
 		/* SNS: check if the initial nsvc is the same, if not recreate it */
 		const struct osmo_sockaddr *initial = gprs_ns2_nse_sns_remote(bts->nse);
 		for (unsigned int i = 0; i < PCU_IF_NUM_NSVC; i++) {
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index bf45686..800079c 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -246,7 +246,7 @@
 		}
 	}
 
-	if (bts->gb_dialect_sns)
+	if (bts->ns_dialect == NS2_DIALECT_SNS)
 		vty_out(vty, " gb-dialect ip-sns%s", VTY_NEWLINE);
 	else
 		vty_out(vty, " gb-dialect classic%s", VTY_NEWLINE);
@@ -1131,11 +1131,9 @@
 	struct gprs_rlcmac_bts *bts = bts_main_data();
 
 	if (!strcmp(argv[0], "ip-sns")) {
-		bts->gb_dialect_sns = true;
-		gprs_ns2_vty_force_vc_mode(true, NS2_VC_MODE_ALIVE, "gb-dialect is ip-sns");
+		bts->ns_dialect = NS2_DIALECT_SNS;
 	} else {
-		bts->gb_dialect_sns = false;
-		gprs_ns2_vty_force_vc_mode(false, 0, NULL);
+		bts->ns_dialect = NS2_DIALECT_IPACCESS;
 	}
 
 	return CMD_SUCCESS;

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I16dc82c38eb75c2b9d1197640a955fec7df84efc
Gerrit-Change-Number: 21728
Gerrit-PatchSet: 4
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.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/20201216/8f5e9a79/attachment.htm>


More information about the gerrit-log mailing list