gprs_gb: Add more comments to code

Change-Id: I89ab4d8be112ca44a64fecbadc60ca8ac3e6bbea
This commit is contained in:
Harald Welte 2018-03-02 17:00:22 +01:00
parent bacca28a71
commit 9d83dd068d
1 changed files with 11 additions and 0 deletions

View File

@ -156,6 +156,7 @@ module Test {
const octetstring gmm_auth_req := '081200102198c72477ea104895e8b959acc58b108182'O;
/* Wrap downlink GMM into LLC, encode + send it via BSSGP to PCU */
function tx_gmm(BIT1 c_r, in octetstring gmm_pdu, BIT4 sapi := c_LLC_SAPI_LLGMM) runs on dummy_CT {
var PDU_LLC llc;
@ -171,6 +172,7 @@ module Test {
BSSGP.send(ts_BSSGP_DL_UD(g_mmctx.tlli, enc_PDU_LLC(llc)));
}
/* Establish BSSGP connection to PCU */
function f_bssgp_establish() runs on dummy_CT {
timer T:= 60.0;
@ -185,6 +187,7 @@ module Test {
log("BSSGP successfully initialized");
}
/* Send PS-PAGING via BSSGP to PCU, expect it to show up on L1/Um */
testcase TC_paging() runs on dummy_CT {
var hexstring imsi := '262420123456789'H;
var BssgpBvci bvci := 196;
@ -207,6 +210,7 @@ module Test {
}
}
/* Establish an UL TBF: Tune to ARFCN, send RACH, receive AGCH, enable TBF Rx */
function f_establish_ul_tbf() runs on dummy_CT {
timer T := 5.0;
var BCCH_tune_req tune_req := { { false, 871 }, true };
@ -225,6 +229,7 @@ module Test {
T.stop;
}
/* Template fro uplink Data block */
template RlcmacUlBlock t_RLCMAC_UL_DATA(template uint5_t tfi, template uint4_t cv, template uint7_t bsn,
template LlcBlocks blocks := {}, template boolean stall := false) := {
data := {
@ -260,6 +265,7 @@ uint3_t usf) := {
usf := usf
}
/* Receive Template for Downlink ACK/NACK */
template RlcmacDlBlock tr_RLCMAC_ACK_NACK(template uint5_t ul_tfi, template GprsTlli tlli := ?) := {
ctrl := {
mac_hdr := {
@ -293,12 +299,14 @@ uint3_t usf) := {
}
}
/* Template for Uplink MAC Control Header */
template UlMacCtrlHeader t_RLCMAC_UlMacCtrlH(template MacPayloadType pt, template boolean retry := false) := {
payload_type := pt,
spare := '00000'B,
retry := retry
}
/* Template for Uplink Conntrol ACK */
template RlcmacUlBlock ts_RLCMAC_CTRL_ACK(GprsTlli tlli, CtrlAck ack := MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN) := {
ctrl := {
mac_hdr := t_RLCMAC_UlMacCtrlH(MAC_PT_RLCMAC_NO_OPT),
@ -314,6 +322,7 @@ uint3_t usf) := {
}
}
/* Template for a LlcBlock (part of a LLC frame inside RlcMac?lDataBlock */
template LlcBlock t_RLCMAC_LLCBLOCK(octetstring data, BIT1 more := '0'B, boolean e := true) := {
hdr := {
length_ind := lengthof(data),
@ -323,11 +332,13 @@ uint3_t usf) := {
payload := data
}
/* compute a random TLLI; FIXME: what about TLLI prefix / local/foreign/...? */
function f_random_tlli() return GprsTlli {
var GprsTlli tlli := float2int(rnd()* 4294967295.0);
return tlli;
}
/* Send a single Uplink Block via Um; Verify reception on BSSGP; Expect UL_ACK on Um */
function f_single_ul_block(GprsCodingScheme cs) runs on dummy_CT {
var GprsTlli tlli := f_random_tlli();
var octetstring payload := '01020304'O;