AkurAI Build
Menu

Public repository / 8dbc8e4a6817aa11980095f657667fb62d065ad8

AkurAI-VPN / crates/akurai-control/src/ipam.rs

Latest change 2f952519db76ba7dd8b099a09ebda909d137ea5e - feat: scaffold pure-Rust zero-dep AkurAI VPN workspace (v0.0.1) by Ólafur Búi Ólafsson

//! Overlay IP allocation (IPAM) — control-plane stub.
//!
//! Hands each enrolled node a stable overlay IPv4/IPv6 from the fixed ranges.
//! The allocation arithmetic itself lives in `akurai-common`; the persistent
//! index bookkeeping (who has which index, reuse on deletion) is not
//! implemented in 0.0.1.

use akurai_common::OverlayIpv4;

/// One-line status of the IP-allocation subsystem, demonstrating the overlay
/// helper that the real allocator will draw addresses from.
pub fn status() -> String {
    match OverlayIpv4::from_index(1) {
        Ok(first) => format!(
            "ipam: 100.88.0.0/16 ready, control plane would take {} (allocator not implemented in 0.0.1)",
            first.addr()
        ),
        Err(e) => format!("ipam: overlay range misconfigured: {e}"),
    }
}