summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2021-10-02 13:01:04 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2021-10-02 13:10:58 +0200
commit596393abe5147bef205c317f7f08378d48b10ba2 (patch)
tree603e0f0bf70318d5c2933afdaecd93b7cc852176
parentbf7202046d4f4ab4f15478080720242bc94377aa (diff)
RSLEM: add f_chan_act_verify_tsc()
Will need this code again to verify the TSC during handover, so cast this in a separate function. Related: SYS#4895 Change-Id: I7a3f68ed1deba6a4a0a1cc4df7613638225c1640
-rw-r--r--library/RSL_Emulation.ttcn23
1 files changed, 13 insertions, 10 deletions
diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn
index 30adfba1..effe83bc 100644
--- a/library/RSL_Emulation.ttcn
+++ b/library/RSL_Emulation.ttcn
@@ -136,6 +136,18 @@ private function f_rx_or_fail(template RSL_Message exp_rx, RSL_DCHAN_PT rsl_pt :
return rx_rsl;
}
+function f_chan_act_verify_tsc(RSL_Message chan_act, template uint3_t tsc) {
+ var RSL_IE_Body ie;
+ if (f_rsl_find_ie(chan_act, RSL_IE_CHAN_IDENT, ie)) {
+ var uint3_t got_tsc := ie.chan_ident.ch_desc.v.tsc;
+ if (not match(got_tsc, tsc)) {
+ setverdict(fail, "RSL CHANnel ACTIVation: unexpected TSC in Channel Description: expected ",
+ tsc, " got ", got_tsc);
+ mtc.stop;
+ }
+ }
+}
+
/* establish a dedicated channel using 'ra' */
function f_chan_est(OCT1 ra, octetstring est_l3, template RslLinkId link_id, GsmFrameNumber fn := 23,
template uint3_t tsc := ?, RSL_DCHAN_PT rsl_pt := RSL, RSLEM_PROC_PT rsl_proc_pt := RSL_PROC)
@@ -158,16 +170,7 @@ runs on RSL_DchanHdlr {
rsl_pt.send(ts_RSL_EST_IND(g_chan_nr, valueof(link_id), est_l3));
/* Check above CHAN ACTIV */
- var RSL_Message chan_act := f_rslem_get_last_act(rsl_proc_pt, 0, g_chan_nr);
- var RSL_IE_Body ie;
- if (f_rsl_find_ie(chan_act, RSL_IE_CHAN_IDENT, ie)) {
- var uint3_t got_tsc := ie.chan_ident.ch_desc.v.tsc;
- if (not match(got_tsc, tsc)) {
- setverdict(fail, "RSL CHANnel ACTIVation: unexpected TSC in Channel Description: expected ",
- tsc, " got ", got_tsc);
- mtc.stop;
- }
- }
+ f_chan_act_verify_tsc(f_rslem_get_last_act(rsl_proc_pt, 0, g_chan_nr), tsc);
}
function f_deact_chan(RSL_Cause cause) runs on RSL_DchanHdlr