webrtc_sctp_cookie (webrtc v0.1.0)

View Source

SCTP State Cookie (RFC 9260 §5.1.3, §5.1.5).

The cookie carries everything needed to build the association when the COOKIE ECHO arrives, so an endpoint answering an INIT keeps no state. It is authenticated with HMAC-SHA256 under a per association secret and holds its creation time and lifespan, in the caller's millisecond clock.

Summary

Types

fields/0

-type fields() ::
          #{my_tag := 0..4294967295,
            peer_tag := 0..4294967295,
            my_itsn := 0..4294967295,
            peer_itsn := 0..4294967295,
            peer_rwnd := 0..4294967295,
            peer_os := 0..65535,
            peer_mis := 0..65535,
            local_tie := 0..4294967295,
            peer_tie := 0..4294967295,
            created := integer(),
            life := 0..4294967295,
            features := #{atom() => boolean()}}.

Functions

make(F, Secret)

-spec make(fields(), binary()) -> binary().

open(Cookie, Secret)

-spec open(binary(), binary()) -> {ok, fields()} | {error, bad_cookie}.