summaryrefslogtreecommitdiffstats
path: root/lapdm
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-30 22:51:04 +0200
committerHarald Welte <laforge@gnumonks.org>2017-07-30 22:51:04 +0200
commitffcad68801b06e1799ca47a358396986c30d474f (patch)
tree2af3c08e97a5223f4827ac1af04798f85b109ea5 /lapdm
parent43e060a50dfc4f64a12fe7c2a9afd20165a44f41 (diff)
lapdm: Updated to recent changes in library code (make it compile again)
Diffstat (limited to 'lapdm')
-rw-r--r--lapdm/L1CTL_Test.ttcn52
-rw-r--r--lapdm/LAPDm_RAW_PT.ttcn1
-rw-r--r--lapdm/LAPDm_Types.ttcn6
-rwxr-xr-xlapdm/gen_links.sh2
-rwxr-xr-xlapdm/regen_makefile.sh2
5 files changed, 58 insertions, 5 deletions
diff --git a/lapdm/L1CTL_Test.ttcn b/lapdm/L1CTL_Test.ttcn
index e780de8..98dc43b 100644
--- a/lapdm/L1CTL_Test.ttcn
+++ b/lapdm/L1CTL_Test.ttcn
@@ -91,6 +91,30 @@ module L1CTL_Test {
}
}
+ template LapdmFrame t_nopayload(template GsmSapi sapi) := {
+ b := {
+ addr := tr_LapdmAddr(sapi, true),
+ ctrl := ?,
+ len := 0,
+ m := false,
+ el := 1,
+ payload := ''O
+ }
+ }
+
+ template LapdmFrame LAPDm_B_DISC(template GsmSapi sapi) modifies t_nopayload := {
+ b := {
+ ctrl := t_LapdmCtrlDISC(true)
+ }
+ }
+
+ template LapdmFrame LAPDm_B_RR(template GsmSapi sapi, template uint3_t nr) modifies t_nopayload := {
+ b := {
+ ctrl := t_LapdmCtrlRR(nr, false)
+ }
+ }
+
+
function f_test_sabm_results_in_ua(uint8_t sapi, boolean use_sacch, octetstring payload) runs on dummy_CT return boolean {
var LAPDm_ph_data phd;
var boolean result := false;
@@ -106,6 +130,7 @@ module L1CTL_Test {
[] LAPDM.receive(t_PH_DATA(?, ?, ?)) -> value phd { log("Other PH-DATA: ", phd); repeat; }
[] T.timeout { }
}
+ LAPDM.send(t_PH_DATA(sapi, use_sacch, LAPDm_B_RR(sapi, 0)));
f_release_dcch();
return result;
}
@@ -169,8 +194,22 @@ module L1CTL_Test {
f_release_dcch();
}
+ /* we test that a re-transmitted SABM with identical payload will result in the retransmission of a
+ * SABM. This is required during the contention resolution procedure as specified in 8.4.1.4 */
+ testcase TC_sabm_retransmit() runs on dummy_CT {
+ const octetstring payload := '00FEFEDEADBEEF'O;
+ f_init();
+ if (not f_test_sabm_results_in_ua(0, false, payload)) {
+ setverdict(fail, "UA not received for first SABM");
+ }
+ if (not f_test_sabm_results_in_ua(0, false, payload)) {
+ setverdict(fail, "UA not received for second SABM");
+ }
+ setverdict(pass);
+ }
testcase TC_foo() runs on dummy_CT {
+ var LapdmFrame lf;
/*
var LapdmFrame lf := valueof(LAPDm_B_UA(0, ''O));
log("ENC UA: ", enc_LapdmFrame(lf));
@@ -180,6 +219,16 @@ module L1CTL_Test {
log("DEC UI AF: ", dec_LapdmAddressField('03'O));
*/
+
+ lf := valueof(LAPDm_B_RR(0, 0));
+ log("ENC RR: ", enc_LapdmFrame(lf));
+
+ lf := valueof(LAPDm_B_UA(0, ''O));
+ log("ENC UA: ", enc_LapdmFrame(lf));
+
+ lf := valueof(LAPDm_B_UI(0, ''O));
+ log("ENC UI: ", enc_LapdmFrame(lf));
+
log("DEC UI CU: ", dec_LapdmCtrlU('03'O));
log("DEC UI CT: ", dec_LapdmCtrl('03'O));
@@ -194,9 +243,12 @@ module L1CTL_Test {
control {
execute(TC_foo());
execute(TC_sabm_ua_dcch_sapi0());
+/*
execute(TC_sabm_ua_dcch_sapi0_nopayload());
execute(TC_sabm_ua_dcch_sapi3());
execute(TC_sabm_ua_dcch_sapi4());
execute(TC_sabm_contention());
+ execute(TC_sabm_retransmit());
+*/
}
}
diff --git a/lapdm/LAPDm_RAW_PT.ttcn b/lapdm/LAPDm_RAW_PT.ttcn
index 02b0b13..06225bb 100644
--- a/lapdm/LAPDm_RAW_PT.ttcn
+++ b/lapdm/LAPDm_RAW_PT.ttcn
@@ -3,6 +3,7 @@
* all kinds of hand-crafted LAPDm frames for testing of the remote LAPDm layer */
module LAPDm_RAW_PT {
import from GSM_Types all;
+ import from GSM_RR_Types all;
import from Osmocom_Types all;
import from L1CTL_Types all;
import from L1CTL_PortType all;
diff --git a/lapdm/LAPDm_Types.ttcn b/lapdm/LAPDm_Types.ttcn
index 988e015..98f6956 100644
--- a/lapdm/LAPDm_Types.ttcn
+++ b/lapdm/LAPDm_Types.ttcn
@@ -40,21 +40,21 @@ module LAPDm_Types {
};
type record LapdmCtrlI {
- BIT1 spare,
+ BIT1 spare ('0'B),
uint3_t n_s,
boolean p,
uint3_t n_r
} with { variant "FIELDORDER(lsb)" };
type record LapdmCtrlS {
- BIT2 spare,
+ BIT2 spare ('01'B),
LapdmSBits s,
boolean p_f,
uint3_t n_r
} with { variant "FIELDORDER(lsb)" };
type record LapdmCtrlU {
- BIT2 spare,
+ BIT2 spare ('11'B),
LapdmU2Bits u2,
boolean p_f,
LapdmUBits u
diff --git a/lapdm/gen_links.sh b/lapdm/gen_links.sh
index d849751..a00b5dd 100755
--- a/lapdm/gen_links.sh
+++ b/lapdm/gen_links.sh
@@ -18,5 +18,5 @@ gen_links $DIR $FILES
DIR=../library
-FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn L1CTL_PortType.ttcn L1CTL_Types.ttcn"
+FILES="General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn RLCMAC_CSN1_Types.ttcn Osmocom_Types.ttcn L1CTL_PortType.ttcn L1CTL_Types.ttcn"
gen_links $DIR $FILES
diff --git a/lapdm/regen_makefile.sh b/lapdm/regen_makefile.sh
index 8d321ac..f4cf882 100755
--- a/lapdm/regen_makefile.sh
+++ b/lapdm/regen_makefile.sh
@@ -5,5 +5,5 @@ FILES="*.ttcn UD_PT.cc UD_PT.hh"
ttcn3_makefilegen -f L1CTL_Test.ttcn $FILES
sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan `pkg-config --libs libnetfilter_conntrack`/' Makefile
-sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
+#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile