Xirsys.XTurn.StunHelper (xturn v2.0.0)

Copy Markdown View Source

Encodes STUN indications for peer-to-client relay traffic.

What problem this solves

When no channel is bound, relayed peer data reaches the client as STUN indications (Data, ICMP error, or ConnectionAttempt). These are not request/response exchanges on the client socket, so they omit MESSAGE-INTEGRITY and FINGERPRINT. Encoding uses xmedialib.

Internal note

Called from DataPlane and allocation ICMP handling.

RFCs

Summary

Functions

Encodes a CONNECTION-ATTEMPT indication (RFC 6062) for peer_address.

Encodes a DATA indication carrying packet to peer_address.

Encodes a DATA indication with an embedded ICMP error attribute for peer_address.

Functions

connection_attempt_indication(peer_address, connection_id)

@spec connection_attempt_indication(
  {term(), term()},
  binary()
) :: binary()

Encodes a CONNECTION-ATTEMPT indication (RFC 6062) for peer_address.

data_indication(packet, peer_address)

@spec data_indication(
  binary(),
  {term(), term()}
) :: binary()

Encodes a DATA indication carrying packet to peer_address.

Uses a monotonic transaction-id counter so successive indications remain distinguishable in packet captures.

icmp_indication(peer_address, type, code, error_data)

@spec icmp_indication(
  {term(), term()},
  non_neg_integer(),
  non_neg_integer(),
  non_neg_integer()
) ::
  binary()

Encodes a DATA indication with an embedded ICMP error attribute for peer_address.