#[non_exhaustive]pub struct HandshakeConfig {Show 13 fields
pub latency: Duration,
pub mtu: u32,
pub max_flow_window_size: u32,
pub initial_seq_number: u32,
pub srt_version: u32,
pub flags: HandshakeExtensionMessageFlags,
pub encryption_field: EncryptionField,
pub stream_id: Option<String>,
pub group: Option<GroupMembershipExtension>,
pub local_ip: [u32; 4],
pub retransmit_after: Duration,
pub max_retries: u32,
pub crypto: Option<CryptoConfig>,
}Expand description
Local configuration for one side of a Caller-Listener handshake — the
values this engine advertises (draft-sharabayko-srt-01 §3.2.1,
§3.2.1.1, §3.2.1.3, §3.2.1.4).
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.latency: DurationTSBPD delay this side requests, sent as both the Receiver and Sender TSBPD Delay of its Handshake Extension Message (§3.2.1.1, Figure 6), in whole milliseconds on the wire. The negotiated value is the greater of the two parties’ requests (§4.3.1.2).
mtu: u32Maximum Transmission Unit Size (§3.2.1).
max_flow_window_size: u32Maximum Flow Window Size (§3.2.1).
initial_seq_number: u32Initial Packet Sequence Number this side will use for its first data packet (§3.2.1). No data plane exists yet in this crate; callers of a later data-plane PR are expected to set this to a real ISN.
srt_version: u32The SRT Version this side reports in its Handshake Extension
Message (major * 0x10000 + minor * 0x100 + patch, §3.2.1.1).
flags: HandshakeExtensionMessageFlagsSRT Flags this side advertises (§3.2.1.1.1, Table 6).
encryption_field: EncryptionFieldAdvertised cipher family and block size (§3.2.1, Table 2). Actual key-wrap/unwrap crypto is an explicit follow-up; this field is negotiated but not acted on in this release.
stream_id: Option<String>Stream ID to advertise (Caller only — §3.2.1.3); None sends no
Stream ID extension.
group: Option<GroupMembershipExtension>Group Membership to advertise (§3.2.1.4); None sends no Group
extension.
local_ip: [u32; 4]This side’s own IP address, reported in every outgoing handshake
packet’s Peer IP Address field (§3.2.1: “IPv4 or IPv6 address of
the packet’s sender” — despite the field’s name, each party reports
its own address, not its peer’s).
retransmit_after: DurationLongest silence from the peer before the last-sent handshake packet is
retransmitted: a crate::caller::CallerHandshake::tick /
crate::listener::ListenerHandshake::tick call is the caller’s own
time step, and the engine resends once that much of it has passed with
no reply. No wall-clock lives in this crate.
max_retries: u32Maximum number of retransmissions before the handshake gives up
(HandshakeOutput::TimedOut).
crypto: Option<CryptoConfig>crypto only.Opt-in §6 payload-encryption negotiation (crypto feature only).
None (the default) means this side neither offers nor requires
encryption. See CryptoConfig for the caller-supplied Salt/SEK
contract.
Implementations§
Source§impl HandshakeConfig
impl HandshakeConfig
Sourcepub fn with_latency(self, latency: Duration) -> Self
pub fn with_latency(self, latency: Duration) -> Self
Sets latency.
Sourcepub fn with_max_flow_window_size(self, max_flow_window_size: u32) -> Self
pub fn with_max_flow_window_size(self, max_flow_window_size: u32) -> Self
Sets max_flow_window_size.
Sourcepub fn with_initial_seq_number(self, initial_seq_number: u32) -> Self
pub fn with_initial_seq_number(self, initial_seq_number: u32) -> Self
Sets initial_seq_number.
Sourcepub fn with_srt_version(self, srt_version: u32) -> Self
pub fn with_srt_version(self, srt_version: u32) -> Self
Sets srt_version.
Sourcepub fn with_flags(self, flags: HandshakeExtensionMessageFlags) -> Self
pub fn with_flags(self, flags: HandshakeExtensionMessageFlags) -> Self
Sets flags.
Sourcepub fn with_encryption_field(self, encryption_field: EncryptionField) -> Self
pub fn with_encryption_field(self, encryption_field: EncryptionField) -> Self
Sets encryption_field.
Sourcepub fn with_stream_id(self, stream_id: Option<String>) -> Self
pub fn with_stream_id(self, stream_id: Option<String>) -> Self
Sets stream_id.
Sourcepub fn with_group(self, group: Option<GroupMembershipExtension>) -> Self
pub fn with_group(self, group: Option<GroupMembershipExtension>) -> Self
Sets group.
Sourcepub fn with_local_ip(self, local_ip: [u32; 4]) -> Self
pub fn with_local_ip(self, local_ip: [u32; 4]) -> Self
Sets local_ip.
Sourcepub fn with_retransmit_after(self, retransmit_after: Duration) -> Self
pub fn with_retransmit_after(self, retransmit_after: Duration) -> Self
Sets retransmit_after.
Sourcepub fn with_max_retries(self, max_retries: u32) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
Sets max_retries.
Sourcepub fn with_crypto(self, crypto: Option<CryptoConfig>) -> Self
Available on crate feature crypto only.
pub fn with_crypto(self, crypto: Option<CryptoConfig>) -> Self
crypto only.Sets crypto.
Source§impl HandshakeConfig
impl HandshakeConfig
Sourcepub fn new(
latency: Duration,
mtu: u32,
max_flow_window_size: u32,
retransmit_after: Duration,
max_retries: u32,
) -> Self
pub fn new( latency: Duration, mtu: u32, max_flow_window_size: u32, retransmit_after: Duration, max_retries: u32, ) -> Self
A configuration advertising latency, mtu and max_flow_window_size, retransmitting
an unanswered handshake packet every retransmit_after and giving up after
max_retries retransmissions. Every number is the caller’s: the crate supplies none.
The rest starts as this crate’s feature set with no stream id, group or encryption.
Source§impl HandshakeConfig
impl HandshakeConfig
Sourcepub fn for_profile(profile: Profile) -> Self
pub fn for_profile(profile: Profile) -> Self
The Profile preset, built from this crate’s feature set with no
stream id, group or encryption, replaceable through its with_* setters.