pub enum IpScope {
Global,
Local,
}Expand description
How far an IP address reaches.
Variants§
Global
An address outside every range listed on Local.
Reserved ranges that are neither private nor host-scoped are not
separated out: 192.0.2.1 is documentation space (RFC 5737) and reads
as Global here, because the question this answers is whether the
address was set aside for use inside a network, not whether some route
to it exists today.
Local
An address that is meaningful only inside a network, or only on the host that is asked:
| Range | Reserved by |
|---|---|
10/8, 172.16/12, 192.168/16 | RFC 1918 §3 |
100.64/10 | RFC 6598 §7 |
169.254/16 | RFC 3927 §2.1 |
127/8, 0/8 | RFC 1122 §3.2.1.3 |
255.255.255.255 | RFC 919 §7 |
224.0.0/24 | RFC 5771 §4 |
239/8 | RFC 2365 §4 |
198.18/15 | RFC 2544 §C.2.2 |
fc00::/7 | RFC 4193 §3 |
fe80::/10 | RFC 4291 §2.5.6 |
fec0::/10 | RFC 3879 §2 |
::1, :: | RFC 4291 §2.5.3, §2.5.2 |
ff00::/8 below global scope | RFC 4291 §2.7 |
An address that embeds an IPv4 one, in either the mapped form (RFC 4291 §2.5.5.2) or the deprecated compatible form (§2.5.5.1), reports the reach of the address it holds, so one host does not classify two ways for being written two ways.
Multicast is not here for being multicast: an IPv6 group carries its
scope in the address and only 0xE is global, and of IPv4 multicast
only the two blocks above are bounded. 224.0.1.1 and 233.1.2.3 are
routable and read as Global.