fr-net: Echo back DL-UD in UL-UD when LLC SAPI '0010'B is used

This allows us to have bi-directional tests

Change-Id: I7637ee5f1a7cce0ed282c972b9cd0702ba86cbaa
This commit is contained in:
Harald Welte 2021-02-04 13:20:29 +01:00
parent 8525764791
commit e58e5b74da
1 changed files with 15 additions and 1 deletions

View File

@ -6,6 +6,8 @@ import from Osmocom_Gb_Types all;
import from NS_Emulation all;
import from BSSGP_Emulation all;
import from LLC_Types all;
import from LLC_Templates all;
modulepar {
integer mp_num_bvc := 10;
@ -69,7 +71,19 @@ type component test_CT {
private function CreateCallback(BssgpBvci bvci, BssgpCellId cell_id, OCT4 tlli, BssgpDecoded dec) runs on BSSGP_BVC_CT {
/* simply ignore any inbound traffic for now */
if (ischosen(dec.bssgp.pDU_BSSGP_UL_UNITDATA)) {
var PDU_LLC llc_rx := dec_PDU_LLC(dec.bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU)
select (llc_rx) {
case (tr_LLC_UI(sapi := '0010'B)) {
//log("BVCI=", bvci, ", CellId=", cell_id, ", TLLI=", tlli, ", BSSGP=", dec);
/* mirror back as DL-UNITDATA */
BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_DL_UD(tlli, dec.bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU), bvci, oct2int(tlli)));
}
case else {
/* simply ignore any inbound traffic for now */
}
}
}
}
private function f_init_gb(inout GbInstance gb, charstring id, integer offset) runs on test_CT {