/******************************************************************************/
// @copyright   Copyright Notification
//   No part may be reproduced except as authorized by written permission.
//   The copyright and the foregoing restriction extend to reproduction in all media.
//   Trademark 2010, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC).
//   All rights reserved.
// @version: IWD_10wk37
// $Date: 2010-09-15 12:03:23 +0200 (Wed, 15 Sep 2010) $
// $Rev: 3890 $
/******************************************************************************/

module GERAN_TypeDefs {
  import from CommonDefs all;
  import from NAS_CommonTypeDefs all;
  import from NAS_24008TypeDefs all;

  //****************************************************************************
  // Port definitions
  //****************************************************************************

  type port GERAN_CL1_PORT message {         // GERAN port for physical layer configuration
    out G_CPHY_CONFIG_REQ;
    in  G_CPHY_CONFIG_CNF;
  };

  type port GERAN_CLLC_PORT message {         // GERAN port for LLC configuration
    out G_LLC_CONFIG_REQ;
    in  G_LLC_CONFIG_CNF;
  };

  type port GERAN_CRLC_PORT message {         // GERAN port for RLC configuration
    out G_RLC_CONFIG_REQ;
    in  G_RLC_CONFIG_CNF;
  };

  type port GERAN_L2_PORT message {         // GERAN port for sending/receiving L2 data
    out G_L2_DATAMESSAGE_REQ;
    in  G_L2_DATAMESSAGE_IND;
  };

  type port GERAN_LLC_PORT message {         // GERAN port for sending/receiving LLC data
    out G_LLC_DATAMESSAGE_REQ;
    in  G_LLC_DATAMESSAGE_IND;
  };

  type port GERAN_RLC_PORT message {         // GERAN port for sending/receiving RLC data
    out G_RLC_DATAMESSAGE_REQ;
    in  G_RLC_DATAMESSAGE_IND;
  };

  //-----------------------------------------------------------------------------

  type B5_Type         BCCHFreq;                     // position of a bcch carrier in the bcch channel list
  type B2_Type         Channel;                      // needed channel type
  type integer         ChannelCoding;                          // 1 - CS-1;
                                                             // 2 - CS-2;
                                                             // 3 - CS-3;
                                                             // 4 -- CS-4;
                                                             // 5 - MCS-1;
                                                             // 6 - MCS-2;
                                                             // 7 - MCS-3;
                                                             // 8 - MCS-4;
                                                             // 9 - MCS-5;
                                                             // 10 - MCS-6;
                                                             // 11 - MCS-7;
                                                             // 12 - MCS-8;
                                                             // 13 - MCS-9;
                                                             // 14 - MCS-5-7;
                                                             // 15 - MCS-6
  type enumerated      GERAN_CellId_Type { geran_Cell24, geran_Cell25, geran_Cell26 };

  type enumerated      ChannelCombination {TCH_F,    // TCH/F + FACCH/F + SACCH/TF
                                         TCH_H1,   // TCH/H(0,1) + FACCH/H(0,1) + SACCH/TH(0,1)
                                         TCH_H0,   // TCH/H(0,0) + FACCH/H(0,1) + SACCH/TH(0,1) + TCH/H(1,1)
                                         ControlCH,// FCCH + SCH + BCCH + CCCH
                                         CombinedControlCH, // FCCH + SCH + BCCH + CCCH + SDCCH/4(0..3) + SACCH/C4(0..3)
                                         BCCH_CCCH,// BCCH + CCCH
                                         SDCCH8,   // 7 SDCCH/8(0..7) + SACCH/C8(0.. 7)
                                         TCH_F_FACCH_SACCHM, // 8 TCH/F + FACCH/F + SACCH/M
                                         TCH_F_SACCHM,       // 9 TCH/F + SACCH/M
                                         TCH_FD,   // 10 TCH/FD + SACCH/MD
                                         PDTCH}              // 13 PDTCH/F+PACCH/F+PTCCH/F
  type B5_Type       EGPRSWindowSize;              // 3GPP TS 44.060 clause 12.5.2
  type enumerated    GERAN_BandUnderTestType {GSM450, GSM480, GSM710, GSM750, T_GSM810, GSM850, GSM_P900, GSM_E900, DCS1800, PCS1900}//, //Single Band Test
//                                              GSM450_900, GSM450_1800, GSM480_900, GSM480_1800, GSM900_1800 } // Multi band Test
  type enumerated    G_LogicChType {BCCH, RACH, PCH, AGCH, SDCCH_4, SACCH_C4, SDCCH_8, SACCH_C8, TCH_F, FACCH_F, SACCH_TF, TCH_H, FACCH_H, SACCH_TH,
                               PDTCH_F, PACCH_F}
  type integer       PagingMode;
  type B2_Type       RRBP;
  type B6_Type       RxLevel;                      // received signal strength
  type B1_Type       S_P_Bit;
  type B5_Type       TFI;
  
  type enumerated GERAN_POSTAMBLE_STATE_TYPE {G1_IDLE, G2_PSHANDOVER, G3_CSFALLBACK, G4_CSCALL, G5_DEREGISTERED};
  type enumerated GERAN_POSTAMBLE_CONDITIONS {GERAN_C1, GERAN_C2, GERAN_C3};

// =============================================================================
// Test Suite Constant Declarations
// -----------------------------------------------------------------------------
type record AccessTechRequest {
  B4_Type              accessTechType  optional,
  B1_Type              mask optional
};

type record of AccessTechRequest AccessTechRequestList;

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record AccessTechnology {
  B4_Type              accessTechnologyType,
  B1_Type              prefix               // value 1 if next iteration present
};

type record of AccessTechnology AccessTechnologyList;

// =============================================================================
// Structured Type Definition
// BA Freq list
// 3GPP TS 44.018 clause 10.5.2.1c
// -----------------------------------------------------------------------------
type record BA_Freq {
  B10_Type             bA_Freq1,
  B1_Type              endingBit  optional  // a value of 1 indicates another repetition
};

type record of BA_Freq BA_FreqList;

type record BA_FreqLists {
  B1_Type     prefixBit,
  BA_FreqList baFreqList optional
}

// =============================================================================
// Structured Type Definition
// BA list pref
// 3GPP TS 44.018 clause 10.5.2.1c
// -----------------------------------------------------------------------------
type record BA_ListPref {
  IEI8_Type           iei  optional,                   // '01110101'B
  O1_Type              iel,
  RangeLimits       rangeList,
  BA_FreqLists     bA_FreqList,
  bitstring       spareBits  optional
};

// =============================================================================
// Structured Type Definition
// BA range
// 3GPP TS 44.018 clause 10.5.2.1a
// -----------------------------------------------------------------------------
type record BA_Range {
  IEI8_Type       iei  optional,
  O1_Type         iel  optional,
  O1_Type         numberOfRanges,        // number of ranges, at least 1
  octetstring     ranges
};

type enumerated GERAN_CellConfiguration_Type {
  geran_GSMOnly,
  geran_GPRS
};

type enumerated GERAN_SI2Configuration_Type {
  geran_NoSI2quater,
  geran_SI2quater,
  geran_SI2ter,
  geran_SI2terAnd2quater
};

// =============================================================================
// The GERAN global variable type
// -----------------------------------------------------------------------------
//type record GERAN_Ctrl_Type {
//  GERAN_CellInfoList_Type  CellCfg,
//  B64_Type    kcGSM, //GSM Cipher Key 64 bits (TS 33.102 cl. 6.8.1.2)
//  B3_Type     cipherAlgGPRS, // to hold the GPRS ciphering algorithm
//  DRXparameter splitPGCycle, //used to determine paging group for DL TBFs
//  TLLI tLLI,
//  TLLI oldTLLI, // used in UL TBFs
//  SI2quaterRO si2quaterRO
//}

// =============================================================================
// Structured Type Definition
// Cell description
// 3GPP TS 44.018 clause 10.5.2.2
// The info element is two octets long.
// -----------------------------------------------------------------------------
type record CellDescr {
  B2_Type              bCCH_ARFCN_h,          // bcch arfcn high part
  B3_Type              nCC,                   // PLMN colour code
  B3_Type              bCC,                   // BS colour code
  B8_Type              bCCH_ARFCN_l             // bcch arfcn low part
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.7
// -----------------------------------------------------------------------------
type record ChReqDescr {
  B4_Type              pkThrouputClass,
  B2_Type              radioPriority,
  B1_Type              rlcMode,
  B1_Type              llcPduType,
  B16_Type             rlcOctetCount
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.7
// -----------------------------------------------------------------------------
type record ExtChReqDescr {
  B7_Type              pFI,
  B2_Type              radioPrior,
  B1_Type              rlcMode,
  B1_Type              mask1,
  B1_Type              llcPduType    optional,  // not present if mask1 = 0
  B1_Type              repeatMask    // always 0 as only one instance defined for PRR
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.7a
// -----------------------------------------------------------------------------
type record IuModeChReqDescr {
  B5_Type              rBId,
  B2_Type              radioPrior,
  B1_Type              mask1,
  B8_Type              rlcOctetCount    optional,  // not present if mask1 = 0
  B1_Type              repeatMask    // always 0 as only one instance defined for PRR
};

// =============================================================================
// Structured Type Definition
// Cell options (BCCH )
// 3GPP TS 44.018 clause 10.5.2.3
// -----------------------------------------------------------------------------
type record CellOptionBCCH {
  IEI8_Type            iei optional,                   // information lelement identifier
  B1_Type              dN_Ind,                // dynamic ARFCN mapping indicator
  B1_Type              pwrc,                  // power control indicator
  B2_Type              dtx,                   // discontinuous transmission indicator
  B4_Type              radioLinkTimeout       // radio link timeout
};

// =============================================================================
// Structured Type Definition
// Cell options (SACCH)
// 3GPP TS 44.018 clause 10.5.2.3a
// -----------------------------------------------------------------------------
type record CellOptionSACCH {
  IEI8_Type           iei  optional,                   // information lelement identifier
  B1_Type              dtx8,                  // high bit of discontinuous transmission
  B1_Type              pwrc,                  // power control indicator
  B2_Type              dtx65,                 // lower 2 bits of discontinuous transmission indicator
  B4_Type              radioLinkTimeout       // radio link timeout
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record AdditionalMeasParam3G {
  B3_Type              fddQminOffset,
  B4_Type              fddRSCPmin
};

//=============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.10a
// -----------------------------------------------------------------------------
type record of ARFCN_Index ARFCN_IndexList;

type record ARFCN_Index {
  B6_Type              aRFCN_Index,
  B1_Type              end_Bit                // the value of the bit is zero when it indicates the end of the structure
};

// =============================================================================
// Structured Type Definition
// Cell channel description
// 3GPP TS 44.018 clause 10.5.2.1b
// -----------------------------------------------------------------------------
type record CellChDescr {
  IEI8_Type           iei  optional,                   // '01100010'B
  O16_Type            refFreqList            // reference frequency list, the first octet is length
};

type record DedicatedServiceInfo {
  IEI8_Type           iei  optional,
  B7_Type             spare,
  B1_Type             sis
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.24
// -----------------------------------------------------------------------------
type record ExtensionInfo {
  B1_Type              extensionMask,         // R99 extension
  B1_Type              eGPRS_PACKET_CHANNEL_REQUEST  optional, // not present if extensionMask = 0
  B4_Type              bEP_PERIOD  optional,            // not present if extensionMask = 0
  B1_Type              pFC_FEATURE_MODE optional,
  B1_Type              dTM_SUPPORT optional,
  B1_Type              bSS_PAGING_COORDINATION optional,
  B1_Type              cCN_ACTIVE optional,
  B1_Type              nW_EXT_UTBF optional,
  B1_Type              multiTBFCap optional,
  B1_Type              extUTBFNoData optional,
  B1_Type              dTMEhancCap optional,
  B1_Type              mbmsMask optional,
  B1_Type              dedModeMBMSSupprt  optional,     // not present if mbmsMask = 0
  B1_Type              mNCISupport  optional,           // not present if mbmsMask = 0
  B1_Type              reducedLatencyAccess,
  bitstring            spareBit  optional
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 9.1.54
// -----------------------------------------------------------------------------
type record UTRAN_FDD_Descr {
  B1_Type              bandwidthMask,
  B3_Type              bandwidthFDD  optional,          // not present if bandwidthMask = 0
  RepeatedUTRAN_FDD_NeighCellList repeatedUTRAN_FDD_NeighbourCells1  optional
};

type record RepeatedUTRANFDDNeighCell{
  B1_Type                      prefix,
  RepeatedUTRAN_FDD_NeighCells iteration optional// only present if prefix = 1
}

type record of RepeatedUTRANFDDNeighCell RepeatedUTRAN_FDD_NeighCellList;

// =============================================================================
// Structured Type Definition
// 44.018 clause 10.5.2.1e
// // -----------------------------------------------------------------------------
type record UTRAN_FDD_Descr_CR {
  B1_Type              bandwidthMask,
  B3_Type              bandwidthFDD  optional,          // not present if bandwidthMask = 0
  B14_Type             fDD_ARFCN,
  B1_Type              fDDIndMask,
  B1_Type              fDD_Indic0  optional,            // not present if fDDIndMask = 0
  B5_Type              nR_OF_FDD_CELLS  optional,       // not present if fDDIndMask = 0
  bitstring       fDD_CELL_INFORMATION  optional        // not present if fDDIndMask = 0
                                                        // length of this bitstring = p(nR_OF_FDD_CELLS)
};

type record of UTRAN_FDD_Descr_CR UTRANFDDDescr_CRList;

type record UTRANFDDDescr_CRStruct {
  B1_Type              prefix,
  UTRANFDDDescr_CRList fdd optional  //only present if prefix = 1
}

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 9.1.54
// -----------------------------------------------------------------------------
type record UTRAN_TDD_Descr {
  B1_Type              bandwidthMask ,
  B3_Type              bandwidthTDD  optional,          // not present if bandwidthMask = 0
  RepeatedUTRAN_TDD_NeighCellList repeatedUTRAN_TDD_NeighbourCells1  optional
};

type record RepeatedUTRANTDDNeighCell{
  B1_Type                      prefix,
  RepeatedUTRAN_TDD_NeighCells iteration optional// only present if prefix = 1
}

type record of RepeatedUTRANTDDNeighCell RepeatedUTRAN_TDD_NeighCellList;

type record UTRAN_TDD_Descr_PMO {
  B1_Type              bandwidthMask ,
  B3_Type              bandwidthTDD  optional,          // not present if bandwidthMask = 0
  RepeatedUTRAN_TDD_PMO_NeighCellList repeatedUTRAN_TDD_PMO_NeighbourCells1  optional
};

type record RepeatedUTRANTDDPMONeighCell{
  B1_Type                          prefix,
  RepeatedUTRAN_TDD_PMO_NeighCells iteration optional// only present if prefix = 1
}

type record of RepeatedUTRANTDDPMONeighCell RepeatedUTRAN_TDD_PMO_NeighCellList;

type record of UTRAN_TDD_Descr_CR UTRANTDDDescr_CRList;

type record UTRANTDDDescr_CRStruct {
  B1_Type              prefix,
  UTRANTDDDescr_CRList tdd optional  //only present if prefix = 1
}

// =============================================================================
// Structured Type Definition
// 44.018 clause 10.5.2.1e
// -----------------------------------------------------------------------------
type record UTRAN_TDD_Descr_CR {
  B1_Type              bandwidthMask,
  B3_Type              bandwidthTDD  optional,          // not present if bandwidthMask = 0
  B14_Type             tDD_ARFCN,
  B1_Type              tDDIndMask,
  B1_Type              tDD_Indic0  optional,            // not present if tDDIndMask = 0
  B5_Type              nR_OF_TDD_CELLS  optional,       // not present if tDDIndMask = 0
  bitstring       tDD_CELL_INFORMATION  optional        // not present if tDDIndMask = 0
                                                        // length of this bitstring = p(nR_OF_TDD_CELLS)
};
// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.1e
// -----------------------------------------------------------------------------
type record CellSelInd {
  O1_Type                iei  optional,
  O1_Type                ielength  optional,
  B3_Type                ranDescr,
  GSM_DescrStruct        gsmDescr optional, // only present if ranDescr = 000
  UTRANFDDDescr_CRStruct uTRANFDDDescr  optional,      // Only present if ranDescr = '001'
  UTRANTDDDescr_CRStruct uTRANTDDDescr  optional,      // Only present if ranDescr = '010'
  EUTRANDescr_CRStruct   eUTRANDescr  optional      // Only present if ranDescr = '011'
};

type record GSM_DescrStruct {
  B1_Type       prefix,
  GSM_DescrList gsmDescr optional // only present if prefix = 1
}

type record of GSM_Descr GSM_DescrList;

type record GSM_Descr {
  B1_Type              bandInd,
  B10_Type             aRFCN,
  B6_Type              bSIC
}

type record EUTRANDescr_CRStruct {
  B1_Type       prefix,
  EUTRAN_DescrList eutranDescr optional // only present if prefix = 1
}

type record of EUTRAN_Descr EUTRAN_DescrList;

type record EUTRAN_Descr {
  B16_Type     earfcn,
  B1_Type      bwMask,
  B3_Type      measBandwidth  optional,  // only present if bwMask = 1 @sic R5s100135 sic@
  B1_Type      naMask,
  RptdEUTRANNotAllowedCells notAllowed  optional,  // only present if naMask = 1
  B1_Type      tMask,
  B9_Type      targetPCID   optional,  // only present if tMask = 1
  B1_Type      endingRepetition  // @sic R5s100135 sic@
};

// =============================================================================
// Structured Type Definition
// Channel mode 2
// 3GPP TS 44.018 clause 10.5.2.7
// -----------------------------------------------------------------------------
type record ChMode2 {
  IEI8_Type           iei  optional,                   // '01100110'B
  B8_Type              mode
};

// =============================================================================
// Structured Type Definition
// Channels needed
// 3GPP TS 44.018 clause 10.5.2.8
// -----------------------------------------------------------------------------
type record ChNeeded {
  B4_Type              iei  optional,                   // information element identity
  Channel         ch2,                   // needed channel 2          O
  Channel         ch1                    // needed channel 1          M
};


// =============================================================================
// Structured Type Definition
// used in DTM Request
// 3GPP TS 44.018 clause 10.5.2.8b
// -----------------------------------------------------------------------------
type record ChReqDescr2 {
  O1_Type             ielength  optional,
  B2_Type              pktEstCause,           // Packet Establishment Cause
  ChReqDescr           chReqDescr,
  B1_Type              mask,
  B7_Type              pFI  optional,                   // not present if mask=0
  B1_Type              multiTBFCap,
  LH_B1_Type           maskR7,
  B1_Type              rlcNonPModeCap  optional,  // not present if maskR7 = 0
  B1_Type              reducedLatencyCap  optional,  // not present if maskR7 = 0
  B2_Type              ulEGPRS2  optional,  // not present if maskR7 = 0
  B2_Type              dlEGPRS2  optional,  // not present if maskR7 = 0
  bitstring            sparepadding  optional           // uplink message
};

// =============================================================================
// Structured Type Definition
// Cipher response
// 3GPP TS 44.018 clause 10.5.2.10
// -----------------------------------------------------------------------------
type record CipherResponse {
  IEI4_Type           iei  optional,                   // '1010'B
  B3_Type              spareBits,             // spare bits
  B1_Type              cipherResponse         // cipher response bit
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 04.08 / 3GPP TS 44.018 Section 10.5.2.7c
// -----------------------------------------------------------------------------
type record ClassmarkEnquiryMask {
  IEI8_Type    iei  optional,                   // OCTETSTRING [1]
  O1_Type      ielength  optional,            // OCTETSTRING [1]
  O1_Type      ievalue             // OCTETSTRING [1]
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record CompactReducedMA {
  B7_Type              reducedMABitmapLen,
  bitstring       reducedMABitmap length(0..128)  optional, // contents of length reducedMABitmapLen
  B1_Type              MAIO_2mask,
  B6_Type              MAIO_2  optional                 // not present if MAIOmask=0
};

// =============================================================================
// Structured Type Definition
// Control channel description
// 3GPP TS 44.018 clause 10.5.2.11
// -----------------------------------------------------------------------------
type record ControlChDescr {
//  IEI8_Type           iei  optional,                   // iei not used
  B1_Type              mSCRelease,            // MSC release
  B1_Type              att,                   // attach-detach allowed
  B3_Type              bS_AG_BLKS_RES,        // base station access grant blocks reservation
  B3_Type              cCCH_CONF,             // CCCH configuration
  B3_Type              spareBits,             // spare bits
  B2_Type              cBQ2,                  // cell bar qualify 2
  B3_Type              bS_PA_MFRMS,           // number of multiframes for paging request
  O1_Type              t3212                  // t3212 value
};

type record CCN_SupportDescr {
  B7_Type           noCells,
  CCN_SupportList   cCN_Support
};

type record of B1_Type CCN_SupportList;

type record CDMA2000Descr {
  B5_Type               cdma2000FreqBand,
  B11_Type              cdma2000Freq,
  B5_Type               noCDMA2000Cells,
  CDMA2000CellDescrList cdmaCells
};

type record of CDMA2000CellDescr CDMA2000CellDescrList;

type record CDMA2000CellDescr {
  B9_Type pilotPN_Offset,
  B1_Type mask,
  B3_Type addMask,
  AdditionalInfoFor1xCommonPilotDiversity addInfO1_TypexCommonPilotDiv optional,
  AdditionalInfoFor1xAuxPilot addInfoAux1xPilot optional,
  AdditionalInfoFor1xAuxPilotDiversity addInfoAux1xPilotDiversity optional,
  AdditionalInfoFor3xCommonPilot addInfo3xCommonPilot optional,
  AdditionalInfoFor3xAuxPilot addInfo3xAuxPilot optional
};

type record AdditionalInfoFor1xCommonPilotDiversity {
    B2_Type        tdMode,
    B3_Type        tdPowerLevel
};

type record AdditionalInfoFor1xAuxPilot {
    B2_Type        qOF,
    B3_Type        walshLenA,
    bitstring       auxPilotWalsh length (6..13)
};

type record AdditionalInfoFor1xAuxPilotDiversity {
    B2_Type        qOF,
    B3_Type        walshLenB,
    bitstring      auxTDWalsh length (6..13),
    B2_Type        auxTDPowerLevel,
    B2_Type        tdMode
};

type record AdditionalInfoFor3xCommonPilot {
    B2_Type        sr3_PrimPilot,
    B3_Type        sr3PilotPower1,
    B3_Type        sr3PilotPower2
};

type record AdditionalInfoFor3xAuxPilot {
    B2_Type        sr3_PrimPilot,
    B3_Type        sr3PilotPower1,
    B3_Type        sr3PilotPower2,
    B2_Type        qOF,
    B3_Type        walshLenC,
    bitstring      auxPilotWalsh length (6..13),
    B1_Type        qofMask1,
    B2_Type        qOF1 optional,
    B3_Type        walshLen1 optional,
    bitstring      auxPilotWalsh1 length (6..13) optional,
    B1_Type        qofMask2,
    B2_Type        qOF2 optional,
    B3_Type        walshLen2 optional,
    bitstring      auxPilotWalsh2 length (6..13) optional
};
// =============================================================================
// Structured Type Definition
// 44.018 10.5.2.25d
// -----------------------------------------------------------------------------
type record MultiDLTBFAssign {
  B1_Type              ulCtrlMask,
  B3_Type              ulCtrlTslot  optional,           // not present if ulCtrlMask = 0
  B8_Type              tslotAlloc,
  DLTBFAssignStruct    dlTBFAssign
};

type record of MultiDLTBFAssignList MultiDLTBFAssignStruct;

type record MultiDLTBFAssignList {
  B1_Type          prefix,
  MultiDLTBFAssign multiTBF optional // only present if prefix = 1
};

type record of DLTBFAssignList DLTBFAssignStruct;

type record DLTBFAssignList{
  B1_Type     prefix,
  DLTBFAssign dlTBF optional // only present if prefix = 1
};

type record DLTBFAssign {
  B7_Type              pFI,
  B1_Type              rlcMode,
  B5_Type              dlTBFAssign,
  B1_Type              ctrlAck,
  B1_Type              windowMask,
  EGPRSWindowSize eGPRSWindowSize  optional       // not present if windowMask = 0
};

// =============================================================================
// Structured Type Definition
// Reference : 3GPP TS 44.018 clause 10.5.2.25b
// -----------------------------------------------------------------------------
type record DedicatedModeOrTBF {
  B4_Type              iei  optional,                   // information element identifier
  B1_Type              spareBit,              // always = 0
  B1_Type              twoMsgAssig,           // two message assignment
  B1_Type              downlink,              // down link assignement
  B1_Type              tBForDedicated         // TBF or dedicated mode
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.8
// -----------------------------------------------------------------------------
type record DirectEncoding1 {
  B6_Type              mAIO,                  // MAIO
  GPRSMobileAlloc gPRS_MobileAllocation
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.8
// -----------------------------------------------------------------------------
type record DirectEncoding2 {
  B6_Type              mAIO,                  // MAIO
  B6_Type              hSN,
  B4_Type              lengthOfMA_FreqList,
  octetstring     mA_FreqList length(3..18) // length of this field is indicated in lengthOfMA_FreqList
};

// =============================================================================
// Structured Type Definition
// <Dynamic ARFCN Mapping > ::=
// <LENGTH OF DYNAMIC ARFCN MAPPING : bit(8)>
// <DYNAMIC ARFCN MAPPING Description :{1 <DYNAMIC ARFCN MAPPING>}**0> <spare bit>**
// Reference : 3GPP TS 44.018 clause 10.5.2.11b
// -----------------------------------------------------------------------------
type record DynaARFCN_Mapping {
  O1_Type              iei  optional,
  DYNAMIC_ARFCN_MAPPING_LIST dYNAMIC_ARFCN_MAPPING
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record TimeSlotAllocationPowerControl {
  B1_Type              tN0mask,
  B3_Type              uSF_TN0  optional,               // not present if tN0mask=0
  B5_Type              gAMMA_TN0  optional,             // not present if tN0mask=0
  B1_Type              tN1mask,
  B3_Type              uSF_TN1  optional,               // not present if tN1mask=0
  B5_Type              gAMMA_TN1  optional,             // not present if tN1mask=0
  B1_Type              tN2mask,
  B3_Type              uSF_TN2  optional,               // not present if tN2mask=0
  B5_Type              gAMMA_TN2  optional,             // not present if tN2mask=0
  B1_Type              tN3mask,
  B3_Type              uSF_TN3  optional,               // not present if tN3mask=0
  B5_Type              gAMMA_TN3  optional,             // not present if tN3mask=0
  B1_Type              tN5mask,
  B3_Type              uSF_TN5  optional,               // not present if tN5mask=0
  B5_Type              gAMMA_TN5  optional,             // not present if tN5mask=0
  B1_Type              tN6mask,
  B3_Type              uSF_TN6  optional,               // not present if tN6mask=0
  B5_Type              gAMMA_TN6  optional,             // not present if tN6mask=0
  B1_Type              tN7mask,
  B3_Type              uSF_TN7  optional,               // not present if tN7mask=0
  B5_Type              gAMMA_TN7  optional              // not present if tN7mask=0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.21
// -----------------------------------------------------------------------------
type record StartingFrameNumberDscr {
  B1_Type              encodingMask,
  RFN             absoluteFrameNumEnc  optional,   // not present if encodingMask=1
  bitstring       relativeFrameNumEnc length(0..13)  optional // not present if encodingMask=0
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record TimeSlotAllocation_UA {
  B1_Type              tN0mask,
  B3_Type              uSF_TN0  optional,               // not present if tN0mask=0
  B1_Type              tN1mask,
  B3_Type              uSF_TN1  optional,               // not present if tN1mask=0
  B1_Type              tN2mask,
  B3_Type              uSF_TN2  optional,               // not present if tN2mask=0
  B1_Type              tN3mask,
  B3_Type              uSF_TN3  optional,               // not present if tN3mask=0
  B1_Type              tN4mask,
  B3_Type              uSF_TN4  optional,               // not present if tN4mask=0
  B1_Type              tN5mask,
  B3_Type              uSF_TN5  optional,               // not present if tN5mask=0
  B1_Type              tN6mask,
  B3_Type              uSF_TN6  optional,               // not present if tN6mask=0
  B1_Type              tN7mask,
  B3_Type              uSF_TN7  optional                // not present if tN7mask=0
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record DynamicAllocationPacket {
  B1_Type              extendedAllocMask,     // 0 - dynamic allocation; 1 - extended dynamic allocation
  B1_Type              mask,
  B4_Type              p0  optional,                    // not present if mask=0
  B1_Type              pR_Mode  optional,               // not present if mask=0
  B1_Type              uSFGranularity,        // 0 - one block; 1 - four blocks
  B1_Type              uplinkTFImask,
  B5_Type              uplinkTFI  optional,             // not present if uplinkTFImask=0
  B1_Type              spareBit,              // set to 0
  B1_Type              tBFStartingTimeMask,
  StartingFrameNumberDscr tBFStartingTime  optional, // not present if tBFStartingTimeMask=0
  B1_Type              timeSlotAllocMask,
  TimeSlotAllocation_UA timeSlotAlloc  optional,   // not present if timeSlotAllocMask=1
  TimeSlotAllocationPowerControl timeSlotAllocPowerControl  optional // not present if timeSlotAllocMask=0
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record SingleBlockAllocationPacket {
  B3_Type              timeSlot,
  B1_Type              PowerControlMask,
  B4_Type              alpha  optional,                 // not present if PowerControlMask=0
  B5_Type              gamma  optional,                 // not present if PowerControlMask=0
  B1_Type              mask,
  B4_Type              P0  optional,                    // not present if mask=0
  B1_Type              spareBit  optional,              // set to 0. not present if mask=0
  B1_Type              prMode  optional,                // not present if mask=0
  StartingFrameNumberDscr tBFStartingTime
};

// =============================================================================
// Structured Type Definition
// 0 0 0 0      MCS-1
// 0 0 0 1      MCS-2
// 0 0 1 0      MCS-3
// 0 0 1 1      MCS-4
// 0 1 0 0      MCS-5
// 0 1 0 1      MCS-6
// 0 1 1 0      MCS-7
// 0 1 1 1      MCS-8
// 1 0 0 0      MCS-9
// 1 0 0 1      MCS-5-7
// 1 0 1 0      MCS-6-9
// -----------------------------------------------------------------------------
type record EGPRSPktUplinkAssigment {
  B2_Type              constantVal,           // shall be '00'B
  B1_Type              tLLImask,
  B32_Type             contensionResolutionTLLI  optional, // not present if tLLImask=0
  B1_Type              compactReducedMAmask,
  CompactReducedMA compactReducedMA  optional,     // not present if compactReducedMAmask=0
  B4_Type              channelCodingCommand,  // note 1
  B1_Type              resegment,             // 0 - Retransmitted RLC data blocks shall not be re-segmented.
                                                   // 1 - Retransmitted RLC data blocks shall be re-segmented according to commanded MCS
  B5_Type              windowSize,
  B1_Type              accessTechMask,
  AccessTechnologyList accessTechnology  optional,     // not present if accessTechMask = 0
  B1_Type              aRACRetransReq,        // 0 - retransmission of an ADDITIONAL MS RADIO ACCESS CAPABILITIES message is not requested.
                                                   // 1 - retransmission of an ADDITIONAL MS RADIO ACCESS CAPABILITIES message is requested
  B1_Type              tLLIBlockChannelCoding, // 0 - MS shall use CS-1 in GPRS TBF mode and MCS-1 in EGPRS TBF mode.
                                                   // 1 - MS shall use the value commanded in the CHANNEL_CODING_COMMAND or EGPRS_CHANNEL_CODING_COMMAND
  B1_Type              bep_Period2Mask,
  B4_Type              bep_Period2  optional,           // not present if bep_Period2Mask=0
  PacketTimingAdvance packetTimingAdvance,
  B1_Type              packetExtTAmask,
  B2_Type              packetExtendedTA  optional,      // not present if  packetExtTImask=0
  B1_Type              freqParamMask,
  FreqParam       freqParam  optional,             // not present if freqParamMask=0
  B2_Type              allocationMask,
  DynamicAllocationPacket dynamicAllocation  optional, // present if allocationMask=01
  MultiBlockAllocationPacket multiBlockAllocation  optional, // present if allocationMask=10
  B1_Type              r5Mask  optional,
  B1_Type              gRNTIMask  optional,             // not present if r99Mask=0 and r5Mask=0
  B4_Type              gRNTIExtension  optional,        // not present if r99Mask=0, r5Mask=0 and gRNTIMask=0
  B1_Type              rBIdMask  optional,              // not present if r99Mask=0 and r5Mask=0
  B5_Type              rBId  optional,                  // not present if r99Mask=0, r5Mask=0 and rBIdMask=0
  B1_Type              r6Mask  optional,                // not present if r99Mask=0, r5Mask=0
  B1_Type              pfiMask  optional,               // not present if r99Mask=0, r5Mask=0 and r6Mask = 0
  B7_Type              pFI  optional,                   // not present if r99Mask=0, r5Mask=0, r6Mask = 0 and pfiMask = 0
  B1_Type              rlcModeMask  optional,           // not present if r99Mask=0, r5Mask=0 and r6Mask = 0
  B1_Type              rlcMode  optional,                // not present if r99Mask=0, r5Mask=0, r6Mask = 0 and rlcModeMask = 0
  B1_Type              r7Mask  optional,                // not present if r99Mask=0, r5Mask=0, r6Mask = 0
  B1_Type              npmMask  optional,                // not present if r99Mask=0, r5Mask=0, r6Mask = 0 and r7Mask = 0
  B5_Type              npmTransferTime  optional                // not present if r99Mask=0, r5Mask=0, r6Mask = 0, r7Mask = 0 or npmMask = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.16
// -----------------------------------------------------------------------------
type record EGPRS_UplinkAssign {
  B5_Type              extendedRA,
  B1_Type              accessTechMmask,
  AccessTechRequestList accessTechRequest  optional,   // not present if accessTechMask = 0
  B1_Type              allocMask,             // '0' -> multiBlock Allocation; '1' -> dynamic allocation
  B5_Type              tFI_Assignment  optional,        // temporary flow identifier not present if allocMask = 0
  B1_Type              pOLLING  optional,               // not present if  allocMask = 0
  B1_Type              spareBit  optional,              // not present if allocMask = 0. set to 0
  B3_Type              uSF  optional,                   // not present if allocMask = 0
  B1_Type              uSFGranularity  optional,        // not present if allocMask = 0
  B1_Type              p0Mask  optional,                // not present if allocMask = 0
  B4_Type              p0  optional,                    // not present if allocMask = 0  or p0Mask = 0
  B1_Type              pR_MODE  optional,               // not present if allocMask = 0 or p0Mask = 0
  B4_Type              eGPRSChannelCodingCommand  optional, // not present if allocMask = 0
  B1_Type              tLLI_BlockChannelCodeing  optional, // not present if allocMask = 0
  B1_Type              bepPeriod2Mask  optional,        // not present if allocMask = 0
  B4_Type              bepPeriod2  optional,            // not present if allocMask = 0 or bepPeriod2Mask = 0
  B1_Type              resegment  optional,             // not present if allocMask = 0
  EGPRSWindowSize eGPRSWindowSize  optional,       // not present if allocMask = 0
  B1_Type              alphaMask  optional,             // not present if allocMask = 0
  B4_Type              aLPHA  optional,                 // not present if allocMask = 0 or alphaMask = 0
  B5_Type              gMMA  optional,                  // not present if allocMask = 0
  B1_Type              taIndexMask  optional,           // not present if allocMask = 0
  B4_Type              tIMING_ADVANCE_INDEX  optional,  // not present if allocMask = 0 or taIndexMask = 0
  B1_Type              tbfStartingTimemask  optional,   // not present if allocMask =  0
  B16_Type             tBF_STARTING_TIME  optional,     // not present if allocMask = 0 or tbfStartingTimemask = 0
  LH_B1_Type           r7Mask                optional,  // not present if allocMask = 0
  B1_Type              bTTIMask              optional,  // not present if allocMask = 0 or r7Mask = L
  B1_Type              fanrMask              optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = 1
  B1_Type              encodingMask          optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = 1 or fanrMask = 0
  B8_Type              reportedTimeslots     optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = 1 or fanrMask or encodingMask = 0
  B2_Type              tsh                   optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = 1 or fanrMask or encodingMask = 0
  B1_Type              rttiUSFMode           optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = 0
  B3_Type              pdchPairInd           optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = 0
  B3_Type              additionalUSF         optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = 0 or rttiUSFMode = 1
  B1_Type              pdchMask              optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = 0
  B3_Type              usf2                  optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask =  or pdchMask = 0
  B3_Type              additionalUSF2        optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = or pdchMask = 0 or rttiUSFMode = 1
  B1_Type              encodingMask2         optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = 0
  B8_Type              reportedTimeslots2    optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask or encodingMask2 = 0
  B8_Type              tsh2                  optional,  // not present if allocMask = 0 or r7Mask = L or bTTIMask = or encodingMask2 = 0
  B1_Type              alpha1Mask  optional,            // present if allocMask = 0
                                                   // multi block allocation
  B4_Type              aLPHA1  optional,                // not present if allocMask = 1 or alpha1Mask = 0
  B5_Type              gMMA1  optional,                 // not present if allocMask = 1
  B16_Type             tBF_STARTING_TIME1  optional,    // not present if allocMask = 1
  B2_Type              numberOfRadioBlocks  optional,   // not present if allocMask = 1
  B1_Type              p02Mask  optional,               // not present if allocMask = 1
  B4_Type              p02  optional,                   // not present if allocMask = 1 or p02Mask = 0
  B1_Type              spareBit2  optional,             // not present if allocMask = 1 or p02Mask = 0 set to 0
  B1_Type              pR_MODE2  optional,              // not present if allocMask = 1 or p02Mask = 0
  LH_B1_Type           r6Mask  optional,                // not present if allocMask = 1
  B1_Type              pfiMask  optional,               // not present if allocMask = 1 or r6Mask = L
  B7_Type              pFI  optional                    // not present if allocMask = 1, r6Mask = L or pfiMask = 0
};

type record PktDlDualCarrier { // @sic R5s100135 sic@
  B2_Type              mask,        // set to 00
  B1_Type              rlcMode,
  B1_Type              ctrlAck,
  B2_Type              assignType,
  B1_Type              carrierId,
  B1_Type              bTTIMask,
  B8_Type              timeslotAllocC1 optional, // only present if bTTIMask = 0
  B1_Type              tnAllocC2Mask   optional, // only present if bTTIMask = 0
  B8_Type              timeslotAllocC2 optional, // only present if bTTIMask = 0 and tnAllocC2Mask = 1
  B1_Type              singleCarrier   optional, // only present if bTTIMask = 0
  B2_Type              pdchMask        optional, // value 11 is reserved
  B8_Type              dlPDCHC1_s      optional, // only present if bTTIMask = 1, singleCarrier = 0 and pdchMask = 10
  B8_Type              ulPDCHC1_s      optional, // only present if bTTIMask = 1, singleCarrier = 0 and pdchMask = 10
  B4_Type              rTTIDLPDCHPair_sc  optional, // only present if bTTIMask = 1 and singleCarrier = 0
  B2_Type              dualCarrierMask  optional, // only present if bTTIMask = 1 and singleCarrier = 1
  B8_Type              dlPDCHC1_d      optional, // only present if bTTIMask = 1, singleCarrier = 1 and dualCarrierMask = 10
  B8_Type              dlPDCHC2_d      optional, // only present if bTTIMask = 1, singleCarrier = 1 and dualCarrierMask = 10
  B8_Type              ulPDCHC1_d      optional, // only present if bTTIMask = 1, singleCarrier = 1 and dualCarrierMask = 10
  B8_Type              ulPDCHC2_d      optional, // only present if bTTIMask = 1, singleCarrier = 1 and dualCarrierMask = 10
  B8_Type              rTTIDLPDCHPair_dc  optional, // only present if bTTIMask = 1 and singleCarrier = 1
  PacketTimingAdvance  pktTA,
  B2_Type              freqMask         optional, // value 11 is reserved
  B1_Type              freqC1Mask       optional, // only present if freqMask = 01
  FreqParam            freqC1           optional, // only present if freqMask = 01 and freqC1Mask = 1
  B1_Type              freqC2Mask       optional, // only present if freqMask = 01
  FreqParam            freqC2           optional, // only present if freqMask = 01 and freqC2Mask = 1
  DualCarrierFreqParam dualCarrierFreqParam optional, // only present if freqMask = 10
  B1_Type              pwrCtrlC1Mask,
  B4_Type              p0C1              optional, // only present if pwrCtrlC1Mask = 1
  B1_Type              pR_ModeC1         optional, // only present if pwrCtrlC1Mask = 1
  B1_Type              pwrCtrlC2Mask,
  B4_Type              p0C2              optional, // only present if pwrCtrlC2Mask = 1
  B1_Type              pR_ModeC2         optional, // only present if pwrCtrlC2Mask = 1
  B1_Type              dlTFIMask,
  B5_Type              dlTFIAssign       optional, // only present if dlTFIMask =1
  B1_Type              pwrParamsC1Mask,
  PowerControlParam    pwrCtrlParamsC1   optional, // only present if pwrParamsC1Mask = 1
  B1_Type              pwrParamsC2Mask,
  PowerControlParam    pwrCtrlParamsC2   optional, // only present if pwrParamsC2Mask = 1
  B1_Type              egprsMask,
  EGPRSWindowSize      eGPRSWindowSize   optional, // only present if egprsMask = 1
  B2_Type              linkQualityMeasMode optional,  // only present if egprsMask = 1
  B1_Type              bepPeriodMask     optional,  // only present if egprsMask = 1
  B4_Type              bepPeriod2        optional,  // only present if egprsMask = 1 and bepPeriodMask = 1
  B1_Type              xdTAMask,
  B2_Type              pktExtendedTA     optional, // only present if xdTAMask = 1
  B1_Type              pfiMask,
  B7_Type              pFI               optional, // only present if pfiMask = 1
  B1_Type              npmMask,
  B5_Type              npmTransferTime   optional, // only present if npmMask = 1
  B1_Type              fanrMask,
  B1_Type              eventBasedFANR    optional, // only present if fanrMask = 1
  B2_Type              dlEGPRSLevel
  };

type record PktUlDualCarrier {
  B2_Type              tLLImask,
  B32_Type             contentionResolutionTLLI optional, // only present if tLLIMask = 1
  B1_Type              resegment, // 0 - Retransmitted RLC data blocks shall not be re-segmented; 1 - Retransmitted RLC data blocks shall be re-segmented according to commanded MCS
  B2_Type              assignType,
  B1_Type              carrierId,
  B5_Type              windowSize,
  B1_Type              accessTechMask,
  AccessTechnology     accessTechnology optional, // only present if accessTechMask = 1
  B1_Type              aRACRetransReq, //0 - retransmission of an ADDITIONAL MS RADIO ACCESS CAPABILITIES message is not requested; 1 - retransmission of an ADDITIONAL MS RADIO ACCESS CAPABILITIES message is requested
  B1_Type              tLLIBlockChannelCoding, // 0 - MS shall use CS-1 in GPRS TBF mode and MCS-1 in EGPRS TBF mode; 1 - MS shall use the value commanded in the CHANNEL_CODING_COMMAND or EGPRS_CHANNEL_CODING_COMMAND
  B1_Type              bepPeriodMask,
  B4_Type              bepPeriod2        optional,  // only present if bepPeriodMask = 1
  PacketTimingAdvance  pktTimingAdvance,
  B1_Type              xdTAMask,
  B2_Type              pktExtendedTA     optional, // only present if xdTAMask = 1
  B1_Type              bTTIMask,
  B1_Type              rTTIUSFMode     optional, // only present if bTTIMask = 1
  PDCHPairsDescr       pdchPairs       optional, // only present if bTTIMask = 1 // @sic R5s100135 sic@
  DynamicAlloc2        dynamicAlloc2,
  B4_Type              eGPRSChCodingCmd,
  B2_Type              freqMask         optional, // value 11 is reserved
  B1_Type              freqC1Mask       optional, // only present if freqMask = 01
  FreqParam            freqC1           optional, // only present if freqMask = 01 and freqC1Mask = 1
  B1_Type              freqC2Mask       optional, // only present if freqMask = 01
  FreqParam            freqC2           optional, // only present if freqMask = 01 and freqC2Mask = 1
  DualCarrierFreqParam dualCarrierFreqParam optional, // only present if freqMask = 10
  B1_Type              pfiMask,
  B7_Type              pFI               optional, // only present if pfiMask = 1
  B1_Type              rlcMask,
  B1_Type              rlcMode           optional, // only present if rlcMask =1
  B1_Type              npmMask,
  B5_Type              npmTransferTime   optional, // only present if npmMask = 1
  B1_Type              fanrMask,
  B1_Type              timeMask          optional, // only present if fanrMask = 1
  B8_Type              reportedTimeslotC1 optional, // only present if fanrMask = 1 and timeMask = 1
  B1_Type              c2Mask            optional, // only present if fanrMask = 1 and timeMask = 1
  B8_Type              reportedTimeslotC2 optional, // only present if fanrMask = 1 and timeMask = 1 and c2Mask= 1
  B2_Type              tSH                optional, // only present if fanrMask = 1 and timeMask = 1
  B2_Type              ulEGPRSLevel,
  B1_Type              pulseMask,
  B1_Type              pulseFormatMask   optional, // only present if pulseMask = 1
  B3_Type              pulseFormatCoding1 optional, // only present if pulseMask =1 and pulseFormatMask = 0
  bitstring            pulseFormatCoding2 optional // only present if pulseMask =1 and pulseFormatMask = 1
  };

type record PDCHPairsDescr { // @sic R5s100135 sic@
  B1_Type              singleCarrier,
  B2_Type              pdchMask, // value 11 is reserved
  B8_Type              dlPDCHC1      optional, // only present if dualCarrierMask = 10
  B8_Type              dlPDCHC2      optional, // only present if singleCarrier = 1 and pdchMask = 10
  B8_Type              ulPDCHC1      optional, // only present if pdchMask = 10
  B8_Type              ulPDCHC2      optional // only present if singleCarrier = 1 and pdchMask = 10
};

type record DualCarrierFreqParam {
  B3_Type              tsc,
  B2_Type              mask,
  B1_Type              arfcnMask,
  B10_Type             arfcn1           optional, // not present if arfcnMask = 0
  B10_Type             arfcn2           optional, // not present if arfcnMask = 0
  B2_Type              encodeMask,
  B1_Type              maMask1,
  B6_Type              maio1            optional, // not present if maMask1 = 0
  B1_Type              maMask2,
  B6_Type              maio2            optional, // not present if maMask2 = 0
  B4_Type              maNumber         optional, // only present if encodeMask = 01
  B1_Type              changeMask       optional, // only present if encodeMask = 01
  B2_Type              changeMark1      optional, // only present if encodeMask = 01 and changeMask = 1
  B1_Type              changeMask2      optional, // only present if encodeMask = 01 and changeMask = 1
  B2_Type              changeMark2      optional, // only present if encodeMask = 01 and changeMask = 1
  GPRSMobileAlloc      gprsMA           optional, // only present if encodeMask = 10
  B6_Type              hsn              optional, // only present if encodeMask = 11
  B4_Type              maFreqListLength optional, // only present if encodeMask = 11
  octetstring maFreqList length (0..18) optional // only present if encodeMask = 11
};

type record DynamicAlloc2 {
  B1_Type              extendedAllocMask,
  B1_Type              maskC1,
  B4_Type              p0C1              optional, // not present if maskC1 = 0
  B1_Type              prModeC1          optional, // not present if maskC1 = 0
  B1_Type              maskC2,
  B4_Type              p0C2              optional, // not present if maskC2 = 0
  B1_Type              prModeC2          optional, // not present if maskC2 = 0
  B1_Type              usfGranularity,  // 0 - 1 block, 1 - 4 blocks
  B1_Type              uplinkTFIMask,
  B5_Type              uplinkTFI         optional, // not present if uplinkTFIMask = 0
  B1_Type              pwrMask,
  B4_Type              nUSF              optional, // only present if pwrMask = 0
  B1_Type              usfMask           optional, // only present if pwrMask = 0
  USFList              usf               optional, // only present if pwrMask = 0
  B4_Type              alphaC1           optional, // only present if pwrMask = 1
  B1_Type              alphaMask         optional, // only present if pwrMask = 1
  B4_Type              alphaC2           optional, // only present if pwrMask = 1 and alphaMask = 1
  B1_Type              bTTIMask          optional, // only present if pwrMask = 1
  B4_Type              nts               optional, // only present if pwrMask = 1 and bTTIMask = 0
  B1_Type              bUSFMask          optional, // only present if pwrMask = 1 and bTTIMask = 0
  USFList              bUSF              optional, // only present if pwrMask = 1, bTTIMask = 0 and bUSFMask = 1
  GammaList            bGamma            optional, // only present if pwrMask = 1, bTTIMask = 0 and bUSFMask = 1
  B3_Type              nPairs            optional, // only present if pwrMask = and bTTIMask = 1
  B1_Type              rUSFMask          optional, // only present if pwrMask = 1 and bTTIMask = 1
  USFList              rUSF              optional, // only present if pwrMask = 1, bTTIMask = 1 and rUSFMask = 1
  GammaList            rGamma            optional, // only present if pwrMask = 1, bTTIMask = 1 and rUSFMask = 1
  B1_Type              mask,
  B3_Type              usfMask2,
  B3_Type              rUSF2             optional, // only present if pwrMask = 1, bTTIMask = 1, mask = 1 and usfMask2 = 1
  B1_Type              gammaMask         optional, // only present if pwrMask = 1, bTTIMask = 1, mask = 1 and usfMask2 = 1
  GammaList            rGamma2           optional // only present if pwrMask = 1, bTTIMask = 1, mask = 1, usfMask2 = 1 and gammaMask = 1
};

type record length (1..16) of B3_Type USFList;

type record length (1..16) of B5_Type GammaList;

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record EGPRSBEPQualityMeas {
  B1_Type     mask1,
  B5_Type     gMSKMeanBEP   optional,  // not present if mask1 = 0
  B3_Type     gMSKCVBEP   optional,  // not present if mask1 = 0
  B1_Type     mask2,
  B5_Type     pSKMeanBEP   optional,  // not present if mask2 = 0
  B3_Type     pSKCVBEP   optional  // not present if mask2 = 0
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record EGPRSTimeslotLinkQualityMeas {
  B1_Type     mask1,
  B1_Type     tnmaskA0   optional,  // not present if mask1 = 0
  B1_Type     tnmaskB0   optional,  // not present if mask1 or tnmaskA0 = 0
  B4_Type     gMSKMeanBEPTN0   optional,  // not present if mask1 or tnmaskA0 = 0 or tnMaskB0 = 1
  B4_Type     pSKMeanBEPTN0    optional,  // not present if mask1 or tnmaskA0 = 0 or tnMaskB0 = 0
  B1_Type     tnmaskA1   optional,  // not present if mask1 = 0
  B1_Type     tnmaskB1   optional,  // not present if mask1 or tnmaskA1 = 0
  B4_Type     gMSKMeanBEPTN1   optional,  // not present if mask1 or tnmaskA1 = 0 or tnMaskB1 = 1
  B4_Type     pSKMeanBEPTN1    optional,  // not present if mask1 or tnmaskA1 = 0 or tnMaskB1 = 0
  B1_Type     tnmaskA2   optional,  // not present if mask1 = 0
  B1_Type     tnmaskB2   optional,  // not present if mask1 or tnmaskA2 = 0
  B4_Type     gMSKMeanBEPTN2   optional,  // not present if mask1 or tnmaskA2 = 0 or tnMaskB2 = 1
  B4_Type     pSKMeanBEPTN2    optional,  // not present if mask1 or tnmaskA2 = 0 or tnMaskB2 = 0
  B1_Type     tnmaskA3   optional,  // not present if mask1 = 0
  B1_Type     tnmaskB3   optional,  // not present if mask1 or tnmaskA3 = 0
  B4_Type     gMSKMeanBEPTN3   optional,  // not present if mask1 or tnmaskA3 = 0 or tnMaskB3 = 1
  B4_Type     pSKMeanBEPTN3    optional,  // not present if mask1 or tnmaskA3 = 0 or tnMaskB3 = 0
  B1_Type     tnmaskA4   optional,  // not present if mask1 = 0
  B1_Type     tnmaskB4   optional,  // not present if mask1 or tnmaskA4 = 0
  B4_Type     gMSKMeanBEPTN4   optional,  // not present if mask1 or tnmaskA4 = 0 or tnMaskB4 = 1
  B4_Type     pSKMeanBEPTN4    optional,  // not present if mask1 or tnmaskA4 = 0 or tnMaskB4 = 0
  B1_Type     tnmaskA5   optional,  // not present if mask1 = 0
  B1_Type     tnmaskB5   optional,  // not present if mask1 or tnmaskA5 = 0
  B4_Type     gMSKMeanBEPTN5   optional,  // not present if mask1 or tnmaskA5 = 0 or tnMaskB5 = 1
  B4_Type     pSKMeanBEPTN5    optional,  // not present if mask1 or tnmaskA5 = 0 or tnMaskB5 = 0
  B1_Type     tnmaskA6   optional,  // not present if mask1 = 0
  B1_Type     tnmaskB6   optional,  // not present if mask1 or tnmaskA6 = 0
  B4_Type     gMSKMeanBEPTN6   optional,  // not present if mask1 or tnmaskA6 = 0 or tnMaskB6 = 1
  B4_Type     pSKMeanBEPTN6    optional,  // not present if mask1 or tnmaskA6 = 0 or tnMaskB6 = 0
  B1_Type     tnmaskA7   optional,  // not present if mask1 = 0
  B1_Type     tnmaskB7   optional,  // not present if mask1 or tnmaskA7 = 0
  B4_Type     gMSKMeanBEPTN7   optional,  // not present if mask1 or tnmaskA7 = 0 or tnMaskB7 = 1
  B4_Type     pSKMeanBEPTN7    optional,  // not present if mask1 or tnmaskA7 = 0 or tnMaskB7 = 0
  B1_Type     mask2,
  B1_Type     imask0     optional,  // not present if mask2 = 0
  B4_Type     ilevelTN0  optional,  // not present if mask2 or imask0 = 0
  B1_Type     imask1     optional,  // not present if mask2 = 0
  B4_Type     ilevelTN1  optional,  // not present if mask2 or imask1 = 0
  B1_Type     imask2     optional,  // not present if mask2 = 0
  B4_Type     ilevelTN2  optional,  // not present if mask2 or imask2 = 0
  B1_Type     imask3     optional,  // not present if mask2 = 0
  B4_Type     ilevelTN3  optional,  // not present if mask2 or imask3 = 0
  B1_Type     imask4     optional,  // not present if mask2 = 0
  B4_Type     ilevelTN4  optional,  // not present if mask2 or imask4 = 0
  B1_Type     imask5     optional,  // not present if mask2 = 0
  B4_Type     ilevelTN5  optional,  // not present if mask2 or imask5 = 0
  B1_Type     imask6     optional,  // not present if mask2 = 0
  B4_Type     ilevelTN6  optional,  // not present if mask2 or imask6 = 0
  B1_Type     imask7     optional,  // not present if mask2 = 0
  B4_Type     ilevelTN7  optional  // not present if mask2 or imask7 = 0
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record EnhDTMCSRelInd {
  B4_Type              iei  optional,
  B3_Type              spareBits,             // set to '000'
  B1_Type              ind
};

//=============================================================================
//Structured Type Definition
//44.060 11.2.9b
//-----------------------------------------------------------------------------
type record ENH_MeasParam {
    B1_Type                    mask,
    B1_Type                    bA_Ind optional,
    B1_Type                    bA3G_Ind optional,
    B2_Type                    pSI3ChangeMark optional,
    B1_Type                    pMOInd,
    B1_Type                    reportType,
    B1_Type                    reportRate,
    B1_Type                    invalidBSICRep,
    B1_Type                    neighCellMask,
    NeighCellDescr3G_PMO       neighCellDescr3G optional,
    B1_Type                    gPRS_RepPriorityMask,
    ReportPriorityDescr        gPRS_RepPriority optional,
    B1_Type                    gPRS_MeasParamDesMask,
    GPRS_MeasParamDescr_PMO    gPRS_MeasureParamDescr optional,
    B1_Type                    gPRS_3G_MeasParamDescrMmask,
    GPRS_3G_MeasParamDescr_PMO gPRS_3G_MeasParamDescr optional
}

// =============================================================================
// Structured Type Definition
// Frequency channel sequence
// 3GPP TSS 44.018 clause 10.5.2.12
// -----------------------------------------------------------------------------
type record FreqChannelSeq {
  IEI8_Type   iei  optional,         // '01101001'B
  O1_Type     larfcn,                // lowest ARFCN (1-124)
  O8_Type     incs                   // increment skip ARFCN n
};

// =============================================================================
// Structured Type Definition
// Frequency list
// 3GPP TS 44.018 clause 10.5.2.13
// -----------------------------------------------------------------------------
type record FreqList {
  IEI8_Type           iei  optional,                   // '00000101'B
  O1_Type              iel  optional,                   // OCTETSTRING [1]
  octetstring     frequencyList         // list of the absolute radio frequency channel numbers
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.8
// -----------------------------------------------------------------------------
type record FreqParam {
  B3_Type              tSC,
  B2_Type              encodingMask,
  B10_Type             aRFCN  optional,                 // present if encodingMask = '00'B
  IndirectEncoding indirectEncoding  optional,     // present if encodingMask = '01'B
  DirectEncoding1 directEncoding1  optional,       // present if encodingMask = '10'B
  DirectEncoding2 directEncoding2  optional        // present if encodingMask = '11'B
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.16
// -----------------------------------------------------------------------------
type record FreqParam_bt {
  B2_Type              maskBits,              // always = 00
  B6_Type              mAIO,                  // MAIO
  octetstring     mobileAloc            // length of this field is (value of lengthOfFreqParam -1), lengthOfFreqParam is definied in IARO
};

// =============================================================================
// Structured Type Definition
// GPRS resumption
// 3GPP TS 44.018 clause 10.5.2.14c
// -----------------------------------------------------------------------------
type record GPRS_Resumption {
  B4_Type              iei  optional,
  B3_Type              spareBits,
  B1_Type              ack
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.10
// -----------------------------------------------------------------------------
type record GlobalTFI {
  B1_Type              tFIMask,
  B5_Type              uplinkTFI  optional,             // not present if TFImask=1
  B5_Type              downlinkTFI  optional            // not present if TFImask=0
};

// =============================================================================
// Structured Type Definition
// ref: 44.060 clause 11.2.9b
// -----------------------------------------------------------------------------
  type record GPRS_MeasParamDescr_PMO
  {
    B1_Type multibandReportingMask,
    B2_Type multibandReporting optional,  // not present if multibandReportingMask = 0
    B1_Type ServingBandReportingMask, // not present if servingBandReportingMask = 0
    B2_Type servingBandReporting optional , // not present if servingBandReportingMask = 0
    B2_Type sCALE_ORD ,
    B1_Type mask900 ,
    B3_Type rEPORTING_OFFSET_900 optional , //not present if mask900 = 0
    B3_Type rEPORTING_THRESHOLD_900 optional,//not present if mask900 = 0
    B1_Type mask1800 ,
    B3_Type rEPORTING_OFFSET_1800 optional, //not present if mask1800 = 0
    B3_Type rEPORTING_THRESHOLD_1800 optional, //not present if mask1800 = 0
    B1_Type mask400 ,
    B3_Type rEPORTING_OFFSET_400 optional, //not present if mask400 = 0
    B3_Type rEPORTING_THRESHOLD_400 optional, //not present if mask400 =
    B1_Type mask1900 ,
    B3_Type rEPORTING_OFFSET_1900 optional, //not present if mask1900 = 0
    B3_Type rEPORTING_THRESHOLD_1900 optional, //not present if mask1900 = 0
    B1_Type mask850 ,
    B3_Type rEPORTING_OFFSET_850 optional, //not present if mask850 = 0
    B3_Type rEPORTING_THRESHOLD_850 optional //not present if mask850 = 0
  }

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 v5a0 clause 11.2.9b
// -----------------------------------------------------------------------------

  type record GPRS_3G_MeasParamDescr_PMO
  {
    B4_Type qsearchP ,
    B1_Type searchPrio3G ,
    B1_Type fDD_REP_QUANT_Mask ,
    B1_Type fDD_REP_QUANT optional, //not present if fDD_REP_QUANT_Mask = 0
    B2_Type fDD_MULTIRAT_REPORTING optional, // not present if fDD_REP_QUANT_Mask = 0
    B1_Type fDD_ReportingMask ,
    B3_Type fDD_REPORTING_OFFSET optional, // not present if fDD_ReportingMask = 0
    B3_Type fDD_REPORTING_THRESHOLD optional, //not present if fDD_ReportingMask = 0
    B1_Type tDD_MultiratReportingMask ,
    B2_Type tDD_MULTIRAT_REPORTING optional, //not present if tDD_MultiratReportingMask = 0
    B1_Type tDD_ReportingMask ,
    B3_Type tDD_REPORTING_OFFSET optional, //not present if tDD_ReportingMask = 0
    B3_Type tDD_REPORTING_THRESHOLD optional, // not present if tDD_ReportingMask = 0
    B1_Type cdma_MultiratReportingMask ,
    B2_Type cdma_MULTIRAT_REPORTING optional, // not present if cdma_MultiratReportingMask = 0
    B1_Type cdma_ReportingMask ,
    B3_Type cdma_REPORTING_OFFSET optional, // not present if cdma_ReportingMask = 0
    B3_Type cdma_REPORTING_THRESHOLD optional //not present if cdma_ReportingMask = 0
  }

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 9.1.21a
// -----------------------------------------------------------------------------
type record GroupCallInfo {
  B36_Type             groupCallRef,
  B1_Type              mask,
  GroupCallReference    groupChDescr  optional // only present if mask = 1
}

type record GroupCallReference {
  B24_Type    channelDescr,
  B1_Type     mask1, // non-hopping = 0
  B1_Type     mask2,
  bitstring   mobileAlloc optional, // only present if mask1 = 1 and mask2 = 0
  B64_Type    freqShortList optional  // only present if mask1 = 1 and mask2 = 1
}

// =============================================================================
// Structured Type Definition
// Group Channel description
// 3GPP TS 44.018 clause 10.5.2.14b
// -----------------------------------------------------------------------------
type record GroupChannelDescr {
  IEI8_Type           iei  optional,
  B5_Type              cht_schn ,              // channel type and TDMA offset
  B3_Type              tn,                    // timeslot number
  B3_Type              tsc,                   // training sequence code
  B1_Type              hch,                   // hch = 1 indicating hopping channel
  B6_Type              maio,                  // mobile allocation index offset - hopping
  B6_Type              hsn,                   // hopping sequence number - hopping
  B2_Type              spr,                   // '00'B - non hopping
  B10_Type             arfcn,                 // absolute RF channel number - non hopping
  B8_Type              mac_8n,                // mac64 - mac57
  B8_Type              mac_7n,                // mac56 - mac49
  B8_Type              mac_6n,                // mac48 - mac41
  B8_Type              mac_5n,                // mac40 - mac33
  B8_Type              mac_4n,                // mac32 - mac25
  B8_Type              mac_3n,                // mac24 - mac17
  B8_Type              mac_2n,                // mac16 - mac9
  B8_Type              mac_1n                 // mac8 - mac1
};

// =============================================================================
// Structured Type Definition
// Group Channel description
// 3GPP TS 44.018 clause 10.5.2.14f
// -----------------------------------------------------------------------------
type record GroupChannelDescr2 {
  IEI8_Type           iei  optional,
  O1_Type          ielength  optional,
  B5_Type              cht_schn,              // channel type and TDMA offset
  B3_Type              tn,                    // timeslot number
  B3_Type              tsc,                   // training sequence code
  B1_Type              spare,                 // set to '0'
  B6_Type              maio,                  // mobile allocation index offset - hopping
  B6_Type              hsn,                   // hopping sequence number - hopping
  O8_Type              freqShortList2         // coded as per clause 10.5.2.14a
};

// =============================================================================
// Structured Type Definition
// Group cipher key number
// 3GPP TS 24.008 clause 10.5.1.10
// -----------------------------------------------------------------------------
type record GroupCipherKey {
  B4_Type              iei  optional,
  B4_Type              keyNumber
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.16
// -----------------------------------------------------------------------------
type record SecondPacketAssign {
  LH_B1_Type              mask1,
  B1_Type              mask2  optional,                 // not present if mask1 = L
  B5_Type              extendedRA  optional             // not present if mask1 = L or mask2 = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.16
// -----------------------------------------------------------------------------
type record IARO {
  LH_B2_Type           constructMask,
  LH_B1_Type           compressInterRATHO  optional,    // present if constructMask = LL
  B1_Type              reservMask1  optional,           // present if constructMask = LH
  B1_Type              reservMask2  optional,           // present if reservMask1 = 0
  EGPRS_UplinkAssign   eGPRS_UplinkAssign  optional, // not present if reservMask2 = 1 or reservMask1 = 1 or constructMask <> LH
  MultiBlocksPacketDlAss multiBlocksPDA  optional, // not present if reservMask2 = 0 or reservMask1 = 1 or constructMask <> LH
  B6_Type              lengthOfFreqParam  optional,     // present if constructMask = HL
  FreqParam_bt         freqParam_bt  optional,          // frequency parameters before time. not present if lengthOfFreqParam = 0
  LH_B1_Type           compressInterRATHO1_Type  optional,   // present if constructMask = HL
  B1_Type              mask1  optional,                 // present if constructMask = HH
  B1_Type              mask2  optional,
  PacketUplinkAssign   packetUplinkAssign  optional, // not present if mask1 = 1 or mask2 = 1 or constructMask <> HH
  PacketDownlinkAssign packetDownlinkAssign  optional, // not present if mask1 = 1 or mask2 = 0 or constructMask <> HH
  SecondPacketAssign   secondPacketAssign  optional  // present if mask1 = 1 and constructMask = HH
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.8
// -----------------------------------------------------------------------------
type record IndirectEncoding {
  B6_Type              mAIO,                  // MAIO
  B4_Type              mA_NUMBER,             // MA_NUMBER
  B1_Type              changeMark1Mask,
  B2_Type              mA_ChangeMark1  optional,        // not present if changeMark1Mask = 0
  B1_Type              changeMark2Mask  optional,       // not present if changeMark1Mask = 0
  B2_Type              mA_ChangeMark2  optional         // not present if changeMark1Mask = 0 or changeMark2Mask = 0
};

type record IuModeNeighCellParams {
  B1_Type                mask1,
  IuModeCellSelParams    iuModeCellSelParams optional,
  B5_Type                noFreqs,
  IuModeCellSelParamList iuModeCellSelParamList optional
}

type record IuModeCellSelParams {
  B2_Type cellBarQualify3,
  B1_Type mask,
  B1_Type si13mask optional,
  B1_Type si13Location optional,
  B2_Type pBCCHLocation optional,
  B4_Type pSIRepeat optional
};

type record of IuModeCellSelParamStruct IuModeCellSelParamList;

type record IuModeCellSelParamStruct {
    B1_Type             mask,
    IuModeCellSelParams iuModeCellSelParams optional
};
//=============================================================================
//Structured Type Definition
//LSA Parameters, 44.060, 12.28
//-----------------------------------------------------------------------------
type record LSA_Param {
   B5_Type      noOfFreqOrCells,
   LSA_ID_Info  lSA_ID_Info
};

type record LSA_ID_Info {
   B1_Type         mask,
   B1_Type         prefix,
   ShortLSA_IDList shortLSA_ID
};

type record of ShortLSA_ID ShortLSA_IDList;

type record ShortLSA_ID {
   B10_Type        shortLSA,
   B1_Type         nextInd // if this is the last instance, set this to 0
};

// =============================================================================
// Structured Type Definition
// measurement results
// 3GPP TS 44.018 clause  10.5.2.20
// The info element has a fixed length of 16 octets exclude IEI.
// -----------------------------------------------------------------------------
type record MeasResults {
  IEI8_Type           iei  optional,                   // information element identifier
  B1_Type              ba_used,               // bcch allocation used
  B1_Type              dtx_used,              // dtx was used
  RxLevel         rxlev_fsc,             // received signal strength on the full serving cell
  B1_Type              ba3G_used,             // 3G bcch allocation used
  B1_Type              meas_valid,            // measurement results valid
  RxLevel         rxlev_ssc,             // received signal strength on a subset of the  serving cell
  B1_Type              spare,        // @sic R5s100135 sic@
  B3_Type              rxqual_fsc,            // received signal quality on the full serving cell
  B3_Type              rxqual_ssc,            // received signal quality on a subset of the serving cell
  B3_Type              no_neighCells,         // number of neighbouring cells (nc)
  RxLevel         rxlev_nc1,             // received signal strength on nc1
  BCCHFreq        bcchfrq_nc1,           // bcch frequency position of nc1
  B6_Type              bsic_nc1,              // base station identity code of nc1
  RxLevel         rxlev_nc2,             // received signal strength on nc2
  BCCHFreq        bcchfrq_nc2,           // bcch frequency position of nc2
  B6_Type              bsic_nc2,              // base station identity code of nc2
  RxLevel         rxlev_nc3,             // received signal strength on nc3
  BCCHFreq        bcchfrq_nc3,           // bcch frequency position of nc3
  B6_Type              bsic_nc3,              // base station identity code of  nc3
  RxLevel         rxlev_nc4,             // received signal strength on nc4
  BCCHFreq        bcchfrq_nc4,           // bcch frequency position of nc4
  B6_Type              bsic_nc4,              // base station identity code of nc4
  RxLevel         rxlev_nc5,             // received signal strength on nc5
  BCCHFreq        bcchfrq_nc5,           // bcch frequency position of nc5
  B6_Type              bsic_nc5,              // base station identity code nc5
  RxLevel         rxlev_nc6,             // received signal strength on nc6
  BCCHFreq        bcchfrq_nc6,           // bcch frequency position of nc6
  B6_Type              bsic_nc6               // base station identity code of nc6
};

// =============================================================================
// Structured Type Definition
// Mobile allocation
// 3GPP TS 44.018 clause  10.5.2.21
// -----------------------------------------------------------------------------
type record MobileAlloc {
  IEI8_Type           iei  optional,                   // '01110010'B
  O1_Type              iel  optional,                   // '00'O for non hopping
  B8_Type              mac_8n optional,                // mac64 - mac57
  B8_Type              mac_7n optional,                // mac56 - mac49
  B8_Type              mac_6n optional,                // mac48 - mac41
  B8_Type              mac_5n optional,                // mac40 - mac33
  B8_Type              mac_4n optional,                // mac32 - mac25
  B8_Type              mac_3n optional,                // mac24 - mac17
  B8_Type              mac_2n optional,                // mac16 - mac9
  B8_Type              mac_1n optional                 // mac8 - mac1
};

// =============================================================================
// Structured Type Definition
// Mobile time difference
// 3GPP TS 44.018 clause 10.5.2.21a
// -----------------------------------------------------------------------------
type record MobileTimeDiff {
  IEI8_Type           iei  optional,                   // '01110111'B
  O1_Type              iel  optional,                   // OCTETSTRING [1]
  B8_Type              valueHigh,             // one unit = 24/13 microseconds (half bit period)
  B8_Type              valueContd,
  B5_Type              valueLow,
  B3_Type              spareBits              // spare bits = 000
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record MultiBlockAllocationPacket {
  B3_Type              timeslotNumber,
  B1_Type              PowerControlMask,
  B4_Type              alpha  optional,                 // not present if PowerControlMask=0
  B5_Type              gamma  optional,                 // not present if PowerControlMask=0
  B1_Type              mask,
  B4_Type              P0  optional,                    // not present if mask=0
  B1_Type              spareBit  optional,              // set to 0. not present if mask=0
  B1_Type              prMode  optional,                // not present if mask=0
  StartingFrameNumberDscr tBFStartingTime,
  B2_Type              noRadioBlocksAlloc
};

// =============================================================================
// Structured Type Definition
// 44.060 clause 12.33
// -----------------------------------------------------------------------------
type record TMGI {
  B1_Type              mask,
  B24_Type             serviceID,             // always present, regardless of mask value
  B12_Type             mCC  optional,                   // not present if mask = 0
  B12_Type             mNC  optional                    // not present if mask = 0
};

// =============================================================================
// Structured Type Definition
// 44.018 clause 10.5.2.16
// -----------------------------------------------------------------------------
type record MultiBlocksPacketDlAss {
  B16_Type             startingTime,
  B4_Type              numAllocBlks,
  B1_Type              escapeBit,             // Set to '1'
  B1_Type              distMask,
  TMGI            tMGI  optional,                  // not present if distMask = 1
  B1_Type              sesIdMask  optional,             // not present if distMask = 1
  B8_Type              sesId  optional,                 // not present if distMask = 1 or sesIdMask = 0
  O4_Type              tLLI_GRNTI  optional,            // not present if distMask = 0
  B1_Type              idMask  optional,                // not present if distMask = 0
  B2_Type              idLength  optional,              // not present if distMask = 0 or idMask = 0
  bitstring       mSId length(1..4)  optional,     // not present if distMask = 0 or idMask = 0
  PacketTimingAdvance pktTA  optional,             // not present if distMask = 0 or idMask = 0
  B1_Type              aMask  optional,                 // not present if distMask = 0 or idMask = 0
  B4_Type              alpha  optional,                 // not present if distMask = 0, idMask = 0 or aMask = 0
  B1_Type              gMask  optional,                 // not present if distMask = 0, idMask = 0 or aMask = 0
  B5_Type              gamma  optional                  // not present if distMask = 0, idMask = 0, aMask = 0 or gMask = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.21aa
// -----------------------------------------------------------------------------
type record MultiRateConfig {
  IEI8_Type           iei  optional,
  O1_Type              iel  optional,
  B3_Type              mrVersion,             // multirate speech version
  B1_Type              nSCB,                  // noise suppression control bit
  B1_Type              iCMI,                  // initial codec mode indicator
  B1_Type              spareBit,              // 0
  B2_Type              startMode,             // start mode
  octetstring     mrSpeechPara length(1..5)  // parameters for multirate speech
};

type record NCCIuModeCapCellList {
    B1_Type           mask,
    AddIuModeOnlyCell addedCells optional
};

type record AddIuModeOnlyCell {
  B10_Type          startFreq,
  B6_Type           bSIC,
  B1_Type           mask,
  IuModeOnlyCellSel cellSelParams,
  B5_Type           noFreqs,
  B3_Type           freqDiffLength,
  bitstring         freqDiff,
  B6_Type           bSIC2,
  IuModeOnlyCellSelList iuModeOnlyCellSelList
};

type record IuModeOnlyCellSel {
  B2_Type cellBarQualify3,
  B1_Type sameRAasServCell,
  B1_Type rxmask,
  B6_Type gPRSRxlevAccessMin optional,
  B5_Type gPRSMSTxpwrMaxCCH optional,
  B1_Type gprsmask,
  B3_Type gPRSTempOffset optional,
  B5_Type gPRSPenaltyTime optional,
  B1_Type resmask,
  B5_Type gPRSReslectOffset optional,
  B1_Type hcsmask,
  B3_Type priorityClass optional,
  B5_Type hcsThr optional,
  B1_Type mask,
  B1_Type si13mask optional,
  B1_Type si13Location optional,
  B2_Type pBCCHLocation optional,
  B4_Type pSIRepeat optional
};

type record IuModeOnlyCellSelStruct {
  B1_Type           mask,
  IuModeOnlyCellSel iuModeOnlyCellSel optional
}

type record of IuModeOnlyCellSelStruct IuModeOnlyCellSelList;

// =============================================================================
// Structured Type Definition
// 44.018 10.5.25c Only one repetition of the USF Assignment structure is included. If more is required, the TTCN shall be updated
// -----------------------------------------------------------------------------
type record ULTBFAssign {
  B7_Type              pFI,
  B1_Type              rlcMode,
  B5_Type              ulTBFAssign,
  B1_Type              ccMask,
  B2_Type              chCodingCmd  optional,           // not present if ccMask = 0
  B1_Type              eccMask,
  B4_Type              eGPRSChCodingCmd  optional,      // not present if eccMask = 0
  B1_Type              windowMask,
  EGPRSWindowSize      eGPRSWindowSize  optional,       // not present if windowMask = 0
  B1_Type              usfMask,
  B3_Type              singleUSFAlloc  optional,        // not present if usfMask = 1
  USFAssignList        usfAlloc  optional               // not present if usfMask = 0
  };

type record USFAssign {
  B1_Type ask,
  B3_Type sfAlloc     optional //only present if mask = 1
}

type record USFAssignStruct {
  B1_Type   prefix,
  USFAssign usfAlloc optional // only present if prefix = 1
}

type record of USFAssignStruct USFAssignList;

// =============================================================================
// Structured Type Definition
// 44.018 clause 10.5.2.25c only one repetition of the ULTBFAssign structure has been included. If more are required, the TTCN shall be updated
// -----------------------------------------------------------------------------
type record MultiTBFAlloc {
  B1_Type              extdDynAlloc,
  B1_Type              poMask,
  B4_Type              po  optional,                    // not present if poMask = 0
  B1_Type              prMode  optional,                // not present if poMask = 0
  B1_Type              tslotMask,
  B1_Type              timeSlotAllocMask  optional,     // not present if tslotMask = 0
  TimeSlotAllocation_UA timeSlotAlloc  optional,        // not present if tslotMask = 0 or timeSlotAllocMask=1
  B4_Type              alpha  optional,                 // not present if tslotMask = 0 or timeSlotAllocMask=0
  TimeSlotAllocationPowerControl timeSlotAllocPowerControl  optional, // not present if tslotMask = 0 or timeSlotAllocMask=0
  USFAssignList        ulTBFAssign  optional            // not present if tslotMask = 0
};

// =============================================================================
// Structured Type Definition
// multislot allocation
// 3GPP TS 44.018 clause 10.5.2.21b
// -----------------------------------------------------------------------------
type record MultislotAlloc {
  IEI8_Type           iei  optional,                   // IEI
  O1_Type              iel  optional,                   // OCTETSTRING [1]
  B1_Type              ext1,
  B1_Type              da7,                   // down link time slot allocation bit
  B1_Type              da6,                   // down link time slot allocation bit
  B1_Type              da5,                   // down link time slot allocation bit
  B1_Type              da4,                   // down link time slot allocation bit
  B1_Type              da3,                   // down link time slot allocation bit
  B1_Type              da2,                   // down link time slot allocation bit
  B1_Type              da1,                   // down link time slot allocation bit
  B1_Type              ext2,                  // always = 1
  B1_Type              ua7,                   // uplink link time slot allocation bit
  B1_Type              ua6,                   // uplink link time slot allocation bit
  B1_Type              ua5,                   // uplink link time slot allocation bit
  B1_Type              ua4,                   // uplink link time slot allocation bit
  B1_Type              ua3,                   // uplink link time slot allocation bit
  B1_Type              ua2,                   // uplink link time slot allocation bit
  B1_Type              ua1,                   // uplink link time slot allocation bit
  O1_Type              channelset1  optional,           // channel set 1
  O1_Type              channelset2  optional,           // channel set 2
  O1_Type              channelset3  optional,           // channel set 3
  O1_Type              channelset4  optional,           // channel set 4
  O1_Type              channelset5  optional,           // channel set 5
  O1_Type              channelset6  optional,           // channel set 6
  O1_Type              channelset7  optional,           // channel set 7
  O1_Type              channelset8  optional            // channel set 8
};

//=============================================================================
//Structured Type Definition
//Reference: 3GPP TS 44.060 clause 11.2.9b
//-----------------------------------------------------------------------------------------------------------------------------------------
type record NeighCellDescr3G_PMO {
    B1_Type         indexMask,
    B7_Type         indexStart3G optional,
    B1_Type         absoluteIndexMask,
    B7_Type         absoluteIndexStartEMR optional,
    B1_Type         fddMask,
    UTRAN_FDD_Descr fddDescr optional,
    B1_Type         tddMask,
    UTRAN_TDD_Descr tddDescr optional,
    B1_Type         cdmaMask,
    CDMA2000Descr   cdma2000Descr optional,
    B1_Type         rem3GCellMask,
    Removed3GCell_Descr rem3GCellDescr optional
}

// =============================================================================
// Structured Type Definition
// paging request type 1 rest octets.
// 3GPP TS 44.018 clause 10.5.2.23
// total length is 0..17 octets
// -----------------------------------------------------------------------------
type record P1RO {
  LH_B1_Type              nlnMask,
  B2_Type                 nLN_PCH  optional,               // not present if nlnMask = L
  B1_Type                 nLN_Status  optional,            // not present if nlnMask = L
  LH_B1_Type              priority1Mask,
  B3_Type                 priority1  optional,             // not present if priority1Mask = L
  LH_B1_Type              priority2Mask,
  B3_Type                 priority2  optional,             // not present if priority2Mask = L
  LH_B1_Type              groupCallMask  optional,
  GroupCallInfo           groupCallInfo  optional,         // not present if groupCallMask = L
  LH_B1_Type              packetPageInd1,
  LH_B1_Type              packetPageInd2,
  LH_B1_Type              r6Mask,
  B1_Type                 mask1            optional,       // not present if r6Mask = L
  B2_Type                 cellMask         optional,       // not present if r6Mask = L or mask1 = 0
  B2_Type                 cellGlobalCount  optional,       // not present if r6Mask = L or mask1 = 0 or cellMask = 01
  bitstring  reducedGCR     length (28)    optional,       // not present if r6Mask = L or mask1 = 0 or if cellMask = 00 or 01
  B36_Type                vSTKRand         optional,       // not present if r6Mask = L or mask1 = 0 or cellMask = 00
  B1_Type                 mBMSMask         optional,       // not present if r6Mask = L
  B1_Type                 note1Mask        optional,       // not present if r6Mask = L or mBMSMask = 0
  MBMSChParams            mBMSNote1        optional,       // not present if r6Mask = L or mBMSMask or note1Mask = 0
  B1_Type                 note2Mask        optional,       // not present if r6Mask = L or mBMSMask = 0
  B1_Type                 mBMSNote2Mask    optional,       // not present if r6Mask = L or mBMSMask = 0
  MBMSChParams            mBMSNote2        optional,       // not present if r6Mask = L or mBMSMask or note2Mask or mBMSNote2Mask = 0
  B1_Type                 infoMask         optional,       // not present if r6Mask = L or mBMSMask = 0
  MBMSInfo                mBMSInfo         optional,       // not present if r6Mask = L or mBMSMask or infoMask = 0
  LH_B1_Type              r7Mask,
  B1_Type                 amrMask          optional,       // not present if r7Mask = L
  B4_Type                 amrConfig        optional,       // not present if r7Mask = L or amrMask = 0
  LH_B1_Type              r8Mask,
  B1_Type                 priorityULAccess optional,       // not present if r8Mask = L
  B1_Type                 etwsMask         optional,       // not present if r8Mask = L @sic R5s100135 sic@
  B1_Type                 segmentMask      optional,       // not present if r8Mask = L or etwsMask = 0 @sic R5s100135 sic@
  B4_Type                 numSegments      optional,       // not present if r8Mask = L or etwsMask = 0 always present regardless of value of segment mask @sic R5s100135 sic@
  B1_Type                 pniBit           optional,       // not present if r8Mask = L or etwsMask = 0 @sic R5s100135 sic@
  B7_Type                 lengthofSegment  optional,       // not present if r8Mask = L or etwsMask = 0 @sic R5s100135 sic@
  bitstring               etwsPrimaryNotificationData optional // not present if r8Mask = L or etwsMask = 0 @sic R5s100135 sic@
};

type record MBMSChParams {
  B1_Type     countMask,
  B1_Type     offMask        optional,  // only present if countMask = 0
  B1_Type     freqMask     optional,  // only present if offMask = 1
  FreqParam   freqParams   optional,  // only present if offMask and freqMask = 1
  B8_Type     dlTimeslotAlloc optional,  // only present if offMask = 1
  RptdMBMSSessionParams sessionParams optional,  // only present if offMask = 1
  B1_Type     mprachMask     optional,  // only present if countMask = 1
  B1_Type     mpFreqMask     optional,  // only present if mprachMask = 1
  FreqParam   mpFreqParams   optional,  // only present if mprachMask and mpFreqMask = 1
  B3_Type     mpTimeslotNum  optional,  // only present if mprachMask = 1
  B3_Type     usf            optional,  // only present if mprachMask = 1
  B1_Type     mpCtrlMask     optional,  // only present if mprachMask = 1
  MPRACHDescr mprach         optional   // only present if mprachMask and mpCtrlMask = 1
};

type record MBMSInfo {
  MBMSSessionsList  preNoteSession,
  B1_Type           mask1,
  B1_Type           note1Or2   optional,  // not present if mask1 =0.  value of 0= same Channel Params at Notification1, value of 1= same Channel Params at Notification2
  MBMSSessionsList  session1   optional,  // not present if mask1 = 0
  RptdMBMSChNote    specificParams
};

type record MPRACHDescr {
  B1_Type   accMask,
  B16_Type  accContrClass  optional,  // not present if accMask = 0
  B1_Type   retransMask,
  B2_Type   maxRetrans     optional,  // not present if retransMask = 0
  B4_Type   s,
  B1_Type   intMask,
  B4_Type   txInt          optional,  // not present if intMask = 0
  B1_Type   levelMask,
  B4_Type   persistenceLevel optional  // not present if levelMask = 0
};


type record RptdMBMSChNote {
  B1_Type   prefix,
  MBMSChNoteList list  optional  // only present if prefix = 1
};

type record of MBMSChNote MBMSChNoteList;

type record MBMSChNote {
  MBMSChParams      chParams,
  MBMSSessionsList  session
};

type record MBMSSessionsDescr {
  B1_Type      prefix,
  MBMSSession  session  optional   // only present if prefix = 1
};

type record of MBMSSessionsDescr MBMSSessionsList;

type record MBMSSession {
  TMGI       tmgi,
  B1_Type    mask,
  B8_Type    id   optional  // only present if mask = 1
};

type record RptdMBMSSessionParams {
  B1_Type    prefix,
  MBMSSessionParamList list  optional  // only present if prefix = 1
};

type record of MBMSSessionParams MBMSSessionParamList;

type record MBMSSessionParams {
  B3_Type    idLength,
  bitstring  id length (1..5),
  B8_Type    sessionDuration,
  B1_Type    timeMask,
  B16_Type   startingTime  optional,  //not present if timeMask = 0
  B1_Type    windowMask,
  EGPRSWindowSize eGPRSWindowSize  optional,       // not present if windowMask = 0
  B1_Type    npmMask,
  B5_Type    npmTransferTime  optional  // not present if npmMask = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.25a
// -----------------------------------------------------------------------------
type record PacketChDescr {
  B5_Type              chType,                // channel type
  B3_Type              tN,                    // time slot
  B3_Type              tSC,                   // training sequence code
  B1_Type              maskBit1,
  B1_Type              maskBit2  optional,              // not present if maskBit1 = 1.
  B1_Type              spareBit1  optional,             // not present if maskBit1 = 1 or maskBit2 = 1
  B10_Type             aRFCN  optional,                 // not present if maskBit1 = 1 or maskBit2 = 1
  B1_Type              spareBit  optional,              // not present if maskBit1 = 1 or maskBit2 = 0
  B6_Type              mAIO  optional,                  // not present if maskBit1 = 1 or maskBit2 = 0
  B1_Type              mA_NumberInd  optional,
  B1_Type              maskBit3  optional,
  B2_Type              spareBits  optional,             // not present if maskBit1 = 1 or maskBit2 = 0 or maskBit3 = 1
  B2_Type              cHANGE_MARK_1  optional,         // not present if maskBit1 = 1 or maskBit2 = 0 or maskBit3 = 0
  B6_Type              mIAO  optional,                  // not present if maskBit1 = 0
  B6_Type              hSN  optional                    // not present if maskBit1 = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.16
// -----------------------------------------------------------------------------
type record PacketDownlinkAssign {
  O4_Type              tLLI,                  // TLLI
  B1_Type              mask,
  B5_Type              tFI_Assignment  optional,        // temporary flow identifier not present if mask = 0
  B1_Type              rLC_Mode  optional,              // RLC mode not present if mask = 0
  B1_Type              alphaMask  optional,             // not present if mask = 0.
  B4_Type              aLPHA  optional,                 // not present if mask = 0 or alphaMask = 0
  B5_Type              gAMMA  optional,                 // not present if mask = 0
  B1_Type              pOLLING  optional,               // not present if mask = 0
  B1_Type              tA_VALID  optional,              // not present if mask = 0
  B1_Type              taIndexMask,
  B4_Type              tIMING_ADVANCE_INDEX  optional,  // not present if mask = 0 or taIndexMask = 0
  B1_Type              startingTimeMask,      // not present if mask =  0
  B16_Type             tBF_STARTING_TIME  optional,     // not present if mask = 0 or startingTimeMask = 0
  B1_Type              pwrCtrlMask,           // not present if mask = 0
  B4_Type              p0  optional,                    // not present if mask = 0 or pwrCtrlMask = 0
  B1_Type              spareBit  optional,              // not present if mask = 0 or pwrCtrlMask = 0 Set to 0
  B1_Type              pR_MODE  optional,               // not present if mask = 0 or pwrCtrlMask = 0
  LH_B1_Type           egprsMask  optional,
  EGPRSWindowSize eGPRSWindowSize  optional,       // not present if egprsMask = L
  B2_Type              linkQualityMeasMode  optional,   // not present if egprsMask = L
  B1_Type              bepPriod2Mask  optional,         // not present if egprsMask = L
  B4_Type              BepPeriod2  optional,            // not present if egprsMask = L or bepPriod2Mask = 0
  LH_B1_Type           r6Mask,
  B1_Type              pfiMask  optional,               // not present if egprsMask = L or r6Mask = L
  B7_Type              pFI  optional,                    // not present if egprsMask = L, r6Mask = L or pfiMask = 0
  LH_B1_Type           r7Mask,
  B1_Type              npmMask optional,                // not present if r7Mask = L
  B5_Type              npmTransferTime optional,        // not present if r7Mask = L
  B1_Type              bTTIMask      optional,          // not present if r7Mask = L
  B1_Type              fanrMask      optional,          // not present if r7Mask = L or bTTIMask = 0
  B1_Type              eventBasedFANR    optional,      // not present if r7Mask = L (present for both values of bTTIMask)
  B3_Type              pdchPairInd       optional,      // not present if r7Mask = L or bTTIMask = 0
  B2_Type              dlEGPRSLevel      optional       // not present if r7Mask = L
};

// =============================================================================
// Structured Type Definition
// 3GPP TS  clause 12.11
// -----------------------------------------------------------------------------
type record PacketRequestReference {
  B11_Type        randomAccessInfo,
  RFN             frameNumber
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.12
// -----------------------------------------------------------------------------
type record PacketTimingAdvance {
  B1_Type              taValueMask,
  B6_Type              timingAdvanceValue  optional,    // not present if taValueMask = 0
  B1_Type              taIndexMask,
  B4_Type              timingAdvanceIndex  optional,    // not present if taIndexMask = 0
  B3_Type              timingAdvanceSlotNumber  optional // not present if taIndexMask = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.16
// -----------------------------------------------------------------------------
type record PacketUplinkAssign {
  B1_Type              allocMask,             // 0 -> indicating single block allocation
  B5_Type              tFI_Assignment  optional,        // temporary flow identifier not present if allocMask = 0
  B1_Type              pOLLING  optional,               // not present if allocMask = 0
  B1_Type              spareBit  optional,              // not present if allocMask = 0. Set to 0
  B3_Type              uSF  optional,                   // not present if allocMask = 0
  B1_Type              uSFGranularity  optional,        // not present if allocMask = 0
  B1_Type              p0Mask  optional,                // not present if allocMask = 0
  B4_Type              p0  optional,                    // not present if allocMask = 0 or p0Mask = 0
  B1_Type              pR_MODE  optional,               // not present if allocMask = 0 or p0Mask = 0
  B2_Type              ChannelCodingCommand  optional,  // not present if allocMask = 0
  B1_Type              tLLI_BlockChannelCodeing  optional, // not present if allocMask = 0
  B1_Type              alphaMask  optional,             // not present if allocMask = 0
  B4_Type              aLPHA  optional,                 // not present if allocMask = 0 or alphaMask = 0
  B5_Type              gMMA  optional,                  // not present if allocMask = 0
  B1_Type              taMask  optional,                // not present if allocMask = 0
  B4_Type              tIMING_ADVANCE_INDEX  optional,  // not present if allocMask = 0 or taMask = 0
  B1_Type              startingTimeMask  optional,      // not present if allocMask =  0
  B16_Type             tBF_STARTING_TIME  optional,     // not present if allocMask = 0 or startingTimeMask = 0
  B1_Type              alpha1Mask  optional,            // present if allocMask = 0 single block allocation
  B4_Type              aLPHA1  optional,                // not present if allocMask = 1 or alpha1Mask = 0
  B5_Type              gMMA1  optional,                 // not present if allocMask = 1
  B2_Type              prefixBits  optional,            // not present if allocMask = 1 the value is 01 if present
  B16_Type             tBF_STARTING_TIME1  optional,    // not present if allocMask = 1
  LH_B1_Type           p02Mask  optional,               // not present if allocMask = 1
  B4_Type              p02  optional,                   // not present if allocMask = 1 or p02Mask = L
  B1_Type              spareBit2  optional,             // not present if allocMask = 1 or p02Mask = L Set to 0
  B1_Type              pR_MODE2  optional,              // not present if allocMask = 1 or p02Mask = L
  LH_B1_Type           r99Mask  optional,
  B1_Type              extRAMask  optional,             // not present if r99Mask = L
  B5_Type              extRA  optional,                 // not present if r99Mask = L or extRAMask = 0
  LH_B1_Type           r6Mask  optional,                // not present if r99Mask = L
  B1_Type              pfiMask  optional,               // not present if r99Mask = L or r6Mask = L
  B7_Type              pFI  optional                    // not present if r99Mask = L, r6Mask = L or pfiMask = 0
};

// =============================================================================
// Structured Type Definition
// Page mode
// 3GPP TS 44.018 clause 10.5.2.26
// -----------------------------------------------------------------------------
type record PageModeIE {
  B4_Type              iei  optional,
  B2_Type              sprb,                  // spare bits
  B2_Type              pgm                    // page mode
};

// =============================================================================
// Structured Type Definition
// Power command and access type
// 3GPP TS 44.018 clause 10.5.2.28a
// -----------------------------------------------------------------------------
type record PowerCmdAccessType {
  B8_Type              iei  optional,                   // information element identifier
  B1_Type              accessType,            // access type
  B1_Type              spareBit,              // spare bit
  B1_Type              fpc,                   // fast measurement reporting and power control
  B5_Type              powerLevel             // power level (0-31)
};

// =============================================================================
// Structured Type Definition
// Power command
// 3GPP TS 44.018 clause 10.5.2.28
// -----------------------------------------------------------------------------
type record PowerCommand {
  B8_Type              iei  optional,                   // information element identifier
  B2_Type              spareBits,             // spare bits
  B1_Type              fpc,                   // fast measurement reporting and power control
  B5_Type              powerLevel             // power level (0-31)
};

// =============================================================================
// Structured Type Definition
// Power control parameters
// 3GPP TS 44.018 clause 12.13
// -----------------------------------------------------------------------------
type record PowerControlParam {
  B4_Type              aLPHA,
  B1_Type              gmmaMask0,
  B5_Type              gMMA_TN0  optional,              // not present if gmmaMask0 = 0
  B1_Type              gmmaMask1,
  B5_Type              gMMA_TN1  optional,              // not present if gmmaMask1 = 0
  B1_Type              gmmaMask2,
  B5_Type              gMMA_TN2  optional,              // not present if gmmaMask2 = 0
  B1_Type              gmmaMask3,
  B5_Type              gMMA_TN3  optional,              // not present if gmmaMask3 = 0
  B1_Type              gmmaMask4,
  B5_Type              gMMA_TN4  optional,              // not present if gmmaMask4 = 0
  B1_Type              gmmaMask5,
  B5_Type              gMMA_TN5  optional,              // not present if gmmaMask5 = 0
  B1_Type              gmmaMask6,
  B5_Type              gMMA_TN6  optional,              // not present if gmmaMask6 = 0
  B1_Type              gmmaMask7,
  B5_Type              gMMA_TN7  optional               // not present if gmmaMask7 = 0
};

// =============================================================================
// Structured Type Definition
// PS Cause
// 3GPP TS 44.018 clause 10.5.2.67
// -----------------------------------------------------------------------------
type record PS_Cause {
  B4_Type              iei,   //'1001'
  B4_Type              cause
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record RRDynamicAllocation {
  B1_Type              extendedAlloc,         // 0 - dynamic allocation; 1 - extended dynamic allocation
  B1_Type              mask,
  B4_Type              po  optional,                    // not present if mask = 0
  B1_Type              prMode  optional,                // not present if mask = 0
  B1_Type              uSFGranularity,        // 0 - one block; 1 - four blocks
  B1_Type              mask2,
  B5_Type              ulTFIAssign  optional,           // not present if mask2 = 0
  B1_Type              spareBit,              // value = 0
  B1_Type              maskTimeslot,          // 0 - no power control, 1 - with power control
  B4_Type              alpha  optional,                 // not present if maskTimeslot = 0
  B1_Type              tN0  optional,                   // 1 - time slot 0 is allocated; 0 -- not allocated
  B3_Type              uSF_TN0  optional,               // USF value for slot 0
  B5_Type              gamma_TN0  optional,             // GAMMA for slot 0.  Not present if maskTimeslot = 0
  B1_Type              tN1  optional,                   // 1 - time slot 1 is allocated; 0 -- not allocated
  B3_Type              uSF_TN1  optional,               // USF value for slot 1
  B5_Type              gamma_TN1  optional,             // GAMMA for slot 1.  Not present if maskTimeslot = 0
  B1_Type              tN2  optional,                   // 1 - time slot 2 is allocated;  0 -- not allocated
  B3_Type              uSF_TN2  optional,               // USF value for slot 2
  B5_Type              gamma_TN2  optional,             // GAMMA for slot 2.  Not present if maskTimeslot = 0
  B1_Type              tN3  optional,                   // 1 - time slot 3 is allocated;  0 -- not allocated
  B3_Type              uSF_TN3  optional,               // USF value for slot 3
  B5_Type              gamma_TN3  optional,             // GAMMA for slot 3.  Not present if maskTimeslot = 0
  B1_Type              tN4  optional,                   // 1 - time slot 4 is allocated;  0 -- not allocated
  B3_Type              uSF_TN4  optional,               // USF value for slot 4
  B5_Type              gamma_TN4  optional,             // GAMMA for slot 4.  Not present if maskTimeslot = 0
  B1_Type              tN5  optional,                   // 1 - time slot 5 is allocated;  0 -- not allocated
  B3_Type              uSF_TN5  optional,               // 1 value for slot 5
  B5_Type              gamma_TN5  optional,             // GAMMA for slot 5.  Not present if maskTimeslot = 0
  B1_Type              tN6  optional,                   // 1 - time slot 6 is allocated;  0 -- not allocated
  B3_Type              uSF_TN6  optional,               // USF value for slot 6
  B5_Type              gamma_TN6  optional,             // GAMMA for slot 6.  Not present if maskTimeslot = 0
  B1_Type              tN7  optional,                   // 1 - time slot 7 is allocated;  0 -- not allocated
  B3_Type              uSF_TN7  optional,               // USF value for slot 7
  B5_Type              gamma_TN7  optional              // GAMMA for slot 7.  Not present if maskTimeslot = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP 44.018 10.5.2.25d
// -----------------------------------------------------------------------------
type record RRPacketDownlinkAssignment {
  B8_Type              tag  optional,                   // '00100011'
  O1_Type              ielength  optional,
  B2_Type              mACMode,
  B1_Type              rLCMode,
  B8_Type              timeslotAllocation,
  PacketTimingAdvance pktTA,
  B1_Type              mask,
  B4_Type              p0  optional,                    // not present if mask=0
  B1_Type              spareBit  optional,              // set to 0. not present if mask=0
  B1_Type              prMode  optional,                // not present if mask=0
  B1_Type              pcmask,
  PowerControlParam powerCntrolParam  optional,    // not present if pcmask = 0
  B1_Type              tfimask,
  B5_Type              dlTFI  optional,                 // not present if tfimask = 0
  B1_Type              spareBit2,             // set to 0
  B1_Type              egprsmask,
  EGPRSWindowSize eGPRSWindowSize  optional,       // not present if egprsmask = 0
  B2_Type              linkQualMeasMode  optional,      // not present if egprsmask = 0
  B1_Type              tamask,
  B2_Type              pktExtendedTA  optional,         // not present if tamask = 0
  B1_Type              r6Mask  optional,
  MultiDLTBFAssignStruct     multiDLTBFAssign  optional,      // not present if r6Mask = 0
  B1_Type              r7Mask  optional,    // not present if r6Mask = 0
  B1_Type              fanr    optional,    // not present if r6Mask or r7Mask = 0
  RptdNPM_dl           rptdNPM      optional,          // not present if r6Mask or r7Mask = 0 @sic R5s100135 sic@
  B2_Type              eGPRSLevel   optional,          // not present if r6Mask or r7Mask = 0 @sic R5s100135 sic@
  B1_Type              r8Mask  optional,    // not present if r6Mask or r7Mask = 0
  B1_Type              eutranMask      optional,          // not present if r6Mask or r7Mask = 0 or r8Mask = 0
  RptdEUTRANMeasCtrl       eutranMeasCtrl  optional,          // not present if r6Mask or r7Mask or r8Mask or eutranMask= 0
  B1_Type              utranMask      optional,          // not present if r6Mask or r7Mask = 0 or r8Mask = 0
  RptdUTRANMeasCtrl       utranMeasCtrl  optional          // not present if r6Mask or r7Mask or r8Mask or utranMask= 0
};

type record RptdNPM_ul { // @sic R5s100135 sic@
  B1_Type    prefix,
  NPMList_ul    list optional  // only present if prefix = 1
};

type record of NPMStruct_ul NPMList_ul; // @sic R5s100135 sic@

type record NPMStruct_ul { // @sic R5s100135 sic@
  B1_Type              npmMask,
  B5_Type              npmTransferTime optional,        // not present if npmMask
  B1_Type              endingRepetition  // @sic R5s100135 sic@
};

type record RptdNPM_dl { // @sic R5s100135 sic@
  B1_Type    prefix,
  NPMList_dl    list optional  // only present if prefix = 1
};

type record of NPMStruct_dl NPMList_dl; // @sic R5s100135 sic@

type record NPMStruct_dl { // @sic R5s100135 sic@
  B1_Type              npmMask,
  B5_Type              npmTransferTime optional,        // not present if npmMask
  B1_Type              eventBasedFANR,
  B1_Type              endingRepetition  // @sic R5s100135 sic@
};

type record RptdEUTRANMeasCtrl {
  B1_Type    prefix,
  EUTRANMeasCtrlList    list  optional  // only present if prefix = 1
};

type record of EUTRANMeasCtrl EUTRANMeasCtrlList;

type record EUTRANMeasCtrl {
  B1_Type    measCtrl,
  B3_Type    freq,
  RptdUTRANFreqIndex rptdFreq
};

type record RptdUTRANMeasCtrl {
  B1_Type    prefix,
  UTRANMeasCtrlList    list  optional  // only present if prefix = 1
};

type record of UTRANMeasCtrl UTRANMeasCtrlList;

type record UTRANMeasCtrl {
  B1_Type    measCtrl,
  B5_Type    freq,
  RptdUTRANFreqIndex rptdFreq
};

// =============================================================================
// Structured Type Definition
// 3GPP 44.018 10.5.2.25c
// -----------------------------------------------------------------------------
type record RRPacketUplinkAssignment {
  B8_Type              tag  optional,                   // '00100010'
  O1_Type              ielength  optional,
  B2_Type              chCodingCmd,
  B1_Type              tLLIBlockChCoding,
  PacketTimingAdvance  pktTA,
  B2_Type              mask,                  // only acceptable values are '01' and '10'
  RRDynamicAllocation dynamicAlloc  optional,      // only if mask = '01'
  B1_Type              multiMask  optional,             // only if mask = '00'
  MultiTBFAlloc   multiTBFAlloc  optional,         // only if mask = '00' and multiMask = 0
  B1_Type              r99mask  optional,
  B4_Type              eGPRSMCSMode  optional,          // not present if r99mask = 0
  B1_Type              resegment  optional,             // not present if r99mask = 0
  EGPRSWindowSize eGPRSWindowSize  optional,       // not present if r99mask = 0
  B1_Type              mask1  optional,
  B2_Type              pktExtendedTA  optional,          // not present if mask1 = 0
  B1_Type              r7Mask  optional,    // not present if r99mask = 0
  B1_Type              rlcMask    optional,    // not present if r99mask or r7Mask = 0
  B1_Type              rlcMode    optional,    // not present if r99mask or r7Mask or rlcMask = 0
  RptdNPM_ul           rptdNPM      optional,          // not present if r99mask or r7Mask = 0  @sic R5s100135 sic@
  B2_Type              eGPRSLevel   optional,          // not present if r99mask or r7Mask = 0 @sic R5s100135 sic@
  B1_Type              pulseMask    optional,          // not present if r99mask or r7Mask = 0 @sic R5s100135 sic@
  PulseFormat          pulseFormat  optional,          // not present if r99mask or r7Mask = 0 @sic R5s100135 sic@
  B1_Type              fanrMask    optional,    // not present if r99mask or r7Mask or fanrMask = 0
  B1_Type              timeMask    optional,    // not present if r99mask or r7Mask or fanrMask or timeMask = 0
  B8_Type              reportedTimeslots    optional,    // not present if r99mask or r7Mask or fanrMask or timeMask = 0
  B1_Type              tsh    optional,    // not present if r99mask or r7Mask or fanrMask or timeMask = 0
  B1_Type              r8Mask  optional,    // not present if r99mask or r7Mask = 0
  B1_Type              eutranMask      optional,          // not present if r99mask or r7Mask = 0 or r8Mask = 0
  RptdEUTRANMeasCtrl       eutranMeasCtrl  optional,          // not present if r99mask or r7Mask or r8Mask or eutranMask= 0
  B1_Type              utranMask      optional,          // not present if r99mask or r7Mask = 0 or r8Mask = 0
  RptdUTRANMeasCtrl       utranMeasCtrl  optional          // not present if r99mask or r7Mask or r8Mask or utranMask= 0
};

// =============================================================================
// Structured Type Definition
// Pulse Format
// 3GPP TS 44.060 clause 12.8.3  @sic R5s100135 sic@
// -----------------------------------------------------------------------------
type record PulseFormat {
  B1_Type         mask,
  B3_Type         coding1  optional,  // only present if mask=0
  bitstring       coding2  optional   // only present if mask=1
};

// =============================================================================
// Structured Type Definition
// RR Cause
// 3GPP TS 44.018 clause 10.5.2.31
// -----------------------------------------------------------------------------
type record RR_Cause {
  B8_Type              iei  optional,
  B8_Type              cause
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 11.2.21a
// -----------------------------------------------------------------------------
type record of RTD12 RTD12_List;

type record RTD12 {
  B1_Type              rtdMask,
  B12_Type             rTD12  optional                  // not present if rtdMask1 = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 11.2.21a
// -----------------------------------------------------------------------------
type record of RTD6 RTD6_List ;

type record RTD6 {
  B1_Type              rtdMask,
  B6_Type              rTD6  optional                  // not present if rtdMask1 = 0
};

// =============================================================================
// Structured Type Definition
// Range list
// 3GPP TS 44.018 clause 10.5.2.1c
// -----------------------------------------------------------------------------
type record Range {
  B10_Type             rangeLower,
  B10_Type             rangeUper,
  B1_Type            endingRepetition   // a value of 1 indicates another repetition
};

type record of Range RangeList;

type record RangeLimits {
  B1_Type   prefix,
  RangeList range optional
}

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record ReferenceAddress {
  B1_Type              globalTFImask,
  GlobalTFI            gLOBAL_TFI  optional,            // not present if globalTFImask=1
  B1_Type              mask2  optional,                 // not present if globalTFImask=0
  O4_Type              tLLI  optional,                  // not present if globalTFImask=0 and mask2=1
  B1_Type              mask3  optional,                 // not present if globalTFImask=0 and mask2=0
  B16_Type             tQI  optional,                   // not present if globalTFImask=0 and mask2=0 and mask3=1
  PacketRequestReference packetRequestRef  optional // not present if globalTFImask=0 and mask2=0 and mask3=0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 9.1.54
// function p(x) is:
// p(0) = 0,     p(1) = 10,    p(2) = 19,      p(3) = 28,     p(4) = 36,     p(5) = 44,
// p(6) = 52,   p(7) = 60,    p(8) = 67,      p(9) = 74,     p(10) = 81,   p(11) = 88,
// p(12) = 95, p(13) = 102, p(14) = 109, p(15) = 116, p(16) = 122,
// p(x) = 0 for x = 17-31.
// -----------------------------------------------------------------------------
type record RepeatedUTRAN_FDD_NeighCells {
  B1_Type         arfcnIndexMask,       // always 0
  B14_Type        fDD_ARFCN,            // present if arfcnIndexMask = 0
  B1_Type         fDD_Indic0,
  B5_Type         nR_OF_FDD_CELLS,
  bitstring       fDD_CELL_INFORMATION  // length of this bitstring = p(nR_OF_FDD_CELLS)
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 9.1.54
// function p(x) is:
// p(0) = 0,     p(1) = 10,    p(2) = 19,      p(3) = 28,     p(4) = 36,     p(5) = 44,
// p(6) = 52,   p(7) = 60,    p(8) = 67,      p(9) = 74,     p(10) = 81,   p(11) = 88,
// p(12) = 95, p(13) = 102, p(14) = 109, p(15) = 116, p(16) = 122,
// p(x) = 0 for x = 17-31.
// -----------------------------------------------------------------------------
type record RepeatedUTRAN_TDD_NeighCells {
  B1_Type              arfcnIndexMask,  //always 0
  B14_Type             tDD_ARFCN,             // not present if arfcnIndexMask = 0
  B1_Type              tDD_Indic0,
  B5_Type              nR_OF_TDD_CELLS,
  bitstring       tDD_CELL_INFORMATION   // length of this bitstring = p(nR_OF_TDD_CELLS)
};

type record RepeatedUTRAN_TDD_PMO_NeighCells {
  B1_Type              tDD_Indic0,
  B1_Type              arfcnIndexMask,  //always 0
  B14_Type             tDD_ARFCN,             // not present if arfcnIndexMask = 0
  B5_Type              nR_OF_TDD_CELLS,
  bitstring       tDD_CELL_INFORMATION   // length of this bitstring = p(nR_OF_TDD_CELLS)
};

//=============================================================================
//Structured Type Definition
//Request reference
//3GPP TS 44.060 clause 11.2.9b
//-----------------------------------------------------------------------------
type record ReportPriorityDescr {
  B7_Type         noCells,
  RepPriorityList repPriority
}

type record of B1_Type RepPriorityList;

//=============================================================================
//Structured Type Definition
//Request reference
//3GPP TS 44.060 clause 11.2.9b
//-----------------------------------------------------------------------------
type record Removed3GCell_Descr {
  B2_Type           n1,
  RemovedCellN2List n2List
}

type record of RemovedCellN2 RemovedCellN2List;

type record RemovedCellN2 {
  B5_Type              n2,
  RemovedCellIndexList cellIndex
}

type record of RemovedCellIndex RemovedCellIndexList;

type record RemovedCellIndex {
    B7_Type   index,
    B3_Type   cellDiffLen,
    bitstring cellDiff length (0..7)
}
// =============================================================================
// Structured Type Definition
// Request reference
// 3GPP TS 44.018 clause 10.5.2.30
// -----------------------------------------------------------------------------
type record ReqRef {
  IEI8_Type       iei  optional,                   // information element identifier
  B8_Type         radoAccessInfo,
  RFN             fn
};

// =============================================================================
// Structured Type Definition
// ref: 3GPP 44.060, clause 11.2.17b
// the TTCN definition shall be modified if more than 2 SI Msgs are required in the constraint
// -----------------------------------------------------------------------------
type record SIMessageEntry {
  B1_Type         prefixBit,             // always =1
  B8_Type         sIMessgeType,
  B2_Type         messRec,               // 00 = Msg Type supported but not received
                                           // 01 = supported and received, single instance
                                           // 10 = supported and partially received, multiple instances
                                           // 11 = supported and completely received, multiple instances
  B3_Type         sixChangeMark  optional,         // only present if messRec1 = 10 or 11
  B4_Type         sixChangeCount  optional,        // only present if messRec1 = 10
  bitstring       instanceBitmap  optional         // only present if messRec1 = 10
};
type record SIMessageEntryOptional {  // created this to try and allow up to 9 optional entries in the list
  SIMessageEntry entry optional
};
type record of SIMessageEntryOptional SIMessageEntryListDescr;

// =============================================================================
// Structured Type Definition
// ref: 3GPP 44.060, clause 11.2.17b
// the TTCN definition shall be modified if more than 2 SI Msgs are required in the constraint
// -----------------------------------------------------------------------------
type record SIMessageList {
  SIMessageEntryListDescr  list  optional,
  B1_Type         endingRepetition,      // always 0
  B1_Type         additionalMsgType
};

// =============================================================================
// Structured Type Definition
// 44.018 clause 10.5.2.57
// -----------------------------------------------------------------------------
type record ServiceSupport {
  IEI8_Type       iei  optional,
  B6_Type         spareBits,             // set to '000000'
  B1_Type         multicastMBMS,
  B1_Type         broadcastMBMS
};

// =============================================================================
// Structured Type Definition
// Starting time
// 3GPP TS 44.018 clause 10.5.2.38
// -----------------------------------------------------------------------------
type record StartingTime {
  IEI8_Type       iei  optional,                   // '01111100'B
  RFN             fn
};

// =============================================================================
// Structured Type Definition
// Synchronization indication
// 3GPP TS 44.018 clause 10.5.2.39
// -----------------------------------------------------------------------------
type record SyncInd {
  IEI4_Type       iei  optional,                   // '1101'B
  B1_Type         normalCellInd,         // normal cell indication
  B1_Type         reportOTD,             // report observed time difference
  B2_Type         syncInd                // synchronisation indication
};

// =============================================================================
// Structured Type Definition
// Timing advance
// GSM 04.08,  10.5.2.40
// -----------------------------------------------------------------------------
type record TA {
  IEI8_Type     iei  optional,                   // '01111101'B
  B2_Type       sprb,        // '00'B
  B6_Type       ievalue      // one unit = 48/13 microseconds (in 1 bit periods)
};

// =============================================================================
// Structured Type Definition
// Timing advance
// GSM 04.08,  10.5.2.40
// -----------------------------------------------------------------------------
type record TA_TypeV {
  B2_Type       sprb,        // '00'B
  B6_Type       ievalue    // one unit = 48/13 microseconds (in 1 bit periods)
};


// =============================================================================
// Structured Type Definition
// Time difference
// 3GPP TS 44.018 clause  10.5.2.41
// -----------------------------------------------------------------------------
type record TimeDiff {
  IEI8_Type       iei  optional,                   // '01111011'B
  O1_Type         iel  optional,                   // OCTETSTRING [1]
  O1_Type         ievalue              // one unit = 24/13 microseconds (half bit period)
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.7a
// -----------------------------------------------------------------------------
type record UTRANPreConfigInfo {
  IEI8_Type       iei  optional,
  O1_Type         iel  optional,
  octetstring    ievalue              // used to be: InterRATHandoverInfo
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 11.2.25b
// -----------------------------------------------------------------------------
type record of UTRAN_ARFCN UTRAN_ARFCN_List;
type record UTRAN_ARFCN {
  B1_Type         prefix,               // value = 1 if present
  B14_Type        uTRAN_ARFCN1  optional
};


// =============================================================================
// Structured Type Definition
// UTRAN frequency list
// 3GPP TS 44.018 clause 10.5.2.1d
// -----------------------------------------------------------------------------
type record UTRAN_FreqList {
  IEI8_Type       iei  optional,                   // '01001100'B
  O1_Type         iel,
  UTRAN_ARFCN_List     fDD_ARFCN  optional,             // FDD frequencies
  UTRAN_ARFCN_List     tDD_ARFCN  optional,             // TDD frequencies
  bitstring       spareBits  optional
};



// =============================================================================
// Structured Type Definition
// ref: 3GPP 44.060, clause 11.2.17b
// -----------------------------------------------------------------------------
type record UnknownSIEntry {
  B1_Type         prefixBit,             // always =1
  B8_Type         sIMessgeType  optional
};

type record UnknownSIEntryOptional { // to be able to have up to 2 entries
  UnknownSIEntry entry optional
  }
type record of UnknownSIEntryOptional UnknownSIEntryListDescr;

// =============================================================================
// Structured Type Definition
// ref: 3GPP 44.060, clause 11.2.17b
// -----------------------------------------------------------------------------
type record UnknownSIList {
  UnknownSIEntryListDescr list  optional,
  B1_Type         endingRepetition,      // always 0
  B1_Type         additionalMsgType
};

// =============================================================================
// Structured Type Definition
// 44.018 clause 10.5.2.42b
// 3GPP TS 44.018 clause 9.1.54
// -----------------------------------------------------------------------------
type record VGCSCiphParam {
  IEI8_Type       iei  optional,
  O1_Type         ielength  optional,
  B2_Type         spareBits,             // set to '00'
  B1_Type         randInd,
  B1_Type         lacInd,
  B1_Type         cellInd,
  B1_Type         b22Count,
  B2_Type         cellGlobalCount,
  O1_Type         cellId,                // Optional
  LocAreaId     lai,                   // Optional
  O5_Type         vSTK_RAND              // Optional
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.42a
// -----------------------------------------------------------------------------
type record VGCS_TargetMode {
  IEI8_Type       iei  optional,
  O1_Type         iel  optional,
  B2_Type         targetMode,
  B4_Type         groupCipherKey,
  B2_Type         spareBits
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record VGCS_AMRConfig {
  IEI8_Type                   iei                   optional, /* present in case of TLV; omit in case of LV */
  Type4Length_Type            iel                   optional, /* present in case of LV or TLV; omit in case of V */
  B4_Type                     amrConfig,
  B4_Type                     spare
};

// =============================================================================
// Structured Type Definition
// Rach control parameters
// 3GPP TS 44.018 clause 10.5.2.29
// The info element has a fixed length of 3 octets.
// -----------------------------------------------------------------------------
type record RACHControlParam {
//  IEI8_Type       iei  optional,                   // iei is never used
  B2_Type         maxretx,               // maximum retransmissions
  B4_Type         txInteger,             // Tx integer, number of slots to spread transmission
  B1_Type         cellBarAccess,         // cell barred for access
  B1_Type         re,                    // call reestablishment allowed
  B5_Type         acc_2,                 // access control class 15-11
  B1_Type         ec,                    // emergency call allowed
  B10_Type        acc_1                  // access control class 9-0
};

// =============================================================================
// Structured Type Definition
// MEASUREMENT PARAMETERSl description in SI2quater rest octets
// -----------------------------------------------------------------------------
type record MeasParamDescr {
  B1_Type         rEPORT_TYPE,
  B2_Type         sERVING_BAND_REPORTING
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.33b
// -----------------------------------------------------------------------------
type record NC_MeasParams {
  B2_Type         nETWORK_CONTROL_ORDER,
  B1_Type         mask,
  B3_Type         nC_NON_DRX_PERIOD  optional,     // not present if mask = 0
  B3_Type         nC_REPORTING_PERIOD_I  optional, // not present if mask = 0
  B3_Type         nC_Reporting_PERIOD_T  optional  // not present if mask = 0
};

// =============================================================================
// Structured Type Definition
// Neighbour cells description
// 3GPP TS 44.018 clause 10.5.2.22
// -----------------------------------------------------------------------------
type record NeighCellDescr {
  B2_Type         rfl2,                  // bits 128-127
  B1_Type         extind,                // extension indication
  B1_Type         baind,                 // bcch allocation sequence number indication
  B4_Type         rfl4,                  // bits 124-121
  O15_Type        rfl                    // bits 120-0
};

// =============================================================================
// Structured Type Definition
// Neighbour cells description2
// 3GPP TS 44.018 clause 10.5.2.22a
// -----------------------------------------------------------------------------
type record NeighCellDescr2 {
  B1_Type         b128,                  // Bit 128, format-ID
  B2_Type         mbrpt,                 // Multiband reporting
  B1_Type         baind,                 // bcch allocation sequence number indication
  B4_Type         b121_124,              // Bit 124 - 121, format ID next
  O15_Type        rfl                    // remaining reference frequency list
};

// =============================================================================
// Structured Type Definition
// 3G Neighbour cell description
// 3GPP TS 44.060 clause 11.2.21b
// -----------------------------------------------------------------------------
type record NeighCellDescr3G {
  B1_Type        indexMask,
  B7_Type        indexStart3G optional,        // not present if indexMask = 0
  B1_Type        absoluteIndexMask,
  B7_Type        absoluteIndexStartEMR optional,        // not present if absoluteIndexMask = 0
  B1_Type        fDDMask,
  UTRAN_FDD_Descr uTRAN_FDD_Description optional,        // not present if fDDMask = 0
  B1_Type        tDDMask,
  UTRAN_TDD_Descr uTRAN_TDD_Description optional        // not present if tDDMask = 0
};

// =============================================================================
// Structured Type Definition
// GPRS report priority description
// 3GPP TS 44.018 clause 10.5.2.33b
// -----------------------------------------------------------------------------
type record GPRS_REP_PRIORITY_Descr {
  B7_Type              numberCells,
  GPRS_REP_PRIORITY_List  rEP_PRIORITY
};

type record of B1_Type GPRS_REP_PRIORITY_List;

type record of RTD12 GPRS_RTD12_List;

type record of RTD6 GPRS_RTD6_List;

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018, 10.5.2.33b
// -----------------------------------------------------------------------------
type record GPRS_RealTimeDiffDescr {
  B1_Type         rtdMask1,
  B1_Type         baIndexMask1  optional,          // not present if rtdMask1 = 0
  B5_Type         bAIndexStartRTD1  optional,      // not present if rtdMask1 = 0 or baIndexMask1 = 0
  GPRS_RTD6_List rTD6_List,             // not present if rtdMask1 = 0
  B1_Type         rtdMask2,
  B1_Type         baIndexMask2  optional,          // not present if rtdMask2 = 0
  B5_Type         bAIndexStartRTD2  optional,      // not present if rtdMask2 = 0 or baIndexMask2 = 0
  GPRS_RTD12_List rTD12_List              // not present if rtdMask2 = 0
};

// =============================================================================
// Structured Type Definition
// Reference : 3GPP TS 44.018, 10.5.2.33b
// -----------------------------------------------------------------------------
type record GPRS_BSIC_Descr {
  B1_Type         indexMask,
  B5_Type         bA_IndexStart_BSIC  optional,    // not present if indexMask = 0
  B6_Type         bSIC,
  B7_Type         numberRemainingBSIC,
  FreqScrollingList freqScroll
};

type record of FreqScrolling FreqScrollingList;

type record FreqScrolling {
  B1_Type         frequencfScrolling1,
  B6_Type         bSIC1
}

// =============================================================================
// Structured Type Definition
// Reference: 3GPP TS 44.060 clause 12.10a
// -----------------------------------------------------------------------------
type record GPRSMobileAlloc {
  B6_Type         hSN,                   // 3GPP TS 45.002
  B1_Type         rFL_Mask,
  RFL_NumberList  rFL_NumberList  optional,        // not present if rFL_Mask = 0
  B1_Type         mA_ARFCN_Mask,
  B6_Type         mA_LENGTH  optional,             // not present if mA_ARFCN_Mask = 1
  bitstring       mA_BITMAP length(1..64)  optional, // not present if mA_ARFCN_Mask = 1
  B1_Type         aRFCN_IndexMask  optional,       // not present if mA_ARFCN_Mask = 0
  ARFCN_IndexList aRFCN_IndexList  optional        // not present if mA_ARFCN_Mask = 0 or aRFCN_IndexMask = 0
};

// =============================================================================
// Structured Type Definition
// Reference : 3GPP TS 44.060 clause 11.2.23
// -----------------------------------------------------------------------------
type record GPRS_3G_MeasParamDescr {
  B1_Type         fDD_REP_QUANT_Mask,
  B1_Type         fDD_REP_QUANT  optional,         // not present if fDD_REP_QUANT_Mask = 0
  B2_Type         fDD_MULTIRAT_REPORTING  optional, // not present if fDD_REP_QUANT_Mask = 0
  B1_Type         fDD_ReportingMask,
  B3_Type         fDD_REPORTING_OFFSET  optional,  // not present if fDD_ReportingMask = 0
  B3_Type         fDD_REPORTING_THRESHOLD  optional, // not present if fDD_ReportingMask = 0
  B1_Type         tDD_MultiratReportingMask,
  B2_Type         tDD_MULTIRAT_REPORTING  optional, // not present if tDD_MultiratReportingMask = 0
  B1_Type         tDD_ReportingMask,
  B3_Type         tDD_REPORTING_OFFSET  optional,  // not present if tDD_ReportingMask = 0
  B3_Type         tDD_REPORTING_THRESHOLD  optional // not present if tDD_ReportingMask = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.24
// -----------------------------------------------------------------------------
type record GPRS_CellOptions {
  B2_Type              nMO,                   // network mode of operation
  B3_Type              t3168,
  B3_Type              t3192,
  B3_Type              dRX_TIMER_MAX,
  B1_Type              aCCESS_BURST_TYPE,
  B1_Type              cONTROL_ACK_TYPE,
  B4_Type              bS_CV_MAX,
  B1_Type              pAN_Mask,
  B3_Type              pAN_DEC  optional,               // not present if pAN_Mask = 0
  B3_Type              pAN_INC  optional,               // not present if pAN_Mask = 0
  B3_Type              pAN_MAX  optional,               // not present if pAN_Mask = 0
  B1_Type              optionalExtMask,
  B6_Type              extensionLength  optional,       // not present if optionalExtMask =0
  ExtensionInfo   extensionInfo  optional          // not present if optionalExtMask = 0
};

// =============================================================================
// Structured Type Definition
// Reference : 3GPP TS 44.060 clause 11.2.23
// -----------------------------------------------------------------------------
type record GPRS_MeasParamDescr {
  B1_Type              multibandReportingMask,
  B2_Type              multibandReporting  optional,    // not present if multibandReportingMask = 0
  B1_Type              ServingBandReportingMask, // not present if servingBandReportingMask = 0
  B2_Type              servingBandReporting  optional,  // not present if servingBandReportingMask = 0
  B1_Type              sCALE_ORD_Mask,
  B2_Type              sCALE_ORD  optional,             // not present if sCALE_ORD_Mask = 0
  B1_Type              mask900,
  B3_Type              rEPORTING_OFFSET_900  optional,  // not present if mask900 = 0
  B3_Type              rEPORTING_THRESHOLD_900  optional, // not present if mask900 = 0
  B1_Type              mask1800,
  B3_Type              rEPORTING_OFFSET_1800  optional, // not present if mask1800 = 0
  B3_Type              rEPORTING_THRESHOLD_1800  optional, // not present if mask1800 = 0
  B1_Type              mask400,
  B3_Type              rEPORTING_OFFSET_400  optional,  // not present if mask400 = 0
  B3_Type              rEPORTING_THRESHOLD_400  optional, // not present if mask400 = 0
  B1_Type              mask1900,
  B3_Type              rEPORTING_OFFSET_1900  optional, // not present if mask1900 = 0
  B3_Type              rEPORTING_THRESHOLD_1900  optional, // not present if mask1900 = 0
  B1_Type              mask850,
  B3_Type              rEPORTING_OFFSET_850  optional,  // not present if mask850 = 0
  B3_Type              rEPORTING_THRESHOLD_850  optional // not present if mask850 = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 11.2.25
// -----------------------------------------------------------------------------
type record GPRS_PowerControlParam {
  B4_Type              aLPHA,
  B5_Type              t_AVG_W,
  B5_Type              t_AVG_T,
  B1_Type              pC_MEAS_CHAN,          // 0--BCCH, 1--PDCH
  B4_Type              n_AVG_I
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 12.10a
// -----------------------------------------------------------------------------
type record of RFL_Number RFL_NumberList;

type record RFL_Number {
  B4_Type              rFL_Number,
  B1_Type              mask               // value = 1 if more to follow
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record ExtLengthDescr {
  B8_Type              extensionLength,
  bitstring       sparebit  optional
};



// =============================================================================
// Structured Type Definition
// used in SI13 rest octets
// 3GPP TS 44.018 clause 10.5.2.37b
// -----------------------------------------------------------------------------
type record PBCCH_Descr {
  B4_Type              pb,
  B3_Type              tSC,
  B3_Type              tN,
  B1_Type              carrierMask1,
  B1_Type              carrierMask2  optional,          // not present if carrierMask1 = 1.
                                                   // (carrierMask1= carrierMask2 = 0) indicating BCCH carrier
  B10_Type             aRFCN  optional,                 // present if (carrierMask1 = 0 and carrierMask2 = 1)
  B6_Type              mAIO  optional                   // present if carrierMask1 = 1
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 11.2.20
// -----------------------------------------------------------------------------
type record SI13PBCCH_Location {
  B1_Type              sI13LocationMask,
  B1_Type              sI13_LOCATION  optional,         // not present if sI13LocationMask = 1
  B2_Type              PBCCH_LOCATION  optional,        // not present if sI13LocationMask = 0
  B4_Type              pSI1_REPEAT_PERIOD  optional     // not present if sI13LocationMask = 0
};

group CSN1_BitTypes
{
type B1_Type   LH_B1_Type;
type B2_Type   LH_B2_Type;

} with { encode "LowHighRule3" }

// =============================================================================
// Structured Type Definition
// SI13 Rest Octets
// 3GPP TS 44.018 clause 10.5.2.37b
// The info element has a fixed length of 20 octets.
// -----------------------------------------------------------------------------
type record SI13RO {
  LH_B1_Type           mask,                  // the remainer of the fields are all not present if mask = L
  B3_Type              bCCH_CHANGE_MARK  optional,
  B4_Type              sI_CHANGE_FIELD  optional,
  B1_Type              sI3ChangeMask  optional,
  B2_Type              sI13_CHANGE_MARK  optional,      // not present if sI3ChangeMask = 0
  GPRSMobileAlloc      gPRS_MobileAllocation  optional, // not present if sI3ChangeMask = 0
  B1_Type              pbcchMask  optional,             // '0' -> no PBCCH
  O1_Type              rAC  optional,                   // present if pbcchMask = 0
  B1_Type              sPGC_CCCH_SUP  optional,         // present if pbcchMask = 0
  B3_Type              pRIORITY_ACCESS_THR  optional,   // present if pbcchMask = 0
  B2_Type              nETWORK_CONTROLl_ORDER  optional, // present if pbcchMask = 0
  GPRS_CellOptions     gPRS_CellOptions  optional,     // present if pbcchMask = 0
  GPRS_PowerControlParam gPRS_PowerControlParameters  optional, // present if pbcchMask = 0
  B4_Type              pSI1_REPEAT_PERIOD  optional,    // present if pbcchMask = 1
  PBCCH_Descr          pBCCH_Description  optional,     // present if pbcchMask = 1
  LH_B1_Type           r99Mask  optional,               // addition in R99
  B1_Type              sGSNR  optional,                 // present if r99Mask = H
  LH_B1_Type           r4Mask  optional,                // addition in R4
  B1_Type              sI_STATUS_IND  optional,         // present if r4Mask = H
  LH_B1_Type           r6Mask  optional,                // not present if r4Mask = L
  B1_Type              txPwrMaxCCHMask  optional,       // not present if r6Mask = L
  B5_Type              lbMSTxPwrMaxCCH  optional,       // not present if r6Mask = L or txPwrMaxCCHMask = 0
  B2_Type              sI2nSupport  optional            // not present if r6Mask = L
};



// =============================================================================
// Structured Type Definition
// 3GPP TS 44.060 clause 11.2.24; 3GPP TS 44.018 clause 10.5.2.37j;
// -----------------------------------------------------------------------------
type record DYNAMIC_ARFCN_MAPPING {
  B4_Type            gSM_Band,
  B10_Type           aRFCN_FIRST,
  B10_Type           bAND_OFFSET,
  B7_Type            aRFCN_RANGE
};

type record DYNAMIC_ARFCN_MAP_Descr {
  B1_Type                mask, // Ending repetition if = '0'
  DYNAMIC_ARFCN_MAPPING        instance optional// only present if mask = '1'
}

type record of DYNAMIC_ARFCN_MAP_Descr DYNAMIC_ARFCN_MAPPING_LIST;

// =============================================================================
// Structured Type Definition
// SI15 Rest Octets
// 3GPP TS 44.018 clause 10.5.2.37k
// The info element has a fixed length of 20 octets.
// -----------------------------------------------------------------------------
type record SI15RO {
  B2_Type              si15Index,
  B2_Type              si15Count,
  B4_Type              dm_CHANGE_MARK,
  DYNAMIC_ARFCN_MAPPING_LIST dynMappingList
};

// =============================================================================
// Structured Type Definition
// SI1 Rest Octets
// 3GPP TS 04.018 clause 10.5.2.32
// The info element has a fixed length of 1 octet.
// -----------------------------------------------------------------------------
type record SI1RO {
  LH_B1_Type           mask,
  B5_Type              nCH_Position  optional,          // not present if mask = L
  LH_B1_Type           bandIndicator  optional          // L= DCS1800; H=PCS1900
};

// =============================================================================
// Structured Type Definition
// SI2quater Rest Octets
// 3GPP TS 44.018 clause 10.5.2.33b
// The info element has a fixed length of 20 octets.
// -----------------------------------------------------------------------------
type record SI2quaterRO {  // @sic R5s100135 sic@
  B1_Type              bA_IND,
  B1_Type              bA_IND_3G,
  B1_Type              mP_CHANGE_MARK,
  B4_Type              sI2quater_INDEX,
  B4_Type              sI2quater_COUNT,
  B1_Type              measParamMask,
  MeasParamDescr       measParamDescription  optional,  // not present if measParamMask = 0
  B1_Type              gprsRTDMask,
  GPRS_RealTimeDiffDescr gPRS_RealTimeDiffDescr  optional, // not present if gprsRTDMask = 0
  B1_Type              gprsBSICMask,
  GPRS_BSIC_Descr      gPRS_BSIC_Description  optional, // not present if gprsBSICMask = 0
  B1_Type              gprsRepPrioMask,
  GPRS_REP_PRIORITY_Descr gPRS_REP_PRIORITY_Descr  optional, // not present if gprsRepPrioMask = 0
  B1_Type              gprsMeasParamMask,
  SI2quaterRO_GPRS_MeasParamDescr gPRS_MeasParamsDescr  optional, // not present if gprsMeasParamMask = 0
  B1_Type              ncMeasParamMask,
  NC_MeasParams        NC_Measurement_Parameters  optional, // not present if ncMeasParamMask = 0
  B1_Type              extnLengthMask,
  ExtLengthDescr       extensionLength  optional,       // not present if extnLengthMask = 0
  B1_Type              extnMask  optional,              // not present if extnLengthMask = 0
  B7_Type              numCells  optional,              // not present if extnLengthMask = 0 or extnMask = 0
  bitstring            cCNSupported  optional,          // not present if extnLengthMask = 0 or extnMask = 0
  B1_Type              neighCellMask,
  NeighCellDescr3G     neighCellDes3G  optional,       // not present if neighCellMask = 0
  B1_Type              measParam3GMask,
  SI2quaterRO_MeasParamDescr3G measurementParams3G  optional, // not present if measParam3GMask = 0
  B1_Type              gprsMeasParam3GMask,
  SI2quaterRO_GPRS_3G_MeasParamDescr gPRS_3G_MeasParamDescr  optional, // not present if gprsMeasParam3GMask = 0
  LH_B1_Type           rel5Mask,
  B1_Type              addMeasMask  optional,           // not present if rel5Mask = L
  AdditionalMeasParam3G addMeasParam3G  optional,  // not present if rel5Mask = L or addMeasMask = 0
  B1_Type              addMeasMask2  optional,          // not present if rel5Mask = L
  B1_Type              fddRepThres2Mask  optional,      // not present if rel5Mask = L or addMeasMask2 = 0
  B6_Type              fddRepThreshold2  optional,      // not present if rel5Mask = L, addMeasMask2 = 0 or fddRepThres2Mask = 0
  LH_B1_Type           rel6Mask  optional,              // not present if rel5Mask = L
  B1_Type              cCNActive  optional,              // not present if rel5Mask = L or rel6Mask = 0
  LH_B1_Type           rel7Mask,
  Rel7_700810Reporting report700810  optional,           // not present if rel7Mask = L
  LH_B1_Type           rel8Mask,
  B1_Type              priorEutranMask optional,         // not present if rel8Mask = L // @sic R5s100135 sic@
  B1_Type              scPriorMask    optional,          // not present if rel8Mask = L or priorEutranMask= 0
  B3_Type              geranPrior     optional,          // not present if rel8Mask = L or priorEutranMask or scPriorMask = 0
  B4_Type              threshPriorSearch optional,       // not present if rel8Mask = L or priorEutranMask or scPriorMask = 0
  B4_Type              threshGSMLow  optional,           // not present if rel8Mask = L or priorEutranMask or scPriorMask = 0 @sic R5s100135 sic@
  B2_Type              hPrior          optional,         // not present if rel8Mask = L or priorEutranMask or scPriorMask = 0
  B2_Type              tReselection    optional,          // not present if rel8Mask = L or priorEutranMask or scPriorMask = 0
  B1_Type              prior3GMask     optional,          // not present if rel8Mask = L
  B1_Type              utranStart     optional,          // not present if rel8Mask = L or prior3GMask = 0
  B1_Type              utranStop      optional,          // not present if rel8Mask = L or prior3GMask = 0
  Priority3GParams     prior3GParams  optional,          // not present if rel8Mask = L or prior3GMask = 0
  B1_Type              eutranMeasMask  optional,         // not present if rel8Mask = L
  EUTRANMeasParams_SI2 eutranMeasParams optional,        // not present if rel8Mask = L or eutranMeasMask = 0
  B1_Type              csg_3GMask      optional,         // not present if rel8Mask = L
  CSG_3G_Descr         csg_3GDescr     optional,        // not present if rel8Mask = L or csg_3GMask = 0
  B1_Type              eutran_CsgMask  optional,         // not present if rel8Mask = L
  EUTRAN_CSG_Descr     eutran_CsgDescr     optional        // not present if rel8Mask = L or eutran_CsgMask = 0
};

type record Rel7_700810Reporting {
  B1_Type           mask700,
  B3_Type           repOffset700   optional,  //  not present if mask 700 = 0
  B3_Type           repThres700    optional,  //  not present if mask 700 = 0
  B1_Type           mask810,
  B3_Type           repOffset810   optional,  //  not present if mask 810 = 0
  B3_Type           repThres810    optional  //  not present if mask 810 = 0
};

type record Priority3GParams {
  B1_Type           priorMask,
  B3_Type           defUtranPriority   optional, // not present if priorMask = 0
  B5_Type           defThreshUtran     optional, // not present if priorMask = 0
  B5_Type           defUtranQrxLvlMin  optional, // not present if priorMask = 0
  RptdUTRANPriorityParams rptdUtranPriorParams optional,
  B1_Type           endingRepetition             // always 0
};

type record of UTRANPriorityParams RptdUTRANPriorityParams;

type record UTRANPriorityParams {
  B1_Type           mask,     // always 1 if this IE is present
  RptdUTRANFreqIndex utranFreqIndex,
  B1_Type           endingRepetition,             // always 0
  B1_Type           priorMask,                   // @sic R5s100135 sic@
  B3_Type           utranPriority      optional, // not present if priorMask = 0 @sic R5s100135 sic@
  B5_Type           threshUtranHigh,
  B1_Type           lowMask,
  B5_Type           threshUtranLow     optional, // not present if lowMask = 0
  B1_Type           rxMask,
  B5_Type           utranQrxLvlMin     optional  // not present if rxMask = 0
};

type record of UTRANFreqIndex RptdUTRANFreqIndex;

type record UTRANFreqIndex {
  B1_Type           mask,     // always 1 if this IE is present
  B5_Type           freq
};

type record of EUTRANFreqIndex RptdEUTRANFreqIndex;

type record EUTRANFreqIndex {
  B1_Type           mask,     // always 1 if this IE is present
  B3_Type           freq
};

type record of EUTRANFreq RptdEUTRANFreq;

type record EUTRANFreq {
  B1_Type           mask,     // always 1 if this IE is present
  B16_Type           freq
};

type record EUTRANMeasParams_SI2 { // @sic R5s100135 sic@
  B1_Type          eutranCCNActive,
  B1_Type          eutranMask,
  EUTRANMeasParams eutranMeasParams    optional,  // not present if eutranMask = 0
  B1_Type          gprsEutranMeasMask,
  GPRS_EUTRANMeasParams gprsEutranMeasParams optional,        // not present if gprsEutranMeasMask = 0
  RptdEUTRANNeighCells neighCells,
  RptdEUTRANNotAllowedCells notAllowedCells,
  RptdTAMapping    pcidToTA
};

type record EUTRAN_CSG_Descr {
  record of EUTRAN_CSG_DescrList list,
  RptdEUTRANFreq freq
};

type record EUTRAN_CSG_DescrList {
  B1_Type     pciMask,
  EUTRANNotAllowedCell pciSplit  optional,  // only present if pciMask = 1
  RptdEUTRANFreqIndex index      optional  //  only present if pciMask = 1
};

type record of RptdEUTRANNeighCellsList RptdEUTRANNeighCells;

type record RptdEUTRANNeighCellsList {
B1_Type         prefix,
EUTRANNeighCell cell    optional  // only present if prefix = 1
};

type record EUTRANNeighCell {
  RptdEARFCN_BW  earfcnBW,
  B1_Type        pMask,
  B3_Type        priority     optional,  // notpresent if pMask = 0 @sic R5s100135 sic@
  B5_Type        threshHigh,
  B1_Type        lowMask,
  B5_Type        threshLow  optional,  // not present if lowMask = 0
  B1_Type        qMask,
  B5_Type        eutranQrxLevelMin  optional  // not present if qMask = 0
};

type record RptdTAMapping {
  B1_Type    prefix,
  TAMappingList list   optional  // only present if prefix = 1
};

type record of RptdEUTRANNotAllowedCells TAMappingList;

type record EARFCN_BWList{
  B1_Type       prefix,
  EARFCN_BW     item     optional  // only present if prefix = 1
};

type record of EARFCN_BWList RptdEARFCN_BW;

type record EARFCN_BW {
  B16_Type   earfcn,
  B1_Type    mask,
  B3_Type    measBW   optional  // only present if mask = 1
};

type record CSG_3G_Descr {
  record of CSG_3G_DescrList list,
  RptdCSG_UARFCN  rptdUARFCN
};

type record CSG_3G_DescrList {
  B1_Type         pscMask,
  RptdPCID        psc        optional, // only present if pscMask = 1
  RptdPCIDPattern pscPattern optional, // only present if pscMask = 1
  RptdUTRANFreqIndex freq    optional // only present if pscMask = 1
};

type record of CSG_UARFCNList RptdCSG_UARFCN;

type record CSG_UARFCNList {
  B1_Type      prefix,
  CSG_UARFCN   uarfcn   optional  // only present if prefix = 1
};

type record CSG_UARFCN {
  B1_Type   mask,
  B14_Type  fddUARFCN   optional,  // only present if mask = 0
  B14_Type  tddUARFCN   optional  // only present if mask = 1
};

type record of EUTRANNotAllowedCellList RptdEUTRANNotAllowedCells;

type record EUTRANNotAllowedCellList {
  B1_Type        prefix,
  EUTRANNotAllowedCell notAllowed  optional // only present if prefix = 1
}

type record EUTRANNotAllowedCell {
  RptdPCID    pcid,
  B1_Type     groupMask,
  B6_Type     bitmapGroup   optional,  // only present if groupMask = 1
  RptdPCIDPattern pcidPattern
};

type record of PCIDList RptdPCID;

type record PCIDList {
  B1_Type     mask,
  B9_Type     pcid  optional  // only present if mask = 1
};

type record of PCIDPatternList RptdPCIDPattern;

type record PCIDPatternList {
  B1_Type     prefix,
  PCIDPattern pcid  optional   // only present if prefix = 1
};

type record PCIDPattern {
  B3_Type    patternLength,
  bitstring  pcidPattern length (1..8),
  B1_Type    sense
};

type record EUTRANMeasParams {  // @sic R5s100135 sic@
  B1_Type          eutranStart,
  B1_Type          eutranStop,
  B2_Type          qSearchCInitial,
  B1_Type          eutranRepQuant,
  B1_Type          multiMask,
  B2_Type          eutranMultiratReporting  optional,  // not present if multiMask = 0
  B1_Type          reportOffsetMask,
  B1_Type          fddReportMask            optional,  // not present if reportOffsetMask = 1
  B3_Type          fddReportingThreshold    optional,  // not present if reportOffsetMask =1 or fddReportMask = 0
  B1_Type          fddReport2Mask            optional,  // not present if reportOffsetMask = 1
  B6_Type          fddReportingThreshold2    optional,  // not present if reportOffsetMask =1 or fddReportMask = 0 or fddReport2Mask =0
  B1_Type          tddReportMask            optional,  // not present if reportOffsetMask = 1 or fddReportMask = 0
  B3_Type          tddReportingThreshold    optional,  // not present if reportOffsetMask = 1 or tddReportMask = 0
  B1_Type          tddReport2Mask            optional,  // not present if reportOffsetMask = 1 or tddReportMask = 0
  B6_Type          tddReportingThreshold2    optional,  // not present if reportOffsetMask = 1 or tddReportMask = 0 or tddReport2Mask =0
  B1_Type          fddMeasReportMask            optional,  // not present if reportOffsetMask = 0
  B6_Type          fddMeasReportingThreshold    optional,  // not present if reportOffsetMask or fddMeasReportMask = 0
  B1_Type          fddMeasReport2Mask            optional,  // not present if reportOffsetMask = 0
  B6_Type          fddMeasReportingThreshold2    optional,  // not present if reportOffsetMask or fddMeasReportMask = 0 or fddMeasReport2Mask =0
  B1_Type          tddMeasReportMask            optional,  // not present if reportOffsetMask = 0 or fddMeasReportMask = 0
  B6_Type          tddMeasReportingThreshold    optional,  // not present if reportOffsetMask or tddMeasReportMask = 0
  B1_Type          tddMeasReport2Mask            optional,  // not present if reportOffsetMask = 0 or tddMeasReportMask = 0
  B6_Type          tddMeasReportingThreshold2    optional,  // not present if reportOffsetMask or tddMeasReportMask = 0 or tddMeasReport2Mask =0
  B1_Type          reportingGranularity        optional   // not present if reportOffsetMask = 0
};

type record GPRS_EUTRANMeasParams {
  B2_Type          qSearchP,
  B1_Type          eutranRepQuant,  // @sic R5s100135 sic@
  B1_Type          multiMask,
  B2_Type          eutranMultiratReporting  optional,  // not present if multiMask = 0
  B1_Type          fddReportMask,
  B3_Type          fddReportingThreshold    optional,  // not present if fddReportMask = 0
  B1_Type          fddReport2Mask            optional,  // not present if fddReportMask = 0
  B6_Type          fddReportingThreshold2    optional,  // not present if fddReportMask = 0 or fddReport2Mask =0
  B1_Type          tddReportMask            optional,  // not present if fddReportMask = 0
  B3_Type          tddReportingThreshold    optional,  // not present if tddReportMask = 0
  B1_Type          tddReport2Mask            optional,  // not present if tddReportMask = 0
  B6_Type          tddReportingThreshold2    optional  // not present if tddReportMask = 0 or tddReport2Mask =0
};
// =============================================================================
// Structured Type Definition
// Reference : 3GPP TS 44.018 clause 10.5.2.33b
// -----------------------------------------------------------------------------
type record SI2quaterRO_GPRS_3G_MeasParamDescr {
  B4_Type              qsearch_P,
  B1_Type              spare, // @sic R5s100135 sic@
  B1_Type              fDD_REP_QUANT_Mask,
  B1_Type              fDD_REP_QUANT  optional,         // not present if fDD_REP_QUANT_Mask = 0
  B2_Type              fDD_MULTIRAT_REPORTING  optional, // not present if fDD_REP_QUANT_Mask = 0
  B1_Type              fDD_ReportingMask,
  B3_Type              fDD_REPORTING_OFFSET  optional,  // not present if fDD_ReportingMask = 0
  B3_Type              fDD_REPORTING_THRESHOLD  optional, // not present if fDD_ReportingMask = 0
  B1_Type              tDD_MultiratReportingMask,
  B2_Type              tDD_MULTIRAT_REPORTING  optional, // not present if tDD_MultiratReportingMask = 0
  B1_Type              tDD_ReportingMask,
  B3_Type              tDD_REPORTING_OFFSET  optional,  // not present if tDD_ReportingMask = 0
  B3_Type              tDD_REPORTING_THRESHOLD  optional // not present if tDD_ReportingMask = 0
};

// =============================================================================
// Structured Type Definition
// Reference : 3GPP TS 44.018 clause 10.5.2.33b
// -----------------------------------------------------------------------------
type record SI2quaterRO_GPRS_MeasParamDescr {
  B1_Type              rEPORT_TYPE,
  B1_Type              rEPORTING_RATE,
  B1_Type              iNVALID_BSIC_REPORTING,
  B1_Type              multibandReportingMask,
  B2_Type              multibandReporting  optional,    // not present if multibandReportingMask = 0
  B1_Type              servingBandReportingMask,
  B2_Type              servingBandReporting  optional,  // not present if servingBandReportingMask = 0
  B2_Type              sCALE_ORD,
  B1_Type              mask900,
  B3_Type              rEPORTING_OFFSET_900  optional,  // not present if mask900 = 0
  B3_Type              rEPORTING_THRESHOLD_900  optional, // not present if mask900 = 0
  B1_Type              mask1800,
  B3_Type              rEPORTING_OFFSET_1800  optional, // not present if mask1800 = 0
  B3_Type              rEPORTING_THRESHOLD_1800  optional, // not present if mask1800 = 0
  B1_Type              mask400,
  B3_Type              rEPORTING_OFFSET_400  optional,  // not present if mask400 = 0
  B3_Type              rEPORTING_THRESHOLD_400  optional, // not present if mask400 = 0
  B1_Type              mask1900,
  B3_Type              rEPORTING_OFFSET_1900  optional, // not present if mask1900 = 0
  B3_Type              rEPORTING_THRESHOLD_1900  optional, // not present if mask1900 = 0
  B1_Type              mask850,
  B3_Type              rEPORTING_OFFSET_850  optional,  // not present if mask850 = 0
  B3_Type              rEPORTING_THRESHOLD_850  optional // not present if mask850 = 0
};

// =============================================================================
// Structured Type Definition
// 3G MEASUREMENT PARAMETERSl description in SI2quater rest octets
// -----------------------------------------------------------------------------
type record SI2quaterRO_MeasParamDescr3G {
  B4_Type              qsearch_I,
  B1_Type              qsearch_C_Initial,
  B1_Type              fDDMask,
  B4_Type              fDD_Qoffset  optional,           // not present if fDDMask = 0
  B1_Type              fDD_REP_QUANT  optional,         // not present if fDDMask = 0
  B2_Type              fDD_MULTIRAT_REPORTING  optional, // not present if fDDMask = 0
  B3_Type              fDD_Qmin  optional,              // not present if fDDMask = 0
  B1_Type              tDDMask,
  B4_Type              tDD_Qoffset  optional,           // not present if tDDMask = 0
  B2_Type              tDD_MULTIRAT_REPORTING  optional // not present if tDDMask = 0
};

// =============================================================================
// Structured Type Definition
// 3G MEASUREMENT PARAMETERSl description in SI2ter
// 3GPP TS 44.018 clause 10.5.2.33a
// -----------------------------------------------------------------------------
type record SI2terMeasParamDescr3G {
  B4_Type              qsearch_I,
  B1_Type              fDDMask,
  B4_Type              fDD_Qoffset  optional,           // not present if fDDMask = 0
  B3_Type              fDD_Qmin  optional,              // not present if fDDMask = 0
  B1_Type              tDDMask,
  B4_Type              tDD_Qoffset  optional            // not present if tDDMask = 0
};

// =============================================================================
// Structured Type Definition
// SI2ter Rest Octets
// 3GPP TS 44.018 clause 10.5.2.33a
// The info element has a fixed length of 4 octets.
// -----------------------------------------------------------------------------
type record SI2terRO {
  LH_B1_Type              mask,
  B1_Type              sI2ter_MP_CHANGE_MARK  optional, // not present if mask = L
  B1_Type              sI2ter_3G_CHANGE_MARK  optional, // not present if mask = L
  B3_Type              sI2ter_INDEX  optional,          // not present if mask = L
  B3_Type              sI2ter_COUNT  optional,          // not present if mask = L
  B1_Type              fDDMask  optional,               // not present if mask = L
  SI2terUTRAN_FDD_Descr uTRAN_FDD_Description  optional, // not present if mask = L or fDDMask = 0
  B1_Type              tDDMask  optional,               // not present if mask = L
  SI2terUTRAN_TDD_Descr uTRAN_TDD_Description  optional, // not present if mask=L or  tDDMask = 0
  B1_Type              measMask  optional,              // not present if mask = L
  SI2terMeasParamDescr3G measurementParams3G  optional, // not present if mask = L or measMask = 0
  LH_B1_Type              rel5Mask  optional,
  B1_Type              addMeasMask  optional,           // not present if mask = L or rel5Mask = L
  AdditionalMeasParam3G addMeasParam3G  optional   // not present if mask = L, rel5Mask = L or addMeasMask = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.33a
// -----------------------------------------------------------------------------
type record SI2terUTRAN_FDD_Descr {
  B2_Type              mask, // only valid value is now 01
  B14_Type               fDD_ARFCN,             // present if mask = 01
  B1_Type              bandwidthMask,
  B3_Type              bandwidthFDD  optional           // not present if bandwidthMask = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.33a
// -----------------------------------------------------------------------------
type record SI2terUTRAN_TDD_Descr {
  B2_Type              mask,  // only valid value now 01
  B14_Type             tDD_ARFCN,             // present if mask = 01
  B1_Type              bandwidthMask,
  B3_Type              bandwidthTDD  optional           // not present if bandwidthMask = 0
};

// =============================================================================
// Structured Type Definition
// SI3 Rest Octets
// 3GPP TS 44.018 clause 10.5.2.34
// The info element has a fixed length of 4 octets.
// -----------------------------------------------------------------------------
type record SI3RO {
  LH_B1_Type              cellSelectMask,        // Cell select parameter mask
  B1_Type              cbq  optional,                   // not present if cellSelectMask = L, Cell bar qualify
  B6_Type              cellReselectOffset  optional,    // not present if cellSelectMask = L
  B3_Type              temporaryOffset  optional,       // not present if cellSelectMask = L
  B5_Type              penaltyTime  optional,           // not present if cellSelectMask = L
  LH_B1_Type              powerOffsetMask,       // Power offset mask
  B2_Type              powerOffset  optional,           // not present if powerOffsetMask = L
  LH_B1_Type              sI2terIndicator,       // SI 2ter indicator L= no SI2ter
  LH_B1_Type              earlyClassMarkSendingControl, // L= forbidden, H= allowed
  LH_B1_Type              mask3,                 // mask bit for scheduling info
  B3_Type              schedulingWhere  optional,       // not present if mask3 = L
  LH_B1_Type              mask4,                 // mask bit for GPRS indicator
  B3_Type              rA_Colour  optional,             // not present if mask4 = L
  B1_Type              sI13Position  optional,          // not present if mask4 = L
  LH_B1_Type              earlyClassMarksendingRestriction3G, // L=no early 3G classmark sending
  LH_B1_Type              mask5,                 // mask bit for SI2quaterPosition
  B1_Type              sI2quaterPosition  optional,     // not present if mask5 = L
  B1_Type              SI13altPosition  optional      // only present if Iu supported in cell
};

// =============================================================================
// Structured Type Definition
// SI4 Rest Octets
// 3GPP TS 44.018 clause 10.5.2.35
// The info element has a length of 0 to 10 octets.
// -----------------------------------------------------------------------------
type record SI4RO {
  LH_B1_Type              cellSelectMask,        // Cell selection parameter mask
  B1_Type              cbq  optional,                   // not present if cellSelectMask = L, Cell bar qualify
  B6_Type              cellReselectOffset  optional,    // not present if cellSelectMask = L
  B3_Type              temporaryOffset  optional,       // not present if cellSelectMask = L
  B5_Type              penaltyTime  optional,           // not present if cellSelectMask = L
  LH_B1_Type              powerOffsetMask,       // Power offset mask
  B2_Type              powerOffset  optional,           // not present if powerOffsetMask = L
  LH_B1_Type              raColourMask,          // GPRS indicator
  B3_Type              rA_Colour  optional,             // not present if raColourMask = L
  B1_Type              sI13Position  optional,          // not present if raColourMask = L
  LH_B1_Type              breakMask  optional,
  LH_B1_Type              breakIndicator  optional,        // present if breakMask = L
  LH_B1_Type              lsaParamMask  optional,          // present if breakMask = H
  B3_Type              pRIO_THR  optional,              // not present if lsaParamMask = L or breakMask = L
  B3_Type              lSA_OFFSET  optional,            // not present if lsaParamMask = L or breakMask = L
  B1_Type              mccMask  optional,               // not present if breakMask = L orlSAParamMask = L
  B12_Type             mCC  optional,                   // not present if mccMask = 0 or breakMask = L orlSAParamMask = L
  B12_Type             mNC  optional,                   // not present if mccMask = 0 or breakMask = L or lSAParamMask= L
  LH_B1_Type              cellIDMask  optional,            // not present if breakMask = L
  B16_Type             cellIdentity  optional,          // not present if cellIDMask = L or breakMask = L
  LH_B1_Type              lsaMask  optional,               // not present if breakMask = L
  LSA_ID_Info_List     lsaIdInfo_List  optional,   // not present if lsaMask = L or breakMask = L
  LH_B1_Type              cBQ3Mask  optional,              // not present if breakMask = L
  B2_Type              cBQ3  optional,                  // not present if breakMask = L or cBQ3Mask = L
  B1_Type              si13altMask  optional,           // not present if breakMask = L or cBQ3Mask = L
  B1_Type              si13altPosition  optional        // not present if breakMask = L or cBQ3Mask = L or si13altMask = 0
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.35
// -----------------------------------------------------------------------------
type record SI4RO_LSA_ID_Info {
  B1_Type              lSA_ID_Mask1,
  B24_Type             lSA_ID1  optional,               // not present if lSA_ID_Mask1 = 1
  B10_Type             ShortLSA_ID1  optional,          // not present if lSA_ID_Mask1 = 0
  B1_Type            endingRepetition  optional         // if = 0 indicates the end of the structure,
                                                        // if = 1, this structure will be repeated
};

type record of SI4RO_LSA_ID_Info LSA_ID_Info_List;

// =============================================================================
// Structured Type Definition
// SI6 Rest Octets
// 3GPP TS 44.018 clause 10.5.2.35a
// The info element has a fixed length of 7 octets.
// -----------------------------------------------------------------------------
type record SI6RO {
  LH_B1_Type           pchNchMask,            // PCH, NCH info mask
  B1_Type              pagingChRestructuring  optional, // not present if pchNchMask = L
  B2_Type              nLN_SACCH  optional,             // not present if pchNchMask = L
  B1_Type              prioMask  optional,              // not present if pchNchMask = L
  B3_Type              callPriority  optional,          // not present if pchNchMask = L or prioMask = 0
  B1_Type              nLN_Status  optional,            // not present if pchNchMask = L
  LH_B1_Type           inbandMask,
  B1_Type              inbandNotifications  optional,   // not present if inbandMask = L
  B1_Type              inbandPagings  optional,         // not present if inbandMask = L
  LH_B1_Type           dTM_Supported,
  B8_Type              rAC  optional,                   // not present if dTM_Supported = L
  B3_Type              mAX_LAPDm  optional,             // not present if dTM_Supported = L
  LH_B1_Type           bandIndicator,         // L = 1800 band supported, H = 1900 band supported
  LH_B1_Type           txPwrMask,
  B5_Type              gPRS_MS_TXPWT_MAX_CCH  optional, // not present if txPwrMask = L
  LH_B1_Type           mBMSMask,
  B1_Type              dedModeMBMSNoteSupport  optional, // not present if mBMSMask = L
  B1_Type              mNCISupport  optional,            // not present if mBMSMask = L
  LH_B1_Type           r7Mask,
  B1_Type              amrConfigMask       optional,     // not present if r7Mask = L
  B4_Type              amrConfig           optional      // not present if r7Mask= L or amrConfigMask = 0
};

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION TYPE1  ntw -> ue/ms
// 3 GPP TS 44.018 clause 9.1.31
// The message has an L2 pseudo length of 21 octets and a total length of 23 octets.
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE1 {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  CellChDescr          cellChDescr,           // cell channel description  M
  RACHControlParam     rACHControlParam,     // rach control parameters    M
  SI1RO                sI1RO                  // SI1 rest octets      M
}with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION TYPE13  ntw -> ue/ms
// 3GPP TS 44.018 clause  9.1.43a
// The message has an L2 pseudo length of 0 octets and a total length of 23 octets.
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE13 {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  SI13RO          si13roct               // SI3 rest octets      M
                                                   // OCTETSTRING [20]
}with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION TYPE15  ntw -> ue/ms
// 3GPP TS 44.018 clause  9.1.43j
// The message has an L2 pseudo length of 0 octets and a total length of 23 octets.
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE15 {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  SI15RO          si15roct               // SI15 rest octets      M
                                                   // OCTETSTRING [20]
}
with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION TYPE2  ntw -> ue/ms
// 3GPP TS 44.018 clause 9.1.32
// The message has an L2 pseudo length of 22 octets and a total length of 23 octets.
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE2 {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M                                                   // OCTETSTRING [1]
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  NeighCellDescr  neighBCCHFreqList,     // bcch frequency list of neighbour cells  M
  NCCPermitted    nCCPermitted,          // ncc permitted    M
  RACHControlParam rACHControlParam      // rach control parameters    M
}with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION TYPE2bis  ntw -> ue/ms
// 3GPP TS 44.018 clause 9.1.33
// This PDU type is used both for SYSINFO2bis.
// The 2bis message has an L2 pseudo length of 21 octets and a total length of 23 octets.
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE2bis {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M                                                   // BITSTRING [4]
  B8_Type              msgType,               // message type   M
  NeighCellDescr  extNeighBCCHFreqList,  // extended bcch frequency list of neighbour cells  M
                                                   // OCTETSTRING [16]
  RACHControlParam rACHControlParam      // rach control parameters    M
                                                   // OCTETSTRING [3]
}with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION 2quater ntw -> ue/ms
// 3GPP TS 44.018 clause 9.1.34a
// The 2ter message has an L2 pseudo length of 1 octet and a total length of 23 octets.
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE2quater {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  SI2quaterRO     sI2quaterRO            // SI2quater rest octets
                                                   // OCTETSTRING [20]
}with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION 2ter ntw -> ue/ms
// 3GPP TS 44.018 clause 9.1.34
// The 2ter message has an L2 pseudo length of 18 octets and a total length of 23 octets.
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE2ter {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  NeighCellDescr2 extNeighBCCHFreqList,  // extended bcch frequency list of neighbour cells M
  SI2terRO        sI2terRO               // SI2ter rest octets
}with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// Structured Type Definition
// Cell selection parameters
// 3GPP TS 44.018 clause 10.5.2.4
// -----------------------------------------------------------------------------
type record CellSelParam {
//  IEI8_Type           iei  optional,                   // iei never used
  B3_Type              cellReselHysteresis,   // cell reselected hysteresis
  B5_Type              mS_TXPWR_MAX_CCH,      // MS maximum TX power for CCH
  B1_Type              acs,                   // additional reselect parameter indicator
  B1_Type              neci,                  // half rate support
  B6_Type              rXLEV_ACCESS_MIN       // MS minimum received signal level
};

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION TYPE3  ntw -> ue/ms
// 3GPP TS 44.018 clause  9.1.35
// The message has an L2 pseudo length of 18 octets and a total length of 23 octets.
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE3 {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  O2_Type              celIId,                // cell identity     M
  LocAreaId     lai,                   // location area identification  M
  ControlChDescr  controlChDescr,        // control channel description   M
  CellOptionBCCH  cellOption,            // cell options/BCCH   M
  CellSelParam    cellSelParam,          // cell selection parameters   M
  RACHControlParam rACHControlParam,     // rach control parameters    M
  SI3RO           sI3RO                    // SI3 rest octets      M
}with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// Structured Type Definition
// Channel description
// 3GPP TS 44.018 clause 10.5.2.5 (and 10.5.2.5a as the type definition is the same)
// -----------------------------------------------------------------------------
type record ChannelDescr {
  IEI8_Type           iei  optional,                   // '01100100'B
  B5_Type              cht_schn,              // channel type and TDMA offset
  B3_Type              tn,                    // timeslot number
  B3_Type              tsc,                   // training sequence code
  B1_Type              hch,                   // hch = 1 indicating hopping channel
  B6_Type              maio  optional,                  // mobile allocation index offset - hopping
  B6_Type              hsn  optional,                   // hopping sequence number - hopping
  B2_Type              spr  optional,                   // '00'B - non hopping
  B10_Type             arfcn  optional                  // absolute RF channel number - non hopping
};

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION TYPE4  ntw -> ue/ms
// 3GPP TS 44.018 clause 9.1.36
// The message has a total length of 23 octets. the L2 pseudo length is the sum of all information elements except SI 4 Rest Octets and L2 pseudo length
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE4 {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  LocAreaId     lai,                   // location area identification  M
                                                   // OCTETSTRING [5]
  CellSelParam    cellSelParam,          // cell selection parameters   M
                                                   // OCTETSTRING [2]
  RACHControlParam rACHControlParam,     // rach control parameters    M
                                                   // OCTETSTRING [3]
  ChannelDescr    cbchd  optional,                 // cbch channel description       O   OCTETSTRING [4]
  MobileAlloc     cbchmobileAlloc  optional,       // mobile allocation    C
                                                   // OCTETSTRING [3..6]
  SI4RO           si4roct  optional                // SI4 rest octets      M
                                                   // OCTETSTRING [0..10]
}with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION TYPE5  ntw -> ue/ms
// 3GPP TS 44.018 clause 9.1.37
// The message has an L2 pseudo length of 18 octets
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE5 {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  NeighCellDescr  bCCHFreqList           // bcch frequency list  M
                                                   // OCTETSTRING [16]
}with { encode "SACCHSysInfoSparePadding Rule4"}

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION TYPE5bis  ntw -> ue/ms
// 3GPP TS 44.018 clause 9.1.38
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE5bis {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  NeighCellDescr  extNeighBCCHFreqList   // extended bcch frequency list of neighbour cells  M
                                                   // OCTETSTRING [16]
}with { encode "SACCHSysInfoSparePadding Rule4"}

// =============================================================================
// PDU Type Definition
// RR SYSTEM INFORMATION TYPE6  ntw -> ue/ms
// 3GPP TS 44.018,  9.1.40
// The message has an L2 pseudo length of 11 octets and a total length of 23 octets.
// -----------------------------------------------------------------------------
type record SYSTEMINFORMATIONTYPE6 {
  O1_Type              l2PseudoLength,        // L2 pseudo length      M
  B4_Type              skipIndicator,         // skip indicator   M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  B8_Type              msgType,               // message type   M
  O2_Type              ci,                    // cell identity     M
  LocAreaId     lai,                   // location area identification  M
                                                   // OCTETSTRING [5]
  CellOptionSACCH co,                    // cell options /SACCH  M ,
                                                   // OCTETSTRING [1]
  NCCPermitted    nCCPermitted,          // ncc permitted    M
                                                   // OCTETSTRING [1]
  SI6RO           si6roct                // SI6 Rest Octets
                                                   // OCTETSTRING [7]
} with { encode "SACCHSysInfoSparePadding Rule4"}

type union         SysInfoType
{
  SYSTEMINFORMATIONTYPE1        si1,
  SYSTEMINFORMATIONTYPE2        si2,
  SYSTEMINFORMATIONTYPE3        si3,
  SYSTEMINFORMATIONTYPE4        si4,
  SYSTEMINFORMATIONTYPE5        si5,
  SYSTEMINFORMATIONTYPE6        si6,
  SYSTEMINFORMATIONTYPE13        si13,
  SYSTEMINFORMATIONTYPE15        si15,
  SYSTEMINFORMATIONTYPE2bis si2bis,
  SYSTEMINFORMATIONTYPE2ter si2ter,
  SYSTEMINFORMATIONTYPE2quater si2quater,
  SYSTEMINFORMATIONTYPE5bis si5bis
};

// =============================================================================
// Structured Type Definition
// parameters for common control channels
// -----------------------------------------------------------------------------
type record CCCH_Info {
  B3_Type              bS_PA_MFRMS,           // the number of 51-multiframes between transmission of paging messages. Definition see 3GPP TS 44.018 section 10.5.2.11
  B3_Type              bS_AG_BLKS_RES         // the number of blocks on each common control channel reserved for access grant messages. Definition see 3GPP TS 44.018 section 10.5.2.11
};

// =============================================================================
// Structured Type Definition
// Channel mode
// 3GPP TS 44.018 clause 10.5.2.6
// 0 0 0 0 0 0 0 0   signalling only
// 0 0 0 0 0 0 0 1   speech full rate or half rate version 1
// 0 0 1 0 0 0 0 1   speech full rate or half rate version 2
// 0 1 0 0 0 0 0 1   speech full rate or half rate version 3
// 0 1 1 0 0 0 0 1   data, 43.5 kbit/s (downlink)+14.5 kbps (uplink)
// 0 1 1 0 0 0 1 0   data, 29.0 kbit/s (downlink)+14.5 kbps (uplink)
// 0 1 1 0 0 1 0 0   data, 43.5 kbit/s (downlink)+29.0 kbps (uplink)
// 0 1 1 0 0 1 1 1   data, 14.5 kbit/s (downlink)+43.5 kbps (uplink)
// 0 1 1 0 0 1 0 1   data, 14.5 kbit/s (downlink)+29.0 kbps (uplink)
// 0 1 1 0 0 1 1 0   data, 29.0 kbit/s (downlink)+43.5 kbps (uplink)
// 0 0 1 0 0 1 1 1   data, 43.5 kbit/s radio interface rate
// 0 1 1 0 0 0 1 1   data, 32.0 kbit/s radio interface rate
// 0 1 0 0 0 0 1 1   data, 29.0 kbit/s radio interface rate
// 0 0 0 0 1 1 1 1   data, 14.5 kbit/s radio interface rate
// 0 0 0 0 0 0 1 1   data, 12.0 kbit/s radio interface rate
// 0 0 0 0 1 0 1 1   data, 6.0 kbit/s radio interface rate
// 0 0 0 1 0 0 1 1   data, 3.6 kbit/s radio interface rate
// -----------------------------------------------------------------------------
type record ChMode {
  IEI8_Type           iei  optional,                   // '01100011'B
  B8_Type              mode
};
// =============================================================================
// Structured Type Definition
// parameters for individual channel
// -----------------------------------------------------------------------------
type record ChannelSpecificInfo {
  DedCH_Info      dedCH_Info  optional,            // parameters for dedicated channel. valid for combinations: 1, 2, 3, 5, 7, 8, 9, 10
  CCCH_Info       cCCH_Info  optional             // parameters for common control channels: PCH, SCH, ... valid for combinations: 4, 5, 6
};

// =============================================================================
// Structured Type Definition
// Cipher mode setting
// 3GPP TS 44.018 clause 10.5.2.9
// -----------------------------------------------------------------------------
type record CipherModeSetting {
  IEI4_Type           iei  optional,                   // '1001'B
  B3_Type              algId,                 // algorithm identifier
  B1_Type              startingCiph           // starting ciphering, 1 = start
};
// =============================================================================
// Structured Type Definition
// parameters for dedicated channel
// In addition to ciphering algorithm the cipherMode specifies the initial ciphering mode of the physical channel in both transmission and receiving direction.by startingCiph bit. During ciphering mode setting procedure the ciphering mode of receiving direction can be changed by G_CL1_CipheringControl_REQ.
// -----------------------------------------------------------------------------
type record DedCH_Info {
  ChMode          chMode,                // channel mode see 3GPP TS 44.018 section 10.5.2.6
  CipherModeSetting cipherMode,          // cipher mode setting see 3GPP TS 44.018 section 10.5.2.9
  B64_Type             cipherKey,
  B5_Type              powerLevel,            // Initial MS uplink transmission power level. This value is used in the L1 header of SACCH.
  B7_Type              timingAdvance          // Initial timing advance. This value is used in the L1 header of SACCH.This field shall be set to the same value as in timingAdvance of G_CL1_CreateCell_REQ.
};
// =============================================================================
// Structured Type Definition
// The uSF_TNx field is not applicable when tNx = FALSE.
// -----------------------------------------------------------------------------
type record DynamicAllocation {
  B1_Type              extendedAlloc,         // 0 - dynamic allocation; 1 - extended dynamic allocation
  B1_Type              uSFGranularity,        // 0 - one block; 1 - four blocks
  PhysicalChId    physicalChId  ,          // Single PDCH or multislot-configured PDCHs
  boolean         tN0,                   // TRUE - time slot 0 is allocated; FALSE -- not allocated
  B3_Type         uSF_TN0 optional,               // USF value for slot 0
  boolean         tN1,                   // TRUE - time slot 1 is allocated; FALSE -- not allocated
  B3_Type         uSF_TN1 optional,               // USF value for slot 1
  boolean         tN2,                   // TRUE - time slot 2 is allocated; FALSE -- not allocated
  B3_Type         uSF_TN2 optional,               // USF value for slot 2
  boolean         tN3,                   // TRUE - time slot 3 is allocated; FALSE -- not allocated
  B3_Type         uSF_TN3 optional,               // USF value for slot 3
  boolean         tN4,                   // TRUE - time slot 4 is allocated; FALSE -- not allocated
  B3_Type         uSF_TN4 optional,               // USF value for slot 4
  boolean         tN5,                   // TRUE - time slot 5 is allocated; FALSE -- not allocated
  B3_Type         uSF_TN5 optional,               // USF value for slot 5
  boolean         tN6,                   // TRUE - time slot 6 is allocated; FALSE -- not allocated
  B3_Type         uSF_TN6 optional,               // USF value for slot 6
  boolean         tN7,                   // TRUE - time slot 7 is allocated; FALSE -- not allocated
  B3_Type         uSF_TN7 optional                // USF value for slot 7
};
// =============================================================================
// Structured Type Definition
// Parameters for Description of basic physical channel in frequency domain.
// macLength is the length of mac field = (NF div 8) + 1.  NF is the number of frequencies in the cell allocation.
// mac i : mobile allocation RF channel i, i = 1, 2,..., NF. The mac i bit indicates whether or not the mobile allocation frequency list includes the  i'th frequency in the cell allocation frequency list. In the cell allocation frequency list the absolute RF channel numbers are placed in increasing order of ARFCN, except that ARFCN 0, if included in the set, is put in the last position in the list. From I =1, 2,?? NF, for a RF channel belonging to the mobile allocation the mac i bit is coded with a "1"; for  a  RF  channel  not  belonging  to  the  mobile allocation  the  mac i bit is coded with a "0". If  NF mod 8 <> 0 then bits from NF to 8*macLength must be coded with a "0" in each.
// -----------------------------------------------------------------------------
type record FreqInfo {
  B1_Type              h,                     // h='1'B: hopping channel; h='0'B: non-hopping channel
  B3_Type              spr,                   // '000'B
  B2_Type              spr1  optional,                  // '00'B, if h = '0'B, otherwise OMIT
  B6_Type              maio  optional,                  // mobile allocation index offset  if h = '1'B, otherwise OMIT
  bitstring       hsn length(6)  optional,         // hopping sequence number  if h = '1'B, otherwise OMIT
  bitstring       arfcn length(10)  optional,      // absolute RF channel number if h = '0'B, otherwise OMIT
  FreqListNoIEI   hoppingFreqList  optional        // hopping frequency list if h='1'B, otherwise OMIT.
                                                   // the definition see 3GPP TS 44.018 section 10.5.2.13
};
// =============================================================================
// Structured Type Definition
// Frequency list without IEI
// GSM 44.018, 10.5.2.13
// -----------------------------------------------------------------------------
type record FreqListNoIEI {
  O1_Type         ielength  optional,            // OCTETSTRING [1]
  octetstring     fl                       // list of the absolute radio frequency channel numbers
};

// =============================================================================
// Structured Type Definition
// Frequency short list
// GSM 44.018, 10.5.2.14
// -----------------------------------------------------------------------------
type record FreqListShort {
  O1_Type        iei,  // '00000010'B
  O9_Type        fl    // list of the absolute radio frequency channel numbers
};

// =============================================================================
// Structured Type Definition
// 3GPP TS 44.018 clause 10.5.2.75 @sic R5s100135 sic@
// -----------------------------------------------------------------------------
type record IndividualPriorities {
  IEI8_Type         iei                   optional, /* present in case of TLV; omit in case of LV */
  Type4Length_Type  iel                   optional, /* present in case of LV or TLV; omit in case of V */
  B1_Type           deleteAllMask,
  B3_Type           geran_Priority        optional,        // not present if servCellMask = 0
  B1_Type           g3Mask,
  IndividualUTRANPriorityParams g3Params  optional,  // not present if g3Mask = 0
  B1_Type           eutranMask,
  IndividualEUTRANPriorityParams eutranParams optional,  // not present if eutranMask = 0
  B1_Type           durationMask,
  B3_Type           t3230TimeoutValue     optional  // not present if durationMask = 0
};

type record IndividualUTRANPriorityParams {
  B1_Type           defUTRANPriorMask,
  B3_Type           defUTRANPriority optional,      // not present if defUTRANPriorMask = 0
  RptdUTRANParams   rptdIndivPriority optional,     //
  B1_Type           endingRepetition                // always 0
};

type record of IndividualUTRANParams RptdUTRANParams;

type record IndividualUTRANParams {
  B1_Type            Rptmask,                       // always 1 if this IE is present
  RptdUtranFreq      rptdUtranFreq  optional,
  B1_Type            utranFreqEndingRepetition,     // always 0
  B3_Type            utranPriority
};

type record of UtranFreq RptdUtranFreq;

type record UtranFreq {
  B1_Type            Rptmask,                       // always 1 if this IE is present
  B14_Type           utranFreq
};

type record of IndividualEUTRANParams RptdEUTRANParams;

type record IndividualEUTRANParams {
  B1_Type            Rptmask,                       // always 1 if this IE is present
  RptdEUTRANFreq     rptdEutranFreq  optional,
  B1_Type            eutranFreqEndingRepetition,     // always 0
  B3_Type            eutranPriority
};

type record IndividualEUTRANPriorityParams { // sic R5s100135 sic@
  B1_Type            defEutranMask,
  B3_Type            defaultEutranPriority optional, // not present if defEutranMask = 0
  RptdEUTRANParams   rptdEutranParams  optional,
  B1_Type            eutranEndingRepetition     // always 0
};

// =============================================================================
// Structured Type Definition
// Layer 1 Header of SACCH
// 3GPP TS 44.004 clause 7.2
// -----------------------------------------------------------------------------
type record L1Header {
  B3_Type              spr1,                  // spare bits
  B5_Type              mspwrlvl,              // actual MS power level
  B1_Type              spr2,                  // spare bit
  B7_Type              ta                      // actual timing advance
};
// =============================================================================
// Structured Type Definition
// used in multi-slot configuration
// -----------------------------------------------------------------------------
type record MultiSlotAllocation {
  boolean         tN0,                   // TRUE -- time slot 0 allocated; FALSE -- not allocated
  ChannelCombination channelCombination0, // Channel Combination for time slot 0; not applicable if tN0 = FALSE
  boolean         tN1,                   // TRUE -- time slot 1 allocated; FALSE -- not allocated
  ChannelCombination channelCombination1, // Channel Combination for time slot 1; not applicable if tN1 = FALSE
  boolean         tN2,                   // TRUE -- time slot 2 allocated; FALSE -- not allocated
  ChannelCombination channelCombination2, // Channel Combination for time slot 2; not applicable if tN2 = FALSE
  boolean         tN3,                   // TRUE -- time slot 3 allocated; FALSE -- not allocated
  ChannelCombination channelCombination3, // Channel Combination for time slot 3; not applicable if tN3 = FALSE
  boolean         tN4,                   // TRUE -- time slot 4 allocated; FALSE -- not allocated
  ChannelCombination channelCombination4, // Channel Combination for time slot 4; not applicable if tN4 = FALSE
  boolean         tN5,                   // TRUE -- time slot 5 allocated; FALSE -- not allocated
  ChannelCombination channelCombination5, // Channel Combination for time slot 5; not applicable if tN5 = FALSE
  boolean         tN6,                   // TRUE -- time slot 6 allocated; FALSE -- not allocated
  ChannelCombination channelCombination6, // Channel Combination for time slot 6; not applicable if tN6 = FALSE
  boolean         tN7,                   // TRUE -- time slot 7 allocated; FALSE -- not allocated
  ChannelCombination channelCombination7 // Channel Combination for time slot 7; not applicable if tN7 = FALSE
};

// =============================================================================
// Structured Type Definition
// The reduced frame number corresponding to the absolute frame number (FN) modulo 42432.
// see 3Gpp TS 44.018 section 10.5.2.38. The reduced frame number, FN modulo 42432 can be calculated in the fowllowing formula: 51 * ((t3 - t2) mod 26) + t3 + 1326 * t1_.
// -----------------------------------------------------------------------------
type record RFN {
  B5_Type              t1_,                   // (FN div 1326) mod 32
  B6_Type              t3,                    // FN mod 51
  B5_Type              t2                     // FN mod 26
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record TalkerIdentity {
  IEI8_Type                   iei                   optional, /* present in case of TLV; omit in case of LV */
  Type4Length_Type            iel                   optional, /* present in case of LV or TLV; omit in case of V */
  B5_Type                     spare,
  B3_Type                     fillerBits,
  octetstring                 talkerIdentityField
};

// =============================================================================
// Structured Type Definition
// -----------------------------------------------------------------------------
type record TalkerPriorityStatus {
  IEI8_Type                   iei                   optional, /* present in case of TLV; omit in case of LV */
  Type4Length_Type            iel                   optional, /* present in case of LV or TLV; omit in case of V */
  B1_Type                     es,
  B3_Type                     spare,
  B1_Type                     uai,
  B3_Type                     priority
};

// =============================================================================
// Structured Type Definition
// used for down link and up link TBF
// -----------------------------------------------------------------------------
type record TimeSlotAllocation {
  PhysicalChId    physicalChId,          // Single PDCH or multi-slot configured PDCHs
  boolean         tN0,                   // TRUE - time slot 0 is allocated; FALSE -- not allocated
  boolean         tN1,                   // TRUE - time slot 1 is allocated; FALSE -- not allocated
  boolean         tN2,                   // TRUE - time slot 2 is allocated; FALSE -- not allocated
  boolean         tN3,                   // TRUE - time slot 3 is allocated; FALSE -- not allocated
  boolean         tN4,                   // TRUE - time slot 4 is allocated; FALSE -- not allocated
  boolean         tN5,                   // TRUE - time slot 5 is allocated; FALSE -- not allocated
  boolean         tN6,                   // TRUE - time slot 6 is allocated; FALSE -- not allocated
  boolean         tN7                    // TRUE - time slot 7 is allocated; FALSE -- not allocated
};

group PDUTypes
{
// =============================================================================
// PDU Type Definition
// RR ASSSIGNMENT COMMAND  ntw -> ue/ms
// 3GPP TS 44.018 claus 9.1.2
// -----------------------------------------------------------------------------
type record ASSIGNMENTCOMMAND {
  B4_Type              skipIndicator,         // skip indicator  M
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator   M
  MessageType          msgType,               // message type   M
  ChannelDescr   ch1Descr_at,           // description of the 1st channel, after time      M   OCTETSTRING [3]
  PowerCommand    powerCmd,              // power command   M OCTETSTRING [1] without IEI
  FreqList        freqList_at  optional,           // frequency list, after time  C OCTETSTRING [4..132]
  CellChDescr     cellChDescr  optional,           // cell channel description      O OCTETSTRING [17]
  MultislotAlloc  multiSlotConfig  optional,       // multislot allocation     C OCTETSTRING [3..12]
  ChMode          ch1Mode  optional,               // mode of the 1st channel (channel set 1)  O OCTETSTRING [2]
  ChMode          channelSet2Mode  optional,       // mode of channel set 2  O TV [2]
  ChMode          channelSet3Mode  optional,       // mode of channel set 3  O TV [2]
  ChMode          channelSet4mode  optional,       // mode of channel set 4  O TV [2]
  ChMode          channelSet5mode  optional,       // mode of channel set 5  O TV [2]
  ChMode          channelSet6mode  optional,       // mode of channel set 6  O TV [2]
  ChMode          channelSet7mode  optional,       // mode of channel set 7  O TV [2]
  ChMode          channelSet8mode  optional,       // mode of channel set 8  O TV [2]
  ChannelDescr    ch2Descr_at  optional,           // description of the 2nd channel, after time O TV [4]
  ChMode2         ch2Mode  optional,               // mode 2 of the 2nd channel   O TV [2]
  MobileAlloc     mobileAlloc_at  optional,        // mobile allocation after time    C TLV [3..10]
  StartingTime    startingTime  optional,          // starting time  O TV [3]
  FreqList        freqList_bt  optional,           // frequency list, before time  C TLV [4..132]
  ChannelDescr    ch1Descr_bt  optional,           // description of the 1st channel, before time      O   TV [4]
  ChannelDescr    ch2Descr_bt  optional,           // description of the 2nd channel, before time      O   TV [4]
  FreqChannelSeq  frqchs_bt  optional,             // frequency channel sequence before time      C   TV [10]
  MobileAlloc     mobileAlloc_bt  optional,        // mobile allocation before time    C TLV [3..10]
  CipherModeSetting cphms  optional,               // cipher mode setting        O TV [1]
  VGCS_TargetMode vGCS_TargetMode  optional,       // VGCS target mode Indication O TLV [3]
  MultiRateConfig mltiRateConfig  optional,        // multiRate configuration  O TLV [4..8]
  VGCSCiphParam   vGCS_CipherParams optional      // VGCS ciphering parameters O TLV [3-15]
};

// =============================================================================
// PDU Type Definition
// RR ASSSIGNMENT  COMPLETE  ue/ms -> ntw
// 3GPP TS 44.018 clause 9.1.3
// -----------------------------------------------------------------------------
type record ASSIGNMENTCOMPLETE {
  B4_Type              skipIndicator,         // skip indicator
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator
  MessageType          msgType,               // message type
  RR_Cause        rRCau                  // RR cause without IEI
};

// =============================================================================
// PDU Type Definition
// RR ASSSIGNMENT  FAILURE ue/ms -> ntw
// 3GPP TS 44.018 clause 9.1.4
// -----------------------------------------------------------------------------
type record ASSIGNMENTFAILURE {
  B4_Type              skipIndicator,         // skip indicator
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator
  MessageType          msgType,               // message type
  RR_Cause        rRCau                  // RR cause without IEI
};

// =============================================================================
// PDU Type Definition
// RR CHANNEL RELEASE  ntw -> ue/ms
// 3GPP TS 44.018 clause 9.1.7
// -----------------------------------------------------------------------------
type record CHANNELRELEASE {
  B4_Type         skipIndicator,         // skip indicator
  B4_Type         rRProtocolDiscriminator, // RR protocol discriminator
  MessageType     msgType,               // message type
  RR_Cause        rRCau,                 // RR cuase
  BA_Range        bA_Range  optional,              // BA range  O OCTETSTRING minimum 6 octets no up limit
  GroupChannelDescr groupChannelDescr  optional,   // group channel description O OCTETSTRING[4..13]
  GroupCipherKey  groupCipherKey  optional,        // group cipher key number  C OCTETSTRING[1]
  GPRS_Resumption gPRS_Resumption  optional,       // GPRS resumptioon  O OCTETSTRING[1]
  BA_ListPref     bA_ListPref  optional,           // BA list pref   O OCTETSTRING at least 3 octets no up limit
  UTRAN_FreqList  uTRAN_FreqList  optional,        // UTRAN frequency list  O OCTETSTRING[3..
  CellChDescr     cellChannelDescr  optional,      // Cell Channel Descr O OCTETSTRING [17]
  CellSelInd      cellSelInd  optional,            // CellSelection indicator after release of all TCH and SDCCH O OCTETSTRING [4..]
  EnhDTMCSRelInd  enhDTMCSRelInd  optional,        // Enhanced DTM CS Release Indication O OCTETSTRING [1]
  VGCSCiphParam   vGCSCiphParam  optional,         // VGCS Ciphering Params O OCTETSTRING [3-15]
  GroupChannelDescr2 grpChDescr2  optional,        // Group Channel Descr 2 O OCTETSTRING [13]
  TalkerIdentity  talkerId optional,               // Talker Id O TLV [3-20]
  TalkerPriorityStatus talkerPriorityStatus optional, // Talker Priority Status O TLV [3]
  VGCS_AMRConfig  vGCS_AMRConfig optional,         // VGCS AMR Config O TLV [3]
  IndividualPriorities individPrior optional       // Individual Priorities O TLV [3-?]
};

// =============================================================================
// PDU Type Definition
// RR CHANNEL REQUEST  ue/ms -> ntw
// 3GPP TS 44.08 clause  9.1.8
// -----------------------------------------------------------------------------
type record CHANNELREQUEST {
  B8_Type              estCauRandomRef        // establishment cause / random reference   M
};

// =============================================================================
// PDU Type Definition
// RR CIPHERING MODE COMMAND  ntw -> ue/ms
// 3GPP TS 44.018 clause  9.1.9
// -----------------------------------------------------------------------------
type record CIPHERINGMODECOMMAND {
  B4_Type              skipIndicator,         // skip indicator
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator
  MessageType          msgType,               // message type
  CipherResponse  cipherResponse,        // cipher response
  CipherModeSetting cipherModeSetting    // cipher mode setting
};

// =============================================================================
// PDU Type Definition
// RR CIPHERING MODE COMPLETE  ue/ms -> ntw/ue
// 3GPP TS 44.018 clause 9.1.10
// -----------------------------------------------------------------------------
type record CIPHERINGMODECOMPLETE {
  B4_Type              skipIndicator,         // skip indicator
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator
  MessageType          msgType,               // message type
  MobileIdentity  mobileEquipId  optional          // mobile equipment identity   O OCTETSTRING [10], 15  digits, BCD
};

// =============================================================================
// PDU Type Definition
// RR CLASSMARK CHANGE  ue/ms -> ntw
// 3GPP TS 44.018 clause 9.1.11
// -----------------------------------------------------------------------------
type record CLASSMARKCHANGE {
  B4_Type     skipIndicator,         // skip indicator
  B4_Type     rRProtocolDiscriminator, // RR protocol discriminator
  MessageType msgType,               // message type
  MS_Clsmk2   msclsmk,               // mobile station classmark
  MS_Clsmk3   additionalMsclsmk  optional      // additional mobile station classmark info C OCTETSTRING [14]
};

// =============================================================================
// PDU Type Definition
// RR CLASSMARK ENQUIRY  ntw -> ue/ms
// 3GPP TS 44.018 clause 9.1.12
// -----------------------------------------------------------------------------
type record CLASSMARKENQUIRY {
  B4_Type              skipIndicator,         // skip indicator
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator
  MessageType          msgType,               // message type
  ClassmarkEnquiryMask mask  optional              // Classmark Enquiry Mask
};

// =============================================================================
// PDU Type Definition
// DTM REQUEST  ue/ms -> ntw
// 3GPP TS 44.018 clause 9.1.12i
// -----------------------------------------------------------------------------
type record DTMREQUEST {
  B4_Type        skipIndicator,         // skip indicator
  B4_Type        rRProtocolDiscriminator, // RR protocol discriminator
  MessageType    msgType,               // message type
  TLLI           tLLI,
  ChReqDescr2    chReqDescr              // channel request descritption M LV OCTETSTRING [5-n]
};

// =============================================================================
// PDU Type Definition
// RR GPRS Suspension Request ue/ms -> ntw
// 3GPP TS 44.018 clause 9.1.13b
// -----------------------------------------------------------------------------
type record GPRS_SUSPENSIONREQ {
  B4_Type              skipIndicator,         // skip indicator
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator
  MessageType          msgType,               // message type
  TLLI                 tlli,                  // Temporary Logical Link Identity
  RoutingAreaId        raIdentification,      // Routeing Area Identification
  O1_Type              cause,                 // SuspensionCause
  ServiceSupport       serviceSupport  optional         // Service support O OTSTETSTRING [2]
};

// =============================================================================
// PDU Type Definition
// RR HANDOVER ACCESS  ue/ms -> ntw
// 3GPP TS 44.018 clause  9.1.14
// -----------------------------------------------------------------------------
type record HANDOVERACCESS {
  B8_Type     hoRef
};

// =============================================================================
// PDU Type Definition
// RR HANDOVER COMMAND  ntw -> ue/ms
// 3GPP TS 44.018 clause  9.1.15
// -----------------------------------------------------------------------------
type record HANDOVERCOMMAND {
  SkipIndicator   skipIndicator,    //BITSTRING [4]
  ProtocolDiscriminator rrProtocolDiscriminator,  //BITSTRING [4]
  MessageType     msgType,          //BITSTRING [8]
  CellDescr       cellDescr,        //M OCTETSTRING [2]
  ChannelDescr    ch1Descr_at,      //description of the 1st channel, after time M OCTETSTRING [3]
  B8_Type         hoRef,            //handover reference M BITSTRING [8]
  PowerCmdAccessType powerCmdAccessType, //power command and access type M OCTETSTRING [1]
  SyncInd         syncInd optional, //synchronization indication O OCTETSTRING [1]
  FreqListShort   freqListShort_at optional, //frequency short list, after time C OCTETSTRING [10]
  FreqList        freqList_at optional, //frequency list, after time  C   OCTETSTRING [4..132]
  CellChDescr     cellChDescr optional, //cell channel description C OCTETSTRING [17]
  MultislotAlloc  mSlotAllocDescr optional, //Multislot Allocation  C  OCTETSTRING [3..12]
  ChMode          ch1Mode optional,  //mode of the 1st channel    O  OCTETSTRING [2]
  ChMode          channelSet2Mode optional, //mode of channel set 2  OOCTETSTRING [2]
  ChMode          channelSet3Mode optional, //mode of channel set 3  OOCTETSTRING [2]
  ChMode          channelSet4Mode optional, //mode of channel set 4  OOCTETSTRING [2]
  ChMode          channelSet5Mode optional, //mode of channel set 5  OOCTETSTRING [2]
  ChMode          channelSet6Mode optional, //mode of channel set 6  OOCTETSTRING [2]
  ChMode          channelSet7Mode optional, //mode of channel set 7  OOCTETSTRING [2]
  ChMode          channelSet8Mode optional, //mode of channel set 8  OOCTETSTRING [2]
  ChannelDescr    ch2Descr_at optional, //description of the 2nd channel, after time  O  OCTETSTRING [4]
  ChMode          ch2Mode optional,  //mode of the 2nd channel    O  OCTETSTRING [2]
  FreqChannelSeq  freqChSeq_at optional, //frequency channel sequence, after time   C  OCTETSTRING [10]
  MobileAlloc     mobileAlloc_at optional, //mobile allocation, after time    C  OCTETSTRING [3..10]
  StartingTime    startingTime optional, //starting time  O   OCTETSTRING [3]
  TimeDiff        realTimeDiff optional, //real time difference     C OCTETSTRING [3]
  TA              ta optional,       //timing advance  C TV [2]
  FreqListShort   freqListShort_bt optional, //frequency short list, before time C TV [10]
  FreqList        freqList_bt optional, //frequency list, before time  C   TLV [4..132]
  ChannelDescr    ch1Descr_bt optional, //description of the 1st channel, before time  O  TV [4]
  ChannelDescr    ch2Descr_bt optional, //description of the 2nd channel, before time  O  TV [4]
  FreqChannelSeq  freqChSeq_bt optional, //frequency channel sequence, before time   C  TV [10]
  MobileAlloc     mobileAlloc_bt optional, //mobile allocation, before time    C  TLV [3..10]
  CipherModeSetting ciphModeSetting optional, //cipher mode setting  O    TV [1]
  VGCS_TargetMode vGCS_TargetMode optional, //VGCS target mode Indication O  TLV [3]
  MultiRateConfig multiRateConfig optional, //multiRate configuration  TLV [4..8]
  DynaARFCN_Mapping dynaARFCN_Mapping optional, //dynamic ARFCN mapping O  TLV [6..34]
  VGCSCiphParam vGCSCipherParams optional, // VGCS Ciphering Parameters O TLV [3-15]
  DedicatedServiceInfo  dedServiceInfo optional// Dedicated Service Info O TV 2
};

// =============================================================================
// PDU Type Definition
// RR HANDOVER COMPLETE  ue/ms -> ntw
// 3GPP TS 44.018 clause  9.1.16
// -----------------------------------------------------------------------------
type record HANDOVERCOMPLETE {
  SkipIndicator   skipIndicator,    //BITSTRING [4]
  ProtocolDiscriminator rrProtocolDiscriminator,  //BITSTRING [4]
  MessageType     msgType,          //BITSTRING [8]
  RR_Cause        rrCau,            //OCTETSTRING [1]
  MobileTimeDiff  mobileObservedTimeDiff optional //mobile observed time difference O OCTETSTRING [5]
};

// =============================================================================
// PDU Type Definition
// RR HANDOVER FAILURE  ue/ms -> ntw
// 3GPP TS 44.018 clause  9.1.17
// -----------------------------------------------------------------------------
type record HANDOVERFAILURE {
  SkipIndicator   skipIndicator,    //BITSTRING [4]
  ProtocolDiscriminator rrProtocolDiscriminator,  //BITSTRING [4]
  MessageType     msgType,          //BITSTRING [8]
  RR_Cause        rrCau,            //OCTETSTRING [1]
  PS_Cause        psCau optional    //O TV OCTETSTRING [1]
};

// =============================================================================
// PDU Type Definition
// RR IMMEDIATE ASSIGNMENT  ntw -> ue/ms
// 3GPP TS 44.018 clause  9.1.18
// The message has a fixed length of 23 octets.
// -----------------------------------------------------------------------------
type record IMMEDIATEASSIGNMENT {
  O1_Type              l2PseudoLength,        // L2 pseudo length
  B4_Type              skipIndicator,         // skip indicator
  B4_Type              rRProtocolDiscriminator, // RR protocol discriminator
  MessageType          msgType,               // message type
  DedicatedModeOrTBF dedicatedModeOrTBF, // dedicated mode or TBF  without IEI
  PageModeIE      pageMode,              // page mode without IEI
  ChannelDescr    chDescr optional,               // channel description    C OCTETSTRING [3]
  PacketChDescr   packetChDescr optional,         // packet channel description    C OCTETSTRING [3]
  ReqRef          reqRef,                // request reference     M OCTETSTRING [3]
  TA              ta,                    // timing advance        M OCTETSTRING [1]
  MobileAlloc     mobileAlloc,           // mobile allocation,    M OCTETSTRING [1..9]
  StartingTime    startingTime  optional,          // starting time  O OCTETSTRING [3]
  IARO            iaroct  optional              // IA rest octets / frequency parameter, before time      M
}with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// PDU Type Definition
// RR MEASUREMENT REPORT  ue/ms -> ntw
// 3GPP TS 44.018 clause  9.1.21
// -----------------------------------------------------------------------------
type record MEASUREMENTREPORT {
  B4_Type         skipIndicator,         // skip indicator
  B4_Type         rRProtocolDiscriminator, // RR protocol discriminator
  MessageType     msgType,               // message type
  MeasResults     measResults            // measurement results
};

// =============================================================================
// PDU Type Definition
// RLC/MAC Control Block format
// -----------------------------------------------------------------------------
type record PACKETCONTROLACKNOWLEDGEMENT {
  B6_Type         msgType,               // Message type
  octetstring     tLLI length(4),
  B2_Type         ctrlAck,
  B1_Type         mask optional,
  B1_Type         rRBPMask  optional,              // not present if mask=0
  B3_Type         tn_RRBP  optional,               // not present if mask=0 or if rRBPMask=0
  B1_Type         gRNTIMask  optional,             // not present if mask=0
  B4_Type         gRNTIExt  optional,              // not present if mask=0 or if gRNTIMask=0
  B1_Type         rel6mask  optional,
  B1_Type         extMask  optional,               // not present if rel6mask = 0
  B9_Type         ctrlAckExt  optional,            // not present if rel6mask or extMask = 0
  bitstring       paddingBits  optional                   // uplink, so have to receive this in TTCN
};

// =============================================================================
// PDU Type Definition
// This message is sent on the PCCCH or PACCH by the network to the mobile station to assign downlink resources.         TS 3GPP 44.060 clause 11.2.7
// SS to add padding bits to RLC block size
// -----------------------------------------------------------------------------
type record PACKETDOWNLINKASSIGNMENT {
  B6_Type              msgType,               // Message type
  B2_Type              pAGE_MODE,             // Normal paging
  B1_Type              persistenceLevelMask,
  B4_Type              persistenceLevel1  optional,     // not Present if persistenceLevelMask=0
  B4_Type              persistenceLevel2  optional,     // not Present if persistenceLevelMask=0
  B4_Type              persistenceLevel3  optional,     // not Present if persistenceLevelMask=0
  B4_Type              persistenceLevel4  optional,     // not Present if persistenceLevelMask=0
  B1_Type              globalTFImask,
  GlobalTFI       gLOBAL_TFI  optional,            // not present if globalTFImask=1
  B1_Type              mask2  optional,                 // not present if globalTFImask=0
  octetstring     tLLI length(4)  optional,        // not present if globalTFImask=0 and mask2=1
  B1_Type              messageEcape,
  B2_Type              mACMode,
  B1_Type              rLCMode,
  B1_Type              controlAck,
  B8_Type              timeslotAllocation,
  PacketTimingAdvance pktTimingAdvance,
  B1_Type              mask1,
  B4_Type              p0  optional,                    // not present if mask1 = 0
  B1_Type              spareBit2  optional,             // not present if mask1 = 0. set to '0'B if present
  B1_Type              pRMode  optional,                // not present if mask1 = 0
  B1_Type              freqParamMask,
  FreqParam       freqParams  optional,            // not present if freqParamMask = 0
  B1_Type              tfiMask,
  B5_Type              dlTFIAssignment  optional,       // not present if tfiMask = 0
  B1_Type              pcMask,
  PowerControlParam powerCtrlParams  optional,     // not present if pcMask = 0
  B1_Type              startTimeMask,
  StartingFrameNumberDscr tbfStartTime  optional,  // not present if startTimeMask = 0
  B1_Type              spareBit3,             // set to '0'B
  B1_Type              r99Mask  optional,
  B1_Type              egprsMask  optional,             // not present if r99mask = 0
  EGPRSWindowSize egprsWindowSize  optional,       // not present if r99mask = 0 or if egprsMask=0
  B2_Type              linkQualMeasMode  optional,      // not present if r99mask = 0 or if egprsMask=0
  B1_Type              bepMask  optional,               // not present if r99mask = 0 or if egprsMask=0
  B4_Type              bepPeriod2  optional,            // not present if r99mask = 0 or if egprsMask=0 or if bepMask=0
  B1_Type              pktXTAMask  optional,            // not present if r99mask = 0
  B2_Type              pktExtendedTA  optional,         // not present if r99mask = 0 or if pktXTAMask=0
  B1_Type              compactMask  optional,           // not present if r99mask = 0
  CompactReducedMA compactReducedMA  optional,     // not present if r99mask = 0 or if compactMask=0
  B1_Type              r5Mask  optional,                // not present if r99mask = 0
  B1_Type              rBIdMask  optional,              // not present if r99mask = 0 or if r5Mask=0
  B5_Type              rBId  optional,                  // not present if r99mask = 0 or if r5Mask=0 or if rBIdMask=0
  B1_Type              grntiXMask  optional,            // not present if r99mask = 0 or if r5Mask=0 or if rBIdMask=0
  B4_Type              gRNTIExtension  optional,        // not present if r99mask = 0 or if r5Mask=0 or if rBIdMask=0 or if grntiXMask=0
  B1_Type              ulCtrlMask  optional,            // not present if r99mask = 0 or if r5Mask=0 or if rBIdMask=0
  B3_Type              ulCtrlTimeslot  optional,        // not present if r99mask = 0 or if r5Mask=0 or if rBIdMask=0 or if ulCtrlMask=0
  B1_Type              hfnMask  optional,               // not present if r99mask = 0 or if r5Mask=0 or if rBIdMask=0
  B1_Type              hfnLSB  optional,                // not present if r99mask = 0 or if r5Mask=0 or if rBIdMask=0 or if hfnMask=0
  B1_Type              r6Mask  optional,                // not present if r99mask = 0
  B1_Type              pfiMask  optional,               // not present if r99mask = 0 or if r6Mask = 0
  B7_Type              pFI  optional,                   // not present if r99mask = 0 or if r6Mask = 0 or if pfiMask = 0
  B1_Type              r7Mask optional,                 // not present if r99mask = 0 or if r6Mask = 0
  B1_Type              npmMask optional,                // not present if r99mask = 0 or if r6Mask = 0 or if r7Mask = 0
  B5_Type              npmTransferTime optional,        // not present if r99mask = 0 or if r6Mask = 0 or if r7Mask = 0 or if npmMask = 0
  PktDlDualCarrier     dualCarrier optional            // only present if messageEscape = 1
}with { encode "GPRSPadding Rule1" }

// =============================================================================
// PDU Type Definition
// uplink message 44.060 clause 11.2.17b
// Reference: 3GPP TS 44.060 clause 11.2.17b
// -----------------------------------------------------------------------------
type record PACKETSISTATUS {
  B6_Type         msgType,               // Message type
  GlobalTFI       globalTFI,
  B3_Type         bCCHChangeMark,
  SIMessageList   rcvdSIList,
  UnknownSIList   rcvdUnknownSIList,
  B1_Type         rel6Mask  optional,
  B1_Type         pSCSI_Support  optional,         // not present if rel6Mask = 0
  B1_Type         ps_RelReq  optional,             // not present if rel6Mask = 0
  bitstring       paddingBits  optional  // uplink, so need to handle padding bits
};

// =============================================================================
// PDU Type Definition
// ref 3GPP 44.060 v5a0 clause 11.2.9b ***Have NOT Updated to Rel 8 *** TO DO
// -----------------------------------------------------------------------------
type record PACKETMEASUREMENTORDER {
  B6_Type              msgType,               // Message type
  B2_Type              pAGE_MODE,             // Normal paging
  B1_Type              globalTFImask,
  GlobalTFI       gLOBAL_TFI  optional,            // not present if globalTFImask=1
  B1_Type              mask2  optional,                 // not present if globalTFImask=0
  octetstring     tLLI length(4)  optional,        // not present if globalTFImask=0 and mask2=1
  B3_Type              pMOIndex,
  B3_Type              pMOCount,
  B1_Type              ncMask,
  NC_MeasParams   nCMeasParams optional,
  B1_Type              spareBit1,  // set to '0'B
  B1_Type              r98Mask  optional,
  B1_Type              lsaMask  optional,
  LSA_Param       lSAParams  optional,
  B1_Type              r99Mask optional,
  B1_Type              enhMask optional,
  ENH_MeasParam   eNHMeasParams  optional,
  B1_Type              r4Mask optional,
  B1_Type                           cCNActive  optional,
  B1_Type              ccnMask optional,
  CCN_SupportDescr cCNSupportDescr                    optional,
  B1_Type              r5Mask optional,
  B1_Type              grntiXMask  optional,
  B4_Type              gRNTIExtension  optional,
  B1_Type              iuMask  optional,
  IuModeNeighCellParams iuModeNeighCellParams  optional,
  B1_Type              ncIuMask  optional,
  NCCIuModeCapCellList nCIuModeCapCellList  optional,
  B1_Type              gprs3GAddMeasParam2Mask  optional,
  B1_Type              rptThresMask  optional,
  B6_Type              fddReportThreshold  optional,
  B1_Type                          r6Mask optional,
  B1_Type                          cCN3GActive optional
}with { encode "GPRSPadding Rule1" }

// =============================================================================
// PDU Type Definition
// This message is sent on the PCCCH or PACCH by the network to the mobile station to assign uplink resources.        TS 3GPP 44.046 clause 11.2.29
// SS to add padding bits to RLC block size
// -----------------------------------------------------------------------------
type record PACKETUPLINKASSIGNMENT {
  B6_Type              msgType  ,               // Message type
  B2_Type              pAGE_MODE  ,
  B1_Type              persistenceLevelMask  ,
  B4_Type              persistenceLevel1  optional,     // not Present if persistenceLevelMask=0
  B4_Type              persistenceLevel2  optional,     // not Present if persistenceLevelMask=0
  B4_Type              persistenceLevel3  optional,     // not Present if persistenceLevelMask=0
  B4_Type              persistenceLevel4  optional,     // not Present if persistenceLevelMask=0
  B1_Type              globalTFIMask,
  GlobalTFI            globalTFI optional,              // only present if globalTFIMask = 0
  B1_Type              tLLIMask optional,               // only present if globalTFIMask = 1
  TLLI                 tLLI optional,                   // only present if global TFIMask  = 1 and tLLIMask = 0
  B1_Type              tQIMask  optional,               // only present if global TFIMask  = 1 and tLLIMask = 1
  B16_Type             tQI  optional,                   // only present if global TFIMask and tLLIMask = 1 and tQIMask  = 0
  ReferenceAddress     referenceAddress  optional,      // only present if global TFIMask and tLLIMask and tQIMask  = 1
  B1_Type              eGPRSmask  optional,
  B2_Type              channelCodingCommand  optional,  // not present if EGPRPSmask=1
  B1_Type              tLLIBlockChannelCoding  optional,
  PacketTimingAdvance  packetTimingAdvance  optional,
  B1_Type              freqParamMask  optional,
  FreqParam            freqParam  optional,             // not present if freqParamMask=0
  B2_Type              allocationMask  optional,
  DynamicAllocationPacket dynamicAllocation  optional, // present if allocationMask=01
  SingleBlockAllocationPacket singleBlockAllocation  optional, // present if allocationMask=10
  B1_Type              r99Mask  optional,
  B1_Type              packetExtTAmask  optional,       // not present if r99Mask=0
  B2_Type              packetExtendedTA  optional,      // not present if r99Mask=0 and packetExtTImask=0
  B1_Type              r5Mask  optional,
  B1_Type              gRNTIMask  optional,             // not present if r99Mask=0 and r5Mask=0
  B4_Type              gRNTIExtension  optional,        // not present if r99Mask=0, r5Mask=0 and gRNTIMask=0
  B1_Type              rBIdMask  optional,              // not present if r99Mask=0 and r5Mask=0
  B5_Type              rBId  optional,                  // not present if r99Mask=0, r5Mask=0 and rBIdMask=0
  B1_Type              r6Mask  optional,                // not present if r99Mask=0, r5Mask=0
  B1_Type              pfiMask  optional,               // not present if r99Mask=0, r5Mask=0 and r6Mask = 0
  B7_Type              pFI  optional,                   // not present if r99Mask=0, r5Mask=0, r6Mask = 0 and pfiMask = 0
  B1_Type              rlcModeMask  optional,           // not present if r99Mask=0, r5Mask=0 and r6Mask = 0
  B1_Type              rlcMode  optional,               // not present if r99Mask=0, r5Mask=0, r6Mask = 0 and rlcModeMask = 0
  B2_Type              mask  optional,                  // only present if EGPRSmask = 1
  EGPRSPktUplinkAssigment eGPRSmessage  optional,       // only present if EGPRSmask=1 and mask = 00
  PktUlDualCarrier     dualCarrier optional             // only present if EGPRSmask = 1 and mask = 01
}with { encode "GPRSPadding Rule1" }

// =============================================================================
// PDU Type Definition
// -----------------------------------------------------------------------------
type record PACKETRESOURCEREQUEST {
  B6_Type         msgType,               // message type   M
  B1_Type         mask1,
  B2_Type         accessType   optional, // not present if mask1 = 0
  B1_Type         mask2,
  GlobalTFI       globalTFI    optional, // only present if mask2 = 0
  TLLI            tlli         optional, // only present if mask2 = 1
  B1_Type         mask3,
  MS_RadioAccessCapList mSRadioAccessCap optional, // not present if mask3 = 0
  ChReqDescr      chReqDescr,
  B1_Type         mask4,
  B2_Type         changeMark   optional, // not present if mask4 = 0
  B6_Type         cValue,
  B1_Type         mask5,
  B6_Type         signVar      optional, // not present if mask5 = 0
  B1_Type         tnmask0,
  B4_Type         iLevelTN0    optional, // not present if tnmask0 = 0
  B1_Type         tnmask1,
  B4_Type         iLevelTN1    optional, // not present if tnmask1 = 0
  B1_Type         tnmask2,
  B4_Type         iLevelTN2    optional, // not present if tnmask2 = 0
  B1_Type         tnmask3,
  B4_Type         iLevelTN3    optional, // not present if tnmask3 = 0
  B1_Type         tnmask4,
  B4_Type         iLevelTN4    optional, // not present if tnmask4 = 0
  B1_Type         tnmask5,
  B4_Type         iLevelTN5    optional, // not present if tnmask5 = 0
  B1_Type         tnmask6,
  B4_Type         iLevelTN6    optional, // not present if tnmask6 = 0
  B1_Type         tnmask7,
  B4_Type         iLevelTN7    optional, // not present if tnmask7 = 0
  B1_Type         r99mask,
  B1_Type         mask6        optional, // not present if r99mask = 0
  EGPRSBEPQualityMeas  eGPRSBEPLinkQual   optional, // not present if r99mask or if mask6 = 0
  B1_Type         mask7        optional, // not present if r99mask = 0
  EGPRSTimeslotLinkQualityMeas  eGPRSTNLinkQual  optional, // not present if r99mask or mask7= 0
  B1_Type         mask8        optional, // not present if r99mask = 0
  B7_Type         pFI          optional, // not present if r99mask or mask8= 0
  B1_Type         addMSRACInfo  optional, // not present if r99mask = 0
  B1_Type         retxPRR      optional, // not present if r99mask = 0
  B1_Type         rel5mask     optional, // not present if r99mask = 0
  B1_Type         mask9        optional, // not present if r99mask or rel5mask = 0
  B1_Type         mask10       optional, // not present if r99mask or rel5mask or mask9 = 0
  B4_Type         gRNTIExt     optional, // not present if r99mask,rel5mask, mask9 or mask10 = 0
  IuModeChReqDescr iuModeChReqDescr optional, // not present if r99mask, rel5mask or mask9 = 0
  B1_Type         hfnmask      optional, // not present if r99mask or rel5mask or mask9 = 0
  B1_Type         hfnlsb       optional, // not present if r99mask or rel5mask or mask9 or hfnmask = 0
  B1_Type         rel6mask     optional, // not present if r99mask or rel5mask or mask9 = 0
  B1_Type         mask11       optional, // not present if r99mask or rel5mask or mask9 or rel6mask = 0
  ExtChReqDescr   extChReqDescr optional, // not present if r99mask or rel5mask or mask9 or rel6mask or mask11 = 0
  B1_Type         rel7mask     optional, // not present if r99mask or rel5mask or mask9 or rel6mask = 0
  B1_Type         earlyTBF     optional, // not present if r99mask or rel5mask or mask9 or rel6mask or rel7mask = 0
  B1_Type         mask12       optional, // not present if r99mask or rel5mask or mask9 or rel6mask or rel7mask = 0
  EGPRSBEPQualityMeas  eGPRSBEPLinkQual2   optional, // not present if r99mask or if mask6 or rel7mask or mask12 = 0
  B1_Type         mask13       optional, // not present if r99mask or rel5mask or mask9 or rel6mask or rel7mask = 0
  EGPRSTimeslotLinkQualityMeas  eGPRSTNLinkQual2   optional, // not present if r99mask or if mask6 or rel7mask or mask13 = 0
  bitstring       sparePadding optional  // Uplink message
};

// =============================================================================
// PDU Type Definition
// To send or receive user data
// -----------------------------------------------------------------------------
type record PacketData {
    octetstring data
}

// =============================================================================
// PDU Type Definition
// RR PAGING REQUEST_TYPE1  ntw -> ue/ms
// 3GPP TS 44.018 clause  9.1.22
// The message has a fixed length of 23 octets.
// -----------------------------------------------------------------------------
type record PAGINGREQUESTTYPE1 {
  O1_Type         l2PseudoLength,        // L2 pseudo length M
  B4_Type         skipIndicator,         // skip indicator  M
  B4_Type         rRProtocolDiscriminator, // RR protocol discriminator M
  MessageType     msgType,               // message type   M
  ChNeeded        chNeeded_m1_2,         // channels needed for mobiles 1 and 2 M BITSTRING [4] without IEI
  PageModeIE      pageMode,              // page mode   M
  MobileIdentity     mobileId1,             // mobility identity 1 M OCTETSTRING [2..9]
  MobileIdentity     mobileId2  optional,   // mobility identity 2 O OCTETSTRING [3..10]
  P1RO            p1RO   optional        // P1 rest octets
}with { encode "GSM Spare Padding Rule2"}

// =============================================================================
// PDU Type Definition
// RR PHYSICAL INFORMATION  ntw -> ue/ms
// 3GPP TS 44.018 clause 9.1.28
// -----------------------------------------------------------------------------
type record PHYSICALINFORMATION {
  B4_Type        skipIndicator,         // skip indicator
  B4_Type        rRProtocolDiscriminator, // RR protocol discriminator
  O1_Type        msgType,               // message type
  TA_TypeV       ta                     // timing advance
};

// =============================================================================
// PDU Type Definition
// RR UTRAN CLASSMARK CHANGE  ue/ms -> ntw 3GPP TS 44.018 clause 9.1.11a
// -----------------------------------------------------------------------------
type record UTRANCLASSMARKCHANGE {
  B4_Type       skipIndicator,
  B4_Type       rRProtocolDiscriminator,
  MessageType   msgType,
  UTRANPreConfigInfo   uTRANPreConfigInfo   //UTRAN predefined configuration status informatiom   M
  //OCTETSTRING [2..n]
}

} // end of group PDUTypes

group ASPTypes {

type union G_CPHY_CONFIG_REQ {
  G_CL1_CreateCell_REQ            createCell,
  G_CL1_DeleteCell_REQ            deleteCell,
  G_CL1_CreateBasicPhyCh_REQ      createPhyCh,
  G_CL1_CreateMultiSlotConfig_REQ createMultiSlotConfig,
  G_CL1_DeleteChannel_REQ         deleteChannel,
  G_CL1_ChangePowerLevel_REQ      changePowerLevel,
  G_CL1_CipheringControl_REQ      cipheringControl,
  G_CL1_CipherModeModify_REQ      cipherModeModify,
  G_CL1_ChModeModify_REQ          chModeModify,
  G_CL1_ComingFN_REQ              comingFN,
  G_CL2_HoldPhyInfo_REQ           holdPhyInfo,
  G_CL1_L1Header_REQ              l1Header,
  G_CL2_MeasRptControl_REQ        measReportCtrl,
  G_CL2_NoUAforSABM_REQ           noUAForSABM,
  G_CL2_ResumeUAforSABM_REQ       resumeUAForSABM,
  G_CL2_Release_REQ               releaseChannel,
  G_CL1_SetNewKey_REQ             setNewKey
}

type union G_CPHY_CONFIG_CNF {
  RFN             comingFN,   // the reduced frame number (FN modulo 42432) returned by G_CL1_ComingFN_REQ which is about 2 seconds later than current frame number
                              // and is able to carry L3 message on the channel specified by "physicalChId"+"G_LogicChType"+"subChannel"
  L1Header        l1Header,  // power level and timing advance returned from G_CL1_L1Header_REQ
  Null_Type       None       // This choice is used when none of the other choices are selected R5-103846
}

// =============================================================================
// ASP Type Definition
// The ASP is used to modify the channel mode of a dedicated channel
// -----------------------------------------------------------------------------
type record G_CL1_ChModeModify_REQ {
  GERAN_CellId_Type cellId,
  PhysicalChId    physicalChId,          // Channel identifier
  G_LogicChType   g_LogicChType,
  SubChannelNumber subChannel,           // Valid only for logical channel types: Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); For SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3). This field is not applicable and the SS shall ignore it if this field is coded as 15.
  ChMode          chMode                 // the new channel mode. definition see 3GPP TS 44.018 section 10.5.2.1b
};

// =============================================================================
// ASP Type Definition
// The ASP is used to change the transmission power level of a physical channel
// -----------------------------------------------------------------------------
type record G_CL1_ChangePowerLevel_REQ {
  GERAN_CellId_Type          cellId,
  PhysicalChId    physicalChId,          // Channel identifier
  TX_Power        txPower                // the new transmission power level. in dBuVemf()
};

// =============================================================================
// ASP Type Definition
// The ASP is used to set the ciphering mode of the physical channel in the receiving direction, the kc and ciphering algorithm were set by the G_CL1CreateBasicPhyCh_REQ for the physical channel before calling the ASP.
// For GSM dedicated physical channels, the ciphering mode of the SS shall be changed in three steps: (3GPP TS 44.018, clause 3.4.7)
// Before the SS sends CIPHERING MODE COMMAND the SS is transmitting and receiving in the old ciphering mode (e.g. not ciphered), after the SS sends the CIPHERING MODE COMMAND the SS changes its receiving ciphering mode to the new ciphering mode (e.g. ciphered) and keeps transmitting in the old ciphering mode; then after receiving the CIPHERING MODE COMPLETE, or any correct L2 frame in the new ciphering mode, the SS changes the transmitting ciphering mode to the new mode.
// The TTCN writer shall use the ASP before sending the CIPHERING MODE COMMAND to ensure the ciphering mode of the physical channel is changed in sufficient time, according to the 3 step procedure outlined above.
// -----------------------------------------------------------------------------
type record G_CL1_CipheringControl_REQ {
  GERAN_CellId_Type          cellId,
  PhysicalChId    physicalChId,          // Channel Identifier
  B1_Type         rcvCipherMode          // Ciphering Mode in SS receiving direction:
                                                   // 0 -> not ciphered
                                                   // 1 -> ciphered
};

// =============================================================================
// ASP Type Definition
// The ASP is used to modify the cipherl mode of a dedicated channel
// -----------------------------------------------------------------------------
type record G_CL1_CipherModeModify_REQ {
  GERAN_CellId_Type          cellId,
  PhysicalChId    physicalChId,          // Channel identifier
  G_LogicChType   g_LogicChType,
  SubChannelNumber subChannel,           // Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); For SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3). This field is not applicable and the SS shall ignore it if this field is coded as 15.
  CipherModeSetting cipherMode           // the new cipher mode. definition see 3GPP TS 44.018 section 10.5.2.9
};

// =============================================================================
// ASP Type Definition
// The ASP is used to request lower layer return the reduced frame number (FN modulo 42432) which is far enough in the future from current frame number and is able to carry L3 message on the specified channel. The requirement of "far enough" is that there is enough time left for TTCN to prepare a L3 message to send before that frame.
// -----------------------------------------------------------------------------
type record G_CL1_ComingFN_REQ {
  GERAN_CellId_Type          cellId,
  PhysicalChId    physicalChId,          // Channel identifier
  G_LogicChType   g_LogicChType,
  SubChannelNumber subChannel  optional            // Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); for SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3).
                                                   // this field is not applicable and the SS shall ignore it if  this field is coded as 15
};

// =============================================================================
// ASP Type Definition
// the ASP is used to create a basic physical channel in GERAN
// The value of channel Combination permitted currently:
// 1 TCH/F + FACCH/F + SACCH/TF
// 2 TCH/H(0,1) + FACCH/H(0,1) + SACCH/TH(0,1)
// 3 TCH/H(0,0) + FACCH/H(0,1) + SACCH/TH(0,1) + TCH/H(1,1)
// 4 FCCH + SCH + BCCH + CCCH
// 5 FCCH + SCH + BCCH + CCCH + SDCCH/4(0..3) + SACCH/C4(0..3)
// 6 BCCH + CCCH
// 7 SDCCH/8(0..7) + SACCH/C8(0.. 7)
// 8 TCH/F + FACCH/F + SACCH/M
// 9 TCH/F + SACCH/M
// 10 TCH/FD + SACCH/MD
// 13 PDTCH/F+PACCH/F+PTCCH/F
// 18 E-TCH/F + E-IACCH/F + E-FACCH/F + SACCH/TF
// 19 E-TCH/F + E-IACCH/F + E-FACCH/F + SACCH/M
// 20 E-TCH/F + E-IACCH/F + SACCH/M
// 21 E-TCH/FD + E-IACCH/F + SACCH/MD
// -----------------------------------------------------------------------------
type record G_CL1_CreateBasicPhyCh_REQ {
  GERAN_CellId_Type          cellId,                // the cell which the channel to be created belongs to
  PhysicalChId    physicalChId,          // identifier of the physical channel in the SS
  ChannelCombination channelCombination, // logical channels combined onto the basic physical channel
  FreqInfo        freqInfo,              // parameters for description of the physical channel in frequency domain
  TN              timeSlot,              // the time slot number of the physical channel
  TSC             tSC,                   // training sequence code. for common control and broadcast channels the value of tsc must be equal to BCC (base station coulour code)
  ChannelSpecificInfo channelSpecificPara optional, // specific parameters related to individual channel
  TX_Power        txPower,               // transmisstion power level of the channel
  B1_Type         bandIndicator          // Parameter for DCS or PCS frequency band selection. A value 0 for frqInfo.arfcn interpreted as DCS1800. A value 1 for frqInfo.arfcn interpreted as PCS1900. If omitted, the value in frqInfo.arfcn interpreted as DCS1800.
};

// =============================================================================
// ASP Type Definition
// the ASP is used to create a cell in GERAN
// -----------------------------------------------------------------------------
type record G_CL1_CreateCell_REQ {
  GERAN_CellId_Type        cellId,
  B6_Type       baseId,      // Base tranceiver station identiy code = NCC+BCC 3GPP TS 23.003 clause 4.3.2.
  B8_Type       timingAdvance // The SS sets the timing advance of downlink direction timing by this value
};

// =============================================================================
// ASP Type Definition
// The ASP is used to create a multi-slot configuration in GERAN and should be preceded w
// This ASP is to add a multi-slot configuration to the physical channel created in G_CL1_CreateBasicPhyCh_REQ ASP. For multi-slot configuration refer 3GPP TS 05.02 or 3GPP TS 45.002 clause 6.4.2.
// -----------------------------------------------------------------------------
type record G_CL1_CreateMultiSlotConfig_REQ {
  GERAN_CellId_Type              cellId,                // The cell which the configuration to be created belongs to
  PhysicalChId        mainChannel,           // identifier of the main physical channel of this multi-slot configuration.
  MultiSlotAllocation multiSlotAllocation    // The timeslot allocation of the configuration
};

// =============================================================================
// ASP Type Definition
// the ASP is used to delete a cell in GERAN
// -----------------------------------------------------------------------------
type record G_CL1_DeleteCell_REQ {
  GERAN_CellId_Type          cellId
};

// =============================================================================
// ASP Type Definition
// the ASP is used to delete a basic physical channel or multi-slot configuration
// -----------------------------------------------------------------------------
type record G_CL1_DeleteChannel_REQ {
  GERAN_CellId_Type          cellId,                // The cell which the channel to be deleted  belongs to
  PhysicalChId    physicalChId           // identifier of the physical channel or the multi-slot configuration to be deleted
};

// =============================================================================
// ASP Type Definition
// The ASP is used to request lower layer return the L1 header of SACCH.
// -----------------------------------------------------------------------------
type record G_CL1_L1Header_REQ {
  GERAN_CellId_Type           cellId,
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,         // SACCH
  SubChannelNumber subChannel             // Valid only for logical channel types: SACCH/TH, SACCH/C8, and SACCH/C4 This field is not applicable and the SS shall ignore it if this field is coded as 15.
};

// =============================================================================
// ASP Type Definition
// The ASP is used to set new cipher key for a dedicated channel
// -----------------------------------------------------------------------------
type record G_CL1_SetNewKey_REQ {
  GERAN_CellId_Type           cellId,
  PhysicalChId     physicalChId,          // the channel which uses the new key
  G_LogicChType    g_LogicChType,
  SubChannelNumber subChannel optional,   // Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); For SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3). This field is not applicable and the SS shall ignore it if this field is coded as 15.
  B64_Type         ciphKey
};

// =============================================================================
// ASP Type Definition
// The ASP commands the SS to hold the PHYSICAL INFORMATION message, which will be sent on PCO G_L2 following the current ASP. The PHYSICAL INFORMATION message shall be sent to the UE/MS within T3124 from the time when the SS has received n handover access bursts.
// T3124 is defined in 3GPP TS 44.018 clause 3.4.4.2.2 and clause 11.1.1
// -----------------------------------------------------------------------------
type record G_CL2_HoldPhyInfo_REQ {
  GERAN_CellId_Type           cellId,
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,
  SubChannelNumber subChannel  optional,  // Valid only for logical channel types: FACCH/H, SDCCH/8 and SDCCH/4,This field is not applicable and the SS shall ignore it if this field is coded as 15.
  integer          n                      // The number of handover access bursts to be received
};

// =============================================================================
// ASP Type Definition
// The ASP is used to enable or disable the reporting of received Measurement Reports to the TTCN
// Per default, this will be set to FALSE
// -----------------------------------------------------------------------------
type record G_CL2_MeasRptControl_REQ {
  GERAN_CellId_Type           cellId,
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,         // Valid only for lofical channel types: SACCH/TF, SACCH/TH, SACCH/C8 and SACCH/C4
  SubChannelNumber subChannel,           // For SACCH/TH value is (0..1), for SACCH/C8 value is (0..7) and for SACCH/C4 value is (0..3)
  boolean          sendMeasRpts           // Whether or not to report received Measurement Reports to the TTCN
};

// =============================================================================
// ASP Type Definition
// The ASP commands the SS not to send UA response to the UE when it receives SABM from the UE on the specified channel.
// -----------------------------------------------------------------------------
type record G_CL2_NoUAforSABM_REQ {
  GERAN_CellId_Type           cellId,
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,
  SubChannelNumber subChannel optional    // Valid only for logical channel types: FACCH/H, SDCCH/8 and SDCCH/4,This field is not applicable and the SS shall ignore it if this field is coded as 15.
};

// =============================================================================
// ASP Type Definition
// The ASP is used to request the SS stop L2 transmission on a channel
// -----------------------------------------------------------------------------
type record G_CL2_Release_REQ {
  GERAN_CellId_Type          cellId,
  PhysicalChId    physicalChId           // Channel identifier
};

// =============================================================================
// ASP Type Definition
// The ASP commands the SS  to send UA response to the UE when it receives SABM from the UE on the specified channel. This ASP is used after G_CL2_NoUAforSABM_REQ to resume the normal multiframe operation of L2
// -----------------------------------------------------------------------------
type record G_CL2_ResumeUAforSABM_REQ {
  GERAN_CellId_Type           cellId,
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,
  SubChannelNumber subChannel            // Valid only for logical channel types: FACCH/H, SDCCH/8 and SDCCH/4,This field is not applicable and the SS shall ignore it if this field is coded as 15.
};

type union G_LLC_CONFIG_REQ {
  G_CLLC_Assign_REQ      assign,
  G_CLLC_ReassignLLE_REQ reassign,
  G_CLLC_CreateLLE_REQ   createLLC,
  G_CLLC_DeleteLLE_REQ   deleteLLC
}

type record G_LLC_CONFIG_CNF {}

type union G_RLC_CONFIG_REQ {
  G_CRLC_CreateRLC_MAC_REQ createRLC,
  G_CRLC_DeleteRLC_MAC_REQ deleteRLC,
  G_CRLC_DL_TBF_Config_REQ dlTBFConfig,
  G_CRLC_UL_TBF_Config_REQ ulTBFConfig
}

type record G_RLC_CONFIG_CNF {}

// =============================================================================
// ASP Type Definition
// the ASP is used to assign, change or unassign the TLLI, the cipher key (Kc) and the cipher algorithm of GERAN LLC emulator module.
// This ASP is used to assign, change, or unassign the TLLI, the ciphering key (Kc) and the ciphering algorithm. 1.
// The oldTLLI and newTLLI parameters shall be interpreted as follows:-        If oldTLLI = all 1's and newTLLI ??all 1's then newTLLI is
// assigned and used when (re?)transmitting LLC frames. If an oldTLLI ??all 1's was assigned to the LLME, then oldTLLI is unassigned.
// Only newTLLI is accepted when received from the peer. It shall be treated as a TLLI change. If oldTLLI = all 1's was assigned to the LLME,
// then this shall be treated as a TLLI assignment, and this ASP shall be the first ASP sent to the SS in order to enable LLC to process
// requests from layer 3.-        If oldTLLI ??all 1's and newTLLI ??all 1's then oldTLLI and newTLLI are assigned, and newTLLI shall be used when
// (re?)transmitting LLC frames. Both oldTLLI and newTLLI shall be accepted when received from the peer. It shall be treated as a TLLI change.
// If oldTLLI ??all 1's and newTLLI = all 1's then oldTLLI shall be unassigned. It shall be treated as a TLLI unassignment, and this ASP shall
// be the last ASP sent to the SS in order to disable LLC to not process requests from layer 3 any longer.2. Kc and Ciphering Algorithm are
// associated with newTLLI (and with oldTLLI if assigned):-        If Ciphering Algorithm indicates no ciphering, then the ciphering function shall be
// disabled. Otherwise, the ciphering function shall be enabled. If a Ciphering Algorithm was already associated with newTLLI or oldTLLI, then
// the new Kc shall replace the previous Kc, and Ciphering Algorithm shall replace the previous algorithm selection. All I frames, and UI frames
// with the E bit set to 1, shall use the new Kc and algorithm for ciphering. All unacknowledged I frames shall be ciphered using the new Kc and
// algorithm before retransmission. As an implementation option, the previous Kc and algorithm may be used to decipher received frames.
// -----------------------------------------------------------------------------
type record G_CLLC_Assign_REQ {
  GERAN_CellId_Type          cellId,
  TLLI            oldTLLI,               // OCTETSTRING[4]
  TLLI            newTLLI,
  B64_Type        cipherKey,
  GPRS_CipherAlg  cipherAlgorithm        // BITSTRING[3], 3GPP TS 24.008 section 10.5.5.3
};

type record G_CLLC_Config_CNF {}

// =============================================================================
// ASP Type Definition
// the ASP is used to configure a TBF used for down link data transfer
// For GPRS channel coding can be: CS-1, CS-2, CS-3 and CS-4;For EGPRS channel coding can be : MCS-1, MCS-2, MCS-3, MCS-4, MCS-5, MCS-6, MCS-7, MCS-8, MCS-9, MCS-5-7 and MCS-6-9.
// -----------------------------------------------------------------------------
type record G_CRLC_DL_TBF_Config_REQ {
  GERAN_CellId_Type        cellId,
  TFI           tFI,
  B1_Type       tBF_Mode,    // 0 - GPRS; 1 - EGPRS
  ChannelCoding channelCoding,
  B1_Type       rLC_Mode,    // 0 - acknowledged mode; 1 - unacknowledged mode
  TimeSlotAllocation timeSlotAllocation, // Downlink TBF time slot allocation
  RFN           startingTime,          // This field is not applicable and the SS shall ignore it if the field t2 of rfn is coded as '11111'B.
  integer       dataBlockRate          // This parameter controls the speed of the DL TBF transferring data blocks by controlling the USF rate:
                                                   // 1---> implementation dependent. TTCN does not specify the USF generating rate;
                                                   // 2---> 10 data blocks per second;
                                                   // 3---> 5 data blocks per second;
                                                   // 4---> 1 data block per second;
                                                   // 5---> 1 data block 2 seconds;
                                                   // 6---> 1 data block 3 seconds;
                                                   // 7---> 1 data block 4 seconds
};

// =============================================================================
// ASP Type Definition
// the ASP is used to configure a TBF used for uplink data transfer
// For GPRS channel coding can be: CS-1, CS-2, CS-3 and CS-4;For EGPRS channel coding can be : MCS-1, MCS-2, MCS-3, MCS-4, MCS-5, MCS-6, MCS-7, MCS-8, MCS-9, MCS-5-7 and MCS-6-9.
// Due to one cell currently has only one RLC/MAC emulation module, this ASP does not contain RLC/MAC identity parameter to indicate which RLC/MAC emulation module this TBF is
// established for, instead, the parameter cellId implicitly indicates the RLC/MAC module, which is created by G_CRLC_CreateRLC_MAC_REQ and has identifier RlcMacEntityId in the cell.
// The higher layer (LLC emulation module) uses rLC/MAC_MappingInfo (with type of CellId) to address the RLC/MAC emulation module to which it connects
// -----------------------------------------------------------------------------
type record G_CRLC_UL_TBF_Config_REQ {
  GERAN_CellId_Type        cellId,
  TFI           tFI,
  B1_Type       tBF_Mode,    // 0 - GPRS; 1 - EGPRS
  ChannelCoding channelCoding,
  B1_Type       tLLI_BlockChannelCoding, // 0 - CS-1 or MCS-1(EGPRS); 1 - same as channelCoding
  B1_Type       rLC_Mode,    // 0 - acknowledged mode; 1 - unacknowledged mode
  RFN           startingTime,          // This field is not applicable and the SS shall ignore it if the field t2 of rfn is coded as '11111'B.
  integer       uSF_Rate,              // This parameter controls the speed of the UL TBF transferring data blocks by controlling the USF rate:
                                                   // 1---> implementation dependent. TTCN does not specify the USF generating rate;
                                                   // 2---> 10 USF's per second;
                                                   // 3---> 5 USF's per second;
                                                   // 4---> 1 USF per second;
                                                   // 5---> 1 USF per 2 seconds;
                                                   // 6---> 1 USF per 3 seconds;
                                                   // 7---> 1 USF per 4 seconds
  DynamicAllocation dynamicAllocation    // dynamic allocation and other parameters.
};

// =============================================================================
// ASP Type Definition
// The ASP is used to receive a L2 PDU from the UE
// -----------------------------------------------------------------------------
type union G_L2_DATAMESSAGE_IND {
    G_L2_UNITDATA_IND    meas,
    G_L2_Release_CNF     relCnf,
    G_L2_Release_IND     relInd,
    G_L2_Estab_IND       sabm,
    G_L2_GTTP_IND        dtm,
    G_L2_DATA_IND        l3,
    G_L2_ACCESS_IND      access
}

// =============================================================================
// ASP Type Definition
// The ASP is used to send a L2 PDU to the UE
// -----------------------------------------------------------------------------
type union G_L2_DATAMESSAGE_REQ {
  G_L2_UNITDATA_REQ    unit,
  G_L2_Release_REQ     rel,
  G_L2_SYSINFO_REQ     si,
  G_L2_Paging_REQ      page,
  G_L2_PagingGPRS_REQ  pageGPRS,
  G_L2_DATA_REQ        l3,
  G_L2_GTTP_REQ        dtm
}

// =============================================================================
// ASP Type Definition
// The ASP is used to receive a random access or handover access burst on the specified channel.
// -----------------------------------------------------------------------------
type record G_L2_ACCESS_IND {
  GERAN_CellId_Type           cellId,
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,         // RACH, FACCH, SDCCH/8, SDCCH/4.
                                          // RACH is used for random access burst; others are used for handover access burst
  SubChannelNumber subChannel optional,           // Valid only for logical channel types:  FACCH/H,  SDCCH/8,  SDCCH/4.
  RFN              rfn,                   // The reduced frame number of the frame carrying the burst
  AccessIndType    burst                    // random access burst or handover access burst
};

type union AccessIndType {
  CHANNELREQUEST chReq,
  HANDOVERACCESS hoA
}

// =============================================================================
// ASP Type Definition
// The ASP is used to receive a L3 signalling message on the signalling channels or user data on the traffic channels from the UE/MS in acknowledged mode.
// -----------------------------------------------------------------------------
type record G_L2_DATA_IND {
  GERAN_CellId_Type           cellId,
  SAPI             sAPI,                  // 0 or 3
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,
  SubChannelNumber subChannel optional,           // Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); for SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3). It shall be ignored if this is coded as 15
  RFN              rfn,                   // The reduced frame number of the first frame on which this message is received
  L2DataIndType    msg                    // Signalling message or user data received
};

type union L2DataIndType {
  ALERTINGul             alerting,
  ASSIGNMENTCOMPLETE     assignmentComplete,
  ASSIGNMENTFAILURE      assignmentFail,
  AUTHENTICATIONRESPONSE authResponse,
  AUTHENTICATIONFAILURE  autnFail,
  CALLCONFIRMED          callConfirmed,
  CIPHERINGMODECOMPLETE  cipherComplete,
  CLASSMARKCHANGE        classmarkChange,
  CONNECTul              connectul,
  DTMREQUEST             dtmReq,
  GPRS_SUSPENSIONREQ     gprsSuspendReq,
  HANDOVERCOMPLETE       hoComplete,
  HANDOVERFAILURE        hoFailure,
  RELEASEul              release,
  SETUPul                setupul,
  TMSIREALLOCATIONCOMPLETE tmsiRealloc,
  UTRANCLASSMARKCHANGE   utranClassmarkChange
}

// =============================================================================
// ASP Type Definition
// The ASP is used to send L3 signalling message on the signalling channels or user data on the traffic channels to the UE/MS in acknowledged mode.
// Parameter rfn is only used in the test cases which requires specific L3 message to be sent on specified frame number
// -----------------------------------------------------------------------------
type record G_L2_DATA_REQ {
  GERAN_CellId_Type           cellId,
  SAPI             sAPI,                  // 0
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,
  SubChannelNumber subChannel optional,           // Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); for SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3).
  RFN              rfn        optional,                   // The reduced frame number of the first frame on which this message is sent.If the field t2 of rfn is coded as '11111'B lower layer shall ignore this field.
  L2DataReqType    msg                    // Signalling message or user data to be sent
};

type union L2DataReqType {
  ASSIGNMENTCOMMAND                assignmentCmd,
  AUTHENTICATIONREQUEST                authReq,
  CHANNELRELEASE                        chRelease,
  CIPHERINGMODECOMMAND                cipherModeCmd,
  CMSERVICEACCEPT                        cmServiceAccept,
  CLASSMARKENQUIRY                classmarkEnquiry,
  HANDOVERCOMMAND                 handoverCommand,
  LOCATIONUPDATINGACCEPT                locUpdAccept,
  RELEASECOMPLETEdl                releaseComplete,
  SETUPdl                                setupdl
}

// =============================================================================
// ASP Type Definition
// The ASP is used for DTM to receive an LLC signalling message on DCCH in acknowledged mode
// If ciphering is used, the SS will take care to ensure the "gmmSmPDU" is deciphered
// -----------------------------------------------------------------------------
type record G_L2_GTTP_IND {
  GERAN_CellId_Type          cellId,
  SAPI            sAPI,
  PhysicalChId    physicalChId,          // Channel identifier
  G_LogicChType   g_LogicChType,
  SubChannelNumber subChannel,           // Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); for SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3). This field is not applicable and the SS shall ignore it if this field is coded as 15
  RFN             rfn,                   // The reduced frame number of the first frame carrying the message
  TLLI            tLLI,
  LLCUnitDataIndType    gmmSmPDU               // Deciphered GMM or SM signalling message received
};

// =============================================================================
// ASP Type Definition
// The ASP is used for DTM to send an LLC signalling message on DCCH in acknowledged mode
// If ciphering is used, the SS will take care to ensure the "gmmSmPDU" is ciphered
// -----------------------------------------------------------------------------
type record G_L2_GTTP_REQ {
  GERAN_CellId_Type          cellId,
  SAPI            sAPI,
  PhysicalChId    physicalChId,          // Channel identifier
  G_LogicChType   g_LogicChType,
  SubChannelNumber subChannel,           // Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); for SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3). This field is not applicable and the SS shall ignore it if this field is coded as 15
  B1_Type         protectMode,           // 0 - unprotected, 1 - protected
  B1_Type         cipherMode,            // 0 - sent without encryption, 1 - encrypted
  B4_Type         skipIndicator,         // GTTP Header, unciphered
  B4_Type         gTTPProtocolDiscriminator, // GTTP Header, unciphered
  MessageType     msgType,               // GTTP Header, unciphered
  TLLI            tLLI,                  // GTTP Header, unciphered
  Type4Length_Type gmmSmPDULength,       // GTTP Header, unciphered
  LLCUnitDataReqType    gmmSmPDU         // GMM or SM PDU, ciphered
};


// =============================================================================
// ASP Type Definition
// The ASP is used to receive an indication of that L2 multiple frame operation on the specified channel has been established.
// see 3GPP TS 44.006 clause 7.1.1 and 7.1.3
// -----------------------------------------------------------------------------
type record G_L2_Estab_IND {
  GERAN_CellId_Type          cellId,
  PhysicalChId    physicalChId,          // Channel identifier
  G_LogicChType   g_LogicChType,
  SubChannelNumber subChannel,           // Valid only for logical channel types: FACCH/H, SDCCH/8 and SDCCH/4,This field shall be coded as 15 if it is not applicable.
  SAPI            sAPI,                  // 0, 3
  EstMode         establish_mode,        // Norm
  RFN             rfn,                   // The reduced frame number of the first frame carries the L2 SABM frame
  EstablishIndType     msg   optional    // this field is present only when the establish mode is CoRes (collision resolution)
};

type union EstablishIndType {
  LOCATIONUPDATINGREQUEST        locUpdReq,
  CMSERVICEREQUEST        cmServiceReq,
  IMSIDETACHINDICATION        imsiDetachInd,
  PAGINGRESPONSE                pagingRsp
}

// =============================================================================
// ASP Type Definition
// The ASP is used to send a paging message on the specified paging group of the specified paging channel to the UE/MS, when the UE/MS is in idle mode or the UE/MS not supporting  SPLIT_PG_CYCLE on CCCH is in GPRS attached mode and PCCCH is absent.
// The SS is required to send valid layer 3 messages continuously on all paging subchannels on CCCH where paging can appear.For "normal paging" the SS send the paging message in the specified pagingGroup;For "extended paging" " the SS send the paging message in the specified pagingGroup and in the "next but one" position on the PCH, following the block corresponding to pagingGroup;For "paging reorganization" the SS send the paging message in all paging subchannels.The required 51-multiframe occurs when:pagingGroup div (N div BS_PA_MFRMS) = (FN div 51) mod (BS_PA_MFRMS)The index to the required paging block in the 51-multiframe determined above:Paging block index = pagingGroup mod (N div BS_PA_MFRMS) N = (9-BS_AG_BLKS_RES) * BS_PA_MFRMS        CCCH not combined orN = (3-BS_AG_BLKS_RES) * BS_PA_MFRMS        CCCH + SDCCH combined
// -----------------------------------------------------------------------------
type record G_L2_Paging_REQ {
  GERAN_CellId_Type          cellId,
  SAPI            sAPI,                  // 0
  PhysicalChId    physicalChId,          // Channel identifier of the right CCCH_GROUP
  G_LogicChType   g_LogicChType,         // PCH
  PAGING_GROUP    pAGING_GROUP,          // INTEGER
  PagingMode      pagingMode,            // 0 -- normal paging; 1-- exteded paging; 3 -- paging reorganization
  PagingReqType   msg                    // paging message  to be sent
};

type union PagingReqType {
  IMMEDIATEASSIGNMENT        immedAss,
  PAGINGREQUESTTYPE1        pagReq
}

// =============================================================================
// ASP Type Definition
// The ASP is used to send a paging message on the specified paging group of the specified paging channel to the UE/MS, when the UE/MS supporting SPLIT_PG_CYCLE on CCCH is in GPRS attached mode and PCCCH absent.
// The SS is required to send valid layer 3 messages continuously on all paging subchannels on CCCH where paging can appear.For "normal paging" the SS send the paging message in the specified pagingGroup;For "extended paging" " the SS send the paging message in the specified pagingGroup and in the "next but one" position on the PCH, following the block corresponding to pagingGroup;For "paging reorganization" the SS send the paging message in all paging subchannels.The required 51-multiframe occurs when:pagingGroup div (M div 64) = (FN div 51) mod 64The index to the required paging block in the 51-multiframe determined above:Paging block index = pagingGroup mod (M div 64)M = (9-BS_AG_BLKS_RES) ??64        CCCH not combined orM = (3-BS_AG_BLKS_RES) ??64        CCCH + SDCCH combined
// NOTE:        This ASP may not be implemented if the MS/UE does not support SPLIT_PG_CYCLE on CCCH.
// -----------------------------------------------------------------------------
type record G_L2_PagingGPRS_REQ {
  GERAN_CellId_Type          cellId,
  SAPI            sAPI,                  // 0
  PhysicalChId    physicalChId,          // Channel identifier of the right CCCH_GROUP
  G_LogicChType   g_LogicChType,         // PCH
  PAGING_GROUP    pAGING_GROUP,          // INTEGER
  PagingMode      pagingMode,            // 0 -- normal paging; 1-- exteded paging; 3 -- paging reorganization
  integer         splitPGcycleCode,      // 0 -- No Split Paging, 1..32 -- Split Paging
  PagingReqType   msg                    // paging message  to be sent
};

// =============================================================================
// ASP Type Definition
// The ASP is used to receive an indication of the termination of an established multiple frame operation or an indication of an unsuccessful establishment attempt.
// -----------------------------------------------------------------------------
type record G_L2_Release_IND {
  GERAN_CellId_Type           cellId,
  SAPI             sAPI,                  // 0
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,
  SubChannelNumber subChannel,           // Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); for SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3).
  B1_Type          release_Mode , // 0 = normal release; 1 = local end release
  boolean          outstanding_Indicator   // whether or not there are outstanding acknowledgements or unsolved G_L2_DATA_REQ primitives.
};

// =============================================================================
// ASP Type Definition
// The ASP is used to send system information messages to the lower layer emulatior.
// The lower layer emulator shall store the SYSTEM INFORMATION's, and transmit them periodically according to the rules specified in section 6.3.1.3 of 3GPP TS 45.002. The msg shall override the same type system information message previous stored in the lower layer emulator.
// SYSTEM INFORMATION scheduling assumption: all SI's except SI7, SI8, SI16 and SI17 are  scheduled on BCCH Norm. Consequently, SI13, SI2bis and SI2quater are scheduled in TC=4 on BCCH norm not on BCCH Ext
// -----------------------------------------------------------------------------
type record G_L2_SYSINFO_REQ {
  GERAN_CellId_Type          cellId,
  SAPI            sAPI,                  // 0
  PhysicalChId    physicalChId,          // Channel identifier
  G_LogicChType   g_LogicChType,         // BCCH or SACCH
  integer         instanceIndex,         // To indicate the instance of the system information messages.For SYSTEM INFORMATION Type 2ter, 18, 19, 20 the value is (0..7); for type 14, 15 the value is (0..3); for type 2quater the value is (0..15); for all other type the value is 0.
  B1_Type         bCCHExt,               // '0' indicates message sent on BCCH Norm
                                         // '1' indicates message sent on BCCH Ext.  Only valid for SI2quater, 13, 15.  Default value '0'.
  SysInfoType     msg                    // SYSTEM INFORMATION Type 5, 5bis, 5ter, and 6 are sent on SACCH, the other SYSTEM INFORMATION 's are sent on BCCH.
};

// =============================================================================
// ASP Type Definition
// The ASP from L2, indicates that the multiple frame operation release was successful. This means that the UA message was received in response to L2 DISC command.
// -----------------------------------------------------------------------------
type record G_L2_Release_CNF {
  GERAN_CellId_Type           cellId,
  SAPI             sAPI,                  // 0 or 3
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,
  SubChannelNumber subChannel  optional,           // For SDCCH/8, SACCH/C8 value is (0..7); for SDCCH/4, and SACCH/C4 value is (0..3).
                                                   // This field is not applicable and the SS shall ignore it if this field is coded as 15.
  B1_Type          releaseMode  // 0-normal release, 1-local release
};

// =============================================================================
// ASP Type Definition
// This ASP requests L2 to send Layer 2 DISC command on the indicated SAPI.
// -----------------------------------------------------------------------------
type record G_L2_Release_REQ {
  GERAN_CellId_Type           cellId,
  SAPI             sAPI,                  // 0 or 3
  PhysicalChId     physicalChId,          // Channel identifier
  G_LogicChType    g_LogicChType,
  SubChannelNumber subChannel  optional,           // For SDCCH/8, SACCH/C8 value is (0..7); for SDCCH/4, and SACCH/C4 value is (0..3).
                                                   // This field is not applicable and the SS shall ignore it if this field is coded as 15.
  B1_Type          releaseMode  // 0-normal release, 1-local release
};

// =============================================================================
// ASP Type Definition
// The ASP is used to receive a L3 signalling message on the signalling channels or user data on the traffic channels from the UE/MS in unacknowledged mode.
// -----------------------------------------------------------------------------
type record G_L2_UNITDATA_IND {
  GERAN_CellId_Type            cellId,
  SAPI              sAPI,                  // 0
  PhysicalChId      physicalChId,          // Channel identifier
  G_LogicChType     g_LogicChType,
  SubChannelNumber  subChannel optional,            // Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); for SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3).
  RFN               rfn,                   // The reduced frame number of the first frame carrying the message
  MEASUREMENTREPORT msg                    // Signalling message received
};

// =============================================================================
// ASP Type Definition
// The ASP is used to send L3 signalling message on the signalling channels or send user data on the traffic channels to the UE/MS in unacknowledged mode.
// Parameter rfn is only used in the test cases which requires specific L3 message to be sent on specified frame number
// -----------------------------------------------------------------------------
type record G_L2_UNITDATA_REQ {
  GERAN_CellId_Type            cellId,
  SAPI              sAPI,                  // 0
  PhysicalChId      physicalChId,          // Channel identifier
  G_LogicChType     g_LogicChType,
  SubChannelNumber  subChannel optional,           // Valid only for logical channel types: TCH/H, FACCH/H, SACCH/TH, SDCCH/8, SACCH/C8, SDCCH/4, and SACCH/C4. For TCH/H, FACCH/H and SACCH/TH value is (0..1); for SDCCH/8 and SACCH/C8 value is (0..7); for SDCCH/4 and SACCH/C4 value is (0..3).
  RFN               rfn,                   // The reduced frame number of the first frame on which this message is sent.If the field t2 of rfn is coded as '11111'B lower layer shall ignore this field.
  L2UnitDataReqType msg                      // Signalling message or user data to be sent
};

type union L2UnitDataReqType {
  IMMEDIATEASSIGNMENT                immedAss,
  PHYSICALINFORMATION                phyChInfo
}

// =============================================================================
// ASP Type Definition
// The ASP is used to receive an L3 PDU from the UE in LLC unconfirmed transmission.
// 3GPP TS 44.064 clause 8.4.2
// -----------------------------------------------------------------------------
type record G_LLC_UNITDATA_IND {
  LLMEId             lLMEId,
  TLLI               tLLI,                  // temporary logical link identifier
  SAPI               sAPI,
  LLCUnitDataIndType msg                    // L3 PDU
};

type union LLCUnitDataIndType {
  ACTIVATEPDPCONTEXTREQUESTul                  actPDPContextReq,
  ATTACHCOMPLETE                                 attComplete,
  ATTACHREQUEST                                  attReq,
  AUTHENTICATION_AND_CIPHERING_FAILURE     authCipherFail,
  AUTHENTICATIONANDCIPHERINGRESPONSE         authCipherResp,
  DEACTIVATEPDPCONTEXTREQUEST                 deactPDPReq,
  DETACHREQUESTMO                                 detachReq,
  MODIFYPDPCONTEXTACCEPT_ul                 modPDPAccept,
  ROUTINGAREAUPDATEREQUEST                 rauReq,
  ROUTING_AREA_UPDATE_COMPLETE                 rauComplete
}

// =============================================================================
// ASP Type Definition
// The ASP is used to receive an LLC PDU from the UE
// -----------------------------------------------------------------------------
type union G_LLC_DATAMESSAGE_IND {
  G_LLC_UNITDATA_IND    unit,
  G_LLC_XID_IND         xid
}

// =============================================================================
// ASP Type Definition
// The ASP is used to transmit an L3 PDU to the UE in LLC unconfirmed transmission.
// 3GPP TS 44.064 clause 8.4.1
// After the ciphering function is started in the SS by G_CLLC_Assign_REQ, the SS shall encrypt the "msg" when cipherMode = '1', and the SS shall not encrypt the "msg" if cipherMode = '0'.
// -----------------------------------------------------------------------------
type record G_LLC_UNITDATA_REQ {
  LLMEId             lLMEId,
  TLLI               tLLI,                  // temporary logical link identifier
  SAPI               sAPI,
  B1_Type            protectMode, // 0 -- unprotected; 1 -- protected
  B1_Type            cipherMode,  // 0 --- sent without no encryption;1 --- sent with encryptionencrypted
  LLCUnitDataReqType msg                      // L3 PDU
};

type union LLCUnitDataReqType {
  ACTIVATEPDPCONTEXTACCEPTdl               actPDPAccept,
  ATTACHACCEPT                             attAccept,
  ATTACHREJECT                             attReject,
  AUTHENTICATIONANDCIPHERINGREQUEST        autnCipherReq,
  DEACTIVATEPDPCONTEXTACCEPT               deactPDPAccept,
  MODIFYPDPCONTEXTREQUEST_dl               modifyPDPReq,
  PacketData                               data,
  ROUTINGAREAUPDATEACCEPT                  rauAccept,
  ROUTINGAREAUPDATEREJECT                  rauReject
  
}

// =============================================================================
// ASP Type Definition
// The ASP is used to transmit an LLC PDU to the UE
// -----------------------------------------------------------------------------
type union G_LLC_DATAMESSAGE_REQ {
  G_LLC_UNITDATA_REQ    unit,
  G_LLC_XID_RES         xid
}


// =============================================================================
// ASP Type Definition
// The ASP is used to receive the XID requested by the UE
// -----------------------------------------------------------------------------
type record G_LLC_XID_IND {
  LLMEId          lLMEId,
  TLLI            tLLI,                  // temporary logical link identifier
  SAPI            sAPI,
  XID_Info        xID_Info     optional    // the XID parameters requested by the UE/MS
};

// =============================================================================
// ASP Type Definition
// The ASP is used to send to the UE the negotiated XID parameters agreed by the SS.
// -----------------------------------------------------------------------------
type record G_LLC_XID_RES {
  LLMEId          lLMEId,
  TLLI            tLLI,                  // temporary logical link identifier
  SAPI            sAPI,
  XID_Info        xID_Info   optional    // the negotiated XID parameters agreed by the SS
};

// =============================================================================
// ASP Type Definition
// The ASP is used to receive an uplink RLC/MAC control block sent by the UE/MS on the specified channel.
// -----------------------------------------------------------------------------
type record G_RLC_ControlMsg_IND {
  GERAN_CellId_Type              cellId,
  PhysicalChId        physicalChId,          // Channel identifier
  G_LogicChType       g_LogicChType,         // PCCCH or PACCH or PTCCH
  integer             tBF_Direction,         // 0 -- downlink; 1 -- uplink
  TFI                 tFI,                   // temporary flow identity
  RFN                 rfn,                   // the reduced frame number of the frame carrying this message
  GRLCCntrlMsgIndType msg                    // uplink RLC/MAC control message
};

type union GRLCCntrlMsgIndType {
  PACKETCONTROLACKNOWLEDGEMENT pktCtrlAck,
  PACKETRESOURCEREQUEST        pktResReq,
  PACKETSISTATUS               pktSIStatus
}

// =============================================================================
// ASP Type Definition
// The ASP is used to transmit a down link RLC/MAC control message to the UE/MS on the specified channel.
// This ASP provides values for "RRBP" and "S/P" fields in MAC header for TTCN controlling the response from the UE, the value for "PayloadType" and "USF" fields in MAC header shall be filled by the SS.If a RLC/MAC control message can not be fitted into one RLC/MAC control block, the SS RLC/MAC entity shall take the responsibility of segmentation of the message, and set the correct "PayloadType" and optional octet1 (and optional octet2).PTCCH is valid for PACKET TIMING ADVANCE/POWER CONTROL message if sending PACKET PAGING REQUEST.The required 52-multiframe occurs when:pagingGroup div (M div 64) = (FN div 52) mod 64The index to the required paging block in the 51-multiframe determined above:Paging block index = pagingGroup mod (M div 64)M = (12 - BS_PAG_BLKS_RES - BS_PBCCH_BLKS) ??64
// -----------------------------------------------------------------------------
type record G_RLC_ControlMsg_REQ {
  GERAN_CellId_Type              cellId,
  PhysicalChId        physicalChId,          // Channel identifier
  G_LogicChType       g_LogicChType,         // PCCCH or PACCH or PTCCH
  integer             tBF_Direction,         // 0 -- downlink; 1 -- uplink
  TFI                 tFI,                   // temporary flow identity
  RRBP                rRBP,                  // relative reserved block period
  S_P_Bit             s_P_Bit,               // supplementary/polling bit
  RFN                 rfn,                   // The reduced frame number of the first frame on which this message is sent.If the field t2 of rfn is coded as '11111'B lower layer shall ignore this field.
  PAGING_GROUP        pagingGroup optional,  // for message other than PACKET PAGING REQUEST this field shall be omitted
  PagingMode          pagingMode,            // 0 -- normal paging;1-- extended paging;3 -- paging reorganization.this field is valid only for PACKET PAGING REQUEST control message, for message other than PACKET PAGING REQUEST this field shall be omitted
  GRLCCntrlMsgReqType msg                    // Down link RLC/MAC control message
};

type union GRLCCntrlMsgReqType {
  PACKETDOWNLINKASSIGNMENT pktDLAssignmt,
  PACKETMEASUREMENTORDER   pktMeasOrder,
  PACKETUPLINKASSIGNMENT   pktULAssignmt
}

type union G_RLC_DATAMESSAGE_REQ {
  G_RLC_ControlMsg_REQ ctrl
}

type union G_RLC_DATAMESSAGE_IND {
  G_RLC_ControlMsg_IND ctrl
}

// =============================================================================
// ASP Type Definition
// The ASP is used to delete a RLC/MAC entity in GERAN emulation module.
// This ASP is used to release any resource used for the RLC/MAC emulation entity in the SS.
// -----------------------------------------------------------------------------
type record G_CRLC_DeleteRLC_MAC_REQ {
  GERAN_CellId_Type          cellId                   // The identifier of the cell
};

// =============================================================================
// ASP Type Definition
// The ASP is used to create a RLC/MAC entity in GERAN RLC/MAC emulation module.
// One RLC/MAC entity per cell can exist, cellId will be used for couping LLC layer module to the RLC/MAC emulation module.
// The packet channel description given in the ChannelSpecificInfo of G_CL1_CreateBasicPhyCh_REQ shall be used to configure
// this layer. This ASP shall be called after the G_CL1_CreateBasicPhyCh_REQ ASP.
// -----------------------------------------------------------------------------
type record G_CRLC_CreateRLC_MAC_REQ {
  GERAN_CellId_Type          cellId                   // The identifier of the cell
};

// =============================================================================
// ASP Type Definition
// The ASP is used to create an LLE (LLC Entity) in GERAN LLC emulation module.
// The RLC/MAC emulation module needs to be created prior to this ASP by G_CRLC_CreateRLC_MAC_REQ ASP.
// -----------------------------------------------------------------------------
type record G_CLLC_CreateLLE_REQ {
  LLMEId          lLMEId,                // Logical Layer Management Entity Id
  GERAN_CellId_Type          rLC_MAC_MappingInfo    // This parameter indicates the RLC/MAC emulation module in the cell, not the cell itself.
};

// =============================================================================
// ASP Type Definition
// The ASP is used to delete an LLE (LLC Entity) in GERAN LLC emulation module.
// -----------------------------------------------------------------------------
type record G_CLLC_DeleteLLE_REQ {
  LLMEId          lLMEId                 // Logical Layer Management Entity Id
};

// =============================================================================
// ASP Type Definition
// The ASP is used to reassign RLC/MAC entity to the specified LLME identity.
// This ASP allows simulation of Intra-SGSN operations in tests.
// -----------------------------------------------------------------------------
type record G_CLLC_ReassignLLE_REQ {
  LLMEId          ILMEId,                // Logical Layer Management Entity Id
  GERAN_CellId_Type          rLC_MAC_MappingInfo,   // This parameter indicates the RLC/MAC emulation module in the cell, not the cell itself
  TLLI            tLLI
};

} // end of group ASPTypes

}

