pub enum Setup {
Active,
Passive,
ActPass,
HoldConn,
}Expand description
Who opens the DTLS connection (RFC 4145 §4, used by RFC 5763 §5).
Variants§
Active
This endpoint will start the handshake — the DTLS client.
Passive
This endpoint will wait for it — the DTLS server.
ActPass
Either; the answerer chooses. RFC 5763 §5 requires an offerer to use this.
HoldConn
No connection is to be formed, for an offer that is only describing a stream.
Implementations§
Source§impl Setup
impl Setup
Sourcepub fn answer(offered: Self) -> Self
pub fn answer(offered: Self) -> Self
The role to answer an offered one with (RFC 4145 §4.1).
actpass is answered active, which is RFC 5763 §5’s recommendation and not merely a
preference: the answerer starting the handshake means the offerer does not have to send
packets to an address it has only just learned, which is what gets a DTLS ClientHello
through a NAT the answerer sits behind.
holdconn is answered holdconn: §4.1 gives no other legal answer, and answering with a
role would be agreeing to a connection the offerer said not to form.