Sign in

    moonbit-community/rtc/sctp does not have a README file

    SctpError

    pub(all) suberror SctpError {
    InvalidPacket(String)
    ChecksumMismatch
    InvalidState(String)
    AssociationFailed(String)
    StreamResetFailed(UInt16)
    MessageTooLarge(UInt64)
    BufferFull
    Time(
    TimeError
    )
    CryptoUnavailable(String)
    Closed
    } derive(Eq,
    Debug
    )

    Association

    pub struct Association {
    config : AssociationConfig
    provider :
    Provider

    outputs :
    Queue
    [Bytes]
    events :
    Queue
    [AssociationEvent]
    started : Bool
    state : AssociationState
    local_tag : UInt
    local_initial_tsn : UInt
    peer_tag : UInt?
    peer_initial_tsn : UInt?
    next_tsn : UInt
    cumulative_tsn : UInt?
    cookie : Bytes?
    init_ack_packet : Bytes?
    peer_supports_reconfig : Bool
    peer_supports_forward_tsn : Bool
    last_control_packet : Bytes?
    control_deadline :
    Instant
    ?
    control_rto_milliseconds : Int64
    control_retransmissions : Int
    outstanding : Map[UInt, OutstandingData]
    abandoned : Map[UInt, DataChunk]
    peer_cumulative_tsn_ack : UInt
    forward_tsn_transaction : ForwardTsnTransaction?
    received : Map[UInt, DataChunk]
    duplicates : Array[UInt]
    send_sequences : Map[StreamId, UInt16]
    receive_sequences : Map[StreamId, UInt16]
    reassemblies : Map[UInt64, Reassembly]
    completed_messages : Map[UInt64, Message]
    buffered_by_stream : Map[StreamId, UInt64]
    buffered_amount_low_thresholds : Map[StreamId, UInt64]
    buffered_amount : UInt64
    next_reset_request : UInt
    expected_peer_reset_request : UInt?
    reset_transactions : Map[UInt, ResetTransaction]
    pending_resets : Map[UInt, PendingReset]
    reset_responses : Map[UInt, Bytes]
    }

    Association::buffered_amount

    fn Association::buffered_amount(self : Association, stream : StreamId) -> UInt64

    Association::close

    Association::handle_datagram

    fn Association::handle_datagram(self : Association, now :
    Instant
    , datagram : Bytes) -> Unit raise SctpError

    Association::handle_timeout

    Association::new

    Association::poll_datagram

    fn Association::poll_datagram(self : Association) -> Bytes?

    Association::poll_event

    fn Association::poll_event(self : Association) -> AssociationEvent?

    Association::poll_timeout

    Association::reset_stream

    fn Association::reset_stream(self : Association, stream : StreamId, now :
    Instant
    ) -> Unit raise SctpError

    Association::send

    fn Association::send(self : Association, message : Message, reliability? : Reliability, now~ :
    Instant
    ) -> Unit raise SctpError

    Association::set_buffered_amount_low_threshold

    fn Association::set_buffered_amount_low_threshold(self : Association, stream : StreamId, threshold : UInt64) -> Unit

    Association::start

    Association::state

    AssociationConfig

    pub struct AssociationConfig {
    role : AssociationRole
    local_port : UInt16
    remote_port : UInt16
    max_message_size : UInt64
    max_payload_size : Int
    send_buffer_size : UInt64
    receive_buffer_size : UInt
    initial_tag : UInt?
    initial_tsn : UInt?
    initial_rto :
    Duration

    }

    AssociationConfig::new

    fn AssociationConfig::new(role~ : AssociationRole, local_port? : UInt16, remote_port? : UInt16, max_message_size? : UInt64, max_payload_size? : Int, send_buffer_size? : UInt64, receive_buffer_size? : UInt, initial_tag? : UInt, initial_tsn? : UInt, initial_rto? :
    Duration
    ) -> AssociationConfig raise SctpError

    AssociationConfig::role

    AssociationEvent

    pub(all) enum AssociationEvent {
    StateChanged(AssociationState)
    MessageReceived(Message)
    StreamReset(StreamId)
    StreamResetAcknowledged(StreamId)
    BufferedAmountLow(StreamId)
    } derive(Eq,
    Debug
    )

    AssociationRole

    pub(all) enum AssociationRole {
    Active
    Passive
    } derive(Eq,
    Debug
    )

    AssociationState

    pub(all) enum AssociationState {
    ClosedState
    CookieWait
    CookieEchoed
    Established
    ShutdownPending
    ShutdownSent
    ShutdownReceived
    ShutdownAckSent
    } derive(Eq,
    Debug
    )

    Chunk

    pub(all) enum Chunk {
    InitChunkValue(InitChunk)
    DataChunkValue(DataChunk)
    SackChunkValue(SackChunk)
    HeartbeatChunk(Bytes)
    HeartbeatAckChunk(Bytes)
    AbortChunk(Bytes)
    ShutdownChunk(UInt)
    ShutdownAckChunk
    ErrorChunk(Bytes)
    CookieEchoChunk(Bytes)
    CookieAckChunk
    ShutdownCompleteChunk
    ReconfigChunk(Array[ReconfigParameter])
    ForwardTsnChunk(ForwardTsn)
    UnknownChunk(Byte, Byte, Bytes)
    } derive(Eq,
    Debug
    )

    DataChunk

    pub struct DataChunk {
    unordered : Bool
    beginning : Bool
    ending : Bool
    immediate_sack : Bool
    tsn : UInt
    stream : StreamId
    stream_sequence : UInt16
    protocol_id : UInt
    user_data : Bytes
    } derive(Eq,
    Debug
    )

    DataChunk::is_beginning

    fn DataChunk::is_beginning(self : DataChunk) -> Bool

    DataChunk::is_ending

    fn DataChunk::is_ending(self : DataChunk) -> Bool

    DataChunk::is_unordered

    fn DataChunk::is_unordered(self : DataChunk) -> Bool

    DataChunk::new

    fn DataChunk::new(unordered? : Bool, beginning? : Bool, ending? : Bool, immediate_sack? : Bool, tsn~ : UInt, stream~ : StreamId, stream_sequence~ : UInt16, protocol_id~ : UInt, user_data~ : Bytes) -> DataChunk

    DataChunk::protocol_id

    fn DataChunk::protocol_id(self : DataChunk) -> UInt

    DataChunk::stream

    fn DataChunk::stream(self : DataChunk) -> StreamId

    DataChunk::stream_sequence

    fn DataChunk::stream_sequence(self : DataChunk) -> UInt16

    DataChunk::tsn

    fn DataChunk::tsn(self : DataChunk) -> UInt

    DataChunk::user_data

    fn DataChunk::user_data(self : DataChunk) -> Bytes

    ForwardTsn

    pub struct ForwardTsn {
    new_cumulative_tsn : UInt
    streams : Array[ForwardTsnStream]
    } derive(Eq,
    Debug
    )

    ForwardTsn::new

    fn ForwardTsn::new(new_cumulative_tsn~ : UInt, streams? : Array[ForwardTsnStream]) -> ForwardTsn

    ForwardTsn::new_cumulative_tsn

    fn ForwardTsn::new_cumulative_tsn(self : ForwardTsn) -> UInt

    ForwardTsn::streams

    ForwardTsnStream

    pub(all) struct ForwardTsnStream {
    stream : StreamId
    sequence : UInt16
    } derive(Eq,
    Debug
    )

    ForwardTsnStream::new

    fn ForwardTsnStream::new(stream~ : StreamId, sequence~ : UInt16) -> ForwardTsnStream

    ForwardTsnStream::sequence

    fn ForwardTsnStream::sequence(self : ForwardTsnStream) -> UInt16

    ForwardTsnStream::stream

    ForwardTsnTransaction

    type ForwardTsnTransaction

    GapAckBlock

    pub(all) struct GapAckBlock {
    start : UInt16
    end : UInt16
    } derive(Eq,
    Debug
    )

    InitChunk

    pub struct InitChunk {
    acknowledgement : Bool
    initiate_tag : UInt
    advertised_receiver_window : UInt
    outbound_streams : UInt16
    inbound_streams : UInt16
    initial_tsn : UInt
    parameters : Array[Parameter]
    } derive(Eq,
    Debug
    )

    InitChunk::advertised_receiver_window

    fn InitChunk::advertised_receiver_window(self : InitChunk) -> UInt

    InitChunk::inbound_streams

    fn InitChunk::inbound_streams(self : InitChunk) -> UInt16

    InitChunk::initial_tsn

    fn InitChunk::initial_tsn(self : InitChunk) -> UInt

    InitChunk::initiate_tag

    fn InitChunk::initiate_tag(self : InitChunk) -> UInt

    InitChunk::is_acknowledgement

    fn InitChunk::is_acknowledgement(self : InitChunk) -> Bool

    InitChunk::new

    fn InitChunk::new(acknowledgement? : Bool, initiate_tag~ : UInt, advertised_receiver_window? : UInt, outbound_streams? : UInt16, inbound_streams? : UInt16, initial_tsn~ : UInt, parameters? : Array[Parameter]) -> InitChunk raise SctpError

    InitChunk::outbound_streams

    fn InitChunk::outbound_streams(self : InitChunk) -> UInt16

    InitChunk::parameters

    fn InitChunk::parameters(self : InitChunk) -> Array[Parameter]

    Message

    pub struct Message {
    stream : StreamId
    protocol_id : UInt
    unordered : Bool
    payload : Bytes
    } derive(Eq,
    Debug
    )

    Message::is_unordered

    fn Message::is_unordered(self : Message) -> Bool

    Message::new

    fn Message::new(stream~ : StreamId, protocol_id~ : UInt, unordered? : Bool, payload~ : Bytes) -> Message

    Message::payload

    fn Message::payload(self : Message) -> Bytes

    Message::protocol_id

    fn Message::protocol_id(self : Message) -> UInt

    Message::stream

    fn Message::stream(self : Message) -> StreamId

    Ordering

    pub(all) enum Ordering {
    Ordered
    Unordered
    } derive(Eq,
    Debug
    )

    OutstandingData

    type OutstandingData

    Packet

    pub struct Packet {
    source_port : UInt16
    destination_port : UInt16
    verification_tag : UInt
    chunks : Array[Chunk]
    } derive(Eq,
    Debug
    )

    Packet::chunks

    fn Packet::chunks(self : Packet) -> Array[Chunk]

    Packet::decode

    fn Packet::decode(raw : Bytes) -> Packet raise SctpError

    Packet::destination_port

    fn Packet::destination_port(self : Packet) -> UInt16

    Packet::encode

    fn Packet::encode(self : Packet) -> Bytes raise SctpError

    Packet::new

    fn Packet::new(source_port~ : UInt16, destination_port~ : UInt16, verification_tag~ : UInt, chunks~ : Array[Chunk]) -> Packet raise SctpError

    Packet::source_port

    fn Packet::source_port(self : Packet) -> UInt16

    Packet::verification_tag

    fn Packet::verification_tag(self : Packet) -> UInt

    Parameter

    pub(all) enum Parameter {
    StateCookieParameter(Bytes)
    SupportedExtensionsParameter(Bytes)
    ForwardTsnSupportedParameter
    UnknownParameter(UInt16, Bytes)
    } derive(Eq,
    Debug
    )

    PendingReset

    type PendingReset

    Reassembly

    type Reassembly

    ReconfigParameter

    pub(all) enum ReconfigParameter {
    OutgoingResetRequest(request_sequence~ : UInt, response_sequence~ : UInt, sender_last_tsn~ : UInt, streams~ : Array[StreamId])
    ReconfigResponse(request_sequence~ : UInt, result~ : UInt)
    UnknownReconfigParameter(UInt16, Bytes)
    } derive(Eq,
    Debug
    )

    Reliability

    pub(all) enum Reliability {
    Reliable
    RetransmitCount(UInt16)
    Timed(UInt)
    } derive(Eq,
    Debug
    )

    ResetTransaction

    type ResetTransaction

    SackChunk

    pub struct SackChunk {
    cumulative_tsn_ack : UInt
    advertised_receiver_window : UInt
    gap_ack_blocks : Array[GapAckBlock]
    duplicate_tsns : Array[UInt]
    } derive(Eq,
    Debug
    )

    SackChunk::cumulative_tsn_ack

    fn SackChunk::cumulative_tsn_ack(self : SackChunk) -> UInt

    SackChunk::duplicate_tsns

    fn SackChunk::duplicate_tsns(self : SackChunk) -> Array[UInt]

    SackChunk::gap_ack_blocks

    fn SackChunk::gap_ack_blocks(self : SackChunk) -> Array[GapAckBlock]

    SackChunk::new

    fn SackChunk::new(cumulative_tsn_ack~ : UInt, advertised_receiver_window? : UInt, gap_ack_blocks? : Array[GapAckBlock], duplicate_tsns? : Array[UInt]) -> SackChunk

    StreamId

    pub(all) struct StreamId(UInt16) derive(Eq, Hash,
    Debug
    )

    StreamId::value

    fn StreamId::value(self : StreamId) -> UInt16