cbc: Support mme/bsc sctp/tcp server mode
Related: OS#4945
Change-Id: I9fa4ddfa18ac85644f219874e6b2166e1795e3a9
diff --git a/library/sbcap/SBC_AP_Adapter.ttcn b/library/sbcap/SBC_AP_Adapter.ttcn
index 3217c5e..515a723 100644
--- a/library/sbcap/SBC_AP_Adapter.ttcn
+++ b/library/sbcap/SBC_AP_Adapter.ttcn
@@ -77,6 +77,23 @@
g_SBC_AP_conn_id[idx] := res.connId;
}
+function f_wait_client_connect(integer idx := 0) runs on SBC_AP_Adapter_CT {
+ var IPL4asp_Types.PortEvent rx_event;
+ SBC_AP[idx].receive(IPL4asp_Types.PortEvent:{connOpened:=?}) -> value rx_event {
+ log("Connection from ", rx_event.connOpened.remName, ":", rx_event.connOpened.remPort);
+ /* we want to store the client's connId, not the 'bind socket' one */
+ g_SBC_AP_conn_id[idx] := rx_event.connOpened.connId;
+ }
+ timer Tcommup := 10.0;
+ Tcommup.start;
+ alt {
+ [] SBC_AP[idx].receive(tr_SctpAssocChange_COMM_UP(g_SBC_AP_conn_id[idx])) {}
+ [] Tcommup.timeout {
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting SCTP_COMM_UP");
+ }
+ }
+}
+
function f_SBC_AP_send(template (value) SBC_AP_PDU pdu, integer idx := 0) runs on SBC_AP_Adapter_CT {
SBC_AP[idx].send(ts_SBC_AP_Send(g_SBC_AP_conn_id[idx], pdu));
}