sctp

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2018 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PAYLOADDATA      chunkType = 0
	INIT             chunkType = 1
	INITACK          chunkType = 2
	SACK             chunkType = 3
	HEARTBEAT        chunkType = 4
	HEARTBEATACK     chunkType = 5
	ABORT            chunkType = 6
	SHUTDOWN         chunkType = 7
	SHUTDOWNACK      chunkType = 8
	ERROR            chunkType = 9
	COOKIEECHO       chunkType = 10
	COOKIEACK        chunkType = 11
	CWR              chunkType = 13
	SHUTDOWNCOMPLETE chunkType = 14
)

List of known chunkType enums

Variables

This section is empty.

Functions

This section is empty.

Types

type Association

type Association struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Association represents an SCTP association 13.2. Parameters Necessary per Association (i.e., the TCB) Peer : Tag value to be sent in every packet and is received Verification: in the INIT or INIT ACK chunk. Tag :

My : Tag expected in every inbound packet and sent in the Verification: INIT or INIT ACK chunk.

Tag : State : A state variable indicating what state the association

: is in, i.e., COOKIE-WAIT, COOKIE-ECHOED, ESTABLISHED,
: SHUTDOWN-PENDING, SHUTDOWN-SENT, SHUTDOWN-RECEIVED,
: SHUTDOWN-ACK-SENT.

  Note: No "CLOSED" state is illustrated since if a
  association is "CLOSED" its TCB SHOULD be removed.

func NewAssocation

func NewAssocation(outboundHandler func([]byte), dataHandler func([]byte, uint16, PayloadProtocolIdentifier), notifier func(AssociationState)) *Association

NewAssocation creates a new Association and the state needed to manage it

func (*Association) Close

func (a *Association) Close() error

Close ends the SCTP Association and cleans up any state

func (*Association) Connect

func (a *Association) Connect()

Connect initiates the SCTP connection

func (*Association) HandleInbound

func (a *Association) HandleInbound(raw []byte) error

HandleInbound parses incoming raw packets

func (*Association) HandleOutbound

func (a *Association) HandleOutbound(raw []byte, streamIdentifier uint16, payloadType PayloadProtocolIdentifier) error

HandleOutbound sends outbound raw packets

func (*Association) Start

func (a *Association) Start(isInitiating bool)

Start starts the Association

type AssociationState

type AssociationState uint8

AssociationState is an enum for the states that an Association will transition through while connecting https://tools.ietf.org/html/rfc4960#section-13.2

const (
	Open AssociationState = iota + 1
	CookieEchoed
	CookieWait
	Established
	ShutdownAckSent
	ShutdownPending
	ShutdownReceived
	ShutdownSent
)

AssociationState enums

func (AssociationState) String

func (a AssociationState) String() string

type PayloadProtocolIdentifier

type PayloadProtocolIdentifier uint32

PayloadProtocolIdentifier is an enum for DataChannel payload types

const (
	PayloadTypeWebRTCDCEP        PayloadProtocolIdentifier = 50
	PayloadTypeWebRTCString      PayloadProtocolIdentifier = 51
	PayloadTypeWebRTCBinary      PayloadProtocolIdentifier = 53
	PayloadTypeWebRTCStringEmpty PayloadProtocolIdentifier = 56
	PayloadTypeWebRTCBinaryEmpty PayloadProtocolIdentifier = 57
)

PayloadProtocolIdentifier enums

func (PayloadProtocolIdentifier) String

func (p PayloadProtocolIdentifier) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL