pub struct VxlanOverlay { /* private fields */ }Expand description
VXLAN overlay network manager.
Implementations§
Source§impl VxlanOverlay
impl VxlanOverlay
Sourcepub const DEFAULT_FDB_AGE: u64 = 300u64
pub const DEFAULT_FDB_AGE: u64 = 300u64
Default FDB aging timeout: 300 ticks (5 minutes at 1 tick/sec).
Sourcepub fn add_tunnel(&mut self, tunnel: VxlanTunnel) -> Result<(), VxlanError>
pub fn add_tunnel(&mut self, tunnel: VxlanTunnel) -> Result<(), VxlanError>
Add a tunnel.
Sourcepub fn remove_tunnel(&mut self, vni: u32) -> Result<(), VxlanError>
pub fn remove_tunnel(&mut self, vni: u32) -> Result<(), VxlanError>
Remove a tunnel.
Sourcepub fn get_tunnel(&self, vni: u32) -> Option<&VxlanTunnel>
pub fn get_tunnel(&self, vni: u32) -> Option<&VxlanTunnel>
Get a tunnel by VNI.
Sourcepub fn encapsulate(
&self,
vni: u32,
inner_frame: &[u8],
) -> Result<Vec<u8>, VxlanError>
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).
Sourcepub fn decapsulate(&self, packet: &[u8]) -> Result<(u32, Vec<u8>), VxlanError>
pub fn decapsulate(&self, packet: &[u8]) -> Result<(u32, Vec<u8>), VxlanError>
Decapsulate a VXLAN packet.
Returns (VNI, inner frame).
Sourcepub fn fdb_learn(&mut self, mac: MacAddress, vtep_ip: u32, current_tick: u64)
pub fn fdb_learn(&mut self, mac: MacAddress, vtep_ip: u32, current_tick: u64)
Learn a MAC address from an incoming frame.
Sourcepub fn fdb_add_static(&mut self, mac: MacAddress, vtep_ip: u32)
pub fn fdb_add_static(&mut self, mac: MacAddress, vtep_ip: u32)
Add a static FDB entry.
Sourcepub fn fdb_lookup(&self, mac: &MacAddress) -> Option<&FdbEntry>
pub fn fdb_lookup(&self, mac: &MacAddress) -> Option<&FdbEntry>
Look up a MAC address in the FDB.
Sourcepub fn arp_proxy_add(&mut self, ip: u32, mac: MacAddress, vtep_ip: u32)
pub fn arp_proxy_add(&mut self, ip: u32, mac: MacAddress, vtep_ip: u32)
Add an ARP proxy entry.
Sourcepub fn arp_proxy(&self, target_ip: u32) -> Option<MacAddress>
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.
Sourcepub fn tunnel_count(&self) -> usize
pub fn tunnel_count(&self) -> usize
Get tunnel count.