[MERGED] osmo-ttcn3-hacks[master]: gprs_gb: Add more comments to code

2018-03-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: gprs_gb: Add more comments to code
..


gprs_gb: Add more comments to code

Change-Id: I89ab4d8be112ca44a64fecbadc60ca8ac3e6bbea
---
M gprs_gb/Test.ttcn
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/gprs_gb/Test.ttcn b/gprs_gb/Test.ttcn
index 732b3f5..e9cb40e 100644
--- a/gprs_gb/Test.ttcn
+++ b/gprs_gb/Test.ttcn
@@ -156,6 +156,7 @@
 
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 @@
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 @@
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 @@
}
}
 
+   /* 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 @@
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 @@
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 @@
}
}
 
+   /* Template for Uplink MAC Control Header */
template UlMacCtrlHeader t_RLCMAC_UlMacCtrlH(template MacPayloadType 
pt, template boolean retry := false) := {
payload_type := pt,
spare := '0'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 @@
}
}
 
+   /* 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 @@
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;

-- 
To view, visit https://gerrit.osmocom.org/7067
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I89ab4d8be112ca44a64fecbadc60ca8ac3e6bbea
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-ttcn3-hacks[master]: gprs_gb: Add more comments to code

2018-03-03 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7067
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I89ab4d8be112ca44a64fecbadc60ca8ac3e6bbea
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-ttcn3-hacks[master]: gprs_gb: Add more comments to code

2018-03-03 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7067

gprs_gb: Add more comments to code

Change-Id: I89ab4d8be112ca44a64fecbadc60ca8ac3e6bbea
---
M gprs_gb/Test.ttcn
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/67/7067/1

diff --git a/gprs_gb/Test.ttcn b/gprs_gb/Test.ttcn
index 732b3f5..e9cb40e 100644
--- a/gprs_gb/Test.ttcn
+++ b/gprs_gb/Test.ttcn
@@ -156,6 +156,7 @@
 
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 @@
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 @@
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 @@
}
}
 
+   /* 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 @@
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 @@
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 @@
}
}
 
+   /* Template for Uplink MAC Control Header */
template UlMacCtrlHeader t_RLCMAC_UlMacCtrlH(template MacPayloadType 
pt, template boolean retry := false) := {
payload_type := pt,
spare := '0'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 @@
}
}
 
+   /* 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 @@
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;

-- 
To view, visit https://gerrit.osmocom.org/7067
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89ab4d8be112ca44a64fecbadc60ca8ac3e6bbea
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte