pub struct EndpointConfig { /* private fields */ }Expand description
Global configuration for the endpoint, affecting all associations
Default values should be suitable for most internet applications.
Implementations§
Source§impl EndpointConfig
impl EndpointConfig
Sourcepub fn random_source(
&mut self,
provider: Arc<dyn RTCCryptoProvider>,
) -> &mut Self
pub fn random_source( &mut self, provider: Arc<dyn RTCCryptoProvider>, ) -> &mut Self
Draws every random value of the endpoint and its associations from provider’s
random(): the verification tags (with the default generator, which this replaces;
set Self::aid_generator after this call for another), the initial TSNs, the State
Cookies made without ServerConfig::cookie_authentication, the Initiate Tag of an
INIT ACK for an existing association, HEARTBEAT nonces and the HEARTBEAT timer’s
jitter.
Without it (the default) they come from rand’s thread-local CSPRNG. This is how the
other crates of the workspace take their randomness (docs/randomness-audit.md), and
what lets a test that seeds the provider replay a run exactly.
Sourcepub fn aid_generator<F: Fn() -> Box<dyn AssociationIdGenerator + Send> + Send + Sync + 'static>(
&mut self,
factory: F,
) -> &mut Self
pub fn aid_generator<F: Fn() -> Box<dyn AssociationIdGenerator + Send> + Send + Sync + 'static>( &mut self, factory: F, ) -> &mut Self
Supply a custom Association ID generator factory
Called once by each Endpoint constructed from this configuration to obtain the AID
generator which will be used to generate the AIDs used for incoming packets on all
associations involving that Endpoint. A custom AID generator allows applications to embed
information in local association IDs, e.g. to support stateless packet-level load balancers.
EndpointConfig::new() applies a default random AID generator factory. This functions
accepts any customized AID generator to reset AID generator factory that implements
the AssociationIdGenerator trait.
Sourcepub fn max_payload_size(&mut self, value: u32) -> &mut Self
pub fn max_payload_size(&mut self, value: u32) -> &mut Self
Maximum payload size accepted from peers.
The default is suitable for typical internet applications. Applications which expect to run on networks supporting Ethernet jumbo frames or similar should set this appropriately.
Sourcepub fn get_max_payload_size(&self) -> u32
pub fn get_max_payload_size(&self) -> u32
Get the current value of max_payload_size
While most parameters don’t need to be readable, this must be exposed to allow higher-level
layers to determine how large a receive buffer to allocate to
support an externally-defined EndpointConfig.
While get_ accessors are typically unidiomatic in Rust, we favor concision for setters,
which will be used far more heavily.