#[non_exhaustive]pub enum IncomingFilterOutcome {
Accept,
Retry,
Reject,
Ignore,
}Expand description
Verdict from a IncomingFilter for an incoming connection.
The filter can accept the connection, send a retry token to validate the source address, actively refuse the connection, or silently drop it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Accept
Accept the connection.
Retry
Tell the remote to retry with a token (a QUIC RETRY packet).
What this does depends on the connection type:
-
Direct (UDP) connections: this is QUIC source address validation. If the socket address was spoofed, the retry token is sent to the spoofed address, so we never hear from the attacker again. If the address was real, the client repeats the connection attempt with the token, and the next
Incomingfor that flow hasIncoming::remote_addr_validatedset totrue. The token is bound to the source address. -
Relay connections: there is no source address to validate (the relay already vouches for the packet origin), so the “validation” itself has no security meaning. However, the retry still imposes a real cost on the client: an extra round trip through the relay plus the work of sending a fresh ClientHello with the token. This filters out adversarial clients that don’t bother to handle retry tokens, and adds latency before we get to the more expensive part of the handshake. The next
Incomingfor that flow will also haveIncoming::remote_addr_validatedset totrue, but again, that just means the client cooperated with the retry.
In short: for direct connections, Retry is address validation;
for relay connections, it is a cost-imposition mechanism.
Reject
Actively refuse the connection. The remote will receive a CONNECTION_REFUSED error immediately.
Ignore
Ignore the connection entirely. The remote gets no response and will eventually time out.
Trait Implementations§
Source§impl Clone for IncomingFilterOutcome
impl Clone for IncomingFilterOutcome
Source§fn clone(&self) -> IncomingFilterOutcome
fn clone(&self) -> IncomingFilterOutcome
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IncomingFilterOutcome
impl Debug for IncomingFilterOutcome
Source§impl PartialEq for IncomingFilterOutcome
impl PartialEq for IncomingFilterOutcome
impl Copy for IncomingFilterOutcome
impl Eq for IncomingFilterOutcome
impl StructuralPartialEq for IncomingFilterOutcome
Auto Trait Implementations§
impl Freeze for IncomingFilterOutcome
impl RefUnwindSafe for IncomingFilterOutcome
impl Send for IncomingFilterOutcome
impl Sync for IncomingFilterOutcome
impl Unpin for IncomingFilterOutcome
impl UnwindSafe for IncomingFilterOutcome
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more