prf::net::parp namespace

Classes

class InterfaceParpRuntime
Per-interface PARP runtime bound to one Ethernet-like ingress interface.
class IParpRoutePolicyProvider
PARP-owned provider for runtime binding and startup route-policy snapshot build.
class IParpStatusSource
Read-only status source used by Ethernet control commands.
struct NetifName
Fixed-size network interface name used in PARP route policy snapshots.
struct ParpConfig
Parsed PARP policy bound to one interface section.
struct ParpRouteDecision
Route lookup result for source+destination PARP policy.
class ParpRoutePolicyBuilder
PARP-owned registry of interface config sections used by runtime and route hook.
struct ParpRoutePolicySnapshot
Immutable PARP route policy snapshot published to lwIP hook.
struct ParpRouteRule
One PARP-derived route rule bound to one ingress interface.
struct ParpStatusSnapshot
Runtime PARP status and counters exposed through /interface/<if>/parp.

Enums

enum class ParpDecision: uint8_t { NoMatch = 0u, Match }
Result of PARP destination filtering.
enum class ParpMatch: uint8_t { InRange = 0u, OutOfRange }
Match selector mapped from pool IP classification.
enum class ParpMode: uint8_t { Standard = 0u, Proxy }
Proxy ARP operation mode for one Ethernet-like ingress interface.
enum class ParpResolvedRule: uint8_t { None = 0u, R1, R2, R3, Conflict }
Rule id selected by the route resolver.
enum class ParpRoutePolicyInvalidReason: uint8_t { None = 0u, ConfigParseFailed, StructuralConfigInvalid, PoolManagerMissing, PoolSnapshotUnavailable, RuleCapacityExceeded, NetifNameEncodingFailed }
Reason why one route policy snapshot is invalid and must fail closed.

Functions

auto build_arp_reply_frame(const eth::ArpFrameEvent& request, const std::array<uint8_t, 6>& ingress_mac, std::array<uint8_t, kArpEthernetIpv4FrameBytes>* out_frame) -> bool
Builds one Ethernet II ARP reply frame from parsed request metadata.
auto decode_netif_name(const NetifName& name) -> std::string_view
Returns decoded view for fixed-size interface name.
auto describe_parp_route_policy_invalid_reason(const ParpRoutePolicyInvalidReason reason) -> const char*
Returns human-readable description for invalid route policy reason.
auto encode_netif_name(const std::string_view name, NetifName*const out) -> bool
Encodes interface name into fixed-size form.
auto ipv4_is_in_subnet(uint32_t ip_be, uint32_t network_ip_be, uint32_t subnet_mask_be) -> bool
Returns true when ip_be belongs to network_ip_be/subnet_mask_be.
auto match_parp_policy(const ParpMatch match_mode, const pool::PoolIpClass ip_class) -> ParpDecision
Maps pool classification to PARP match result according to current policy.
auto match_r1(const ParpRouteRule& rule, const uint32_t, const uint32_t dst) -> bool
Per-instance rule match helpers used by resolver and tests.
auto match_r2(const ParpRouteRule& rule, const uint32_t src, const uint32_t dst) -> bool
auto match_r3(const ParpRouteRule& rule, const uint32_t src, const uint32_t dst) -> bool
auto parp_config_is_structurally_valid(const ParpConfig& config, const std::string_view ingress_interface, const std::span<const char*const> known_interfaces) -> bool
auto parp_config_is_structurally_valid(const ParpConfig& config, std::string_view ingress_interface, std::span<const char*const> known_interfaces) -> bool
Performs static config validation that does not require pool snapshot.
auto parp_target_ip_guardrail_ok(const uint32_t target_ip, const uint32_t ingress_ip, const pool::PoolSnapshot& pool_snapshot) -> bool
Applies common PARP guardrails to destination IP against ingress subnet.
auto parp_target_ip_is_unicast(const uint32_t ip) -> bool
Returns true when the IPv4 address is a valid unicast candidate for PARP.
auto parse_parp_config(const cfg::EthConfigSection& section) -> std::optional<ParpConfig>
Parses PARP config from Ethernet interface section.
auto parse_parp_config(const cfg::UsbConfigSection& section) -> std::optional<ParpConfig>
Parses PARP config from USB Ethernet-like interface section.
auto resolve_parp_route(const std::span<const ParpRouteRule> rules, const uint32_t src, const uint32_t dst) -> ParpRouteDecision
Resolves source+destination IPv4 pair against PARP routing policy.

Variables

size_t kArpEthernetIpv4FrameBytes constexpr
Canonical Ethernet II ARP frame size for Ethernet/IPv4 payload.
size_t kMaxParpRouteRules constexpr
Maximum number of active PARP route rules in one published policy snapshot.

Enum documentation

enum class prf::net::parp::ParpDecision: uint8_t

Result of PARP destination filtering.

enum class prf::net::parp::ParpMatch: uint8_t

Match selector mapped from pool IP classification.

enum class prf::net::parp::ParpMode: uint8_t

Proxy ARP operation mode for one Ethernet-like ingress interface.

enum class prf::net::parp::ParpResolvedRule: uint8_t

Rule id selected by the route resolver.

enum class prf::net::parp::ParpRoutePolicyInvalidReason: uint8_t

Reason why one route policy snapshot is invalid and must fail closed.

Function documentation

bool prf::net::parp::build_arp_reply_frame(const eth::ArpFrameEvent& request, const std::array<uint8_t, 6>& ingress_mac, std::array<uint8_t, kArpEthernetIpv4FrameBytes>* out_frame)

Builds one Ethernet II ARP reply frame from parsed request metadata.

Reply source MAC is always the ingress interface MAC.

std::string_view prf::net::parp::decode_netif_name(const NetifName& name)

Returns decoded view for fixed-size interface name.

const char* prf::net::parp::describe_parp_route_policy_invalid_reason(const ParpRoutePolicyInvalidReason reason)

Returns human-readable description for invalid route policy reason.

bool prf::net::parp::encode_netif_name(const std::string_view name, NetifName*const out)

Encodes interface name into fixed-size form.

bool prf::net::parp::ipv4_is_in_subnet(uint32_t ip_be, uint32_t network_ip_be, uint32_t subnet_mask_be)

Returns true when ip_be belongs to network_ip_be/subnet_mask_be.

All inputs are IPv4 values in network-byte-order representation used by the PacketRF network stack.

ParpDecision prf::net::parp::match_parp_policy(const ParpMatch match_mode, const pool::PoolIpClass ip_class)

Maps pool classification to PARP match result according to current policy.

bool prf::net::parp::match_r1(const ParpRouteRule& rule, const uint32_t, const uint32_t dst)

Per-instance rule match helpers used by resolver and tests.

bool prf::net::parp::match_r2(const ParpRouteRule& rule, const uint32_t src, const uint32_t dst)

bool prf::net::parp::match_r3(const ParpRouteRule& rule, const uint32_t src, const uint32_t dst)

bool prf::net::parp::parp_config_is_structurally_valid(const ParpConfig& config, const std::string_view ingress_interface, const std::span<const char*const> known_interfaces)

bool prf::net::parp::parp_config_is_structurally_valid(const ParpConfig& config, std::string_view ingress_interface, std::span<const char*const> known_interfaces)

Performs static config validation that does not require pool snapshot.

bool prf::net::parp::parp_target_ip_guardrail_ok(const uint32_t target_ip, const uint32_t ingress_ip, const pool::PoolSnapshot& pool_snapshot)

Applies common PARP guardrails to destination IP against ingress subnet.

bool prf::net::parp::parp_target_ip_is_unicast(const uint32_t ip)

Returns true when the IPv4 address is a valid unicast candidate for PARP.

std::optional<ParpConfig> prf::net::parp::parse_parp_config(const cfg::EthConfigSection& section)

Parses PARP config from Ethernet interface section.

std::optional<ParpConfig> prf::net::parp::parse_parp_config(const cfg::UsbConfigSection& section)

Parses PARP config from USB Ethernet-like interface section.

ParpRouteDecision prf::net::parp::resolve_parp_route(const std::span<const ParpRouteRule> rules, const uint32_t src, const uint32_t dst)

Resolves source+destination IPv4 pair against PARP routing policy.

Variable documentation

size_t prf::net::parp::kArpEthernetIpv4FrameBytes constexpr

Canonical Ethernet II ARP frame size for Ethernet/IPv4 payload.

size_t prf::net::parp::kMaxParpRouteRules constexpr

Maximum number of active PARP route rules in one published policy snapshot.