pub struct ConversationTable { /* private fields */ }Expand description
Thread-safe conversation tracking table backed by DashMap.
Supports concurrent packet ingestion from multiple threads while maintaining per-conversation state including TCP state machines and stream reassembly.
Implementations§
Source§impl ConversationTable
impl ConversationTable
Sourcepub fn new(config: FlowConfig) -> Self
pub fn new(config: FlowConfig) -> Self
Create a new table with the given configuration.
Sourcepub fn with_default_config() -> Self
pub fn with_default_config() -> Self
Create a new table with default configuration.
Sourcepub fn conversation_count(&self) -> usize
pub fn conversation_count(&self) -> usize
Number of tracked conversations.
Sourcepub fn ingest_packet(
&self,
packet: &Packet,
timestamp: Duration,
packet_index: usize,
) -> Result<(), FlowError>
pub fn ingest_packet( &self, packet: &Packet, timestamp: Duration, packet_index: usize, ) -> Result<(), FlowError>
Ingest a single parsed packet, updating or creating conversation state.
timestamp is the packet capture timestamp (from PCAP metadata).
packet_index is the index of this packet in the original capture
(used for cross-referencing).
Sourcepub fn get_conversation(
&self,
key: &CanonicalKey,
) -> Option<Ref<'_, CanonicalKey, ConversationState>>
pub fn get_conversation( &self, key: &CanonicalKey, ) -> Option<Ref<'_, CanonicalKey, ConversationState>>
Get a read reference to a specific conversation.
Sourcepub fn evict_idle(&self, now: Duration) -> usize
pub fn evict_idle(&self, now: Duration) -> usize
Evict conversations that have exceeded their idle timeout.
Returns the number of evicted conversations.
Sourcepub fn into_conversations(self) -> Vec<ConversationState>
pub fn into_conversations(self) -> Vec<ConversationState>
Consume the table and return all conversations sorted by start time.
Sourcepub fn config(&self) -> &FlowConfig
pub fn config(&self) -> &FlowConfig
Get a reference to the configuration.