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
This commit is contained in:
Neels Hofmeyr 2021-10-02 13:01:04 +02:00
parent bf7202046d
commit 596393abe5
1 changed files with 13 additions and 10 deletions

View File

@ -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