moonbitstack/moonrtc/sctp does not have a README file

    SctpError

    pub(all) suberror SctpError {
    Truncated
    BadChecksum
    InvalidChunk
    } derive(Eq,
    Debug
    )

    impl Show for SctpError

    AssocState

    pub(all) enum AssocState {
    Closed
    CookieWait
    CookieEchoed
    Established
    } derive(Eq,
    Debug
    )

    Association

    pub struct Association {
    local_port : Int
    remote_port : Int
    local_vtag : UInt
    remote_vtag : UInt
    next_tsn : UInt
    peer_cum_tsn : UInt
    stream_seqs : Map[Int, Int]
    state : AssocState
    received : Array[ReceivedData]
    }

    User-space SCTP association driving the 4-way handshake and data framing.

    Association::drain_received

    fn Association::drain_received(self : Association) -> Array[ReceivedData]

    Association::handle_packet

    fn Association::handle_packet(self : Association, raw : BytesView) -> Array[Bytes] raise SctpError

    Association::initiate

    fn Association::initiate(self : Association) -> Bytes

    Association::new

    fn Association::new(local_port? : Int, remote_port? : Int, local_vtag? : UInt, initial_tsn? : UInt) -> Association

    Association::send

    fn Association::send(self : Association, stream_id : Int, ppid : UInt, payload : Bytes, unordered? : Bool) -> Bytes

    Chunk

    pub(all) enum Chunk {
    Data(flags~ : Byte, tsn~ : UInt, stream_id~ : Int, seq~ : Int, ppid~ : UInt, payload~ : Bytes)
    Init(init_tag~ : UInt, a_rwnd~ : UInt, out_streams~ : Int, in_streams~ : Int, init_tsn~ : UInt)
    InitAck(init_tag~ : UInt, a_rwnd~ : UInt, out_streams~ : Int, in_streams~ : Int, init_tsn~ : UInt, cookie~ : Bytes)
    Sack(cum_tsn_ack~ : UInt, a_rwnd~ : UInt)
    Heartbeat(info~ : Bytes)
    HeartbeatAck(info~ : Bytes)
    Abort
    Shutdown(cum_tsn_ack~ : UInt)
    ShutdownAck
    CookieEcho(cookie~ : Bytes)
    CookieAck
    ForwardTsn(new_cum_tsn~ : UInt)
    } derive(Eq,
    Debug
    )

    Packet

    pub(all) struct Packet {
    src_port : Int
    dst_port : Int
    vtag : UInt
    chunks : Array[Chunk]
    } derive(Eq,
    Debug
    )

    Packet::decode

    fn Packet::decode(packet : BytesView) -> Packet raise SctpError

    Decode and verify an SCTP packet.

    Packet::encode

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

    Encode an SCTP packet with CRC32c Castagnoli checksum (RFC 4960 §6.8).

    ReceivedData

    pub(all) struct ReceivedData {
    stream_id : Int
    ppid : UInt
    payload : Bytes
    } derive(Eq,
    Debug
    )

    Source Files