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

VxlanOverlay

Struct VxlanOverlay 

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

VXLAN overlay network manager.

Implementations§

Source§

impl VxlanOverlay

Source

pub const DEFAULT_FDB_AGE: u64 = 300u64

Default FDB aging timeout: 300 ticks (5 minutes at 1 tick/sec).

Source

pub fn new() -> Self

Create a new VXLAN overlay manager.

Source

pub fn add_tunnel(&mut self, tunnel: VxlanTunnel) -> Result<(), VxlanError>

Add a tunnel.

Source

pub fn remove_tunnel(&mut self, vni: u32) -> Result<(), VxlanError>

Remove a tunnel.

Source

pub fn get_tunnel(&self, vni: u32) -> Option<&VxlanTunnel>

Get a tunnel by VNI.

Source

pub fn encapsulate( &self, vni: u32, inner_frame: &[u8], ) -> Result<Vec<u8>, VxlanError>

Encapsulate a frame in a VXLAN header.

Returns the VXLAN-encapsulated packet (header + original frame).

Source

pub fn decapsulate(&self, packet: &[u8]) -> Result<(u32, Vec<u8>), VxlanError>

Decapsulate a VXLAN packet.

Returns (VNI, inner frame).

Source

pub fn fdb_learn(&mut self, mac: MacAddress, vtep_ip: u32, current_tick: u64)

Learn a MAC address from an incoming frame.

Source

pub fn fdb_add_static(&mut self, mac: MacAddress, vtep_ip: u32)

Add a static FDB entry.

Source

pub fn fdb_lookup(&self, mac: &MacAddress) -> Option<&FdbEntry>

Look up a MAC address in the FDB.

Source

pub fn fdb_age(&mut self, current_tick: u64) -> usize

Remove aged-out FDB entries.

Source

pub fn arp_proxy_add(&mut self, ip: u32, mac: MacAddress, vtep_ip: u32)

Add an ARP proxy entry.

Source

pub fn arp_proxy(&self, target_ip: u32) -> Option<MacAddress>

Respond to an ARP request for a remote container.

Returns the MAC address if we can proxy-respond.

Source

pub fn tunnel_count(&self) -> usize

Get tunnel count.

Source

pub fn fdb_count(&self) -> usize

Get FDB entry count.

Trait Implementations§

Source§

impl Debug for VxlanOverlay

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VxlanOverlay

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for VxlanOverlay

§

impl RefUnwindSafe for VxlanOverlay

§

impl Send for VxlanOverlay

§

impl Sync for VxlanOverlay

§

impl Unpin for VxlanOverlay

§

impl UnwindSafe for VxlanOverlay

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.