Skip to main content

Module candidate

Module candidate 

Source
Expand description

Candidates as the agent holds them: priority, foundation and base (RFC 8445 §5.1.1.3, §5.1.2.1, §7.1.1; spec §4, §5).

sipx_sdp::ice::Candidate is the a=candidate line. It is what crosses the wire and it knows nothing about which socket a check would leave from, because sipx-sdp owns no sockets. The two types here add exactly that: a LocalCandidate carries the LocalBase the driver bound, and a RemoteCandidate carries a foundation that a peer-reflexive candidate can also have — §7.3.1.3 gives one “an arbitrary value, different from the foundations of all other remote candidates”, which is not a value any a=candidate line ever supplied.

Structs§

CandidateIds
Allocates the identities of LocalCandidates and RemoteCandidates.
Foundations
Allocates foundations over the candidates as they are gathered (§5.1.1.3).
Gathered
A candidate the driver gathered, before the agent has priced it.
LocalBase
Which socket the driver bound, named so the agent never has to hold one.
LocalCandidate
A local candidate: what the driver gathered, plus what §5.1.1.3 and §5.1.2.1 make of it.
LocalFoundation
A local candidate’s foundation (§5.1.1.3).
LocalId
A local candidate’s identity.
PairFoundation
A candidate pair’s foundation: §6.1.2.6’s “combination of the foundations of the local and remote candidates in the pair”.
RemoteCandidate
A remote candidate: one the peer signalled, or one §7.3.1.3 learned from a check.
RemoteId
A remote candidate’s identity, allocated and stable — see LocalId.

Enums§

RemoteFoundation
A remote candidate’s foundation.

Constants§

HOST_PREFERENCE
Type preference for a host candidate (§5.1.2.2’s recommended value; spec §4).
MAX_TYPE_PREFERENCE
The largest type preference §5.1.2.1 admits: “an integer from 0 … to 126 … inclusive”.
PEER_REFLEXIVE_PREFERENCE
Type preference for a peer-reflexive candidate. §5.1.2.1 makes it a MUST that this is higher than the server-reflexive one, and it is the preference every PRIORITY attribute uses whatever the candidate actually is (§7.1.1, check_priority).
RELAYED_PREFERENCE
Type preference for a relayed candidate: last resort, because it costs a relay’s bandwidth.
SERVER_REFLEXIVE_PREFERENCE
Type preference for a server-reflexive candidate (§5.1.2.2’s recommended value).
SINGLE_ADDRESS_PREFERENCE
The local preference for a candidate that is the only one of its type for its component. §5.1.2.1: “When there is only a single IP address, this value SHOULD be set to 65535.”

Functions§

assign_local_preferences
Assign §5.1.2.1’s local preferences across a gathered set, and price every candidate.
check_priority
The PRIORITY a connectivity check carries (§7.1.1).
find_local
The local candidate with this identity, if it is still known.
find_remote
The remote candidate with this identity, if it is still known.
pair_priority
§6.1.2.3’s pair priority, with controlling the priority of the controlling agent’s candidate and controlled the controlled agent’s:
priority
§5.1.2.1’s formula, exactly as it is printed:
type_preference
§5.1.2.2’s recommended type preference for a candidate of this type (spec §4’s table).