moonbitstack/moonrtc/ice does not have a README file

    Agent

    pub struct Agent {
    role : Role
    local_creds :
    IceCreds

    remote_creds :
    IceCreds
    ?
    tie_breaker : UInt64
    local_candidates : Array[Candidate]
    remote_candidates : Array[Candidate]
    pairs : Array[CandidatePair]
    state : IceState
    }

    Agent::add_local_candidate

    fn Agent::add_local_candidate(self : Agent, cand : Candidate) -> Unit

    Agent::add_remote_candidate

    fn Agent::add_remote_candidate(self : Agent, cand : Candidate) -> Unit

    Agent::build_check

    fn Agent::build_check(self : Agent, idx : Int, tx_id : Bytes, nominate? : Bool) -> Bytes?

    Build a STUN Binding Request for connectivity checking on pair idx.

    Agent::handle_stun

    fn Agent::handle_stun(self : Agent, packet : BytesView, from :
    AddrPort
    ) -> Bytes?

    Handle an incoming STUN connectivity check packet from from. Returns an encoded STUN Binding SuccessResponse if the packet was a valid Request.

    Agent::new

    fn Agent::new(role : Role, local_creds :
    IceCreds
    , tie_breaker? : UInt64) -> Agent

    Agent::selected_pair

    fn Agent::selected_pair(self : Agent) -> CandidatePair?

    Agent::set_remote_creds

    fn Agent::set_remote_creds(self : Agent, creds :
    IceCreds
    ) -> Unit

    Candidate

    pub(all) struct Candidate {
    foundation : String
    component : Int
    addr :
    AddrPort

    typ : CandidateType
    priority : UInt
    } derive(Eq,
    Debug
    )

    CandidatePair

    pub(all) struct CandidatePair {
    local_cand : Candidate
    remote_cand : Candidate
    priority : UInt64
    state : PairState
    nominated : Bool
    } derive(Eq,
    Debug
    )

    CandidateType

    pub(all) enum CandidateType {
    Host
    Srflx
    Prflx
    Relay
    } derive(Eq,
    Debug
    )

    IceState

    pub(all) enum IceState {
    New
    Checking
    Connected
    Completed
    Failed
    } derive(Eq,
    Debug
    )

    PairState

    pub(all) enum PairState {
    Waiting
    InProgress
    Succeeded
    Failed
    } derive(Eq,
    Debug
    )

    Role

    pub(all) enum Role {
    Controlling
    Controlled
    } derive(Eq,
    Debug
    )

    candidate_priority

    fn candidate_priority(typ : CandidateType, local_pref? : UInt, component? : Int) -> UInt

    RFC 8445 §5.1.2.1 candidate priority calculation.

    pair_priority

    fn pair_priority(controlling_prio : UInt, controlled_prio : UInt) -> UInt64

    RFC 8445 §6.1.2.3 candidate pair priority calculation.

    Source Files