ETS index of active TURN allocations and relay ingress rows.
What problem this solves
Control handlers, the data plane, and relay ingress must find the allocation
process, client socket, and channel map quickly from a transaction id, client
five-tuple, or inbound relay {ip, port}. This store holds those mappings
and publishes relay socket rows for peer-to-client forwarding.
Internal note
Initialised at application start; rows are inserted/deleted by Allocate.Client.
RFCs
Summary
Functions
Deletes an allocation or raw ETS row.
When key is a transaction id, unpublishes relay rows and removes the
{:tuple5, _} secondary index. Any other key is deleted directly.
Returns true when lookup/1 would succeed for criteria.
Creates the public allocation ETS table.
Inserts a new allocation under tid and indexes it by normalized tuple5.
Returns :ok.
Looks up an allocation by one of:
- transaction id (
tid) -{:ok, pid, socket, perms} - normalized five-tuple list -
{:ok, [pid, relay, socket, perms]} - relay
{ip, port}-{:ok, [pid, tuple5, socket, perms]}
Returns {:error, :not_found} when no match exists.