bsc: add RSL port args in MSC_ConnHdlr, RSLEM
Add explicit RSL_DCHAN_PT and RSLEM_PROC_PT args to functions and
altsteps related to channel establishment and assignment. This allows
establishing and assigning a channel on cells other than bts 0.
This is required for upcoming BSC_Tests.TC_cm_reestablishment().
Related: SYS#5130
Change-Id: Ic3206b7125ee22bf98330080d9b136cefe7da03f
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index fc12307..af93343 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -187,11 +187,11 @@
/* altstep for handling of IPACC media related commands. Activated by as_Media() to test
* RSL level media handling */
-altstep as_Media_ipacc() runs on MSC_ConnHdlr {
+altstep as_Media_ipacc(RSL_DCHAN_PT rsl_pt := RSL, RSL_DCHAN_PT rsl_pt_ho_target := RSL1) runs on MSC_ConnHdlr {
var RSL_Message rsl;
var RSL_IE_Body ie;
var boolean b_unused;
- [not g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl {
+ [not g_media.bts.ipa_crcx_seen] rsl_pt.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl {
/* Extract parameters from request + use in response */
if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) {
g_media.bts.rtp_pt := ie.ipa_rtp_pt;
@@ -199,14 +199,14 @@
if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD2, ie)) {
g_media.bts.rtp_pt := ie.ipa_rtp_pt2;
}
- RSL.send(ts_RSL_IPA_CRCX_ACK(g_chan_nr, g_media.bts.conn_id,
+ rsl_pt.send(ts_RSL_IPA_CRCX_ACK(g_chan_nr, g_media.bts.conn_id,
f_inet_addr(g_media.bts.bts.host),
g_media.bts.bts.port_nr,
g_media.bts.rtp_pt));
g_media.bts.ipa_crcx_seen := true;
repeat;
}
- [g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{
+ [g_media.bts.ipa_crcx_seen] rsl_pt.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{
/* Extract conn_id, ip, port, rtp_pt2 from request + use in response */
b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie);
if (g_media.bts.conn_id != ie.ipa_conn_id) {
@@ -224,7 +224,7 @@
if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD2, ie)) {
g_media.bts.rtp_pt := ie.ipa_rtp_pt2;
}
- RSL.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, g_media.bts.conn_id,
+ rsl_pt.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, g_media.bts.conn_id,
f_inet_addr(g_media.bts.peer.host),
g_media.bts.peer.port_nr,
g_media.bts.rtp_pt));
@@ -233,7 +233,7 @@
}
/* on second (new) BTS during hand-over */
- [not g_media.bts1.ipa_crcx_seen] RSL1.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl {
+ [not g_media.bts1.ipa_crcx_seen] rsl_pt_ho_target.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl {
/* Extract parameters from request + use in response */
if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) {
g_media.bts1.rtp_pt := ie.ipa_rtp_pt;
@@ -241,7 +241,7 @@
if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD2, ie)) {
g_media.bts1.rtp_pt := ie.ipa_rtp_pt2;
}
- RSL1.send(ts_RSL_IPA_CRCX_ACK(g_chan_nr, g_media.bts1.conn_id,
+ rsl_pt_ho_target.send(ts_RSL_IPA_CRCX_ACK(g_chan_nr, g_media.bts1.conn_id,
f_inet_addr(g_media.bts1.bts.host),
g_media.bts1.bts.port_nr,
g_media.bts1.rtp_pt));
@@ -249,7 +249,7 @@
repeat;
}
/* on second (new) BTS during hand-over */
- [g_media.bts1.ipa_crcx_seen] RSL1.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{
+ [g_media.bts1.ipa_crcx_seen] rsl_pt_ho_target.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{
/* Extract conn_id, ip, port, rtp_pt2 from request + use in response */
b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie);
if (g_media.bts1.conn_id != ie.ipa_conn_id) {
@@ -267,7 +267,7 @@
if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD2, ie)) {
g_media.bts1.rtp_pt := ie.ipa_rtp_pt2;
}
- RSL1.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, g_media.bts1.conn_id,
+ rsl_pt_ho_target.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, g_media.bts1.conn_id,
f_inet_addr(g_media.bts1.peer.host),
g_media.bts1.peer.port_nr,
g_media.bts1.rtp_pt));
@@ -654,17 +654,17 @@
}
function f_rsl_send_l3(template PDU_ML3_MS_NW l3, template (omit) RslLinkId link_id := omit,
- template (omit) RslChannelNr chan_nr := omit) runs on MSC_ConnHdlr {
+ template (omit) RslChannelNr chan_nr := omit, RSL_DCHAN_PT rsl_pt := RSL) runs on MSC_ConnHdlr {
if (not isvalue(link_id)) {
link_id := ts_RslLinkID_DCCH(0);
}
if (not isvalue(chan_nr)) {
chan_nr := g_chan_nr;
}
- RSL.send(ts_RSL_DATA_IND(valueof(chan_nr), valueof(link_id), enc_PDU_ML3_MS_NW(valueof(l3))));
+ rsl_pt.send(ts_RSL_DATA_IND(valueof(chan_nr), valueof(link_id), enc_PDU_ML3_MS_NW(valueof(l3))));
}
-function f_rsl_reply(template PDU_ML3_MS_NW l3, RSL_Message orig) runs on MSC_ConnHdlr {
+function f_rsl_reply(template PDU_ML3_MS_NW l3, RSL_Message orig, RSL_DCHAN_PT rsl_pt := RSL) runs on MSC_ConnHdlr {
var RslChannelNr chan_nr := orig.ies[0].body.chan_nr;
var RslLinkId link_id;
if (orig.msg_type == RSL_MT_ENCR_CMD) {
@@ -672,7 +672,7 @@
} else {
link_id := orig.ies[1].body.link_id;
}
- f_rsl_send_l3(l3, link_id, chan_nr);
+ f_rsl_send_l3(l3, link_id, chan_nr, rsl_pt := rsl_pt);
}
/* Convert the cipher representation on BSSMAP to the representation used on RSL */
@@ -783,7 +783,8 @@
setverdict(pass);
}
-function f_cipher_mode(TestHdlrEncrParams enc, boolean exp_fail := false)
+function f_cipher_mode(TestHdlrEncrParams enc, boolean exp_fail := false,
+ RSL_DCHAN_PT rsl_pt := RSL, RSLEM_PROC_PT rsl_proc_pt := RSL_PROC)
runs on MSC_ConnHdlr {
var PDU_BSSAP bssap;
var RSL_Message rsl;
@@ -796,14 +797,14 @@
alt {
/* RSL/UE Side */
- [] RSL.receive(tr_RSL_ENCR_CMD(g_chan_nr)) -> value rsl {
+ [] rsl_pt.receive(tr_RSL_ENCR_CMD(g_chan_nr)) -> value rsl {
var PDU_ML3_NW_MS l3 := dec_PDU_ML3_NW_MS(rsl.ies[3].body.l3_info.payload);
log("Rx L3 from net: ", l3);
f_verify_encr_info(rsl);
if (ischosen(l3.msgs.rrm.cipheringModeCommand)) {
- f_rsl_reply(ts_RRM_CiphModeCompl, rsl);
+ f_rsl_reply(ts_RRM_CiphModeCompl, rsl, rsl_pt := rsl_pt);
}
repeat;
}
@@ -956,9 +957,9 @@
return tsc;
}
-altstep as_assignment(inout AssignmentState st) runs on MSC_ConnHdlr {
+altstep as_assignment(inout AssignmentState st, RSL_DCHAN_PT rsl_pt := RSL, RSLEM_PROC_PT rsl_proc_pt := RSL_PROC) runs on MSC_ConnHdlr {
var RSL_Message rsl;
- [not st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> value rsl {
+ [not st.rr_ass_cmpl_seen] rsl_pt.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> value rsl {
var PDU_ML3_NW_MS l3 := dec_PDU_ML3_NW_MS(rsl.ies[2].body.l3_info.payload);
log("Rx L3 from net: ", l3);
if (ischosen(l3.msgs.rrm.assignmentCommand)) {
@@ -979,20 +980,20 @@
/* FIXME: Determine TRX NR by ARFCN, instead of hard-coded TRX0! */
/* register our component for this channel number at the RSL Emulation */
- f_rslem_register(0, new_chan_nr);
+ f_rslem_register(0, new_chan_nr, PT := rsl_proc_pt);
/* dispatch queued messages for this channel (if any) */
- f_rslem_dchan_queue_dispatch();
+ f_rslem_dchan_queue_dispatch(PT := rsl_proc_pt);
var PDU_ML3_MS_NW l3_tx := valueof(ts_RRM_AssignmentComplete('00'O));
/* send assignment complete over the new channel */
- RSL.send(ts_RSL_EST_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)),
+ rsl_pt.send(ts_RSL_EST_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)),
enc_PDU_ML3_MS_NW(l3_tx)));
/* by default, send via the new channel from now */
st.old_chan_nr := g_chan_nr;
g_chan_nr := new_chan_nr;
st.rr_ass_cmpl_seen := true;
/* obtain channel activation from RSL_Emulation for new channel */
- var RSL_Message chan_act := f_rslem_get_last_act(RSL_PROC, 0, g_chan_nr);
+ var RSL_Message chan_act := f_rslem_get_last_act(rsl_proc_pt, 0, g_chan_nr);
/* check it (e.g. for correct ciphering parameters) */
f_check_chan_act(st, chan_act);
repeat;
@@ -1000,20 +1001,20 @@
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Unexpected L3 received", l3));
}
}
- [st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_DEACT_SACCH(st.old_chan_nr)) {
+ [st.rr_ass_cmpl_seen] rsl_pt.receive(tr_RSL_DEACT_SACCH(st.old_chan_nr)) {
st.old_lchan_deact_sacch_seen := true;
repeat;
}
- [st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_REL_REQ(st.old_chan_nr, tr_RslLinkID_DCCH(0))) {
+ [st.rr_ass_cmpl_seen] rsl_pt.receive(tr_RSL_REL_REQ(st.old_chan_nr, tr_RslLinkID_DCCH(0))) {
st.old_lchan_rll_rel_req_seen := true;
- RSL.send(ts_RSL_REL_CONF(st.old_chan_nr, valueof(ts_RslLinkID_DCCH(0))));
+ rsl_pt.send(ts_RSL_REL_CONF(st.old_chan_nr, valueof(ts_RslLinkID_DCCH(0))));
repeat;
}
- [st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_RF_CHAN_REL(st.old_chan_nr)) {
- RSL.send(ts_RSL_RF_CHAN_REL_ACK(st.old_chan_nr));
+ [st.rr_ass_cmpl_seen] rsl_pt.receive(tr_RSL_RF_CHAN_REL(st.old_chan_nr)) {
+ rsl_pt.send(ts_RSL_RF_CHAN_REL_ACK(st.old_chan_nr));
/* unregister for old channel number in RSL emulation */
/* FIXME: Determine TRX NR by ARFCN, instead of hard-coded TRX0! */
- f_rslem_unregister(0, st.old_chan_nr);
+ f_rslem_unregister(0, st.old_chan_nr, PT := rsl_proc_pt);
st.assignment_done := true;
repeat;
}
diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn
index f64329a..969dbce 100644
--- a/library/RSL_Emulation.ttcn
+++ b/library/RSL_Emulation.ttcn
@@ -109,7 +109,7 @@
* Client Component for a single dedicated channel
***********************************************************************/
-private function f_rx_or_fail(template RSL_Message exp_rx) runs on RSL_DchanHdlr return RSL_Message
+private function f_rx_or_fail(template RSL_Message exp_rx, RSL_DCHAN_PT rsl_pt := RSL) runs on RSL_DchanHdlr return RSL_Message
{
var RSL_Message rx_rsl;
timer T := 10.0;
@@ -117,11 +117,11 @@
/* request a channel to be established */
T.start;
alt {
- [] RSL.receive(exp_rx) -> value rx_rsl {
+ [] rsl_pt.receive(exp_rx) -> value rx_rsl {
T.stop;
return rx_rsl;
}
- [] RSL.receive {
+ [] rsl_pt.receive {
setverdict(fail, "Unexpected RSL message on DCHAN");
mtc.stop;
}
@@ -136,16 +136,16 @@
/* 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 := ?)
+ template uint3_t tsc := ?, RSL_DCHAN_PT rsl_pt := RSL, RSLEM_PROC_PT rsl_proc_pt := RSL_PROC)
runs on RSL_DchanHdlr {
var RSL_Message rx_rsl;
var GsmRrMessage rr;
/* request a channel to be established */
- RSL.send(ts_RSLDC_ChanRqd(ra, fn));
+ rsl_pt.send(ts_RSLDC_ChanRqd(ra, fn));
/* At this point the BSC sends a CHAN ACTIV which we always ACK. Checking it below. */
/* expect immediate assignment */
- rx_rsl := f_rx_or_fail(tr_RSL_IMM_ASSIGN);
+ rx_rsl := f_rx_or_fail(tr_RSL_IMM_ASSIGN, rsl_pt := rsl_pt);
rr := dec_GsmRrMessage(rx_rsl.ies[1].body.full_imm_ass_info.payload);
if (not match(rr.payload.imm_ass.chan_desc.tsc, tsc)) {
setverdict(fail, "Immediate Assignment: unexpected TSC in Channel Description: expected ", tsc, " got ",
@@ -153,10 +153,10 @@
mtc.stop;
}
g_chan_nr := rr.payload.imm_ass.chan_desc.chan_nr;
- RSL.send(ts_RSL_EST_IND(g_chan_nr, valueof(link_id), est_l3));
+ 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, 0, g_chan_nr);
+ 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;