Show / Hide Table of Contents

Class SctpInitChunk

This class is used to represent both an INIT and INIT ACK chunk. The only structural difference between them is the INIT ACK requires the Cookie variable parameter to be set. The INIT chunk is used to initiate an SCTP association between two endpoints. The INIT ACK chunk is used to respond to an incoming INIT chunk from a remote peer.

Inheritance
System.Object
SctpChunk
SctpInitChunk
Inherited Members
SctpChunk.SCTP_CHUNK_HEADER_LENGTH
SctpChunk.logger
SctpChunk.ChunkType
SctpChunk.ChunkFlags
SctpChunk.ChunkValue
SctpChunk.KnownType
SctpChunk.UnrecognizedPeerParameters
SctpChunk.ParseFirstWord(Byte[], Int32)
SctpChunk.WriteChunkHeader(Byte[], Int32)
SctpChunk.GotUnrecognisedParameter(SctpTlvChunkParameter)
SctpChunk.ParseBaseChunk(Byte[], Int32)
SctpChunk.GetParameters(Byte[], Int32, Int32)
SctpChunk.Parse(Byte[], Int32)
SctpChunk.GetChunkLengthFromHeader(Byte[], Int32, Boolean)
SctpChunk.GetUnrecognisedChunkAction(UInt16)
SctpChunk.CopyUnrecognisedChunk(Byte[], Int32)
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 SctpInitChunk : SctpChunk

Constructors

| Improve this Doc View Source

SctpInitChunk(SctpChunkType, UInt32, UInt32, UInt32, UInt16, UInt16)

Initialises the chunk as either INIT or INIT ACK.

Declaration
public SctpInitChunk(SctpChunkType initChunkType, uint initiateTag, uint initialTSN, uint arwnd, ushort numberOutboundStreams, ushort numberInboundStreams)
Parameters
Type Name Description
SctpChunkType initChunkType

Either INIT or INIT ACK.

System.UInt32 initiateTag
System.UInt32 initialTSN
System.UInt32 arwnd
System.UInt16 numberOutboundStreams
System.UInt16 numberInboundStreams

Fields

| Improve this Doc View Source

Addresses

Optional list of IP address parameters that can be included in INIT chunks.

Declaration
public List<IPAddress> Addresses
Field Value
Type Description
System.Collections.Generic.List<System.Net.IPAddress>
| Improve this Doc View Source

ARwnd

Advertised Receiver Window Credit. This value represents the dedicated buffer space, in number of bytes, the sender of the INIT has reserved in association with this window.

Declaration
public uint ARwnd
Field Value
Type Description
System.UInt32
| Improve this Doc View Source

CookiePreservative

The sender of the INIT shall use this parameter to suggest to the receiver of the INIT for a longer life-span of the State Cookie.

Declaration
public uint CookiePreservative
Field Value
Type Description
System.UInt32
| Improve this Doc View Source

FIXED_PARAMETERS_LENGTH

Declaration
public const int FIXED_PARAMETERS_LENGTH = 16
Field Value
Type Description
System.Int32
| Improve this Doc View Source

HostnameAddress

The sender of INIT uses this parameter to pass its Host Name (in place of its IP addresses) to its peer.The peer is responsible for resolving the name.Using this parameter might make it more likely for the association to work across a NAT box.

Declaration
public string HostnameAddress
Field Value
Type Description
System.String
| Improve this Doc View Source

InitialTSN

The initial Transmission Sequence Number (TSN) that the sender will use.

Declaration
public uint InitialTSN
Field Value
Type Description
System.UInt32
| Improve this Doc View Source

InitiateTag

The receiver of the INIT (the responding end) records the value of the Initiate Tag parameter.This value MUST be placed into the Verification Tag field of every SCTP packet that the receiver of the INIT transmits within this association.

Declaration
public uint InitiateTag
Field Value
Type Description
System.UInt32
| Improve this Doc View Source

NumberInboundStreams

Defines the maximum number of streams the sender of this INIT chunk allows the peer end to create in this association.

Declaration
public ushort NumberInboundStreams
Field Value
Type Description
System.UInt16
| Improve this Doc View Source

NumberOutboundStreams

Defines the number of outbound streams the sender of this INIT chunk wishes to create in this association.

Declaration
public ushort NumberOutboundStreams
Field Value
Type Description
System.UInt16
| Improve this Doc View Source

StateCookie

INIT ACK only. Mandatory. This parameter value MUST contain all the necessary state and parameter information required for the sender of this INIT ACK to create the association, along with a Message Authentication Code (MAC).

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

SupportedAddressTypes

The sender of INIT uses this parameter to list all the address types it can support. Options are IPv4 (5), IPv6 (6) and Hostname (11).

Declaration
public List<SctpInitChunkParameterType> SupportedAddressTypes
Field Value
Type Description
System.Collections.Generic.List<SctpInitChunkParameterType>
| Improve this Doc View Source

UnrecognizedParameters

INIT ACK only. Optional. This parameter is returned to the originator of the INIT chunk if the INIT contains an unrecognized parameter that has a value that indicates it should be reported to the sender. This parameter value field will contain unrecognized parameters copied from the INIT chunk complete with Parameter Type, Length, and Value fields.

Declaration
public List<byte[]> UnrecognizedParameters
Field Value
Type Description
System.Collections.Generic.List<System.Byte[]>

Methods

| Improve this Doc View Source

GetChunkLength(Boolean)

Calculates the length for INIT and INIT ACK chunks.

Declaration
public override ushort GetChunkLength(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.

Overrides
SctpChunk.GetChunkLength(Boolean)
| Improve this Doc View Source

ParseChunk(Byte[], Int32)

Parses the INIT or INIT ACK chunk fields

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

The buffer holding the serialised chunk.

System.Int32 posn

The position to start parsing at.

Returns
Type Description
SctpInitChunk
| Improve this Doc View Source

WriteTo(Byte[], Int32)

Serialises an INIT or INIT ACK chunk to a pre-allocated buffer.

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

The buffer to write the serialised chunk 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.UInt16

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

Overrides
SctpChunk.WriteTo(Byte[], Int32)

Extension Methods

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