/******************************************************************************
* Copyright (c) 2000-2023 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
*
* Contributors:
* Ferenc Kovacs
* Gabor Bettesch
* Gabor Szalai
******************************************************************************/
//
//  File:               M3UA_Types.ttcn
//  Rev:                R2A
//  Prodnr:             CNL 113 536
//  Reference:

module M3UA_Types {

import from General_Types all;

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

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

//++++++++++++++++++++++++++++++++++++++++++++++++++
// M3UA PARAMETERS
//++++++++++++++++++++++++++++++++++++++++++++++++++
type octetstring M3UA_OCT0_255 length (0..255);

type record M3UA_Point_Code
{
  OCT1 mask,
  OCT3 affected_Point_Code
}

type record of M3UA_Point_Code M3UA_Point_Codes;

type record M3UA_Error_Code
{
  OCT2      tag,
  integer   lengthInd,
  OCT4      errorCode
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,errorCode)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Routing_Context
{
  OCT2            tag,
  integer         lengthInd,
  octetstring     routingContext
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,routingContext)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
         variant "PADDING(dword32)";
       }

type record M3UA_Affected_Point_Codes
{
  OCT2             tag,
  integer          lengthInd,
  M3UA_Point_Codes pointCodes
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,pointCodes)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Network_Appearance
{
  OCT2         tag,
  integer      lengthInd,
  OCT4         networkAppearance
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,networkAppearance)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Diagnostic_information
{
  OCT2         tag,
  integer      lengthInd,
  octetstring  diagnosticInformation
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,diagnosticInformation)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
         variant "PADDING(dword32)";
       }

type record M3UA_Correlation_ID
{
  OCT2      tag,
  integer   lengthInd,
  OCT4      correlationID
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,correlationID)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Protocol_Data
{
  OCT2        tag,
  integer     lengthInd,
  OCT4        oPC,
  OCT4        dPC,
  OCT1        sI,
  OCT1        nI,
  OCT1        mP,
  OCT1        sLS,
  octetstring userProtocolData
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,oPC,dPC,sI,nI,mP,sLS,
                                       userProtocolData)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
         variant "PADDING(dword32)";
       }

type record M3UA_Info_String
{
  OCT2          tag,
  integer       lengthInd,
  M3UA_OCT0_255 infoString
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,infoString)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
         variant "PADDING(dword32)";
       }

type record  M3UA_Concerned_Destination
{
  OCT2      tag,
  integer   lengthInd,
  OCT1      reserved,
  OCT3      concernedDestination
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,reserved,
                                       concernedDestination)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record  M3UA_Congestion_Indicators
{
  OCT2       tag,
  integer    lengthInd,
  OCT1       reserved,
  OCT3       congestionLevel
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,reserved,congestionLevel)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_User_Cause
{
  OCT2       tag,
  integer    lengthInd,
  OCT2       cause,
  OCT2       user
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,cause,user)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
        }

type record M3UA_ASP_Identifier
{
  OCT2       tag,
  integer    lengthInd,
  OCT4       aSPIdentifier
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,aSPIdentifier)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Heartbeat_Data
{
  OCT2        tag,
  integer     lengthInd,
  octetstring heartbeat_Data
} with { variant (lengthInd) "LENGTHTO(tag,lengthInd,heartbeat_Data)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
         variant "PADDING(dword32)";
       }

type record M3UA_Traffic_Mode_Type
{
  OCT2       tag,
  integer    lengthInd,
  OCT4       trafficModeType
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,trafficModeType)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Status
{
  OCT2       tag,
  integer    lengthInd,
  OCT2       statusType,
  OCT2       statusInfo
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,statusType,statusInfo)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Local_Routing_Key_Id
{
  OCT2       tag,
  integer    lengthInd,
  OCT4       localRkId
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,localRkId)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Destination_PointCode
{
  OCT2            tag,
  integer         lengthInd,
  M3UA_Point_Code pointCode
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,pointCode)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Service_Indicators
{
  OCT2       tag,
  integer    lengthInd,
  octetstring serviceIndicators
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,serviceIndicators)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_OPC_List
{
  OCT2             tag,
  integer          lengthInd,
  M3UA_Point_Codes pointCodes
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,pointCodes)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Routing_Key
{
  OCT2                        tag,
  integer                     lengthInd,
  M3UA_Routing_Key_Parameters routingKey
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,routingKey)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Registration_Status
{
  OCT2                        tag,
  integer                     lengthInd,
  OCT4			      registrationStatus
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,registrationStatus)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type record M3UA_Deregistration_Status
{
  OCT2                        tag,
  integer                     lengthInd,
  OCT4			      deregistrationStatus
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,deregistrationStatus)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type set M3UA_Routing_Key_Parameters
{
  M3UA_Local_Routing_Key_Id   local_Routing_Key_Id,
  M3UA_Routing_Context        routing_Context optional,
  M3UA_Traffic_Mode_Type      traffic_Mode_Type optional,
  M3UA_Destination_PointCode  destination_Point_Code,
  M3UA_Network_Appearance     network_Appearance optional,
  M3UA_Service_Indicators     service_Indicators optional,
  M3UA_OPC_List               opc_List optional
} with { variant "TAG(local_Routing_Key_Id,   tag = '020a'O;
                      routing_Context,        tag = '0006'O;
                      traffic_Mode_Type,      tag = '000b'O;
                      destination_Point_Code, tag = '020b'O;
                      network_Appearance,     tag = '0200'O;
                      service_Indicators,     tag = '020c'O;
                      opc_List,               tag = '020e'O; )"
       }

type record M3UA_Registration_Result
{
  OCT2                                tag,
  integer                             lengthInd,
  M3UA_Registration_Result_Parameters registrationResult
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,registrationResult)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type set M3UA_Registration_Result_Parameters
{
  M3UA_Local_Routing_Key_Id  local_Routing_Key_Id,
  M3UA_Registration_Status   registration_Status,
  M3UA_Routing_Context       routing_Context
} with { variant "TAG(local_Routing_Key_Id, tag = '020a'O;
                      registration_Status,  tag = '0212'O;
                      routing_Context,      tag = '0006'O; )"
       }

type record M3UA_Deregistration_Result
{
  OCT2                                  tag,
  integer                               lengthInd,
  M3UA_Deregistration_Result_Parameters deregistrationResult
} with { variant (lengthInd) "LENGTHTO (tag,lengthInd,deregistrationResult)";
         variant (lengthInd) "FIELDLENGTH(16)";
         variant (lengthInd) "BYTEORDER(last)";
       }

type set M3UA_Deregistration_Result_Parameters
{
  M3UA_Routing_Context       routing_Context,
  M3UA_Deregistration_Status deregistration_Status
} with { variant "TAG(routing_Context,       tag = '0006'O;
                      deregistration_Status, tag = '0213'O; )"
       }


//++++++++++++++++++++++++++++++++++++++++++++++++++
//PDUs
//++++++++++++++++++++++++++++++++++++++++++++++++++

// M3UA_ERR PDU
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_ERR
{
  OCT1                       version,
  OCT1                       reserved,
  OCT2                       messageClassAndType,
  integer                    messageLength,
  M3UA_ERR_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_ERR_MessageParameters
{
  M3UA_Error_Code             error_Code,
  M3UA_Routing_Context        routing_Context optional,
  M3UA_Affected_Point_Codes   affected_Point_Codes optional,
  M3UA_Network_Appearance     network_Appearance optional,
  M3UA_Diagnostic_information diagnostic_information optional
} with { variant "TAG(error_Code,             tag = '000C'O;
                      routing_Context,        tag = '0006'O;
                      affected_Point_Codes,   tag = '0012'O;
                      network_Appearance,     tag = '0200'O;
                      diagnostic_information, tag = '0007'O; )"
       }


// M3UA_NOTIFY
//  NOTE1 : NOTIFY should not come and will be dropped if it comes
//  NOTE2 : messageParameters is simpified implementation as octetstring
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_NOTIFY
{
  OCT1                          version,
  OCT1                          reserved,
  OCT2                          messageClassAndType,
  integer                       messageLength,
  M3UA_NOTIFY_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_NOTIFY_MessageParameters
{
  M3UA_Status              status,
  M3UA_ASP_Identifier      aSP_Identifier optional,
  M3UA_Routing_Context     routing_Context optional,
  M3UA_Info_String         info_String optional
} with { variant "TAG(aSP_Identifier,      tag = '0011'O;
                      routing_Context,     tag = '0006'O;
                      info_String,         tag = '0004'O; )"
       }

//  M3UA_DATA PDU
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_DATA
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_DATA_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_DATA_MessageParameters
{
  M3UA_Network_Appearance  network_Appearance optional,
  M3UA_Routing_Context     routing_Context optional,
  M3UA_Protocol_Data       protocol_Data,
  M3UA_Correlation_ID      correlation_ID optional
} with { variant "TAG(network_Appearance,   tag = '0200'O;
                      routing_Context,      tag = '0006'O;
                      protocol_Data,        tag = '0210'O;
                      correlation_ID,       tag = '0013'O; )"
       }


//  M3UA_DUNA PDU
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_DUNA
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_DUNA_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_DUNA_MessageParameters
{
  M3UA_Network_Appearance   network_Appearance optional,
  M3UA_Routing_Context      routing_Context optional,
  M3UA_Affected_Point_Codes affected_Point_Codes,
  M3UA_Info_String          info_String optional
} with { variant "TAG(network_Appearance,    tag = '0200'O;
                      routing_Context,       tag = '0006'O;
                      affected_Point_Codes,  tag = '0012'O;
                      info_String,           tag = '0004'O )"
       }


//  M3UA_DAVA PDU
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_DAVA
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_DAVA_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_DAVA_MessageParameters
{
  M3UA_Network_Appearance   network_Appearance optional,
  M3UA_Routing_Context      routing_Context optional,
  M3UA_Affected_Point_Codes affected_Point_Codes,
  M3UA_Info_String          info_String optional
} with { variant "TAG(network_Appearance,       tag = '0200'O;
                      routing_Context,          tag = '0006'O;
                      affected_Point_Codes,     tag = '0012'O;
                      info_String,              tag = '0004'O )"
       }


//  M3UA_DAUD PDU
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_DAUD
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_DAUD_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_DAUD_MessageParameters
{
  M3UA_Network_Appearance   network_Appearance optional,
  M3UA_Routing_Context      routing_Context optional,
  M3UA_Affected_Point_Codes affected_Point_Codes,
  M3UA_Info_String          info_String optional
} with { variant "TAG(network_Appearance,       tag = '0200'O;
                      routing_Context,          tag = '0006'O;
                      affected_Point_Codes,     tag = '0012'O;
                      info_String,              tag = '0004'O )"
       }


//  M3UA_SCON PDU
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_SCON
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_SCON_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_SCON_MessageParameters
{
  M3UA_Network_Appearance    network_Appearance optional,
  M3UA_Routing_Context       routing_Context optional,
  M3UA_Affected_Point_Codes  affected_Point_Codes,
  M3UA_Concerned_Destination concerned_Destination optional,
  M3UA_Congestion_Indicators congestion_Indicators optional,
  M3UA_Info_String           info_String optional
} with { variant "TAG(network_Appearance,       tag = '0200'O;
                      routing_Context,          tag = '0006'O;
                      affected_Point_Codes,     tag = '0012'O;
                      concerned_Destination,    tag = '0206'O;
                      congestion_Indicators,    tag = '0205'O;
                      info_String,              tag = '0004'O )"
       }


//  M3UA_DUPU PDU
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_DUPU
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_DUPU_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_DUPU_MessageParameters
{
  M3UA_Network_Appearance   network_Appearance optional,
  M3UA_Routing_Context      routing_Context optional,
  M3UA_Affected_Point_Codes affected_Point_Codes,
  M3UA_User_Cause           user_Cause,
  M3UA_Info_String          info_String optional
} with { variant "TAG(network_Appearance,       tag = '0200'O;
                      routing_Context,          tag = '0006'O;
                      affected_Point_Codes,     tag = '0012'O;
                      user_Cause,               tag = '0204'O;
                      info_String,              tag = '0004'O )"
       }


//  M3UA_DRST PDU
//  NOTE1 : DRST should not come and will be dropped if it comes
//  NOTE2 : messageParameters is simpified implementation as octetstring
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_DRST
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  octetstring                 messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }


//  M3UA_ASPUP
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_ASPUP
{
  OCT1                         version,
  OCT1                         reserved,
  OCT2                         messageClassAndType,
  integer                      messageLength,
  M3UA_ASPUP_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_ASPUP_MessageParameters
{
  M3UA_ASP_Identifier aSP_Identifier optional,
  M3UA_Info_String    info_String optional
} with { variant "TAG(aSP_Identifier,      tag = '0011'O;
                      info_String,         tag = '0004'O; )"
       }


//M3UA_ASPUP_Ack
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_ASPUP_Ack
{
  OCT1                             version,
  OCT1                             reserved,
  OCT2                             messageClassAndType,
  integer                          messageLength,
  M3UA_ASPUP_Ack_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_ASPUP_Ack_MessageParameters
{
  M3UA_Info_String   info_String optional
} with { variant "TAG(info_String,         tag = '0004'O; )"
       }


//M3UA_ASPDN
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_ASPDN
{
  OCT1                         version,
  OCT1                         reserved,
  OCT2                         messageClassAndType,
  integer                      messageLength,
  M3UA_ASPDN_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_ASPDN_MessageParameters
{
  M3UA_Info_String   info_String optional
} with { variant "TAG(info_String,         tag = '0004'O; )"
       }


//M3UA_ASPDN_Ack
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_ASPDN_Ack
{
  OCT1                             version,
  OCT1                             reserved,
  OCT2                             messageClassAndType,
  integer                          messageLength,
  M3UA_ASPDN_Ack_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_ASPDN_Ack_MessageParameters
{
  M3UA_Info_String   info_String optional
} with { variant "TAG(info_String,         tag = '0004'O;)"
       }


// M3UA_BEAT
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_BEAT
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_BEAT_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_BEAT_MessageParameters
{
  M3UA_Heartbeat_Data  heartbeat_Data optional
} with { variant "TAG(heartbeat_Data,         tag = '0009'O; )"
       }


// M3UA_BEAT_Ack
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_BEAT_Ack
{
  OCT1                            version,
  OCT1                            reserved,
  OCT2                            messageClassAndType,
  integer                         messageLength,
  M3UA_BEAT_Ack_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_BEAT_Ack_MessageParameters
{
  M3UA_Heartbeat_Data  heartbeat_Data optional
} with { variant "TAG(heartbeat_Data,         tag = '0009'O; )"
       }


// M3UA_ASPAC
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_ASPAC
{
  OCT1                         version,
  OCT1                         reserved,
  OCT2                         messageClassAndType,
  integer                      messageLength,
  M3UA_ASPAC_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_ASPAC_MessageParameters
{
  M3UA_Traffic_Mode_Type    traffic_Mode_Type optional,
  M3UA_Routing_Context      routing_Context optional,
  M3UA_Info_String          info_String optional
} with { variant "TAG(traffic_Mode_Type,   tag = '000B'O;
                      routing_Context,     tag = '0006'O;
                      info_String,         tag = '0004'O; )"
       }


// M3UA_ASPAC_Ack
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_ASPAC_Ack
{
  OCT1                             version,
  OCT1                             reserved,
  OCT2                             messageClassAndType,
  integer                          messageLength,
  M3UA_ASPAC_Ack_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_ASPAC_Ack_MessageParameters
{
  M3UA_Traffic_Mode_Type   traffic_Mode_Type optional,
  M3UA_Routing_Context     routing_Context optional,
  M3UA_Info_String         info_String optional
} with { variant "TAG(traffic_Mode_Type,   tag = '000B'O;
                      routing_Context,     tag = '0006'O;
                      info_String,         tag = '0004'O; )"
       }


// M3UA_ASPIA
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_ASPIA
{
  OCT1                         version,
  OCT1                         reserved,
  OCT2                         messageClassAndType,
  integer                      messageLength,
  M3UA_ASPIA_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_ASPIA_MessageParameters
{
  M3UA_Routing_Context    routing_Context optional,
  M3UA_Info_String        info_String optional
} with { variant "TAG(routing_Context,     tag = '0006'O;
                      info_String,         tag = '0004'O; )"
       }


// M3UA_ASPIA_Ack
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_ASPIA_Ack
{
  OCT1                             version,
  OCT1                             reserved,
  OCT2                             messageClassAndType,
  integer                          messageLength,
  M3UA_ASPIA_Ack_MessageParameters messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_ASPIA_Ack_MessageParameters
{
  M3UA_Routing_Context     routing_Context optional,
  M3UA_Info_String         info_String optional
} with { variant "TAG(routing_Context,     tag = '0006'O;
                      info_String,         tag = '0004'O; )"
       }


//  M3UA_REG_REQ
//  NOTE1 : REG REQ should not come and will be dropped if it comes
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_REG_REQ
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_Routing_Keys           messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type record of M3UA_Routing_Key M3UA_Routing_Keys;

//  M3UA_REG_RSP
//  NOTE1 : REG RSP should not come and will be dropped if it comes
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_REG_RSP
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_Registration_Results   messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type record of M3UA_Registration_Result M3UA_Registration_Results;


//  M3UA_DEREG_REQ
//  NOTE1 : DEREG REQ should not come and will be dropped if it comes
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_DEREG_REQ
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_DEREG_REQ_MsgParams    messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type set M3UA_DEREG_REQ_MsgParams
{
  M3UA_Routing_Context  routing_Context
} with { variant "TAG(routing_Context, tag = '0006'O; )"
       }

//  M3UA_DEREG_RSP
//  NOTE1 : DEREG RSP should not come and will be dropped if it comes
//++++++++++++++++++++++++++++++++++++++++++++++++++
type record M3UA_DEREG_RSP
{
  OCT1                        version,
  OCT1                        reserved,
  OCT2                        messageClassAndType,
  integer                     messageLength,
  M3UA_Deregistration_Results messageParameters
} with { variant (messageLength) "LENGTHTO(version,reserved,messageClassAndType,
                                           messageLength,messageParameters)";
         variant (messageLength) "FIELDLENGTH(32)";
         variant (messageLength) "BYTEORDER(last)";
       }

type record of M3UA_Deregistration_Result M3UA_Deregistration_Results;

// Top level PDU
//************************************************************************
type union PDU_M3UA
{
  M3UA_ERR        m3UA_ERR,        // Error
  M3UA_NOTIFY     m3UA_NOTIFY,     // Notify - should not come
  M3UA_DATA       m3UA_DATA,       // Payload data
  M3UA_DUNA       m3UA_DUNA,       // Destination Unavailable
  M3UA_DAVA       m3UA_DAVA,       // Destination Available
  M3UA_DAUD       m3UA_DAUD,       // Destination State Audit
  M3UA_SCON       m3UA_SCON,       // Signaling Congestion
  M3UA_DUPU       m3UA_DUPU,       // Destination User Part Unavailable
  M3UA_DRST       m3UA_DRST,       // DRST - should not come
  M3UA_ASPUP      m3UA_ASPUP,      // ASP up
  M3UA_ASPDN      m3UA_ASPDN,      // ASP down
  M3UA_BEAT       m3UA_BEAT,       // Heartbeat
  M3UA_BEAT_Ack   m3UA_BEAT_Ack,   // Heartbeat Ack
  M3UA_ASPUP_Ack  m3UA_ASPUP_Ack,  // ASP up ack
  M3UA_ASPDN_Ack  m3UA_ASPDN_Ack,  // ASP down ack
  M3UA_ASPAC      m3UA_ASPAC,      // ASP Active
  M3UA_ASPIA      m3UA_ASPIA,      // ASP Inactive
  M3UA_ASPAC_Ack  m3UA_ASPAC_Ack,  // ASP Active Ack
  M3UA_ASPIA_Ack  m3UA_ASPIA_Ack,  // ASP Inactive
  M3UA_REG_REQ    m3UA_REG_REQ,    // REG REQ - should not come
  M3UA_REG_RSP    m3UA_REG_RSP,    // REG RSP - should not come
  M3UA_DEREG_REQ  m3UA_DEREG_REQ,  // DEREG REQ - should not come
  M3UA_DEREG_RSP  m3UA_DEREG_RSP   // DEREG RSP - should not come
} with { variant "TAG(
          m3UA_ERR,        messageClassAndType = '0000'O;    //MGMT Class (0),
          m3UA_NOTIFY,     messageClassAndType = '0001'O;    //MGMT Class (0),
          m3UA_DATA,       messageClassAndType = '0101'O;    //Transf msg Class(1),
          m3UA_DUNA,       messageClassAndType = '0201'O;    //SSNM Class(2),
          m3UA_DAVA,       messageClassAndType = '0202'O;    //SSNM Class(2),
          m3UA_DAUD,       messageClassAndType = '0203'O;    //SSNM Class(2),
          m3UA_SCON,       messageClassAndType = '0204'O;    //SSNM Class(2),
          m3UA_DUPU,       messageClassAndType = '0205'O;    //SSNM Class(2),
          m3UA_DRST,       messageClassAndType = '0206'O;    //SSNM Class(2),
          m3UA_ASPUP,      messageClassAndType = '0301'O;    //ASPSM Class(3),
          m3UA_ASPDN,      messageClassAndType = '0302'O;    //ASPSM Class(3),
          m3UA_BEAT,       messageClassAndType = '0303'O;    //ASPSM Class(3),
          m3UA_ASPUP_Ack,  messageClassAndType = '0304'O;    //ASPSM Class(3),
          m3UA_ASPDN_Ack,  messageClassAndType = '0305'O;    //ASPSM Class(3),
          m3UA_BEAT_Ack,   messageClassAndType = '0306'O;    //ASPSM Class(3),
          m3UA_ASPAC,      messageClassAndType = '0401'O;    //ASPTM Class(4),
          m3UA_ASPIA,      messageClassAndType = '0402'O;    //ASPTM Class(4),
          m3UA_ASPAC_Ack,  messageClassAndType = '0403'O;    //ASPTM Class(4),
          m3UA_ASPIA_Ack,  messageClassAndType = '0404'O;    //ASPTM Class(4),
          m3UA_REG_REQ,    messageClassAndType = '0901'O;    //RKM Class(9),
          m3UA_REG_RSP,    messageClassAndType = '0902'O;    //RKM Class(9),
          m3UA_DEREG_REQ,  messageClassAndType = '0903'O;    //RKM Class(9),
          m3UA_DEREG_RSP,  messageClassAndType = '0904'O; )" //RKM Class(9),
       }
} with { encode "RAW"}
