Used to check IpAddr's against all the rfc 6890 entries and find the one that
matches the most specific definition
vector of all of the available entries
Build the WithRfc6890, by creating the list of Rfc6890Entry's
RFC6890 https://tools.ietf.org/rfc/rfc6890.txt
Forwardable - A boolean value indicating whether a router may
forward an IP datagram whose destination address is drawn from the
allocated special-purpose address block between external
interfaces.
use ift::rfc::WithRfc6890;
let rfc = WithRfc6890::create();
assert_eq!(true, rfc.is_forwardable(&"192.168.1.100".parse().unwrap()), "intranet ip");
assert_eq!(false, rfc.is_forwardable(&"169.254.169.254".parse().unwrap()), "aws metadata service");
assert_eq!(true, rfc.is_forwardable(&"172.217.9.142".parse().unwrap()), "a google ip");
assert_eq!(true, rfc.is_forwardable(&"2001:4860:4860::8844".parse().unwrap()), "a google ipv6 address");
RFC6890 https://tools.ietf.org/rfc/rfc6890.txt
Global - A boolean value indicating whether an IP datagram whose
destination address is drawn from the allocated special-purpose
address block is forwardable beyond a specified administrative
domain.
use ift::rfc::WithRfc6890;
let rfc = WithRfc6890::create();
assert_eq!(false, rfc.is_global(&"192.168.1.100".parse().unwrap()), "intranet ip");
assert_eq!(true, rfc.is_global(&"192.88.99.20".parse().unwrap()), "internet ip");
assert_eq!(false, rfc.is_global(&"169.254.169.254".parse().unwrap()), "aws metadata service");
assert_eq!(true, rfc.is_global(&"172.217.9.142".parse().unwrap()), "a google ip");
assert_eq!(true, rfc.is_global(&"64:ff9b::255.255.255.255".parse().unwrap()), "ipv6");
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more