pool namespace
Control endpoints for IPv4 pool inspection and configuration.
Pool-oriented IPv4 address management types shared by config, runtime, and future allocators such as DHCP or NPR master admission.
Runtime pool manager and source publication interfaces.
The pool subsystem is exposed under /ip/pool/... so future IP-management features such as DHCP can live next to it under the same /ip/... root. This adapter keeps endpoint routing close to the pool module rather than spreading pool-specific control code across generic control infrastructure.
The pool manager owns address block allocation, generation tracking, and dynamic-source activation for a fixed set of scenario-provided poolX config sections.
The pool subsystem deliberately exposes a small set of plain value objects: one structure for source snapshots, one for effective pool snapshots, one for client identity, and one for concrete allocations. This keeps the module transport-agnostic and easy to inspect in logs, tests, and Doxygen output.
Namespaces
- namespace cfg
- Pool configuration schema and validation helpers used by runtime scenarios to open
poolXconfig sections.
Classes
- class IPoolSourceSink
- Sink used by runtime publishers of dynamic address ranges.
- class Ipv4PoolManager
- Fixed-footprint IPv4 pool manager for static and dynamic pools.
- struct PoolAllocation
- One allocated contiguous IPv4 block associated with one client identity.
- struct PoolAllocationEntryView
- Lightweight listing view returned by allocation enumeration helpers.
- struct PoolClientIdentity
- Stable client identity used as the primary lookup key in pool allocations.
- class PoolControlCommands
- Publishes pool management commands under
/ip/pool/.... - struct PoolSnapshot
- Effective pool view visible to clients of the pool manager.
- struct PoolSourceSnapshot
- Live network parameters published by a dynamic source owner.
Enums
- enum class PoolAllocationState: uint8_t { Offered = 0u, Committed }
- Distinguishes a temporary offered address from a committed lease-like allocation.
- enum class PoolIpClass: uint8_t { OutsideSubnet = 0u, InSubnetOutOfRange, InRange }
- Classification of one IPv4 destination against effective pool addressing.
- enum class PoolType: uint8_t { Static = 0u, Dynamic }
- Declares whether a pool is configured from static values or from a live runtime source such as
np2.
Functions
- auto classify_ip_against_pool(const PoolSnapshot& snapshot, uint32_t ip) -> PoolIpClass
- Classifies one IPv4 address against effective pool snapshot.
- auto make_pool_client_identity(std::string_view client_id, PoolClientIdentity* out) -> bool
- Builds a pool client identity from a string-like identifier.
- auto pool_client_identity_equals(const PoolClientIdentity& lhs, const PoolClientIdentity& rhs) -> bool
- Compares two client identities by primary key bytes only.
Enum documentation
enum class prf:: net:: pool:: PoolAllocationState: uint8_t
#include <net/pool/pool_types.hpp>
Distinguishes a temporary offered address from a committed lease-like allocation.
| Enumerators | |
|---|---|
| Offered |
Block is reserved for one client but not yet finalized. |
| Committed |
Block is active and should be reused for the same client when possible. |
enum class prf:: net:: pool:: PoolIpClass: uint8_t
#include <net/pool/pool_types.hpp>
Classification of one IPv4 destination against effective pool addressing.
The class is derived from effective pool snapshot semantics and is consumed by higher-level routing/policy modules such as proxy ARP.
| Enumerators | |
|---|---|
| OutsideSubnet |
Address is outside effective pool subnet. |
| InSubnetOutOfRange |
Address is inside effective pool subnet but outside effective pool range. |
| InRange |
Address is inside effective pool range. |
enum class prf:: net:: pool:: PoolType: uint8_t
#include <net/pool/pool_types.hpp>
Declares whether a pool is configured from static values or from a live runtime source such as np2.
| Enumerators | |
|---|---|
| Static |
Pool parameters come directly from persistent config. |
| Dynamic |
Pool parameters are published at runtime via |
Function documentation
PoolIpClass prf:: net:: pool:: classify_ip_against_pool(const PoolSnapshot& snapshot,
uint32_t ip)
#include <net/pool/pool_types.hpp>
Classifies one IPv4 address against effective pool snapshot.
Classification is based on two independent checks:
- membership in effective pool subnet (
ip_start/subnet_mask), - membership in effective pool range (
ip_start..ip_start+ip_size-1).
Invalid snapshots always classify as OutsideSubnet.
bool prf:: net:: pool:: make_pool_client_identity(std::string_view client_id,
PoolClientIdentity* out)
#include <net/pool/pool_types.hpp>
Builds a pool client identity from a string-like identifier.
| Parameters | |
|---|---|
| client_id | Source identifier bytes. |
| out | Output identity structure. |
| Returns | true when the identifier fits into the fixed buffer and output was written. |
Example:
prf::net::pool::PoolClientIdentity id{}; if (prf::net::pool::make_pool_client_identity("us0", &id)) { // Use id with acquire_committed(...) }
bool prf:: net:: pool:: pool_client_identity_equals(const PoolClientIdentity& lhs,
const PoolClientIdentity& rhs)
#include <net/pool/pool_types.hpp>
Compares two client identities by primary key bytes only.
| Returns | true when lhs and rhs refer to the same pool client. |
|---|