#[non_exhaustive]pub struct CallerParams {Show 13 fields
pub handshake: HandshakeConfig,
pub own_socket_id: u32,
pub initial_seq_number: u32,
pub timers: LinkTimers,
pub arq: ArqBounds,
pub key_refresh_seed: Zeroizing<Vec<u8>>,
pub payload_admits: fn(&[u8]) -> bool,
pub damage_policy: DamagePolicy,
pub drift_us: i64,
pub drift_window: NonZeroU32,
pub max_bw: MaxBwConfig,
pub km_refresh_thresholds: KmRefreshThresholds,
pub refuse_cleartext: bool,
}link only.Expand description
What a CallerLink is configured by: the handshake this side advertises, the connection’s
own Socket ID and initial sequence number, its time bounds, and what the link may assume about
the stream it delivers.
The caller supplies the Socket ID and the ISN; a link never draws them itself, so a host that reads no randomness (or derives them from a seed it keeps) can still open a connection.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.handshake: HandshakeConfigThe handshake this side advertises (latency, stream id, encryption).
own_socket_id: u32This caller’s own SRT Socket ID (§3).
initial_seq_number: u32This caller’s initial sequence number: the first sequence number it sends (§3.1).
timers: LinkTimersThe link’s time bounds.
arq: ArqBoundsThe ARQ receiver’s and sender’s bounds.
key_refresh_seed: Zeroizing<Vec<u8>>Secret entropy the link derives every refreshed stream key from; it draws none itself. A
refresh that cannot be derived (an empty seed) is counted in
LinkCounts::key_refresh_failed and reported as damage, never skipped silently.
payload_admits: fn(&[u8]) -> boolA synchronous check on each delivered payload: one it refuses is counted and reported, and
never delivered. The host names the payload format it expects; the link imposes none, so a
link built with CallerParams::new admits every payload.
damage_policy: DamagePolicyThe caller’s decision about each damage report.
drift_us: i64Initial TSBPD drift. The scheduler estimates it from there; zero when none is known.
drift_window: NonZeroU32Fresh in-sequence packets per drift-sampling window (§4.7, rules 26-27). The draft names no count, so the caller supplies one.
max_bw: MaxBwConfigThe LiveCC bandwidth policy that paces DATA packets (§5.1.1).
km_refresh_thresholds: KmRefreshThresholdsKM Refresh thresholds (§6.1.6, key rotation packet counts).
refuse_cleartext: boolWhether a connection that negotiated encryption refuses a DATA packet sent in the clear, counting it undecryptable, rather than delivering it.
Implementations§
Source§impl CallerParams
impl CallerParams
Sourcepub fn new(
handshake: HandshakeConfig,
own_socket_id: u32,
initial_seq_number: u32,
timers: LinkTimers,
arq: ArqBounds,
key_refresh_seed: Vec<u8>,
drift_window: NonZeroU32,
) -> Self
pub fn new( handshake: HandshakeConfig, own_socket_id: u32, initial_seq_number: u32, timers: LinkTimers, arq: ArqBounds, key_refresh_seed: Vec<u8>, drift_window: NonZeroU32, ) -> Self
Parameters advertising handshake with this side’s Socket ID and ISN, the caller’s time
bounds and key-refresh entropy, DamagePolicy::default (report everything), the default
LiveCC policy and a link that admits every delivered payload.
Sourcepub fn with_handshake_timeout(self, handshake_timeout: Duration) -> Self
pub fn with_handshake_timeout(self, handshake_timeout: Duration) -> Self
Set how long the handshake may take.
Sourcepub fn with_payload_admits(self, payload_admits: fn(&[u8]) -> bool) -> Self
pub fn with_payload_admits(self, payload_admits: fn(&[u8]) -> bool) -> Self
Set which payloads the link delivers (see CallerParams::payload_admits).
Sourcepub fn with_damage_policy(self, damage_policy: DamagePolicy) -> Self
pub fn with_damage_policy(self, damage_policy: DamagePolicy) -> Self
Set the caller’s decision about each damage report.
Sourcepub fn with_drift_us(self, drift_us: i64) -> Self
pub fn with_drift_us(self, drift_us: i64) -> Self
Set the initial TSBPD drift.
Sourcepub fn with_max_bw(self, max_bw: MaxBwConfig) -> Self
pub fn with_max_bw(self, max_bw: MaxBwConfig) -> Self
Set the LiveCC bandwidth policy.
Sourcepub fn with_read_idle(self, read_idle: Duration) -> Self
pub fn with_read_idle(self, read_idle: Duration) -> Self
Set the peer-idle bound.
Sourcepub fn with_passphrase(self, passphrase: Vec<u8>) -> Self
pub fn with_passphrase(self, passphrase: Vec<u8>) -> Self
Set the §6 passphrase a peer’s Key Material is recovered with. The encryption
field this side advertises still comes from handshake (its CryptoConfig
salt and stream key are overwritten per attempt).
Sourcepub fn with_cleartext_refused(self) -> Self
pub fn with_cleartext_refused(self) -> Self
Refuse cleartext DATA on a connection that negotiated encryption (see
CallerParams::refuse_cleartext).
Sourcepub fn with_km_refresh_thresholds(self, thresholds: KmRefreshThresholds) -> Self
pub fn with_km_refresh_thresholds(self, thresholds: KmRefreshThresholds) -> Self
Set the KM Refresh thresholds.