(compress-ipv6 s)Takes a string representation of an IPv6 address (full or already compressed) and returns its canonical, maximally-compressed form per RFC 5952 (lowercase hex, no leading zeros, longest zero-run collapsed to '::', leftmost run wins ties).
Takes a string representation of an IPv6 address (full or already compressed) and returns its canonical, maximally-compressed form per RFC 5952 (lowercase hex, no leading zeros, longest zero-run collapsed to '::', leftmost run wins ties).
(ifconfig-blocks s)Splits ifconfig -a output into a list of [name header-line body-lines].
Splits ifconfig -a output into a list of [name header-line body-lines].
(ipv4-in-subnet? ip network netmask)Returns true if ip belongs to network/netmask.
Returns true if `ip` belongs to `network`/`netmask`.
(join-ip-o-lines s)ip -o output escapes continuation lines with a trailing backslash. Join those physical lines back into single logical lines.
ip -o output escapes continuation lines with a trailing backslash. Join those physical lines back into single logical lines.
(parse-angled-flags s)Parses a token like flags=1008843<UP,BROADCAST,RUNNING> or
options=880028<VLAN_MTU,JUMBO_MTU> returning
{:value 1008843 :flags #{:UP :BROADCAST :RUNNING}} or nil.
Parses a token like `flags=1008843<UP,BROADCAST,RUNNING>` or
`options=880028<VLAN_MTU,JUMBO_MTU>` returning
`{:value 1008843 :flags #{:UP :BROADCAST :RUNNING}}` or nil.(parse-ifconfig s)Parses ifconfig -a output into a seq of interface maps.
Parses `ifconfig -a` output into a seq of interface maps.
(parse-ip-o-addr s)Parses ip -o addr output into a map of interface-name ->
{:ipv4 [...] :ipv6 [...]}.
Parses `ip -o addr` output into a map of interface-name ->
{:ipv4 [...] :ipv6 [...]}.(parse-ip-o-link s)Parses ip -o link output into a map of interface-name ->
{:mac :mtu :status :loopback?}.
Parses `ip -o link` output into a map of interface-name ->
{:mac :mtu :status :loopback?}.(parse-ip-route-default s)Parses ip route show default output, returns the first default
route as {:address :interface}.
Parses `ip route show default` output, returns the first default
route as {:address :interface}.(parse-netstat-default-route s)Parses netstat -rn output for the default route. Returns
hashmap with :gateway and :interface
Parses `netstat -rn` output for the default route. Returns hashmap with :gateway and :interface
(parse-pipe-rows s)Splits content into seqs of fields split on |. Skips blank lines.
Splits content into seqs of fields split on `|`. Skips blank lines.
(parse-proc-network-info sys-class-net proc-net-route proc-net-fib-trie)Parses raw /sys/class/net, /proc/net/route and /proc/net/fib_trie
dumps into a seq of interface maps, mirroring parse-ifconfig.
Local IPv4 addresses are the host LOCAL /32 leaf entries from
fib_trie. Each is assigned to the interface whose subnet contains it
(subnets come from fib_trie; the owning interface is resolved through
/proc/net/route, with 127.0.0.0/8 inferred as the loopback). The
reported prefix is the containing subnet's prefix length, matching
ifconfig's netmask reporting rather than the /32 host route. The
IPv6 loopback address (::1/128) is added to loopback interfaces.
Parses raw /sys/class/net, /proc/net/route and /proc/net/fib_trie dumps into a seq of interface maps, mirroring `parse-ifconfig`. Local IPv4 addresses are the `host LOCAL` /32 leaf entries from fib_trie. Each is assigned to the interface whose subnet contains it (subnets come from fib_trie; the owning interface is resolved through /proc/net/route, with 127.0.0.0/8 inferred as the loopback). The reported prefix is the containing subnet's prefix length, matching `ifconfig`'s netmask reporting rather than the /32 host route. The IPv6 loopback address (::1/128) is added to loopback interfaces.
(parse-resolv-conf s)Parses /etc/resolv.conf into {:nameservers [...] :search [...]}.
Parses /etc/resolv.conf into {:nameservers [...] :search [...]}.
(parse-scutil-dns s)Parses scutil --dns output, returning the union of nameservers and
search domains across resolvers.
Parses `scutil --dns` output, returning the union of nameservers and search domains across resolvers.
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 |