OSS NAS Tools for C# for 5G for 3GPP Release 15.6.0
Oss.Nas.NasCodecBase< T > Class Template Reference

Implements encoding, decoding, and printing of NAS messages. NasCodec can

More...

Public Member Functions

String DecodeToJSON (byte[] nasMessage)
 Converts a binary NAS message to a JSON value. More...
 
String DecodeToJSON (byte[] nasMessage, int offset, int length)
 Converts a binary NAS message to a JSON value. More...
 
String DecodeToXML (byte[] nasMessage)
 Converts a binary NAS message to an XML document. More...
 
String DecodeToXML (byte[] nasMessage, int offset, int length)
 Converts a binary NAS message to an XML document. More...
 
String DecodeToText (byte[] nasMessage)
 Converts a binary NAS message to ASN.1 value notation format. More...
 
String DecodeToText (byte[] nasMessage, int offset, int length)
 Converts a binary NAS message to ASN.1 value notation format. More...
 
byte[] Encode (T nasMessage)
 Encodes a C# object that represents a NAS message into binary bytes. The byte[] that receives the binary bytes is allocated dynamically. More...
 
String PrintJSON (T nasMessage)
 Converts a C# object that represents a NAS message to a JSON value. Unlike the decodeToJSON method, it does not throw an exception when the C# object has semantic errors, but returns a null string. You can use the Diagnostics property to retrieve a diagnostic report in that case. More...
 
String PrintXML (T nasMessage)
 Converts a C# object that represents a NAS message to an XML document. Unlike the decodeToXML method, it does not throw an exception when the C# object has semantic errors, but returns a null string. You can use the Diagnostics property to retrieve a diagnostic report in that case. More...
 
String PrintMessage (T nasMessage)
 Converts a C# object that represents a NAS message into ASN.1 value notation format. Unlike the decodeToText method, it does not throw an exception when the C# object has semantic errors but returns a null string. You can use the Diagnostics property to retrieve a diagnostic report in that case. More...
 

Properties

Originator Originator [get, set]
 Identifies the originator of a NAS message. Some NAS messages can originate only from the network, while other NAS messages can be sent only by the UE. More...
 
bool HasDiagnostics [get]
 Indicates whether the most recent invocation of the NasCodec API revealed defects in the NAS message. More...
 
Diagnostics Diagnostics [get]
 Returns a diagnostic report created by the most recent invocation of the NasCodec API. If the operation aborted due to an exception, the diagnostic report returned is identical to the diagnostics reported by the diagnostics() method of NASException. Even when the exception is not thrown, the operation can return a non-empty report because the encoder or decoder detected non-critical defects that did not cause it to treat a message as invalid. More...
 
JSONOptions JSONOptions [get]
 Specifies formatting options that are used when a NAS message is converted to JSON format. More...
 
XMLOptions XMLOptions [get]
 Specifies formatting options that are used when a NAS message is converted to an XML document. More...
 
TextOptions TextOptions [get]
 Specifies formatting options that are used when a NAS message is converted to ASN.1 value notation format. More...
 

Detailed Description

Implements encoding, decoding, and printing of NAS messages. NasCodec can

  • Print a binary NAS message in JSON, XML, or ASN.1 value notation format.
  • Decode a binary NAS message into a C# object.
  • Encode a C# object that represents a NAS message into binary octets.
  • Print a C# object that represents a NAS message in JSON, XML, or ASN.1 value notation format.
Template Parameters
TDefines a NAS PDU type.
Type Constraints
T :class 
T :NasPdu 

Member Function Documentation

◆ DecodeToJSON() [1/2]

String Oss.Nas.NasCodecBase< T >.DecodeToJSON ( byte[]  nasMessage)
inline

Converts a binary NAS message to a JSON value.

Parameters
nasMessageThe binary NAS message.
Exceptions
NASDecodeFailedExceptionIs thrown when conversion fails because the binary message is syntactically invalid and cannot be decoded.
Returns
A string that contains the JSON value.

◆ DecodeToJSON() [2/2]

String Oss.Nas.NasCodecBase< T >.DecodeToJSON ( byte[]  nasMessage,
int  offset,
int  length 
)
inline

Converts a binary NAS message to a JSON value.

Parameters
nasMessageThe binary NAS message.
offsetThe offset in the buffer where the message starts.
lengthThe length of the binary message in bytes.
Exceptions
NASDecodeFailedExceptionIs thrown when conversion fails because the binary message is syntactically invalid and cannot be decoded.
Returns
A string that contains the JSON value.

◆ DecodeToText() [1/2]

String Oss.Nas.NasCodecBase< T >.DecodeToText ( byte[]  nasMessage)
inline

Converts a binary NAS message to ASN.1 value notation format.

Parameters
nasMessageThe binary NAS message.
Exceptions
NASDecodeFailedExceptionIs thrown when conversion fails because the binary message is syntactically invalid and cannot be decoded.
Returns
A string that contains the ASN.1 value notation of the message.

◆ DecodeToText() [2/2]

String Oss.Nas.NasCodecBase< T >.DecodeToText ( byte[]  nasMessage,
int  offset,
int  length 
)
inline

Converts a binary NAS message to ASN.1 value notation format.

Parameters
nasMessageThe binary NAS message.
offsetThe offset in the buffer where the message starts.
lengthThe length of the binary message in bytes.
Exceptions
NASDecodeFailedExceptionIs thrown when conversion fails because the binary message is syntactically invalid and cannot be decoded.
Returns
A string that contains the ASN.1 value notation of the message.

◆ DecodeToXML() [1/2]

String Oss.Nas.NasCodecBase< T >.DecodeToXML ( byte[]  nasMessage)
inline

Converts a binary NAS message to an XML document.

Parameters
nasMessageThe binary NAS message.
Exceptions
NASDecodeFailedExceptionIs thrown when conversion fails because the binary message is syntactically invalid and cannot be decoded.
Returns
A string that contains the XML document.

◆ DecodeToXML() [2/2]

String Oss.Nas.NasCodecBase< T >.DecodeToXML ( byte[]  nasMessage,
int  offset,
int  length 
)
inline

Converts a binary NAS message to an XML document.

Parameters
nasMessageThe binary NAS message.
offsetThe offset in the buffer where the message starts.
lengthThe length of the binary message in bytes.
Exceptions
NASDecodeFailedExceptionIs thrown when conversion fails because the binary message is syntactically invalid and cannot be decoded.
Returns
A string that contains the XML document.

◆ Encode()

byte [] Oss.Nas.NasCodecBase< T >.Encode ( nasMessage)
inline

Encodes a C# object that represents a NAS message into binary bytes. The byte[] that receives the binary bytes is allocated dynamically.

Parameters
nasMessageThe C# object that represents the NAS message.
Exceptions
NASEncodeFailedExceptionIs thrown when the message cannot be encoded because the value represented by nasMessage has semantic errors.
Returns
A byte[] that contains the encoded NAS message.

◆ PrintJSON()

String Oss.Nas.NasCodecBase< T >.PrintJSON ( nasMessage)
inline

Converts a C# object that represents a NAS message to a JSON value. Unlike the decodeToJSON method, it does not throw an exception when the C# object has semantic errors, but returns a null string. You can use the Diagnostics property to retrieve a diagnostic report in that case.

Parameters
nasMessageThe C# object that represents the NAS message.
Returns
A string that contains the JSON object.

◆ PrintMessage()

String Oss.Nas.NasCodecBase< T >.PrintMessage ( nasMessage)
inline

Converts a C# object that represents a NAS message into ASN.1 value notation format. Unlike the decodeToText method, it does not throw an exception when the C# object has semantic errors but returns a null string. You can use the Diagnostics property to retrieve a diagnostic report in that case.

Parameters
nasMessageThe C# object that represents the NAS message.
Returns
A string that contains the ASN.1 value notation for the NAS message.

◆ PrintXML()

String Oss.Nas.NasCodecBase< T >.PrintXML ( nasMessage)
inline

Converts a C# object that represents a NAS message to an XML document. Unlike the decodeToXML method, it does not throw an exception when the C# object has semantic errors, but returns a null string. You can use the Diagnostics property to retrieve a diagnostic report in that case.

Parameters
nasMessageThe C# object that represents the NAS message.
Returns
A string that contains the XML document.

Property Documentation

◆ Diagnostics

Returns a diagnostic report created by the most recent invocation of the NasCodec API. If the operation aborted due to an exception, the diagnostic report returned is identical to the diagnostics reported by the diagnostics() method of NASException. Even when the exception is not thrown, the operation can return a non-empty report because the encoder or decoder detected non-critical defects that did not cause it to treat a message as invalid.

◆ HasDiagnostics

bool Oss.Nas.NasCodecBase< T >.HasDiagnostics
get

Indicates whether the most recent invocation of the NasCodec API revealed defects in the NAS message.

◆ JSONOptions

Specifies formatting options that are used when a NAS message is converted to JSON format.

◆ Originator

Identifies the originator of a NAS message. Some NAS messages can originate only from the network, while other NAS messages can be sent only by the UE.

◆ TextOptions

Specifies formatting options that are used when a NAS message is converted to ASN.1 value notation format.

◆ XMLOptions

Specifies formatting options that are used when a NAS message is converted to an XML document.