Skip to main content

Module network

Module network 

Source
Expand description

Shared network helpers. Currently the trusted-proxy client-IP resolver, reused by rate limiting, structured logging and future Geo/IP-reputation — the real client IP is derived once and read by everyone from RequestContext::client_ip.

Structs§

ClientIpResolver
Pre-compiled resolver: trusted CIDRs are parsed once at construction.
ResolvedClientIp
Result of resolution: the chosen IP and how it was obtained.

Enums§

IpSource
How client_ip was determined — for audit/logging and to decide warnings.

Functions§

is_valid_cidr
True if s is a syntactically valid CIDR or bare IP (IPv4/IPv6). Used by config validation to reject illegal trusted_proxies entries at startup instead of silently dropping them at resolver-construction time.