pub struct AllocateOptions {
pub transport: RelayTransport,
pub address_family: Option<RequestedAddressFamily>,
pub additional_ipv6: bool,
pub lifetime: Option<Duration>,
pub dont_fragment: bool,
pub even_port: Option<EvenPort>,
pub reservation_token: Option<ReservationToken>,
}Expand description
What an Allocate request asks for beyond a UDP relayed address (RFC 8656 §7.1).
The default asks for nothing more: one relayed address, IPv4 unless the server decides otherwise, for the server’s default lifetime.
The RFC forbids some combinations, and Client::allocate_with refuses them before
anything is sent: address_family with additional_ipv6 or reservation_token;
additional_ipv6 with reservation_token or with an even_port that reserves the next
port; reservation_token with even_port.
A TCP allocation (RelayTransport::Tcp, RFC 6062 §4.1) takes none of dont_fragment,
even_port and reservation_token, and cannot be asked for over UDP.
Fields§
§transport: RelayTransportREQUESTED-TRANSPORT: what the allocation relays, UDP datagrams by default.
address_family: Option<RequestedAddressFamily>REQUESTED-ADDRESS-FAMILY: the family of the one relayed address, for example
REQUESTED_FAMILY_IPV6 for an IPv6 relayed address.
additional_ipv6: boolADDITIONAL-ADDRESS-FAMILY: an IPv6 relayed address beside the IPv4 one. The server
may give only one of the two; Relay::address_error then says
why.
lifetime: Option<Duration>LIFETIME: how long the allocation should last without a refresh. A hint; the server answers with what it grants, which the client then goes by.
dont_fragment: boolDONT-FRAGMENT, to find out whether the server supports it and so whether
Relay::send_to_dont_fragment can be
used. A server that does not know the attribute answers 420; the client then makes
the request again without it.
even_port: Option<EvenPort>EVEN-PORT: an even relayed port, and with reserve_port the next port held for a
later allocation, which the response’s RESERVATION-TOKEN names.
reservation_token: Option<ReservationToken>RESERVATION-TOKEN: use the port a previous allocation reserved.