CIDR
Classless Inter-Domain Routing (CIDR)
Summary
Functions
Check whether the argument is a CIDR value
Checks if an IP address is in the provided CIDR
Throwing version of match/2, raises ArgumentError
on error
Parses a bitstring into a CIDR struct
Functions
Check whether the argument is a CIDR value.
Examples
iex> CIDR.is_cidr?("192.168.1.254/32")
true
Checks if an IP address is in the provided CIDR.
Returns {:ok, true}
if the address is in the CIDR range, {:ok, false} if
it’s not, and {:error, reason}
if the second argument isn’t a valid IP
address.