NS_Emulation: Factor-out function to broadcast to all NS_VCs
Change-Id: I8cd16031dbbd244dcff74fc8a1cd69e9f8a06dbf
diff --git a/library/NS_Emulation.ttcnpp b/library/NS_Emulation.ttcnpp
index 6d8113c..24c9941 100644
--- a/library/NS_Emulation.ttcnpp
+++ b/library/NS_Emulation.ttcnpp
@@ -461,6 +461,12 @@
}
}
+ private function f_broadcast_ns_ctrl(template (value) NsCtrlRequest req) runs on NS_CT {
+ for (var integer i := 0; i < lengthof(g_nsvcs); i := i+1) {
+ NSVC.send(req) to g_nsvcs[i].vc_conn;
+ }
+ }
+
/* simple IP Sub-Network Service responder for the SGSN side. This is not a full implementation
* of the protocol, merely sufficient to make the PCU/BSS side happy to proceed */
private altstep as_vcg_sns_sgsn() runs on NS_CT {
@@ -489,9 +495,7 @@
/* success */
log("SNS Config succeeded. Sending Alive");
/* inform all NS-VC that they are now considered alive */
- for (var integer i := 0; i < lengthof(g_nsvcs); i := i+1) {
- NSVC.send(NsCtrlRequest:StartAliveProcedure) to g_nsvcs[i].vc_conn;
- }
+ f_broadcast_ns_ctrl(NsCtrlRequest:StartAliveProcedure);
}
[] NSVC.receive(SnsIndication:{sind.nsvci,
tr_SNS_CONFIG_ACK(g_config.nsei, ?)}) from vc {