[MERGED] osmo-ttcn3-hacks[master]: LAPDm_Types: Fix encoding of S+I frames

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu May 10 16:46:10 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: LAPDm_Types: Fix encoding of S+I frames
......................................................................


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
---
M library/LAPDm_Types.ttcn
1 file changed, 39 insertions(+), 32 deletions(-)

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



diff --git a/library/LAPDm_Types.ttcn b/library/LAPDm_Types.ttcn
index 487748d..2e008e5 100644
--- a/library/LAPDm_Types.ttcn
+++ b/library/LAPDm_Types.ttcn
@@ -42,25 +42,25 @@
 	};
 
 	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 @@
 	/* 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 }
 	};
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id90ff80576fd8007def4d8d027b481eef693ddc0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list