Expand description
Network vocabulary shared by every per-client limit.
Structs§
- Client
Key - Key under which per-client state is held: an IPv4 address as
/32, an IPv6 address as its/64(one subscriber owns a whole/64, so per-address keys would be trivially bypassed).
Enums§
- IpNet
- An IP network address, either IPv4 or IPv6.
Constants§
- MAX_
TRUSTED_ HOPS - Most trusted hops
forwarded_clientskips before giving up. - UNKNOWN_
FORWARDED - The key of a request from a trusted proxy that names no usable client: no
X-Forwarded-For, every entry a trusted proxy, more thanMAX_TRUSTED_HOPStrusted entries, or a malformed entry reached on the walk. The unspecified address0.0.0.0is never a real peer, so it carries no ACLallow, no private-network trust and no per-client allowance of the proxy itself; all such requests share one bucket.
Functions§
- client_
key - Client key of
ip. IPv4-mapped IPv6 addresses count as IPv4. - forwarded_
client - The client address of a request that arrived from
peercarrying theX-Forwarded-Forheader instancesxff(in order), given the proxies listed intrusted. - is_
trusted - Whether
ip(IPv4-mapped IPv6 counted as IPv4) lies inside one oftrusted.