pub struct IcmpFlowState {
pub icmp_type: u8,
pub icmp_code: u8,
pub identifier: Option<u16>,
pub request_count: u64,
pub reply_count: u64,
pub last_seq: Option<u16>,
pub status: ConversationStatus,
}Expand description
ICMP/ICMPv6 conversation state.
Tracks ICMP-specific metadata for echo request/reply pairs and other ICMP types. Echo requests and replies are correlated using the ICMP identifier field.
Fields§
§icmp_type: u8ICMP type (e.g., 8 for Echo Request, 0 for Echo Reply).
icmp_code: u8ICMP code.
identifier: Option<u16>ICMP identifier (for echo, timestamp, and other types that use it).
request_count: u64Number of echo requests (type 8 for ICMP, 128 for ICMPv6).
reply_count: u64Number of echo replies (type 0 for ICMP, 129 for ICMPv6).
last_seq: Option<u16>Last sequence number seen in an echo packet.
status: ConversationStatusConversation status.
Implementations§
Source§impl IcmpFlowState
impl IcmpFlowState
pub fn new(icmp_type: u8, icmp_code: u8) -> Self
Sourcepub fn process_packet(
&mut self,
packet: &Packet,
buf: &[u8],
icmp_type: u8,
icmp_code: u8,
)
pub fn process_packet( &mut self, packet: &Packet, buf: &[u8], icmp_type: u8, icmp_code: u8, )
Update state when a new ICMP packet is received.
Increments request or reply count based on ICMP type, and updates the identifier and sequence number fields if present.
Sourcepub fn check_timeout(
&self,
last_seen: Duration,
now: Duration,
config: &FlowConfig,
) -> bool
pub fn check_timeout( &self, last_seen: Duration, now: Duration, config: &FlowConfig, ) -> bool
Check whether this flow has timed out.
Trait Implementations§
Source§impl Clone for IcmpFlowState
impl Clone for IcmpFlowState
Source§fn clone(&self) -> IcmpFlowState
fn clone(&self) -> IcmpFlowState
Returns a duplicate of the value. Read more
1.0.0 · 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 IcmpFlowState
impl Debug for IcmpFlowState
Auto Trait Implementations§
impl Freeze for IcmpFlowState
impl RefUnwindSafe for IcmpFlowState
impl Send for IcmpFlowState
impl Sync for IcmpFlowState
impl Unpin for IcmpFlowState
impl UnsafeUnpin for IcmpFlowState
impl UnwindSafe for IcmpFlowState
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