gbproxy: Remove array of three cell IDs

The hard-coded array of three cell identifiers in the ConnHdlr
configuration doesn't really reflect situations with a different
number of PCUs than three, and a different count of BVCs than one
per NSE.

Let's pass the entire PCU configuration as parameter into every
ConnHdlr.  This way, the ConnHdlr can learn whatever cell identities
there mgiht be in whatever number of BVCs of each NSE.

Change-Id: I0bb22be612b8aa256c9ee115ee44ea849c4225e1
This commit is contained in:
Harald Welte 2020-11-17 18:20:00 +01:00
parent ea1ba59134
commit 16357a970a
1 changed files with 14 additions and 11 deletions

View File

@ -251,7 +251,7 @@ type record BSSGP_ConnHdlrPars {
OCT4 tlli,
OCT4 tlli_old optional,
RoutingAreaIdentificationV ra optional,
BssgpCellIds bssgp_cell_id,
GbInstances pcu,
float t_guard
};
@ -427,7 +427,7 @@ runs on test_CT return BSSGP_ConnHdlr {
tlli := f_gprs_tlli_random(),
tlli_old := omit,
ra := omit,
bssgp_cell_id := { pcu[0].cfg.bvc[0].cell_id, pcu[1].cfg.bvc[0].cell_id, pcu[2].cfg.bvc[0].cell_id },
pcu := g_pcu,
t_guard := t_guard
};
@ -572,15 +572,16 @@ testcase TC_BVC_bringup() runs on test_CT {
}
friend function f_bssgp_suspend(integer ran_idx := 0) runs on BSSGP_ConnHdlr return OCT1 {
var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0];
timer T := 5.0;
var PDU_BSSGP rx_pdu;
PCU_SIG[ran_idx].send(ts_BSSGP_SUSPEND(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id));
PCU_SIG[ran_idx].send(ts_BSSGP_SUSPEND(g_pars.tlli, bvcc.cell_id.ra_id));
T.start;
alt {
[] PCU_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_ACK(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id, ?)) -> value rx_pdu {
[] PCU_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_ACK(g_pars.tlli, bvcc.cell_id.ra_id, ?)) -> value rx_pdu {
return rx_pdu.pDU_BSSGP_SUSPEND_ACK.suspend_Reference_Number.suspend_Reference_Number_value;
}
[] PCU_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_NACK(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id, ?)) -> value rx_pdu {
[] PCU_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_NACK(g_pars.tlli, bvcc.cell_id.ra_id, ?)) -> value rx_pdu {
setverdict(fail, "SUSPEND-NACK in response to SUSPEND for TLLI ", g_pars.tlli);
mtc.stop;
}
@ -593,13 +594,13 @@ friend function f_bssgp_suspend(integer ran_idx := 0) runs on BSSGP_ConnHdlr ret
}
friend function f_bssgp_resume(OCT1 susp_ref, integer ran_idx := 0) runs on BSSGP_ConnHdlr {
var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0];
timer T := 5.0;
PCU_SIG[ran_idx].send(ts_BSSGP_RESUME(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id, susp_ref));
PCU_SIG[ran_idx].send(ts_BSSGP_RESUME(g_pars.tlli, bvcc.cell_id.ra_id, susp_ref));
T.start;
alt {
[] PCU_SIG[ran_idx].receive(tr_BSSGP_RESUME_ACK(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id));
[] PCU_SIG[ran_idx].receive(tr_BSSGP_RESUME_NACK(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id,
?)) {
[] PCU_SIG[ran_idx].receive(tr_BSSGP_RESUME_ACK(g_pars.tlli, bvcc.cell_id.ra_id));
[] PCU_SIG[ran_idx].receive(tr_BSSGP_RESUME_NACK(g_pars.tlli, bvcc.cell_id.ra_id, ?)) {
setverdict(fail, "RESUME-NACK in response to RESUME for TLLI ", g_pars.tlli);
mtc.stop;
}
@ -613,13 +614,15 @@ friend function f_bssgp_resume(OCT1 susp_ref, integer ran_idx := 0) runs on BSSG
/* send uplink-unitdata of a variety of different sizes; expect it to show up on SGSN */
private function f_TC_ul_unitdata(charstring id) runs on BSSGP_ConnHdlr {
var integer ran_idx := 0;
var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0];
var integer i;
for (i := 0; i < 1024; i := i+1) {
var octetstring payload := f_rnd_octstring(i);
var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_UL_UD(g_pars.tlli, g_pars.bssgp_cell_id[0], payload);
var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload);
/* we cannot use pdu_tx as there are some subtle differences in the length field :/ */
var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_UL_UD(g_pars.tlli, g_pars.bssgp_cell_id[0], payload);
var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload);
f_pcu2sgsn(pdu_tx, pdu_rx);
}