Show / Hide Table of Contents

Class SctpTlvChunkParameter

Represents the a variable length parameter field for use within a Chunk. All chunk parameters use the same underlying Type-Length-Value (TLV) format but then specialise how the fields are used.

Inheritance
System.Object
SctpTlvChunkParameter
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SIPSorcery.Net
Assembly: SIPSorcery.dll
Syntax
public class SctpTlvChunkParameter
Remarks

From https://tools.ietf.org/html/rfc4960#section-3.2.1 (final section): Note that a parameter type MUST be unique across all chunks.For example, the parameter type '5' is used to represent an IPv4 address. The value '5' then is reserved across all chunks to represent an IPv4 address and MUST NOT be reused with a different meaning in any other chunk.

Constructors

| Improve this Doc View Source

SctpTlvChunkParameter()

Declaration
protected SctpTlvChunkParameter()
| Improve this Doc View Source

SctpTlvChunkParameter(UInt16, Byte[])

Creates a new chunk parameter instance.

Declaration
public SctpTlvChunkParameter(ushort parameterType, byte[] parameterValue)
Parameters
Type Name Description
System.UInt16 parameterType
System.Byte[] parameterValue

Fields

| Improve this Doc View Source

ParameterValue

The information contained in the parameter.

Declaration
public byte[] ParameterValue
Field Value
Type Description
System.Byte[]
| Improve this Doc View Source

SCTP_PARAMETER_HEADER_LENGTH

Declaration
public const int SCTP_PARAMETER_HEADER_LENGTH = 4
Field Value
Type Description
System.Int32

Properties

| Improve this Doc View Source

ParameterType

The type of the chunk parameter.

Declaration
public ushort ParameterType { get; protected set; }
Property Value
Type Description
System.UInt16
| Improve this Doc View Source

UnrecognisedAction

If this parameter is unrecognised by the parent chunk then this field dictates how it should handle it.

Declaration
public SctpUnrecognisedParameterActions UnrecognisedAction { get; }
Property Value
Type Description
SctpUnrecognisedParameterActions

Methods

| Improve this Doc View Source

GetBytes()

Serialises an SCTP chunk parameter to a byte array.

Declaration
public byte[] GetBytes()
Returns
Type Description
System.Byte[]

The byte array containing the serialised chunk parameter.

| Improve this Doc View Source

GetParameterLength(Boolean)

Calculates the length for the chunk parameter.

Declaration
public virtual ushort GetParameterLength(bool padded)
Parameters
Type Name Description
System.Boolean padded

If true the length field will be padded to a 4 byte boundary.

Returns
Type Description
System.UInt16

The length of the chunk. This method gets overridden by specialised SCTP parameters that each have their own fields that determine the length.

| Improve this Doc View Source

ParseFirstWord(Byte[], Int32)

The first 32 bits of all chunk parameters represent the type and length. This method parses those fields and sets them on the current instance.

Declaration
public ushort ParseFirstWord(byte[] buffer, int posn)
Parameters
Type Name Description
System.Byte[] buffer

The buffer holding the serialised chunk parameter.

System.Int32 posn

The position in the buffer that indicates the start of the chunk parameter.

Returns
Type Description
System.UInt16
| Improve this Doc View Source

ParseTlvParameter(Byte[], Int32)

Parses an SCTP Type-Length-Value (TLV) chunk parameter from a buffer.

Declaration
public static SctpTlvChunkParameter ParseTlvParameter(byte[] buffer, int posn)
Parameters
Type Name Description
System.Byte[] buffer

The buffer holding the serialised TLV chunk parameter.

System.Int32 posn

The position to start parsing at.

Returns
Type Description
SctpTlvChunkParameter

An SCTP TLV chunk parameter instance.

| Improve this Doc View Source

WriteParameterHeader(Byte[], Int32)

Writes the parameter header to the buffer. All chunk parameters use the same two header fields.

Declaration
protected void WriteParameterHeader(byte[] buffer, int posn)
Parameters
Type Name Description
System.Byte[] buffer

The buffer to write the chunk parameter header to.

System.Int32 posn

The position in the buffer to write at.

| Improve this Doc View Source

WriteTo(Byte[], Int32)

Serialises the chunk parameter to a pre-allocated buffer. This method gets overridden by specialised SCTP chunk parameters that have their own data and need to be serialised differently.

Declaration
public virtual int WriteTo(byte[] buffer, int posn)
Parameters
Type Name Description
System.Byte[] buffer

The buffer to write the serialised chunk parameter bytes to. It must have the required space already allocated.

System.Int32 posn

The position in the buffer to write to.

Returns
Type Description
System.Int32

The number of bytes, including padding, written to the buffer.

Extension Methods

JSONWriter.ToJson(Object)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX