Documentation
¶
Index ¶
- Constants
- func SCTPBind(fd int, addr *SCTPAddr, flags int) error
- type AssocInfo
- type EventSubscribe
- type GetAddrsOld
- type InitMsg
- type Notification
- type NotificationHandler
- type NotificationHeader
- type RtoInfo
- type SCTPAddr
- type SCTPAssocChangeEvent
- func (s *SCTPAssocChangeEvent) AssocID() SCTPAssocID
- func (s *SCTPAssocChangeEvent) Flags() uint16
- func (s *SCTPAssocChangeEvent) InboundStreams() uint16
- func (s *SCTPAssocChangeEvent) Info() []uint8
- func (s *SCTPAssocChangeEvent) Length() uint32
- func (s *SCTPAssocChangeEvent) OutboundStreams() uint16
- func (s *SCTPAssocChangeEvent) State() SCTPState
- func (s *SCTPAssocChangeEvent) Type() SCTPNotificationType
- type SCTPAssocID
- type SCTPConn
- func (c *SCTPConn) Close() error
- func (c *SCTPConn) GetAssocInfo() (*AssocInfo, error)
- func (c *SCTPConn) GetDefaultSentParam() (*SndRcvInfo, error)
- func (c *SCTPConn) GetReadBuffer() (int, error)
- func (c *SCTPConn) GetRtoInfo() (*RtoInfo, error)
- func (c *SCTPConn) GetWriteBuffer() (int, error)
- func (c *SCTPConn) LocalAddr() net.Addr
- func (c *SCTPConn) Read(b []byte) (int, error)
- func (c *SCTPConn) RemoteAddr() net.Addr
- func (c *SCTPConn) SCTPRead(b []byte) (int, *SndRcvInfo, Notification, error)
- func (c *SCTPConn) SCTPWrite(b []byte, info *SndRcvInfo) (int, error)
- func (c *SCTPConn) SetAssocInfo(info AssocInfo) error
- func (c *SCTPConn) SetDeadline(t time.Time) error
- func (c *SCTPConn) SetDefaultSentParam(info *SndRcvInfo) error
- func (c *SCTPConn) SetNonBlock(nonBlock bool) error
- func (c *SCTPConn) SetReadBuffer(bytes int) error
- func (c *SCTPConn) SetReadDeadline(t time.Time) error
- func (c *SCTPConn) SetReadTimeout(tv syscall.Timeval) error
- func (c *SCTPConn) SetRtoInfo(rtoInfo RtoInfo) error
- func (c *SCTPConn) SetWriteBuffer(bytes int) error
- func (c *SCTPConn) SetWriteDeadline(t time.Time) error
- func (c *SCTPConn) SetWriteTimeout(tv syscall.Timeval) error
- func (c *SCTPConn) SubscribeEvents(flags int) error
- func (c *SCTPConn) SubscribedEvents() (int, error)
- func (c *SCTPConn) Write(b []byte) (int, error)
- type SCTPListener
- type SCTPNotificationType
- type SCTPShutdownEventNotification
- type SCTPState
- type SndInfo
- type SndRcvInfo
- type SocketConfig
Constants ¶
View Source
const ( SolSCTP = 132 SCTPBindxAddAddr = 0x01 SCTPBindxRemAddr = 0x02 MsgNotification = 0x8000 )
View Source
const ( SCTPRtoInfo = iota SCTPAssocInfo SCTPInitMsg SCTPNoDelay SCTPAutoClose SCTPSetPeerPrimaryAddr SCTPPrimaryAddr SCTPAdaptationLayer SCTPDisableFragments SCTPPeerAddrParams SCTPDefaultSentParam SCTPEvents SCTPIWantMappedV4Addr SCTPMaxSeg SCTPStatus SCTPGetPeerAddrInfo SCTPDelayedAckTime SCTPDelayedAck = SCTPDelayedAckTime SCTPDelayedSack = SCTPDelayedAckTime SCTPSockOptBindxAdd = 100 SCTPSockOptBindxRem = 101 SCTPSockOptPeelOff = 102 SCTPGetPeerAddrs = 108 SCTPGetLocalAddrs = 109 SCTPSockOptConnectx = 110 SCTPSockOptConnectx3 = 111 )
View Source
const ( SCTPEventDataIO = 1 << iota SCTPEventAssociation SCTPEventAddress SCTPEventSendFailure SCTPEventSendPeerError SCTPEventShutdown SCTPEventPartialDelivery SCTPEventAdaptationLayer SCTPEventAuthentication SCTPEventSenderDry SCTPEventAll = SCTPEventDataIO | SCTPEventAssociation | SCTPEventAddress | SCTPEventSendFailure | SCTPEventSendPeerError | SCTPEventShutdown | SCTPEventPartialDelivery | SCTPEventAdaptationLayer | SCTPEventAuthentication | SCTPEventSenderDry )
View Source
const ( SCTPSnTypeBase = SCTPNotificationType(iota + (1 << 15)) SCTPAssocChange SCTPPeerAddrChange SCTPSendFailed SCTPRemoteError SCTPShutdownEvent SCTPPartialDeliveryEvent SCTPAdaptationIndication SCTPAuthenticationIndication SCTPSenderDryEvent )
View Source
const ( SCTPCMsgInit = iota SCTPCMsgSndRcv SCTPCMsgSndInfo SCTPCMsgRcvInfo SCTPCMsgNxtInfo )
View Source
const ( SCTPUnordered = 1 << iota SCTPAddrOver SCTPAbort SCTPSackImmediately SCTPEof )
View Source
const ( SCTPCommUp = SCTPState(iota) SCTPCommLost SCTPRestart SCTPShutdownComp SCTPCantStrAssoc )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssocInfo ¶
type AssocInfo struct { AssocID SCTPAssocID // maximum retransmission attempts to make for the association AsocMaxRxt uint16 // number of destination addresses that the peer has NumberPeerDestinations uint16 // current value of the peer's rwnd (reported in the last selective acknowledgment (SACK)) minus any outstanding data PeerRwnd uint32 // the last reported rwnd that was sent to the peer LocalRwnd uint32 // the association's cookie life value used when issuing cookies CookieLife uint32 }
Association Parameters defined in RFC 6458 8.1
type EventSubscribe ¶
type GetAddrsOld ¶
type Notification ¶
type Notification interface { Type() SCTPNotificationType Flags() uint16 Length() uint32 }
type NotificationHandler ¶
type NotificationHeader ¶
type SCTPAddr ¶
func (*SCTPAddr) ToRawSockAddrBuf ¶
type SCTPAssocChangeEvent ¶
type SCTPAssocChangeEvent struct {
// contains filtered or unexported fields
}
SCTPAssocChangeEvent is an implementation of Notification interface
func (*SCTPAssocChangeEvent) AssocID ¶
func (s *SCTPAssocChangeEvent) AssocID() SCTPAssocID
func (*SCTPAssocChangeEvent) Flags ¶
func (s *SCTPAssocChangeEvent) Flags() uint16
func (*SCTPAssocChangeEvent) InboundStreams ¶
func (s *SCTPAssocChangeEvent) InboundStreams() uint16
func (*SCTPAssocChangeEvent) Info ¶
func (s *SCTPAssocChangeEvent) Info() []uint8
func (*SCTPAssocChangeEvent) Length ¶
func (s *SCTPAssocChangeEvent) Length() uint32
func (*SCTPAssocChangeEvent) OutboundStreams ¶
func (s *SCTPAssocChangeEvent) OutboundStreams() uint16
func (*SCTPAssocChangeEvent) State ¶
func (s *SCTPAssocChangeEvent) State() SCTPState
func (*SCTPAssocChangeEvent) Type ¶
func (s *SCTPAssocChangeEvent) Type() SCTPNotificationType
type SCTPAssocID ¶
type SCTPAssocID int32
type SCTPConn ¶
type SCTPConn struct {
// contains filtered or unexported fields
}
func NewSCTPConn ¶
func NewSCTPConn(fd int, handler NotificationHandler) *SCTPConn
func (*SCTPConn) GetAssocInfo ¶
func (*SCTPConn) GetDefaultSentParam ¶
func (c *SCTPConn) GetDefaultSentParam() (*SndRcvInfo, error)
func (*SCTPConn) GetReadBuffer ¶
func (*SCTPConn) GetRtoInfo ¶
func (*SCTPConn) GetWriteBuffer ¶
func (*SCTPConn) RemoteAddr ¶
func (*SCTPConn) SCTPRead ¶
func (c *SCTPConn) SCTPRead(b []byte) (int, *SndRcvInfo, Notification, error)
SCTPRead use syscall.Recvmsg to receive SCTP message and return sctp sndrcvinfo/notification if need
func (*SCTPConn) SetAssocInfo ¶
func (*SCTPConn) SetDefaultSentParam ¶
func (c *SCTPConn) SetDefaultSentParam(info *SndRcvInfo) error
func (*SCTPConn) SetNonBlock ¶
func (*SCTPConn) SetReadBuffer ¶
func (*SCTPConn) SetRtoInfo ¶
func (*SCTPConn) SetWriteBuffer ¶
func (*SCTPConn) SubscribeEvents ¶
func (*SCTPConn) SubscribedEvents ¶
type SCTPListener ¶
type SCTPListener struct {
// contains filtered or unexported fields
}
func (*SCTPListener) AcceptSCTP ¶
func (ln *SCTPListener) AcceptSCTP() (*SCTPConn, error)
AcceptSCTP waits for and returns the next SCTP connection to the listener. it will use EpollWait to wait for a incoming connection then call syscall.Accept4 to accept
func (*SCTPListener) Close ¶
func (ln *SCTPListener) Close() error
type SCTPNotificationType ¶
type SCTPNotificationType int
type SCTPShutdownEventNotification ¶ added in v0.0.12
type SCTPShutdownEventNotification struct {
// contains filtered or unexported fields
}
SCTPShutdownEvent is an implementation of Notification interface
func (*SCTPShutdownEventNotification) AssocID ¶ added in v0.0.12
func (s *SCTPShutdownEventNotification) AssocID() SCTPAssocID
func (*SCTPShutdownEventNotification) Flags ¶ added in v0.0.12
func (s *SCTPShutdownEventNotification) Flags() uint16
func (*SCTPShutdownEventNotification) Length ¶ added in v0.0.12
func (s *SCTPShutdownEventNotification) Length() uint32
func (*SCTPShutdownEventNotification) Type ¶ added in v0.0.12
func (s *SCTPShutdownEventNotification) Type() SCTPNotificationType
type SndRcvInfo ¶
type SocketConfig ¶
type SocketConfig struct { // If Control is not nil it is called after the socket is created but before // it is bound or connected. Control func(network, address string, c syscall.RawConn) error // InitMsg is the options to send in the initial SCTP message InitMsg InitMsg // RtoInfo RtoInfo *RtoInfo // AssocInfo (RFC 6458) AssocInfo *AssocInfo }
SocketConfig contains options for the SCTP socket.
func (*SocketConfig) Listen ¶
func (cfg *SocketConfig) Listen(net string, laddr *SCTPAddr) (*SCTPListener, error)
Click to show internal directories.
Click to hide internal directories.