pub struct TupleV4 {
pub src_ip: Ipv4Addr,
pub dst_ip: Ipv4Addr,
pub src_port: u16,
pub dst_port: u16,
pub protocol: IpProto,
pub vni: VniId,
}Expand description
IPv4 5-tuple flow with VNI support
This tuple uniquely identifies a network flow using:
- Source and destination IPv4 addresses
- Source and destination ports
- IP protocol number
- Virtual Network Identifier (VNI) for tunnel-aware flow tracking
Fields§
§src_ip: Ipv4Addr§dst_ip: Ipv4Addr§src_port: u16§dst_port: u16§protocol: IpProto§vni: VniIdImplementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TupleV4
impl<'de> Deserialize<'de> for TupleV4
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Tuple for TupleV4
impl Tuple for TupleV4
type Addr = Ipv4Addr
Source§fn source_port(&self) -> u16
fn source_port(&self) -> u16
Returns the source port of the flow tuple.
Source§fn from_packet(pkt: &Packet<'_>, vni_mapper: &mut VniMapper) -> Option<Self>
fn from_packet(pkt: &Packet<'_>, vni_mapper: &mut VniMapper) -> Option<Self>
Create a new flow tuple from a packet
Source§fn hash_canonical<H: Hasher>(&self, state: &mut H)
fn hash_canonical<H: Hasher>(&self, state: &mut H)
Hashes the tuple in a canonical (symmetric) way without creating a new instance.
Used by
Symmetric wrapper to ensure Hash(A->B) == Hash(B->A).Source§fn eq_canonical(&self, other: &Self) -> bool
fn eq_canonical(&self, other: &Self) -> bool
Checks equality in a canonical (symmetric) way without creating a new instance.
Used by
Symmetric wrapper to ensure Eq(A->B, B->A).Source§fn is_symmetric(&self) -> bool
fn is_symmetric(&self) -> bool
Checks if the tuple is symmetric (source equals destination). Read more
impl Copy for TupleV4
impl Eq for TupleV4
impl StructuralPartialEq for TupleV4
Auto Trait Implementations§
impl Freeze for TupleV4
impl RefUnwindSafe for TupleV4
impl Send for TupleV4
impl Sync for TupleV4
impl Unpin for TupleV4
impl UnwindSafe for TupleV4
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