Conversion between IP addresses or networks and reverse-DNS domains.
This namespace connects inet.data.ip and inet.data.dns. Neither namespace
depends on the other.
Conversion between IP addresses or networks and reverse-DNS domains. This namespace connects `inet.data.ip` and `inet.data.dns`. Neither namespace depends on the other.
(classless-domain->ip value)Return the IPv4 network represented by an RFC 2317 reverse-DNS value.
The classless label must contain the network's final octet and a prefix
from /25 through /31, followed by the other three reversed octets and
in-addr.arpa. One trailing dot is accepted. Malformed input returns nil.
Return the IPv4 network represented by an RFC 2317 reverse-DNS `value`. The classless label must contain the network's final octet and a prefix from `/25` through `/31`, followed by the other three reversed octets and `in-addr.arpa`. One trailing dot is accepted. Malformed input returns `nil`.
(classless-ip->domain value)Return the RFC 2317 reverse-DNS dns/domain for an IPv4 network.
This opt-in conversion accepts classless prefixes from /25 through /31
beneath a /24 reverse zone. It returns nil for IPv4 addresses, IPv6
values, prefixes outside that range, and malformed input. The existing
ip->domain behavior is unchanged.
Return the RFC 2317 reverse-DNS `dns/domain` for an IPv4 network. This opt-in conversion accepts classless prefixes from `/25` through `/31` beneath a `/24` reverse zone. It returns `nil` for IPv4 addresses, IPv6 values, prefixes outside that range, and malformed input. The existing `ip->domain` behavior is unchanged.
(domain->ip value)Return an IP address or network represented by reverse-DNS value.
This function reads in-addr.arpa names at octet granularity and ip6.arpa
names at nibble granularity. Suffix matching ignores case. The function
accepts one trailing dot. Malformed input returns nil. IPv4-mapped IPv6
names stay IPv6 and therefore give an ip6.arpa result. Accepted values are
strings, primitive byte arrays, existing DNS domain values, and nil. This is
lenient and returns nil for malformed or unsupported input; it catches every
java.lang.Exception and does not throw for those failures. Conversion is
O(b) in the encoded domain length.
Return an IP address or network represented by reverse-DNS `value`. This function reads `in-addr.arpa` names at octet granularity and `ip6.arpa` names at nibble granularity. Suffix matching ignores case. The function accepts one trailing dot. Malformed input returns `nil`. IPv4-mapped IPv6 names stay IPv6 and therefore give an `ip6.arpa` result. Accepted values are strings, primitive byte arrays, existing DNS domain values, and nil. This is lenient and returns `nil` for malformed or unsupported input; it catches every `java.lang.Exception` and does not throw for those failures. Conversion is O(b) in the encoded domain length.
(ip->domain value)Return the reverse-DNS dns/domain for IP address or network value.
This function supports IPv4 networks only at octet-aligned prefixes, and
IPv6 networks only at nibble-aligned prefixes. Non-aligned prefixes return
nil. This function deliberately does not implement RFC 2317 classless IPv4
delegation. It treats IPv4-mapped IPv6 values as IPv6 values and returns
ip6.arpa names. Malformed input returns nil, the same as the
non-exceptional behavior of ip/address? and dns/domain?.
The accepted values are strings, byte arrays, java.net.InetAddress,
java.math.BigInteger, and existing IP address or network values. This is
lenient and returns nil for malformed, nil, unsupported, or non-aligned
input; it catches every java.lang.Exception and does not throw for those
failures. Conversion is O(1) for the fixed maximum IP address width.
Return the reverse-DNS `dns/domain` for IP address or network `value`. This function supports IPv4 networks only at octet-aligned prefixes, and IPv6 networks only at nibble-aligned prefixes. Non-aligned prefixes return `nil`. This function deliberately does not implement RFC 2317 classless IPv4 delegation. It treats IPv4-mapped IPv6 values as IPv6 values and returns `ip6.arpa` names. Malformed input returns `nil`, the same as the non-exceptional behavior of `ip/address?` and `dns/domain?`. The accepted values are strings, byte arrays, `java.net.InetAddress`, `java.math.BigInteger`, and existing IP address or network values. This is lenient and returns `nil` for malformed, nil, unsupported, or non-aligned input; it catches every `java.lang.Exception` and does not throw for those failures. Conversion is O(1) for the fixed maximum IP address width.
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 |