pub struct TcpFlagsFilter {
pub mask: u8,
pub value: u8,
pub exact: bool,
}Expand description
TCP control-flags filter.
The mask field selects which bits are tested; value is the expected
result of flags & mask.
- any mode (default): at least one bit in
maskmust be set —(flags & mask) != 0. - exact mode (append
:exactto the flag string): all bits inmaskmust equalvalue—(flags & mask) == value.
Fields§
§mask: u8Bitmask of flags to test.
value: u8Expected value under mask (used in exact mode).
exact: boolWhen true, require (flags & mask) == value; otherwise != 0.
Implementations§
Source§impl TcpFlagsFilter
impl TcpFlagsFilter
Sourcepub fn parse(s: &str) -> Result<Self, FilterError>
pub fn parse(s: &str) -> Result<Self, FilterError>
Parse a flag specification string.
Flags are joined with +: "SYN", "SYN+ACK", "RST+FIN".
Append :exact for exact-match mode (default: any).
Known flag names (case-insensitive): FIN, SYN, RST, PSH,
ACK, URG, ECE, CWR.
§Errors
Returns FilterError::InvalidTcpFlags for unknown names or an
empty specification.
Trait Implementations§
Source§impl Clone for TcpFlagsFilter
impl Clone for TcpFlagsFilter
Source§fn clone(&self) -> TcpFlagsFilter
fn clone(&self) -> TcpFlagsFilter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TcpFlagsFilter
impl Debug for TcpFlagsFilter
Source§impl PartialEq for TcpFlagsFilter
impl PartialEq for TcpFlagsFilter
Source§fn eq(&self, other: &TcpFlagsFilter) -> bool
fn eq(&self, other: &TcpFlagsFilter) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for TcpFlagsFilter
impl Eq for TcpFlagsFilter
impl StructuralPartialEq for TcpFlagsFilter
Auto Trait Implementations§
impl Freeze for TcpFlagsFilter
impl RefUnwindSafe for TcpFlagsFilter
impl Send for TcpFlagsFilter
impl Sync for TcpFlagsFilter
impl Unpin for TcpFlagsFilter
impl UnsafeUnpin for TcpFlagsFilter
impl UnwindSafe for TcpFlagsFilter
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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