pub enum Ipv6Scope {
InterfaceLocal,
LinkLocal,
RealmLocal,
AdminLocal,
SiteLocal,
OrganizationLocal,
Global,
Reserved(Ipv6ReservedScope),
Unassigned(Ipv6UnassignedScope),
}Expand description
The list of IPv6 scopes.
These scopes are defined by RFC 4291 Section 2.7 and updated by RFC 7346.
Variants§
InterfaceLocal
The interface-local scope.
LinkLocal
The link-local scope.
RealmLocal
The realm-local scope.
AdminLocal
The admin-local scope.
SiteLocal
The (deprecated) site-local scope.
The site-local scope was deprecated in RFC 3879. While this scope is returned for both site-local unicast and site-local multicast addresses, RFC 3879 says the following about site-local unicast addresses in particular (“this prefix” refers to the site-local unicast subnet):
The special behavior of this prefix MUST no longer be supported in new implementations. The prefix MUST NOT be reassigned for other use except by a future IETF standards action… However, router implementations SHOULD be configured to prevent routing of this prefix by default.
OrganizationLocal
The organization-local scope.
Global
The global scope.
Reserved(Ipv6ReservedScope)
Scopes which are reserved for future use by [RFC 7436].
Unassigned(Ipv6UnassignedScope)
Scopes which are available for local definition by administrators.
Implementations§
Source§impl Ipv6Scope
impl Ipv6Scope
Sourcepub const MULTICAST_SCOPE_ID_INTERFACE_LOCAL: u8 = 1
pub const MULTICAST_SCOPE_ID_INTERFACE_LOCAL: u8 = 1
The multicast scope ID of an interface-local address, defined in RFC 7346.
Sourcepub const MULTICAST_SCOPE_ID_LINK_LOCAL: u8 = 2
pub const MULTICAST_SCOPE_ID_LINK_LOCAL: u8 = 2
The multicast scope ID of a link-local address, defined in RFC 7346.
Sourcepub const MULTICAST_SCOPE_ID_REALM_LOCAL: u8 = 3
pub const MULTICAST_SCOPE_ID_REALM_LOCAL: u8 = 3
The multicast scope ID of a realm-local address, defined in RFC 7346.
Sourcepub const MULTICAST_SCOPE_ID_ADMIN_LOCAL: u8 = 4
pub const MULTICAST_SCOPE_ID_ADMIN_LOCAL: u8 = 4
The multicast scope ID of an admin-local address, defined in RFC 7346.
Sourcepub const MULTICAST_SCOPE_ID_SITE_LOCAL: u8 = 5
pub const MULTICAST_SCOPE_ID_SITE_LOCAL: u8 = 5
The multicast scope ID of a (deprecated) site-local address, defined in RFC 7346.
Note that site-local addresses are deprecated.
Sourcepub const MULTICAST_SCOPE_ID_ORG_LOCAL: u8 = 8
pub const MULTICAST_SCOPE_ID_ORG_LOCAL: u8 = 8
The multicast scope ID of an organization-local address, defined in RFC 7346.
Sourcepub const MULTICAST_SCOPE_ID_GLOBAL: u8 = 0xE
pub const MULTICAST_SCOPE_ID_GLOBAL: u8 = 0xE
The multicast scope ID of global address, defined in RFC 7346.
Sourcepub fn multicast_scope_id(&self) -> u8
pub fn multicast_scope_id(&self) -> u8
The ID used to indicate this scope in a multicast IPv6 address.
Per RFC 4291 Section 2.7, the bits of a multicast IPv6 address are laid out as follows:
| 8 | 4 | 4 | 112 bits |
+------ -+----+----+---------------------------------------------+
|11111111|flgs|scop| group ID |
+--------+----+----+---------------------------------------------+The 4-bit scop field encodes the scope of the address.
multicast_scope_id returns the numerical value used to encode this
scope in the scop field of a multicast address.