pub struct ServerConfig {
pub transport: Arc<TransportConfig>,
/* private fields */
}Expand description
Parameters governing incoming associations
Default values should be suitable for most internet applications.
Fields§
§transport: Arc<TransportConfig>Transport configuration to use for incoming associations
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn new(transport: TransportConfig) -> Self
pub fn new(transport: TransportConfig) -> Self
Create a default configuration with a particular handshake token key
Gives the endpoint a crypto provider to authenticate State Cookies with, and makes the handshake stateless on the accepting side, as RFC 9260 sections 5.1 and 5.1.3 have it.
With a provider, the State Cookie of an INIT ACK holds everything the association is
made from, the time it was made, and an HMAC-SHA-256 over them under a random key of
the endpoint’s (replaced every hour). The endpoint answers an INIT and keeps nothing:
Endpoint::handle returns None for it and the INIT ACK
leaves by Endpoint::poll_transmit. The
association is made, and returned as
DatagramEvent::NewAssociation, when a
COOKIE ECHO brings back a cookie whose MAC verifies and which is no older than
TransportConfig::with_valid_cookie_life; it is established at once.
Without a provider (the default) the cookie is 32 random bytes and the endpoint makes
the association when the INIT arrives, remembering the cookie to compare it with the
one echoed. rtci-sctp names no cryptographic implementation of its own, so the MAC
is there only when the application supplies the provider.
Sourcepub fn concurrent_associations(&mut self, value: u32) -> &mut Self
pub fn concurrent_associations(&mut self, value: u32) -> &mut Self
Maximum number of associations the endpoint holds at once. An INIT that would start one more is refused.
A transport that carries a single association, such as WebRTC’s SCTP over one DTLS transport (RFC 8261), should set this to 1.