This sample is provided as part of the OSS ASN.1 Tools trial and commercial shipments. The source code and related files are listed below for reference.
The sample demonstrates how to use the OSS ASN.1 Tools to process messages for the 3GPP 5G XnAP standard (TS 38.423 version 19.0.0).
It runs on Windows as an example and illustrates how to decode, inspect, and create PER-encoded 5G XnAP messages using the OSS ASN.1 Tools API.
The sample reads XnAP messages from .per files, decodes and prints them, and creates and encodes a response message.
A Windows batch script (run.bat) is included for running the test program using the OSS ASN.1/C# runtime.
To explore more samples (LTE RRC, 5G RRC, S1AP, X2AP, XnAP), visit the main Sample Code page.
This sample shows how to:
The files listed below are included in the OSS ASN.1 Tools trial and commercial shipments and are used by this sample program:
| File | Description |
|---|---|
| README.TXT | Instructions and sample overview. |
| xnap.asn | ASN.1 source file that describes the 3GPP 5G XnAP protocol (TS 38.423) used with this program example. |
| XNAP-PDU_HandoverRequest.per | Valid PER-encoded XnAP message. It should pass testing. |
| app.cs | Simple C# program that shows how to work with 5G XnAP protocol data. It reads input messages from files, decodes and prints them, and creates and encodes a response message. |
| run.bat | Windows batch script that runs the sample test. |
| gui/ | ASN.1 Studio project for viewing/compiling schema and generating sample data. |
(Installation instructions for the OSS ASN.1 Tools are included in all trial and commercial shipments.)
To build and run this sample, install a trial or licensed version of the OSS ASN.1 Tools for C#.
If you use the OSS command prompt window, you do not need to set environment variables to run this sample. Otherwise, ensure the following are defined:
If using Visual Studio, run the Microsoft vsvars32.bat script to set up the .NET command-line environment. If Visual Studio is not installed, ensure your PATH includes the required .NET directories. For details, see ossvars.bat installed with the product.
run
run clean
Note: The C# source code in this sample is platform-independent. Windows commands are shown as an example, but equivalent samples and run instructions may be available for other platforms. For help with platform-specific instructions, please contact OSS Support.
The following listing shows the main C# source file for this sample test program, app.cs. It demonstrates how to read PER-encoded 5G XnAP messages from files, decode and print them, and create and encode a response message using the OSS ASN.1 Tools API.
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) ###RELEASE_YEAR### OSS Nokalva, Inc. All rights reserved. //
// //
// THIS FILE IS PROPRIETARY MATERIAL OF OSS NOKALVA, INC. //
// AND MAY BE USED ONLY BY DIRECT LICENSEES OF OSS NOKALVA, INC. //
// THIS FILE MAY NOT BE DISTRIBUTED. //
// THIS COPYRIGHT STATEMENT MAY NOT BE REMOVED. //
///////////////////////////////////////////////////////////////////////////////
// THIS SAMPLE PROGRAM IS PROVIDED AS IS. THE SAMPLE PROGRAM AND ANY RESULTS //
// OBTAINED FROM IT ARE PROVIDED WITHOUT ANY WARRANTIES OR REPRESENTATIONS, //
// EXPRESS, IMPLIED OR STATUTORY. //
///////////////////////////////////////////////////////////////////////////////
//
// Demonstrates part of the 5G XnAP protocol.
//
// Classes generated from ASN.1 specification.
using Xnap;
using Xnap.XnAPPDUDescriptions;
using Xnap.XnAPPDUContents;
using Xnap.XnAPContainers;
using Xnap.XnAPIEs;
using XnAPConstants = Xnap.XnAPConstants.Values;
// Classes from the OSS runtime library.
using Oss.Asn1;
// C# system classes.
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
public class Program
{
public static int Main(string[] args)
{
try
{
// A folder with encoded messages.
string dataDir = (args.Length > 0) ? args[0] : "../../";
Txnap txnap = new Txnap();
txnap.Process(dataDir, "XNAP-PDU_HandoverRequest.per");
Console.WriteLine("Message processing has completed successfully.");
return 0;
}
catch (Exception e)
{
// Print complete exception information.
Console.WriteLine("ERROR: Error processing input files.");
Console.WriteLine(e);
return 1;
}
}
}
/// <summary>
/// Does all the processing of the files with encoded PDUs.
/// </summary>
public class Txnap
{
PerAlignedCodec codec = new PerAlignedCodec();
/// <summary>
/// Processes a file with encoded XnAP PDU.
/// </summary>
public void Process(String dataDir, String fileName)
{
try
{
String fullPath = Path.Combine(dataDir, fileName);
XnAPPDU req = DecodeRequest(fullPath);
Console.WriteLine("\nPrinting the PER-Decoded XnAPPDU PDU...\n");
ValueNotationFormatter.Print(req, Console.Out);
XnAPPDU res = CreateResponse(req);
if (res != null) {
Console.WriteLine("\nPrinting the created XnAPPDU response PDU...\n");
ValueNotationFormatter.Print(res, Console.Out);
EncodeAndSend(res);
}
Console.WriteLine();
}
catch (Exception e)
{
throw new Exception("Unable to process file '" + fileName + "'.", e);
}
}
/// <summary>
/// Creates XnAPPDU response PDUs.
/// </summary>
XnAPPDU CreateResponse(XnAPPDU request)
{
// Check that the message contains InitiatingMessage.
if (request.Selected != XnAPPDU.Id.InitiatingMessageChosen)
throw new Exception("ERROR: Wrong message. Expecting InitiatingMessage.");
InitiatingMessage msg = request.InitiatingMessage;
ProcedureCode code = ProcedureCodes.ContainsKey(msg.ProcedureCode) ? ProcedureCodes[msg.ProcedureCode] : ProcedureCode.Unknown;
switch (code) {
case ProcedureCode.HandoverRequest:
{
HandoverRequest req = (HandoverRequest)msg.Value.Decoded;
AccessHandoverRequestIEs(req);
return CreateHandoverRequestAcknowledge(req);
}
case ProcedureCode.Unknown:
Console.WriteLine("WARNING: Got unknown ProcedureCode: " + msg.ProcedureCode);
return null;
default:
Console.WriteLine("WARNING: ProcedureCode " + code + " not implemented yet.");
return null;
}
}
/// <summary>
/// Creates a HandoverCommand PDU.
/// </summary>
public XnAPPDU CreateHandoverRequestAcknowledge(HandoverRequest req)
{
Console.WriteLine("\nCreating a HandoverRequestAcknowledge XnAPPDU PDU message...");
HandoverRequest.ProtocolIEsType request_IEs = req.ProtocolIEs;
if (request_IEs == null || request_IEs.Count == 0)
{
Console.WriteLine("No IEs in the HandoverRequired message.");
return null;
}
HandoverRequestAcknowledge.ProtocolIEsType response_IEs = new HandoverRequestAcknowledge.ProtocolIEsType();
// Copy some IEs from the request
foreach (HandoverRequest.ProtocolIEsType.Element ie in request_IEs)
{
if (ie.Id == XnAPConstants.IdSourceNGRANnodeUEXnAPID)
{
response_IEs.Add(new HandoverRequestAcknowledge.ProtocolIEsType.Element()
{
Id = XnAPConstants.IdSourceNGRANnodeUEXnAPID,
Criticality = Xnap.XnAPCommonDataTypes.Criticality.Ignore,
Value = (OpenType)ie.Value.Copy()
});
break;
}
}
// Add the id-targetNG-RANnodeUEXnAPID IE
response_IEs.Add(new HandoverRequestAcknowledge.ProtocolIEsType.Element()
{
Id = XnAPConstants.IdTargetNGRANnodeUEXnAPID,
Criticality = Xnap.XnAPCommonDataTypes.Criticality.Ignore,
Value = new OpenType(
new NGRANnodeUEXnAPID() {
Value = 456
})
});
// Add the id-PDUSessionResourcesAdmitted-List IE
PDUSessionResourcesAdmittedList pduSessionResourcesAdmittedList = new PDUSessionResourcesAdmittedList(
new PDUSessionResourcesAdmittedItem[] {
new PDUSessionResourcesAdmittedItem() {
PduSessionId = 1,
PduSessionResourceAdmittedInfo = new PDUSessionResourceAdmittedInfo()
{
QosFlowsAdmittedList = new QoSFlowsAdmittedList(
new QoSFlowsAdmittedItem[] {
new QoSFlowsAdmittedItem()
{
Qfi = 3
},
new QoSFlowsAdmittedItem()
{
Qfi = 4
}
}
),
QosFlowsNotAdmittedList = new QoSFlowsListWithCause(
new QoSFlowwithCauseItem[] {
new QoSFlowwithCauseItem()
{
Qfi = 2,
Cause = new Cause()
{
Misc = CauseMisc.Unspecified
}
},
new QoSFlowwithCauseItem()
{
Qfi = 5,
Cause = new Cause()
{
Misc = CauseMisc.Unspecified
}
}
}
)
}
}
}
);
response_IEs.Add(new HandoverRequestAcknowledge.ProtocolIEsType.Element()
{
Id = XnAPConstants.IdPDUSessionResourcesAdmittedList,
Criticality = Xnap.XnAPCommonDataTypes.Criticality.Ignore,
Value = new OpenType(
new PDUSessionResourcesAdmittedListPdu()
{
Value = pduSessionResourcesAdmittedList
}
)
});
HandoverRequestAcknowledge handoverRequestAcknowledge = new HandoverRequestAcknowledge()
{
ProtocolIEs = response_IEs
};
SuccessfulOutcome successfulOutcome = new SuccessfulOutcome()
{
ProcedureCode = XnAPConstants.IdHandoverPreparation,
Criticality = Xnap.XnAPCommonDataTypes.Criticality.Reject,
Value = new OpenType(handoverRequestAcknowledge)
};
XnAPPDU pdu = new XnAPPDU();
pdu.SuccessfulOutcome = successfulOutcome;
Console.WriteLine("Created the NGAPPDU response PDU successfully.\n");
return pdu;
}
/// <summary>
/// Decodes an XnAPPDU request PDU from a file.
/// </summary>
XnAPPDU DecodeRequest(String fileName)
{
using (Stream stream = File.OpenRead(fileName))
{
/// <summary>
/// Set the decoder to autodecode open type values.
/// </summary>
codec.DecoderOptions.AutoDecode = true;
Console.WriteLine("\nDecoding the XnAPPDU request PDU from the file " + fileName + "...");
XnAPPDU msg = new XnAPPDU();
codec.Decode(stream, msg);
Console.WriteLine("PDU decoded successfully.");
return msg;
}
}
/// <summary>
/// Enumerates possible procedure codes.
/// </summary>
public enum ProcedureCode {
HandoverRequest,
Unknown
}
static Dictionary<int, ProcedureCode> ProcedureCodes = new Dictionary<int, ProcedureCode>() {
{XnAPConstants.IdHandoverPreparation, ProcedureCode.HandoverRequest}
};
private const string PLACEHOLDER = "...";
/// <summary>
/// Demonstrates how components of the HandoverRequired can
/// be accessed in the code.
/// </summary>
/// <param name="req">A HandoverRequired message.</param>
public void AccessHandoverRequestIEs(HandoverRequest req)
{
Console.WriteLine("\nAccessing IEs of the HandoverRequest message...\n");
int ordinal = 0;
foreach (HandoverRequest.ProtocolIEsType.Element ie in req.ProtocolIEs)
{
++ordinal;
Console.WriteLine("IE #{0}:\nid {1}\ncriticality {2}", ordinal, ie.Id, ie.Criticality);
if (ie.Id == XnAPConstants.IdSourceNGRANnodeUEXnAPID)
{
NGRANnodeUEXnAPID v = (NGRANnodeUEXnAPID)ie.Value.Decoded;
Console.WriteLine("value NG-RANnodeUEXnAPID: {0}\n", v.Value);
}
else if (ie.Id == XnAPConstants.IdCause)
{
Cause v = (Cause)ie.Value.Decoded;
Console.Write("value Cause: ");
switch (v.Selected)
{
case Cause.Id.TransportChosen:
Console.WriteLine("transport: {0}\n", v.Transport);
break;
case Cause.Id.RadioNetworkChosen:
Console.WriteLine("radioNetwork: {0}\n", v.RadioNetwork);
break;
case Cause.Id.ProtocolChosen:
Console.WriteLine("protocol: {0}\n", v.Protocol);
break;
case Cause.Id.MiscChosen:
Console.WriteLine("misc: {0}\n", v.Misc);
break;
case Cause.Id.ChoiceExtensionChosen:
Console.WriteLine("choice-Extension: {0}\n", PLACEHOLDER);
break;
}
}
else if (ie.Id == XnAPConstants.IdTargetCellGlobalID) {
TargetCGI v = (TargetCGI)ie.Value.Decoded;
Console.Write("value Target-CGI: ");
switch (v.Selected)
{
case TargetCGI.Id.NrChosen:
Console.WriteLine("nr:");
Console.WriteLine(" plmn-id: {0}", BytesToString(v.Nr.PlmnId));
Console.WriteLine(" nr-CI : {0}", BitsToString(v.Nr.NrCI));
if (v.Nr.IEExtension != null)
Console.WriteLine(" ie-Extension: {0}", PLACEHOLDER);
Console.WriteLine();
break;
case TargetCGI.Id.EUtraChosen:
Console.WriteLine("e-utra: {0}\n", PLACEHOLDER);
break;
case TargetCGI.Id.ChoiceExtensionChosen:
Console.WriteLine("choice-Extension: {0}\n", PLACEHOLDER);
break;
}
}
else if (ie.Id == XnAPConstants.IdGUAMI)
{
GUAMI v = (GUAMI)ie.Value.Decoded;
Console.WriteLine("value GUAMI:");
Console.WriteLine(" plmn-ID : {0}", BytesToString(v.PlmnID));
Console.WriteLine(" amf-region-if: {0}", BitsToString(v.AmfRegionId));
Console.WriteLine(" amf-set-id : {0}", BitsToString(v.AmfSetId));
Console.WriteLine(" amf-pointer : {0}", BitsToString(v.AmfPointer));
if (v.IEExtensions != null)
Console.WriteLine(" ie-Extensions: {0}", PLACEHOLDER);
Console.WriteLine();
}
else if (ie.Id == XnAPConstants.IdUEContextInfoHORequest)
{
UEContextInfoHORequest v = (UEContextInfoHORequest)ie.Value.Decoded;
Console.WriteLine("value PDUSessionResourceListHORqd:");
Console.WriteLine(" ng-c-UE-reference: {0}", v.NgCUEReference);
Console.Write(" cp-TNL-info-source: ");
switch (v.CpTNLInfoSource.Selected)
{
case CPTransportLayerInformation.Id.EndpointIPAddressChosen:
Console.WriteLine("endpointIPAddress: {0}", BitsToString(v.CpTNLInfoSource.EndpointIPAddress));
break;
case CPTransportLayerInformation.Id.ChoiceExtensionChosen:
Console.WriteLine("choice-extension: {0}", PLACEHOLDER);
break;
}
Console.WriteLine(" ueSecurityCapabilities:");
Console.WriteLine(" nr-EncyptionAlgorithms: {0}",
BitsToString(v.UeSecurityCapabilities.NrEncyptionAlgorithms));
Console.WriteLine(" nr-IntegrityProtectionAlgorithms: {0}",
BitsToString(v.UeSecurityCapabilities.NrIntegrityProtectionAlgorithms));
Console.WriteLine(" e-utra-EncyptionAlgorithms: {0}",
BitsToString(v.UeSecurityCapabilities.EUtraEncyptionAlgorithms));
Console.WriteLine(" e-utra-IntegrityProtectionAlgorithms: {0}",
BitsToString(v.UeSecurityCapabilities.EUtraIntegrityProtectionAlgorithms));
if (v.UeSecurityCapabilities.IEExtension != null)
Console.WriteLine(" iE-Extension: {0}", PLACEHOLDER);
Console.WriteLine(" securityInformation:");
Console.WriteLine(" key-NG-RAN-Star: {0}", BitsToString(v.SecurityInformation.KeyNGRANStar));
Console.WriteLine(" ncc: {0}", v.SecurityInformation.Ncc);
if (v.SecurityInformation.IEExtensions != null)
Console.WriteLine(" iE-Extensions: {0}", PLACEHOLDER);
if (v.IndexToRatFrequencySelectionPriority != null)
Console.WriteLine(" indexToRatFrequencySelectionPriority: {0}", PLACEHOLDER);
Console.WriteLine(" ue-AMBR:");
Console.WriteLine(" dl-UE-AMBR: {0}", v.UeAMBR.DlUEAMBR);
Console.WriteLine(" ul-UE-AMBR: {0}", v.UeAMBR.UlUEAMBR);
if (v.UeAMBR.IEExtension != null)
Console.WriteLine(" iE-Extension: {0}", PLACEHOLDER);
Console.WriteLine(" pduSessionResourcesToBeSetup-List:");
int n = 0;
foreach (var entry in v.PduSessionResourcesToBeSetupList)
{
Console.WriteLine(" #{0}:", ++n);
Console.WriteLine(" pduSessionId: {0}", entry.PduSessionId);
Console.WriteLine(" s-NSSAI:");
Console.WriteLine(" sst: {0}", BytesToString(entry.SNSSAI.Sst));
if (entry.SNSSAI.Sd != null)
Console.WriteLine(" sd: ..");
if (entry.SNSSAI.IEExtensions != null)
Console.WriteLine(" iE-Extensions: {0}", PLACEHOLDER);
Console.WriteLine(" pduSessionAMBR:");
Console.WriteLine(" downlink-session-AMBR: {0}", entry.PduSessionAMBR.DownlinkSessionAMBR);
Console.WriteLine(" uplink-session-AMBR: {0}", entry.PduSessionAMBR.UplinkSessionAMBR);
if (entry.PduSessionAMBR.IEExtensions != null)
Console.WriteLine(" iE-Extensions: {0}", PLACEHOLDER);
Console.Write(" uL-NG-U-TNLatUPF: ");
switch (entry.ULNGUTNLatUPF.Selected)
{
case UPTransportLayerInformation.Id.GtpTunnelChosen:
Console.WriteLine("gtpTunnel:");
Console.WriteLine(" tnl-address: {0}",
BitsToString(entry.ULNGUTNLatUPF.GtpTunnel.TnlAddress));
Console.WriteLine(" gtp-teid: {0}", BytesToString(entry.ULNGUTNLatUPF.GtpTunnel.GtpTeid));
if (entry.ULNGUTNLatUPF.GtpTunnel.IEExtensions != null)
Console.Write(" iE-Extensions: {0}", PLACEHOLDER);
break;
case UPTransportLayerInformation.Id.ChoiceExtensionChosen:
Console.WriteLine("choice-extension: {0}", PLACEHOLDER);
break;
}
if (entry.SecurityIndication != null)
Console.WriteLine(" securityIndication: {0}", PLACEHOLDER);
Console.WriteLine(" pduSessionType: {0}", entry.PduSessionType);
Console.WriteLine(" qosFlowsToBeSetup-List:");
int n1 = 0;
foreach (var item in entry.QosFlowsToBeSetupList)
{
Console.WriteLine(" #{0}:", ++n1);
Console.WriteLine(" qfi: {0}", item.Qfi);
if (item.QosFlowLevelQoSParameters != null)
Console.WriteLine(" qosFlowLevelQoSParameters: {0}", PLACEHOLDER);
Console.WriteLine(" qosFlowLevelQoSParameters: {0}", PLACEHOLDER);
if (item.ERABID != null)
Console.WriteLine(" e-RAB-ID: {0}", PLACEHOLDER);
if (item.IEExtension != null)
Console.WriteLine(" iE-Extension: {0}", PLACEHOLDER);
}
if (entry.DataforwardinginfofromSource != null)
Console.WriteLine(" dataforwardinginfofromSource: {0}", PLACEHOLDER);
if (entry.IEExtensions != null)
Console.WriteLine(" iE-Extensions: {0}", PLACEHOLDER);
}
Console.WriteLine(" rrc-Context: {0}", BytesToString(v.RrcContext));
if (v.LocationReportingInformation != null)
Console.WriteLine(" locationReportingInformation: {0}", PLACEHOLDER);
if (v.Mrl != null)
Console.WriteLine(" mrl: {0}", PLACEHOLDER);
if (v.IEExtensions != null)
Console.WriteLine(" iE-Extensions: {0}", PLACEHOLDER);
Console.WriteLine();
}
else if (ie.Id == XnAPConstants.IdTraceActivation)
{
Console.WriteLine("value TraceActivation: {0}\n", PLACEHOLDER);
}
else if (ie.Id == XnAPConstants.IdMaskedIMEISV)
{
Console.WriteLine("value MaskedIMEISV: {0}\n", PLACEHOLDER);
}
else if (ie.Id == XnAPConstants.IdUEHistoryInformation)
{
UEHistoryInformationPdu ueHistoryInformationPdu = (UEHistoryInformationPdu)ie.Value.Decoded;
Console.WriteLine("value UEHistoryInformation:");
int n = 0;
foreach (var item in ueHistoryInformationPdu.Value)
{
switch (item.Selected)
{
case LastVisitedCellItem.Id.UTRANCellChosen:
Console.WriteLine(" #{0} uTRAN-Cell: {1}", ++n, BytesToString(item.UTRANCell));
break;
case LastVisitedCellItem.Id.NGRANCellChosen:
Console.WriteLine(" #{0} nG-RAN-Cell: {1}", ++n, BytesToString(item.NGRANCell));
break;
case LastVisitedCellItem.Id.GERANCellChosen:
Console.WriteLine(" #{0} gERAN-Cell: {1}", ++n, BytesToString(item.GERANCell));
break;
case LastVisitedCellItem.Id.EUTRANCellChosen:
Console.WriteLine(" #{0} e-UTRAN-Cell: {1}", ++n, BytesToString(item.EUTRANCell));
break;
case LastVisitedCellItem.Id.ChoiceExtensionChosen:
Console.WriteLine(" #{0} choice-Extension: {1}", ++n, PLACEHOLDER);
break;
}
}
Console.WriteLine();
}
else if (ie.Id == XnAPConstants.IdUEContextRefAtSNHORequest)
{
Console.WriteLine("value UEContextRefAtSN-HORequest: {0}\n", PLACEHOLDER);
}
else
{
if (ie.Value.Decoded != null)
Console.WriteLine(ie.Value.Decoded);
else
Console.WriteLine("IE left undecoded: {0}\n", BytesToString(ie.Value.Encoded));
}
}
}
/// <summary>
/// A utility method to print bits of a BIT STRING.
/// </summary>
/// <param name="bitString">A value of BIT STRING</param>
/// <returns></returns>
private string BitsToString(BitString bitString)
{
StringBuilder sb = new StringBuilder(bitString.Length+3);
sb.Append("'");
foreach (bool bit in bitString)
sb.Append(bit ? "1" : "0");
sb.Append("'B");
return sb.ToString();
}
/// <summary>
/// A utility method to print octets.
/// </summary>
/// <param name="bytes">The byte[] value </param>
/// <returns></returns>
private string BytesToString(byte[] bytes)
{
StringBuilder sb = new StringBuilder(2*bytes.Length + 3);
sb.Append("'");
foreach (byte b in bytes)
sb.Append(b.ToString("X2"));
sb.Append("'H");
return sb.ToString();
}
/// <summary>
/// Dumps binary data to the TextWriter.
/// </summary>
/// <param name="data">The binary data</param>
/// <param name="tty">The TextWriter where the hex dump is written</param>
private void HexDump(byte[] data, TextWriter tty)
{
ValueNotationFormatter.Print(data, data.Length, tty);
}
/// <summary>
/// Encodes and sends a message.
/// </summary>
void EncodeAndSend(XnAPPDU message)
{
// Assert the validity of the response messages
codec.EncoderOptions.Validate = true;
try
{
using (MemoryStream stream = new MemoryStream()) {
Console.WriteLine("Encoding the XnAPPDU response PDU using memory stream...");
codec.Encode(message, stream);
Console.WriteLine("Encoded successfully.\n");
Console.WriteLine("Printing the XnAPPDU response PDU in " + stream.Length + " bytes...");
HexDump(stream.ToArray(), Console.Out);
}
Console.WriteLine("\nEncoding the XnAPPDU response PDU again using a class object...");
byte[] encoded = codec.Encode(message);
Console.WriteLine("Encoded successfully.\n");
Console.WriteLine("Printing the XnAPPDU response PDU in " + encoded.Length + " bytes...");
HexDump(encoded, Console.Out);
} catch (Exception e) {
throw new Exception("ERROR: Failed to encode.", e);
}
}
}
This is the expected output when running the sample:
Decoded XnAP message: ... Encoding response message... Encoding successful.
-- Excerpt from ngap.asn 3GPP TS 38.423 V19.0.0 (2025-09)
-- **************************************************************
--
-- Elementary Procedure definitions
--
-- **************************************************************
XnAP-PDU-Descriptions {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) xnap (2) version1 (1) xnap-PDU-Descriptions (0) }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
--
-- IE parameter types from other modules.
--
-- **************************************************************
IMPORTS
Criticality,
ProcedureCode
FROM XnAP-CommonDataTypes
HandoverRequest,
HandoverRequestAcknowledge,
HandoverPreparationFailure,
SNStatusTransfer,
UEContextRelease,
HandoverCancel,
NotificationControlIndication,
RANPaging,
RetrieveUEContextRequest,
RetrieveUEContextResponse,
RetrieveUEContextConfirm,
RetrieveUEContextFailure,
XnUAddressIndication,
SecondaryRATDataUsageReport,
SNodeAdditionRequest,
SNodeAdditionRequestAcknowledge,
SNodeAdditionRequestReject,
SNodeReconfigurationComplete,
SNodeModificationRequest,
SNodeModificationRequestAcknowledge,
SNodeModificationRequestReject,
SNodeModificationRequired,
SNodeModificationConfirm,
SNodeModificationRefuse,
SNodeReleaseRequest,
SNodeReleaseRequestAcknowledge,
SNodeReleaseReject,
SNodeReleaseRequired,
SNodeReleaseConfirm,
SNodeCounterCheckRequest,
SNodeChangeRequired,
SNodeChangeConfirm,
SNodeChangeRefuse,
RRCTransfer,
XnRemovalRequest,
XnRemovalResponse,
XnRemovalFailure,
XnSetupRequest,
XnSetupResponse,
XnSetupFailure,
NGRANNodeConfigurationUpdate,
NGRANNodeConfigurationUpdateAcknowledge,
NGRANNodeConfigurationUpdateFailure,
E-UTRA-NR-CellResourceCoordinationRequest,
E-UTRA-NR-CellResourceCoordinationResponse,
ActivityNotification,
CellActivationRequest,
CellActivationResponse,
CellActivationFailure,
ResetRequest,
ResetResponse,
ErrorIndication,
PrivateMessage,
DeactivateTrace,
TraceStart,
HandoverSuccess,
ConditionalHandoverCancel,
EarlyStatusTransfer,
FailureIndication,
HandoverReport,
SCGFailureIndication,
ResourceStatusRequest,
ResourceStatusResponse,
ResourceStatusFailure,
ResourceStatusUpdate,
MobilityChangeRequest,
MobilityChangeAcknowledge,
MobilityChangeFailure,
AccessAndMobilityIndication,
CellTrafficTrace,
RANMulticastGroupPaging,
ScgFailureInformationReport,
ScgFailureTransfer,
F1CTrafficTransfer,
IABTransportMigrationManagementRequest,
IABTransportMigrationManagementResponse,
IABTransportMigrationManagementReject,
IABTransportMigrationModificationRequest,
IABTransportMigrationModificationResponse,
IABResourceCoordinationRequest,
IABResourceCoordinationResponse,
CPCCancel,
PartialUEContextTransfer,
PartialUEContextTransferAcknowledge,
PartialUEContextTransferFailure,
RachIndication,
DataCollectionRequest,
DataCollectionResponse,
DataCollectionFailure,
DataCollectionUpdate,
ODSIB1ConfigurationProvisionRequest,
ODSIB1ConfigurationProvisionResponse,
ODSIB1ConfigurationProvisionFailure,
ODSIB1ConfigurationProvisionStatus,
LTMConfigurationUpdate,
LTMConfigurationUpdateAcknowledge,
LTMConfigurationUpdateFailure,
CSIRSCoordinationRequest,
CSIRSCoordinationResponse,
CellSwitchNotification,
TAInformationTransfer,
LTMCancel,
CLI-Indication
FROM XnAP-PDU-Contents
id-handoverPreparation,
id-sNStatusTransfer,
id-handoverCancel,
id-notificationControl,
id-retrieveUEContext,
id-rANPaging,
id-xnUAddressIndication,
id-uEContextRelease,
id-secondaryRATDataUsageReport,
id-sNGRANnodeAdditionPreparation,
id-sNGRANnodeReconfigurationCompletion,
id-mNGRANnodeinitiatedSNGRANnodeModificationPreparation,
id-sNGRANnodeinitiatedSNGRANnodeModificationPreparation,
id-mNGRANnodeinitiatedSNGRANnodeRelease,
id-sNGRANnodeinitiatedSNGRANnodeRelease,
id-sNGRANnodeCounterCheck,
id-sNGRANnodeChange,
id-activityNotification,
id-rRCTransfer,
id-xnRemoval,
id-xnSetup,
id-nGRANnodeConfigurationUpdate,
id-e-UTRA-NR-CellResourceCoordination,
id-cellActivation,
id-reset,
id-errorIndication,
id-privateMessage,
id-deactivateTrace,
id-traceStart,
id-handoverSuccess,
id-conditionalHandoverCancel,
id-earlyStatusTransfer,
id-failureIndication,
id-handoverReport,
id-scgFailureIndication,
id-resourceStatusReportingInitiation,
id-resourceStatusReporting,
id-mobilitySettingsChange,
id-accessAndMobilityIndication,
id-cellTrafficTrace,
id-RANMulticastGroupPaging,
id-scgFailureInformationReport,
id-scgFailureTransfer,
id-f1CTrafficTransfer,
id-iABTransportMigrationManagement,
id-iABTransportMigrationModification,
id-iABResourceCoordination,
id-retrieveUEContextConfirm,
id-cPCCancel,
id-partialUEContextTransfer,
id-rachIndication,
id-dataCollectionReportingInitiation,
id-dataCollectionReporting,
id-ODSIB1ConfigurationProvision,
id-ODSIB1ConfigurationProvisionStatus,
id-lTMConfigurationUpdate,
id-cSIRSCoordination,
id-cellSwitchNotification,
id-tAInformationTransfer,
id-lTMCancel,
id-cLI-Indication
FROM XnAP-Constants;
-- **************************************************************
--
-- Interface Elementary Procedure Class
--
-- **************************************************************
XNAP-ELEMENTARY-PROCEDURE ::= CLASS {
&InitiatingMessage ,
&SuccessfulOutcome OPTIONAL,
&UnsuccessfulOutcome OPTIONAL,
&procedureCode ProcedureCode UNIQUE,
&criticality Criticality DEFAULT ignore
}
WITH SYNTAX {
INITIATING MESSAGE &InitiatingMessage
[SUCCESSFUL OUTCOME &SuccessfulOutcome]
[UNSUCCESSFUL OUTCOME &UnsuccessfulOutcome]
PROCEDURE CODE &procedureCode
[CRITICALITY &criticality]
}
-- **************************************************************
--
-- Interface PDU Definition
--
-- **************************************************************
XnAP-PDU ::= CHOICE {
initiatingMessage InitiatingMessage,
successfulOutcome SuccessfulOutcome,
unsuccessfulOutcome UnsuccessfulOutcome,
...
}
InitiatingMessage ::= SEQUENCE {
procedureCode XNAP-ELEMENTARY-PROCEDURE.&procedureCode ({XNAP-ELEMENTARY-PROCEDURES}),
criticality XNAP-ELEMENTARY-PROCEDURE.&criticality ({XNAP-ELEMENTARY-PROCEDURES}{@procedureCode}),
value XNAP-ELEMENTARY-PROCEDURE.&InitiatingMessage ({XNAP-ELEMENTARY-PROCEDURES}{@procedureCode})
}
SuccessfulOutcome ::= SEQUENCE {
procedureCode XNAP-ELEMENTARY-PROCEDURE.&procedureCode ({XNAP-ELEMENTARY-PROCEDURES}),
criticality XNAP-ELEMENTARY-PROCEDURE.&criticality ({XNAP-ELEMENTARY-PROCEDURES}{@procedureCode}),
value XNAP-ELEMENTARY-PROCEDURE.&SuccessfulOutcome ({XNAP-ELEMENTARY-PROCEDURES}{@procedureCode})
}
UnsuccessfulOutcome ::= SEQUENCE {
procedureCode XNAP-ELEMENTARY-PROCEDURE.&procedureCode ({XNAP-ELEMENTARY-PROCEDURES}),
criticality XNAP-ELEMENTARY-PROCEDURE.&criticality ({XNAP-ELEMENTARY-PROCEDURES}{@procedureCode}),
value XNAP-ELEMENTARY-PROCEDURE.&UnsuccessfulOutcome ({XNAP-ELEMENTARY-PROCEDURES}{@procedureCode})
}
The gui/ subdirectory contains an ASN.1 Studio project for this sample. With ASN.1 Studio you can:
This sample is provided solely for illustration purposes, for example to demonstrate usage of the OSS ASN.1 Tools API with 3GPP 5G XnAP messages. It does not represent a complete application. To build and run this sample, you must use a trial or licensed version of the appropriate OSS ASN.1 Tools. The copyright and license statements included in each source file remain fully applicable.
If you have questions about using this sample, contact OSS Nokalva Support.