pub struct VirtualIpPool { /* private fields */ }Expand description
Virtual IP pool manager.
Implementations§
Source§impl VirtualIpPool
impl VirtualIpPool
Sourcepub fn new(
cidr: &str,
ttl_secs: u64,
grace_secs: u64,
) -> Result<Self, PoolError>
pub fn new( cidr: &str, ttl_secs: u64, grace_secs: u64, ) -> Result<Self, PoolError>
Create a new pool from a CIDR string (e.g., fd01::/112).
Sourcepub fn allocate(
&mut self,
node_addr: NodeAddr,
mesh_addr: Ipv6Addr,
dns_name: &str,
) -> Result<(Ipv6Addr, bool), PoolError>
pub fn allocate( &mut self, node_addr: NodeAddr, mesh_addr: Ipv6Addr, dns_name: &str, ) -> Result<(Ipv6Addr, bool), PoolError>
Allocate a virtual IP for the given node. Idempotent: returns existing mapping if one exists.
Sourcepub fn tick(
&mut self,
now: Instant,
conntrack: &dyn ConntrackQuerier,
) -> Vec<PoolEvent>
pub fn tick( &mut self, now: Instant, conntrack: &dyn ConntrackQuerier, ) -> Vec<PoolEvent>
Periodic tick — drives state transitions. Returns events for the NAT and network modules.
Sourcepub fn status(&self) -> PoolStatus
pub fn status(&self) -> PoolStatus
Pool utilization summary.
Sourcepub fn mapping_info(&self, now: Instant) -> Vec<MappingInfo>
pub fn mapping_info(&self, now: Instant) -> Vec<MappingInfo>
Summary of all active mappings.
Sourcepub fn lookup_virtual_ip(
&self,
virtual_ip: &Ipv6Addr,
) -> Option<&VirtualIpMapping>
pub fn lookup_virtual_ip( &self, virtual_ip: &Ipv6Addr, ) -> Option<&VirtualIpMapping>
Look up which node a virtual IP maps to.
Auto Trait Implementations§
impl Freeze for VirtualIpPool
impl RefUnwindSafe for VirtualIpPool
impl Send for VirtualIpPool
impl Sync for VirtualIpPool
impl Unpin for VirtualIpPool
impl UnsafeUnpin for VirtualIpPool
impl UnwindSafe for VirtualIpPool
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more