ips_in_cidrs: Determine if a vector if IPv4 addresses are in a vector of...

Description Usage Arguments Value Note Examples

Description

Determine if a vector if IPv4 addresses are in a vector of CIDRs

Usage

1
ips_in_cidrs(ips, cidrs)

Arguments

ips

character vector or numeric vector of IPv4 addresses

cidrs

character vector or numeric vector of IPv4 CIDRs

Value

data_frame with ips column and a logical in_cdir column

Note

auto-appends /32 if a bare IPv4 is detected

Examples

1
2
3
4
ips_in_cidrs(
  c("4.3.2.1", "1.2.3.4", "1.20.113.10", "5.190.145.5"),
  c("5.190.144.0/21", "1.20.113.0/24")
)

Example output

# A tibble: 4 x 2
  ips         in_cidr
  <fct>       <lgl>  
1 4.3.2.1     FALSE  
2 1.2.3.4     FALSE  
3 1.20.113.10 TRUE   
4 5.190.145.5 TRUE   

iptools documentation built on May 2, 2019, 2:53 p.m.