Expand description
TCP stream processing and application-layer parsing.
This module provides TCP connection tracking and stream reassembly, enabling parsing of application-layer protocols that span multiple packets.
§Components
ConnectionTracker- Tracks TCP connections via 3-way handshakeTcpReassembler- Reassembles TCP segments into ordered byte streamsStreamManager- Coordinates tracking, reassembly, and parsingStreamParser- Trait for application-layer parsers (HTTP, TLS)StreamRegistry- Registry of stream parsers
§Built-in Stream Parsers
- HTTP (request/response parsing)
- TLS (handshake analysis, SNI extraction)
§Example
use pcapsql_core::stream::{StreamManager, StreamConfig};
let config = StreamConfig::default();
let mut manager = StreamManager::new(config);
// Process TCP segments from packets...
// manager.process_segment(...);Re-exports§
pub use parsers::DecryptingTlsStreamParser;pub use parsers::Http2StreamParser;pub use parsers::HttpStreamParser;pub use parsers::TlsStreamParser;
Modules§
- parsers
- Stream protocol parsers.
Structs§
- Connection
- A tracked TCP connection.
- Connection
Key - Normalized connection key (lower IP/port first for consistent lookup).
- Connection
Tracker - Tracks TCP connections.
- Parsed
Message - A parsed application-layer message.
- Segment
- A TCP segment waiting to be reassembled.
- Sequence
Gap - A gap in the sequence space (missing data).
- Stream
Buffer - Buffer for one direction of a TCP stream.
- Stream
Config - Configuration for the StreamManager.
- Stream
Context - Context for stream parsing.
- Stream
Key - Key for stream buffer lookup.
- Stream
Manager - Central orchestrator for TCP stream processing.
- Stream
Registry - Registry of available stream parsers.
- Stream
Stats - Stream statistics.
- TcpFlags
- TCP flags for state transitions.
- TcpReassembler
- TCP stream reassembler.
Enums§
- Connection
State - TCP connection state (simplified state machine).
- Direction
- Direction of data flow in a TCP connection.
- Stream
Parse Result - Result of stream parsing.
Traits§
- Stream
Parser - Trait for parsing application protocols from reassembled streams.