⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

ConntrackTable

Struct ConntrackTable 

Source
pub struct ConntrackTable { /* private fields */ }
Expand description

Connection tracking table managing all active connections

Implementations§

Source§

impl ConntrackTable

Source

pub fn new() -> Self

Create a new connection tracking table

Source

pub fn with_max_entries(max: usize) -> Self

Create with a custom maximum entry count

Source

pub fn tick(&mut self)

Advance the tick counter

Source

pub fn set_tick(&mut self, tick: u64)

Set the current tick counter

Source

pub fn entry_count(&self) -> usize

Number of active entries

Source

pub fn lookup(&self, key: &ConntrackKey) -> Option<&ConntrackEntry>

Look up an entry by key

Source

pub fn lookup_mut(&mut self, key: &ConntrackKey) -> Option<&mut ConntrackEntry>

Look up an entry mutably

Source

pub fn track_packet( &mut self, key: ConntrackKey, bytes: u64, tcp_flags: u8, ) -> ConntrackState

Insert or update a connection tracking entry

Returns the classified state for this packet.

Source

pub fn remove(&mut self, key: &ConntrackKey) -> Option<ConntrackEntry>

Remove an entry by key

Source

pub fn gc(&mut self) -> usize

Garbage collect expired entries

Source

pub fn classify_packet(&self, key: &ConntrackKey) -> ConntrackState

Classify a packet based on existing connection state

Source

pub fn stats(&self) -> ConntrackStats

Get statistics

Trait Implementations§

Source§

impl Default for ConntrackTable

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for ConntrackTable

§

impl RefUnwindSafe for ConntrackTable

§

impl Send for ConntrackTable

§

impl Sync for ConntrackTable

§

impl Unpin for ConntrackTable

§

impl UnwindSafe for ConntrackTable

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.