Functions for interacting with IP addresses and networks.
Functions for interacting with IP addresses and networks.
(->address addr)Coerce addr to an IPAddress. Accepted values are the same strings, byte
arrays, java.net.InetAddress, java.math.BigInteger, and existing address
or network values accepted by address. This is strict: malformed or
unsupported input throws inet.data.ip.IPAddressException.
Coerce `addr` to an IPAddress. Accepted values are the same strings, byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing address or network values accepted by `address`. This is strict: malformed or unsupported input throws `inet.data.ip.IPAddressException`.
(->network net)Coerce net to an IPNetwork. Accepted values are the representations
accepted by network. This is strict: malformed or unsupported input throws
inet.data.ip.IPNetworkException.
Coerce `net` to an IPNetwork. Accepted values are the representations accepted by `network`. This is strict: malformed or unsupported input throws `inet.data.ip.IPNetworkException`.
(->network-set coll)Create a hierarchical set from networks in finite seqable coll, or an
empty set when coll is nil. Members accept the representations supported by
network. A malformed supported member becomes nil; a one-member nil set is
retained, while comparing nil with another member throws
inet.data.ip.IPNetworkException. An unsupported member or non-seqable
coll throws java.lang.IllegalArgumentException. Building n members takes
O(n^2) worst-case time and O(n) space.
Create a hierarchical set from networks in finite seqable `coll`, or an empty set when `coll` is nil. Members accept the representations supported by `network`. A malformed supported member becomes nil; a one-member nil set is retained, while comparing nil with another member throws `inet.data.ip.IPNetworkException`. An unsupported member or non-seqable `coll` throws `java.lang.IllegalArgumentException`. Building `n` members takes O(n^2) worst-case time and O(n) space.
(address addr)Return the IP address for representation addr.
This function accepts IPv6 zone IDs. It keeps a zone in metadata for text round-tripping only. A zone is not part of address identity, equality, hashing, comparison, or network ordering. Serialization does not keep the zone. This function rejects zones on IPv4 addresses and on network literals.
Accepted values are strings, byte arrays, java.net.InetAddress values,
java.math.BigInteger values, and existing address or network values. This
is lenient for those supported representations: malformed input returns
nil. An unsupported type throws java.lang.IllegalArgumentException.
Parsing is O(1) for the fixed maximum address width.
Return the IP address for representation `addr`. This function accepts IPv6 zone IDs. It keeps a zone in metadata for text round-tripping only. A zone is not part of address identity, equality, hashing, comparison, or network ordering. Serialization does not keep the zone. This function rejects zones on IPv4 addresses and on network literals. Accepted values are strings, byte arrays, `java.net.InetAddress` values, `java.math.BigInteger` values, and existing address or network values. This is lenient for those supported representations: malformed input returns `nil`. An unsupported type throws `java.lang.IllegalArgumentException`. Parsing is O(1) for the fixed maximum address width.
(address-add addr n)Return the nth address after addr in numeric order. addr is any value
accepted by ->address; n may be a number coercible to long, a
clojure.lang.BigInt, or a java.math.BigInteger. Invalid addr throws
inet.data.ip.IPAddressException. Nil n throws
java.lang.NullPointerException; a non-number throws
java.lang.ClassCastException. Numeric values other than BigInt and
BigInteger are converted to long, truncating fractions; an out-of-range
conversion throws java.lang.IllegalArgumentException. This is O(1).
Return the `n`th address after `addr` in numeric order. `addr` is any value accepted by `->address`; `n` may be a number coercible to `long`, a `clojure.lang.BigInt`, or a `java.math.BigInteger`. Invalid `addr` throws `inet.data.ip.IPAddressException`. Nil `n` throws `java.lang.NullPointerException`; a non-number throws `java.lang.ClassCastException`. Numeric values other than `BigInt` and `BigInteger` are converted to `long`, truncating fractions; an out-of-range conversion throws `java.lang.IllegalArgumentException`. This is O(1).
(address-networks start stop)Return the minimal set of networks that contains only the addresses from
start to stop, inclusive. Both endpoints accept values accepted by
->address; invalid input throws inet.data.ip.IPAddressException. For k
output networks, the operation is O(k log k) time and O(k) output space; a
reversed range returns an empty set.
Return the minimal set of networks that contains only the addresses from `start` to `stop`, *inclusive*. Both endpoints accept values accepted by `->address`; invalid input throws `inet.data.ip.IPAddressException`. For `k` output networks, the operation is O(k log k) time and O(k) output space; a reversed range returns an empty set.
(address-range start stop)Return a lazy sequence of addresses from start to stop, inclusive.
Both endpoints accept the values accepted by ->address. Invalid input
throws inet.data.ip.IPAddressException. Producing k addresses takes
O(k) time and O(1) additional space per realized step.
Return a lazy sequence of addresses from `start` to `stop`, *inclusive*. Both endpoints accept the values accepted by `->address`. Invalid input throws `inet.data.ip.IPAddressException`. Producing `k` addresses takes O(k) time and O(1) additional space per realized step.
(address-zero? addr)True if and only if the address addr is the zero address. addr must be a
string, primitive byte array, java.net.InetAddress, java.math.BigInteger,
or existing IP address/network value. This low-level predicate does not
validate supported values; malformed strings can be treated as empty and
return true. Nil or an unsupported type throws
java.lang.IllegalArgumentException. The scan is O(w), where w is the
supplied byte width.
True if and only if the address `addr` is the zero address. `addr` must be a string, primitive byte array, `java.net.InetAddress`, `java.math.BigInteger`, or existing IP address/network value. This low-level predicate does not validate supported values; malformed strings can be treated as empty and return true. Nil or an unsupported type throws `java.lang.IllegalArgumentException`. The scan is O(w), where `w` is the supplied byte width.
(address? addr)Determine if addr represents an IP address. It accepts strings, byte
arrays, java.net.InetAddress, java.math.BigInteger, and existing IP
values. This is lenient and returns false for unsupported or malformed
input without throwing. Validation is O(1) for the fixed address width.
Determine if `addr` represents an IP address. It accepts strings, byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient and returns `false` for unsupported or malformed input without throwing. Validation is O(1) for the fixed address width.
(aggregate-networks values)Return a minimal, ascending network-set covering values exactly.
Values can be addresses or networks. Bare addresses become host networks. This function aggregates IPv4 and IPv6 values independently. It skips invalid or unsupported values, the same as the invalid values that this namespace's address and network predicates reject.
values is a collection or seqable of address/network representations.
Invalid members are skipped and an empty input returns an empty set. For n
input values, the worst-case running time is O(n^2) and additional space is
O(n); the number of fixed-point passes is bounded by the 128-bit maximum
address width. A non-seqable values throws
java.lang.IllegalArgumentException.
Return a minimal, ascending `network-set` covering `values` exactly. Values can be addresses or networks. Bare addresses become host networks. This function aggregates IPv4 and IPv6 values independently. It skips invalid or unsupported values, the same as the invalid values that this namespace's address and network predicates reject. `values` is a collection or seqable of address/network representations. Invalid members are skipped and an empty input returns an empty set. For `n` input values, the worst-case running time is O(n^2) and additional space is O(n); the number of fixed-point passes is bounded by the 128-bit maximum address width. A non-seqable `values` throws `java.lang.IllegalArgumentException`.
(benchmarking? value)Return true when value is in the IPv4 benchmarking block.
For a network value, the result is true only when the full network is
inside the benchmarking block. This function does not unwrap IPv4-mapped
IPv6 addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is in the IPv4 benchmarking block. For a network value, the result is true only when the full network is inside the benchmarking block. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(broadcast? value)Return true when value is the IPv4 limited broadcast address.
For a network value, the result is true only when the full network is
255.255.255.255/32. This function does not unwrap IPv4-mapped IPv6
addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is the IPv4 limited broadcast address. For a network value, the result is true only when the full network is `255.255.255.255/32`. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(documentation? value)Return true when value is in an IPv4 or IPv6 documentation block.
For a network value, the result is true only when the full network is
inside a documentation block. This function does not unwrap IPv4-mapped
IPv6 addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is in an IPv4 or IPv6 documentation block. For a network value, the result is true only when the full network is inside a documentation block. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(global? value)Return true when value is valid and matches no special-use block.
For a network value, the result is true only when the full network is
outside every special-use block. This function does not unwrap IPv4-mapped
IPv6 addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is valid and matches no special-use block. For a network value, the result is true only when the full network is outside every special-use block. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(inet-address addr)Generate a java.net.InetAddress from addr, which may be any value
accepted by ->address. This is strict and throws
inet.data.ip.IPAddressException when addr cannot be interpreted.
Generate a `java.net.InetAddress` from `addr`, which may be any value accepted by `->address`. This is strict and throws `inet.data.ip.IPAddressException` when `addr` cannot be interpreted.
(link-local? value)Return true when value is in an IPv4 or IPv6 link-local block.
For a network value, the result is true only when the full network is
inside a link-local block. This function does not unwrap IPv4-mapped IPv6
addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is in an IPv4 or IPv6 link-local block. For a network value, the result is true only when the full network is inside a link-local block. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(loopback? value)Return true when value is in an IPv4 or IPv6 loopback block.
For a network value, the result is true only when the full network is
inside a loopback block. This function does not unwrap IPv4-mapped IPv6
addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is in an IPv4 or IPv6 loopback block. For a network value, the result is true only when the full network is inside a loopback block. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(multicast? value)Return true when value is in an IPv4 or IPv6 multicast block.
For a network value, the result is true only when the full network is
inside a multicast block. This function does not unwrap IPv4-mapped IPv6
addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is in an IPv4 or IPv6 multicast block. For a network value, the result is true only when the full network is inside a multicast block. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(network net)(network prefix length)Return the IP network for representation net or prefix and length.
Accepted representations are strings, byte arrays, java.net.InetAddress,
java.math.BigInteger, and existing address or network values. This is
lenient for those supported representations: malformed input returns nil.
An unsupported type throws java.lang.IllegalArgumentException. In the
two-argument form, length accepts a number coercible to long; nil throws
java.lang.NullPointerException, a non-number throws
java.lang.ClassCastException, and a numeric value outside the long range
throws java.lang.IllegalArgumentException. A long-range prefix outside the
address width or not network-aligned returns nil. Parsing is O(1) for the
fixed address width.
Return the IP network for representation `net` or `prefix` and `length`. Accepted representations are strings, byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing address or network values. This is lenient for those supported representations: malformed input returns `nil`. An unsupported type throws `java.lang.IllegalArgumentException`. In the two-argument form, `length` accepts a number coercible to `long`; nil throws `java.lang.NullPointerException`, a non-number throws `java.lang.ClassCastException`, and a numeric value outside the long range throws `java.lang.IllegalArgumentException`. A long-range prefix outside the address width or not network-aligned returns `nil`. Parsing is O(1) for the fixed address width.
(network-compare left right)(network-compare stable left right)Compare the prefixes of networks left and right. The result semantics
are the same as compare. When stable is true (the default), the result is 0
only when the networks are value-identical. When stable is false, the result
is 0 when the networks are identical up to their minimum common prefix length.
Arguments accept values accepted by ->network. This is strict and throws
inet.data.ip.IPNetworkException for invalid input. Comparison is O(1) for
the fixed maximum IP address width. stable must be Boolean; nil throws
java.lang.NullPointerException and a non-Boolean value throws
java.lang.ClassCastException.
Compare the prefixes of networks `left` and `right`. The result semantics are the same as `compare`. When `stable` is true (the default), the result is 0 only when the networks are value-identical. When `stable` is false, the result is 0 when the networks are identical up to their minimum common prefix length. Arguments accept values accepted by `->network`. This is strict and throws `inet.data.ip.IPNetworkException` for invalid input. Comparison is O(1) for the fixed maximum IP address width. `stable` must be Boolean; nil throws `java.lang.NullPointerException` and a non-Boolean value throws `java.lang.ClassCastException`.
(network-contains? net addr)Determine if network net contains the address or network addr. Both
arguments accept values accepted by ->network. This is strict and throws
inet.data.ip.IPNetworkException when either value cannot be interpreted.
Comparison is O(1) for the fixed maximum IP address width.
Determine if network `net` contains the address or network `addr`. Both arguments accept values accepted by `->network`. This is strict and throws `inet.data.ip.IPNetworkException` when either value cannot be interpreted. Comparison is O(1) for the fixed maximum IP address width.
(network-count net)Count of addresses in network net. count on an IPNetwork throws an
IPNetworkException when this value exceeds Integer/MAX_VALUE; use this
function for the exact count. net accepts values accepted by ->network.
Invalid input throws inet.data.ip.IPNetworkException. This is O(1) for the
fixed maximum IP address width.
Count of addresses in network `net`. `count` on an IPNetwork throws an IPNetworkException when this value exceeds Integer/MAX_VALUE; use this function for the exact count. `net` accepts values accepted by `->network`. Invalid input throws `inet.data.ip.IPNetworkException`. This is O(1) for the fixed maximum IP address width.
(network-intersect left right)Return the intersection of CIDR networks left and right, or nil when
they are disjoint. Since CIDR networks can only overlap by containment, the
result is the narrower network.
Return the intersection of CIDR networks `left` and `right`, or nil when they are disjoint. Since CIDR networks can only overlap by containment, the result is the narrower network.
(network-nth net n)Return the nth address in the network net. Negative ns count backward
from the final address at -1. net accepts values accepted by ->network.
Invalid networks throw inet.data.ip.IPNetworkException; an out-of-range
index throws java.lang.IndexOutOfBoundsException. n accepts numeric values;
nil throws java.lang.NullPointerException and a non-number throws
java.lang.ClassCastException. The operation is O(1) for the fixed maximum
IP address width.
Return the `n`th address in the network `net`. Negative `n`s count backward from the final address at -1. `net` accepts values accepted by `->network`. Invalid networks throw `inet.data.ip.IPNetworkException`; an out-of-range index throws `java.lang.IndexOutOfBoundsException`. `n` accepts numeric values; nil throws `java.lang.NullPointerException` and a non-number throws `java.lang.ClassCastException`. The operation is O(1) for the fixed maximum IP address width.
(network-set & nets)Create a hierarchical set from variadic networks nets; each member accepts
the representations supported by network. A malformed supported member
becomes nil; a one-member nil set is retained, while comparing nil with
another member throws inet.data.ip.IPNetworkException. An unsupported
member throws java.lang.IllegalArgumentException. Building n members
takes O(n^2) worst-case time and O(n) space.
Create a hierarchical set from variadic networks `nets`; each member accepts the representations supported by `network`. A malformed supported member becomes nil; a one-member nil set is retained, while comparing nil with another member throws `inet.data.ip.IPNetworkException`. An unsupported member throws `java.lang.IllegalArgumentException`. Building `n` members takes O(n^2) worst-case time and O(n) space.
(network-subnets net)(network-subnets net n)Set of networks in the network net which have n more bits of network
prefix, default 1. net accepts values accepted by ->network; n is a
non-negative integer prefix increment. Invalid net throws
inet.data.ip.IPNetworkException; nil n throws
java.lang.NullPointerException, a non-number throws
java.lang.ClassCastException, and a negative n can throw
java.lang.IllegalArgumentException unless network-length + n is
non-negative and the input prefix is aligned to that shorter length; in that
case it returns that one more-general network. Negative values are outside
this function's subnet contract. If n exceeds the available host bits, the
result is an empty set.
For m = 2^n valid subnets, construction takes O(m log m) time and O(m)
output space.
Set of networks in the network `net` which have `n` more bits of network prefix, default 1. `net` accepts values accepted by `->network`; `n` is a non-negative integer prefix increment. Invalid `net` throws `inet.data.ip.IPNetworkException`; nil `n` throws `java.lang.NullPointerException`, a non-number throws `java.lang.ClassCastException`, and a negative `n` can throw `java.lang.IllegalArgumentException` unless `network-length + n` is non-negative and the input prefix is aligned to that shorter length; in that case it returns that one more-general network. Negative values are outside this function's subnet contract. If `n` exceeds the available host bits, the result is an empty set. For `m = 2^n` valid subnets, construction takes O(m log m) time and O(m) output space.
(network-subtract left right)Return a minimal network-set covering network left minus right.
Return a minimal `network-set` covering network `left` minus `right`.
(network-supernet net)(network-supernet net n)Return a network that contains net. Its prefix is n bits shorter. The
default is 1. net accepts values accepted by ->network; n is a numeric
integer prefix decrement. Invalid net throws inet.data.ip.IPNetworkException; nil
n throws java.lang.NullPointerException, and a non-number throws
java.lang.ClassCastException. A decrement larger than the prefix returns
nil. Negative n is not rejected: it requests a more-specific prefix and
returns that network when aligned and in range, otherwise nil. This is O(1).
Return a network that contains `net`. Its prefix is `n` bits shorter. The default is 1. `net` accepts values accepted by `->network`; `n` is a numeric integer prefix decrement. Invalid `net` throws `inet.data.ip.IPNetworkException`; nil `n` throws `java.lang.NullPointerException`, and a non-number throws `java.lang.ClassCastException`. A decrement larger than the prefix returns `nil`. Negative `n` is not rejected: it requests a more-specific prefix and returns that network when aligned and in range, otherwise nil. This is O(1).
(network-trunc prefix)(network-trunc prefix length)Create a network. Its prefix is the first length bits of prefix, and its
length is length. prefix accepts values accepted by ->address; length
accepts a number coercible to long. In the one-argument form, a malformed
string or nil prefix throws inet.data.ip.IPNetworkException, while a
malformed primitive byte array throws inet.data.ip.IPAddressException; in
the two-argument form any invalid prefix throws
inet.data.ip.IPAddressException. Nil length throws
java.lang.NullPointerException, a non-number throws
java.lang.ClassCastException, a negative length throws
java.lang.ArrayIndexOutOfBoundsException, and a length wider than the
address returns nil when it is representable as a long. A numeric value
outside the long range throws java.lang.IllegalArgumentException. In the
one-argument form, an unsupported prefix type also throws
java.lang.IllegalArgumentException. The operation is O(1).
Create a network. Its prefix is the first `length` bits of `prefix`, and its length is `length`. `prefix` accepts values accepted by `->address`; `length` accepts a number coercible to `long`. In the one-argument form, a malformed string or nil prefix throws `inet.data.ip.IPNetworkException`, while a malformed primitive byte array throws `inet.data.ip.IPAddressException`; in the two-argument form any invalid prefix throws `inet.data.ip.IPAddressException`. Nil length throws `java.lang.NullPointerException`, a non-number throws `java.lang.ClassCastException`, a negative length throws `java.lang.ArrayIndexOutOfBoundsException`, and a length wider than the address returns `nil` when it is representable as a long. A numeric value outside the long range throws `java.lang.IllegalArgumentException`. In the one-argument form, an unsupported prefix type also throws `java.lang.IllegalArgumentException`. The operation is O(1).
(network? net)(network? addr length)Determine if net represents an IP network. It accepts the same values as
network; the two-argument form also accepts a number coercible to long as
the prefix length. This is lenient and returns false for unsupported or
malformed address/network input. With a supported address, nil length
throws java.lang.NullPointerException and a non-number throws
java.lang.ClassCastException; a numeric value outside the long range throws
java.lang.IllegalArgumentException. Validation is O(1).
Determine if `net` represents an IP network. It accepts the same values as `network`; the two-argument form also accepts a number coercible to `long` as the prefix length. This is lenient and returns `false` for unsupported or malformed address/network input. With a supported address, nil `length` throws `java.lang.NullPointerException` and a non-number throws `java.lang.ClassCastException`; a numeric value outside the long range throws `java.lang.IllegalArgumentException`. Validation is O(1).
(private? value)Return true when value is in an RFC 1918 private block.
For a network value, the result is true only when the full network is
inside one private block. This function does not unwrap IPv4-mapped IPv6
addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is in an RFC 1918 private block. For a network value, the result is true only when the full network is inside one private block. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(reserved? value)Return true when value is in the IPv4 reserved-for-future-use block.
For a network value, the result is true only when the full network is
inside the reserved block. This function does not unwrap IPv4-mapped IPv6
addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is in the IPv4 reserved-for-future-use block. For a network value, the result is true only when the full network is inside the reserved block. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(shared-address-space? value)Return true when value is in the IPv4 shared address space block.
For a network value, the result is true only when the full network is
inside the shared address space block. This function does not unwrap
IPv4-mapped IPv6 addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is in the IPv4 shared address space block. For a network value, the result is true only when the full network is inside the shared address space block. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(special-use value)Return the most-specific special-use concept keyword for value, or nil.
The function accepts address-like and network-like values. For a network
value, the result is non-nil only when the full network is inside one
special-use block. IPv4-mapped IPv6 addresses have the :ipv4-mapped
classification. This function does not unwrap them as IPv4 addresses. The
input may be an address or network representation accepted by this namespace.
Concretely, it accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns nil without
throwing. Classification is O(1) because address width and the block table
are fixed.
Return the most-specific special-use concept keyword for `value`, or `nil`. The function accepts address-like and network-like values. For a network value, the result is non-`nil` only when the full network is inside one special-use block. IPv4-mapped IPv6 addresses have the `:ipv4-mapped` classification. This function does not unwrap them as IPv4 addresses. The input may be an address or network representation accepted by this namespace. Concretely, it accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns `nil` without throwing. Classification is O(1) because address width and the block table are fixed.
(unique-local? value)Return true when value is in the IPv6 unique-local block.
For a network value, the result is true only when the full network is
inside the unique-local block. This function does not unwrap IPv4-mapped
IPv6 addresses. value accepts strings, primitive byte arrays,
java.net.InetAddress, java.math.BigInteger, and existing IP values. This
is lenient: malformed, nil, or unsupported input returns false without
throwing. Classification is O(1).
Return true when `value` is in the IPv6 unique-local block. For a network value, the result is true only when the full network is inside the unique-local block. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
(unspecified? value)Return true when value is the IPv6 unspecified address.
For a network value, the result is true only when the full network is
::/128. This function does not unwrap IPv4-mapped IPv6 addresses. value
accepts strings, primitive byte arrays, java.net.InetAddress,
java.math.BigInteger, and existing IP values. This is lenient: malformed,
nil, or unsupported input returns false without throwing. Classification is
O(1).
Return true when `value` is the IPv6 unspecified address. For a network value, the result is true only when the full network is `::/128`. This function does not unwrap IPv4-mapped IPv6 addresses. `value` accepts strings, primitive byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP values. This is lenient: malformed, nil, or unsupported input returns false without throwing. Classification is O(1).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |