Learn R Programming

ipaddress (version 0.3.0)

is_reserved: Reserved addresses

Description

Check if an address or network is reserved for special use. A network is considered reserved if both the network_address() and broadcast_address() are reserved.

Usage

is_multicast(x)

is_unspecified(x)

is_loopback(x)

is_link_local(x)

Arguments

x

An ip_address or ip_network vector

Value

A logical vector

Details

These special use addresses are documented in IETF documents RFC 5735 (for IPv4) and RFC 4291 (for IPv6).

See Also

Addresses reserved by IPv6 transition mechanisms can be identified by functions described in ipv6-transition.

Examples

Run this code
# NOT RUN {
# these examples show the reserved networks

is_multicast(ip_network(c("224.0.0.0/4", "ff00::/8")))

is_unspecified(ip_network(c("0.0.0.0/32", "::/128")))

is_loopback(ip_network(c("127.0.0.0/8", "::1/128")))

is_link_local(ip_network(c("169.254.0.0/16", "fe80::/10")))
# }

Run the code above in your browser using DataLab