aboutsummaryrefslogtreecommitdiffstats
path: root/library/LAPDm_Types.ttcn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-05-10 18:28:15 +0200
committerHarald Welte <laforge@gnumonks.org>2018-05-10 18:35:34 +0200
commit1bbe0b733d5fb1d3f8d4931851708fc3223161b7 (patch)
tree61c4ebd48e9530fc040614e2b63f374e6121b868 /library/LAPDm_Types.ttcn
parent7aacbbf1e5a62c7902cf78399dc3d02fc204aac7 (diff)
LAPDm_Types: Fix encoding of S+I frames
For some reason, the "FIELDORDER(lsb)" only worked for U-frames, but not for S- and I-frames. Probably a TITAN bug, but rather than debugging that now, let's rewrite the LAPDm types as "FIELDORDER(msb)" as that appears to work. Change-Id: Id90ff80576fd8007def4d8d027b481eef693ddc0
Diffstat (limited to 'library/LAPDm_Types.ttcn')
-rw-r--r--library/LAPDm_Types.ttcn71
1 files changed, 39 insertions, 32 deletions
diff --git a/library/LAPDm_Types.ttcn b/library/LAPDm_Types.ttcn
index 487748d7..2e008e5b 100644
--- a/library/LAPDm_Types.ttcn
+++ b/library/LAPDm_Types.ttcn
@@ -42,25 +42,25 @@ module LAPDm_Types {
};
type record LapdmCtrlI {
- BIT1 spare ('0'B),
- uint3_t n_s,
+ uint3_t n_r,
boolean p,
- uint3_t n_r
- } with { variant "FIELDORDER(lsb)" };
+ uint3_t n_s,
+ BIT1 spare ('0'B)
+ } with { variant "FIELDORDER(msb)" };
type record LapdmCtrlS {
- BIT2 spare ('01'B),
- LapdmSBits s,
+ uint3_t n_r,
boolean p_f,
- uint3_t n_r
- } with { variant "FIELDORDER(lsb)" };
+ LapdmSBits s,
+ BIT2 spare ('01'B)
+ } with { variant "FIELDORDER(msb)" };
type record LapdmCtrlU {
- BIT2 spare ('11'B),
- LapdmU2Bits u2,
+ LapdmUBits u,
boolean p_f,
- LapdmUBits u
- } with { variant "FIELDORDER(lsb)" };
+ LapdmU2Bits u2,
+ BIT2 spare ('11'B)
+ } with { variant "FIELDORDER(msb)" };
/* TS 44.006 Table 3 */
type union LapdmCtrl {
@@ -77,60 +77,67 @@ module LAPDm_Types {
/* TS 44.006 Table 4 */
template LapdmCtrl tr_LapdmCtrlS := {
- s := { spare := '01'B, s := ?, p_f := ?, n_r := ? }
+ s := { n_r := ?, p_f := ?, s := ?, spare := '01'B }
};
template LapdmCtrl tr_LapdmCtrlU := {
- u := { spare := '11'B, u2 := ?, p_f := ?, u := ? }
+ u := { u := ?, p_f := ?, u2 := ?, spare := '11'B }
};
/* TS 44.006 Table 4 */
template LapdmCtrl tr_LapdmCtrlI(template uint3_t nr, template uint3_t ns, template boolean p) := {
- i := { spare := '0'B, n_s := ns, p := p, n_r := nr }
+ i := { n_r := nr, p := p, n_s := ns, spare := '0'B }
};
+ template (value) LapdmCtrl ts_LapdmCtrlI(uint3_t nr, uint3_t ns, boolean p) := {
+ i := { n_r := nr, p := p, n_s := ns, spare := '0'B }
+ };
+
template LapdmCtrl tr_LapdmCtrlRR(template uint3_t nr, template boolean pf) modifies tr_LapdmCtrlS := {
- s := { s:= '00'B, p_f := pf, n_r := nr }
+ s := { n_r := nr, p_f := pf, s := '00'B }
+ };
+ template (value) LapdmCtrl ts_LapdmCtrlRR(uint3_t nr, boolean pf) := {
+ s := { n_r := nr, p_f := pf, s := '00'B }
};
template LapdmCtrl tr_LapdmCtrlRNR(template uint3_t nr, template boolean pf) modifies tr_LapdmCtrlS := {
- s := { s:= '01'B, p_f := pf, n_r := nr }
+ s := { n_r := nr, p_f := pf, s := '01'B }
};
template LapdmCtrl tr_LapdmCtrlREJ(template uint3_t nr, template boolean pf) modifies tr_LapdmCtrlS := {
- s := { s:= '10'B, p_f := pf, n_r := nr }
+ s := { n_r := nr, p_f := pf, s := '10'B }
};
- template LapdmCtrl tr_LapdmCtrlSABM(template boolean p) modifies tr_LapdmCtrlU := {
- u := { u2 := '11'B, p_f := p, u := '001'B }
+ template LapdmCtrl tr_LapdmCtrlSABM(template boolean p) := {
+ u := { u := '001'B, p_f := p, u2 := '11'B, spare := '11'B }
};
template (value) LapdmCtrl ts_LapdmCtrlSABM(boolean p) := {
- u := { spare := '11'B, u2 := '11'B, p_f := p, u := '001'B }
+ u := { u := '001'B, p_f := p, u2 := '11'B, spare := '11'B }
};
- template LapdmCtrl tr_LapdmCtrlDM(template boolean f) modifies tr_LapdmCtrlU := {
- u := { u2 := '11'B, p_f := f, u := '000'B }
+ template LapdmCtrl tr_LapdmCtrlDM(template boolean f) := {
+ u := { u := '000'B, p_f := f, u2 := '11'B, spare := '11'B }
};
- template LapdmCtrl tr_LapdmCtrlUI(template boolean p) modifies tr_LapdmCtrlU := {
- u := { u2 := '00'B, p_f := p, u := '000'B }
+ template LapdmCtrl tr_LapdmCtrlUI(template boolean p := false) := {
+ u := { u := '000'B, p_f := p, u2 := '00'B, spare := '11'B }
};
- template (value) LapdmCtrl ts_LapdmCtrlUI(boolean p) := {
- u := { spare := '11'B, u2 := '00'B, p_f := p, u := '000'B }
+ template (value) LapdmCtrl ts_LapdmCtrlUI(boolean p := false) := {
+ u := { u := '000'B, p_f := p, u2 := '00'B, spare := '11'B }
};
- template LapdmCtrl tr_LapdmCtrlDISC(template boolean p) modifies tr_LapdmCtrlU := {
- u := { u2 := '00'B, p_f := p, u := '010'B }
+ template LapdmCtrl tr_LapdmCtrlDISC(template boolean p) := {
+ u := { u := '010'B, p_f := p, u2 := '00'B, spare := '11'B }
};
template LapdmCtrl ts_LapdmCtrlDISC(boolean p) := {
- u := { spare := '11'B, u2 := '00'B, p_f := p, u := '010'B }
+ u := { u := '010'B, p_f := p, u2 := '00'B, spare := '11'B }
};
template LapdmCtrl tr_LapdmCtrlUA(template boolean f) modifies tr_LapdmCtrlU := {
- u := { u2 := '00'B, p_f := f, u := '011'B }
+ u := { u := '011'B, p_f := f, u2 := '00'B, spare := '11'B }
};
template (value) LapdmCtrl ts_LapdmCtrlUA(boolean f) := {
- u := { spare := '11'B, u2 := '00'B, p_f := f, u := '011'B }
+ u := { u := '011'B, p_f := f, u2 := '00'B, spare := '11'B }
};