ip_in_range: check if IP addresses fall within particular IP ranges

Description Usage Arguments Value See Also Examples

View source: R/RcppExports.R

Description

ip_in_range checks whether a vector of IP addresses fall within particular IP range(s).

Usage

1
ip_in_range(ip_addresses, ranges)

Arguments

ip_addresses

a vector of IP addresses

ranges

either a vector of ranges equal in length to ip_addresses, or a single range. If the former, ip_in_range will compare each IP to the equivalent range. If the latter, each IP will be compared to the single range provided.

Value

a logical vector, where TRUE indicates the relevant IP is in the range, and FALSE indicates that the IP is not in the range, or is an invalid IP address.

See Also

range_boundaries for identifying the minimum and maximum IPs within a range, and validate_range for validating that a range exists.

Examples

1
2
3
#Is this in the range? Yes!
ip_in_range("172.18.0.1","172.18.0.0/28")
#[1] TRUE

iptools documentation built on Sept. 10, 2021, 5:06 p.m.