<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17981">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Split templates in RLCMAC_{CSN1_}Types into their own _Templates file<br><br>RLCMAC blocks have a lot of fields and we will potentially require lots<br>of different templates, as well as functions to handle related structs.<br><br>Change-Id: I9c6597178168aa3848b21930f33be698dd2ce545<br>---<br>M bsc-nat/gen_links.sh<br>M bsc/gen_links.sh<br>M bts/gen_links.sh<br>M lapdm/gen_links.sh<br>M library/L3_Templates.ttcn<br>A library/RLCMAC_CSN1_Templates.ttcn<br>M library/RLCMAC_CSN1_Types.ttcn<br>A library/RLCMAC_Templates.ttcn<br>M library/RLCMAC_Types.ttcn<br>M mme/gen_links.sh<br>M msc/gen_links.sh<br>M pcu/GPRS_TBF.ttcn<br>M pcu/PCU_Tests.ttcn<br>M pcu/gen_links.sh<br>M selftest/gen_links.sh<br>M sgsn/gen_links.sh<br>M sysinfo/gen_links.sh<br>17 files changed, 524 insertions(+), 477 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/81/17981/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/bsc-nat/gen_links.sh b/bsc-nat/gen_links.sh</span><br><span>index 471753e..4d2303f 100755</span><br><span>--- a/bsc-nat/gen_links.sh</span><br><span>+++ b/bsc-nat/gen_links.sh</span><br><span>@@ -52,7 +52,7 @@</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> DIR=../library</span><br><span style="color: hsl(0, 100%, 40%);">-FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn RLCMAC_CSN1_Types.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_VTY_Functions.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn BSSAP_CodecPort.ttcn"</span><br><span style="color: hsl(120, 100%, 40%);">+FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_VTY_Functions.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn BSSAP_CodecPort.ttcn"</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> ignore_pp_results</span><br><span>diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh</span><br><span>index 845f7cc..a936ef3 100755</span><br><span>--- a/bsc/gen_links.sh</span><br><span>+++ b/bsc/gen_links.sh</span><br><span>@@ -67,7 +67,7 @@</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> DIR=../library</span><br><span style="color: hsl(0, 100%, 40%);">-FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn "</span><br><span style="color: hsl(120, 100%, 40%);">+FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn "</span><br><span> FILES+="CBSP_Types.ttcn CBSP_Templates.ttcn "</span><br><span> FILES+="CBSP_CodecPort.ttcn CBSP_CodecPort_CtrlFunct.ttcn CBSP_CodecPort_CtrlFunctdef.cc CBSP_Adapter.ttcn "</span><br><span> gen_links $DIR $FILES</span><br><span>diff --git a/bts/gen_links.sh b/bts/gen_links.sh</span><br><span>index aafe231..b6921fa 100755</span><br><span>--- a/bts/gen_links.sh</span><br><span>+++ b/bts/gen_links.sh</span><br><span>@@ -33,7 +33,7 @@</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> DIR=../library</span><br><span style="color: hsl(0, 100%, 40%);">-FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_VTY_Functions.ttcn GSM_SystemInformation.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn L1CTL_PortType_CtrlFunct.ttcn L1CTL_PortType_CtrlFunctDef.cc LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn "</span><br><span style="color: hsl(120, 100%, 40%);">+FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_VTY_Functions.ttcn GSM_SystemInformation.ttcn Osmocom_Types.ttcn RLCMAC_Templates.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn L1CTL_PortType_CtrlFunct.ttcn L1CTL_PortType_CtrlFunctDef.cc LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn "</span><br><span> #FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "</span><br><span> #FILES+="BSSGP_Emulation.ttcn Osmocom_Gb_Types.ttcn "</span><br><span> FILES+="IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp IPA_CodecPort.ttcn RSL_Types.ttcn RSL_Emulation.ttcn AbisOML_Types.ttcn "</span><br><span>diff --git a/lapdm/gen_links.sh b/lapdm/gen_links.sh</span><br><span>index 12830dd..217f485 100755</span><br><span>--- a/lapdm/gen_links.sh</span><br><span>+++ b/lapdm/gen_links.sh</span><br><span>@@ -14,7 +14,7 @@</span><br><span> </span><br><span> </span><br><span> DIR=../library</span><br><span style="color: hsl(0, 100%, 40%);">-FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn RLCMAC_CSN1_Types.ttcn Osmocom_Types.ttcn L1CTL_PortType.ttcn L1CTL_PortType_CtrlFunct.ttcn L1CTL_PortType_CtrlFunctDef.cc L1CTL_Types.ttcn LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn RLCMAC_Types.ttcn RLCMAC_EncDec.cc"</span><br><span style="color: hsl(120, 100%, 40%);">+FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn Osmocom_Types.ttcn L1CTL_PortType.ttcn L1CTL_PortType_CtrlFunct.ttcn L1CTL_PortType_CtrlFunctDef.cc L1CTL_Types.ttcn LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn RLCMAC_Templates.ttcn RLCMAC_Types.ttcn RLCMAC_EncDec.cc"</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> ignore_pp_results</span><br><span>diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn</span><br><span>index 8af9acc..3032503 100644</span><br><span>--- a/library/L3_Templates.ttcn</span><br><span>+++ b/library/L3_Templates.ttcn</span><br><span>@@ -20,7 +20,7 @@</span><br><span> import from MobileL3_CC_Types all;</span><br><span> import from MobileL3_GMM_SM_Types all;</span><br><span> import from MobileL3_SMS_Types all;</span><br><span style="color: hsl(0, 100%, 40%);">-import from RLCMAC_CSN1_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+import from RLCMAC_CSN1_Templates all;</span><br><span> </span><br><span> /* TS 24.007 Table 11.3 TI Flag */</span><br><span> const BIT1 c_TIF_ORIG := '0'B;</span><br><span>diff --git a/library/RLCMAC_CSN1_Templates.ttcn b/library/RLCMAC_CSN1_Templates.ttcn</span><br><span>new file mode 100644</span><br><span>index 0000000..07f70b4</span><br><span>--- /dev/null</span><br><span>+++ b/library/RLCMAC_CSN1_Templates.ttcn</span><br><span>@@ -0,0 +1,163 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/* GPRS RLC/MAC Control Messages as per 3GPP TS 44.060 manually transcribed from the CSN.1 syntax, as no CSN.1</span><br><span style="color: hsl(120, 100%, 40%);">+ * tool for Eclipse TITAN could be found.  Implements only the minimum necessary messages for Osmocom teseting</span><br><span style="color: hsl(120, 100%, 40%);">+ * purposes. */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* (C) 2017-2018 Harald Welte <laforge@gnumonks.org></span><br><span style="color: hsl(120, 100%, 40%);">+ * contributions by sysmocom - s.f.m.c. GmbH</span><br><span style="color: hsl(120, 100%, 40%);">+ * All rights reserved.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Released under the terms of GNU General Public License, Version 2 or</span><br><span style="color: hsl(120, 100%, 40%);">+ * (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * SPDX-License-Identifier: GPL-2.0-or-later</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+module RLCMAC_CSN1_Templates {</span><br><span style="color: hsl(120, 100%, 40%);">+     import from General_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+        import from Osmocom_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+        import from GSM_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+    import from MobileL3_GMM_SM_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+        import from RLCMAC_CSN1_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_CTRL_ACK(GprsTlli tlli,</span><br><span style="color: hsl(120, 100%, 40%);">+                                          CtrlAck ack := MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN) := {</span><br><span style="color: hsl(120, 100%, 40%);">+               msg_type := PACKET_CONTROL_ACK,</span><br><span style="color: hsl(120, 100%, 40%);">+               u := {</span><br><span style="color: hsl(120, 100%, 40%);">+                        ctrl_ack := {</span><br><span style="color: hsl(120, 100%, 40%);">+                         tlli := tlli,</span><br><span style="color: hsl(120, 100%, 40%);">+                         ctrl_ack := ack</span><br><span style="color: hsl(120, 100%, 40%);">+                       }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   const ILevel iNone := {</span><br><span style="color: hsl(120, 100%, 40%);">+               presence := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+             i_level := omit</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+     const ChannelQualityReport c_ChQualRep_default := {</span><br><span style="color: hsl(120, 100%, 40%);">+           c_value := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+         rxqual := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+          sign_var := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+                i_levels := { iNone, iNone, iNone, iNone, iNone, iNone, iNone, iNone }</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+     template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_DL_ACK(uint5_t dl_tfi,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                               AckNackDescription andesc,</span><br><span style="color: hsl(120, 100%, 40%);">+                                        ChannelQualityReport qual_rep := c_ChQualRep_default) := {</span><br><span style="color: hsl(120, 100%, 40%);">+            msg_type := PACKET_DL_ACK_NACK,</span><br><span style="color: hsl(120, 100%, 40%);">+               u := {</span><br><span style="color: hsl(120, 100%, 40%);">+                        dl_ack_nack := {</span><br><span style="color: hsl(120, 100%, 40%);">+                              dl_tfi := dl_tfi,</span><br><span style="color: hsl(120, 100%, 40%);">+                             ack_nack_desc := andesc,</span><br><span style="color: hsl(120, 100%, 40%);">+                              chreq_desc_presence := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                          chreq_desc := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                           ch_qual_rep := qual_rep</span><br><span style="color: hsl(120, 100%, 40%);">+                       }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   private function f_presence_bit_MultislotCap_GPRS(template (omit) MultislotCap_GPRS mscap_gprs) return BIT1 {</span><br><span style="color: hsl(120, 100%, 40%);">+         if (istemplatekind(mscap_gprs, "omit")) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   return '0'B;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+             return '1'B;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+     private function f_presence_bit_MultislotCap_EGPRS(template (omit) MultislotCap_EGPRS mscap_egprs) return BIT1 {</span><br><span style="color: hsl(120, 100%, 40%);">+              if (istemplatekind(mscap_egprs, "omit")) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  return '0'B;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+             return '1'B;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+     template (value) MSRACapabilityValuesRecord ts_RaCapRec(BIT4 att := '0001'B /* E-GSM */, template (omit) MultislotCap_GPRS mscap_gprs := omit, template (omit) MultislotCap_EGPRS mscap_egprs := omit) := {</span><br><span style="color: hsl(120, 100%, 40%);">+           mSRACapabilityValues := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mSRACapabilityValuesExclude1111 := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          accessTechnType := att, /* E-GSM */</span><br><span style="color: hsl(120, 100%, 40%);">+                           accessCapabilities := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                       lengthIndicator := 0, /* overwritten */</span><br><span style="color: hsl(120, 100%, 40%);">+                                       accessCapabilities := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                               rfPowerCapability := '001'B, /* FIXME */</span><br><span style="color: hsl(120, 100%, 40%);">+                                              presenceBitA5 := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                a5bits := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                                               esind := '1'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                psbit := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                vgcs := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                         vbs := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                          presenceBitMultislot := '1'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                         multislotcap := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                     presenceBitHscsd := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                     hscsdmultislotclass := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                  presenceBitGprs := f_presence_bit_MultislotCap_GPRS(mscap_gprs),</span><br><span style="color: hsl(120, 100%, 40%);">+                                                      gprsmultislot := mscap_gprs,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                  presenceBitSms := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                       multislotCap_SMS := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                     multislotCapAdditionsAfterRel97 := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                  presenceBitEcsdmulti := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                 ecsdmultislotclass := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                   presenceBitEgprsmulti := f_presence_bit_MultislotCap_EGPRS(mscap_egprs),</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                      multislotCap_EGPRS := mscap_egprs,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                    presenceBitDtmGprsmulti := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                      multislotCapdtmgprsmultislotsubclass := omit</span><br><span style="color: hsl(120, 100%, 40%);">+                                                  }</span><br><span style="color: hsl(120, 100%, 40%);">+                                             },</span><br><span style="color: hsl(120, 100%, 40%);">+                                            accessCapAdditionsAfterRel97 := omit</span><br><span style="color: hsl(120, 100%, 40%);">+                                  },</span><br><span style="color: hsl(120, 100%, 40%);">+                                    spare_bits := omit</span><br><span style="color: hsl(120, 100%, 40%);">+                            }</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             },</span><br><span style="color: hsl(120, 100%, 40%);">+            presenceBitMSRACap := '0'B</span><br><span style="color: hsl(120, 100%, 40%);">+    };</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  private function f_presence_bit_MSRadioAccessCapabilityV(template (omit) MSRadioAccessCapabilityV ms_rac) return BIT1 {</span><br><span style="color: hsl(120, 100%, 40%);">+               if (istemplatekind(ms_rac, "omit")) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       return '0'B;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+             return '1'B;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   private function f_template_MSRadioAccessCapabilityV_to_MSRadioAccCap2(template (omit) MSRadioAccessCapabilityV ms_rac) return template (omit) MSRadioAccCap2 {</span><br><span style="color: hsl(120, 100%, 40%);">+               var template (omit) MSRadioAccCap2 ms_rac2 := omit;</span><br><span style="color: hsl(120, 100%, 40%);">+           if (istemplatekind(ms_rac, "omit")) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       return ms_rac2;</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+             ms_rac2 := { msRadioAccessCapabilityV := ms_rac };</span><br><span style="color: hsl(120, 100%, 40%);">+            return ms_rac2;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   private const ChannelReqDescription c_ChReqDesc_default := {</span><br><span style="color: hsl(120, 100%, 40%);">+          peak_tput_class := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+         priority := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+                rlc_mode := RLC_MODE_UNACKNOWLEDGED,</span><br><span style="color: hsl(120, 100%, 40%);">+          llc_pdu_type := LLC_PDU_IS_NOT_SACK_OR_ACK,</span><br><span style="color: hsl(120, 100%, 40%);">+           RlcOctetCount := 0</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* TS 44.060 sec 11.2.16 */</span><br><span style="color: hsl(120, 100%, 40%);">+   template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_RES_REQ(GprsTlli tlli,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                template (omit) MSRadioAccessCapabilityV ms_rac,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              ChannelReqDescription ch_req_desc := c_ChReqDesc_default,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                     RlcAccessType acc_type := RLC_ACC_TYPE_TWO_PHASE)</span><br><span style="color: hsl(120, 100%, 40%);">+        := {</span><br><span style="color: hsl(120, 100%, 40%);">+          msg_type := PACKET_RESOURCE_REQUEST,</span><br><span style="color: hsl(120, 100%, 40%);">+          u := {</span><br><span style="color: hsl(120, 100%, 40%);">+                        resource_req := {</span><br><span style="color: hsl(120, 100%, 40%);">+                             acc_type_presence := '1'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                            acc_type := acc_type,</span><br><span style="color: hsl(120, 100%, 40%);">+                         id_type := '1'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                              id := { tlli := tlli },</span><br><span style="color: hsl(120, 100%, 40%);">+                               ms_rac2_presence := f_presence_bit_MSRadioAccessCapabilityV(ms_rac),</span><br><span style="color: hsl(120, 100%, 40%);">+                          ms_rac2 := f_template_MSRadioAccessCapabilityV_to_MSRadioAccCap2(ms_rac),</span><br><span style="color: hsl(120, 100%, 40%);">+                             ch_req_desc := ch_req_desc,</span><br><span style="color: hsl(120, 100%, 40%);">+                           change_mark_presence := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                         change_mark := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                          C_val := '000000'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                           sign_var_presence := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                            sign_var := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                             I_levels := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                 iNone, iNone, iNone, iNone,</span><br><span style="color: hsl(120, 100%, 40%);">+                                   iNone, iNone, iNone, iNone</span><br><span style="color: hsl(120, 100%, 40%);">+                            }</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+} with { encode "RAW"; variant "FIELDORDER(msb)" variant "BYTEORDER(last)" };</span><br><span>diff --git a/library/RLCMAC_CSN1_Types.ttcn b/library/RLCMAC_CSN1_Types.ttcn</span><br><span>index b545368..bca4351 100644</span><br><span>--- a/library/RLCMAC_CSN1_Types.ttcn</span><br><span>+++ b/library/RLCMAC_CSN1_Types.ttcn</span><br><span>@@ -639,147 +639,6 @@</span><br><span>                variant (relative_k) "PRESENCE(presence = '1'B)"</span><br><span>   };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_CTRL_ACK(GprsTlli tlli,</span><br><span style="color: hsl(0, 100%, 40%);">-                                            CtrlAck ack := MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN) := {</span><br><span style="color: hsl(0, 100%, 40%);">-         msg_type := PACKET_CONTROL_ACK,</span><br><span style="color: hsl(0, 100%, 40%);">-         u := {</span><br><span style="color: hsl(0, 100%, 40%);">-                  ctrl_ack := {</span><br><span style="color: hsl(0, 100%, 40%);">-                           tlli := tlli,</span><br><span style="color: hsl(0, 100%, 40%);">-                           ctrl_ack := ack</span><br><span style="color: hsl(0, 100%, 40%);">-                 }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       const ILevel iNone := {</span><br><span style="color: hsl(0, 100%, 40%);">-         presence := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-               i_level := omit</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-       const ChannelQualityReport c_ChQualRep_default := {</span><br><span style="color: hsl(0, 100%, 40%);">-             c_value := 0,</span><br><span style="color: hsl(0, 100%, 40%);">-           rxqual := 0,</span><br><span style="color: hsl(0, 100%, 40%);">-            sign_var := 0,</span><br><span style="color: hsl(0, 100%, 40%);">-          i_levels := { iNone, iNone, iNone, iNone, iNone, iNone, iNone, iNone }</span><br><span style="color: hsl(0, 100%, 40%);">-  }</span><br><span style="color: hsl(0, 100%, 40%);">-       template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_DL_ACK(uint5_t dl_tfi,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                 AckNackDescription andesc,</span><br><span style="color: hsl(0, 100%, 40%);">-                                  ChannelQualityReport qual_rep := c_ChQualRep_default) := {</span><br><span style="color: hsl(0, 100%, 40%);">-              msg_type := PACKET_DL_ACK_NACK,</span><br><span style="color: hsl(0, 100%, 40%);">-         u := {</span><br><span style="color: hsl(0, 100%, 40%);">-                  dl_ack_nack := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                dl_tfi := dl_tfi,</span><br><span style="color: hsl(0, 100%, 40%);">-                               ack_nack_desc := andesc,</span><br><span style="color: hsl(0, 100%, 40%);">-                                chreq_desc_presence := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                            chreq_desc := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                             ch_qual_rep := qual_rep</span><br><span style="color: hsl(0, 100%, 40%);">-                 }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       private function f_presence_bit_MultislotCap_GPRS(template (omit) MultislotCap_GPRS mscap_gprs) return BIT1 {</span><br><span style="color: hsl(0, 100%, 40%);">-           if (istemplatekind(mscap_gprs, "omit")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     return '0'B;</span><br><span style="color: hsl(0, 100%, 40%);">-            }</span><br><span style="color: hsl(0, 100%, 40%);">-               return '1'B;</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-       private function f_presence_bit_MultislotCap_EGPRS(template (omit) MultislotCap_EGPRS mscap_egprs) return BIT1 {</span><br><span style="color: hsl(0, 100%, 40%);">-                if (istemplatekind(mscap_egprs, "omit")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    return '0'B;</span><br><span style="color: hsl(0, 100%, 40%);">-            }</span><br><span style="color: hsl(0, 100%, 40%);">-               return '1'B;</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-       template (value) MSRACapabilityValuesRecord ts_RaCapRec(BIT4 att := '0001'B /* E-GSM */, template (omit) MultislotCap_GPRS mscap_gprs := omit, template (omit) MultislotCap_EGPRS mscap_egprs := omit) := {</span><br><span style="color: hsl(0, 100%, 40%);">-             mSRACapabilityValues := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mSRACapabilityValuesExclude1111 := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            accessTechnType := att, /* E-GSM */</span><br><span style="color: hsl(0, 100%, 40%);">-                             accessCapabilities := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                 lengthIndicator := 0, /* overwritten */</span><br><span style="color: hsl(0, 100%, 40%);">-                                 accessCapabilities := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                         rfPowerCapability := '001'B, /* FIXME */</span><br><span style="color: hsl(0, 100%, 40%);">-                                                presenceBitA5 := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                          a5bits := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                                         esind := '1'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                          psbit := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                          vgcs := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                           vbs := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                            presenceBitMultislot := '1'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                           multislotcap := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                       presenceBitHscsd := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                       hscsdmultislotclass := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                    presenceBitGprs := f_presence_bit_MultislotCap_GPRS(mscap_gprs),</span><br><span style="color: hsl(0, 100%, 40%);">-                                                        gprsmultislot := mscap_gprs,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                    presenceBitSms := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                 multislotCap_SMS := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                       multislotCapAdditionsAfterRel97 := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                    presenceBitEcsdmulti := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                   ecsdmultislotclass := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                     presenceBitEgprsmulti := f_presence_bit_MultislotCap_EGPRS(mscap_egprs),</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                        multislotCap_EGPRS := mscap_egprs,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                      presenceBitDtmGprsmulti := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                                        multislotCapdtmgprsmultislotsubclass := omit</span><br><span style="color: hsl(0, 100%, 40%);">-                                                    }</span><br><span style="color: hsl(0, 100%, 40%);">-                                               },</span><br><span style="color: hsl(0, 100%, 40%);">-                                              accessCapAdditionsAfterRel97 := omit</span><br><span style="color: hsl(0, 100%, 40%);">-                                    },</span><br><span style="color: hsl(0, 100%, 40%);">-                                      spare_bits := omit</span><br><span style="color: hsl(0, 100%, 40%);">-                              }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               },</span><br><span style="color: hsl(0, 100%, 40%);">-              presenceBitMSRACap := '0'B</span><br><span style="color: hsl(0, 100%, 40%);">-      };</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      private function f_presence_bit_MSRadioAccessCapabilityV(template (omit) MSRadioAccessCapabilityV ms_rac) return BIT1 {</span><br><span style="color: hsl(0, 100%, 40%);">-         if (istemplatekind(ms_rac, "omit")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 return '0'B;</span><br><span style="color: hsl(0, 100%, 40%);">-            }</span><br><span style="color: hsl(0, 100%, 40%);">-               return '1'B;</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       private function f_template_MSRadioAccessCapabilityV_to_MSRadioAccCap2(template (omit) MSRadioAccessCapabilityV ms_rac) return template (omit) MSRadioAccCap2 {</span><br><span style="color: hsl(0, 100%, 40%);">-         var template (omit) MSRadioAccCap2 ms_rac2 := omit;</span><br><span style="color: hsl(0, 100%, 40%);">-             if (istemplatekind(ms_rac, "omit")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 return ms_rac2;</span><br><span style="color: hsl(0, 100%, 40%);">-         }</span><br><span style="color: hsl(0, 100%, 40%);">-               ms_rac2 := { msRadioAccessCapabilityV := ms_rac };</span><br><span style="color: hsl(0, 100%, 40%);">-              return ms_rac2;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       private const ChannelReqDescription c_ChReqDesc_default := {</span><br><span style="color: hsl(0, 100%, 40%);">-            peak_tput_class := 0,</span><br><span style="color: hsl(0, 100%, 40%);">-           priority := 0,</span><br><span style="color: hsl(0, 100%, 40%);">-          rlc_mode := RLC_MODE_UNACKNOWLEDGED,</span><br><span style="color: hsl(0, 100%, 40%);">-            llc_pdu_type := LLC_PDU_IS_NOT_SACK_OR_ACK,</span><br><span style="color: hsl(0, 100%, 40%);">-             RlcOctetCount := 0</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* TS 44.060 sec 11.2.16 */</span><br><span style="color: hsl(0, 100%, 40%);">-     template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_RES_REQ(GprsTlli tlli,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                  template (omit) MSRadioAccessCapabilityV ms_rac,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                ChannelReqDescription ch_req_desc := c_ChReqDesc_default,</span><br><span style="color: hsl(0, 100%, 40%);">-                                               RlcAccessType acc_type := RLC_ACC_TYPE_TWO_PHASE)</span><br><span style="color: hsl(0, 100%, 40%);">-  := {</span><br><span style="color: hsl(0, 100%, 40%);">-            msg_type := PACKET_RESOURCE_REQUEST,</span><br><span style="color: hsl(0, 100%, 40%);">-            u := {</span><br><span style="color: hsl(0, 100%, 40%);">-                  resource_req := {</span><br><span style="color: hsl(0, 100%, 40%);">-                               acc_type_presence := '1'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                              acc_type := acc_type,</span><br><span style="color: hsl(0, 100%, 40%);">-                           id_type := '1'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                id := { tlli := tlli },</span><br><span style="color: hsl(0, 100%, 40%);">-                         ms_rac2_presence := f_presence_bit_MSRadioAccessCapabilityV(ms_rac),</span><br><span style="color: hsl(0, 100%, 40%);">-                            ms_rac2 := f_template_MSRadioAccessCapabilityV_to_MSRadioAccCap2(ms_rac),</span><br><span style="color: hsl(0, 100%, 40%);">-                               ch_req_desc := ch_req_desc,</span><br><span style="color: hsl(0, 100%, 40%);">-                             change_mark_presence := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                           change_mark := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                            C_val := '000000'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                             sign_var_presence := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                              sign_var := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                               I_levels := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                   iNone, iNone, iNone, iNone,</span><br><span style="color: hsl(0, 100%, 40%);">-                                     iNone, iNone, iNone, iNone</span><br><span style="color: hsl(0, 100%, 40%);">-                              }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    /* 3GPP TS 44.060, table 11.2.5a.2 "EGPRS PACKET CHANNEL REQUEST" */</span><br><span>       type union EGPRSPktChRequest {</span><br><span>               EGPRSPktChRequest_MC5P2RB3              one_phase,</span><br><span>diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn</span><br><span>new file mode 100644</span><br><span>index 0000000..8fb6b0c</span><br><span>--- /dev/null</span><br><span>+++ b/library/RLCMAC_Templates.ttcn</span><br><span>@@ -0,0 +1,346 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/* TITAN REW encode/decode definitions for 3GPP TS 44.060 RLC/MAC Blocks */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* (C) 2017-2018 Harald Welte <laforge@gnumonks.org></span><br><span style="color: hsl(120, 100%, 40%);">+ * (C) 2020 by sysmocom s.f.m.c. GmbH <info@sysmocom.de></span><br><span style="color: hsl(120, 100%, 40%);">+ * All rights reserved.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Released under the terms of GNU General Public License, Version 2 or</span><br><span style="color: hsl(120, 100%, 40%);">+ * (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * SPDX-License-Identifier: GPL-2.0-or-later</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+module RLCMAC_Templates {</span><br><span style="color: hsl(120, 100%, 40%);">+        import from General_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+        import from Osmocom_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+        import from GSM_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+    import from RLCMAC_CSN1_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+    import from RLCMAC_CSN1_Templates all;</span><br><span style="color: hsl(120, 100%, 40%);">+        import from RLCMAC_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       /* TS 44.060 10.4.5 */</span><br><span style="color: hsl(120, 100%, 40%);">+        function f_rrbp_fn_delay(MacRrbp rrbp) return uint32_t {</span><br><span style="color: hsl(120, 100%, 40%);">+              select (rrbp) {</span><br><span style="color: hsl(120, 100%, 40%);">+               case (RRBP_Nplus13_mod_2715648) { return 13; }</span><br><span style="color: hsl(120, 100%, 40%);">+                case (RRBP_Nplus17_or_18_mod_2715648) { return 17; }</span><br><span style="color: hsl(120, 100%, 40%);">+          case (RRBP_Nplus21_or_22_mod_2715648) { return 21;  }</span><br><span style="color: hsl(120, 100%, 40%);">+         case (RRBP_Nplus26_mod_2715648) { return 26; }</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+             return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   function f_rlcmac_cs_mcs2block_len(CodingScheme cs_mcs) return uint32_t {</span><br><span style="color: hsl(120, 100%, 40%);">+             select (cs_mcs) {</span><br><span style="color: hsl(120, 100%, 40%);">+             case (CS_1) { return 23; }</span><br><span style="color: hsl(120, 100%, 40%);">+            case (CS_2) { return 34; }</span><br><span style="color: hsl(120, 100%, 40%);">+            case (CS_3) { return 40; }</span><br><span style="color: hsl(120, 100%, 40%);">+            case (CS_4) { return 54; }</span><br><span style="color: hsl(120, 100%, 40%);">+            case (MCS_1) { return 27; }</span><br><span style="color: hsl(120, 100%, 40%);">+           case (MCS_2) { return 33; }</span><br><span style="color: hsl(120, 100%, 40%);">+           case (MCS_3) { return 42; }</span><br><span style="color: hsl(120, 100%, 40%);">+           case (MCS_4) { return 49; }</span><br><span style="color: hsl(120, 100%, 40%);">+           case (MCS_5) { return 61; }</span><br><span style="color: hsl(120, 100%, 40%);">+           case (MCS_6) { return 79; }</span><br><span style="color: hsl(120, 100%, 40%);">+           case (MCS_7) { return 119; }</span><br><span style="color: hsl(120, 100%, 40%);">+          case (MCS_8) { return 143; }</span><br><span style="color: hsl(120, 100%, 40%);">+          case (MCS_9) { return 155; }</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+             return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   function f_rlcmac_block_len2cs_mcs(uint32_t len) return CodingScheme {</span><br><span style="color: hsl(120, 100%, 40%);">+                select (len) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        case (23) { return CS_1; }</span><br><span style="color: hsl(120, 100%, 40%);">+                    case (34) { return CS_2; }</span><br><span style="color: hsl(120, 100%, 40%);">+                    case (40) { return CS_3; }</span><br><span style="color: hsl(120, 100%, 40%);">+                    case (54) { return CS_4; }</span><br><span style="color: hsl(120, 100%, 40%);">+                    case (27) { return MCS_1; }</span><br><span style="color: hsl(120, 100%, 40%);">+                   case (33) { return MCS_2; }</span><br><span style="color: hsl(120, 100%, 40%);">+                   case (42) { return MCS_3; }</span><br><span style="color: hsl(120, 100%, 40%);">+                   case (49) { return MCS_4; }</span><br><span style="color: hsl(120, 100%, 40%);">+                   case (60) { return MCS_5; }</span><br><span style="color: hsl(120, 100%, 40%);">+                   case (61) { return MCS_5; }</span><br><span style="color: hsl(120, 100%, 40%);">+                   case (78) { return MCS_6; }</span><br><span style="color: hsl(120, 100%, 40%);">+                   case (79) { return MCS_6; }</span><br><span style="color: hsl(120, 100%, 40%);">+                   case (118) { return MCS_7; }</span><br><span style="color: hsl(120, 100%, 40%);">+                  case (119) { return MCS_7; }</span><br><span style="color: hsl(120, 100%, 40%);">+                  case (142) { return MCS_8; }</span><br><span style="color: hsl(120, 100%, 40%);">+                  case (143) { return MCS_8; }</span><br><span style="color: hsl(120, 100%, 40%);">+                  case (154) { return MCS_9; }</span><br><span style="color: hsl(120, 100%, 40%);">+                  case (155) { return MCS_9; }</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+             return CS_1;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   template (value) RlcmacUlBlock ts_RLC_UL_CTRL_ACK(RlcmacUlCtrlMsg ctrl,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                       MacPayloadType pt := MAC_PT_RLCMAC_NO_OPT,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                    boolean retry := false) := {</span><br><span style="color: hsl(120, 100%, 40%);">+          ctrl := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          payload_type := pt,</span><br><span style="color: hsl(120, 100%, 40%);">+                           spare := '00000'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                            retry := retry</span><br><span style="color: hsl(120, 100%, 40%);">+                        },</span><br><span style="color: hsl(120, 100%, 40%);">+                    payload := ctrl</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Send Template for Downlink ACK/NACK */</span><br><span style="color: hsl(120, 100%, 40%);">+     template RlcmacUlBlock ts_RLCMAC_DL_ACK_NACK(template uint5_t tfi, AckNackDescription andesc, boolean retry := false) := {</span><br><span style="color: hsl(120, 100%, 40%);">+            ctrl := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          payload_type := MAC_PT_RLCMAC_NO_OPT,</span><br><span style="color: hsl(120, 100%, 40%);">+                         spare := '00000'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                            retry := retry</span><br><span style="color: hsl(120, 100%, 40%);">+                        },</span><br><span style="color: hsl(120, 100%, 40%);">+                    payload := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          msg_type := PACKET_DL_ACK_NACK,</span><br><span style="color: hsl(120, 100%, 40%);">+                               u := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                        dl_ack_nack := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                              dl_tfi := tfi,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                ack_nack_desc := andesc,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              chreq_desc_presence := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                          chreq_desc := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                                           ch_qual_rep := c_ChQualRep_default</span><br><span style="color: hsl(120, 100%, 40%);">+                                    }</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Template for uplink Data block */</span><br><span style="color: hsl(120, 100%, 40%);">+  template RlcmacUlBlock t_RLCMAC_UL_DATA(template uint5_t tfi, template uint4_t cv, template uint7_t bsn,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              template LlcBlocks blocks := {}, template boolean stall := false) := {</span><br><span style="color: hsl(120, 100%, 40%);">+                data := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          payload_type := MAC_PT_RLC_DATA,</span><br><span style="color: hsl(120, 100%, 40%);">+                              countdown := cv,</span><br><span style="color: hsl(120, 100%, 40%);">+                              stall_ind := false,</span><br><span style="color: hsl(120, 100%, 40%);">+                           retry := false,</span><br><span style="color: hsl(120, 100%, 40%);">+                               spare := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                pfi_ind := false,</span><br><span style="color: hsl(120, 100%, 40%);">+                             tfi := tfi,</span><br><span style="color: hsl(120, 100%, 40%);">+                           tlli_ind := false,</span><br><span style="color: hsl(120, 100%, 40%);">+                            bsn := bsn,</span><br><span style="color: hsl(120, 100%, 40%);">+                           e := false</span><br><span style="color: hsl(120, 100%, 40%);">+                    },</span><br><span style="color: hsl(120, 100%, 40%);">+                    tlli := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                 pfi := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                  blocks := blocks</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+     template RlcmacUlBlock t_RLCMAC_UL_DATA_TLLI(template uint5_t tfi, template uint4_t cv, template uint7_t bsn,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              template LlcBlocks blocks := {}, template boolean stall := false, template GprsTlli tlli) := {</span><br><span style="color: hsl(120, 100%, 40%);">+           data := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          payload_type := MAC_PT_RLC_DATA,</span><br><span style="color: hsl(120, 100%, 40%);">+                              countdown := cv,</span><br><span style="color: hsl(120, 100%, 40%);">+                              stall_ind := false,</span><br><span style="color: hsl(120, 100%, 40%);">+                           retry := false,</span><br><span style="color: hsl(120, 100%, 40%);">+                               spare := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                pfi_ind := false,</span><br><span style="color: hsl(120, 100%, 40%);">+                             tfi := tfi,</span><br><span style="color: hsl(120, 100%, 40%);">+                           tlli_ind := true,</span><br><span style="color: hsl(120, 100%, 40%);">+                             bsn := bsn,</span><br><span style="color: hsl(120, 100%, 40%);">+                           e := false</span><br><span style="color: hsl(120, 100%, 40%);">+                    },</span><br><span style="color: hsl(120, 100%, 40%);">+                    tlli := tlli,</span><br><span style="color: hsl(120, 100%, 40%);">+                 pfi := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                  blocks := blocks</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   template DlMacHeader t_RLCMAC_DlMacH(template MacPayloadType pt, template MacRrbp rrbp, template</span><br><span style="color: hsl(120, 100%, 40%);">+uint3_t usf) := {</span><br><span style="color: hsl(120, 100%, 40%);">+           payload_type := pt,</span><br><span style="color: hsl(120, 100%, 40%);">+           rrbp := rrbp,</span><br><span style="color: hsl(120, 100%, 40%);">+         rrbp_valid := ispresent(rrbp),</span><br><span style="color: hsl(120, 100%, 40%);">+                usf := usf</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   template RlcmacDlBlock tr_RLCMAC_DUMMY_CTRL(template uint3_t usf := ?, template PageMode page_mode := ?) := {</span><br><span style="color: hsl(120, 100%, 40%);">+         ctrl := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT),</span><br><span style="color: hsl(120, 100%, 40%);">+                            rrbp:= ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                             rrbp_valid := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                              usf := usf</span><br><span style="color: hsl(120, 100%, 40%);">+                    },</span><br><span style="color: hsl(120, 100%, 40%);">+                    opt := *,</span><br><span style="color: hsl(120, 100%, 40%);">+                     payload := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          msg_type := PACKET_DL_DUMMY_CTRL,</span><br><span style="color: hsl(120, 100%, 40%);">+                             u := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                        dl_dummy := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                         page_mode := page_mode,</span><br><span style="color: hsl(120, 100%, 40%);">+                                               persistence_levels_present := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              persistence_levels := *</span><br><span style="color: hsl(120, 100%, 40%);">+                                       }</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   template RlcmacDlBlock tr_RLCMAC_DL_PACKET_ASS(template uint3_t usf := ?) := {</span><br><span style="color: hsl(120, 100%, 40%);">+                ctrl := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT),</span><br><span style="color: hsl(120, 100%, 40%);">+                            rrbp:= ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                             rrbp_valid := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                              usf := usf</span><br><span style="color: hsl(120, 100%, 40%);">+                    },</span><br><span style="color: hsl(120, 100%, 40%);">+                    opt := *,</span><br><span style="color: hsl(120, 100%, 40%);">+                     payload := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          msg_type := PACKET_DL_ASSIGNMENT,</span><br><span style="color: hsl(120, 100%, 40%);">+                             u := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                        dl_assignment := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                            page_mode := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                               pres1 := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                           persistence_levels := *,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              tfi_or_tlli := ?</span><br><span style="color: hsl(120, 100%, 40%);">+                                      }</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   template RlcmacDlBlock tr_RLCMAC_UL_PACKET_ASS(template uint3_t usf := ?) := {</span><br><span style="color: hsl(120, 100%, 40%);">+                ctrl := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT),</span><br><span style="color: hsl(120, 100%, 40%);">+                            rrbp:= ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                             rrbp_valid := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                              usf := usf</span><br><span style="color: hsl(120, 100%, 40%);">+                    },</span><br><span style="color: hsl(120, 100%, 40%);">+                    opt := *,</span><br><span style="color: hsl(120, 100%, 40%);">+                     payload := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          msg_type := PACKET_UL_ASSIGNMENT,</span><br><span style="color: hsl(120, 100%, 40%);">+                             u := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                        ul_assignment := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                            page_mode := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                               persistence_levels_present := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              persistence_levels := *,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              identity := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                is_egprs := ?,  /* msg escape */</span><br><span style="color: hsl(120, 100%, 40%);">+                                              gprs := *</span><br><span style="color: hsl(120, 100%, 40%);">+                                     }</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Receive Template for Uplink ACK/NACK */</span><br><span style="color: hsl(120, 100%, 40%);">+    template RlcmacDlBlock tr_RLCMAC_UL_ACK_NACK(template uint5_t ul_tfi, template GprsTlli tlli := ?) := {</span><br><span style="color: hsl(120, 100%, 40%);">+               ctrl := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT),</span><br><span style="color: hsl(120, 100%, 40%);">+                            rrbp:= ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                             rrbp_valid := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                              usf := ?</span><br><span style="color: hsl(120, 100%, 40%);">+                      },</span><br><span style="color: hsl(120, 100%, 40%);">+                    opt := *,</span><br><span style="color: hsl(120, 100%, 40%);">+                     payload := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          msg_type := PACKET_UL_ACK_NACK,</span><br><span style="color: hsl(120, 100%, 40%);">+                               u := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                        ul_ack_nack := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                              page_mode := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                               msg_excape := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              uplink_tfi := ul_tfi,</span><br><span style="color: hsl(120, 100%, 40%);">+                                         is_egprs := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                             gprs := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                     ch_coding_cmd := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                   ack_nack_desc := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                   cont_res_tlli_present := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                   cont_res_tlli := tlli,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                        pkt_ta_present := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                  pkt_ta := *,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                  pwr_ctrl_present := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                        pwr_ctrl := *</span><br><span style="color: hsl(120, 100%, 40%);">+                                         }</span><br><span style="color: hsl(120, 100%, 40%);">+                                     }</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   template RlcmacDlBlock tr_RLCMAC_PACKET_PAG_REQ(template uint3_t usf := ?) := {</span><br><span style="color: hsl(120, 100%, 40%);">+               ctrl := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          payload_type := MAC_PT_RLCMAC_NO_OPT,</span><br><span style="color: hsl(120, 100%, 40%);">+                         rrbp:= ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                             rrbp_valid := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                              usf := usf</span><br><span style="color: hsl(120, 100%, 40%);">+                    },</span><br><span style="color: hsl(120, 100%, 40%);">+                    opt := *,</span><br><span style="color: hsl(120, 100%, 40%);">+                     payload := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          msg_type := PACKET_PAGING_REQUEST,</span><br><span style="color: hsl(120, 100%, 40%);">+                            u := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                        paging := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                           page_mode := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                               persistence_levels_present := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              persistence_levels := *,</span><br><span style="color: hsl(120, 100%, 40%);">+                                              nln_present := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                             nln := *,</span><br><span style="color: hsl(120, 100%, 40%);">+                                             repeated_pageinfo_present := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                               repeated_pageinfo := *</span><br><span style="color: hsl(120, 100%, 40%);">+                                        }</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   template RlcmacDlBlock tr_RLCMAC_DATA_RRBP := {</span><br><span style="color: hsl(120, 100%, 40%);">+               data := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          mac_hdr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                  payload_type := MAC_PT_RLC_DATA,</span><br><span style="color: hsl(120, 100%, 40%);">+                                      rrbp := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                    rrbp_valid := true,</span><br><span style="color: hsl(120, 100%, 40%);">+                                   usf := ?</span><br><span style="color: hsl(120, 100%, 40%);">+                              },</span><br><span style="color: hsl(120, 100%, 40%);">+                            hdr_ext := ?</span><br><span style="color: hsl(120, 100%, 40%);">+                  },</span><br><span style="color: hsl(120, 100%, 40%);">+                    blocks := ?</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   template RlcmacDlBlock tr_RLCMAC_DATA_EGPRS := {</span><br><span style="color: hsl(120, 100%, 40%);">+              data_egprs := {</span><br><span style="color: hsl(120, 100%, 40%);">+                       mac_hdr := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                 fbi := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                     e := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                       blocks := ?</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Template for Uplink MAC Control Header */</span><br><span style="color: hsl(120, 100%, 40%);">+  template UlMacCtrlHeader t_RLCMAC_UlMacCtrlH(template MacPayloadType pt, template boolean retry := false) := {</span><br><span style="color: hsl(120, 100%, 40%);">+                payload_type := pt,</span><br><span style="color: hsl(120, 100%, 40%);">+           spare := '00000'B,</span><br><span style="color: hsl(120, 100%, 40%);">+            retry := retry</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Template for Uplink Control ACK */</span><br><span style="color: hsl(120, 100%, 40%);">+ template RlcmacUlBlock ts_RLCMAC_CTRL_ACK(GprsTlli tlli, CtrlAck ack := MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN) := {</span><br><span style="color: hsl(120, 100%, 40%);">+              ctrl := {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mac_hdr := t_RLCMAC_UlMacCtrlH(MAC_PT_RLCMAC_NO_OPT),</span><br><span style="color: hsl(120, 100%, 40%);">+                 payload := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          msg_type := PACKET_CONTROL_ACK,</span><br><span style="color: hsl(120, 100%, 40%);">+                               u := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                        ctrl_ack := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                         tlli := tlli,</span><br><span style="color: hsl(120, 100%, 40%);">+                                         ctrl_ack := ack</span><br><span style="color: hsl(120, 100%, 40%);">+                                       }</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Template for a LlcBlock (part of a LLC frame inside RlcMac?lDataBlock */</span><br><span style="color: hsl(120, 100%, 40%);">+   template LlcBlock t_RLCMAC_LLCBLOCK(octetstring data, boolean more := false, boolean e := true) := {</span><br><span style="color: hsl(120, 100%, 40%);">+          /* let encoder figure out the header */</span><br><span style="color: hsl(120, 100%, 40%);">+               hdr := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+          payload := data</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+} with { encode "RAW"; variant "FIELDORDER(msb)" }</span><br><span>diff --git a/library/RLCMAC_Types.ttcn b/library/RLCMAC_Types.ttcn</span><br><span>index e5c2464..27c1805 100644</span><br><span>--- a/library/RLCMAC_Types.ttcn</span><br><span>+++ b/library/RLCMAC_Types.ttcn</span><br><span>@@ -31,16 +31,6 @@</span><br><span>            RRBP_Nplus26_mod_2715648        ('11'B)</span><br><span>      } with { variant "FIELDLENGTH(2)" };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      function f_rrbp_fn_delay(MacRrbp rrbp) return uint32_t {</span><br><span style="color: hsl(0, 100%, 40%);">-                select (rrbp) {</span><br><span style="color: hsl(0, 100%, 40%);">-         case (RRBP_Nplus13_mod_2715648) { return 13; }</span><br><span style="color: hsl(0, 100%, 40%);">-          case (RRBP_Nplus17_or_18_mod_2715648) { return 17; }</span><br><span style="color: hsl(0, 100%, 40%);">-            case (RRBP_Nplus21_or_22_mod_2715648) { return 21;  }</span><br><span style="color: hsl(0, 100%, 40%);">-           case (RRBP_Nplus26_mod_2715648) { return 26; }</span><br><span style="color: hsl(0, 100%, 40%);">-          }</span><br><span style="color: hsl(0, 100%, 40%);">-               return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    type enumerated EgprsHeaderType {</span><br><span>            RLCMAC_HDR_TYPE_1,</span><br><span>           RLCMAC_HDR_TYPE_2,</span><br><span>@@ -66,49 +56,6 @@</span><br><span>              // MCS6_9 ?</span><br><span>  };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  function f_rlcmac_cs_mcs2block_len(CodingScheme cs_mcs) return uint32_t {</span><br><span style="color: hsl(0, 100%, 40%);">-               select (cs_mcs) {</span><br><span style="color: hsl(0, 100%, 40%);">-               case (CS_1) { return 23; }</span><br><span style="color: hsl(0, 100%, 40%);">-              case (CS_2) { return 34; }</span><br><span style="color: hsl(0, 100%, 40%);">-              case (CS_3) { return 40; }</span><br><span style="color: hsl(0, 100%, 40%);">-              case (CS_4) { return 54; }</span><br><span style="color: hsl(0, 100%, 40%);">-              case (MCS_1) { return 27; }</span><br><span style="color: hsl(0, 100%, 40%);">-             case (MCS_2) { return 33; }</span><br><span style="color: hsl(0, 100%, 40%);">-             case (MCS_3) { return 42; }</span><br><span style="color: hsl(0, 100%, 40%);">-             case (MCS_4) { return 49; }</span><br><span style="color: hsl(0, 100%, 40%);">-             case (MCS_5) { return 61; }</span><br><span style="color: hsl(0, 100%, 40%);">-             case (MCS_6) { return 79; }</span><br><span style="color: hsl(0, 100%, 40%);">-             case (MCS_7) { return 119; }</span><br><span style="color: hsl(0, 100%, 40%);">-            case (MCS_8) { return 143; }</span><br><span style="color: hsl(0, 100%, 40%);">-            case (MCS_9) { return 155; }</span><br><span style="color: hsl(0, 100%, 40%);">-            }</span><br><span style="color: hsl(0, 100%, 40%);">-               return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       function f_rlcmac_block_len2cs_mcs(uint32_t len) return CodingScheme {</span><br><span style="color: hsl(0, 100%, 40%);">-          select (len) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  case (23) { return CS_1; }</span><br><span style="color: hsl(0, 100%, 40%);">-                      case (34) { return CS_2; }</span><br><span style="color: hsl(0, 100%, 40%);">-                      case (40) { return CS_3; }</span><br><span style="color: hsl(0, 100%, 40%);">-                      case (54) { return CS_4; }</span><br><span style="color: hsl(0, 100%, 40%);">-                      case (27) { return MCS_1; }</span><br><span style="color: hsl(0, 100%, 40%);">-                     case (33) { return MCS_2; }</span><br><span style="color: hsl(0, 100%, 40%);">-                     case (42) { return MCS_3; }</span><br><span style="color: hsl(0, 100%, 40%);">-                     case (49) { return MCS_4; }</span><br><span style="color: hsl(0, 100%, 40%);">-                     case (60) { return MCS_5; }</span><br><span style="color: hsl(0, 100%, 40%);">-                     case (61) { return MCS_5; }</span><br><span style="color: hsl(0, 100%, 40%);">-                     case (78) { return MCS_6; }</span><br><span style="color: hsl(0, 100%, 40%);">-                     case (79) { return MCS_6; }</span><br><span style="color: hsl(0, 100%, 40%);">-                     case (118) { return MCS_7; }</span><br><span style="color: hsl(0, 100%, 40%);">-                    case (119) { return MCS_7; }</span><br><span style="color: hsl(0, 100%, 40%);">-                    case (142) { return MCS_8; }</span><br><span style="color: hsl(0, 100%, 40%);">-                    case (143) { return MCS_8; }</span><br><span style="color: hsl(0, 100%, 40%);">-                    case (154) { return MCS_9; }</span><br><span style="color: hsl(0, 100%, 40%);">-                    case (155) { return MCS_9; }</span><br><span style="color: hsl(0, 100%, 40%);">-            }</span><br><span style="color: hsl(0, 100%, 40%);">-               return CS_1;</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    /* Partof DL RLC data block and DL RLC/MAC ctrl block */</span><br><span>     type record DlMacHeader {</span><br><span>            MacPayloadType  payload_type,</span><br><span>@@ -406,277 +353,6 @@</span><br><span>        external function enc_RlcmacDlBlock(in RlcmacDlBlock si) return octetstring;</span><br><span>         external function dec_RlcmacDlBlock(in octetstring stream) return RlcmacDlBlock;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    template (value) RlcmacUlBlock ts_RLC_UL_CTRL_ACK(RlcmacUlCtrlMsg ctrl,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                 MacPayloadType pt := MAC_PT_RLCMAC_NO_OPT,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                      boolean retry := false) := {</span><br><span style="color: hsl(0, 100%, 40%);">-            ctrl := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            payload_type := pt,</span><br><span style="color: hsl(0, 100%, 40%);">-                             spare := '00000'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                              retry := retry</span><br><span style="color: hsl(0, 100%, 40%);">-                  },</span><br><span style="color: hsl(0, 100%, 40%);">-                      payload := ctrl</span><br><span style="color: hsl(0, 100%, 40%);">-         }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Send Template for Downlink ACK/NACK */</span><br><span style="color: hsl(0, 100%, 40%);">-       template RlcmacUlBlock ts_RLCMAC_DL_ACK_NACK(template uint5_t tfi, AckNackDescription andesc, boolean retry := false) := {</span><br><span style="color: hsl(0, 100%, 40%);">-              ctrl := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            payload_type := MAC_PT_RLCMAC_NO_OPT,</span><br><span style="color: hsl(0, 100%, 40%);">-                           spare := '00000'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                              retry := retry</span><br><span style="color: hsl(0, 100%, 40%);">-                  },</span><br><span style="color: hsl(0, 100%, 40%);">-                      payload := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            msg_type := PACKET_DL_ACK_NACK,</span><br><span style="color: hsl(0, 100%, 40%);">-                         u := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                  dl_ack_nack := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                dl_tfi := tfi,</span><br><span style="color: hsl(0, 100%, 40%);">-                                          ack_nack_desc := andesc,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                chreq_desc_presence := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                            chreq_desc := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                                             ch_qual_rep := c_ChQualRep_default</span><br><span style="color: hsl(0, 100%, 40%);">-                                      }</span><br><span style="color: hsl(0, 100%, 40%);">-                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Template for uplink Data block */</span><br><span style="color: hsl(0, 100%, 40%);">-    template RlcmacUlBlock t_RLCMAC_UL_DATA(template uint5_t tfi, template uint4_t cv, template uint7_t bsn,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                template LlcBlocks blocks := {}, template boolean stall := false) := {</span><br><span style="color: hsl(0, 100%, 40%);">-          data := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            payload_type := MAC_PT_RLC_DATA,</span><br><span style="color: hsl(0, 100%, 40%);">-                                countdown := cv,</span><br><span style="color: hsl(0, 100%, 40%);">-                                stall_ind := false,</span><br><span style="color: hsl(0, 100%, 40%);">-                             retry := false,</span><br><span style="color: hsl(0, 100%, 40%);">-                         spare := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                          pfi_ind := false,</span><br><span style="color: hsl(0, 100%, 40%);">-                               tfi := tfi,</span><br><span style="color: hsl(0, 100%, 40%);">-                             tlli_ind := false,</span><br><span style="color: hsl(0, 100%, 40%);">-                              bsn := bsn,</span><br><span style="color: hsl(0, 100%, 40%);">-                             e := false</span><br><span style="color: hsl(0, 100%, 40%);">-                      },</span><br><span style="color: hsl(0, 100%, 40%);">-                      tlli := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                   pfi := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                    blocks := blocks</span><br><span style="color: hsl(0, 100%, 40%);">-                }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-       template RlcmacUlBlock t_RLCMAC_UL_DATA_TLLI(template uint5_t tfi, template uint4_t cv, template uint7_t bsn,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                template LlcBlocks blocks := {}, template boolean stall := false, template GprsTlli tlli) := {</span><br><span style="color: hsl(0, 100%, 40%);">-             data := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            payload_type := MAC_PT_RLC_DATA,</span><br><span style="color: hsl(0, 100%, 40%);">-                                countdown := cv,</span><br><span style="color: hsl(0, 100%, 40%);">-                                stall_ind := false,</span><br><span style="color: hsl(0, 100%, 40%);">-                             retry := false,</span><br><span style="color: hsl(0, 100%, 40%);">-                         spare := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                          pfi_ind := false,</span><br><span style="color: hsl(0, 100%, 40%);">-                               tfi := tfi,</span><br><span style="color: hsl(0, 100%, 40%);">-                             tlli_ind := true,</span><br><span style="color: hsl(0, 100%, 40%);">-                               bsn := bsn,</span><br><span style="color: hsl(0, 100%, 40%);">-                             e := false</span><br><span style="color: hsl(0, 100%, 40%);">-                      },</span><br><span style="color: hsl(0, 100%, 40%);">-                      tlli := tlli,</span><br><span style="color: hsl(0, 100%, 40%);">-                   pfi := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                    blocks := blocks</span><br><span style="color: hsl(0, 100%, 40%);">-                }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       template DlMacHeader t_RLCMAC_DlMacH(template MacPayloadType pt, template MacRrbp rrbp, template</span><br><span style="color: hsl(0, 100%, 40%);">-uint3_t usf) := {</span><br><span style="color: hsl(0, 100%, 40%);">-               payload_type := pt,</span><br><span style="color: hsl(0, 100%, 40%);">-             rrbp := rrbp,</span><br><span style="color: hsl(0, 100%, 40%);">-           rrbp_valid := ispresent(rrbp),</span><br><span style="color: hsl(0, 100%, 40%);">-          usf := usf</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       template RlcmacDlBlock tr_RLCMAC_DUMMY_CTRL(template uint3_t usf := ?, template PageMode page_mode := ?) := {</span><br><span style="color: hsl(0, 100%, 40%);">-           ctrl := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT),</span><br><span style="color: hsl(0, 100%, 40%);">-                              rrbp:= ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                               rrbp_valid := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                usf := usf</span><br><span style="color: hsl(0, 100%, 40%);">-                      },</span><br><span style="color: hsl(0, 100%, 40%);">-                      opt := *,</span><br><span style="color: hsl(0, 100%, 40%);">-                       payload := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            msg_type := PACKET_DL_DUMMY_CTRL,</span><br><span style="color: hsl(0, 100%, 40%);">-                               u := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                  dl_dummy := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                           page_mode := page_mode,</span><br><span style="color: hsl(0, 100%, 40%);">-                                         persistence_levels_present := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                persistence_levels := *</span><br><span style="color: hsl(0, 100%, 40%);">-                                 }</span><br><span style="color: hsl(0, 100%, 40%);">-                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       template RlcmacDlBlock tr_RLCMAC_DL_PACKET_ASS(template uint3_t usf := ?) := {</span><br><span style="color: hsl(0, 100%, 40%);">-          ctrl := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT),</span><br><span style="color: hsl(0, 100%, 40%);">-                              rrbp:= ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                               rrbp_valid := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                usf := usf</span><br><span style="color: hsl(0, 100%, 40%);">-                      },</span><br><span style="color: hsl(0, 100%, 40%);">-                      opt := *,</span><br><span style="color: hsl(0, 100%, 40%);">-                       payload := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            msg_type := PACKET_DL_ASSIGNMENT,</span><br><span style="color: hsl(0, 100%, 40%);">-                               u := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                  dl_assignment := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                              page_mode := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                         pres1 := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                             persistence_levels := *,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                tfi_or_tlli := ?</span><br><span style="color: hsl(0, 100%, 40%);">-                                        }</span><br><span style="color: hsl(0, 100%, 40%);">-                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       template RlcmacDlBlock tr_RLCMAC_UL_PACKET_ASS(template uint3_t usf := ?) := {</span><br><span style="color: hsl(0, 100%, 40%);">-          ctrl := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT),</span><br><span style="color: hsl(0, 100%, 40%);">-                              rrbp:= ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                               rrbp_valid := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                usf := usf</span><br><span style="color: hsl(0, 100%, 40%);">-                      },</span><br><span style="color: hsl(0, 100%, 40%);">-                      opt := *,</span><br><span style="color: hsl(0, 100%, 40%);">-                       payload := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            msg_type := PACKET_UL_ASSIGNMENT,</span><br><span style="color: hsl(0, 100%, 40%);">-                               u := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                  ul_assignment := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                              page_mode := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                         persistence_levels_present := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                persistence_levels := *,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                identity := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                          is_egprs := ?,  /* msg escape */</span><br><span style="color: hsl(0, 100%, 40%);">-                                                gprs := *</span><br><span style="color: hsl(0, 100%, 40%);">-                                       }</span><br><span style="color: hsl(0, 100%, 40%);">-                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Receive Template for Uplink ACK/NACK */</span><br><span style="color: hsl(0, 100%, 40%);">-      template RlcmacDlBlock tr_RLCMAC_UL_ACK_NACK(template uint5_t ul_tfi, template GprsTlli tlli := ?) := {</span><br><span style="color: hsl(0, 100%, 40%);">-         ctrl := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            payload_type := (MAC_PT_RLCMAC_NO_OPT, MAC_PT_RLCMAC_OPT),</span><br><span style="color: hsl(0, 100%, 40%);">-                              rrbp:= ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                               rrbp_valid := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                usf := ?</span><br><span style="color: hsl(0, 100%, 40%);">-                        },</span><br><span style="color: hsl(0, 100%, 40%);">-                      opt := *,</span><br><span style="color: hsl(0, 100%, 40%);">-                       payload := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            msg_type := PACKET_UL_ACK_NACK,</span><br><span style="color: hsl(0, 100%, 40%);">-                         u := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                  ul_ack_nack := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                page_mode := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                         msg_excape := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                uplink_tfi := ul_tfi,</span><br><span style="color: hsl(0, 100%, 40%);">-                                           is_egprs := '0'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                               gprs := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                       ch_coding_cmd := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                     ack_nack_desc := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                     cont_res_tlli_present := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                     cont_res_tlli := tlli,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                  pkt_ta_present := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                    pkt_ta := *,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                    pwr_ctrl_present := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                  pwr_ctrl := *</span><br><span style="color: hsl(0, 100%, 40%);">-                                           }</span><br><span style="color: hsl(0, 100%, 40%);">-                                       }</span><br><span style="color: hsl(0, 100%, 40%);">-                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       template RlcmacDlBlock tr_RLCMAC_PACKET_PAG_REQ(template uint3_t usf := ?) := {</span><br><span style="color: hsl(0, 100%, 40%);">-         ctrl := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            payload_type := MAC_PT_RLCMAC_NO_OPT,</span><br><span style="color: hsl(0, 100%, 40%);">-                           rrbp:= ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                               rrbp_valid := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                usf := usf</span><br><span style="color: hsl(0, 100%, 40%);">-                      },</span><br><span style="color: hsl(0, 100%, 40%);">-                      opt := *,</span><br><span style="color: hsl(0, 100%, 40%);">-                       payload := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            msg_type := PACKET_PAGING_REQUEST,</span><br><span style="color: hsl(0, 100%, 40%);">-                              u := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                  paging := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                             page_mode := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                         persistence_levels_present := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                persistence_levels := *,</span><br><span style="color: hsl(0, 100%, 40%);">-                                                nln_present := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                               nln := *,</span><br><span style="color: hsl(0, 100%, 40%);">-                                               repeated_pageinfo_present := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                         repeated_pageinfo := *</span><br><span style="color: hsl(0, 100%, 40%);">-                                  }</span><br><span style="color: hsl(0, 100%, 40%);">-                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       template RlcmacDlBlock tr_RLCMAC_DATA_RRBP := {</span><br><span style="color: hsl(0, 100%, 40%);">-         data := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            mac_hdr := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                    payload_type := MAC_PT_RLC_DATA,</span><br><span style="color: hsl(0, 100%, 40%);">-                                        rrbp := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                      rrbp_valid := true,</span><br><span style="color: hsl(0, 100%, 40%);">-                                     usf := ?</span><br><span style="color: hsl(0, 100%, 40%);">-                                },</span><br><span style="color: hsl(0, 100%, 40%);">-                              hdr_ext := ?</span><br><span style="color: hsl(0, 100%, 40%);">-                    },</span><br><span style="color: hsl(0, 100%, 40%);">-                      blocks := ?</span><br><span style="color: hsl(0, 100%, 40%);">-             }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       template RlcmacDlBlock tr_RLCMAC_DATA_EGPRS := {</span><br><span style="color: hsl(0, 100%, 40%);">-                data_egprs := {</span><br><span style="color: hsl(0, 100%, 40%);">-                 mac_hdr := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                   fbi := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                       e := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                 blocks := ?</span><br><span style="color: hsl(0, 100%, 40%);">-             }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Template for Uplink MAC Control Header */</span><br><span style="color: hsl(0, 100%, 40%);">-    template UlMacCtrlHeader t_RLCMAC_UlMacCtrlH(template MacPayloadType pt, template boolean retry := false) := {</span><br><span style="color: hsl(0, 100%, 40%);">-          payload_type := pt,</span><br><span style="color: hsl(0, 100%, 40%);">-             spare := '00000'B,</span><br><span style="color: hsl(0, 100%, 40%);">-              retry := retry</span><br><span style="color: hsl(0, 100%, 40%);">-  }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Template for Uplink Control ACK */</span><br><span style="color: hsl(0, 100%, 40%);">-   template RlcmacUlBlock ts_RLCMAC_CTRL_ACK(GprsTlli tlli, CtrlAck ack := MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN) := {</span><br><span style="color: hsl(0, 100%, 40%);">-                ctrl := {</span><br><span style="color: hsl(0, 100%, 40%);">-                       mac_hdr := t_RLCMAC_UlMacCtrlH(MAC_PT_RLCMAC_NO_OPT),</span><br><span style="color: hsl(0, 100%, 40%);">-                   payload := {</span><br><span style="color: hsl(0, 100%, 40%);">-                            msg_type := PACKET_CONTROL_ACK,</span><br><span style="color: hsl(0, 100%, 40%);">-                         u := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                  ctrl_ack := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                           tlli := tlli,</span><br><span style="color: hsl(0, 100%, 40%);">-                                           ctrl_ack := ack</span><br><span style="color: hsl(0, 100%, 40%);">-                                 }</span><br><span style="color: hsl(0, 100%, 40%);">-                               }</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Template for a LlcBlock (part of a LLC frame inside RlcMac?lDataBlock */</span><br><span style="color: hsl(0, 100%, 40%);">-     template LlcBlock t_RLCMAC_LLCBLOCK(octetstring data, boolean more := false, boolean e := true) := {</span><br><span style="color: hsl(0, 100%, 40%);">-            /* let encoder figure out the header */</span><br><span style="color: hsl(0, 100%, 40%);">-         hdr := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-            payload := data</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> /************************</span><br><span>  * PTCCH/D (Packet Timing Advance Control Channel) message.</span><br><span>  * TODO: add a spec. reference to the message format definition.</span><br><span>diff --git a/mme/gen_links.sh b/mme/gen_links.sh</span><br><span>index 469b92f..b0ecf86 100755</span><br><span>--- a/mme/gen_links.sh</span><br><span>+++ b/mme/gen_links.sh</span><br><span>@@ -56,7 +56,7 @@</span><br><span> DIR=../library</span><br><span> FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc "</span><br><span> FILES+="SGsAP_Templates.ttcn SGsAP_CodecPort.ttcn SGsAP_CodecPort_CtrlFunct.ttcn SGsAP_CodecPort_CtrlFunctDef.cc SGsAP_Emulation.ttcn DNS_Helpers.ttcn "</span><br><span style="color: hsl(0, 100%, 40%);">-FILES+="L3_Templates.ttcn RLCMAC_CSN1_Types.ttcn "</span><br><span style="color: hsl(120, 100%, 40%);">+FILES+="L3_Templates.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn "</span><br><span> FILES+="S1AP_CodecPort.ttcn S1AP_CodecPort_CtrlFunctDef.cc S1AP_CodecPort_CtrlFunct.ttcn S1AP_Emulation.ttcn "</span><br><span> FILES+="NAS_Templates.ttcn GTPv2_PrivateExtensions.ttcn GTPv2_Templates.ttcn "</span><br><span> FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn DIAMETER_Templates.ttcn "</span><br><span>diff --git a/msc/gen_links.sh b/msc/gen_links.sh</span><br><span>index 329a7d1..221110e 100755</span><br><span>--- a/msc/gen_links.sh</span><br><span>+++ b/msc/gen_links.sh</span><br><span>@@ -93,7 +93,7 @@</span><br><span> DIR=../library</span><br><span> FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc "</span><br><span> FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc GSUP_Types.ttcn GSUP_Emulation.ttcn "</span><br><span style="color: hsl(0, 100%, 40%);">-FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn RLCMAC_CSN1_Types.ttcn L3_Common.ttcn "</span><br><span style="color: hsl(120, 100%, 40%);">+FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn L3_Common.ttcn "</span><br><span> FILES+="RAN_Emulation.ttcnpp BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn RAN_Adapter.ttcnpp MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn "</span><br><span> FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc "</span><br><span> FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc "</span><br><span>diff --git a/pcu/GPRS_TBF.ttcn b/pcu/GPRS_TBF.ttcn</span><br><span>index 1c9a75b..fb42097 100644</span><br><span>--- a/pcu/GPRS_TBF.ttcn</span><br><span>+++ b/pcu/GPRS_TBF.ttcn</span><br><span>@@ -14,8 +14,9 @@</span><br><span> import from GSM_Types all;</span><br><span> import from Osmocom_Types all;</span><br><span> import from General_Types all;</span><br><span style="color: hsl(0, 100%, 40%);">-import from RLCMAC_Types all;</span><br><span> import from RLCMAC_CSN1_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+import from RLCMAC_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+import from RLCMAC_Templates all;</span><br><span> import from LLC_Types all;</span><br><span> import from GPRS_Context all;</span><br><span> </span><br><span>diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn</span><br><span>index 24c198e..3562925 100644</span><br><span>--- a/pcu/PCU_Tests.ttcn</span><br><span>+++ b/pcu/PCU_Tests.ttcn</span><br><span>@@ -28,7 +28,9 @@</span><br><span> </span><br><span> import from MobileL3_GMM_SM_Types all;</span><br><span> import from RLCMAC_CSN1_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+import from RLCMAC_CSN1_Templates all;</span><br><span> import from RLCMAC_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+import from RLCMAC_Templates all;</span><br><span> </span><br><span> import from MobileL3_CommonIE_Types all;</span><br><span> import from L3_Templates all;</span><br><span>diff --git a/pcu/gen_links.sh b/pcu/gen_links.sh</span><br><span>index da035cb..3a52c99 100755</span><br><span>--- a/pcu/gen_links.sh</span><br><span>+++ b/pcu/gen_links.sh</span><br><span>@@ -49,7 +49,7 @@</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> DIR=../library</span><br><span style="color: hsl(0, 100%, 40%);">-FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc "</span><br><span style="color: hsl(120, 100%, 40%);">+FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Templates.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc "</span><br><span> FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "</span><br><span> FILES+="BSSGP_Emulation.ttcn Osmocom_Gb_Types.ttcn "</span><br><span> FILES+="LLC_Templates.ttcn L3_Templates.ttcn L3_Common.ttcn "</span><br><span>diff --git a/selftest/gen_links.sh b/selftest/gen_links.sh</span><br><span>index c590de6..fd64a48 100755</span><br><span>--- a/selftest/gen_links.sh</span><br><span>+++ b/selftest/gen_links.sh</span><br><span>@@ -39,7 +39,7 @@</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> DIR=../library</span><br><span style="color: hsl(0, 100%, 40%);">-FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn GSUP_Types.ttcn"</span><br><span style="color: hsl(120, 100%, 40%);">+FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn GSUP_Types.ttcn"</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> ignore_pp_results</span><br><span>diff --git a/sgsn/gen_links.sh b/sgsn/gen_links.sh</span><br><span>index 3552bc2..bd3a7ea 100755</span><br><span>--- a/sgsn/gen_links.sh</span><br><span>+++ b/sgsn/gen_links.sh</span><br><span>@@ -83,7 +83,7 @@</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> DIR=../library</span><br><span style="color: hsl(0, 100%, 40%);">-FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc "</span><br><span style="color: hsl(120, 100%, 40%);">+FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Templates.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc "</span><br><span> FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "</span><br><span> FILES+="BSSGP_Emulation.ttcn Osmocom_Gb_Types.ttcn "</span><br><span> FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn "</span><br><span>diff --git a/sysinfo/gen_links.sh b/sysinfo/gen_links.sh</span><br><span>index d32b89b..3526a29 100755</span><br><span>--- a/sysinfo/gen_links.sh</span><br><span>+++ b/sysinfo/gen_links.sh</span><br><span>@@ -25,7 +25,7 @@</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> DIR=../library</span><br><span style="color: hsl(0, 100%, 40%);">-FILES="GSMTAP_PortType.ttcn GSMTAP_Types.ttcn GSM_SystemInformation.ttcn GSM_RR_Types.ttcn RLCMAC_CSN1_Types.ttcn GSM_Types.ttcn IPL4_GSMTAP_CtrlFunct.ttcn IPL4_GSMTAP_CtrlFunctDef.cc Osmocom_Types.ttcn Misc_Helpers.ttcn General_Types.ttcn Osmocom_VTY_Functions.ttcn"</span><br><span style="color: hsl(120, 100%, 40%);">+FILES="GSMTAP_PortType.ttcn GSMTAP_Types.ttcn GSM_SystemInformation.ttcn GSM_RR_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_Types.ttcn IPL4_GSMTAP_CtrlFunct.ttcn IPL4_GSMTAP_CtrlFunctDef.cc Osmocom_Types.ttcn Misc_Helpers.ttcn General_Types.ttcn Osmocom_VTY_Functions.ttcn"</span><br><span> gen_links $DIR $FILES</span><br><span> </span><br><span> ignore_pp_results</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17981">change 17981</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17981"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I9c6597178168aa3848b21930f33be698dd2ce545 </div>
<div style="display:none"> Gerrit-Change-Number: 17981 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>