Skip to contents

Data classes

ip_address()
Vector of IP addresses
ip_network()
Vector of IP networks
ip_interface()
Vector of IP interfaces
is_ip_address() is_ip_interface() is_ip_network()
Test for IP vector
as_ip_address() as_ip_interface() as_ip_network()
Cast to IP vector
format(<ip_address>) format(<ip_interface>) format(<ip_network>)
Format IP vector

Other representations

ip_to_binary() binary_to_ip()
Represent address as binary
ip_to_bytes() bytes_to_ip()
Represent address as raw bytes
ip_to_hex() hex_to_ip()
Represent address as hexadecimal
ip_to_integer() integer_to_ip()
Represent address as integer
ip_to_hostname() ip_to_hostname_all() hostname_to_ip() hostname_to_ip_all()
Translate address to/from hostname
reverse_pointer()
Reverse DNS pointer

Address space

Network membership

network_address() broadcast_address() num_addresses()
Network size
prefix_length() netmask() hostmask()
Network mask
common_network()
Find the common network of two addresses
is_within() is_within_any()
Network membership of addresses
is_supernet() is_subnet() overlaps()
Network membership of other networks
supernet() subnets()
Traverse the network hierarchy

Address ranges

summarize_address_range()
List constituent networks of an address range
collapse_networks()
Collapse contiguous and overlapping networks
exclude_networks()
Remove networks from others

Generating addresses

sample_ipv4() sample_ipv6() sample_network()
Sample random addresses
seq(<ip_network>) hosts()
List addresses within a network

Datasets

country_networks()
Country-level IP networks
iana_ipv4
IPv4 address space allocation
iana_ipv6
IPv6 address space allocation