Expand description
IP RFC
§Installation
[dependencies]
iprfc = "0.2"§Const Classifiers
iprfc exposes const functions for common RFC address classes, so downstream
crates can reuse the same no-std range checks in constructors and predicates.
use iprfc::{is_documentation_ip_addr, is_private_ip_addr};
let private = "10.0.0.1".parse().unwrap();
assert!(is_private_ip_addr(private));
let documentation = "3fff::1".parse().unwrap();
assert!(is_documentation_ip_addr(documentation));§Pedigree
- Reference to: HashiCorp’s go-sockaddr
rfc.go
§License
iprfc is under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2021 Al Liu.
Structs§
- Filter
- Address-related RFC flags
- Ipv4Net
- An IPv4 network address.
- Ipv6Net
- An IPv6 network address.
- RFC
- RFC
- RFCs
- All known RFCs
- Subset
- A subset of
RFCs, useful for filtering
Enums§
- IpNet
- An IP network address, either IPv4 or IPv6.
Constants§
- FORWARDING_
BLACKLIST - Pseudo-RFC: Blacklist of non-forwardable IP blocks taken from RFC 6890
- FORWARDING_
BLACKLIST_ ID - The id of the
FORWARDING_BLACKLISTRFC. - RFC919
- RFC 919 Broadcasting Internet Datagrams
- RFC1112
- RFC 1112 Host Extensions for IP Multicasting
- RFC1122
- RFC 1122 Requirements for Internet Hosts – Communication Layers
- RFC1918
- RFC 1918 Address Allocation for Private Internets
- RFC2544
- RFC 2544 Benchmarking Methodology for Network Interconnect Devices
- RFC2765
- RFC 2765 Stateless IP/ICMP Translation Algorithm (SIIT) (obsoleted by RFCs 6145, which itself was later obsoleted by 7915).
- RFC2928
- RFC 2928 Initial IPv6 Sub-TLA ID Assignments
- RFC3056
- RFC 3056 Connection of IPv6 Domains via IPv4 Clouds
- RFC3068
- RFC 3068 An Anycast Prefix for 6to4 Relay Routers (obsolete by RFC7526)
- RFC3171
- RFC 3171 IANA Guidelines for IPv4 Multicast Address Assignments
- RFC3330
- RFC 3330 Special-Use IPv4 Addresses
- RFC3849
- RFC 3849 IPv6 Address Prefix Reserved for Documentation
- RFC3927
- RFC 3927 Dynamic Configuration of IPv4 Link-Local Addresses
- RFC4038
- RFC 4038 Application Aspects of IPv6 Transition
- RFC4193
- RFC 4193 Unique Local IPv6 Unicast Addresses
- RFC4291
- RFC 4291 IP Version 6 Addressing Architecture
- RFC4380
- RFC 4380 Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)
- RFC4773
- RFC 4773 Administration of the IANA Special Purpose IPv6 Address Block
- RFC4843
- RFC 4843 An IPv6 Prefix for Overlay Routable Cryptographic Hash Identifiers (ORCHID)
- RFC5180
- RFC 5180 IPv6 Benchmarking Methodology for Network Interconnect Devices
- RFC5735
- RFC 5735 Special Use IPv4 Addresses
- RFC5737
- RFC 5737 IPv4 Address Blocks Reserved for Documentation
- RFC6052
- RFC 6052 IPv6 Addressing of IPv4/IPv6 Translators
- RFC6333
- RFC 6333 Dual-Stack Lite Broadband Deployments Following IPv4 Exhaustion
- RFC6598
- RFC 6598 IANA-Reserved IPv4 Prefix for Shared Address Space
- RFC6666
- RFC 6666 A Discard Prefix for IPv6
- RFC6890
- RFC 6890 Special-Purpose IP Address Registries
- RFC7335
- RFC 7335 IPv4 Service Continuity Prefix
- RFC9637
- RFC 9637 Expanding the IPv6 Documentation Space
Traits§
Functions§
- is_
benchmark_ ip_ addr - Returns
trueif the IP address is reserved for benchmarking. - is_
benchmark_ ipv4_ addr - Returns
trueif the IPv4 address is in RFC 2544 benchmarking space. - is_
benchmark_ ipv6_ addr - Returns
trueif the IPv6 address is in RFC 5180 benchmarking space. - is_
broadcast_ ip_ addr - Returns
trueif the IP address is the IPv4 limited broadcast address. - is_
broadcast_ ipv4_ addr - Returns
trueif the IPv4 address is exactly255.255.255.255/32. - is_
documentation_ ip_ addr - Returns
trueif the IP address is reserved for documentation or examples. - is_
documentation_ ipv4_ addr - Returns
trueif the IPv4 address is in an RFC 5737 documentation block. - is_
documentation_ ipv6_ addr - Returns
trueif the IPv6 address is in an RFC 3849 or RFC 9637 documentation block. - is_
link_ local_ ip_ addr - Returns
trueif the IP address is link-local. - is_
link_ local_ ipv4_ addr - Returns
trueif the IPv4 address is in RFC 3927 link-local space. - is_
link_ local_ ipv6_ addr - Returns
trueif the IPv6 address is infe80::/10link-local space. - is_
loopback_ ip_ addr - Returns
trueif the IP address is loopback. - is_
loopback_ ipv4_ addr - Returns
trueif the IPv4 address is in127.0.0.0/8. - is_
loopback_ ipv6_ addr - Returns
trueif the IPv6 address is::1/128. - is_
multicast_ ip_ addr - Returns
trueif the IP address is multicast. - is_
multicast_ ipv4_ addr - Returns
trueif the IPv4 address is multicast. - is_
multicast_ ipv6_ addr - Returns
trueif the IPv6 address is multicast. - is_
private_ ip_ addr - Returns
trueif the IP address is RFC 1918 private-use or RFC 4193 unique-local. - is_
private_ ipv4_ addr - Returns
trueif the IPv4 address is in RFC 1918 private-use space. - is_
shared_ ip_ addr - Returns
trueif the IP address is in shared address space. - is_
shared_ ipv4_ addr - Returns
trueif the IPv4 address is in RFC 6598 shared address space. - is_
unique_ local_ ipv6_ addr - Returns
trueif the IPv6 address is in RFC 4193 unique-local space. - is_
unspecified_ ip_ addr - Returns
trueif the IP address is the exact unspecified address. - is_
unspecified_ ipv4_ addr - Returns
trueif the IPv4 address is exactly0.0.0.0/32. - is_
unspecified_ ipv6_ addr - Returns
trueif the IPv6 address is exactly::/128.