summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-10-12 20:03:34 +0000
committerlaforge <laforge@osmocom.org>2020-10-13 08:43:10 +0000
commit6ea71cda5a53752e556a6a9eab4ac8ae20d387fa (patch)
treec73d067d44ce24444577f3129b7090b4e3afbb3c /library
parentffd2ef1de4da33bb0e8d5c1fa6e375a7dc544886 (diff)
BSSAP_LE_Emulation: on register_imsi, make sure to wait for RESET ACK
Diffstat (limited to 'library')
-rw-r--r--library/BSSAP_LE_Emulation.ttcn26
1 files changed, 26 insertions, 0 deletions
diff --git a/library/BSSAP_LE_Emulation.ttcn b/library/BSSAP_LE_Emulation.ttcn
index 4965856..7818be1 100644
--- a/library/BSSAP_LE_Emulation.ttcn
+++ b/library/BSSAP_LE_Emulation.ttcn
@@ -115,6 +115,7 @@ type component BSSAP_LE_Emulation_CT {
var charstring g_ran_id;
var integer g_next_e1_ts := 1;
var BssapLeOps g_ran_ops;
+ var boolean g_reset_ack_ready := false;
};
private function f_conn_id_known(integer sccp_conn_id)
@@ -315,6 +316,7 @@ private function f_bssap_le_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) r
alt {
[] BSSAP_LE.receive(tr_BSSAP_LE_UNITDATA_ind(own, peer, tr_BSSMAP_LE_ResetAck)) {
log("Received RESET-ACK in response to RESET, we're ready to go!");
+ g_reset_ack_ready := true;
}
[] as_reset_ack();
[] BSSAP_LE.receive { repeat };
@@ -349,6 +351,7 @@ private altstep as_reset_ack() runs on BSSAP_LE_Emulation_CT {
log("Responding to inbound RESET with RESET-ACK");
BSSAP_LE.send(ts_BSSAP_LE_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress,
ts_BSSMAP_LE_ResetAck));
+ g_reset_ack_ready := true;
repeat;
}
}
@@ -553,6 +556,29 @@ function main(BssapLeOps ops, charstring id) runs on BSSAP_LE_Emulation_CT {
[] PROC.getcall(BSSAP_LE_register_imsi:{?,?,?}) -> param(imsi, tmsi, vc_hdlr) {
f_create_imsi(imsi, tmsi, vc_hdlr);
+
+ /* Wait for RESET-ACK if not received yet */
+ if (not g_reset_ack_ready) {
+ var integer wait_seconds := 10;
+ timer T_reset_ack := 1.0;
+ T_reset_ack.start;
+ alt {
+ [wait_seconds > 0] T_reset_ack.timeout {
+ if (g_reset_ack_ready) {
+ break;
+ }
+ wait_seconds := wait_seconds - 1;
+ T_reset_ack.start;
+ repeat;
+ }
+
+ [wait_seconds == 0] T_reset_ack.timeout {
+ setverdict(fail, "Timeout waiting for BSSMAP-LE RESET-ACK");
+ mtc.stop;
+ }
+ }
+ }
+
PROC.reply(BSSAP_LE_register_imsi:{imsi, tmsi, vc_hdlr}) to vc_hdlr;
}