Change in osmo-ttcn3-hacks[master]: NS_Emulation: Use endpoint list for SNS-CONFIG payload

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
Thu Apr 1 13:52:45 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23544 )

Change subject: NS_Emulation: Use endpoint list for SNS-CONFIG payload
......................................................................

NS_Emulation: Use endpoint list for SNS-CONFIG payload

We used to have no distinction between endpoints and NSVCs, meaning
that we could not have more than one NSVC per endpoint, which in turn
meant it was ok to iterate the list of NSVCs for generating the
endpoint lists in the SNS-CONFIG payload.

With Change-Id I05a50b966b8ce93497372ca403d40fd383dd35f7 we remove that
constraint and introduce an actual local IP endpoint list.  Let's use
that one for SNS-CONFIG.

Change-Id: Ifa91510430a017fa29592a3d5fa2a3697d29c9da
---
M library/NS_Emulation.ttcnpp
1 file changed, 13 insertions(+), 18 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/library/NS_Emulation.ttcnpp b/library/NS_Emulation.ttcnpp
index 85869da..d58dc45 100644
--- a/library/NS_Emulation.ttcnpp
+++ b/library/NS_Emulation.ttcnpp
@@ -504,30 +504,25 @@
 			}
 	}
 
-	/* generate a list of v4 + v6 endpoints based on the NSVConfigurations. This is not strictly
-	 * accurate, as we should create a list of _endpoints_, while we actually create a list of
-	 * NSVCs.  Those are only identical as long as our peer only implements one endpoint */
+	/* generate a list of v4 + v6 endpoints based on the IpEndpointTable */
 	private function gen_sns_ip_elems(out template (omit) IP4_Elements v4_out,
 					  out template (omit) IP6_Elements v6_out) runs on NS_CT {
 		var integer i;
 		var IP4_Elements v4 := {};
 		var IP6_Elements v6 := {};
 
-		for (i := 0; i < lengthof(g_config.nsvc); i := i + 1) {
-			var NSVCConfiguration nsvc_cfg := g_config.nsvc[i];
-			if (not ischosen(nsvc_cfg.provider.ip)) {
-				continue;
-			}
-			if (nsvc_cfg.provider.ip.address_family == AF_INET) {
-				v4 := v4 & { valueof(ts_SNS_IPv4(nsvc_cfg.provider.ip.local_ip,
-								 nsvc_cfg.provider.ip.local_udp_port,
-								 nsvc_cfg.provider.ip.signalling_weight,
-								 nsvc_cfg.provider.ip.data_weight)) };
-			} else if (nsvc_cfg.provider.ip.address_family == AF_INET6) {
-				v6 := v6 & { valueof(ts_SNS_IPv6(nsvc_cfg.provider.ip.local_ip,
-								 nsvc_cfg.provider.ip.local_udp_port,
-								 nsvc_cfg.provider.ip.signalling_weight,
-								 nsvc_cfg.provider.ip.data_weight)) };
+		for (i := 0; i < lengthof(g_ip_endpoints); i := i + 1) {
+			var IpEndpointTableEntry ipep := g_ip_endpoints[i];
+			if (ipep.address_family == AF_INET) {
+				v4 := v4 & { valueof(ts_SNS_IPv4(ipep.local_ip,
+								 ipep.local_udp_port,
+								 ipep.signalling_weight,
+								 ipep.data_weight)) };
+			} else if (ipep.address_family == AF_INET6) {
+				v6 := v6 & { valueof(ts_SNS_IPv6(ipep.local_ip,
+								 ipep.local_udp_port,
+								 ipep.signalling_weight,
+								 ipep.data_weight)) };
 			}
 		}
 

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ifa91510430a017fa29592a3d5fa2a3697d29c9da
Gerrit-Change-Number: 23544
Gerrit-PatchSet: 2
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/20210401/6dcaa7db/attachment.htm>


More information about the gerrit-log mailing list