pub struct FiveTuple {
pub proto: u8,
pub src: IpAddr,
pub dst: IpAddr,
pub src_port: u16,
pub dst_port: u16,
}Expand description
Network 5-tuple: layer 4 protocol (e.g TCP or UDP), source and destination IP/ports
Fields§
§proto: u8Layer 4 protocol (e.g TCP, UDP, ICMP)
src: IpAddrSource IP address
dst: IpAddrDestination IP address
src_port: u16Source port. 0 if not relevant for protocol
dst_port: u16Destination port. 0 if not relevant for protocol
Implementations§
Source§impl FiveTuple
impl FiveTuple
Sourcepub fn from_three_tuple(t3: &ThreeTuple, src_port: u16, dst_port: u16) -> Self
pub fn from_three_tuple(t3: &ThreeTuple, src_port: u16, dst_port: u16) -> Self
Creates a FiveTuple from a ThreeTuple, the source/destination ports
Sourcepub fn get_reverse(&self) -> FiveTuple
pub fn get_reverse(&self) -> FiveTuple
Returns the opposite FiveTuple (swaps IP addresses, and ports)
Trait Implementations§
Source§impl Ord for FiveTuple
impl Ord for FiveTuple
Source§impl PartialOrd for FiveTuple
impl PartialOrd for FiveTuple
impl Eq for FiveTuple
impl StructuralPartialEq for FiveTuple
Auto Trait Implementations§
impl Freeze for FiveTuple
impl RefUnwindSafe for FiveTuple
impl Send for FiveTuple
impl Sync for FiveTuple
impl Unpin for FiveTuple
impl UnwindSafe for FiveTuple
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