diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-03-12 15:02:26 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-05-09 08:54:53 +0200 |
commit | 0472ab441586101286e7caf765782824bbc98d1b (patch) | |
tree | b1478e477a944dc6226fab3a5473ff5f76f721f5 /library/LAPDm_Types.ttcn | |
parent | 187ad5da87a4d040f17d8faede102f19bde54c40 (diff) |
bts: Add RLL tests
This adds a series of test cases to BTS_Tests.ttcn implementing testing
of the RLL sub-layr of RSL, i.e. the translation between LAPDm frames
on the Um interface and the RLL frames on the Abis side (and vice vrsa).
Related: OS#3174
Change-Id: I336378de6106e5369600cbb49e0c47cc59864630
Diffstat (limited to 'library/LAPDm_Types.ttcn')
-rw-r--r-- | library/LAPDm_Types.ttcn | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/library/LAPDm_Types.ttcn b/library/LAPDm_Types.ttcn index 91f55fab..487748d7 100644 --- a/library/LAPDm_Types.ttcn +++ b/library/LAPDm_Types.ttcn @@ -10,6 +10,12 @@ module LAPDm_Types { type BIT3 LapdmUBits; type BIT2 LapdmU2Bits; + /* 44.006 6.3.2 */ + const boolean cr_MO_CMD := false; + const boolean cr_MO_RSP := true; + const boolean cr_MT_CMD := true; + const boolean cr_MT_RSP := false; + /* TS 44.006 Figure 4 */ type record LapdmAddressField { BIT1 spare, @@ -193,4 +199,113 @@ module LAPDm_Types { /* automatic decoding to the generic LapdmFrame will not work, you have to call one of the * type-specific decoder routines above */ + /* SABM frame with L3 payload */ + template (value) LapdmFrame ts_LAPDm_SABM(LapdmSapi sapi, boolean c_r, boolean p, + octetstring l3) := { + ab := { + addr := ts_LapdmAddr(sapi, c_r), + ctrl := ts_LapdmCtrlSABM(p), + len := 0, /* overwritten in encoder */ + m := false, + el := 1, + payload := l3 + } + } + template LapdmFrame tr_LAPDm_SABM(template LapdmSapi sapi, template boolean c_r, + template boolean p, template octetstring l3) := { + ab := { + addr := tr_LapdmAddr(sapi, c_r), + ctrl := tr_LapdmCtrlSABM(p), + len := ?, + m := false, + el := 1, + payload := l3 + } + } + + template (value) LapdmFrame ts_LAPDm_UA(LapdmSapi sapi, boolean c_r, boolean f, + octetstring l3) := { + ab := { + addr := ts_LapdmAddr(sapi, c_r), + ctrl := ts_LapdmCtrlUA(f), + len := 0, /* overwritten in encoder */ + m := false, + el := 1, + payload := l3 + } + } + template LapdmFrame tr_LAPDm_UA(template LapdmSapi sapi, template boolean c_r, + template boolean f, template octetstring l3) := { + ab := { + addr := tr_LapdmAddr(sapi, c_r), + ctrl := tr_LapdmCtrlUA(f), + len := ?, + m := false, + el := 1, + payload := l3 + } + } + + template LapdmFrame ts_LAPDm_DISC(LapdmSapi sapi, boolean c_r, boolean p) := { + ab := { + addr := ts_LapdmAddr(sapi, c_r), + ctrl := ts_LapdmCtrlDISC(p), + len := 0, + m := false, + el := 1, + payload := ''O + } + } + template LapdmFrame tr_LAPDm_DISC(template LapdmSapi sapi, template boolean c_r, + template boolean p) := { + ab := { + addr := tr_LapdmAddr(sapi, c_r), + ctrl := tr_LapdmCtrlDISC(p), + len := ?, + m := false, + el := 1, + payload := ''O + } + } + + template LapdmFrame ts_LAPDm_UI(LapdmSapi sapi, boolean c_r, boolean p, octetstring l3) := { + ab := { + addr := ts_LapdmAddr(sapi, c_r), + ctrl := ts_LapdmCtrlUI(p), + len := 0, + m := false, + el := 1, + payload := l3 + } + } + template LapdmFrame tr_LAPDm_UI(template LapdmSapi sapi, template boolean c_r, + template boolean p, template octetstring l3) := { + ab := { + addr := tr_LapdmAddr(sapi, c_r), + ctrl := tr_LapdmCtrlUI(p), + len := ?, + m := false, + el := 1, + payload := l3 + } + } + + template LapdmFrame ts_LAPDm_B4_UI(LapdmSapi sapi, boolean c_r, boolean p, octetstring l3) := { + b4 := { + addr := ts_LapdmAddr(sapi, c_r), + ctrl := ts_LapdmCtrlUI(p), + payload := l3 + } + } + template LapdmFrame tr_LAPDm_B4_UI(template LapdmSapi sapi, template boolean c_r, + template boolean p, template octetstring l3) := { + b4 := { + addr := tr_LapdmAddr(sapi, c_r), + ctrl := tr_LapdmCtrlUI(p), + payload := l3 + } + } + + + } with { encode "RAW"; /*variant "FIELDORDER(msb)" */} |