pub enum IpClass {
Public,
Private,
Loopback,
LinkLocal,
Multicast,
Reserved,
}Expand description
Classification of an IP address against the SSRF-relevant address space.
Total coverage: IpClass::from(IpAddr) (via SsrfPolicy::classify)
is total — every IpAddr maps to exactly one variant.
Variants§
Public
Publicly routable unicast (the only default-permitted class).
Private
RFC 1918 (10/8, 172.16/12, 192.168/16) + RFC 4193 (fc00::/7).
Loopback
127.0.0.0/8 + ::1.
LinkLocal
169.254.0.0/16 + fe80::/10 (excluding well-known metadata IPs,
which are classified Reserved).
Multicast
IPv4 224.0.0.0/4 + IPv6 ff00::/8.
Reserved
Reserved / unspecified / cloud-metadata (169.254.169.254, fd00:ec2::254) / documentation ranges / benchmarking / IETF protocol assignments.
Trait Implementations§
impl Copy for IpClass
impl Eq for IpClass
impl StructuralPartialEq for IpClass
Auto Trait Implementations§
impl Freeze for IpClass
impl RefUnwindSafe for IpClass
impl Send for IpClass
impl Sync for IpClass
impl Unpin for IpClass
impl UnsafeUnpin for IpClass
impl UnwindSafe for IpClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more