Xirsys.Sockets.Sctp.Dcep (xturn_sockets v2.2.1)

View Source

Data Channel Establishment Protocol (DCEP) encode and decode.

What problem this solves

WebRTC data channels negotiate labels, ordering, and reliability with DCEP messages on SCTP PPI 50 before user data flows. This module parses and builds DCEP Open and Ack payloads used by SctpAssociation.

RFCs

  • RFC 8832 - DCEP (Open, Ack wire format)
  • RFC 8831 - WebRTC data channels (SCTP usage)

Summary

Functions

Decodes a DCEP message from an SCTP user message body (after the type byte).

Encodes a DCEP struct (Ack or Open) to wire bytes.

Functions

decode(arg1)

@spec decode(binary()) ::
  {:ok, Xirsys.Sockets.Sctp.Dcep.Ack.t() | Xirsys.Sockets.Sctp.Dcep.Open.t()}
  | :error

Decodes a DCEP message from an SCTP user message body (after the type byte).

Returns {:ok, %Ack{}} or {:ok, %Open{}}, or :error on malformed input.

encode(msg)

@spec encode(Xirsys.Sockets.Sctp.Dcep.Ack.t() | Xirsys.Sockets.Sctp.Dcep.Open.t()) ::
  binary()

Encodes a DCEP struct (Ack or Open) to wire bytes.