Functions for interacting with IP addresses and networks.
Functions for interacting with IP addresses and networks.
(->address addr)Coerce addr to an IPAddress, throwing when it cannot be interpreted.
Coerce `addr` to an IPAddress, throwing when it cannot be interpreted.
(->network net)Coerce net to an IPNetwork, throwing when it cannot be interpreted.
Coerce `net` to an IPNetwork, throwing when it cannot be interpreted.
(->network-set coll)Create a hierarchical set from networks in coll.
Create a hierarchical set from networks in `coll`.
(address addr)The IP address for representation addr.
IPv6 zone IDs are accepted and carried in metadata for text round-tripping only. A zone is not part of address identity, equality, hashing, comparison, or network ordering, and is not preserved by serialization. Zones on IPv4 addresses and network literals are rejected.
The IP address for representation addr. IPv6 zone IDs are accepted and carried in metadata for text round-tripping only. A zone is not part of address identity, equality, hashing, comparison, or network ordering, and is not preserved by serialization. Zones on IPv4 addresses and network literals are rejected.
(address-add addr n)The nth address following addr numerically.
The `n`th address following `addr` numerically.
(address-networks start stop)Minimal set of networks containing only the addresses in the range from
start to stop inclusive.
Minimal set of networks containing only the addresses in the range from `start` to `stop` *inclusive*.
(address-range start stop)Sequence of addresses from start to stop inclusive.
Sequence of addresses from `start` to `stop` *inclusive*.
(address-zero? addr)True iff address addr is the zero address.
True iff address `addr` is the zero address.
(address? addr)Determine if addr is a value which represents an IP address.
Determine if `addr` is a value which represents an IP address.
(aggregate-networks values)Return a minimal, ascending network-set covering values exactly.
Values may be addresses or networks, and bare addresses become host networks. IPv4 and IPv6 values are aggregated independently. Invalid or unsupported values are skipped, like invalid values rejected by the namespace's address and network predicates.
Return a minimal, ascending `network-set` covering `values` exactly. Values may be addresses or networks, and bare addresses become host networks. IPv4 and IPv6 values are aggregated independently. Invalid or unsupported values are skipped, like invalid values rejected by the namespace's address and network predicates.
(benchmarking? value)Return true when value is in the IPv4 benchmarking block.
For a network value, true requires the entire network to be inside the benchmarking block. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is in the IPv4 benchmarking block. For a network value, true requires the entire network to be inside the benchmarking block. IPv4-mapped IPv6 addresses are not unwrapped.
(broadcast? value)Return true when value is the IPv4 limited broadcast address.
For a network value, true requires the entire network to be
255.255.255.255/32. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is the IPv4 limited broadcast address. For a network value, true requires the entire network to be `255.255.255.255/32`. IPv4-mapped IPv6 addresses are not unwrapped.
(documentation? value)Return true when value is in an IPv4 or IPv6 documentation block.
For a network value, true requires the entire network to be inside a documentation block. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is in an IPv4 or IPv6 documentation block. For a network value, true requires the entire network to be inside a documentation block. IPv4-mapped IPv6 addresses are not unwrapped.
(global? value)Return true when value is valid and matches no special-use block.
For a network value, true requires the entire network to be outside every special-use block. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is valid and matches no special-use block. For a network value, true requires the entire network to be outside every special-use block. IPv4-mapped IPv6 addresses are not unwrapped.
(inet-address addr)Generate a java.net.InetAddress from the provided value.
Generate a java.net.InetAddress from the provided value.
(link-local? value)Return true when value is in an IPv4 or IPv6 link-local block.
For a network value, true requires the entire network to be inside a link-local block. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is in an IPv4 or IPv6 link-local block. For a network value, true requires the entire network to be inside a link-local block. IPv4-mapped IPv6 addresses are not unwrapped.
(loopback? value)Return true when value is in an IPv4 or IPv6 loopback block.
For a network value, true requires the entire network to be inside a loopback block. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is in an IPv4 or IPv6 loopback block. For a network value, true requires the entire network to be inside a loopback block. IPv4-mapped IPv6 addresses are not unwrapped.
(multicast? value)Return true when value is in an IPv4 or IPv6 multicast block.
For a network value, true requires the entire network to be inside a multicast block. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is in an IPv4 or IPv6 multicast block. For a network value, true requires the entire network to be inside a multicast block. IPv4-mapped IPv6 addresses are not unwrapped.
(network net)(network prefix length)The IP network for representation net or prefix & length.
The IP network for representation `net` or `prefix` & `length`.
(network-compare left right)(network-compare stable left right)Compare the prefixes of networks left and right, with the same result
semantics as compare. When stable is true (the default), 0 will only be
returned when the networks are value-identical; when stable is false, 0 will
be returned as long as the networks are identical up to their minimum common
prefix length.
Compare the prefixes of networks `left` and `right`, with the same result semantics as `compare`. When `stable` is true (the default), 0 will only be returned when the networks are value-identical; when `stable` is false, 0 will be returned as long as the networks are identical up to their minimum common prefix length.
(network-contains? net addr)Determine if network net contains the address/network addr.
Determine if network `net` contains the address/network `addr`.
(network-count net)Count of addresses in network net.
Count of addresses in network `net`.
(network-nth net n)The nth address in the network net. Negative ns count backwards
from the final address at -1.
The `n`th address in the network `net`. Negative `n`s count backwards from the final address at -1.
(network-set & nets)Create a hierarchical set from networks nets.
Create a hierarchical set from networks `nets`.
(network-subnets net)(network-subnets net n)Set of networks within the network net which have n additional bits of
network prefix, default 1.
Set of networks within the network `net` which have `n` additional bits of network prefix, default 1.
(network-supernet net)(network-supernet net n)Network containing the network net with a prefix shorter by n bits,
default 1.
Network containing the network `net` with a prefix shorter by `n` bits, default 1.
(network-trunc prefix)(network-trunc prefix length)Create a network with a prefix consisting of the first length bits of
prefix and a length of length.
Create a network with a prefix consisting of the first `length` bits of `prefix` and a length of `length`.
(network? net)(network? addr length)Determine if net is a value which represents an IP network.
Determine if `net` is a value which represents an IP network.
(private? value)Return true when value is in an RFC 1918 private block.
For a network value, true requires the entire network to be inside one private block. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is in an RFC 1918 private block. For a network value, true requires the entire network to be inside one private block. IPv4-mapped IPv6 addresses are not unwrapped.
(reserved? value)Return true when value is in the IPv4 reserved-for-future-use block.
For a network value, true requires the entire network to be inside the reserved block. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is in the IPv4 reserved-for-future-use block. For a network value, true requires the entire network to be inside the reserved block. IPv4-mapped IPv6 addresses are not unwrapped.
(shared-address-space? value)Return true when value is in the IPv4 shared address space block.
For a network value, true requires the entire network to be inside the shared address space block. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is in the IPv4 shared address space block. For a network value, true requires the entire network to be inside the shared address space block. IPv4-mapped IPv6 addresses are not unwrapped.
(special-use value)Return the most-specific special-use concept keyword for value, or nil.
Address-like and network-like values are accepted. For a network value, the
result is non-nil only when the entire network is inside one special-use
block. IPv4-mapped IPv6 addresses are classified as :ipv4-mapped; they
are not unwrapped and classified as IPv4 addresses.
Return the most-specific special-use concept keyword for `value`, or nil. Address-like and network-like values are accepted. For a network value, the result is non-nil only when the entire network is inside one special-use block. IPv4-mapped IPv6 addresses are classified as `:ipv4-mapped`; they are not unwrapped and classified as IPv4 addresses.
(unique-local? value)Return true when value is in the IPv6 unique-local block.
For a network value, true requires the entire network to be inside the unique-local block. IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is in the IPv6 unique-local block. For a network value, true requires the entire network to be inside the unique-local block. IPv4-mapped IPv6 addresses are not unwrapped.
(unspecified? value)Return true when value is the IPv6 unspecified address.
For a network value, true requires the entire network to be ::/128.
IPv4-mapped IPv6 addresses are not unwrapped.
Return true when `value` is the IPv6 unspecified address. For a network value, true requires the entire network to be `::/128`. IPv4-mapped IPv6 addresses are not unwrapped.
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 |