Retrieve range boundaries for a character vector of IPv4/IPv6 CIDRs

range_boundaries(cidr)

Arguments

cidr

a character vector of IPv4/IPv6 CIDRs

Value

data frame with original input, canonical CIDR, start/end (chr) of range and number of hosts.

Note

the n_hosts column is a numeric vector since R cannot handle 128-bit integers easily and v4 & v6 are co-mingled.

Examples

range_boundaries(
  c("2001:4801::/32", "2001:0db8::/127", "10.1.10.0/24", "2001:0db8::/119", "wat")
)