aboutsummaryrefslogtreecommitdiffstats
path: root/library/IPA_Emulation.ttcnpp
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-05-24 20:00:00 +0200
committerHarald Welte <laforge@gnumonks.org>2018-05-24 20:02:55 +0200
commit2e32e4321b4db01537919a725b679ad554d96dbc (patch)
tree371f5cb081fd3d957c3ed11f8c818ed87c57571a /library/IPA_Emulation.ttcnpp
parentb1eaa6fc9192c3c94f16129dc61ad714effa495e (diff)
BSSAP/IPA integration: Wait for SCCPLite to be established
Before this patch, we had some problems related to synchronization between the IPA transport, SCCP emulation and BSSAP layer in SCCPlite configurations. This code ensures that f_bssap_init() will block until the IPA connection (client or server) is established, and then start the SCCP and BSSAP emulation components in the right order. This in turn ensures that the initial BSSMAP RESET that we're sending from the TTCN-3 side is only sent once the IPA connection is fully established, and the CCM Identity handshake has happened before. Change-Id: I483ddd45c1cf631a5a9d8f862b6ca728b38bdc14 Related: OS#2544
Diffstat (limited to 'library/IPA_Emulation.ttcnpp')
-rw-r--r--library/IPA_Emulation.ttcnpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp
index 41a3968d..df2b15e4 100644
--- a/library/IPA_Emulation.ttcnpp
+++ b/library/IPA_Emulation.ttcnpp
@@ -243,6 +243,9 @@ private template IpaCcmRespPart t_IdRespPart(IpaCcmIdTag tag, charstring payload
}
private function f_send_IPA_EVT(template ASP_IPA_Event evt) runs on IPA_Emulation_CT {
+ if (IPA_SP_PORT.checkstate("Connected")) {
+ IPA_SP_PORT.send(evt);
+ }
#ifdef IPA_EMULATION_RSL
if (IPA_RSL_PORT.checkstate("Connected")) {
IPA_RSL_PORT.send(evt);
@@ -368,6 +371,7 @@ private function f_ccm_rx_server(PDU_IPA_CCM ccm) runs on IPA_Emulation_CT {
* the TCP connection is established. Other implementations may differ.
* We currently ignore it completely - but actually we should make sure that
* one ID_ACK is received by the server at some point */
+ f_send_IPA_EVT(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_ID_ACK));
}
case (IPAC_MSGT_ID_RESP) {
log("IPA ID RESP: ", ccm.u.resp);
@@ -635,4 +639,24 @@ private function ScanEvents() runs on IPA_Emulation_CT {
}
}
+/***********************************************************************
+ * IPA Event waiter component. Wait for ASP_IPA_EVENT_ID_ACK
+ ***********************************************************************/
+
+type component IPA_EventWaiter_CT {
+ port IPA_SP_PT IPA_SP_PORT;
+}
+
+function waiter_main(template ASP_IPA_Event wait_for := t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_ID_ACK))
+runs on IPA_EventWaiter_CT {
+
+ alt {
+ [] IPA_SP_PORT.receive(wait_for) {
+ setverdict(pass);
+ }
+ [] IPA_SP_PORT.receive { repeat; }
+ }
+}
+
+
}