sctp_go

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MIT Imports: 11 Imported by: 0

README

# Using sctp in golang.

## See example/sctp_server.go for server implementation.
## See example/sctp_client.go for client implementation.

### Running Server

#### Stream Server
$ go run example/sctp_server.go

#### Sequential Packet Server
$ go run example/packet_server.go

### Running Client

#### Stream Client 
$ go run example/sctp_client.go 

#### Sequential Packet Client
$ go run example/packet_client.go

#### Getting
$ go get github.com/thebagchi/sctp-go

Documentation

Index

Constants

View Source
const (
	SOL_SCTP                       = 0x84
	IPPROTO_SCTP                   = 0x84
	IoVectorSize                   = 0x10
	MsgHeaderSize                  = 0x38
	CMsgHeaderSize                 = 0x10
	InAddrSize                     = 0x4
	In6AddrSize                    = 0x10
	SockAddrInSize                 = 0x10
	SockAddrIn6Size                = 0x1c
	SockAddrSize                   = 0x10
	SockAddrStorageSize            = 0x80
	SCTPSndRcvInfoSize             = 0x20
	SCTPInitMsgSize                = 0x8
	SCTPSndInfoSize                = 0x10
	SCTPRcvInfoSize                = 0x1c
	SCTPNxtInfoSize                = 0x10
	SCTPPrInfoSize                 = 0x8
	SCTPAuthInfoSize               = 0x2
	SCTPAssocChangeSize            = 0x14
	SCTPPAddrChangeSize            = 0x94
	SCTPRemoteErrorSize            = 0x10
	SCTPSendFailedSize             = 0x30
	SCTPShutdownEventSize          = 0xc
	SCTPAdaptationEventSize        = 0x10
	SCTPPDApiEventSize             = 0x18
	SCTPAuthKeyEventSize           = 0x14
	SCTPSenderDryEventSize         = 0xc
	SCTPStreamResetEventSize       = 0xc
	SCTPAssocResetEventSize        = 0x14
	SCTPStreamChangeEventSize      = 0x10
	SCTPEventSubscribeSize         = 0xd
	SCTPNotificationSize           = 0x94
	SCTPCmsgDataSize               = 0x20
	SCTPNotificationHeaderSize     = 0x8
	SCTPRTOInfoSize                = 0x10
	SCTPAssocParamsSize            = 0x14
	SCTPSetPeerPrimarySize         = 0x84
	SCTPPrimaryAddrSize            = 0x84
	SCTPSetAdaptationSize          = 0x4
	SCTPPeerAddrParamsSize         = 0x9c
	SCTPAuthChunkSize              = 0x1
	SCTPHmacAlgoSize               = 0x4
	SCTPAuthKeySize                = 0x8
	SCTPAuthKeyIdSize              = 0x8
	SCTPSackInfoSize               = 0xc
	SCTPAssocValueSize             = 0x8
	SCTPStreamValueSize            = 0x8
	SCTPPeerAddrInfoSize           = 0x98
	SCTPStatusSize                 = 0xb0
	SCTPAuthChunksSize             = 0x8
	SCTPAssocIdsSize               = 0x4
	SCTPGetAddrsOldSize            = 0x10
	SCTPGetAddrsSize               = 0x8
	SCTPAssocStatsSize             = 0x100
	SCTPPeelOffArgSize             = 0x8
	SCTPPeelOffFlagsArgSize        = 0xc
	SCTPPeerAddrThresholdsSize     = 0x90
	SCTPPRStatusSize               = 0x18
	SCTPDefaultPRInfoSize          = 0xc
	SCTPInfoSize                   = 0x170
	SCTPResetStreamsSize           = 0x8
	SCTPAddStreamsSize             = 0x8
	SCTPEventSize                  = 0x8
	SCTP_FUTURE_ASSOC              = 0x0
	SCTP_CURRENT_ASSOC             = 0x1
	SCTP_ALL_ASSOC                 = 0x2
	SCTP_RTOINFO                   = 0x0
	SCTP_ASSOCINFO                 = 0x1
	SCTP_INITMSG                   = 0x2
	SCTP_NODELAY                   = 0x3
	SCTP_AUTOCLOSE                 = 0x4
	SCTP_SET_PEER_PRIMARY_ADDR     = 0x5
	SCTP_PRIMARY_ADDR              = 0x6
	SCTP_ADAPTATION_LAYER          = 0x7
	SCTP_DISABLE_FRAGMENTS         = 0x8
	SCTP_PEER_ADDR_PARAMS          = 0x9
	SCTP_DEFAULT_SEND_PARAM        = 0xa
	SCTP_EVENTS                    = 0xb
	SCTP_I_WANT_MAPPED_V4_ADDR     = 0xc
	SCTP_MAXSEG                    = 0xd
	SCTP_STATUS                    = 0xe
	SCTP_GET_PEER_ADDR_INFO        = 0xf
	SCTP_DELAYED_ACK_TIME          = 0x10
	SCTP_DELAYED_ACK               = 0x10
	SCTP_DELAYED_SACK              = 0x10
	SCTP_CONTEXT                   = 0x11
	SCTP_FRAGMENT_INTERLEAVE       = 0x12
	SCTP_PARTIAL_DELIVERY_POINT    = 0x13
	SCTP_MAX_BURST                 = 0x14
	SCTP_AUTH_CHUNK                = 0x15
	SCTP_HMAC_IDENT                = 0x16
	SCTP_AUTH_KEY                  = 0x17
	SCTP_AUTH_ACTIVE_KEY           = 0x18
	SCTP_AUTH_DELETE_KEY           = 0x19
	SCTP_PEER_AUTH_CHUNKS          = 0x1a
	SCTP_LOCAL_AUTH_CHUNKS         = 0x1b
	SCTP_GET_ASSOC_NUMBER          = 0x1c
	SCTP_GET_ASSOC_ID_LIST         = 0x1d
	SCTP_AUTO_ASCONF               = 0x1e
	SCTP_PEER_ADDR_THLDS           = 0x1f
	SCTP_RECVRCVINFO               = 0x20
	SCTP_RECVNXTINFO               = 0x21
	SCTP_DEFAULT_SNDINFO           = 0x22
	SCTP_AUTH_DEACTIVATE_KEY       = 0x23
	SCTP_REUSE_PORT                = 0x24
	SCTP_SOCKOPT_BINDX_ADD         = 0x64
	SCTP_SOCKOPT_BINDX_REM         = 0x65
	SCTP_SOCKOPT_PEELOFF           = 0x66
	SCTP_SOCKOPT_CONNECTX_OLD      = 0x6b
	SCTP_GET_PEER_ADDRS            = 0x6c
	SCTP_GET_LOCAL_ADDRS           = 0x6d
	SCTP_SOCKOPT_CONNECTX          = 0x6e
	SCTP_SOCKOPT_CONNECTX3         = 0x6f
	SCTP_GET_ASSOC_STATS           = 0x70
	SCTP_PR_SUPPORTED              = 0x71
	SCTP_DEFAULT_PRINFO            = 0x72
	SCTP_PR_ASSOC_STATUS           = 0x73
	SCTP_PR_STREAM_STATUS          = 0x74
	SCTP_RECONFIG_SUPPORTED        = 0x75
	SCTP_ENABLE_STREAM_RESET       = 0x76
	SCTP_RESET_STREAMS             = 0x77
	SCTP_RESET_ASSOC               = 0x78
	SCTP_ADD_STREAMS               = 0x79
	SCTP_SOCKOPT_PEELOFF_FLAGS     = 0x7a
	SCTP_STREAM_SCHEDULER          = 0x7b
	SCTP_STREAM_SCHEDULER_VALUE    = 0x7c
	SCTP_INTERLEAVING_SUPPORTED    = 0x7d
	SCTP_SENDMSG_CONNECT           = 0x7e
	SCTP_EVENT                     = 0x7f
	SCTP_ASCONF_SUPPORTED          = 0x80
	SCTP_AUTH_SUPPORTED            = 0x81
	SCTP_ECN_SUPPORTED             = 0x82
	SCTP_PR_SCTP_NONE              = 0x0
	SCTP_PR_SCTP_TTL               = 0x10
	SCTP_PR_SCTP_RTX               = 0x20
	SCTP_PR_SCTP_PRIO              = 0x30
	SCTP_PR_SCTP_MAX               = 0x30
	SCTP_PR_SCTP_MASK              = 0x30
	SCTP_ENABLE_RESET_STREAM_REQ   = 0x1
	SCTP_ENABLE_RESET_ASSOC_REQ    = 0x2
	SCTP_ENABLE_CHANGE_ASSOC_REQ   = 0x4
	SCTP_ENABLE_STRRESET_MASK      = 0x7
	SCTP_STREAM_RESET_INCOMING     = 0x1
	SCTP_STREAM_RESET_OUTGOING     = 0x2
	SCTP_MSG_NOTIFICATION          = 0x8000
	SCTP_UNORDERED                 = 0x1
	SCTP_ADDR_OVER                 = 0x2
	SCTP_ABORT                     = 0x4
	SCTP_SACK_IMMEDIATELY          = 0x8
	SCTP_SENDALL                   = 0x40
	SCTP_PR_SCTP_ALL               = 0x80
	SCTP_NOTIFICATION              = 0x8000
	SCTP_EOF                       = 0x200
	SCTP_INIT                      = 0x0
	SCTP_SNDRCV                    = 0x1
	SCTP_SNDINFO                   = 0x2
	SCTP_RCVINFO                   = 0x3
	SCTP_NXTINFO                   = 0x4
	SCTP_PRINFO                    = 0x5
	SCTP_AUTHINFO                  = 0x6
	SCTP_DSTADDRV4                 = 0x7
	SCTP_DSTADDRV6                 = 0x8
	SCTP_COMM_UP                   = 0x0
	SCTP_COMM_LOST                 = 0x1
	SCTP_RESTART                   = 0x2
	SCTP_SHUTDOWN_COMP             = 0x3
	SCTP_CANT_STR_ASSOC            = 0x4
	SCTP_ADDR_AVAILABLE            = 0x0
	SCTP_ADDR_UNREACHABLE          = 0x1
	SCTP_ADDR_REMOVED              = 0x2
	SCTP_ADDR_ADDED                = 0x3
	SCTP_ADDR_MADE_PRIM            = 0x4
	SCTP_ADDR_CONFIRMED            = 0x5
	SCTP_DATA_UNSENT               = 0x0
	SCTP_DATA_SENT                 = 0x1
	SCTP_PARTIAL_DELIVERY_ABORTED  = 0x0
	SCTP_AUTH_NEW_KEY              = 0x0
	SCTP_AUTH_FREE_KEY             = 0x1
	SCTP_AUTH_NO_AUTH              = 0x2
	SCTP_STREAM_RESET_INCOMING_SSN = 0x1
	SCTP_STREAM_RESET_OUTGOING_SSN = 0x2
	SCTP_STREAM_RESET_DENIED       = 0x4
	SCTP_STREAM_RESET_FAILED       = 0x8
	SCTP_ASSOC_RESET_DENIED        = 0x4
	SCTP_ASSOC_RESET_FAILED        = 0x8
	SCTP_ASSOC_CHANGE_DENIED       = 0x4
	SCTP_ASSOC_CHANGE_FAILED       = 0x8
	SCTP_STREAM_CHANGE_DENIED      = 0x4
	SCTP_STREAM_CHANGE_FAILED      = 0x8
	SCTP_SN_TYPE_BASE              = 0x8000
	SCTP_DATA_IO_EVENT             = 0x8000
	SCTP_ASSOC_CHANGE              = 0x8001
	SCTP_PEER_ADDR_CHANGE          = 0x8002
	SCTP_SEND_FAILED               = 0x8003
	SCTP_REMOTE_ERROR              = 0x8004
	SCTP_SHUTDOWN_EVENT            = 0x8005
	SCTP_PARTIAL_DELIVERY_EVENT    = 0x8006
	SCTP_ADAPTATION_INDICATION     = 0x8007
	SCTP_AUTHENTICATION_EVENT      = 0x8008
	SCTP_SENDER_DRY_EVENT          = 0x8009
	SCTP_STREAM_RESET_EVENT        = 0x800a
	SCTP_ASSOC_RESET_EVENT         = 0x800b
	SCTP_STREAM_CHANGE_EVENT       = 0x800c
	SCTP_SN_TYPE_MAX               = 0x800c
	SCTP_FAILED_THRESHOLD          = 0x0
	SCTP_RECEIVED_SACK             = 0x1
	SCTP_HEARTBEAT_SUCCESS         = 0x2
	SCTP_RESPONSE_TO_USER_REQ      = 0x3
	SCTP_INTERNAL_ERROR            = 0x4
	SCTP_SHUTDOWN_GUARD_EXPIRES    = 0x5
	SCTP_PEER_FAULTY               = 0x6
	SPP_HB_ENABLE                  = 0x1
	SPP_HB_DISABLE                 = 0x2
	SPP_HB                         = 0x3
	SPP_HB_DEMAND                  = 0x4
	SPP_PMTUD_ENABLE               = 0x8
	SPP_PMTUD_DISABLE              = 0x10
	SPP_PMTUD                      = 0x18
	SPP_SACKDELAY_ENABLE           = 0x20
	SPP_SACKDELAY_DISABLE          = 0x40
	SPP_SACKDELAY                  = 0x60
	SPP_HB_TIME_IS_ZERO            = 0x80
	SPP_IPV6_FLOWLABEL             = 0x100
	SPP_DSCP                       = 0x200
	SCTP_AUTH_HMAC_ID_SHA1         = 0x1
	SCTP_AUTH_HMAC_ID_SHA256       = 0x3
	SCTP_INACTIVE                  = 0x0
	SCTP_PF                        = 0x1
	SCTP_ACTIVE                    = 0x2
	SCTP_UNCONFIRMED               = 0x3
	SCTP_UNKNOWN                   = 0xffff
	SCTP_EMPTY                     = 0x0
	SCTP_CLOSED                    = 0x1
	SCTP_COOKIE_WAIT               = 0x2
	SCTP_COOKIE_ECHOED             = 0x3
	SCTP_ESTABLISHED               = 0x4
	SCTP_SHUTDOWN_PENDING          = 0x5
	SCTP_SHUTDOWN_SENT             = 0x6
	SCTP_SHUTDOWN_RECEIVED         = 0x7
	SCTP_SHUTDOWN_ACK_SENT         = 0x8
	SCTP_BINDX_ADD_ADDR            = 0x1
	SCTP_BINDX_REM_ADDR            = 0x2
	SCTP_SS_FCFS                   = 0x0
	SCTP_SS_DEFAULT                = 0x0
	SCTP_SS_PRIO                   = 0x1
	SCTP_SS_RR                     = 0x2
	SCTP_SS_MAX                    = 0x2
)

Variables

This section is empty.

Functions

func AddrFamily

func AddrFamily(network string) int

func Clone

func Clone(from, to interface{})

func DetectAddrFamily

func DetectAddrFamily(network string) int

func Endianness

func Endianness() binary.ByteOrder

func MakeSockaddr

func MakeSockaddr(addr *SCTPAddr) []byte

func NotificationName

func NotificationName(notification uint16) string

func Pack

func Pack(v interface{}) []byte

func ParseSndRcvInfo

func ParseSndRcvInfo(info *SCTPSndRcvInfo, data []byte)

func SCTPBind

func SCTPBind(sock int, addr *SCTPAddr, flags int) error

func SCTPConnect

func SCTPConnect(sock int, addr *SCTPAddr) (int, error)

func SCTPSendMsg

func SCTPSendMsg(sock int, buffer, control []byte, flags int) (int, error)

func SCTPSocket

func SCTPSocket(family, flag int) (int, error)

Types

type CMsgHeader

type CMsgHeader struct {
	Len   uint64
	Level int32
	Type  int32
}

type In6Addr

type In6Addr struct {
	Addr [16]byte
}

type InAddr

type InAddr struct {
	Addr [4]byte
}

type IoVector

type IoVector struct {
	Base *byte
	Len  uint64
}

type MsgHeader

type MsgHeader struct {
	Name       *byte
	NameLen    uint32
	Iov        *IoVector
	IovLen     uint64
	Control    *byte
	ControlLen uint64
	Flags      int32
	Padding    [4]byte
}

type Notification

type Notification interface {
	GetType() uint16
	GetFlags() uint16
	GetLength() uint32
}

func ParseAdaptationIndicationEvent

func ParseAdaptationIndicationEvent(data []byte) (Notification, error)

func ParseAssocChangeEvent

func ParseAssocChangeEvent(data []byte) (Notification, error)

func ParseAssocResetEvent

func ParseAssocResetEvent(data []byte) (Notification, error)

func ParseAuthenticationEvent

func ParseAuthenticationEvent(data []byte) (Notification, error)

func ParseDataIOEvent

func ParseDataIOEvent(data []byte) (Notification, error)

func ParseNotification

func ParseNotification(data []byte) (Notification, error)

func ParsePartialDeliveryEvent

func ParsePartialDeliveryEvent(data []byte) (Notification, error)

func ParsePeerAddrChangeEvent

func ParsePeerAddrChangeEvent(data []byte) (Notification, error)

func ParseRemoteErrorEvent

func ParseRemoteErrorEvent(data []byte) (Notification, error)

func ParseSendFailedEvent

func ParseSendFailedEvent(data []byte) (Notification, error)

func ParseSenderDryEvent

func ParseSenderDryEvent(data []byte) (Notification, error)

func ParseShutdownEvent

func ParseShutdownEvent(data []byte) (Notification, error)

func ParseStreamChangeEvent

func ParseStreamChangeEvent(data []byte) (Notification, error)

func ParseStreamResetEvent

func ParseStreamResetEvent(data []byte) (Notification, error)

type SCTPAdaptationEvent

type SCTPAdaptationEvent struct {
	Type          uint16
	Flags         uint16
	Length        uint32
	AdaptationInd uint32
	AssocId       int32
}

func (*SCTPAdaptationEvent) GetFlags

func (n *SCTPAdaptationEvent) GetFlags() uint16

func (*SCTPAdaptationEvent) GetLength

func (n *SCTPAdaptationEvent) GetLength() uint32

func (*SCTPAdaptationEvent) GetType

func (n *SCTPAdaptationEvent) GetType() uint16

type SCTPAddStreams

type SCTPAddStreams struct {
	AssocId    int32
	InStreams  uint16
	OutStreams uint16
}

type SCTPAddr

type SCTPAddr struct {
	// contains filtered or unexported fields
}

func FromSCTPGetAddrs

func FromSCTPGetAddrs(addr *SCTPGetAddrs) *SCTPAddr

func FromSockAddrStorage

func FromSockAddrStorage(addr *SockAddrStorage) *SCTPAddr

func MakeSCTPAddr

func MakeSCTPAddr(network, addr string) (*SCTPAddr, error)

func (*SCTPAddr) Addr

func (addr *SCTPAddr) Addr() net.Addr

func (*SCTPAddr) IsV4Only

func (addr *SCTPAddr) IsV4Only() bool

func (*SCTPAddr) IsV6Only

func (addr *SCTPAddr) IsV6Only() bool

func (*SCTPAddr) Network

func (addr *SCTPAddr) Network() string

func (*SCTPAddr) String

func (addr *SCTPAddr) String() string

type SCTPAssocChange

type SCTPAssocChange struct {
	Type            uint16
	Flags           uint16
	Length          uint32
	State           uint16
	Error           uint16
	OutboundStreams uint16
	InboundStreams  uint16
	AssocId         int32
}

func (*SCTPAssocChange) GetFlags

func (n *SCTPAssocChange) GetFlags() uint16

func (*SCTPAssocChange) GetLength

func (n *SCTPAssocChange) GetLength() uint32

func (*SCTPAssocChange) GetType

func (n *SCTPAssocChange) GetType() uint16

type SCTPAssocId

type SCTPAssocId int32

type SCTPAssocIds

type SCTPAssocIds struct {
	NumberIds uint32
}

type SCTPAssocParams

type SCTPAssocParams struct {
	AssocId                int32
	AssocMaxrxt            uint16
	NumberPeerDestinations uint16
	PeerRwnd               uint32
	LocalRwnd              uint32
	CookieLife             uint32
}

type SCTPAssocResetEvent

type SCTPAssocResetEvent struct {
	Type      uint16
	Flags     uint16
	Length    uint32
	AssocId   int32
	LocalTsn  uint32
	RemoteTsn uint32
}

func (*SCTPAssocResetEvent) GetFlags

func (n *SCTPAssocResetEvent) GetFlags() uint16

func (*SCTPAssocResetEvent) GetLength

func (n *SCTPAssocResetEvent) GetLength() uint32

func (*SCTPAssocResetEvent) GetType

func (n *SCTPAssocResetEvent) GetType() uint16

type SCTPAssocStats

type SCTPAssocStats struct {
	AssocId      int32
	Addr         SockAddrStorage
	MaxRto       uint64
	ISacks       uint64
	OSacks       uint64
	OPackets     uint64
	IPackets     uint64
	RtxChunks    uint64
	OutOfSeqTsns uint64
	IDupChunks   uint64
	GapCnt       uint64
	OUodChunks   uint64
	IUodChunks   uint64
	OodChunks    uint64
	IodChunks    uint64
	OCtrlChunks  uint64
	ICtrlChunks  uint64
}

type SCTPAssocValue

type SCTPAssocValue struct {
	Id    int32
	Value uint32
}

type SCTPAuthChunk

type SCTPAuthChunk struct {
	Chunk uint8
}

type SCTPAuthChunks

type SCTPAuthChunks struct {
	AssocId      int32
	NumberChunks uint32
}

type SCTPAuthInfo

type SCTPAuthInfo struct {
	KeyNumber uint16
}

type SCTPAuthKey

type SCTPAuthKey struct {
	AssocId   int32
	KeyNumber uint16
	KeyLength uint16
}

type SCTPAuthKeyEvent

type SCTPAuthKeyEvent struct {
	Type         uint16
	Flags        uint16
	Length       uint32
	KeyNumber    uint16
	AltKeyNumber uint16
	Indication   uint32
	AssocId      int32
}

func (*SCTPAuthKeyEvent) GetFlags

func (n *SCTPAuthKeyEvent) GetFlags() uint16

func (*SCTPAuthKeyEvent) GetLength

func (n *SCTPAuthKeyEvent) GetLength() uint32

func (*SCTPAuthKeyEvent) GetType

func (n *SCTPAuthKeyEvent) GetType() uint16

type SCTPAuthKeyId

type SCTPAuthKeyId struct {
	AssocId   int32
	KeyNumber uint16
	// contains filtered or unexported fields
}

type SCTPCmsgData

type SCTPCmsgData [32]byte

type SCTPConn

type SCTPConn struct {
	// contains filtered or unexported fields
}

func DialSCTP

func DialSCTP(network string, local, remote *SCTPAddr, init *SCTPInitMsg) (*SCTPConn, error)

func NewSCTPConn

func NewSCTPConn(sock int) *SCTPConn

func SCTPPeelOff

func SCTPPeelOff(sock, assoc int) (*SCTPConn, error)

func SCTPPeelOffFlag

func SCTPPeelOffFlag(sock, assoc, flags int) (*SCTPConn, error)

func (*SCTPConn) Abort

func (conn *SCTPConn) Abort() error

func (*SCTPConn) Close

func (conn *SCTPConn) Close() error

func (*SCTPConn) GetDefaultSendParam

func (conn *SCTPConn) GetDefaultSendParam() (*SCTPSndRcvInfo, error)

func (*SCTPConn) GetEventSubscribe

func (conn *SCTPConn) GetEventSubscribe() (*SCTPEventSubscribe, error)

func (*SCTPConn) GetInitMsg

func (conn *SCTPConn) GetInitMsg() (*SCTPInitMsg, error)

func (*SCTPConn) GetPrimaryPeerAddr

func (conn *SCTPConn) GetPrimaryPeerAddr() (*SCTPAddr, error)

func (*SCTPConn) GetReadBufferSize

func (conn *SCTPConn) GetReadBufferSize() (int, error)

func (*SCTPConn) GetWriteBufferSize

func (conn *SCTPConn) GetWriteBufferSize() (int, error)

func (*SCTPConn) LocalAddr

func (conn *SCTPConn) LocalAddr() net.Addr

func (*SCTPConn) Read

func (conn *SCTPConn) Read(b []byte) (n int, err error)

func (*SCTPConn) RecvMsg

func (conn *SCTPConn) RecvMsg(b []byte, info *SCTPSndRcvInfo, flags *int) (n int, err error)

func (*SCTPConn) RemoteAddr

func (conn *SCTPConn) RemoteAddr() net.Addr

func (*SCTPConn) SendMsg

func (conn *SCTPConn) SendMsg(b []byte, info *SCTPSndRcvInfo) (int, error)

func (*SCTPConn) SetDeadline

func (conn *SCTPConn) SetDeadline(_ time.Time) error

func (*SCTPConn) SetDefaultSendParam

func (conn *SCTPConn) SetDefaultSendParam(param *SCTPSndRcvInfo) error

func (*SCTPConn) SetEventSubscribe

func (conn *SCTPConn) SetEventSubscribe(events *SCTPEventSubscribe) error

func (*SCTPConn) SetInitMsg

func (conn *SCTPConn) SetInitMsg(init *SCTPInitMsg) error

func (*SCTPConn) SetReadBufferSize

func (conn *SCTPConn) SetReadBufferSize(bytes int) error

func (*SCTPConn) SetReadDeadline

func (conn *SCTPConn) SetReadDeadline(_ time.Time) error

func (*SCTPConn) SetWriteBufferSize

func (conn *SCTPConn) SetWriteBufferSize(bytes int) error

func (*SCTPConn) SetWriteDeadline

func (conn *SCTPConn) SetWriteDeadline(_ time.Time) error

func (*SCTPConn) Write

func (conn *SCTPConn) Write(b []byte) (n int, err error)

type SCTPDefaultPRInfo

type SCTPDefaultPRInfo struct {
	AssocId int32
	Value   uint32
	Policy  uint16
}

type SCTPEvent

type SCTPEvent struct {
	AssocId int32
	Type    uint16
	On      uint8
}

type SCTPEventSubscribe

type SCTPEventSubscribe struct {
	DataIoEvent          uint8
	AssociationEvent     uint8
	AddressEvent         uint8
	SendFailureEvent     uint8
	PeerErrorEvent       uint8
	ShutdownEvent        uint8
	PartialDeliveryEvent uint8
	AdaptationLayerEvent uint8
	AuthenticationEvent  uint8
	SenderDryEvent       uint8
	StreamResetEvent     uint8
	AssocResetEvent      uint8
	StreamChangeEvent    uint8
}

type SCTPGetAddrs

type SCTPGetAddrs struct {
	AssocId int32
	Num     uint32
}

type SCTPGetAddrsOld

type SCTPGetAddrsOld struct {
	AssocId int32
	Num     int32
	Addrs   uintptr
}

type SCTPHmacAlgo

type SCTPHmacAlgo struct {
	NumIdents uint32
}

type SCTPInfo

type SCTPInfo struct {
	Tag                uint32
	State              uint32
	Rwnd               uint32
	UnackedData        uint16
	PendingData        uint16
	InStreams          uint16
	OutStreams         uint16
	FragmentationPoint uint32
	InQueue            uint32
	OutQueue           uint32
	OverallError       uint32
	MaxBurst           uint32
	MaxSeg             uint32
	PeerRwnd           uint32
	PeerTag            uint32
	PeerCapable        uint8
	PeerSack           uint8

	ISacks                   uint64
	OSacks                   uint64
	OPackets                 uint64
	IPackets                 uint64
	RtxChunks                uint64
	OutOfSeqTsns             uint64
	IDupChunks               uint64
	GapCount                 uint64
	OUodChunks               uint64
	IUodChunks               uint64
	OOdChunks                uint64
	IOdChunks                uint64
	OCtrlChunks              uint64
	ICtrlChunks              uint64
	PrimaryAddress           SockAddrStorage
	PrimaryState             int32
	PrimaryCwnd              uint32
	PrimarySrtt              uint32
	PrimaryRto               uint32
	PrimaryHbInterval        uint32
	PrimaryPathMaxRxt        uint32
	PrimarySackDelay         uint32
	PrimarySackFreq          uint32
	PrimarySsThreshold       uint32
	PrimaryPartialBytesAcked uint32
	PrimaryFlightSize        uint32
	PrimaryError             uint16

	SockAutoClose        uint32
	SockAdaptationInd    uint32
	SockPdPoint          uint32
	SockNodelay          uint8
	SockDisableFragments uint8
	SockV4Mapped         uint8
	SockFragInterleave   uint8
	SockType             uint32
	// contains filtered or unexported fields
}

type SCTPInitMsg

type SCTPInitMsg struct {
	NumOutStreams  uint16
	MaxInStreams   uint16
	MaxAttempts    uint16
	MaxInitTimeout uint16
}

type SCTPListener

type SCTPListener struct {
	// contains filtered or unexported fields
}

func ListenSCTP

func ListenSCTP(network string, sockettype int, local *SCTPAddr, init *SCTPInitMsg) (*SCTPListener, error)

func (*SCTPListener) Abort

func (listener *SCTPListener) Abort(assoc int) error

func (*SCTPListener) Accept

func (listener *SCTPListener) Accept() (net.Conn, error)

func (*SCTPListener) AcceptSCTP

func (listener *SCTPListener) AcceptSCTP() (*SCTPConn, error)

func (*SCTPListener) Addr

func (listener *SCTPListener) Addr() net.Addr

func (*SCTPListener) Close

func (listener *SCTPListener) Close() error

func (*SCTPListener) Connect

func (listener *SCTPListener) Connect(remote *SCTPAddr) (int, error)

func (*SCTPListener) Disconnect

func (listener *SCTPListener) Disconnect(assoc int) error

func (*SCTPListener) GetEventSubscribe

func (listener *SCTPListener) GetEventSubscribe() (*SCTPEventSubscribe, error)

func (*SCTPListener) PeelOff

func (listener *SCTPListener) PeelOff(assoc int) (*SCTPConn, error)

func (*SCTPListener) PeelOffFlags

func (listener *SCTPListener) PeelOffFlags(assoc, flag int) (*SCTPConn, error)

func (*SCTPListener) RecvMsg

func (listener *SCTPListener) RecvMsg(b []byte, info *SCTPSndRcvInfo, flags *int) (n int, err error)

func (*SCTPListener) RemoteAddr

func (listener *SCTPListener) RemoteAddr(assoc int) net.Addr

func (*SCTPListener) SendMsg

func (listener *SCTPListener) SendMsg(b []byte, info *SCTPSndRcvInfo) (int, error)

func (*SCTPListener) SetEventSubscribe

func (listener *SCTPListener) SetEventSubscribe(events *SCTPEventSubscribe) error

func (*SCTPListener) SetInitMsg

func (listener *SCTPListener) SetInitMsg(init *SCTPInitMsg) error

type SCTPNotification

type SCTPNotification [148]byte

type SCTPNotificationHeader

type SCTPNotificationHeader struct {
	Type   uint16
	Flags  uint16
	Length uint32
}

func (*SCTPNotificationHeader) GetFlags

func (n *SCTPNotificationHeader) GetFlags() uint16

func (*SCTPNotificationHeader) GetLength

func (n *SCTPNotificationHeader) GetLength() uint32

func (*SCTPNotificationHeader) GetType

func (n *SCTPNotificationHeader) GetType() uint16

type SCTPNxtInfo

type SCTPNxtInfo struct {
	Sid     uint16
	Flags   uint16
	Ppid    uint32
	Length  uint32
	AssocId int32
}

type SCTPPAddrChange

type SCTPPAddrChange struct {
	Type    uint16
	Flags   uint16
	Length  uint32
	Addr    [128]byte
	State   int32
	Error   int32
	AssocId int32
}

func (*SCTPPAddrChange) GetAddr

func (n *SCTPPAddrChange) GetAddr() *SCTPAddr

func (*SCTPPAddrChange) GetFlags

func (n *SCTPPAddrChange) GetFlags() uint16

func (*SCTPPAddrChange) GetLength

func (n *SCTPPAddrChange) GetLength() uint32

func (*SCTPPAddrChange) GetType

func (n *SCTPPAddrChange) GetType() uint16

type SCTPPDApiEvent

type SCTPPDApiEvent struct {
	Type       uint16
	Flags      uint16
	Length     uint32
	Indication uint32
	AssocId    int32
	Stream     uint32
	Sequence   uint32
}

func (*SCTPPDApiEvent) GetFlags

func (n *SCTPPDApiEvent) GetFlags() uint16

func (*SCTPPDApiEvent) GetLength

func (n *SCTPPDApiEvent) GetLength() uint32

func (*SCTPPDApiEvent) GetType

func (n *SCTPPDApiEvent) GetType() uint16

type SCTPPRStatus

type SCTPPRStatus struct {
	AssocId         int32
	Sid             uint16
	Policy          uint16
	AbandonedUnsent uint64
	AbandonedSent   uint64
}

type SCTPPeelOffArg

type SCTPPeelOffArg struct {
	AssocId int32
	Sd      int32
}

type SCTPPeelOffFlagsArg

type SCTPPeelOffFlagsArg struct {
	Arg   SCTPPeelOffArg
	Flags uint32
}

type SCTPPeerAddrInfo

type SCTPPeerAddrInfo struct {
	AssocId int32
	Addr    [128]byte
	State   int32
	Cwnd    uint32
	Srtt    uint32
	Rto     uint32
	Mtu     uint32
}

type SCTPPeerAddrParams

type SCTPPeerAddrParams struct {
	AssocId       int32
	Addr          [128]byte
	HbInterval    uint32
	PathMaxRxt    uint16
	PathMtu       uint32
	SackDelay     uint32
	Flags         uint32
	Ipv6FlowLabel uint32
	Dscp          uint8
	// contains filtered or unexported fields
}

func (*SCTPPeerAddrParams) Pack

func (s *SCTPPeerAddrParams) Pack() []byte

func (*SCTPPeerAddrParams) Unpack

func (s *SCTPPeerAddrParams) Unpack(data []byte)

type SCTPPeerAddrThresholds

type SCTPPeerAddrThresholds struct {
	AssocId         int32
	Address         SockAddrStorage
	PathMaxRxt      uint16
	PathPfThreshold uint16
}

type SCTPPrInfo

type SCTPPrInfo struct {
	Policy uint16
	Value  uint32
}

type SCTPPrimaryAddr

type SCTPPrimaryAddr SCTPSetPeerPrimary

type SCTPRTOInfo

type SCTPRTOInfo struct {
	AssocId int32
	Initial uint32
	Max     uint32
	Min     uint32
}

type SCTPRcvInfo

type SCTPRcvInfo struct {
	Sid     uint16
	Ssn     uint16
	Flags   uint16
	Ppid    uint32
	Tsn     uint32
	CumTsn  uint32
	Context uint32
	AssocId int32
}

type SCTPRemoteError

type SCTPRemoteError struct {
	Type    uint16
	Flags   uint16
	Length  uint32
	Error   uint16
	AssocId int32
}

func (*SCTPRemoteError) GetFlags

func (n *SCTPRemoteError) GetFlags() uint16

func (*SCTPRemoteError) GetLength

func (n *SCTPRemoteError) GetLength() uint32

func (*SCTPRemoteError) GetType

func (n *SCTPRemoteError) GetType() uint16

type SCTPResetStreams

type SCTPResetStreams struct {
	AssocId       int32
	Flags         uint16
	NumberStreams uint16
}

type SCTPSackInfo

type SCTPSackInfo struct {
	AssocId int32
	Delay   uint32
	Freq    uint32
}

type SCTPSendFailed

type SCTPSendFailed struct {
	Type    uint16
	Flags   uint16
	Length  uint32
	Error   uint32
	Info    SCTPSndRcvInfo
	AssocId int32
}

func (*SCTPSendFailed) GetFlags

func (n *SCTPSendFailed) GetFlags() uint16

func (*SCTPSendFailed) GetLength

func (n *SCTPSendFailed) GetLength() uint32

func (*SCTPSendFailed) GetType

func (n *SCTPSendFailed) GetType() uint16

type SCTPSenderDryEvent

type SCTPSenderDryEvent struct {
	Type    uint16
	Flags   uint16
	Length  uint32
	AssocId int32
}

func (*SCTPSenderDryEvent) GetFlags

func (n *SCTPSenderDryEvent) GetFlags() uint16

func (*SCTPSenderDryEvent) GetLength

func (n *SCTPSenderDryEvent) GetLength() uint32

func (*SCTPSenderDryEvent) GetType

func (n *SCTPSenderDryEvent) GetType() uint16

type SCTPSetAdaptation

type SCTPSetAdaptation struct {
	AdaptationInd uint32
}

type SCTPSetPeerPrimary

type SCTPSetPeerPrimary struct {
	AssocId int32
	Addr    [128]byte
}

type SCTPShutdownEvent

type SCTPShutdownEvent struct {
	Type    uint16
	Flags   uint16
	Length  uint32
	AssocId int32
}

func (*SCTPShutdownEvent) GetFlags

func (n *SCTPShutdownEvent) GetFlags() uint16

func (*SCTPShutdownEvent) GetLength

func (n *SCTPShutdownEvent) GetLength() uint32

func (*SCTPShutdownEvent) GetType

func (n *SCTPShutdownEvent) GetType() uint16

type SCTPSndInfo

type SCTPSndInfo struct {
	Sid     uint16
	Flags   uint16
	Ppid    uint32
	Context uint32
	AssocId int32
}

type SCTPSndRcvInfo

type SCTPSndRcvInfo struct {
	Stream uint16
	Ssn    uint16
	Flags  uint16

	Ppid       uint32
	Context    uint32
	TimeToLive uint32
	Tsn        uint32
	CumTsn     uint32
	AssocId    int32
	// contains filtered or unexported fields
}

type SCTPStatus

type SCTPStatus struct {
	AssocId            int32
	State              int32
	Rwnd               uint32
	UnackedData        uint16
	PendingData        uint16
	InStreams          uint16
	OutStreams         uint16
	FragmentationPoint uint32
	Primary            SCTPPeerAddrInfo
}

type SCTPStreamChangeEvent

type SCTPStreamChangeEvent struct {
	Type       uint16
	Flags      uint16
	Length     uint32
	AssocId    int32
	InStreams  uint16
	OutStreams uint16
}

func (*SCTPStreamChangeEvent) GetFlags

func (n *SCTPStreamChangeEvent) GetFlags() uint16

func (*SCTPStreamChangeEvent) GetLength

func (n *SCTPStreamChangeEvent) GetLength() uint32

func (*SCTPStreamChangeEvent) GetType

func (n *SCTPStreamChangeEvent) GetType() uint16

type SCTPStreamResetEvent

type SCTPStreamResetEvent struct {
	Type    uint16
	Flags   uint16
	Length  uint32
	AssocId int32
}

func (*SCTPStreamResetEvent) GetFlags

func (n *SCTPStreamResetEvent) GetFlags() uint16

func (*SCTPStreamResetEvent) GetLength

func (n *SCTPStreamResetEvent) GetLength() uint32

func (*SCTPStreamResetEvent) GetType

func (n *SCTPStreamResetEvent) GetType() uint16

type SCTPStreamValue

type SCTPStreamValue struct {
	AssocId     int32
	StreamId    uint16
	StreamValue uint16
}

type SockAddr

type SockAddr struct {
	Family uint16
	Data   [14]int8
}

type SockAddrIn

type SockAddrIn struct {
	Family uint16
	Port   uint16
	Addr   InAddr
	Zero   [8]uint8
}

type SockAddrIn6

type SockAddrIn6 struct {
	Family   uint16
	Port     uint16
	FlowInfo uint32
	Addr     In6Addr
	ScopeId  uint32
}

type SockAddrStorage

type SockAddrStorage struct {
	Family  uint16
	Padding [118]int8
	Align   uint64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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