pub struct ParserConfig {
pub enable_dpi: bool,
pub dpi_packet_limit: usize,
}Expand description
Configuration for packet parsing
§Example
ⓘ
// Create parser with custom DPI limit
let config = ParserConfig {
enable_dpi: true,
dpi_packet_limit: 5, // Only inspect first 5 packets per connection
};
let parser = PacketParser::with_config(config);
// In connection tracking code:
if config.should_perform_dpi(connection.packet_count) {
// Perform DPI on this packet
}Fields§
§enable_dpi: bool§dpi_packet_limit: usizeMaximum number of packets per connection to inspect with DPI
Use should_perform_dpi() method to check if DPI should be applied
Implementations§
Source§impl ParserConfig
impl ParserConfig
Sourcepub fn should_perform_dpi(&self, packet_count: usize) -> bool
pub fn should_perform_dpi(&self, packet_count: usize) -> bool
Check if DPI should be performed based on packet count Returns true if packet_count is less than dpi_packet_limit
Trait Implementations§
Source§impl Clone for ParserConfig
impl Clone for ParserConfig
Source§fn clone(&self) -> ParserConfig
fn clone(&self) -> ParserConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParserConfig
impl RefUnwindSafe for ParserConfig
impl Send for ParserConfig
impl Sync for ParserConfig
impl Unpin for ParserConfig
impl UnsafeUnpin for ParserConfig
impl UnwindSafe for ParserConfig
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