cfg namespace
Pool configuration schema and validation helpers used by runtime scenarios to open poolX config sections.
This namespace owns the persistent representation of one pool and translates it into a normalized Ipv4PoolStaticConfig consumed by Ipv4PoolManager.
Namespaces
- namespace validators
Classes
- struct Ipv4PoolStaticConfig
- Normalized parsed configuration of one pool section.
- struct PoolConfigSectionDefinition
- Typed section definition for one
poolXconfig section. - struct PoolSectionDefaults
- Factory-default profile used to seed one named
poolXsection.
Typedefs
-
using PoolConfigSection = prf::
config:: TypedConfigSection<PoolConfigSectionDefinition> - Strongly typed config facade for one pool section.
Functions
- auto default_pool_type() -> std::string
- Default config value for
type. -
auto make_pool_section_schema(const std::string& section_name) -> prf::
config:: SectionSchema - Convenience helper mirroring
PoolConfigSectionDefinition::.schema - auto parse_pool_config(const PoolConfigSection& section) -> std::optional<Ipv4PoolStaticConfig>
- Parses and validates one typed pool section into normalized runtime config.
- auto pool_config_is_valid(const PoolConfigSection& section) -> bool
- Returns whether a typed pool section is currently valid.
- auto pool_section_defaults(std::string_view section_name) -> PoolSectionDefaults
- Returns factory defaults for one named pool section.
- auto pool_snapshot_matches_static_config(const Ipv4PoolStaticConfig& config, const PoolSnapshot& snapshot) -> bool
- Checks whether a static config and effective snapshot describe the same pool shape.
- auto pool_source_snapshot_is_valid(const PoolSourceSnapshot& snapshot) -> bool
- Validates a live dynamic source snapshot before it becomes an effective pool.
Typedef documentation
using prf:: net:: pool:: cfg:: PoolConfigSection = prf:: config:: TypedConfigSection<PoolConfigSectionDefinition>
#include <net/pool/pool_config.hpp>
Strongly typed config facade for one pool section.
Function documentation
std::string prf:: net:: pool:: cfg:: default_pool_type()
#include <net/pool/pool_config.hpp>
Default config value for type.
prf:: config:: SectionSchema prf:: net:: pool:: cfg:: make_pool_section_schema(const std::string& section_name)
#include <net/pool/pool_config.hpp>
Convenience helper mirroring PoolConfigSectionDefinition::.
std::optional<Ipv4PoolStaticConfig> prf:: net:: pool:: cfg:: parse_pool_config(const PoolConfigSection& section)
#include <net/pool/pool_config.hpp>
Parses and validates one typed pool section into normalized runtime config.
| Parameters | |
|---|---|
| section | Typed pool section facade. |
| Returns | Parsed config on success, std::nullopt when config is invalid. |
Example:
auto section = prf::net::pool::cfg::PoolConfigSection(...); auto parsed = prf::net::pool::cfg::parse_pool_config(section); if (parsed && parsed->enabled) { // Safe to pass to pool runtime }
bool prf:: net:: pool:: cfg:: pool_config_is_valid(const PoolConfigSection& section)
#include <net/pool/pool_config.hpp>
Returns whether a typed pool section is currently valid.
PoolSectionDefaults prf:: net:: pool:: cfg:: pool_section_defaults(std::string_view section_name)
#include <net/pool/pool_config.hpp>
Returns factory defaults for one named pool section.
Example:
auto defaults = prf::net::pool::cfg::pool_section_defaults("pool1"); // defaults.type == "dynamic", defaults.source_interface == "np2"
bool prf:: net:: pool:: cfg:: pool_snapshot_matches_static_config(const Ipv4PoolStaticConfig& config,
const PoolSnapshot& snapshot)
#include <net/pool/pool_config.hpp>
Checks whether a static config and effective snapshot describe the same pool shape.
bool prf:: net:: pool:: cfg:: pool_source_snapshot_is_valid(const PoolSourceSnapshot& snapshot)
#include <net/pool/pool_config.hpp>
Validates a live dynamic source snapshot before it becomes an effective pool.