This version is still in development and is not considered stable yet. For the latest stable version, please use ol.client-ip 0.1!

ol.client-ip.cidr

cidr-parts

(cidr-parts cidr)

Parse an ip network string into its prefix and signifcant bits

cidr must be given in CIDR notation, as defined in [RFC 4632 section 3.1](https://tools.ietf.org/html/rfc4632#section-3.1)

Returns a vector of [^InetAddress prefix ^Integer bits]


contains?

(contains? cidr ip)
(contains? cidr-ip cidr-mask ip)

Check if the given CIDR contains the given IP address.

Arguments:
  cidr - CIDR notation string (e.g. "192.168.0.0/24" or "2001:db8::/32")
  ip   - IP address to check (can be InetAddress or string)

reserved-ranges

reserved?

(reserved? ip)

Check if an IP is in a reserved range (loopback or private network).