///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2019 Ericsson Telecom AB
//
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
//
//  File:               GTPv2_Types.ttcn
//  Description:        GTPv2 protocol module
//  Rev:                R2A
//  Prodnr:             CNL 113 846 
//  Contact:            http://ttcn.ericsson.se
//  Reference:          3GPP TS 29.274 v13.7.0
//                      


module GTPv2_Types
{
import from General_Types all;
import from GTPv2_PrivateExtensions all;

external function enc_PDU_GTPCv2(in PDU_GTPCv2 pdu) return octetstring
with { extension "prototype(convert)" extension "encode(RAW)" }

external function dec_PDU_GTPCv2(in octetstring stream) return PDU_GTPCv2
with { extension "prototype(convert)" extension "decode(RAW)" }

external function enc_PDU_GTPCv2_fast(in PDU_GTPCv2 pdu, out octetstring stream)
with { extension "prototype(fast) encode(RAW)" }

external function dec_PDU_GTPCv2_backtrack(in octetstring stream, out PDU_GTPCv2 pdu) return integer
with { extension "prototype(backtrack) decode(RAW)" }


// Information Elements

//8.2.1A For future use
type record Special_IE_Type_Extension
{
  OCT1                         elementIdentifier,  // dec 254, 'FE'O;  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  IE_Extension_UnionType       iE_Type_Extension
} with { 
  variant (lengthIndicator) "LENGTHTO(iE_Type_Extension)"; 
  variant "PRESENCE (elementIdentifier = 'FE'O; )";
};

type union IE_Extension_UnionType
{
  IE_Type_Extension  iE_Type_Extension
}

type record IE_Type_Extension
{
  OCT2                         elementIdentifier,
  octetstring                  valueField
}

// 8.3
type record IMSI
{
  OCT1              elementIdentifier,  //dec 1, '01'O  
  LIN2_BO_LAST      lengthIndicator,
  BIT4              instance,
  BIT4              spare,
  hexstring         iMSI_Value 
} with { 
  variant "PRESENCE (elementIdentifier = '01'O;)"   
  variant (lengthIndicator) "LENGTHTO(iMSI_Value)" 
  variant (iMSI_Value) "PADDING(yes)";
  variant (iMSI_Value) "PADDING_PATTERN('1'B)"
};

// 8.4
type record Cause
{
  OCT1              elementIdentifier, //dec 2, '02'O  
  LIN2_BO_LAST      lengthIndicator,
  BIT4              instance,
  BIT4              spare,
  OCT1              causeValue,
  BIT1              cS,
  BIT1              bCE,
  BIT1              pCE,
  BIT5              spare2,
  OCT1              typeOfOffendingIE optional,
  LIN2_BO_LAST      lengthIndicator2 optional,
  BIT4              instanceOfOffendingIE optional,
  BIT4              spare3 optional
} with { 
  variant "PRESENCE (elementIdentifier = '02'O; )" 
  variant (lengthIndicator) "LENGTHTO(causeValue,cS,bCE,pCE,spare2,typeOfOffendingIE,
  lengthIndicator2,instanceOfOffendingIE,spare3 )" 
};

// 8.5
type record Recovery
{
  OCT1              elementIdentifier,  // dec 3, '03'O 
  LIN2_BO_LAST      lengthIndicator,
  BIT4              instance,
  BIT4              spare,
  integer           recoveryValue
} with { 
  variant (lengthIndicator) "LENGTHTO(recoveryValue)"
  variant "PRESENCE (elementIdentifier = '03'O; )" 
}; 

// 8.6 
type record AccessPointName
{
  OCT1              elementIdentifier, // dec 71, '47'O
  LIN2_BO_LAST      lengthIndicator,
  BIT4              instance,
  BIT4              spare,
  octetstring       aPN_Value 
} with { 
  variant (lengthIndicator) "LENGTHTO(aPN_Value)"
  variant "PRESENCE (elementIdentifier = '47'O; )"   
}; 

// 8.7 
type record AggregateMaximumBitRate
{
  OCT1              elementIdentifier, // dec 72, '48'O  
  LIN2_BO_LAST      lengthIndicator,
  BIT4              instance,
  BIT4              spare,
  OCT4              aPN_AMBR_for_uplink, 
  OCT4              aPN_AMBR_for_downlink
} with { 
  variant (lengthIndicator) "LENGTHTO(aPN_AMBR_for_uplink,aPN_AMBR_for_downlink)"
  variant "PRESENCE (elementIdentifier = '48'O; )" 
}; 

//8.8
type record EPS_BearerID
{
  OCT1              elementIdentifier, // dec 73, '49'O  
  LIN2_BO_LAST      lengthIndicator,
  BIT4              instance,
  BIT4              spare,
  integer           ePS_Bearer_ID_Value,
  BIT4              spare2,   //'0000'B
  octetstring       additionalOctets  optional 
}with { 
  variant (lengthIndicator) "LENGTHTO(ePS_Bearer_ID_Value,spare2,additionalOctets)"
  variant "PRESENCE (elementIdentifier = '49'O; )"
  variant(ePS_Bearer_ID_Value) "FIELDLENGTH(4)"; 
};

type set of EPS_BearerID EPS_BearerID_List;

//8.9
type union IPv4_IPv6_Address{
  OCT4                       iPv4_Address,
  OCT16                      iPv6_Address
};

type record IP_Address
{
  OCT1                elementIdentifier,  // dec 74, '4A'O   
  LIN2_BO_LAST        lengthIndicator,
  BIT4                instance,
  BIT4                spare,
  IPv4_IPv6_Address   iPv4_IPv6_Address
} with { 
  variant (lengthIndicator) "LENGTHTO(iPv4_IPv6_Address)"
  variant "PRESENCE (elementIdentifier = '4A'O; )" 
  variant (iPv4_IPv6_Address) "CROSSTAG( iPv4_Address, lengthIndicator = 4;
  iPv6_Address, lengthIndicator = 16)"
};

type set of IP_Address IP_Address_List;

//8.10
type record MEI
{
  OCT1                elementIdentifier, // dec 75, '4B'O;
  LIN2_BO_LAST        lengthIndicator,
  BIT4                instance,
  BIT4                spare,
  octetstring         mEI_Value
} with { 
  variant (lengthIndicator) "LENGTHTO(mEI_Value)"
  variant "PRESENCE (elementIdentifier = '4B'O; )" 
};

//8.11
type record MSISDN
{
  OCT1                elementIdentifier,  // dec 76, '4C'O; 
  LIN2_BO_LAST        lengthIndicator,
  BIT4                instance,
  BIT4                spare,
  hexstring           mSISDN_Value 
}  with { 
  variant (lengthIndicator) "LENGTHTO(mSISDN_Value)"
  variant "PRESENCE (elementIdentifier = '4C'O; )" 
  variant (mSISDN_Value) "PADDING(yes)";
  variant (mSISDN_Value) "PADDING_PATTERN('1'B)"  

};

type set of MSISDN MSISDN_List;

//8.12
type record Indication
{
  OCT1                elementIdentifier,   // dec 77, '4D'O; 
  LIN2_BO_LAST        lengthIndicator,
  BIT4                instance,
  BIT4                spare,
  BIT1                sGWCI,
  BIT1                iSRAI,
  BIT1                iSRSI,
  BIT1                oI,           
  BIT1                dFI,
  BIT1                hI,
  BIT1                dTF,
  BIT1                dAF,
  BIT1                mSV,
  BIT1                sI,
  BIT1                pT,
  BIT1                pBit,
  BIT1                cRSI,
  BIT1                cFSI,
  BIT1                uIMSI,
  BIT1                sQCI,
  BIT1                cCRSI optional,
  BIT1                iSRAU optional, 
  BIT1                mBMDT optional,
  BIT1                s4AF optional,
  BIT1                s6AF optional,
  BIT1                sRNI optional,
  BIT1                pBIC optional,
  BIT1                retLoc optional, 
  BIT1                cPSR optional,
  BIT1                cLII optional,
  BIT1                cSFBI optional, 
  BIT1                pPSI optional, 
  BIT1                pPON_PPEI optional, 
  BIT1                pPOF optional, 
  BIT1                aRRL optional, 
  BIT1                cPRAI optional, 
  BIT1                aOPI optional, 
  BIT1                aOSI optional, 
  BIT1                pCRI optional,
  BIT1                pSCI optional,
  BIT1                bDWI optional,
  BIT1                dTCI optional,
  BIT1                uASI optional,
  BIT1                nSI optional,
  BIT1                wPMSI optional,
  BIT1                uNACCSI optional,
  BIT1                pNSI optional,
  BIT1                s11TF optional,
  BIT1                pMTSMI optional,
  BIT1                cPOPCI optional,
  BIT1                ePCOSI optional,
  BIT1                rOAAI optional,
  BIT1                tSPCMI optional,
  BIT1                spare_1 optional,
  BIT1                spare_2 optional,
  BIT1                spare_3 optional,
  BIT1                spare_4 optional,
  BIT1                spare_5 optional,
  BIT1                spare_6 optional,
  BIT1                spare_7 optional,
  octetstring         additionalOctets  optional   
} with { 
  variant (lengthIndicator) "LENGTHTO(sGWCI,iSRAI,iSRSI,oI,dFI,hI,dTF,dAF,
  mSV,sI,pT,pBit,cRSI,cFSI,uIMSI,sQCI, 
  cCRSI, iSRAU,mBMDT,s4AF,s6AF,sRNI,pBIC,retLoc,
  cPSR,cLII,cSFBI,pPSI,pPON_PPEI,pPOF,aRRL,cPRAI,aOPI,aOSI,pCRI,pSCI,bDWI,dTCI,uASI,nSI,
  wPMSI,uNACCSI,pNSI,s11TF,pMTSMI,cPOPCI,ePCOSI,rOAAI, tSPCMI, spare_1, spare_2, spare_3, spare_4, spare_5, spare_6, spare_7, additionalOctets)"
  variant "PRESENCE (elementIdentifier = '4D'O; )"
};

type set of Indication Indication_List;

//8.13
// 24.301 (9.9.4.8) -> 24.008 (10.5.6.3)
type set of  ProtocolID_or_ContainerID   ProtocolIDs_and_ContainerIDs;

type record ProtocolID_or_ContainerID
{
  OCT2               protocolID_or_ContainerID,
  LIN1               lengthIndicator,
  octetstring        protID_orContID_Contents
} with { variant (lengthIndicator) "LENGTHTO (protID_orContID_Contents)"};

type record ProtocolConfigOptions
{
  OCT1                         elementIdentifier, // dec 78 '4E'O;
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT3                         configProtocol,
  BIT4                         spare2,  //'0000'B
  BIT1                         extensionField,   //'1'B
  ProtocolIDs_and_ContainerIDs protocolIDs_and_ContainerIDs optional
} with { 
  variant (lengthIndicator) "LENGTHTO(configProtocol,spare2,extensionField,protocolIDs_and_ContainerIDs)"
  variant "PRESENCE (elementIdentifier = '4E'O; )" 
};

//8.14 
type union PDN_Address_and_Prefix{
  OCT4                       iPv4_Address,
  IPv6                       iPv6_Address,
  IPv4_IPv6                  iPv4_IPv6 
};

type record IPv6
{
  integer   prefixLength, 
  OCT16     iPv6_Address 
};

type record IPv4_IPv6
{
  integer          prefixLength, 
  OCT16            iPv6_Address, 
  OCT4             iPv4_Address
};

type record PDN_AddressAllocation
{
  OCT1                         elementIdentifier,  // dec 79 '4F'O;
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT3                         pDN_Type,
  BIT5                         spare2,  //'00000'B
  PDN_Address_and_Prefix       pDN_Address_and_Prefix optional
} with { 
  variant (lengthIndicator) "LENGTHTO(pDN_Type,spare2,pDN_Address_and_Prefix)"
  variant "PRESENCE (elementIdentifier = '4F'O; )"
  variant (pDN_Address_and_Prefix) "CROSSTAG
  (
  iPv4_Address,             pDN_Type ='001'B;
  iPv6_Address,             pDN_Type ='010'B;
  iPv4_IPv6,                pDN_Type ='011'B;  
  )"
};

//8.15
type record Bearer_QoS
{
  OCT1                         elementIdentifier,  // dec 80 '50'O; 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT1                         pVI,
  BIT1                         spare2,
  BIT4                         pL,
  BIT1                         pCI,
  BIT1                         spare3,  
  OCT1                         labelQCI,
  OCT5                         maxBitrateUplink,
  OCT5                         maxBitrateDownLink,
  OCT5                         guaranteedBitrateUplink,
  OCT5                         guaranteedBitrateDownLink,
  octetstring                  additionalOctets optional  
} with { 
  variant (lengthIndicator) "LENGTHTO(pVI,spare2,pL,pCI,spare3,
  labelQCI,maxBitrateUplink,maxBitrateDownLink,
  guaranteedBitrateUplink,guaranteedBitrateDownLink,additionalOctets)"
  variant "PRESENCE (elementIdentifier = '50'O; )" 
};

//8.16
type record FlowQoS
{
  OCT1                         elementIdentifier,  // dec 81 '51'O;  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT1                         labelQCI,
  OCT5                         maxBitrateUplink,
  OCT5                         maxBitrateDownLink,
  OCT5                         guaranteedBitrateUplink,
  OCT5                         guaranteedBitrateDownLink,
  octetstring                  additionalOctets  optional  
}with { 
  variant (lengthIndicator) "LENGTHTO(labelQCI,maxBitrateUplink,maxBitrateDownLink,guaranteedBitrateUplink,guaranteedBitrateDownLink,additionalOctets)"
  variant "PRESENCE (elementIdentifier = '51'O; )" 
};

//8.17
type record RAT_Type
{
  OCT1                         elementIdentifier,  // dec 82, '52'O;   
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  integer                      rAT_TypeValue,
  octetstring                  additionalOctets  optional 
} with { 
  variant (lengthIndicator) "LENGTHTO(rAT_TypeValue,additionalOctets)"
  variant "PRESENCE (elementIdentifier = '52'O; )" 
};

//8.18
type record ServingNetwork
{
  OCT1                         elementIdentifier,   // dec 83, '53'O;   
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  HEX1                         mccDigit1,  
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  octetstring                  additionalOctets  optional 
}with { 
  variant (lengthIndicator) "LENGTHTO(mccDigit1,mccDigit2,mccDigit3,mncDigit3,mncDigit1,mncDigit2,additionalOctets)"
  variant "PRESENCE (elementIdentifier = '53'O; )" 
};

//8.19 24.008 10.5.6.12
type union TrafficFlowTemplateV
{
  TrafficFlowTemplateV_CreateAddReplaceTFT
  trafficFlowTemplateV_CreateAddReplaceTFT,
  TrafficFlowTemplateV_DeletePacketFilter
  trafficFlowTemplateV_DeletePacketFilter,
  TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation
  trafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation
};


type record TrafficFlowTemplateV_CreateAddReplaceTFT
{
  integer                                numberOfPacketFilters,
  BIT1                                   eBIT,
  BIT3                                   operationCodeTFT, 
  PacketFilterList_CreateAddReplaceTFT   packetFilterList_CreateAddReplaceTFT,
  ParametersList                         parametersList            optional
} with {
  variant "PRESENCE (operationCodeTFT  = '001'B, //  Create New TFT
  operationCodeTFT  = '011'B, //  Add packet filters to existing TFT
  operationCodeTFT  = '100'B  //  Replace packet filters in existing TFT
  )";
  variant(parametersList)       "PRESENCE(eBIT = '1'B)";
  variant(numberOfPacketFilters)"FIELDLENGTH(4)";
  variant(numberOfPacketFilters)"LENGTHTO(packetFilterList_CreateAddReplaceTFT)";
  variant(numberOfPacketFilters)"UNIT(elements)";
};


type record TrafficFlowTemplateV_DeletePacketFilter
{
  integer                                numberOfPacketFilters,
  BIT1                                   eBIT,
  BIT3                                   operationCodeTFT,
  //'101'B or '011'B or '100'B
  PacketFilterList_DeletePacketFilter    packetFilterList_DeletePacketFilter,
  ParametersList                         parametersList         optional
} with {
  variant "PRESENCE (operationCodeTFT = '101'B)"  // Delete packet filters from existing TFT
  variant(parametersList) "PRESENCE(eBIT = '1'B)";
  variant(numberOfPacketFilters)"FIELDLENGTH(4)";
  variant(numberOfPacketFilters)"LENGTHTO(packetFilterList_DeletePacketFilter)";
  variant  (numberOfPacketFilters)"UNIT(elements)";
};


type record TrafficFlowTemplateV_Delete_Existing_TFT_or_No_TFT_Operation
{
  BIT4                         numberOfPacketFilters, //'0000'B
  // numberOfPacketFilters is meaningless here since there is no PacketFilterList
  BIT1                         eBIT,
  BIT3                         operationCodeTFT,      // '010'B  or '110'B
  ParametersList               parametersList   optional
} with {
  variant "PRESENCE (operationCodeTFT = '010'B,  // delete existing TFT
  operationCodeTFT = '110'B   // No TFT Operation
  )";
  variant (parametersList) "PRESENCE(eBIT = '1'B)"
};


type record of PacketFilter PacketFilterList_CreateAddReplaceTFT;


type record PacketFilter
{
  PacketFilterIdentifier       identifier,
  OCT1                         evaluationPrecedence,
  LIN1                         lengthIndicator,
  octetstring                  contents
} with { variant (lengthIndicator) "LENGTHTO (contents)"};


type record of PacketFilterIdentifier  PacketFilterList_DeletePacketFilter;

type record  PacketFilterIdentifier
{
  BIT4     identifier,
  BIT2     direction,
  BIT2     spare
};


type record of Parameter ParametersList;


type record Parameter
{
  OCT1               parameterIdentifier,
  LIN1               lengthIndicator,
  octetstring        contents
} with { variant (lengthIndicator) "LENGTHTO (contents)"};


type record EPS_BearerLevel_TFT
{
  OCT1                         elementIdentifier,   // dec 84, '54'O;   
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  TrafficFlowTemplateV         trafficFlowTemplateValue
} with { 
  variant (lengthIndicator) "LENGTHTO(trafficFlowTemplateValue)"
  variant "PRESENCE (elementIdentifier = '54'O; )";  
};

type set of EPS_BearerLevel_TFT EPS_BearerLevel_TFT_List;

//8.20
type record TrafficAggregateDescription
{
  OCT1                         elementIdentifier,     // dec 85, '55'O; 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  octetstring                  trafficAggregateDescriptionValue          
} with { 
  variant (lengthIndicator) "LENGTHTO(trafficAggregateDescriptionValue)"
  variant "PRESENCE (elementIdentifier = '55'O; )";  
};

//8.21
type record UserLocationInfo
{
  OCT1                         elementIdentifier,   // dec 86, '56'O; 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT1                         cGI_Flag,
  BIT1                         sAI_Flag,
  BIT1                         rAI_Flag,
  BIT1                         tAI_Flag,
  BIT1                         eCGI_Flag, 
  BIT1                         lAI_Flag, 
  BIT2                         spare2,
  CGI                          cGI optional,
  SAI                          sAI optional,
  RAI                          rAI optional,
  TAI                          tAI optional,
  ECGI                         eCGI optional,
  LAI                          lAI optional,
  octetstring                  additionalOctets  optional 
} with { 
  variant (lengthIndicator) "LENGTHTO(cGI_Flag,sAI_Flag,rAI_Flag,tAI_Flag,eCGI_Flag,
  lAI_Flag,spare2,cGI,sAI,rAI,tAI,eCGI,lAI,additionalOctets)"
  variant(cGI)       "PRESENCE(cGI_Flag = '1'B)";
  variant(sAI)       "PRESENCE(sAI_Flag = '1'B)";
  variant(rAI)       "PRESENCE(rAI_Flag = '1'B)";
  variant(tAI)       "PRESENCE(tAI_Flag = '1'B)";
  variant(eCGI)      "PRESENCE(eCGI_Flag = '1'B)";
  variant(lAI)       "PRESENCE(lAI_Flag = '1'B)";  
  variant "PRESENCE (elementIdentifier = '56'O; )"   
};

//8.21.1
type record CGI
{  
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3, 
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  OCT2                         lAC,
  OCT2                         cI
};

//8.21.2
type record SAI
{
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1, 
  HEX1                         mncDigit2, 
  OCT2                         lAC,
  OCT2                         sAC  
};

//8.21.3
type record RAI 
{
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  OCT2                         lAC,
  OCT2                         rAC  
};  

//8.21.4
type record TAI
{
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1, 
  HEX1                         mncDigit2, 
  OCT2                         tAC 
};  

//8.21.5
type record ECGI
{
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1, 
  HEX1                         mncDigit2,
  HEX1                         spare,                  
  integer                      eCI    
} with { 
  variant (spare,eCI) "FIELDORDER(msb)";                  
  variant(eCI) "FIELDLENGTH(28)";
  variant (eCI) "BYTEORDER(last)";
};  

//8.21.6
type record LAI
{
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1, 
  HEX1                         mncDigit2,
  OCT2                         lAC
}

//8.22
type record FullyQualifiedTEID
{
  OCT1                         elementIdentifier,   // dec 87, '57'O; 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  integer                      interfaceType, 
  BIT1                         v6_Flag,
  BIT1                         v4_Flag,
  OCT4                         tEID_GRE_Key,
  OCT4                         iPv4_Address optional,
  OCT16                        iPv6_Address optional,
  octetstring                  additionalOctets  optional    
} with {   
  variant "PRESENCE (elementIdentifier = '57'O; )" 
  variant (lengthIndicator) "LENGTHTO(interfaceType,v6_Flag,v4_Flag,tEID_GRE_Key,
  iPv4_Address,iPv6_Address,additionalOctets)" 
  variant(interfaceType) "FIELDLENGTH(6)";
  variant(iPv4_Address)  "PRESENCE(v4_Flag = '1'B)";
  variant(iPv6_Address)  "PRESENCE(v6_Flag = '1'B)";
}; 

type set of FullyQualifiedTEID FullyQualifiedTEID_List;

//8.23
type record TMSI
{
  OCT1                         elementIdentifier,  // dec 88, '58'O;  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT4                         tMSI_Value 
} with { 
  variant (lengthIndicator) "LENGTHTO(tMSI_Value)"; 
  variant "PRESENCE (elementIdentifier = '58'O; )";
};

//8.24
type record GlobalCN_ID
{
  OCT1                         elementIdentifier,  // dec 89, '59'O;  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3, 
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  octetstring                  cN_ID  
} with { 
  variant (lengthIndicator) "LENGTHTO(mccDigit1,mccDigit2,mccDigit3,mncDigit3,mncDigit1,mncDigit2,cN_ID)"
  variant "PRESENCE (elementIdentifier = '59'O; )";  
};

//8.25
type record EPS_Bearer_ID
{
  integer   ePS_Bearer_ID_Value,
  BIT4      spare    // '0000'B
} with {
  variant(ePS_Bearer_ID_Value) "FIELDLENGTH(4)";}

type set of EPS_Bearer_ID EPS_Bearer_IDs;

type record S103_PDF
{
  OCT1                         elementIdentifier,// dec 90, '5A'O; 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  integer                      hSGW_AddrForForwardingLength (4,16),
  octetstring                  hSGW_AddrForForwarding length (4..16),
  OCT4                         gRE_Key,
  integer                      ePSBearerID_Number,
  EPS_Bearer_IDs               ePS_Bearer_IDs  
} with { 
  variant (lengthIndicator) "LENGTHTO(hSGW_AddrForForwardingLength,hSGW_AddrForForwarding,gRE_Key,ePSBearerID_Number,ePS_Bearer_IDs)"; 
  variant "PRESENCE (elementIdentifier = '5A'O; )";  
  variant (hSGW_AddrForForwardingLength) "LENGTHTO(hSGW_AddrForForwarding)"; 
  variant (ePSBearerID_Number) "LENGTHTO(ePS_Bearer_IDs)";
  variant (ePSBearerID_Number) "UNIT (elements)";   
};

type set of S103_PDF S103_PDF_List

//8.26
type record S1_UDF
{
  OCT1                         elementIdentifier,  // dec 91, '5B'O; 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  integer                      ePS_Bearer_ID_Value,
  BIT4                         spare2,    // '0000'B 
  integer                      servingGWAddrLength (0,4,16),
  octetstring                  servingGWAddr length (4..16) optional,    
  OCT4                         servingGW_S1U_TEID    
} with { 
  variant (lengthIndicator) "LENGTHTO(ePS_Bearer_ID_Value,spare2,servingGWAddrLength,servingGWAddr,servingGW_S1U_TEID)";
  variant "PRESENCE (elementIdentifier = '5B'O; )"; 
  variant(ePS_Bearer_ID_Value) "FIELDLENGTH(4)";
  variant (servingGWAddrLength) "LENGTHTO(servingGWAddr)";
};

type set of S1_UDF S1_UDF_List

//8.27
type record DelayValue
{
  OCT1                         elementIdentifier,   // dec 92 , '5C'O 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  integer                      delayValue, //(integer multiples of 50 millisec)
  octetstring                  additionalOctets  optional 
} 
with { 
  variant (lengthIndicator) "LENGTHTO(delayValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '5C'O; )";  
};

//8.28 - Grouped
type set BearerContextIEs
{
  EPS_BearerID                     ePS_Bearer_ID optional,
  Cause                            cause optional,
  EPS_BearerLevel_TFT              ePS_Bearer_TFT optional,  
  FullyQualifiedTEID_List          fullyQualifiedTEID optional, 
  Bearer_QoS                       bearerLevel_QoS optional,
  ChargingID                       chargingID optional,
  BearerFlags                      bearerFlags optional,
  TransactionIdentifier            transactionIdentifier optional,
  ProtocolConfigOptions            protocolConfigOptions optional,
  RAN_NASCause_List                rAN_NASCause optional,
  APCO                             additionalProtocolConfigOptions optional,
  ExtendedProtocolConfigOptions    extendedProtocolConfigOptions optional
}
with { 
  variant(fullyQualifiedTEID) "REPEATABLE(yes)"; 
  variant(rAN_NASCause) "REPEATABLE(yes)"; 
};

type record BearerContextGrouped
{
  OCT1                         elementIdentifier, // dec 93 , '5D'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,  
  BIT4                         spare,
  BearerContextIEs             bearerContextIEs
} with { 
  variant (lengthIndicator) "LENGTHTO(bearerContextIEs)"; 
  variant "PRESENCE (elementIdentifier = '5D'O; )"; 
};

type set of BearerContextGrouped BearerContextGrouped_List;

//8.29
type record ChargingID
{
  OCT1                         elementIdentifier, // dec 94, '5E'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT4                         chargingID_Value,
  octetstring                  additionalOctets  optional    
} with { 
  variant (lengthIndicator) "LENGTHTO(chargingID_Value,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '5E'O; )"; 
};

//8.30
type record ChargingCharacteristics
{
  OCT1                         elementIdentifier, // dec 95, '5F'O 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT2                         chargingCharacteristicsValue,
  octetstring                  additionalOctets  optional
} with { 
  variant (lengthIndicator) "LENGTHTO(chargingCharacteristicsValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '5F'O; )"; 
};

//8.31
type record TraceInformation
{
  OCT1                         elementIdentifier, // dec 96, '60'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3, 
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  OCT3                         traceIDValue,
  OCT9                         triggeringEvents,
  OCT2                         listOfNE_Types,  
  OCT1                         sessionTraceDepth, 
  OCT12                        listOfInterfaces,
  octetstring                  iPAddressOfTraceCollectionEntity 
} with { 
  variant (lengthIndicator) "LENGTHTO(mccDigit1,mccDigit2,mccDigit3,mncDigit3, mncDigit1,mncDigit2,
  traceIDValue,triggeringEvents,listOfNE_Types,sessionTraceDepth,
  listOfInterfaces,iPAddressOfTraceCollectionEntity)"; 
  variant "PRESENCE (elementIdentifier = '60'O; )";        
};

//8.32
type record BearerFlags
{
  OCT1                         elementIdentifier, // dec 97, '61'O 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT1                         pPC,
  BIT1                         vB,
  BIT1                          vind,
  BIT1                          aSI,
  BIT4                         spare2,
  octetstring                  additionalOctets  optional
} with { 
  variant (lengthIndicator) "LENGTHTO(pPC,vB,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '61'O; )"; 
};

//8.33
//VOID

//8.34
type record PDN_Type
{
  OCT1                         elementIdentifier,   // dec 99, '63'O 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT3                         pDN_TypeValue,
  BIT5                         spare2,
  octetstring                  additionalOctets  optional
} with { 
  variant (lengthIndicator) "LENGTHTO(pDN_TypeValue,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '63'O; )";  
};

//8.35
type record ProcedureTransactionID
{
  OCT1                         elementIdentifier,  // dec 100, '64'O 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  integer                      pTI_Value,
  octetstring                  additionalOctets  optional
} with { 
  variant (lengthIndicator) "LENGTHTO(pTI_Value,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '64'O; )";      
};

//8.36 Void

//8.37 Void

//8.38
type union MM_Context
{
  GSM_Key_and_Triplets                         gSM_Key_and_Triplets,
  UMTS_Key_UsedCipher_and_Quintuplets          uMTS_Key_UsedCipher_and_Quintuplets,
  GSM_Key_UsedCipher_and_Quintuplets           gSM_Key_UsedCipher_and_Quintuplets,
  UMTS_key_and_Quintuplets                     uMTS_key_and_Quintuplets,
  EPS_SecurityContext_and_Quadruplets          ePS_SecurityContext_and_Quadruplets,
  UMTS_Key_Quadruplets_and_Quintuplets         uMTS_Key_Quadruplets_and_Quintuplets
}

type set of AuthTriplet AuthTriplets;

type record AuthTriplet
{
  OCT16     rAND,
  OCT4      sRES,
  OCT8      kc
};

type set of AuthQuintuplet AuthQuintuplets;

type record AuthQuintuplet { 
  OCT16                     rand,
  integer                   xresLength,
  octetstring               xres,
  OCT16                     ck,
  OCT16                     ik,
  integer                   autnLength,
  octetstring               autn 
} with {
  variant (xresLength) "LENGTHTO(xres)";
  variant (autnLength) "LENGTHTO(autn)"; 
};

type set of AuthQuadruplet AuthQuadruplets;

type record AuthQuadruplet
{
  OCT16                     rand,
  integer                   xresLength,
  octetstring               xres,
  integer                   autnLength,
  octetstring               autn,
  octetstring               k_asme length (32) 
} with {
  variant (xresLength) "LENGTHTO(xres)";
  variant (autnLength) "LENGTHTO(autn)"; 
};

type record GSM_Key_and_Triplets
{
  OCT1                         elementIdentifier,  // dec 103, '67'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT3                         cksn,
  BIT1                         dRXI,
  BIT1                         spare2,
  integer                      securityMode, 
  BIT1                         sAMBRI,  
  BIT1                         uAMBRI,
  BIT3                         spare3,
  integer                      noofTriplets, 
  BIT3                         usedCipher,
  BIT5                         spare4, 
  OCT8                         kc, 
  AuthTriplets                 triplets, 
  OCT2                         drx_par optional,  
  OCT4                         uplinkSubscribedUE_AMBR optional,
  OCT4                         downlinkSubscribedUE_AMBR optional,
  OCT4                         uplinkUsedUE_AMBR optional,
  OCT4                         downlinkUsedUE_AMBR optional, 
  integer                      lengthOfUE_NEtworkCapability,
  octetstring                  uE_NEtworkCapability, 
  integer                      lengthOfMS_NetworkCapability,
  octetstring                  mS_NetworkCapability, 
  integer                      lengthOfMobileEquipmentIdentity,
  octetstring                  mobileEquipmentIdentity,
  BIT1                         uNA,
  BIT1                         gENA,
  BIT1                         gANA,
  BIT1                         iNA,
  BIT1                         eNA,
  BIT1                         hNNA,
  BIT1                         nBNA,
  BIT1                         spare5,  
  integer                      lengthOfVoiceDomainPreferenceAndUEsUsageSetting optional, //"extendable" optional for backward compatibility
  octetstring                  voiceDomainPreferenceAndUEsUsageSetting optional,         //"extendable" optional for backward compatibility
  octetstring                  additionalOctets  optional                                //"extendable" optional for backward compatibility
} with { 
  variant (lengthIndicator) "LENGTHTO(cksn,dRXI,spare2,securityMode,sAMBRI,uAMBRI,spare3,noofTriplets,usedCipher,spare4, 
  kc,triplets,drx_par,uplinkSubscribedUE_AMBR,downlinkSubscribedUE_AMBR,
  uplinkUsedUE_AMBR,downlinkUsedUE_AMBR,lengthOfUE_NEtworkCapability,
  uE_NEtworkCapability,lengthOfMS_NetworkCapability,mS_NetworkCapability,
  lengthOfMobileEquipmentIdentity,mobileEquipmentIdentity,
  uNA,gENA,gANA,iNA,eNA,hNNA,nBNA,spare5,
  lengthOfVoiceDomainPreferenceAndUEsUsageSetting,
  voiceDomainPreferenceAndUEsUsageSetting,
  additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '67'O; )";   
  variant (securityMode) "FIELDLENGTH(3)";  
  variant (noofTriplets) "FIELDLENGTH(3)"; 
  variant (noofTriplets) "LENGTHTO(triplets)";
  variant (noofTriplets) "UNIT(elements)";  
  variant (drx_par) "PRESENCE (dRXI = '1'B; )";  
  variant (lengthOfUE_NEtworkCapability) "LENGTHTO(uE_NEtworkCapability)";  
  variant (lengthOfMS_NetworkCapability) "LENGTHTO(mS_NetworkCapability)";  
  variant (lengthOfMobileEquipmentIdentity) "LENGTHTO(mobileEquipmentIdentity)"; 
  variant (lengthOfVoiceDomainPreferenceAndUEsUsageSetting) "LENGTHTO(voiceDomainPreferenceAndUEsUsageSetting)";  
  variant (uplinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";  
  variant (downlinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";    
  variant (uplinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";  
  variant (downlinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";           
};

type record UMTS_Key_UsedCipher_and_Quintuplets
{
  OCT1                         elementIdentifier,  // dec 104, '68'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT3                         cksn_ksi,
  BIT1                         dRXI,
  BIT1                         spare2,
  integer                      securityMode, 
  BIT1                         sAMBRI,
  BIT1                         uAMBRI,
  BIT1                         uGIPAI,
  BIT1                         gUPII,
  BIT1                         spare3,  
  integer                      noofQuintuplets, 
  BIT3                         usedCipher,
  BIT3                         usedGPRSIntegrityProtectionAlgorithm,
  BIT2                         spare4,  
  OCT16                        ck,
  OCT16                        ik, 
  AuthQuintuplets              quintuplets, 
  OCT2                         drx_par optional,    
  OCT4                         uplinkSubscribedUE_AMBR optional,
  OCT4                         downlinkSubscribedUE_AMBR optional,
  OCT4                         uplinkUsedUE_AMBR optional,
  OCT4                         downlinkUsedUE_AMBR optional, 
  integer                      lengthOfUE_NEtworkCapability,
  octetstring                  uE_NEtworkCapability, 
  integer                      lengthOfMS_NetworkCapability,
  octetstring                  mS_NetworkCapability, 
  integer                      lengthOfMobileEquipmentIdentity,
  octetstring                  mobileEquipmentIdentity,
  BIT1                         uNA,
  BIT1                         gENA,
  BIT1                         gANA,
  BIT1                         iNA,
  BIT1                         eNA,
  BIT1                         hNNA,
  BIT1                         nBNA,
  BIT1                         spare5,  
  integer                      lengthOfVoiceDomainPreferenceAndUEsUsageSetting optional, //"extendable" optional for backward compatibility
  octetstring                  voiceDomainPreferenceAndUEsUsageSetting optional,         //"extendable" optional for backward compatibility
  integer                      lengthOfHigherBitratesThan16Mbpsflags optional,           //"extendable" optional for backward compatibility
  octetstring                  higherBitratesThan16Mbpsflags optional,                   //"extendable" optional for backward compatibility
  octetstring                  additionalOctets  optional                                //"extendable" optional for backward compatibility
} with { 
  variant (lengthIndicator) "LENGTHTO(cksn_ksi,dRXI,spare2,securityMode,sAMBRI,uAMBRI,uGIPAI,gUPII,spare3,noofQuintuplets, 
  usedCipher,usedGPRSIntegrityProtectionAlgorithm,spare4,ck,ik,quintuplets,drx_par,uplinkSubscribedUE_AMBR,
  downlinkSubscribedUE_AMBR,uplinkUsedUE_AMBR,downlinkUsedUE_AMBR, 
  lengthOfUE_NEtworkCapability,uE_NEtworkCapability,lengthOfMS_NetworkCapability,
  mS_NetworkCapability,lengthOfMobileEquipmentIdentity,mobileEquipmentIdentity,
  uNA,gENA,gANA,iNA,eNA,hNNA,nBNA,spare5,
  lengthOfVoiceDomainPreferenceAndUEsUsageSetting,
  voiceDomainPreferenceAndUEsUsageSetting,
  lengthOfHigherBitratesThan16Mbpsflags,
  higherBitratesThan16Mbpsflags,
  additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '68'O; )";   
  variant (securityMode) "FIELDLENGTH(3)";  
  variant (noofQuintuplets) "FIELDLENGTH(3)";
  variant (noofQuintuplets) "LENGTHTO(quintuplets)";
  variant (noofQuintuplets) "UNIT(elements)"; 
  variant (drx_par) "PRESENCE (dRXI = '1'B; )";  
  variant (lengthOfUE_NEtworkCapability) "LENGTHTO(uE_NEtworkCapability)";  
  variant (lengthOfMS_NetworkCapability) "LENGTHTO(mS_NetworkCapability)";  
  variant (lengthOfMobileEquipmentIdentity) "LENGTHTO(mobileEquipmentIdentity)"; 
  variant (lengthOfVoiceDomainPreferenceAndUEsUsageSetting) "LENGTHTO(voiceDomainPreferenceAndUEsUsageSetting)";  
  variant (lengthOfHigherBitratesThan16Mbpsflags) "LENGTHTO(higherBitratesThan16Mbpsflags)";  
  variant (uplinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";  
  variant (downlinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";    
  variant (uplinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";  
  variant (downlinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";       
};

type record GSM_Key_UsedCipher_and_Quintuplets
{
  OCT1                         elementIdentifier,  // dec 105, '69'O 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT3                         cksn_ksi,
  BIT1                         dRXI,
  BIT1                         spare2,
  integer                      securityMode, 
  BIT1                         sAMBRI,
  BIT1                         uAMBRI,
  BIT3                         spare3,  
  integer                      noofQuintuplets,  
  BIT3                         usedCipher,
  BIT5                         spare4,  
  OCT8                         kc, 
  AuthQuintuplets              quintuplets, 
  OCT2                         drx_par optional,     
  OCT4                         uplinkSubscribedUE_AMBR optional,
  OCT4                         downlinkSubscribedUE_AMBR optional,
  OCT4                         uplinkUsedUE_AMBR optional,
  OCT4                         downlinkUsedUE_AMBR optional, 
  integer                      lengthOfUE_NEtworkCapability,
  octetstring                  uE_NEtworkCapability, 
  integer                      lengthOfMS_NetworkCapability,
  octetstring                  mS_NetworkCapability, 
  integer                      lengthOfMobileEquipmentIdentity,
  octetstring                  mobileEquipmentIdentity,
  BIT1                         uNA,
  BIT1                         gENA,
  BIT1                         gANA,
  BIT1                         iNA,
  BIT1                         eNA,
  BIT1                         hNNA,
  BIT1                         nBNA,
  BIT1                         spare5,  
  integer                      lengthOfVoiceDomainPreferenceAndUEsUsageSetting optional, //"extendable" optional for backward compatibility
  octetstring                  voiceDomainPreferenceAndUEsUsageSetting optional,         //"extendable" optional for backward compatibility
  integer                      lengthOfHigherBitratesThan16Mbpsflags optional,           //"extendable" optional for backward compatibility
  octetstring                  higherBitratesThan16Mbpsflags optional,                   //"extendable" optional for backward compatibility
  octetstring                  additionalOctets  optional                                //"extendable" optional for backward compatibility
} with { 
  variant (lengthIndicator) "LENGTHTO(cksn_ksi,dRXI,spare2,securityMode,sAMBRI,uAMBRI,spare3,  
  noofQuintuplets,usedCipher,spare4,kc,quintuplets, 
  drx_par,uplinkSubscribedUE_AMBR,downlinkSubscribedUE_AMBR,
  uplinkUsedUE_AMBR,downlinkUsedUE_AMBR,lengthOfUE_NEtworkCapability,
  uE_NEtworkCapability,lengthOfMS_NetworkCapability,mS_NetworkCapability, 
  lengthOfMobileEquipmentIdentity,mobileEquipmentIdentity, 
  uNA,gENA,gANA,iNA,eNA,hNNA,nBNA,spare5,
  lengthOfVoiceDomainPreferenceAndUEsUsageSetting,
  voiceDomainPreferenceAndUEsUsageSetting,
  lengthOfHigherBitratesThan16Mbpsflags,
  higherBitratesThan16Mbpsflags,
  additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '69'O; )";   
  variant (securityMode) "FIELDLENGTH(3)";  
  variant (noofQuintuplets) "FIELDLENGTH(3)";
  variant (noofQuintuplets) "LENGTHTO(quintuplets)";
  variant (noofQuintuplets) "UNIT(elements)";
  variant (drx_par) "PRESENCE (dRXI = '1'B; )";  
  variant (lengthOfUE_NEtworkCapability) "LENGTHTO(uE_NEtworkCapability)";  
  variant (lengthOfMS_NetworkCapability) "LENGTHTO(mS_NetworkCapability)";  
  variant (lengthOfMobileEquipmentIdentity) "LENGTHTO(mobileEquipmentIdentity)"; 
  variant (lengthOfVoiceDomainPreferenceAndUEsUsageSetting) "LENGTHTO(voiceDomainPreferenceAndUEsUsageSetting)";  
  variant (lengthOfHigherBitratesThan16Mbpsflags) "LENGTHTO(higherBitratesThan16Mbpsflags)";  
  variant (uplinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";  
  variant (downlinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";    
  variant (uplinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";  
  variant (downlinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";         
};

type record UMTS_key_and_Quintuplets
{
  OCT1                         elementIdentifier,  // dec 106, '6A'O 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT3                         ksi,
  BIT1                         dRXI,
  BIT1                         spare2,
  integer                      securityMode, 
  BIT1                         sAMBRI,
  BIT1                         uAMBRI,   
  BIT1                         uGIPAI,   
  BIT1                         gUPII,   
  BIT1                         spare3,  
  integer                      noofQuintuplets, 
  BIT3                         usedGPRSIntegrityProtectionAlgorithm, 
  BIT5                         spare4, 
  OCT16                        ck,
  OCT16                        ik,
  AuthQuintuplets              quintuplets,     
  OCT2                         drx_par optional,     
  OCT4                         uplinkSubscribedUE_AMBR optional,
  OCT4                         downlinkSubscribedUE_AMBR optional,
  OCT4                         uplinkUsedUE_AMBR optional,
  OCT4                         downlinkUsedUE_AMBR optional, 
  integer                      lengthOfUE_NEtworkCapability,
  octetstring                  uE_NEtworkCapability, 
  integer                      lengthOfMS_NetworkCapability,
  octetstring                  mS_NetworkCapability, 
  integer                      lengthOfMobileEquipmentIdentity,
  octetstring                  mobileEquipmentIdentity,
  BIT1                         uNA,
  BIT1                         gENA,
  BIT1                         gANA,
  BIT1                         iNA,
  BIT1                         eNA,
  BIT1                         hNNA,
  BIT1                         nBNA,
  BIT1                         spare5,  
  integer                      lengthOfVoiceDomainPreferenceAndUEsUsageSetting optional, //"extendable" optional for backward compatibility
  octetstring                  voiceDomainPreferenceAndUEsUsageSetting optional,         //"extendable" optional for backward compatibility
  integer                      lengthOfHigherBitratesThan16Mbpsflags optional,           //"extendable" optional for backward compatibility
  octetstring                  higherBitratesThan16Mbpsflags optional,                   //"extendable" optional for backward compatibility
  octetstring                  additionalOctets  optional                                //"extendable" optional for backward compatibility
}  with { 
  variant (lengthIndicator) "LENGTHTO(ksi,dRXI,spare2,securityMode,sAMBRI,uAMBRI,uGIPAI,gUPII,spare3,  
  noofQuintuplets,usedGPRSIntegrityProtectionAlgorithm,spare4,ck,ik,quintuplets,     
  drx_par,uplinkSubscribedUE_AMBR,downlinkSubscribedUE_AMBR,
  uplinkUsedUE_AMBR,downlinkUsedUE_AMBR,lengthOfUE_NEtworkCapability,
  uE_NEtworkCapability,lengthOfMS_NetworkCapability,mS_NetworkCapability, 
  lengthOfMobileEquipmentIdentity,mobileEquipmentIdentity,
  uNA,gENA,gANA,iNA,eNA,hNNA,nBNA,spare5,
  lengthOfVoiceDomainPreferenceAndUEsUsageSetting,
  voiceDomainPreferenceAndUEsUsageSetting,
  lengthOfHigherBitratesThan16Mbpsflags,
  higherBitratesThan16Mbpsflags,
  additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '6A'O; )";   
  variant (securityMode) "FIELDLENGTH(3)";  
  variant (noofQuintuplets) "FIELDLENGTH(3)";
  variant (noofQuintuplets) "LENGTHTO(quintuplets)";
  variant (noofQuintuplets) "UNIT(elements)"; 
  variant (drx_par) "PRESENCE (dRXI = '1'B; )";  
  variant (lengthOfUE_NEtworkCapability) "LENGTHTO(uE_NEtworkCapability)";  
  variant (lengthOfMS_NetworkCapability) "LENGTHTO(mS_NetworkCapability)";  
  variant (lengthOfMobileEquipmentIdentity) "LENGTHTO(mobileEquipmentIdentity)";
  variant (lengthOfVoiceDomainPreferenceAndUEsUsageSetting) "LENGTHTO(voiceDomainPreferenceAndUEsUsageSetting)";  
  variant (lengthOfHigherBitratesThan16Mbpsflags) "LENGTHTO(higherBitratesThan16Mbpsflags)";  
  variant (uplinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";  
  variant (downlinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";    
  variant (uplinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";  
  variant (downlinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";             
};


type record OldEPS_SecurityContext
{
  BIT3                         oldNCC,
  BIT3                         oldKSI,
  BIT1                         spare,
  BIT1                         nHI_old,
  octetstring                  old_K_asme length (32), 
  octetstring                  old_NH length (32) optional 
} with { 
  variant (old_NH)  "PRESENCE(nHI_old = '1'B )"; 
};

type record EPS_SecurityContext_and_Quadruplets
{
  OCT1                         elementIdentifier,  // dec 107, '6B'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT3                         ksi_asme,
  BIT1                         dRXI,
  BIT1                         nHI,
  integer                      securityMode,  
  BIT1                         osci,
  BIT1                         uAMBRI,      
  integer                      noofQuadruplets, 
  integer                      noofQuintuplets, 
  BIT4                         usedNAS_Cipher,
  BIT3                         usedNAS_IntegrityAlgorithm,
  BIT1                         sAMBRI,
  integer                      nAS_DownlinkCount,
  integer                      nAS_UplinkCount,
  octetstring                  k_asme length (32), 
  AuthQuadruplets              quadruplets,   
  AuthQuintuplets              quintuplets,
  OCT2                         drx_par optional, 
  octetstring                  nH length (32) optional, 
  BIT3                         nCC optional, 
  BIT5                         spare4 optional,   
  OCT4                         uplinkSubscribedUE_AMBR optional,
  OCT4                         downlinkSubscribedUE_AMBR optional,
  OCT4                         uplinkUsedUE_AMBR optional,
  OCT4                         downlinkUsedUE_AMBR optional, 
  integer                      lengthOfUE_NEtworkCapability,
  octetstring                  uE_NEtworkCapability, 
  integer                      lengthOfMS_NetworkCapability,
  octetstring                  mS_NetworkCapability, 
  integer                      lengthOfMobileEquipmentIdentity,
  octetstring                  mobileEquipmentIdentity, 
  BIT1                         uNA,
  BIT1                         gENA,
  BIT1                         gANA,
  BIT1                         iNA,
  BIT1                         eNA,
  BIT1                         hNNA,
  BIT1                         nBNA,
  BIT1                         spare5, 
  OldEPS_SecurityContext       oldEPS_SecurityContext optional,               
  integer                      lengthOfVoiceDomainPreferenceAndUEsUsageSetting optional, //"extendable" optional for backward compatibility
  octetstring                  voiceDomainPreferenceAndUEsUsageSetting optional,         //"extendable" optional for backward compatibility
  LIN2_BO_LAST                 lengthOfUERadioCapabilityforPagingInformation optional,   //"extendable" optional for backward compatibility
  octetstring                  uERadioCapabilityforPagingInformation optional,           //"extendable" optional for backward compatibility
  octetstring                  additionalOctets  optional                                //"extendable" optional for backward compatibility   
}  with { 
  variant (lengthIndicator) "LENGTHTO(ksi_asme,dRXI,nHI,securityMode,osci,uAMBRI,noofQuadruplets, 
  noofQuintuplets,usedNAS_Cipher,usedNAS_IntegrityAlgorithm,sAMBRI,
  nAS_DownlinkCount,nAS_UplinkCount,k_asme, 
  quadruplets,quintuplets,drx_par,nH,nCC,spare4, 
  uplinkSubscribedUE_AMBR,downlinkSubscribedUE_AMBR,
  uplinkUsedUE_AMBR,downlinkUsedUE_AMBR,lengthOfUE_NEtworkCapability,
  uE_NEtworkCapability,lengthOfMS_NetworkCapability,mS_NetworkCapability, 
  lengthOfMobileEquipmentIdentity,mobileEquipmentIdentity,
  uNA,gENA,gANA,iNA,eNA,hNNA,nBNA,spare5,
  oldEPS_SecurityContext, 
  lengthOfVoiceDomainPreferenceAndUEsUsageSetting,
  voiceDomainPreferenceAndUEsUsageSetting,
  lengthOfUERadioCapabilityforPagingInformation,
  uERadioCapabilityforPagingInformation,
  additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '6B'O; )";   
  variant (securityMode) "FIELDLENGTH(3)";  
  variant (noofQuadruplets) "FIELDLENGTH(3)";
  variant (noofQuadruplets) "LENGTHTO(quadruplets)";
  variant (noofQuadruplets) "UNIT(elements)";      
  variant (noofQuintuplets) "FIELDLENGTH(3)";
  variant (noofQuintuplets) "LENGTHTO(quintuplets)";
  variant (noofQuintuplets) "UNIT(elements)";      
  variant (nAS_DownlinkCount)  "FIELDLENGTH(24)";
  variant (nAS_DownlinkCount) "BYTEORDER(last)";     
  variant (nAS_UplinkCount) "FIELDLENGTH(24)"; 
  variant (nAS_UplinkCount) "BYTEORDER(last)";       
  variant (lengthOfUE_NEtworkCapability) "LENGTHTO(uE_NEtworkCapability)";  
  variant (lengthOfMS_NetworkCapability) "LENGTHTO(mS_NetworkCapability)";  
  variant (lengthOfMobileEquipmentIdentity) "LENGTHTO(mobileEquipmentIdentity)";
  variant (lengthOfVoiceDomainPreferenceAndUEsUsageSetting) "LENGTHTO(voiceDomainPreferenceAndUEsUsageSetting)";  
  variant (lengthOfUERadioCapabilityforPagingInformation) "LENGTHTO(uERadioCapabilityforPagingInformation)";  
  variant (drx_par) "PRESENCE(dRXI = '1'B)";
  variant (nH)      "PRESENCE(nHI = '1'B)";
  variant (nCC)     "PRESENCE(nHI = '1'B)";
  variant (spare4)  "PRESENCE(nHI = '1'B)";   
  variant (uplinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";  
  variant (downlinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";    
  variant (uplinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";  
  variant (downlinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";      
  variant (oldEPS_SecurityContext)  "PRESENCE(osci = '1'B )";                   
}; 

type record UMTS_Key_Quadruplets_and_Quintuplets
{
  OCT1                         elementIdentifier,   // dec 108, '6C'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT3                         ksi_asme,
  BIT1                         dRXI,
  BIT1                         spare2,
  integer                      securityMode, 
  BIT1                         sAMBRI,
  BIT1                         uAMBRI,
  integer                      noofQuadruplets, 
  integer                      noofQuintuplets,
  OCT1                         spare4, 
  OCT16                        ck,
  OCT16                        ik,
  AuthQuadruplets              quadruplets,   
  AuthQuintuplets              quintuplets,  
  OCT2                         drx_par optional,  
  OCT4                         uplinkSubscribedUE_AMBR optional,
  OCT4                         downlinkSubscribedUE_AMBR optional,
  OCT4                         uplinkUsedUE_AMBR optional,
  OCT4                         downlinkUsedUE_AMBR optional, 
  integer                      lengthOfUE_NEtworkCapability,
  octetstring                  uE_NEtworkCapability, 
  integer                      lengthOfMS_NetworkCapability,
  octetstring                  mS_NetworkCapability, 
  integer                      lengthOfMobileEquipmentIdentity,
  octetstring                  mobileEquipmentIdentity, 
  BIT1                         uNA,
  BIT1                         gENA,
  BIT1                         gANA,
  BIT1                         iNA,
  BIT1                         eNA,
  BIT1                         hNNA,
  BIT1                         nBNA,
  BIT1                         spare5,  
  integer                      lengthOfVoiceDomainPreferenceAndUEsUsageSetting optional,  //"extendable" optional for backward compatibility
  octetstring                  voiceDomainPreferenceAndUEsUsageSetting optional,          //"extendable" optional for backward compatibility
  octetstring                  additionalOctets  optional                                 //"extendable" optional for backward compatibility 
}  with { 
  variant (lengthIndicator) "LENGTHTO(ksi_asme,dRXI,spare2,securityMode,sAMBRI,uAMBRI, 
  noofQuadruplets,noofQuintuplets,spare4,ck,
  ik,quadruplets,quintuplets,drx_par,uplinkSubscribedUE_AMBR,
  downlinkSubscribedUE_AMBR,uplinkUsedUE_AMBR,downlinkUsedUE_AMBR, 
  lengthOfUE_NEtworkCapability,uE_NEtworkCapability, 
  lengthOfMS_NetworkCapability,mS_NetworkCapability, 
  lengthOfMobileEquipmentIdentity,mobileEquipmentIdentity,
  uNA,gENA,gANA,iNA,eNA,hNNA,nBNA,spare5,
  lengthOfVoiceDomainPreferenceAndUEsUsageSetting,
  voiceDomainPreferenceAndUEsUsageSetting,
  additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '6C'O; )";   
  variant (securityMode) "FIELDLENGTH(3)";  
  variant (noofQuadruplets) "FIELDLENGTH(3)";
  variant (noofQuadruplets) "LENGTHTO(quadruplets)";
  variant (noofQuadruplets) "UNIT(elements)";      
  variant (noofQuintuplets) "FIELDLENGTH(3)";
  variant (noofQuintuplets) "LENGTHTO(quintuplets)";
  variant (noofQuintuplets) "UNIT(elements)";
  variant (drx_par) "PRESENCE (dRXI = '1'B; )";
  variant (lengthOfUE_NEtworkCapability) "LENGTHTO(uE_NEtworkCapability)";  
  variant (lengthOfMS_NetworkCapability) "LENGTHTO(mS_NetworkCapability)";  
  variant (lengthOfMobileEquipmentIdentity) "LENGTHTO(mobileEquipmentIdentity)";
  variant (lengthOfVoiceDomainPreferenceAndUEsUsageSetting) "LENGTHTO(voiceDomainPreferenceAndUEsUsageSetting)";  
  variant (uplinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";  
  variant (downlinkSubscribedUE_AMBR) "PRESENCE (sAMBRI = '1'B; )";    
  variant (uplinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )";  
  variant (downlinkUsedUE_AMBR) "PRESENCE (uAMBRI = '1'B; )"; 
};   

//8.39
type set PDN_Conn_BearerContext_IEs
{
  EPS_BearerID                ePS_BearerID optional,
  EPS_BearerLevel_TFT         ePS_Bearer_TFT optional, 
  FullyQualifiedTEID_List     fullyQualifiedTEID optional, 
  Bearer_QoS                  bearerLevel_QoS optional,
  FullyQualifiedContainer     container optional, 
  TransactionIdentifier       transactionIdentifier optional,
  BearerFlags                 bearerFlags optional 
}with {         
  variant(fullyQualifiedTEID) "REPEATABLE(yes)";
};         

type record PDN_Conn_BearerContext
{
  OCT1                         elementIdentifier,// dec 93, '5D'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,  
  PDN_Conn_BearerContext_IEs   bearerContext_IEs
} with { 
  variant (lengthIndicator) "LENGTHTO(bearerContext_IEs)"; 
  variant "PRESENCE (elementIdentifier = '5D'O; )";      
};

type set of PDN_Conn_BearerContext PDN_Conn_BearerContext_List

type set PDN_Connection_IEs
{
  AccessPointName             accessPointName optional,
  IP_Address_List             iP_Address optional,
  EPS_BearerID                linkedEPS_Bearer_ID optional,
  FullyQualifiedTEID          fullyQualifiedTEID optional,  
  FullyQualifiedDomainName_List fullyQualifiedDomainName optional,
  PDN_Conn_BearerContext_List bearerContexts optional, 
  AggregateMaximumBitRate     apn_ambr optional,
  ChargingCharacteristics     chargingCharacteristics optional,
  APN_Restriction             aPN_Restriction optional,
  SelectionMode               selectionMode optional,
  ChangeReportingAction       changeReportingAction optional,
  CSG_InformationReportingAction cSG_InformationReportingAction optional,
  HeNBInformationReporting    heNBInformationReporting optional,
  Indication                  indicationFlags optional,
  SignallingPriorityIndication signallingPriorityIndication optional,
  ChangeToReportFlags	        changeToReportFlags optional,
  PresenceReportingAreaAction presenceReportingAreaAction optional,
  WLANOffloadabilityIndication wLANOffloadabilityIndication optional,
  RemoteUEContextGrouped       remoteUEContext optional,
  PDN_Type                     pDN_Type optional,
  HeaderCompressionConfiguration headerCompressionConfiguration optional
} with { 
  variant(iP_Address) "REPEATABLE(yes)";
  variant(fullyQualifiedDomainName) "REPEATABLE(yes)";
  variant(bearerContexts) "REPEATABLE(yes)"  
};    

type record PDN_ConnectionGrouped
{
  OCT1                         elementIdentifier,  // dec 109, '6D'O   
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,  
  PDN_Connection_IEs           pDN_Connection_IEs
} with { 
  variant (lengthIndicator) "LENGTHTO(pDN_Connection_IEs)";
  variant "PRESENCE (elementIdentifier = '6D'O; )";      
};         

type set of PDN_ConnectionGrouped PDN_ConnectionGrouped_List    

//8.40
type record PDU_Numbers
{
  OCT1                         elementIdentifier,  // dec 110, '6E'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,  
  BIT4                         nSAPI,
  BIT4                         spare2,
  integer                      dL_GTPU_SeqNumber, 
  integer                      uL_GTPU_SeqNumber,
  integer                      send_NPDU_Number,
  integer                      receive_NPDU_Number, 
  octetstring                  additionalOctets  optional
} with { 
  variant (lengthIndicator) "LENGTHTO(nSAPI,spare2,dL_GTPU_SeqNumber, 
  uL_GTPU_SeqNumber,send_NPDU_Number,
  receive_NPDU_Number,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '6E'O;)"; 
  variant (dL_GTPU_SeqNumber) "FIELDLENGTH(16)";
  variant (dL_GTPU_SeqNumber) "BYTEORDER(last)";  
  variant (uL_GTPU_SeqNumber) "FIELDLENGTH(16)"; 
  variant (uL_GTPU_SeqNumber) "BYTEORDER(last)";
  variant (send_NPDU_Number) "FIELDLENGTH(16)";
  variant (send_NPDU_Number) "BYTEORDER(last)";   
  variant (receive_NPDU_Number) "FIELDLENGTH(16)"; 
  variant (receive_NPDU_Number) "BYTEORDER(last)";         
};

//8.41
type record Packet_TMSI
{
  OCT1                         elementIdentifier, // dec 111, '6F'O   
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,  
  OCT4                         pTMSI_Value
} with { 
  variant (lengthIndicator) "LENGTHTO(pTMSI_Value)"; 
  variant "PRESENCE (elementIdentifier = '6F'O; )";      
};


//8.42
type record P_TMSI_Signature
{
  OCT1                         elementIdentifier, // dec 112, '70'O 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,  
  OCT3                         p_TMSI_SignatureValue     
} with { 
  variant (lengthIndicator) "LENGTHTO(p_TMSI_SignatureValue)"; 
  variant "PRESENCE (elementIdentifier = '70'O; )";      
};

//8.43
type record Hop_Counter
{
  OCT1                         elementIdentifier,  //dec 113, '71'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,   
  integer                      hopCounterValue,
  octetstring                  additionalOctets  optional
} with { 
  variant (lengthIndicator) "LENGTHTO(hopCounterValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '71'O; )";      
}; 

//8.44
type record UE_TimeZone
{
  OCT1                         elementIdentifier,  //dec 114, '72'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,   
  OCT1                         timeZone,
  BIT2                         daylightSavingTime,
  BIT6                         spare2,
  octetstring                  additionalOctets  optional 
} with { 
  variant (lengthIndicator) "LENGTHTO(timeZone,daylightSavingTime,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '72'O; )";      
}; 

//8.45
type record TraceReference
{
  OCT1                         elementIdentifier,  //dec 115, '73'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,   
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3, 
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  OCT3                         traceID_Value
} with { 
  variant (lengthIndicator) "LENGTHTO(mccDigit1,mccDigit2,mccDigit3,mncDigit3,
  mncDigit1,mncDigit2,traceID_Value)"; 
  variant "PRESENCE (elementIdentifier = '73'O; )";      
};

//8.46
type record CompleteRequestMessage 
{ 
  OCT1                         elementIdentifier,   //dec 116, '74'O   
  LIN2_BO_LAST                 lengthIndicator, 
  BIT4                         instance,
  BIT4                         spare,    
  integer                      completeRequestMessageType, 
  octetstring                  completeRequestMessageValue 
} with { 
  variant (lengthIndicator) "LENGTHTO(completeRequestMessageType,completeRequestMessageValue)"; 
  variant "PRESENCE (elementIdentifier = '74'O; )";      
}; 

//8.47
type record GUTI
{
  OCT1                         elementIdentifier,   //dec 117, '75'O    
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,    
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3, 
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  OCT2                         mME_GroupID,
  OCT1                         mME_Code,
  octetstring                  m_TMSI
} with { 
  variant (lengthIndicator) "LENGTHTO(mccDigit1,mccDigit2,mccDigit3,mncDigit3, 
  mncDigit1,mncDigit2,mME_GroupID,mME_Code,m_TMSI
  )"; 
  variant "PRESENCE (elementIdentifier = '75'O; )";        
};

//8.48
type record FullyQualifiedContainer
{
  OCT1                         elementIdentifier,   //dec 118, '76'O     
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  integer                      containerType,
  BIT4                         spare2,
  F_ContainerField             f_ContainerField
} with { 
  variant (lengthIndicator) "LENGTHTO(containerType,spare2,f_ContainerField)"; 
  variant "PRESENCE (elementIdentifier = '76'O; )"; 
  variant (containerType) "FIELDLENGTH(4)";            
  variant (f_ContainerField) "CROSSTAG(
  uTRAN_TransparentContainer,    containerType = 1;
  bSS_Container,                 containerType = 2; 
  eUTRAN_TransparentContainer,   containerType = 3; 
  nBIFOM_Container,              containerType = 4;
  )";  
};

type union F_ContainerField
{
  BSS_Container_union bSS_Container,
  octetstring uTRAN_TransparentContainer,
  octetstring eUTRAN_TransparentContainer,
  octetstring nBIFOM_Container
}

type set of FullyQualifiedContainer FullyQualifiedContainer_List;

type union BSS_Container_union {
  BSS_Container bSS_Container_structured,
  octetstring bSS_Container_octet
}

//8.48-2
type record BSS_Container
{
  BIT1    pFI,
  BIT1    rP,
  BIT1    sAPIflag,
  BIT1    pHX,
  BIT4    spare,
  OCT1    packetFlowID optional,
  BIT3    radioPriority optional,
  BIT1    spare2 optional,
  BIT4    sAPI optional,
  integer xiDparametersLength optional,
  octetstring xiDparameters optional
} with {
  variant "PRESENCE (spare = '0000'B; )";
  variant (xiDparametersLength) "LENGTHTO(xiDparameters)"; 
  variant (packetFlowID) "PRESENCE (pFI = '1'B; )";  
  variant (radioPriority) "PRESENCE (rP = '1'B; )";  
  variant (sAPI) "PRESENCE (sAPIflag = '1'B; )";  
  variant (xiDparametersLength) "PRESENCE (pHX = '1'B; )";  
  variant (xiDparameters) "PRESENCE (pHX = '1'B; )";  
};

//8.49
type record FullyQualifiedCause
{
  OCT1                         elementIdentifier,   //dec 119, '77'O      
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT4                         causeType,
  BIT4                         spare2,   
  octetstring                  f_CauseFieldValue
} with { 
  variant (lengthIndicator) "LENGTHTO(causeType,spare2,f_CauseFieldValue)"; 
  variant "PRESENCE (elementIdentifier = '77'O; )";            
};

type set of FullyQualifiedCause FullyQualifiedCause_List;

//8.50
type record PLMN_ID
{
  OCT1                         elementIdentifier,  //dec 120, '78'O    
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  OCT3                         pLMN_IdentityValue   
}with { 
  variant (lengthIndicator) "LENGTHTO(pLMN_IdentityValue)"; 
  variant "PRESENCE (elementIdentifier = '78'O; )";            
};

//8.51
type record TargetIdentification
{
  OCT1                         elementIdentifier,  //dec 121, '79'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  integer                      targetType,
  TargetId                     targetID
} with { 
  variant (lengthIndicator) "LENGTHTO(targetType,targetID)";
  variant "PRESENCE (elementIdentifier = '79'O; )";
  variant (targetID) "CROSSTAG( rnc_ID, targetType = 0;
  macro_eNodeB_ID, targetType = 1;
  cell_ID, targetType = 2;
  home_eNodeB_ID, targetType = 3;
  unknown, OTHERWISE)"
};

type union TargetId {
  RNC_ID rnc_ID,
  Macro_eNodeB_ID macro_eNodeB_ID,
  Cell_ID cell_ID,
  Home_eNodeB_ID home_eNodeB_ID, 
  octetstring unknown
}

type octetstring RNC_ID;
type octetstring Cell_ID;

type record Macro_eNodeB_ID {
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  BIT4                         spare2,
  bitstring                    targetID length(20),
  OCT2                         tac
} with { 
  variant (spare2,targetID) "FIELDORDER(msb)";
  variant (targetID) "BYTEORDER(last)";
}

type record Home_eNodeB_ID {
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  BIT4                         spare2,
  bitstring                    targetID length(28),
  OCT2                         tac
} with { 
  variant (spare2,targetID) "FIELDORDER(msb)";
  variant (targetID) "BYTEORDER(last)";
}

// In Presence Reporting Area Action it shall be encoded as per octets 6 to 11 of the Target ID 
type record Macro_eNodeB_ID_spec {
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  BIT4                         spare2,
  bitstring                    targetID length(20)
} with { 
  variant (spare2,targetID) "FIELDORDER(msb)";
  variant (targetID) "BYTEORDER(last)";
}

// In Presence Reporting Area Action it shall be encoded as per octets 6 to 11 of the Target ID 
type record Home_eNodeB_ID_spec {
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  BIT4                         spare2,
  bitstring                    targetID length(28)
} with { 
  variant (spare2,targetID) "FIELDORDER(msb)";
  variant (targetID) "BYTEORDER(last)";
}

//8.52
//VOID

//8.53
type record PacketFlowID
{
  OCT1                         elementIdentifier,  // dec 123, '7B'O 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT4                         eBI,
  BIT4                         spare2,
  octetstring                  packetFlowIDValue
} with { 
  variant (lengthIndicator) "LENGTHTO(eBI,spare2,packetFlowIDValue)"; 
  variant "PRESENCE (elementIdentifier = '7B'O;)";            
};

//8.54
type record RAB_Context
{
  OCT1                         elementIdentifier,  // dec 124, '7C'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,   
  BIT4                         nSAPI,
  BIT4                         spare2,
  integer                      dL_GTPU_SeqNumber,
  integer                      uL_GTPU_SeqNumber,
  integer                      dL_PDCP_SeqNumber,
  integer                      uL_PDCP_SeqNumber
}with { 
  variant (lengthIndicator) "LENGTHTO(nSAPI,spare2,dL_GTPU_SeqNumber,uL_GTPU_SeqNumber,dL_PDCP_SeqNumber,uL_PDCP_SeqNumber)"; 
  variant "PRESENCE (elementIdentifier = '7C'O;)"; 
  variant (dL_GTPU_SeqNumber) "FIELDLENGTH(16)"; 
  variant (dL_GTPU_SeqNumber) "BYTEORDER(last)";   
  variant (uL_GTPU_SeqNumber) "FIELDLENGTH(16)";
  variant (uL_GTPU_SeqNumber) "BYTEORDER(last)";    
  variant (dL_PDCP_SeqNumber) "FIELDLENGTH(16)";  
  variant (dL_PDCP_SeqNumber) "BYTEORDER(last)";   
  variant (uL_PDCP_SeqNumber) "FIELDLENGTH(16)"; 
  variant (uL_PDCP_SeqNumber) "BYTEORDER(last)";                 
};

type set of RAB_Context RAB_Context_List

//8.55
type record Source_RNC_PDCP_Context_Info
{
  OCT1                         elementIdentifier,  // dec 125, '7D'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  octetstring                  rRC_ContainerValue
} with { 
  variant (lengthIndicator) "LENGTHTO(rRC_ContainerValue)"; 
  variant "PRESENCE (elementIdentifier = '7D'O;)";            
};

//8.56
type record PortNumber
{
  OCT1                         elementIdentifier, // dec 126, '7E'O   
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  integer                      PortNumberValue,
  octetstring                  additionalOctets optional
} with { 
  variant (lengthIndicator) "LENGTHTO(PortNumberValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '7E'O;)";
  variant (PortNumberValue) "FIELDLENGTH(16)"; 
  variant (PortNumberValue) "BYTEORDER(last)";              
};

type set of PortNumber PortNumber_List

//8.57
type record APN_Restriction
{
  OCT1                         elementIdentifier,  // dec 127, '7F'O   
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  integer                      restrictionTypeValue,
  octetstring                  additionalOctets optional
} with { 
  variant (lengthIndicator) "LENGTHTO(restrictionTypeValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '7F'O;)";            
};

//8.58
type record SelectionMode
{
  OCT1                         elementIdentifier,   // dec 128, '80'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  integer                      selectionModeValue,
  BIT6                         spare2,
  octetstring                  additionalOctets optional 
} with { 
  variant (lengthIndicator) "LENGTHTO(selectionModeValue,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '80'O;)"; 
  variant (selectionModeValue) "FIELDLENGTH(2)";              
};

//8.59
type record SourceIdentification
{
  OCT1                         elementIdentifier,   // dec 129, '81'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  OCT8                         targetCellID,
  OCT1                         sourceType,
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  BIT4                         spare2,
  bitstring                    sourceID length(20),
  OCT2                         tac
} with { 
  variant (lengthIndicator) "LENGTHTO(targetCellID,sourceType,mccDigit1,mccDigit2,mccDigit3,
  mncDigit3,mncDigit1,mncDigit2,spare2,
  sourceID,tac)"; 
  variant "PRESENCE (elementIdentifier = '81'O;)";
  variant (spare2,sourceID) "FIELDORDER(msb)";
  variant (sourceID) "BYTEORDER(last)";
};   

//8.60
//VOID

//8.61
type record ChangeReportingAction
{
  OCT1                         elementIdentifier, // dec 131, '83'O   
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  octetstring                  actionValue
} with { 
  variant (lengthIndicator) "LENGTHTO(actionValue)"; 
  variant "PRESENCE (elementIdentifier = '83'O;)";            
};

//8.62
type set of OCT2 PDN_CSID_List;

type union NodeID
{
  OCT4       globalUnicastIPv4,
  OCT16      globalUnicastIPv6,
  OCT4       fourOctets
};

type record FullyQualifiedPDN_ConnectionSetID   //FQ CSID
{
  OCT1                         elementIdentifier, // dec 132, '84'O 
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  integer                      nRofCSIDs,
  integer                      nodeIDType,
  NodeID                       nodeID,
  PDN_CSID_List                pDN_CSID_List,
  octetstring                  additionalOctets optional 
} with { 
  variant (lengthIndicator) "LENGTHTO(nRofCSIDs,nodeIDType,nodeID,pDN_CSID_List,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '84'O;)";    
  variant (nRofCSIDs) "FIELDLENGTH(4)"; 
  variant (nRofCSIDs) "LENGTHTO(pDN_CSID_List)"; 
  variant (nRofCSIDs) "UNIT(elements)";    
  variant (nodeIDType) "FIELDLENGTH(4)";
  variant (nodeID) "CROSSTAG(
  globalUnicastIPv4,     nodeIDType = 0;
  globalUnicastIPv6,     nodeIDType = 1; 
  fourOctets,            nodeIDType = 2; 
  )";  
};

type set of FullyQualifiedPDN_ConnectionSetID FullyQualifiedPDN_ConnectionSetID_List;

//8.63
type record ChannelNeeded
{
  OCT1                         elementIdentifier, // dec 133, '85'O  
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  octetstring                  channelNeededValue
} with { 
  variant (lengthIndicator) "LENGTHTO(channelNeededValue)"; 
  variant "PRESENCE (elementIdentifier = '85'O;)";            
};

//8.64
type record EMLPP_Priority
{
  OCT1                         elementIdentifier, // dec 134, '86'O   
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  octetstring                  eMLPP_PriorityValue               
}with { 
  variant (lengthIndicator) "LENGTHTO(eMLPP_PriorityValue)"; 
  variant "PRESENCE (elementIdentifier = '86'O;)";            
};

//8.65
type record NodeType
{
  OCT1                         elementIdentifier,// dec 135, '87'O    
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT1                         nodeTypeValue, 
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(nodeTypeValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '87'O;)";            
};

//8.66
type record FullyQualifiedDomainName
{
  OCT1                         elementIdentifier,  // dec 136, '88'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,  
  octetstring                  fQDN_Value
} with { 
  variant (lengthIndicator) "LENGTHTO(fQDN_Value)"; 
  variant "PRESENCE (elementIdentifier = '88'O;)";
};

type set of FullyQualifiedDomainName FullyQualifiedDomainName_List;

//8.67
// Moved to GTPv2_PrivateExtensions.ttcn


//8.68
type record TransactionIdentifier
{
  OCT1                         elementIdentifier, // dec 137, '89'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT4                         spare2,                  
  L3_TransactionId             transactionIdentifierValue  
} with { 
  variant (lengthIndicator) "LENGTHTO(spare2,transactionIdentifierValue)"; 
  variant "PRESENCE (elementIdentifier = '89'O;)";
};

type record L3_TransactionId
{
  BIT3               tio,
  BIT1               tiFlag ,
  TI_Extension       tIExtension  optional     
  // an extension octet (TI) can be used for session management messages
  // not yet implemented (see 24.008 clause 10.3.2 for more detail
} with { variant (tIExtension) "PRESENCE(tio = '111'B)"
};  

type record TI_Extension
{
  BIT7               tI_Value,
  BIT1               tI_ExtBit         //'1'B
};

//8.69
type record MBMS_SessionDuration
{
  OCT1                         elementIdentifier, // dec 138, '8A'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT3                         mBMS_SessionDurationValue,
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(mBMS_SessionDurationValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '8A'O;)";            
};

//8.70
type record MBMS_ServiceArea
{
  OCT1                         elementIdentifier, // dec 139, '8B'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  octetstring                  mBMS_ServiceAreaValue
}with { 
  variant (lengthIndicator) "LENGTHTO(mBMS_ServiceAreaValue)"; 
  variant "PRESENCE (elementIdentifier = '8B'O;)";            
};

//8.71
type record MBMS_SessionIdentifier
{
  OCT1                         elementIdentifier, // dec 140, '8C'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT1                         mBMS_SessionIdentifierValue,
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(mBMS_SessionIdentifierValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '8C'O;)";            
};

//8.72
type record MBMS_FlowIdentifier
{
  OCT1                         elementIdentifier, // dec 141, '8D'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT2                         mBMS_FlowIdentifierValue,
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(mBMS_FlowIdentifierValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '8D'O;)";            
};

//8.73
type record MBMS_IPMulticastDistribution
{
  OCT1                         elementIdentifier, // dec 142, '8E'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT4                         commonTunnelEndpointIdentifierData,
  GSN_Address                  iP_MulticastDistributionAddress,
  GSN_Address                  iP_MulticastSourceAddress,
  OCT1                         mBMS_HCIndicator,
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(commonTunnelEndpointIdentifierData,iP_MulticastDistributionAddress,
  iP_MulticastSourceAddress,mBMS_HCIndicator,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '8E'O;)";            
};

type set of MBMS_IPMulticastDistribution MBMS_IPMulticastDistribution_List;

type record GSN_Address
{ 
  INT6b        lengthIndicator,
  BIT2         addressType,
  octetstring  addressValue 
}with { 
  variant (lengthIndicator) "LENGTHTO(addressValue)"; 
};

//8.74
type record MBMS_DistributionAcknowledge
{
  OCT1                         elementIdentifier, // dec 143, '8F'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT2                         distributionIndicationValue,
  BIT6                         spare2,
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(distributionIndicationValue,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '8F'O;)";            
};

//8.75
type record User_CSG_Information
{
  OCT1                         elementIdentifier, // dec 145, '91'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  BIT5                         spare2,
  bitstring                    cSG_ID length(27),
  BIT1                         cMI,
  BIT1                         lCSG,
  BIT4                         spare3,
  BIT2                         accessMode, 
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(mccDigit1,mccDigit2,mccDigit3,
  mncDigit3,mncDigit1,mncDigit2,
  spare2,cSG_ID,cMI,lCSG,spare3,
  accessMode,additionalOctets)"; 
  variant (spare2,cSG_ID) "FIELDORDER(msb)";
  variant (cSG_ID) "BYTEORDER(last)";
  variant "PRESENCE (elementIdentifier = '91'O;)";            
};

//8.76
type record CSG_InformationReportingAction
{
  OCT1                         elementIdentifier, // dec 146, '92'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT1                         uCIC_SG,
  BIT1                         uCIS_HC,
  BIT1                         uCIU_HC,
  BIT5                         spare2,
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(uCIC_SG,uCIS_HC,uCIU_HC,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '92'O;)";            
};

//8.77
type record of RFSP_Index RFSP_Index_List;

type record RFSP_Index
{
  OCT1                         elementIdentifier, // dec 144, '90'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  integer                      rFSP_IndexValue 
}  with { 
  variant (lengthIndicator) "LENGTHTO(rFSP_IndexValue)"; 
  variant "PRESENCE (elementIdentifier = '90'O;)"; 
  variant (rFSP_IndexValue) "FIELDLENGTH(16)"; 
  variant (rFSP_IndexValue) "BYTEORDER(last)";    
};

//8.78
type record CSG_ID
{
  OCT1                         elementIdentifier, // dec 147, '93'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT5                         spare2,
  bitstring                    cSG_ID length(27),
  octetstring                  additionalOctets optional
}  with { 
  variant (lengthIndicator) "LENGTHTO(spare2,cSG_ID,additionalOctets)"; 
  variant (spare2,cSG_ID) "FIELDORDER(msb)";
  variant (cSG_ID) "BYTEORDER(last)";
  variant "PRESENCE (elementIdentifier = '93'O;)"; 
};

//8.79
type record CSG_MembershipIndication
{
  OCT1                         elementIdentifier, // dec 148, '94'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT1                         cMI,
  BIT7                         spare2,
  octetstring                  additionalOctets optional
}  with { 
  variant (lengthIndicator) "LENGTHTO(cMI,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '94'O;)"; 
};

//8.80
type record ServiceIndicator
{
  OCT1                         elementIdentifier, // dec 149, '95'O
  LIN2_BO_LAST                 lengthIndicator,  //=1
  BIT4                         instance,
  BIT4                         spare, 
  INT1                         serviceIndicator
}  with { 
  variant (lengthIndicator) "LENGTHTO(serviceIndicator)"; 
  variant "PRESENCE (elementIdentifier = '95'O;)"; 
};

//8.81
type record DetachType
{
  OCT1                         elementIdentifier, // dec 150, '96'O
  LIN2_BO_LAST                 lengthIndicator,  //=1
  BIT4                         instance,
  BIT4                         spare, 
  INT1                         detachType
} with { 
  variant (lengthIndicator) "LENGTHTO(detachType)"; 
  variant "PRESENCE (elementIdentifier = '96'O;)"; 
};

//8.82
type record LocalDistinguishedName
{
  OCT1                         elementIdentifier, // dec 151 '97'O
  LIN2_BO_LAST                 lengthIndicator, 
  BIT4                         instance,
  BIT4                         spare,
  charstring                   lDN length (1..400) 
} with { 
  variant (lengthIndicator) "LENGTHTO(lDN)"; 
  variant "PRESENCE (elementIdentifier = '97'O;)"; 
};

type set of LocalDistinguishedName LocalDistinguishedName_List

//8.83
type record NodeFeatures
{
  OCT1                         elementIdentifier, // dec 152, '98'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT1                         pRN,
  BIT1                         mABR,
  BIT1                         nTSR,
  BIT1                         cIOT,
  BIT4                         spare2,
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(pRN,mABR,nTSR,cIOT,spare2,additionalOctets)";
  variant "PRESENCE (elementIdentifier = '98'O;)"; 
};

//8.84
type record MBMSTimetoDataTransfer
{
  OCT1                         elementIdentifier, // dec 153, '99'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  OCT1                         mBMSTimetoDataTransfervalue,
  octetstring                  additionalOctets optional
} with { 
  variant (lengthIndicator) "LENGTHTO(mBMSTimetoDataTransfervalue, additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '99'O;)"; 
};

//8.85
type record Throttling
{
  OCT1                         elementIdentifier, // dec 154, '9A'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  INT5b                        throttlingDelayValue,
  BIT3                         throttlingDelayUnit,
  INT1                         throttlingfactor,
  octetstring                  additionalOctets optional 
}with { 
  variant (lengthIndicator) "LENGTHTO(throttlingDelayValue,throttlingDelayUnit,throttlingfactor,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '9A'O;)";  
};


//8.86
type record AllocationRetentionPriority
{
  OCT1                         elementIdentifier, // dec 155, '9B'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT1                         pVI,
  BIT1                         spare2,
  BIT4                         pL,
  BIT1                         pCI,
  BIT1                         spare3,
  octetstring                  additionalOctets optional
} with { 
  variant (lengthIndicator) "LENGTHTO(pVI,spare2,pL,pCI,spare3,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '9B'O;)"; 
};

//8.87
type record EPC_Timer
{
  OCT1                         elementIdentifier, // dec 156, '9C'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  INT5b                        timerValue,  
  BIT3                         timerUnit,
  octetstring                  additionalOctets optional
} with { 
  variant (lengthIndicator) "LENGTHTO(timerValue,timerUnit,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '9C'O;)"; 
};

//8.88
type record SignallingPriorityIndication
{
  OCT1                         elementIdentifier, // dec 157, '9D'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT1                         lAPI,
  BIT7                         spare2,
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(lAPI,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '9D'O;)"; 
};

//8.89
type record TMGI
{
  OCT1                         elementIdentifier, // dec 158, '9E'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  OCT3                         mBMSServiceID,
  HEX1                         mccDigit1,
  HEX1                         mccDigit2,
  HEX1                         mccDigit3,
  HEX1                         mncDigit3,
  HEX1                         mncDigit1,
  HEX1                         mncDigit2,
  octetstring                  additionalOctets optional
} with { 
  variant (lengthIndicator) "LENGTHTO(mBMSServiceID, mccDigit1,
  mccDigit2, mccDigit3, mncDigit1,
  mncDigit2, mncDigit3,
  additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = '9E'O;)"; 
};

//8.90
type record AdditionalMMContextForSRVCC
{
  OCT1                         elementIdentifier, // dec 159, '9F'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  integer                      mobileStationClassmark2Length,
  MobileStationClassmark2      mobileStationClassmark2,
  integer                      mobileStationClassmark3Length,
  octetstring                  mobileStationClassmark3,
  integer                      supportedCodecListLength,
  SupportedCodecList           supportedCodecList,
  octetstring                  additionalOctets optional 
}with { 
  variant (lengthIndicator) "LENGTHTO(mobileStationClassmark2Length,mobileStationClassmark2, 
  mobileStationClassmark3Length,mobileStationClassmark3,
  supportedCodecListLength,supportedCodecList,
  additionalOctets)"; 
  variant (mobileStationClassmark2Length) "LENGTHTO(mobileStationClassmark2)"; 
  variant (mobileStationClassmark3Length) "LENGTHTO(mobileStationClassmark3)"; 
  variant (supportedCodecListLength) "LENGTHTO(supportedCodecList)"; 
  variant "PRESENCE (elementIdentifier = '9F'O;)";            
};

// 24.008/ 10.5.1.6 MobileStationClassmark2
//4th octet:
type record MobileStationClassmark2_oct4
{
  BIT1  fc,
  BIT1  vgcs,
  BIT1  vbs,
  BIT1  sm_Capability,
  BIT2  ss_ScreenIndicator,
  BIT1  ps_Capability, 
  BIT1  spare2_1 
};


//5th octet ( Table 10.5.6a ):
type record MobileStationClassmark2_oct5
{
  BIT1  a5_2, 
  BIT1  a5_3,
  BIT1  cmsp,
  BIT1  solsa,
  BIT1  ucs2,
  BIT1  lcsva_cap,
  BIT1  spare5_7,
  BIT1  cm3
};

type record MobileStationClassmark2
{
  BIT3  rf_PowerCapability,
  BIT1  a5_1,
  BIT1  esind,
  BIT2  revisionLevel, 
  BIT1  spare1_1, 
  MobileStationClassmark2_oct4  mobileStationClassmark2_oct4    optional,
  MobileStationClassmark2_oct5  mobileStationClassmark2_oct5    optional
};


// TS 24008/10.5.4.32 Supported Codec List
type record Codec
{
  OCT1  systemIdentification,
  integer  lengthOfBitmap,
  OCT1  codecBitmap_bits1to8,
  OCT1  codecBitmap_bits9to16 optional,
  octetstring additional_codecs optional
} with {
  variant (lengthOfBitmap) "LENGTHTO(codecBitmap_bits1to8,codecBitmap_bits9to16,additional_codecs)"; 
}; 

type record of Codec SupportedCodecList; 

//8.91
type record AdditionalFlagsForSRVCC
{
  OCT1                         elementIdentifier, // dec 160, 'A0'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  BIT1                         iCS,
  BIT7                         spare2,
  octetstring                  additionalOctets optional
} with { 
  variant (lengthIndicator) "LENGTHTO(iCS, spare2, additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'A0'O;)"; 
};

// Sv Information Elements
// 3GPP TS 29.280 6.2
type record STN_SR
{
  OCT1                         elementIdentifier, // dec 51, '33'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT1                         nanpi,
  hexstring                    sTN_SR_Value
}with { 
  variant (lengthIndicator) "LENGTHTO(nanpi,sTN_SR_Value)";
  variant "PRESENCE (elementIdentifier = '33'O;)";  
  variant (sTN_SR_Value) "PADDING(yes)";
  variant (sTN_SR_Value) "PADDING_PATTERN('1'B)";          
};

//8.92 Void
/*type record MMBR
{
  OCT1                         elementIdentifier, // dec 161, 'A1'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT4                         maxMMBR_for_uplink, 
  OCT4                         maxMMBR_for_downlink,
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(maxMMBR_for_uplink,maxMMBR_for_downlink,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'A1'O;)"; 
};*/


//8.93
type record MDT_Configuration
{
  OCT1                         elementIdentifier, // dec 162, 'A2'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  OCT1                         jobType,
  OCT4                         listOfmeasurements,
  OCT1                         reportingTrigger,
  OCT1                         reportInterval,
  OCT1                         reportAmount,
  OCT1                         eventThresholdforRSRP,  
  OCT1                         eventThresholdforRSRQ,
  INT1                         lengthOfAreaScope,
  octetstring                  areaScope optional,
  BIT1                         cRRMI,
  BIT1                         mPI,
  BIT1                         pMI,
  BIT1                         pLI,
  BIT4                         spare2,
  CollectionPeriodforRRMmeasurementsLTE collectionPeriodforRRMmeasurementsLTE optional,
  MeasurementPeriodLTE         measurementPeriodLTE optional,
  PositioningMethod            positioningMethod optional,
  INT1                         numberOfMDT_PLMNs optional,
  MDT_PLMN_List                mDT_PLMN_List length(0..16) optional,
  octetstring                  additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(jobType,listOfmeasurements,reportingTrigger,
  reportInterval,reportAmount,eventThresholdforRSRP,
  eventThresholdforRSRQ,lengthOfAreaScope,areaScope,
  cRRMI,mPI,pMI,pLI,spare2,
  collectionPeriodforRRMmeasurementsLTE,measurementPeriodLTE,positioningMethod,
  numberOfMDT_PLMNs,mDT_PLMN_List,additionalOctets )"; 
  variant "PRESENCE (elementIdentifier = 'A2'O;)"; 
  variant (lengthOfAreaScope) "LENGTHTO(areaScope)";  
  variant (collectionPeriodforRRMmeasurementsLTE) "PRESENCE(cRRMI = '1'B)";   
  variant (measurementPeriodLTE) "PRESENCE(mPI = '1'B)";   
  variant (positioningMethod) "PRESENCE(pMI = '1'B)";   
  variant (mDT_PLMN_List) "PRESENCE(pLI = '1'B)";   
  variant (numberOfMDT_PLMNs) "PRESENCE(pLI = '1'B)";   
  variant (numberOfMDT_PLMNs) "LENGTHTO(mDT_PLMN_List)";  
  variant (numberOfMDT_PLMNs) "UNIT(elements)"; 
};

//5.10.19 3GPP TS 32.422
type record PositioningMethod
{
  BIT1 gNSS,
  BIT1  eCellID,
  BIT6  spare
}
//5.10.20 3GPP TS 32.422
type enumerated CollectionPeriodforRRMmeasurementsLTE
{
  ms1024 (0),
  ms1280 (1),
  ms2048 (2),
  ms2560 (3),
  ms5120 (4),
  ms10240 (5),
  min1 (6)
} with { variant "FIELDLENGTH(8)"; }

//5.10.23 3GPP TS 32.422
type enumerated MeasurementPeriodLTE
{
  ms1024 (0),
  ms1280 (1),
  ms2048 (2),
  ms2560 (3),
  ms5120 (4),
  ms10240 (5),
  min1 (6)
} with { variant "FIELDLENGTH(8)"; }

//9.2.1.89, 9.2.3.8 TS 32.422
type record of OCT3 MDT_PLMN_List;

//8.94
type record APCO
{
  OCT1                         elementIdentifier, // dec 163, 'A3'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare,
  BIT3                         configProtocol,
  BIT4                         spare2,  //'0000'B
  BIT1                         extensionField,   //'1'B
  ProtocolIDs_and_ContainerIDs protocolIDs_and_ContainerIDs optional,
  octetstring                  additionalOctets optional    
}with { 
  variant (lengthIndicator) "LENGTHTO(configProtocol,spare2,extensionField,protocolIDs_and_ContainerIDs,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'A3'O;)";  
};

//8.95
type record AbsoluteTimeofMBMSDataTransfer
{
  OCT1                         elementIdentifier, // dec 164, 'A4'O
  LIN2_BO_LAST                 lengthIndicator,
  BIT4                         instance,
  BIT4                         spare, 
  OCT8                         value_part,
  octetstring                  additionalOctets optional
} with { 
  variant (lengthIndicator) "LENGTHTO( value_part, additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'A4'O;)"; 
};

//8.96
type record HeNBInformationReporting
{
  OCT1            elementIdentifier, // dec 165, 'A5'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  BIT1            FTI,
  BIT7            spare2,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(FTI,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'A5'O;)"; 
};

//8.97
type record IPv4ConfigurationPrameters
{
  OCT1            elementIdentifier, // dec 166, 'A6'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  INT1            subnetPrefixLength,
  OCT4            iPv4DefaultRouterAddress,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(subnetPrefixLength,iPv4DefaultRouterAddress,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'A6'O;)"; 
}

//8.98
type record ChangeToReportFlags
{
  OCT1            elementIdentifier, // dec 167, 'A7'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  BIT1            servingNetworkChangeToReport,
  BIT1            timeZoneChangeToReport,
  BIT6            spare2, //'000000'B
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(servingNetworkChangeToReport,timeZoneChangeToReport,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'A7'O;)"; 
}


//8.99
type record ActionIndication
{
  OCT1            elementIdentifier, // dec 168, 'A8'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  BIT3            indication,
  BIT5            spare2,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(indication,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'A8'O;)"; 
}

//8.100
type record TrustedWLANAccessNetworkIdentifier
{
  OCT1            elementIdentifier,	//dec 169, 'A9'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  BIT1            bssIdIndicator,
  BIT1            cIVAI,
  BIT1            pLMNI,
  BIT1            oPNAI,
  BIT1            lAAI,
  BIT3            spare2,
  INT1            lengthOfSSID,
  octetstring     SSID,
  OCT6            BSSID optional,
  INT1            lengthOfCivicAddress optional,
  octetstring     civicAddressInformation optional,
  OCT4            tWAN_PLMNID optional,
  INT1            lengthOfTWANOperatorName optional,
  octetstring     tWANOperatorName optional,
  INT1            relayIdentityType optional,
  INT1            lengthOfRelayIdentity optional,
  octetstring     relayIdentity optional,
  INT1            lengthOfcircuitID optional,
  octetstring     circuitID optional,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(bssIdIndicator,cIVAI,pLMNI,oPNAI,lAAI,spare2,
  lengthOfSSID,SSID,BSSID,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'A9'O;)";
  variant (lengthOfSSID) "LENGTHTO(SSID)"; 
  variant (civicAddressInformation) "PRESENCE(cIVAI = '1'B)";   
  variant (lengthOfCivicAddress) "PRESENCE(cIVAI = '1'B)";   
  variant (lengthOfCivicAddress) "LENGTHTO(civicAddressInformation)"; 
  variant (tWAN_PLMNID) "PRESENCE(pLMNI = '1'B)";   
  variant (tWANOperatorName) "PRESENCE(oPNAI = '1'B)";   
  variant (lengthOfTWANOperatorName) "PRESENCE(oPNAI = '1'B)";   
  variant (lengthOfTWANOperatorName) "LENGTHTO(tWANOperatorName)"; 
  variant (relayIdentityType) "PRESENCE(lAAI = '1'B)";   
  variant (lengthOfRelayIdentity) "PRESENCE(lAAI = '1'B)";   
  variant (relayIdentity) "PRESENCE(lAAI = '1'B)";   
  variant (lengthOfcircuitID) "PRESENCE(lAAI = '1'B)";   
  variant (circuitID) "PRESENCE(lAAI = '1'B)";   
  variant (lengthOfRelayIdentity) "LENGTHTO(relayIdentity)"; 
  variant (lengthOfcircuitID) "LENGTHTO(circuitID)";
};

type set of TrustedWLANAccessNetworkIdentifier TrustedWLANAccessNetworkIdentifier_List;

//8.101
type record UserLocationInformationTimestamp
{
  OCT1          elementIdentifier,	//dec 170, 'AA'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  OCT4          timestampValue,
  octetstring   additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(timestampValue, additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'AA'O;)";
}

//8.102
type record MBMSFlags
{
  OCT1          elementIdentifier,	//dec 171, 'AB'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  BIT1          mSRI,
  BIT1          lMR,
  BIT6          spare2,
  octetstring   additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(mSRI,lMR,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'AB'O;)";
}

//8.103
type record RAN_NASCause
{
  OCT1          elementIdentifier,	//dec 172, 'AC'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  BIT4          causeType,
  BIT4          protocolType,
  OCT1          causeValue,
  octetstring   additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(causeType, protocolType, causeValue, additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'AC'O;)";
}

type set of RAN_NASCause RAN_NASCause_List;

//8.104
type record CNOperatorSelectionEntity
{
  OCT1          elementIdentifier,	//dec 173, 'AD'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  BIT2          selectionEntity,
  BIT6          spare2,
  octetstring   additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(selectionEntity, spare2, additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'AD'O;)";
}

//8.105
type record TrustedWLANModeIndication
{
  OCT1          elementIdentifier,	//dec 174, 'AE'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  BIT1          sCM,
  BIT1          mCM,
  BIT6          spare2,
  octetstring   additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(sCM, mCM, spare2, additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'AE'O;)";
}

//8.106
type record NodeNumber
{
  OCT1          elementIdentifier,	//dec 175, 'AF'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  LIN1          lenghOfNodeNumber,
  octetstring   nodeNumber,
  octetstring   additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(lenghOfNodeNumber, nodeNumber, additionalOctets)"; 
  variant (lenghOfNodeNumber) "LENGTHTO(nodeNumber)"; 
  variant "PRESENCE (elementIdentifier = 'AF'O;)";
}

type set of NodeNumber NodeNumber_List;

//8.107
type record NodeIdentifier
{
  OCT1          elementIdentifier,	//dec 176, 'B0'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  LIN1          lenghOfNodeName,
  octetstring   nodeName,
  LIN1          lenghOfNodeRealm,
  octetstring   nodeRealm,
  octetstring   additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(lenghOfNodeName,nodeName,lenghOfNodeRealm,nodeRealm, additionalOctets)"; 
  variant (lenghOfNodeName) "LENGTHTO(nodeName)"; 
  variant (lenghOfNodeRealm) "LENGTHTO(nodeRealm)"; 
  variant "PRESENCE (elementIdentifier = 'B0'O;)";
}

type set of NodeIdentifier NodeIdentifier_List;
  
//8.108
type record PresenceReportingAreaAction
{
  OCT1            elementIdentifier,	//dec 177, 'B1'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  BIT3            actionField,
  BIT5            spare2,
  OCT3            presenceReportingAreaIdentifier optional,
  INT4b           numberOfRAI (0..15) optional,
  INT4b           numberOfTAI (0..15) optional,
  INT6b           numberOfMacroENodeB (0..63) optional,
  BIT2            spare3 optional,
  INT6b           numberOfHomeENodeB (0..63) optional,
  BIT2            spare4 optional,
  INT6b           numberOfECGI (0..63) optional,
  BIT2            spare5 optional,
  INT6b           numberOfSAI (0..63) optional,
  BIT2            spare6 optional,
  INT6b           numberOfCGI (0..63) optional,
  BIT2            spare7 optional,
  TAIList         tAIs optional,
  Macro_eNB_ID_List  macroENBIDs optional,
  Home_eNB_ID_List  homeENBIDs optional,
  ECGIList        eCGIs optional,
  RAIList         rAIs optional,
  SAIList         sAIs optional,
  CGIList         cGIs optional,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(actionField,spare2,presenceReportingAreaIdentifier,numberOfRAI,numberOfTAI,numberOfMacroENodeB,
  spare3,numberOfHomeENodeB,spare4,numberOfECGI,spare5,numberOfSAI,spare6,numberOfCGI,spare7,tAIs,macroENBIDs,homeENBIDs,
  eCGIs,rAIs,sAIs,cGIs,additionalOctets)"; 
  variant (numberOfRAI) "LENGTHTO(rAIs)";
  variant (numberOfRAI) "UNIT(elements)"; 
  variant (numberOfTAI) "LENGTHTO(tAIs)";
  variant (numberOfTAI) "UNIT(elements)"; 
  variant (numberOfMacroENodeB) "LENGTHTO(macroENBIDs)";
  variant (numberOfMacroENodeB) "UNIT(elements)"; 
  variant (numberOfHomeENodeB) "LENGTHTO(homeENBIDs)";
  variant (numberOfHomeENodeB) "UNIT(elements)"; 
  variant (numberOfECGI) "LENGTHTO(eCGIs)";
  variant (numberOfECGI) "UNIT(elements)"; 
  variant (numberOfSAI) "LENGTHTO(sAIs)";
  variant (numberOfSAI) "UNIT(elements)"; 
  variant (numberOfCGI) "LENGTHTO(cGIs)";
  variant (numberOfCGI) "UNIT(elements)"; 
  variant "PRESENCE (elementIdentifier = 'B1'O;)";
}

type set of TAI TAIList;
type set of ECGI ECGIList;
type set of RAI RAIList;
type set of SAI SAIList;
type set of CGI CGIList;
type set of Macro_eNodeB_ID_spec Macro_eNB_ID_List;
type set of Home_eNodeB_ID_spec Home_eNB_ID_List;

//8.109
type record PresenceReportingAreaInformation
{
  OCT1          elementIdentifier,	//dec 178, 'B2'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  OCT3          presenceReportingAreaIdentifier,
  BIT1          iPRA,
  BIT1          oPRA,
  BIT6          spare2,
  octetstring   additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(presenceReportingAreaIdentifier,iPRA,oPRA, spare2, additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'B2'O;)";
}

//8.110
type record TWANIdentifierTimestamp
{
  OCT1          elementIdentifier,	//dec 179, 'B3'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  OCT4          tWANIdentifierTimestampValue,
  octetstring   additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(tWANIdentifierTimestampValue, additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'B3'O;)";
}

type set of TWANIdentifierTimestamp TWANIdentifierTimestamp_List
  
//8.111
type record OverloadControlInformationGrouped
{
  OCT1          elementIdentifier,	//dec 180, 'B4'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  OverloadControlInformationIEs overloadControlInformationIEs
}with { 
  variant (lengthIndicator) "LENGTHTO(overloadControlInformationIEs)"; 
  variant "PRESENCE (elementIdentifier = 'B4'O;)";
}

type set OverloadControlInformationIEs
{
  SequenceNumber  overloadControlSequenceNumber optional,
  Metric          overloadReductionMetric optional,
  EPC_Timer       periodOfValidity optional,
  AccessPointName listOfAccessPointName optional
} 

type set of OverloadControlInformationGrouped OverloadControlInformationGrouped_List;

//8.112
type record LoadControlInformationGrouped
{
  OCT1          elementIdentifier,	//dec 181, 'B5'O
  LIN2_BO_LAST  lengthIndicator,
  BIT4          instance,
  BIT4          spare,
  LoadControlInformationIEs loadControlInformationIEs
}with { 
  variant (lengthIndicator) "LENGTHTO(loadControlInformationIEs)"; 
  variant "PRESENCE (elementIdentifier = 'B5'O;)";
}

type set LoadControlInformationIEs
{
  SequenceNumber  loadControlSequenceNumber optional,
  Metric          loadMetric optional,
  APNandRelativeCapacity  listOfAPNandRelativeCapacity optional
}

type set of LoadControlInformationGrouped LoadControlInformationGrouped_List;

//8.113
type record Metric
{
  OCT1          elementIdentifier,	//dec 182, 'B6'O
  LIN2_BO_LAST  lengthIndicator (1),
  BIT4          instance,
  BIT4          spare,
  LIN1          metric (0..100)
}with { 
  variant (lengthIndicator) "LENGTHTO(metric)"; 
  variant "PRESENCE (elementIdentifier = 'B6'O;)";
}

//8.114
type record SequenceNumber
{
  OCT1          elementIdentifier,	//dec 183, 'B7'O
  LIN2_BO_LAST  lengthIndicator (4),
  BIT4          instance,
  BIT4          spare,
  LIN4_BO_LAST  sequenceNumber
}with { 
  variant (lengthIndicator) "LENGTHTO(sequenceNumber)"; 
  variant "PRESENCE (elementIdentifier = 'B7'O;)";
}

//8.115
type record APNandRelativeCapacity
{
  OCT1            elementIdentifier,	//dec 184, 'B8'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  LIN1            relativeCapacity (0..100),
  LIN1            aPNLength,
  AccessPointName accessPointName,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(relativeCapacity,aPNLength,accessPointName, additionalOctets)"; 
  variant (aPNLength) "LENGTHTO(accessPointName)"; 
  variant "PRESENCE (elementIdentifier = 'B8'O;)";
}

//8.116
type record WLANOffloadabilityIndication
{
  OCT1            elementIdentifier,	//dec 185, 'B9'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  BIT1            uTRANIndication,
  BIT1            eUTRANIndication,
  BIT6            spare2,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(uTRANIndication, eUTRANIndication, spare2, additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'B9'O;)";
}

//8.117
type record PagingAndServiceInformation
{
  OCT1            elementIdentifier,	//dec 186, 'BA'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  integer         ePS_Bearer_ID_Value,
  BIT4            spare2,
  BIT1            pPI,
  BIT7            spare3,
  BIT6            pagingPolicyIndicationValue optional,
  BIT2            spare4 optional,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(ePS_Bearer_ID_Value,spare2,pPI,spare3,pagingPolicyIndicationValue,spare4,additionalOctets)"; 
  variant(ePS_Bearer_ID_Value) "FIELDLENGTH(4)"; 
  variant "PRESENCE (elementIdentifier = 'BA'O;)";
  variant (pagingPolicyIndicationValue) "PRESENCE(pPI = '1'B)";   
  variant (spare4) "PRESENCE(pPI = '1'B)";   
}

//8.118
type record IntegerNumber
{
  OCT1            elementIdentifier,	//dec 187, 'BB'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  IntegerNumberValue integerNumberValue optional
}with { 
  variant (lengthIndicator) "LENGTHTO(integerNumberValue)"; 
  variant "PRESENCE (elementIdentifier = 'BB'O;)";
  variant (integerNumberValue)"CROSSTAG(int1,lengthIndicator=1;
  int2,lengthIndicator=2)"
}

type union IntegerNumberValue
{
  LIN1 int1,
  LIN2_BO_LAST int2
}

//8.119
type record MillisecondTimeStamp
{
  OCT1            elementIdentifier,	//dec 188, 'BC'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  OCT6            millisecondTimeStampValue,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(millisecondTimeStampValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'BC'O;)";
}

//8.120
type record MonitoringEventInformation
{
  OCT1            elementIdentifier,	//dec 189, 'BD'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  OCT4            sCEFReferenceID,  //Unsigned32 ?
  LIN1            sCEF_ID_length,
  octetstring     sCEF_ID,
  OCT2            remainingNumberOfReports, //Unsigned32 ?
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(sCEFReferenceID,sCEF_ID_length,sCEF_ID,remainingNumberOfReports,additionalOctets)"; 
  variant (sCEF_ID_length) "LENGTHTO(sCEF_ID)"; 
  variant "PRESENCE (elementIdentifier = 'BD'O;)";
}

//8.121
type record ECGI_List
{
  OCT1            elementIdentifier,	//dec 190, 'BE'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  LIN2_BO_LAST    numberOfECGI,
  ECGIs           eCGIs,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(numberOfECGI,eCGIs,additionalOctets)"; 
  variant (numberOfECGI) "LENGTHTO(eCGIs)";
  variant (numberOfECGI) "UNIT(elements)"; 
  variant "PRESENCE (elementIdentifier = 'BE'O;)";
}

type set of ECGI ECGIs;

//8.122
type record RemoteUEContextGrouped
{
  OCT1            elementIdentifier,	//dec 191, 'BF'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  RemoteUEContextIEs remoteUEContextIEs
}with { 
  variant (lengthIndicator) "LENGTHTO(remoteUEContextIEs)"; 
  variant "PRESENCE (elementIdentifier = 'BF'O;)";
}

type set RemoteUEContextIEs
{
  RemoteUserID          remoteUserID optional,
  RemoteUEIPInformation remoteUEIPInformation optional
}

type set of RemoteUEContextGrouped RemoteUEContextGrouped_List;

//8.123
type record RemoteUserID
{
  OCT1            elementIdentifier,	//dec 192, 'C0'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  BIT1            mSISDNF,
  BIT1            iMEIF,
  BIT6            spare2,
  LIN1            lengthOfIMSI,
  hexstring       iMSI,
  LIN1            lengthOfMSISDN optional,
  hexstring       mSISDN optional,
  LIN1            lengthOfIMEI optional,
  octetstring     iMEI optional,
  octetstring     additionalOctets optional
}with { 
  variant "PRESENCE (elementIdentifier = 'C0'O;)";
  variant (lengthIndicator) "LENGTHTO(mSISDNF,iMEIF,spare2,lengthOfIMSI,iMSI,lengthOfMSISDN,mSISDN,lengthOfIMEI,iMEI,additionalOctets)"; 
  variant (lengthOfMSISDN) "PRESENCE(mSISDNF = '1'B)";   
  variant (mSISDN) "PRESENCE(mSISDNF = '1'B)";   
  variant (lengthOfIMEI) "PRESENCE(iMEIF = '1'B)";   
  variant (iMEI) "PRESENCE(iMEIF = '1'B)";   
  variant (lengthOfIMSI) "LENGTHTO(iMSI)";
  variant (iMSI) "PADDING(yes)";
  variant (iMSI) "PADDING_PATTERN('1'B)";
  variant (lengthOfMSISDN) "LENGTHTO(mSISDN)"; 
  variant (mSISDN) "PADDING(yes)";
  variant (mSISDN) "PADDING_PATTERN('1'B)";
  variant (lengthOfIMEI) "LENGTHTO(iMEI)" ;
}

//8.124
type record RemoteUEIPInformation
{
  OCT1            elementIdentifier,	//dec 193, 'C1'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  octetstring     remoteUEIPInformation
}with { 
  variant (lengthIndicator) "LENGTHTO(remoteUEIPInformation)"; 
  variant "PRESENCE (elementIdentifier = 'C1'O;)";
}

//8.125
type record CIoT_OptimizationsSupportIndication
{
  OCT1            elementIdentifier,	//dec 194, 'C2'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  BIT1            sGNIPDN,
  BIT1            sCNIPDN,
  BIT1            aWOPDN,
  BIT1            iHCSI,
  BIT4            spare2,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(sGNIPDN,sCNIPDN,aWOPDN,iHCSI,spare2,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'C2'O;)";
}

//8.126
type record SCEF_PDN_ConnectionGrouped
{
  OCT1            elementIdentifier,	//dec 195, 'C3'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  SCEF_PDN_ConnectionIEs sCEF_PDN_ConnectionIEs
}with { 
  variant (lengthIndicator) "LENGTHTO(sCEF_PDN_ConnectionIEs)"; 
  variant "PRESENCE (elementIdentifier = 'C3'O;)";
}

type set SCEF_PDN_ConnectionIEs
{
  AccessPointName  accessPointName optional,
  EPS_BearerID     ePS_BearerID optional,
  NodeIdentifier   nodeIdentifier optional
}

type set of SCEF_PDN_ConnectionGrouped SCEF_PDN_ConnectionGrouped_List;

//8.127
type record HeaderCompressionConfiguration
{
  OCT1            elementIdentifier,	//dec 196, 'C4'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  OCT2            rOHC_Profiles,
  LIN2_BO_LAST    maxCID (1..16383),
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(rOHC_Profiles,maxCID,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'C4'O;)";
}

//8.128
type record ExtendedProtocolConfigOptions
{
  OCT1            elementIdentifier,	//dec 197, 'C5'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  octetstring     ePCO
}with { 
  variant (lengthIndicator) "LENGTHTO(ePCO)"; 
  variant "PRESENCE (elementIdentifier = 'C5'O;)";
}

//8.129
type record ServingPLMNRateControl
{
  OCT1            elementIdentifier,	//dec 197, 'C6'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  LIN2_BO_LAST    uplinkRateLimit,
  LIN2_BO_LAST    downlinkRateLimit,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(uplinkRateLimit,downlinkRateLimit,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'C6'O;)";
}

//8.130
type record Counter
{
  OCT1            elementIdentifier,	//dec 199, 'C7'O
  LIN2_BO_LAST    lengthIndicator,
  BIT4            instance,
  BIT4            spare,
  OCT4            timestampValue,
  OCT1            counterValue,
  octetstring     additionalOctets optional
}with { 
  variant (lengthIndicator) "LENGTHTO(timestampValue,counterValue,additionalOctets)"; 
  variant "PRESENCE (elementIdentifier = 'C7'O;)";
}

// GTPC PDUs
// Path Management messages
//7.1.1
type set EchoRequest
{
  Recovery                     recovery,
  NodeFeatures                 sendingNodeFeatures optional,
  PrivateExtension_List        privateExtension optional
};

//7.1.2
type set EchoResponse
{
  Recovery                     recovery,
  NodeFeatures                 sendingNodeFeatures optional,
  PrivateExtension_List        privateExtension optional
};

//7.1.3
type set VersionNotSupported  
{};

// Tunnel Management messages
//7.2.1
type set CreateSessionRequest
{
  IMSI                                    iMSI   optional,
  MSISDN                                  mSISDN      optional,
  MEI                                     mEI         optional,
  UserLocationInfo                        userLocationInfo optional,
  ServingNetwork                          servingNetwork   optional,
  RAT_Type                                rAT_Type,
  Indication                              indication optional,
  FullyQualifiedTEID_List                 fullyQualifiedTEID,  
  AccessPointName                         accessPointName,
  SelectionMode                           selectionMode optional,
  PDN_Type                                pDN_Type optional,
  PDN_AddressAllocation                   pDN_AddressAllocation optional,
  APN_Restriction                         maxAPN_Restriction optional,
  AggregateMaximumBitRate                 ambr optional,
  EPS_BearerID                            linkedEPS_Bearer_ID optional,
  TrustedWLANModeIndication               trustedWLANModeIndication optional,
  ProtocolConfigOptions                   protocolConfigOptions optional, 
  BearerContextGrouped_List               bearerContextGrouped,  
  TraceInformation                        traceInformation optional, 
  Recovery                                recovery optional, 
  FullyQualifiedPDN_ConnectionSetID_List  csid optional, 
  UE_TimeZone                             uE_TimeZone optional,
  User_CSG_Information                    user_CSG_Information optional,
  ChargingCharacteristics                 chargingCharacteristics optional,
  LocalDistinguishedName_List             lDN optional,
  SignallingPriorityIndication            signallingPriorityIndication optional, 
//  MMBR                                    maxMBR_APN_AMBR optional,
  IP_Address_List			  iP_Addr optional,
  PortNumber_List			  portNumber optional,	 
  APCO                                    aPCO optional,
  TrustedWLANAccessNetworkIdentifier_List trustedWLANAccessNetworkIdentifier optional,
  CNOperatorSelectionEntity               cNOperatorSelectionEntity optional,
  PresenceReportingAreaInformation        presenceReportingAreaInformation optional,
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,
  MillisecondTimeStamp                    originationTimeStamp optional,
  IntegerNumber                           maximumWaitTime optional,
  TWANIdentifierTimestamp                 wLANLocationTimestamp optional,
  FullyQualifiedContainer                 nBIFOMContainer optional,
  RemoteUEContextGrouped_List             remoteUEContextGrouped optional,
  NodeIdentifier_List                     nodeIdentifier optional,            
  ExtendedProtocolConfigOptions           extendedProtocolConfigOptions optional,
  ServingPLMNRateControl                  servingPLMNRateControl optional,
  Counter									counter optional,
  PrivateExtension_List                   privateExtension optional 
} with { 
  variant(fullyQualifiedTEID) "REPEATABLE(yes)";
  variant(bearerContextGrouped) "REPEATABLE(yes)";
  variant(csid) "REPEATABLE(yes)"; 
  variant(lDN) "REPEATABLE(yes)"; 
  variant(iP_Addr) "REPEATABLE(yes)"; 
  variant(portNumber) "REPEATABLE(yes)";
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
  variant(remoteUEContextGrouped) "REPEATABLE(yes)";
  variant(trustedWLANAccessNetworkIdentifier) "REPEATABLE(yes)";
};


//7.2.2 
//6.1.1 - Only the Cause information element, optionally Protocol Configuration Options and optionally the Recovery information element 
//shall be included in the response if the Cause contains a value indicating that the request is not accepted.
type set CreateSessionResponse
{
  Cause                                   cause,
  ChangeReportingAction                   changeReportingAction optional, 
  CSG_InformationReportingAction          cSG_InformationReportingAction optional,
  HeNBInformationReporting                heNBInformationReporting optional,
  FullyQualifiedTEID_List                 fullyQualifiedTEID optional,
  PDN_AddressAllocation                   pDN_AddressAllocation optional,
  APN_Restriction                         aPN_Restriction optional,  
  AggregateMaximumBitRate                 ambr optional,
  EPS_BearerID                            linkedEPS_Bearer_ID optional,
  ProtocolConfigOptions                   protocolConfigOptions optional, 
  BearerContextGrouped_List               bearerContextGrouped optional,
  Recovery                                recovery optional,  
  FullyQualifiedDomainName                chargingGatewayName optional,
  IP_Address                              chargingGatewayAddress optional,
  FullyQualifiedPDN_ConnectionSetID_List  csid optional, 
  LocalDistinguishedName_List             lDN optional, 
  EPC_Timer                               pGW_Back_OffTime optional,
  APCO                                    aPCO optional,
  IPv4ConfigurationPrameters              trustedWLANIPv4Parameters optional,
  Indication                              indicationFlags optional,
  PresenceReportingAreaAction             presenceReportingAreaAction optional,
  LoadControlInformationGrouped_List      loadControlInformationGrouped optional,
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,
  FullyQualifiedContainer                 nBIFOMContainer optional,
  ChargingID                              pDNConnectionChargingID optional,
  ExtendedProtocolConfigOptions           extendedProtocolConfigOptions optional,
  PrivateExtension_List                   privateExtension optional
} with { 
  variant(fullyQualifiedTEID) "REPEATABLE(yes)";
  variant(bearerContextGrouped) "REPEATABLE(yes)";
  variant(csid) "REPEATABLE(yes)";
  variant(lDN) "REPEATABLE(yes)";    
  variant(loadControlInformationGrouped) "REPEATABLE(yes)";    
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";    
};

//7.2.3
type set CreateBearerRequest
{
  ProcedureTransactionID                  procedureTransactionID optional,
  EPS_BearerID                            linkedEPS_BearerID,  
  ProtocolConfigOptions                   protocolConfigOptions optional, 
  BearerContextGrouped_List               bearerContextGrouped,
  FullyQualifiedPDN_ConnectionSetID_List  csid optional,  
  ChangeReportingAction                   changeReportingAction optional,
  CSG_InformationReportingAction          cSG_InformationReportingAction optional,
  HeNBInformationReporting		            heNBInformationReporting optional,
  PresenceReportingAreaAction             presenceReportingAreaAction optional,
  Indication                              indicationFlags optional,
  LoadControlInformationGrouped_List      loadControlInformationGrouped optional,
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,
  FullyQualifiedContainer                 nBIFOMContainer optional,
  PrivateExtension_List                   privateExtension optional 
} with {
  variant(bearerContextGrouped) "REPEATABLE(yes)";
  variant(csid) "REPEATABLE(yes)";
  variant(loadControlInformationGrouped) "REPEATABLE(yes)";    
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";    
};

//7.2.4
//6.1.1 - Only the Cause information element, optionally Protocol Configuration Options and optionally the Recovery information element 
//shall be included in the response if the Cause contains a value indicating that the request is not accepted.
type set CreateBearerResponse
{
  Cause                                   cause,
  BearerContextGrouped_List               bearerContextGrouped optional,
  Recovery                                recovery optional,  
  FullyQualifiedPDN_ConnectionSetID_List  csid optional,
  ProtocolConfigOptions                   protocolConfigOptions optional,  
  UE_TimeZone                             uE_TimeZone optional,
  UserLocationInfo                        uLI optional, 
  TrustedWLANAccessNetworkIdentifier_List	trustedWLANAccessNetworkIdentifier optional,
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,
  PresenceReportingAreaInformation        presenceReportingAreaInformation optional,
  IP_Address_List                         iP_Addr optional,
  TWANIdentifierTimestamp                 wLANLocationTimestamp optional,
  PortNumber_List			  portNumber optional,
  FullyQualifiedContainer                 nBIFOMContainer optional,
  ExtendedProtocolConfigOptions           extendedProtocolConfigOptions optional,
  PrivateExtension_List                   privateExtension optional 
} with {  
  variant(bearerContextGrouped) "REPEATABLE(yes)";
  variant(csid) "REPEATABLE(yes)";
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";    
  variant(iP_Addr) "REPEATABLE(yes)";
  variant(trustedWLANAccessNetworkIdentifier) "REPEATABLE(yes)";
  variant(portNumber) "REPEATABLE(yes)"    
};

//7.2.5
type set BearerResourceCommand
{
  EPS_BearerID_List                       epsBearerIdentity,
  ProcedureTransactionID                  procedureTransactionID,
  FlowQoS                                 flowQoS optional,
  TrafficAggregateDescription             tAD optional, 
  RAT_Type                                rAT_Type optional, 
  ServingNetwork                          servingNetwork optional,
  UserLocationInfo                        userLocationInfo optional,
  // EBI is included in 1st field : EPS_BearerID_List
  Indication                              indicationFlags optional,
  FullyQualifiedTEID_List                 fullyQualifiedTEID optional,
  ProtocolConfigOptions                   protocolConfigOptions optional,
  SignallingPriorityIndication            signallingPriorityIndication optional, 
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,
  FullyQualifiedContainer                 nBIFOMContainer optional,
  ExtendedProtocolConfigOptions           extendedProtocolConfigOptions optional,
  PrivateExtension_List                   privateExtension optional 
} with {  
  variant(epsBearerIdentity) "REPEATABLE(yes)";
  variant(fullyQualifiedTEID) "REPEATABLE(yes)";
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";    
};

//7.2.6
type set BearerResourceFailureIndication
{
  Cause                                   cause,
  EPS_BearerID                            linkedBearerIdentity,
  ProcedureTransactionID                  procedureTransactionID,
  Indication                              indicationFlags optional,
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,
  Recovery                                recovery optional, 
  FullyQualifiedContainer                 nBIFOMContainer optional,
  PrivateExtension_List                   privateExtension optional
} with {  
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";    
};

//7.2.7
type set ModifyBearerRequest
{
  MEI                                     mEI optional, 
  UserLocationInfo                        userLocationInfo optional,
  ServingNetwork                          servingNetwork optional, 
  RAT_Type                                rAT_Type optional, 
  Indication                              indicationFlags optional, 
  FullyQualifiedTEID                      fullyQualifiedTEID optional,
  AggregateMaximumBitRate                 ambr optional,  
  DelayValue                              delayDownlinkPacketNotificationReq optional,  
  BearerContextGrouped_List               bearerContextGrouped optional, 
  Recovery                                recovery optional, 
  UE_TimeZone                             uE_TimeZone optional, 
  FullyQualifiedPDN_ConnectionSetID_List  csid optional, 
  User_CSG_Information                    user_CSG_Information optional,
  IP_Address_List			  iP_Addr optional,
  PortNumber_List			  portNumber optional,	 
  LocalDistinguishedName_List             lDN optional,   
//  MMBR                                    maxMBR_APN_AMBR optional,
  CNOperatorSelectionEntity               cNOperatorSelectionEntity optional,
  PresenceReportingAreaInformation        presenceReportingAreaInformation optional,
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,
  ServingPLMNRateControl                  servingPLMNRateControl optional,
  Counter									counter optional,
  PrivateExtension_List                   privateExtension optional
} with { 
  variant(bearerContextGrouped) "REPEATABLE(yes)"; 
  variant(csid) "REPEATABLE(yes)";
  variant(lDN) "REPEATABLE(yes)"; 
  variant(iP_Addr) "REPEATABLE(yes)";
  variant(portNumber) "REPEATABLE(yes)";
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
};

//7.2.8
type set ModifyBearerResponse
{
  Cause                                   cause,
  MSISDN                                  mSISDN optional,
  EPS_BearerID                            linkedEPS_Bearer_ID optional,
  APN_Restriction                         aPN_Restriction optional,
  ProtocolConfigOptions                   protocolConfigOptions optional,
  BearerContextGrouped_List               bearerContextGrouped optional, 
  ChangeReportingAction                   changeReportingAction optional,
  CSG_InformationReportingAction          cSG_InformationReportingAction optional,
  HeNBInformationReporting		  heNBInformationReporting optional,
  FullyQualifiedDomainName                chargingGatewayName optional,
  IP_Address                              chargingGatewayAddress optional, 
  FullyQualifiedPDN_ConnectionSetID_List  csid optional,
  Recovery                                recovery optional,
  LocalDistinguishedName_List             lDN optional, 
  Indication                              indicationFlags optional, 
  PresenceReportingAreaAction             presenceReportingAreaAction optional,
  LoadControlInformationGrouped_List      loadControlInformationGrouped optional,     
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,     
  ChargingID                              pDNConnectionChargingID optional,
  PrivateExtension_List                   privateExtension optional 
} with { 
  variant(bearerContextGrouped) "REPEATABLE(yes)"; 
  variant(csid) "REPEATABLE(yes)";
  variant(lDN) "REPEATABLE(yes)";      
  variant(loadControlInformationGrouped) "REPEATABLE(yes)";
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
};

//7.2.9.1
type set DeleteSessionRequest
{
  Cause                                   cause optional,
  EPS_BearerID                            linkedEPS_Bearer_ID optional, 
  UserLocationInfo                        uLI optional, 
  Indication                              indicationFlags optional,
  ProtocolConfigOptions                   protocolConfigOptions optional, 
  NodeType                                originatingNode optional, 
  FullyQualifiedTEID                      fullyQualifiedTEID optional, 
  UE_TimeZone                             uE_TimeZone optional,
  UserLocationInformationTimestamp	      uLITimestamp optional,
  RAN_NASCause                            rANNASReleaseCause optional,
  TrustedWLANAccessNetworkIdentifier_List trustedWLANAccessNetworkIdentifier optional,
  TWANIdentifierTimestamp_List            tWANIdentifierTimestamp optional,
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,     
  IP_Address			                        uELocalIP_Addr optional,
  PortNumber_List			  portNumber optional,
  ExtendedProtocolConfigOptions           extendedProtocolConfigOptions optional,
  PrivateExtension_List                   privateExtension optional
} with { 
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
  variant(trustedWLANAccessNetworkIdentifier) "REPEATABLE(yes)";    
  variant(tWANIdentifierTimestamp) "REPEATABLE(yes)";
  variant(portNumber) "REPEATABLE(yes)";     
};
//7.2.9.2
type set DeleteBearerRequest
{
  EPS_BearerID_List                       epsBearerIdentity optional, //LBI , EBI
  BearerContextGrouped_List               bearerContextGrouped optional,  
  ProcedureTransactionID                  procedureTransactionID optional, 
  ProtocolConfigOptions                   protocolConfigOptions optional, 
  FullyQualifiedPDN_ConnectionSetID_List  csid optional, 
  Cause                                   cause optional, 
  Indication                              indicationFlags optional, 
  LoadControlInformationGrouped_List      loadControlInformationGrouped optional,     
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,     
  FullyQualifiedContainer                 nBIFOMContainer optional,
  ExtendedProtocolConfigOptions           extendedProtocolConfigOptions optional,
  PrivateExtension_List                   privateExtension optional
} with { 
  variant(epsBearerIdentity) "REPEATABLE(yes)";
  variant(bearerContextGrouped) "REPEATABLE(yes)";
  variant(csid) "REPEATABLE(yes)"  
  variant(loadControlInformationGrouped) "REPEATABLE(yes)";
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
};

//7.2.10.1
type set DeleteSessionResponse
{
  Cause                                   cause,
  Recovery                                recovery optional,
  ProtocolConfigOptions                   protocolConfigOptions optional, 
  Indication                              indicationFlags optional, 
  LoadControlInformationGrouped_List      loadControlInformationGrouped optional,     
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,     
  ExtendedProtocolConfigOptions           extendedProtocolConfigOptions optional,
  PrivateExtension_List                   privateExtension optional
} with { 
  variant(loadControlInformationGrouped) "REPEATABLE(yes)";
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
};

//7.2.10.2
type set DeleteBearerResponse
{
  Cause                                   cause,
  EPS_BearerID                            linkedBearerIdentity optional,
  BearerContextGrouped_List               bearerContextGrouped optional, 
  Recovery                                recovery optional,
  FullyQualifiedPDN_ConnectionSetID_List  csid optional,
  ProtocolConfigOptions                   protocolConfigOptions optional,  
  UE_TimeZone                             uE_TimeZone optional,
  UserLocationInfo                        uLI optional,
  UserLocationInformationTimestamp        uLITimestamp optional,
  TrustedWLANAccessNetworkIdentifier	    trustedWLANAccessNetworkIdentifier optional,
  TWANIdentifierTimestamp                 tWANIdentifierTimestamp optional,
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,     
  IP_Address_List                         iP_Addr optional,
  PortNumber_List			  portNumber optional,
  FullyQualifiedContainer                 nBIFOMContainer optional,
  PrivateExtension_List                   privateExtension optional
} with { 
  variant(bearerContextGrouped) "REPEATABLE(yes)"; 
  variant(csid) "REPEATABLE(yes)";
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
  variant(iP_Addr) "REPEATABLE(yes)";
  variant(portNumber) "REPEATABLE(yes)"; 
};

//7.2.11.1
type set DownlinkDataNotification
{
  Cause                                   cause optional,
  EPS_BearerID_List                       epsBearerIdentity optional,
  AllocationRetentionPriority             aRP optional,
  IMSI                                    iMSI optional,
  FullyQualifiedTEID                      fullyQualifiedTEID optional,
  Indication                              indicationFlags optional, 
  LoadControlInformationGrouped           loadControlInformationGrouped optional,     
  OverloadControlInformationGrouped       overloadControlInformationGrouped optional,     
  PagingAndServiceInformation             pagingAndServiceInformation optional,
  PrivateExtension_List                   privateExtension optional   
}with { 
  variant(epsBearerIdentity) "REPEATABLE(yes)";
}; 


//7.2.11.2
type set DownlinkDataNotificationAcknowledgement
{
  Cause                                   cause,
  DelayValue                              dataNotificationDelay optional,  
  Recovery                                recovery optional, 
  Throttling                              dL_LowPriorityTrafficThrottling optional, 
  IMSI                                    iMSI optional,
  EPC_Timer                               dLBufferingDuration optional,
  IntegerNumber                           dLBufferingSuggestedPacketCount optional,
  PrivateExtension_List                   privateExtension optional
};

//7.2.11.3
type set DownlinkDataNotificationFailureIndication
{
  Cause                                   cause,
  NodeType                                originatingNode optional,
  IMSI                                    iMSI optional, 
  PrivateExtension_List                   privateExtension optional
};

//7.2.12
type set DeleteIndirectDataForwardingTunnelRequest
{
  PrivateExtension_List                   privateExtension optional
};

//7.2.13
type set DeleteIndirectDataForwardingTunnelResponse
{
  Cause                                   cause,
  Recovery                                recovery optional, 
  PrivateExtension_List                   privateExtension optional
}

//7.2.14.1
type set ModifyBearerCommand
{
  AggregateMaximumBitRate                 ambr,   
  BearerContextGrouped                    bearerContextGrouped,
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,
  FullyQualifiedTEID                      fullyQualifiedTEID optional,      
  PrivateExtension_List                   privateExtension optional 
}with { 
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
}; 

//7.2.14.2
type set ModifyBearerFailureIndication
{
  Cause                                   cause,
  Recovery                                recovery optional, 
  Indication                              indicationFlags optional, 
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,     
  PrivateExtension_List                   privateExtension optional 
}with { 
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
}; 

//7.2.15
type set UpdateBearerRequest
{
  BearerContextGrouped_List               bearerContextGrouped, 
  ProcedureTransactionID                  procedureTransactionID optional, 
  ProtocolConfigOptions                   protocolConfigOptions optional, 
  AggregateMaximumBitRate                 apn_ambr, 
  ChangeReportingAction                   changeReportingAction optional,  
  CSG_InformationReportingAction          cSG_InformationReportingAction optional,
  Indication                              indicationFlags optional,
  HeNBInformationReporting		            heNBInformationReporting optional,
  FullyQualifiedPDN_ConnectionSetID_List  csid optional,
  PresenceReportingAreaAction             presenceReportingAreaAction optional,
  LoadControlInformationGrouped_List      loadControlInformationGrouped optional,     
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional, 
  FullyQualifiedContainer                 nBIFOMContainer optional,
  PrivateExtension_List                   privateExtension optional  
} with {   
  variant(bearerContextGrouped) "REPEATABLE(yes)";
  variant(csid) "REPEATABLE(yes)";     
  variant(loadControlInformationGrouped) "REPEATABLE(yes)";
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
};

//7.2.16
//6.1.1 - Only the Cause information element, optionally Protocol Configuration Options and optionally the Recovery information element 
//shall be included in the response if the Cause contains a value indicating that the request is not accepted.
type set UpdateBearerResponse
{
  Cause                                   cause,
  BearerContextGrouped_List               bearerContextGrouped optional,
  ProtocolConfigOptions                   protocolConfigOptions optional,
  Recovery                                recovery optional, 
  FullyQualifiedPDN_ConnectionSetID_List  csid optional, 
  Indication                              indicationFlags optional,
  UE_TimeZone                             uE_TimeZone optional,
  UserLocationInfo                        uLI optional,
  TrustedWLANAccessNetworkIdentifier	    trustedWLANAccessNetworkIdentifier optional,
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,     
  PresenceReportingAreaInformation        presenceReportingAreaInformation optional,
  IP_Address_List                         iP_Addr optional,
  TWANIdentifierTimestamp                 tWANIdentifierTimestamp optional,
  PortNumber_List			  portNumber optional,
  FullyQualifiedContainer                 nBIFOMContainer optional,
  ExtendedProtocolConfigOptions           extendedProtocolConfigOptions optional,
  PrivateExtension_List                   privateExtension optional    
} with {  
  variant(bearerContextGrouped) "REPEATABLE(yes)";
  variant(csid) "REPEATABLE(yes)";     
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
  variant(iP_Addr) "REPEATABLE(yes)";
  variant(portNumber) "REPEATABLE(yes)";      
};

//7.2.17.1
type set DeleteBearerCommand
{
  BearerContextGrouped_List               bearerContextGrouped,
  UserLocationInfo                        uli optional,
  UserLocationInformationTimestamp        uli_timestamp optional,
  UE_TimeZone                             ue_timezone optional, 
  OverloadControlInformationGrouped_List  overloadControlInformationGrouped optional,
  FullyQualifiedTEID                      fullyQualifiedTEID optional,      
  PrivateExtension_List                   privateExtension optional 
} with {  
  variant(bearerContextGrouped) "REPEATABLE(yes)";
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
};

//7.2.17.2
type set DeleteBearerFailureIndication
{
  Cause                                  cause,
  BearerContextGrouped_List              bearerContextGrouped, 
  Recovery                               recovery optional, 
  Indication                             indicationFlags optional,
  OverloadControlInformationGrouped_List overloadControlInformationGrouped optional,     
  PrivateExtension_List                  privateExtension optional 
} with {   
  variant(bearerContextGrouped) "REPEATABLE(yes)";   
  variant(overloadControlInformationGrouped) "REPEATABLE(yes)";
};

//7.2.18
type set CreateIndirectDataForwardingTunnelRequest
{
  IMSI                                   iMSI optional,
  MEI                                    mEI optional,  
  Indication                             indicationFlags optional, 
  FullyQualifiedTEID                     fullyQualifiedTEID optional,
  BearerContextGrouped_List              bearerContextGrouped, 
  Recovery                               recovery optional,   
  PrivateExtension_List                  privateExtension optional 
} with {   
  variant(bearerContextGrouped) "REPEATABLE(yes)";   
};

//7.2.19
//6.1.1 - Only the Cause information element, optionally Protocol Configuration Options and optionally the Recovery information element 
//shall be included in the response if the Cause contains a value indicating that the request is not accepted.
type set CreateIndirectDataForwardingTunnelResponse
{
  Cause                                  cause,
  FullyQualifiedTEID                     fullyQualifiedTEID optional, 
  BearerContextGrouped_List              bearerContextGrouped optional,
  Recovery                               recovery optional,    
  PrivateExtension_List                  privateExtension optional 
} with {   
  variant(bearerContextGrouped) "REPEATABLE(yes)";   
};

//7.2.20
// VOID

//7.2.21
type set ReleaseAccessBearersRequest
{
  EPS_BearerID_List                      listOfRABs optional,
  NodeType                               originatingNode optional,
  Indication                             indicationFlags optional,
  PrivateExtension_List                  privateExtension optional   
} with { 
  variant(listOfRABs) "REPEATABLE(yes)";
};

//7.2.22
type set ReleaseAccessBearersResponse
{
  Cause                                 cause,
  Recovery                              recovery optional, 
  Indication                            indicationFlags optional,
  LoadControlInformationGrouped         loadControlInformationGrouped optional,     
  OverloadControlInformationGrouped     overloadControlInformationGrouped optional,     
  PrivateExtension_List                 privateExtension optional  
}

//7.2.23
type set StopPagingIndication
{
  IMSI                                   iMSI optional,
  PrivateExtension_List                  privateExtension optional
}

//7.2.24
type set ModifyAccessBearersRequest
{
  Indication                             indicationFlags optional, 
  FullyQualifiedTEID                     fullyQualifiedTEID optional, 
  DelayValue                             delayDownlinkPacketNotifReq optional,
  BearerContextGrouped_List              bearerContextGrouped optional,
  Recovery                               recovery optional,    
  PrivateExtension_List                  privateExtension optional 
} with {   
  variant(bearerContextGrouped) "REPEATABLE(yes)";   
};


//7.2.25
type set ModifyAccessBearersResponse
{
  Cause                                 cause,
  BearerContextGrouped_List             bearerContextGrouped optional,
  Recovery                              recovery optional,    
  Indication                            indicationFlags optional,
  LoadControlInformationGrouped         loadControlInformationGrouped optional,     
  OverloadControlInformationGrouped     overloadControlInformationGrouped optional,     
  PrivateExtension_List                 privateExtension optional  
} with {   
  variant(bearerContextGrouped) "REPEATABLE(yes)";   
};


//7.2.26
type set RemoteUEReportNotification
{
  RemoteUEContextGrouped_List           remoteUEContextGrouped optional,
  PrivateExtension_List                 privateExtension optional  
} with {   
  variant(remoteUEContextGrouped) "REPEATABLE(yes)";   
};

//7.2.27
type set RemoteUEReportAcknowledge
{
  Cause                                 cause,
  PrivateExtension_List                 privateExtension optional  
};

// Mobility Management messages
//7.3.1
type set ForwardRelocationRequest
{
  IMSI                                 iMSI optional,
  FullyQualifiedTEID_List              fullyQualifiedTEID,
  PDN_ConnectionGrouped_List           pDN_Connection,
  FullyQualifiedDomainName_List        nodeName optional,
  MM_Context                           mM_Context,
  Indication                           indication optional,
  FullyQualifiedContainer_List         containers optional,
  TargetIdentification                 targetIdentification optional,
  IP_Address_List                      iP_Addr optional,
  FullyQualifiedCause_List             cause optional,
  SourceIdentification                 sourceIdentification optional,
  PLMN_ID           	                 selected_PLMN_ID optional,
  Recovery                             recovery optional, 
  TraceInformation                     traceInformation optional,
  RFSP_Index_List                      rFSP_Index optional, 
  CSG_ID                               cSG_ID optional,
  CSG_MembershipIndication             cSG_MembershipIndication optional,
  UE_TimeZone                          uE_TimeZone      optional,
  ServingNetwork                       servingNetwork optional,
  LocalDistinguishedName               lDN optional,
  AdditionalMMContextForSRVCC          additionalMMContextForSRVCC optional,
  AdditionalFlagsForSRVCC              additionalFlagsForSRVCC optional,
  STN_SR                               sTN_SR optional,
  MSISDN_List                          mSISDN optional,
  MDT_Configuration                    mDT_Configuration optional,
  User_CSG_Information                 user_CSG_Information optional,
  MonitoringEventInformation           monitoringEventInformation optional,
  IntegerNumber                        uEUsageType optional,
  SCEF_PDN_ConnectionGrouped           mME_UE_SCEF_PDN_Connection optional,
  PortNumber                           sourceUDPPortNumber optional,
  ServingPLMNRateControl               servingPLMNRateControl optional,
  PrivateExtension_List                privateExtension optional
} with {      
  variant(fullyQualifiedTEID) "REPEATABLE(yes)";
  variant(pDN_Connection) "REPEATABLE(yes)";
  variant(containers) "REPEATABLE(yes)"; 
  variant(iP_Addr) "REPEATABLE(yes)"; 
  variant(cause) "REPEATABLE(yes)"; 
  variant(rFSP_Index) "REPEATABLE(yes)";
  variant(nodeName) "REPEATABLE(yes)"; 
  variant(mSISDN) "REPEATABLE(yes)"; 
}

//7.3.2
type set ForwardRelocationResponse
{
  Cause                                cause,
  FullyQualifiedTEID                   fullyQualifiedTEID optional,
  Indication                           indication optional,
  BearerContextGrouped_List            bearerContextGrouped optional, 
  FullyQualifiedCause_List             fullyQualifiedCause optional, 
  FullyQualifiedContainer_List         transparentContainer optional,
  LocalDistinguishedName               lDN optional,
  FullyQualifiedDomainName_List	       nodeName optional,
  NodeNumber_List                      nodeNumber optional,
  NodeIdentifier_List                  nodeIdentifier optional,
  PrivateExtension_List                privateExtension optional
} with {   
  variant(bearerContextGrouped) "REPEATABLE(yes)"; 
  variant(fullyQualifiedCause) "REPEATABLE(yes)";       
  variant(transparentContainer) "REPEATABLE(yes)";      
  variant(nodeName) "REPEATABLE(yes)";   
  variant(nodeIdentifier) "REPEATABLE(yes)";   
  variant(nodeNumber) "REPEATABLE(yes)";   
};

//7.3.3
type set ForwardRelocationCompleteNotification
{
  Indication                           indication optional,
  PrivateExtension_List                privateExtension optional
};

//7.3.4
type set ForwardRelocationCompleteAcknowledge
{
  Cause                                cause,
  Recovery                             recovery optional, 
  PrivateExtension_List                     privateExtension optional
};

//7.3.5
type set ContextRequest
{
  IMSI                                 iMSI optional,
  GUTI                                 gUTI optional,
  UserLocationInfo                     uLI optional,
  Packet_TMSI                          pTMSI optional,
  P_TMSI_Signature                     pTMSI_Signature optional,
  CompleteRequestMessage               complete_TAU_RequestMessage optional,
  FullyQualifiedTEID                   address_and_TEID_for_ControlPlane optional,
  PortNumber                 	         portNumber optional,
  RAT_Type                             rAT_Type optional, 
  Indication                           indication optional,
  Hop_Counter                          hop_Counter optional,
  ServingNetwork                       target_PLMN_ID optional,
  LocalDistinguishedName               lDN optional,
  FullyQualifiedDomainName_List	       nodeName optional,
  NodeNumber                           sGSNNumber optional,
  NodeIdentifier_List                  nodeIdentifier optional,
  CIoT_OptimizationsSupportIndication  cIoT_OptimizationsSupportIndication optional,
  PrivateExtension_List                privateExtension optional  
} with {   
  variant(nodeName) "REPEATABLE(yes)"; 
  variant(nodeIdentifier) "REPEATABLE(yes)";   
}; 

//7.3.6
type set ContextResponse
{
  Cause                                cause,
  IMSI                                 iMSI optional,
  MM_Context                           mM_Context optional,
  PDN_ConnectionGrouped_List           pDN_Connection optional,
  FullyQualifiedTEID_List              fullyQualifiedTEID optional,
  FullyQualifiedDomainName_List        nodeName optional,
  Indication                           indication optional,
  TraceInformation                     traceInformation optional,
  IP_Address_List                      iP_Addr optional,
  RFSP_Index_List                      rFSP_Index optional,               
  UE_TimeZone                          uE_TimeZone optional,
  LocalDistinguishedName               lDN optional,
  MDT_Configuration                    mDT_Configuration optional,
  User_CSG_Information                 user_CSG_Information optional,
  MonitoringEventInformation           monitoringEventInformation optional,
  IntegerNumber                        uEUsageType optional,
  SCEF_PDN_ConnectionGrouped           mME_US_SCEF_PDN_Connection optional,
  RAT_Type                             rAT_Type optional,
  ServingPLMNRateControl               servingPLMNRateControl optional,
  Counter								counter optional,
  PrivateExtension_List                privateExtension optional 
}with {    
  variant(pDN_Connection) "REPEATABLE(yes)";
  variant(fullyQualifiedTEID) "REPEATABLE(yes)";
  variant(iP_Addr) "REPEATABLE(yes)";
  variant(rFSP_Index) "REPEATABLE(yes)";    
  variant(nodeName) "REPEATABLE(yes)";     
};

//7.3.7
type set ContextAcknowledge
{
  Cause                                cause,
  Indication                           indication optional,  //SGW change ind, israi
  FullyQualifiedTEID                   fullyQualifiedTEID optional,
  NodeNumber_List                      nodeNumber optional,
  NodeIdentifier_List                  nodeIdentifier optional,
  PrivateExtension_List                privateExtension optional
}with {    
  variant(nodeNumber) "REPEATABLE(yes)";     
  variant(nodeIdentifier) "REPEATABLE(yes)";     
};

//7.3.8
type set IdentificationRequest
{
  GUTI                                 gUTI optional,
  UserLocationInfo                     uLI optional,
  Packet_TMSI                          pTMSI optional,
  P_TMSI_Signature                     pTMSI_Signature optional,
  CompleteRequestMessage               complete_AttachRequestMessage optional, 
  IP_Address                           addressForControlPlane optional,
  PortNumber                 	       portNumber optional,
  Hop_Counter                          hop_Counter optional,
  ServingNetwork                       target_PLMN_ID optional, 
  PrivateExtension_List                privateExtension optional
};

//7.3.9
type set IdentificationResponse
{
  Cause                                cause,
  IMSI                                 iMSI optional,
  MM_Context                           mM_Context optional,
  TraceInformation                     traceInformation optional,
  IntegerNumber                        uEUsageType optional,
  MonitoringEventInformation           monitoringEventInformation optional,
  PrivateExtension_List                privateExtension optional
};

//7.3.10
type set ForwardAccessContextNotification
{
  RAB_Context_List                     rAB_Contexts optional,      
  Source_RNC_PDCP_Context_Info         source_RNC_PDCP_Context_Info optional,    
  PDU_Numbers                          pDU_Numbers optional,
  FullyQualifiedContainer              eUTRAN_TransparentContainer optional,
  PrivateExtension_List                privateExtension optional
}with {    
  variant(rAB_Contexts) "REPEATABLE(yes)";    
};


//7.3.11
type set ForwardAccessContextAcknowledge
{
  Cause                                cause,
  PrivateExtension_List                privateExtension optional 
}

//7.3.12
type set DetachNotification
{
  Cause                               cause,
  DetachType                          detachType optional,
  PrivateExtension_List               privateExtension optional
}

//7.3.13
type set DetachAcknowledge
{
  Cause                               cause,
  Recovery                            recovery optional, 
  PrivateExtension_List               privateExtension optional
};

//7.3.14
type set ChangeNotificationRequest
{
  IMSI                                iMSI optional,
  MEI                                 mEI optional,  
  Indication                          indication optional,
  RAT_Type                            rAT_Type, 
  UserLocationInfo                    uLI optional, 
  User_CSG_Information                user_CSG_Information optional,
  IP_Address                          gTPC_IP_Address optional,
  EPS_BearerID                        linkedBearerIdentity optional,
  PresenceReportingAreaInformation    presenceReportingAreaInformation optional,
  Counter								counter optional,
  PrivateExtension_List               privateExtension optional
};

//7.3.15
//6.1.1 - Only the Cause information element, optionally Protocol Configuration Options and optionally the Recovery information element 
//shall be included in the response if the Cause contains a value indicating that the request is not accepted.
type set ChangeNotificationResponse
{
  IMSI                                iMSI optional,
  MEI                                 mEI optional,  
  Cause                               cause,
  ChangeReportingAction               changeReportingAction optional,  
  CSG_InformationReportingAction      cSG_InformationReportingAction optional,
  PresenceReportingAreaAction         presenceReportingAreaAction optional,
  PrivateExtension_List               privateExtension optional
};

//7.3.16
type set RelocationCancelRequest
{
  IMSI                                iMSI optional,
  MEI                                 mEI optional,   
  Indication                          indication optional, 
  FullyQualifiedCause                 ranapCause optional,
  PrivateExtension_List               privateExtension optional
};

//7.3.17
type set RelocationCancelResponse
{
  Cause                               cause,
  PrivateExtension_List               privateExtension optional
};

//7.3.18
type set ConfigurationTransferTunnel
{
  FullyQualifiedContainer              eUTRAN_TransparentContainer, 
  TargetIdentification                 targetENB_ID
}

//7.3.19
type set RAN_InformationRelay
{
  FullyQualifiedContainer              bSS_Container,
  TargetIdentification                 rIM_RoutingAddress optional,
  PrivateExtension_List                privateExtension optional
}

//7.3.20
type set ISR_StatusIndication
{
  ActionIndication                    actionIndication,
  PrivateExtension_List               privateExtension optional 
}

//7.3.21
type set UE_RegistrationQueryRequest
{
  IMSI                                iMSI,
  PrivateExtension_List               privateExtension optional 
}

//7.3.22
type set UE_RegistrationQueryResponse
{
  Cause                               cause,
  IMSI                                iMSI,
  PLMN_ID                             selectedCoreNetworkOperatorIdenifier,
  PrivateExtension_List               privateExtension optional 
}

//7.4 Fallback Related messages

//7.4.1
type set SuspendNotification
{
  IMSI                                iMSI optional,
  UserLocationInfo                    uLI optional,                
  EPS_BearerID                        linkedEPS_BearerID optional,
  Packet_TMSI                         pTMSI optional,
  NodeType                            originatingNode optional,
  IP_Address                          addressForControlPlane optional,
  PortNumber                          uDPSourcePortNumber optional,
  Hop_Counter                         hopCounter optional,
  PrivateExtension_List               privateExtension optional
};

//7.4.2
type set SuspendAcknowledge
{
  Cause                               cause,
  PrivateExtension_List               privateExtension optional
};

//7.4.3
type set ResumeNotification
{
  IMSI                                iMSI,
  EPS_BearerID                        linkedEPS_BearerID optional,
  NodeType                            originatingNode optional,
  PrivateExtension_List               privateExtension optional
};

//7.4.4 
type set ResumeAcknowledge
{
  Cause                               cause,
  PrivateExtension_List               privateExtension optional
};

//7.4.5
type set CSPagingIndication
{
  IMSI                                iMSI,
  FullyQualifiedDomainName            vLR_Name,
  TMSI                                tMSI optional,
  UserLocationInfo                    locationAreaIdentifier optional,
  GlobalCN_ID                         globalCN_ID optional, 
  ChannelNeeded                       channelNeeded optional,
  EMLPP_Priority                      eMLPP_Priority optional,
  ServiceIndicator                    serviceIndicator optional,
  PrivateExtension_List               privateExtension optional
}; 

//7.4.6
type set AlertMMENotification
{
  PrivateExtension_List               privateExtension optional
};

//7.4.7 
type set AlertMMEAcknowledge
{
  Cause                               cause,
  PrivateExtension_List               privateExtension optional
};

//7.4.8
type set UEActivityNotification
{
  PrivateExtension_List               privateExtension optional
};

//7.4.9 
type set UEActivityAcknowledge
{
  Cause                               cause,
  PrivateExtension_List               privateExtension optional
};

//Non-3GPP access related messages
//7.5.1
type set CreateForwardingTunnelRequest
{
  S103_PDF_List                       s103_PDF,
  PrivateExtension_List               privateExtension optional
} with {    
  variant(s103_PDF) "REPEATABLE(yes)";    
};

//7.5.2   
type set CreateForwardingTunnelResponse
{
  Cause                               cause,
  S1_UDF_List                         s1_UDF optional,
  PrivateExtension_List               privateExtension optional
} with {    
  variant(s1_UDF) "REPEATABLE(yes)";    
}; 

//Restoration and recovery
//7.9.1
type set DeletePDN_ConnectionSetRequest
{
  FullyQualifiedPDN_ConnectionSetID_List  csid optional, //MME, SGW, PGW, ePDG, TWAN
  PrivateExtension_List                   privateExtension optional 
} with {    
  variant(csid) "REPEATABLE(yes)";     
};

//7.9.2
type set DeletePDN_ConnectionSetResponse
{
  Cause                               cause,
  PrivateExtension_List               privateExtension optional
}

//7.9.3
type set UpdatePDN_ConnectionSetRequest
{
  FullyQualifiedPDN_ConnectionSetID_List  csid optional, //MME, SGW
  PrivateExtension_List                   privateExtension optional
} with {    
  variant(csid) "REPEATABLE(yes)";     
};


//7.9.4
type set UpdatePDN_ConnectionSetResponse
{
  Cause                               cause,
  FullyQualifiedPDN_ConnectionSetID   csid optional, //PGW
  PrivateExtension_List               privateExtension optional
}

//7.9.5
type set PGW_RestartNotification
{
  IP_Address_List                        iP_Addr,//PGW, SGW
  Cause					 cause optional,
  PrivateExtension_List                  privateExtension optional
}
with {    
  variant(iP_Addr) "REPEATABLE(yes)"; 
};

//7.9.6
type set PGW_RestartNotificationAcknowledge
{
  Cause                               cause,
  PrivateExtension_List               privateExtension optional
}

//7.9.7
type set PGW_DownlinkTriggeringNotification
{
  IMSI                                iMSI,
  IP_Address			      mME_S4_SGSN_Identifier optional,
  FullyQualifiedTEID                  senderF_TEIDForControlPlane optional,
  PrivateExtension_List               privateExtension optional
}

//7.9.8
type set PGW_DownlinkTriggeringAcknowledge
{
  Cause				      cause,
  IMSI                                iMSI optional,
  IP_Address			      mME_S4_SGSN_Identifier optional,
  PrivateExtension_List               privateExtension optional
}


// Trace Management Messages
//7.12.1 
type set TraceSessionActivation
{
  IMSI                                iMSI optional,
  TraceInformation                    traceInformation,
  MEI                                 mEI optional
}

//7.12.2
type set TraceSessionDeactivation
{
  TraceReference                      traceReference
}


// MBMS Messages
//7.13.1
type set MBMSSessionStartRequest
{
  FullyQualifiedTEID                  fullyQualifiedTEID,
  TMGI                                tMGI,
  MBMS_SessionDuration                mBMS_SessionDuration,
  MBMS_ServiceArea                    mBMS_ServiceArea,
  MBMS_SessionIdentifier              mBMS_SessionIdentifier optional,
  MBMS_FlowIdentifier                 mBMS_FlowIdentifier optional,
  Bearer_QoS                          QoS_Profile,
  MBMS_IPMulticastDistribution_List   mBMS_IPMulticastDistribution,
  Recovery                            recovery optional,
  MBMSTimetoDataTransfer              mBMSTimetoDataTransfer optional,
  AbsoluteTimeofMBMSDataTransfer      mBMS_Data_Transfer_Start optional,
  MBMSFlags                           mBMSFlags optional,
  ECGI_List                           mBMSCellList optional,
  PrivateExtension_List               privateExtension optional
} with {    
  variant(mBMS_IPMulticastDistribution) "REPEATABLE(yes)";     
};

//7.13.2
type set MBMSSessionStartResponse
{
  Cause                               cause,
  FullyQualifiedTEID_List             fullyQualifiedTEID optional,
  MBMS_DistributionAcknowledge        mBMS_DistributionAcknowledge optional,
  Recovery                            recovery optional,
  PrivateExtension_List               privateExtension optional
} with { 
  variant(fullyQualifiedTEID) "REPEATABLE(yes)"; 
};

//7.13.3
type set MBMSSessionUpdateRequest
{
  MBMS_ServiceArea                    mBMS_ServiceArea optional,
  TMGI                                tMGI,
  FullyQualifiedTEID                  fullyQualifiedTEID optional,
  MBMS_SessionDuration                mBMS_SessionDuration,
  Bearer_QoS                          QoS_Profile,
  MBMS_SessionIdentifier              mBMS_SessionIdentifier optional,
  MBMS_FlowIdentifier                 mBMS_FlowIdentifier optional,
  MBMSTimetoDataTransfer              mBMSTimetoDataTransfer optional,
  AbsoluteTimeofMBMSDataTransfer      mBMS_Data_Transfer_Start optional,  
  ECGI_List                           mBMSCellList optional,
  PrivateExtension_List               privateExtension optional
}

//7.13.4
type set MBMSSessionUpdateResponse
{
  Cause                               cause,
  MBMS_DistributionAcknowledge        mBMS_DistributionAcknowledge optional,
  FullyQualifiedTEID                  fullyQualifiedTEID optional,
  Recovery                            recovery optional,
  PrivateExtension_List               privateExtension optional
}

//7.13.5
type set MBMSSessionStopRequest
{
  MBMS_FlowIdentifier                 mBMS_FlowIdentifier optional,
  AbsoluteTimeofMBMSDataTransfer      mBMS_Data_Transfer_Stop optional,   
  PrivateExtension_List               privateExtension optional
}

//7.13.6
type set MBMSSessionStopResponse
{
  Cause                               cause,
  Recovery                            recovery optional, 
  PrivateExtension_List               privateExtension optional
}


type union GTPCv2_PDUs {
  EchoRequest                                  echoRequest,
  EchoResponse                                 echoResponse,
  VersionNotSupported                          versionNotSupported,
  CreateSessionRequest                         createSessionRequest, 
  CreateSessionResponse                        createSessionResponse,
  CreateBearerRequest                          createBearerRequest,
  CreateBearerResponse                         createBearerResponse,
  BearerResourceCommand                        bearerResourceCommand,
  BearerResourceFailureIndication              bearerResourceFailureIndication,
  ModifyBearerRequest                          modifyBearerRequest,
  ModifyBearerResponse                         modifyBearerResponse,
  DeleteSessionRequest                         deleteSessionRequest,   
  DeleteBearerRequest                          deleteBearerRequest,
  DeleteSessionResponse                        deleteSessionResponse,
  DeleteBearerResponse                         deleteBearerResponse,
  DownlinkDataNotification                     downlinkDataNotification,
  DownlinkDataNotificationAcknowledgement      downlinkDataNotificationAcknowledgement,
  DownlinkDataNotificationFailureIndication    downlinkDataNotificationFailureIndication,
  DeleteIndirectDataForwardingTunnelRequest    deleteIndirectDataForwardingTunnelRequest,
  DeleteIndirectDataForwardingTunnelResponse   deleteIndirectDataForwardingTunnelResponse,
  ModifyBearerCommand                          modifyBearerCommand,
  ModifyBearerFailureIndication                modifyBearerFailureIndication,
  UpdateBearerRequest                          updateBearerRequest,
  UpdateBearerResponse                         updateBearerResponse,
  DeleteBearerCommand                          deleteBearerCommand,
  DeleteBearerFailureIndication                deleteBearerFailureIndication,  
  CreateIndirectDataForwardingTunnelRequest    createIndirectDataForwardingTunnelRequest,
  CreateIndirectDataForwardingTunnelResponse   createIndirectDataForwardingTunnelResponse,
  ReleaseAccessBearersRequest                  releaseAccessBearersRequest,
  ReleaseAccessBearersResponse                 releaseAccessBearersResponse,
  StopPagingIndication                         stopPagingIndication,
  ModifyAccessBearersRequest                   modifyAccessBearersRequest,
  ModifyAccessBearersResponse                  modifyAccessBearersResponse,
  RemoteUEReportNotification                   remoteUEReportNotification,
  RemoteUEReportAcknowledge                    remoteUEReportAcknowledge,
  ForwardRelocationRequest                     forwardRelocationRequest,
  ForwardRelocationResponse                    forwardRelocationResponse,
  ForwardRelocationCompleteNotification        forwardRelocationCompleteNotification,
  ForwardRelocationCompleteAcknowledge         forwardRelocationCompleteAcknowledge,
  ContextRequest                               contextRequest,
  ContextResponse                              contextResponse,
  ContextAcknowledge                           contextAcknowledge, 
  IdentificationRequest                        identificationRequest,
  IdentificationResponse                       identificationResponse,
  ForwardAccessContextNotification             forwardAccessContextNotification,
  ForwardAccessContextAcknowledge              forwardAccessContextAcknowledge,
  DetachNotification                           detachNotification,
  DetachAcknowledge                            detachAcknowledge,
  ChangeNotificationRequest                    changeNotificationRequest,
  ChangeNotificationResponse                   changeNotificationResponse,
  RelocationCancelRequest                      relocationCancelRequest,
  RelocationCancelResponse                     relocationCancelResponse,
  ConfigurationTransferTunnel                  configurationTransferTunnel,
  RAN_InformationRelay                         rAN_InformationRelay,
  SuspendNotification                          suspendNotification,
  SuspendAcknowledge                           suspendAcknowledge,
  ResumeNotification                           resumeNotification,
  ResumeAcknowledge                            resumeAcknowledge,
  CSPagingIndication                           cSPagingIndication,
  CreateForwardingTunnelRequest                createForwardingTunnelRequest,
  CreateForwardingTunnelResponse               createForwardingTunnelResponse,
  DeletePDN_ConnectionSetRequest               deletePDN_ConnectionSetRequest,
  DeletePDN_ConnectionSetResponse              deletePDN_ConnectionSetResponse,
  TraceSessionActivation                       traceSessionActivation,
  TraceSessionDeactivation                     traceSessionDeactivation,
  UpdatePDN_ConnectionSetRequest               updatePDN_ConnectionSetRequest,
  UpdatePDN_ConnectionSetResponse              updatePDN_ConnectionSetResponse,
  PGW_RestartNotification                      pGW_RestartNotification,
  PGW_RestartNotificationAcknowledge           pGW_RestartNotificationAcknowledge,
  PGW_DownlinkTriggeringNotification           pGW_DownlinkTriggeringNotification,
  PGW_DownlinkTriggeringAcknowledge	           pGW_DownlinkTriggeringAcknowledge,
  AlertMMENotification                         alertMMENotification,
  AlertMMEAcknowledge                          alertMMEAcknowledge,
  UEActivityNotification                       uEActivityNotification,
  UEActivityAcknowledge                        uEActivityAcknowledge,
  MBMSSessionStartRequest                      mBMSSessionStartRequest,
  MBMSSessionStartResponse                     mBMSSessionStartResponse,
  MBMSSessionUpdateRequest                     mBMSSessionUpdateRequest,
  MBMSSessionUpdateResponse                    mBMSSessionUpdateResponse,
  MBMSSessionStopRequest                       mBMSSessionStopRequest,
  MBMSSessionStopResponse                      mBMSSessionStopResponse,
  ISR_StatusIndication			                   iSR_StatusIndication,
  UE_RegistrationQueryRequest                  uE_RegistrationQueryRequest,
  UE_RegistrationQueryResponse                 uE_RegistrationQueryResponse
}

// TOP LEVEL GTPC PDU
type record PDU_GTPCv2
{
  BIT3                           spare,   //0 
  BIT1                           t_Bit,
  BIT1                           p_Bit,
  BIT3                           version,  //'010'B
  OCT1                           messageType,
  LIN2_BO_LAST                   lengthf, 
  OCT4                           tEID optional,
  OCT3                           sequenceNumber,
  OCT1                           spare3, // 0
  GTPCv2_PDUs                    gtpcv2_pdu,
  PDU_GTPCv2                     piggybackPDU_GTPCv2 optional
}  with { 
  variant (tEID) "PRESENCE(t_Bit = '1'B)";
  variant (piggybackPDU_GTPCv2) "PRESENCE(p_Bit = '1'B)";   
  variant (lengthf) "LENGTHTO(tEID,sequenceNumber,spare3,gtpcv2_pdu)";
  variant (gtpcv2_pdu) "CROSSTAG( 
  echoRequest,                                       messageType = '01'O; 
  echoResponse,                                      messageType = '02'O; 
  versionNotSupported,                               messageType = '03'O; 
  createSessionRequest,                              messageType = '20'O;  //32 
  createSessionResponse,                             messageType = '21'O;  //33  
  createBearerRequest,                               messageType = '5F'O;  //95 
  createBearerResponse,                              messageType = '60'O;  //96 
  bearerResourceCommand,                             messageType = '44'O;  //68 
  bearerResourceFailureIndication,                   messageType = '45'O;  //69 
  modifyBearerRequest,                               messageType = '22'O;  //34
  modifyBearerResponse,                              messageType = '23'O;  //35
  deleteSessionRequest,                              messageType = '24'O;  //36    
  deleteBearerRequest,                               messageType = '63'O;  //99
  deleteSessionResponse,                             messageType = '25'O;  //37 
  deleteBearerResponse,                              messageType = '64'O;  //100 
  downlinkDataNotification,                          messageType = 'B0'O;  //176
  downlinkDataNotificationAcknowledgement,           messageType = 'B1'O;  //177 
  downlinkDataNotificationFailureIndication,         messageType = '46'O;  //70 
  deleteIndirectDataForwardingTunnelRequest,         messageType = 'A8'O;  //168 
  deleteIndirectDataForwardingTunnelResponse,        messageType = 'A9'O;  //169  
  modifyBearerCommand,                               messageType = '40'O;  //64
  modifyBearerFailureIndication,                     messageType = '41'O;  //65
  updateBearerRequest,                               messageType = '61'O;  //97 
  updateBearerResponse,                              messageType = '62'O;  //98 
  deleteBearerCommand,                               messageType = '42'O;  //66
  deleteBearerFailureIndication,                     messageType = '43'O;  //67 
  createIndirectDataForwardingTunnelRequest,         messageType = 'A6'O;  //166 
  createIndirectDataForwardingTunnelResponse,        messageType = 'A7'O;  //167 
  releaseAccessBearersRequest,                       messageType = 'AA'O;  //170
  releaseAccessBearersResponse,                      messageType = 'AB'O;  //171 
  stopPagingIndication,                              messageType = '49'O;  //73 
  modifyAccessBearersRequest,                        messageType = 'D3'O;  //211
  modifyAccessBearersResponse,                       messageType = 'D4'O;  //212
  remoteUEReportNotification,                        messageType = '28'O;  //40
  remoteUEReportAcknowledge,                         messageType = '29'O;  //41
  forwardRelocationRequest,                          messageType = '85'O;  //133
  forwardRelocationResponse,                         messageType = '86'O;  //134
  forwardRelocationCompleteNotification,             messageType = '87'O;  //135 
  forwardRelocationCompleteAcknowledge,              messageType = '88'O;  //136 
  contextRequest,                                    messageType = '82'O;  //130 
  contextResponse,                                   messageType = '83'O;  //131
  contextAcknowledge,                                messageType = '84'O;  //132 
  identificationRequest,                             messageType = '80'O;  //128
  identificationResponse,                            messageType = '81'O;  //129
  forwardAccessContextNotification,                  messageType = '89'O;  //137
  forwardAccessContextAcknowledge,                   messageType = '8A'O;  //138 
  detachNotification,                                messageType = '95'O;  //149 
  detachAcknowledge,                                 messageType = '96'O;  //150 
  changeNotificationRequest,                         messageType = '26'O;  //38
  changeNotificationResponse,                        messageType = '27'O;  //39
  relocationCancelRequest,                           messageType = '8B'O;  //139
  relocationCancelResponse,                          messageType = '8C'O;  //140
  configurationTransferTunnel,                       messageType = '8D'O;  //141
  rAN_InformationRelay,                              messageType = '98'O;  //152 
  suspendNotification,                               messageType = 'A2'O;  //162 
  suspendAcknowledge,                                messageType = 'A3'O;  //163 
  resumeNotification,                                messageType = 'A4'O;  //164
  resumeAcknowledge,                                 messageType = 'A5'O;  //165
  cSPagingIndication,                                messageType = '97'O;  //151 
  createForwardingTunnelRequest,                     messageType = 'A0'O;  //160 
  createForwardingTunnelResponse,                    messageType = 'A1'O;  //161 
  deletePDN_ConnectionSetRequest,                    messageType = '65'O;  //101
  deletePDN_ConnectionSetResponse,                   messageType = '66'O;  //102
  traceSessionActivation,                            messageType = '47'O;  //71
  traceSessionDeactivation,                          messageType = '48'O;  //72 
  updatePDN_ConnectionSetRequest,                    messageType = 'C8'O;  //200
  updatePDN_ConnectionSetResponse,                   messageType = 'C9'O;  //201
  pGW_RestartNotification,                           messageType = 'B3'O;  //179
  pGW_RestartNotificationAcknowledge,                messageType = 'B4'O;  //180
  pGW_DownlinkTriggeringNotification,                messageType = '67'O;  //103
  pGW_DownlinkTriggeringAcknowledge,                 messageType = '68'O;  //104
  alertMMENotification,                              messageType = '99'O;  //153
  alertMMEAcknowledge,                               messageType = '9A'O;  //154
  uEActivityNotification,                            messageType = '9B'O;  //155
  uEActivityAcknowledge,                             messageType = '9C'O;  //156
  iSR_StatusIndication,				                       messageType = '9D'O;  //157
  uE_RegistrationQueryRequest,				               messageType = '9E'O;  //158
  uE_RegistrationQueryResponse,				               messageType = '9F'O;  //159
  mBMSSessionStartRequest,                           messageType = 'E7'O;  //231
  mBMSSessionStartResponse,                          messageType = 'E8'O;  //232
  mBMSSessionUpdateRequest,                          messageType = 'E9'O;  //233
  mBMSSessionUpdateResponse,                         messageType = 'EA'O;  //234
  mBMSSessionStopRequest,                            messageType = 'EB'O;  //235
  mBMSSessionStopResponse,                           messageType = 'EC'O;  //236
  )";                          
};



} with { encode "RAW"} // End of module
