Liking cljdoc? Tell your friends :D

eyre.network-parse


compress-ipv6clj

(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).
sourceraw docstring

ifconfig-blocksclj

(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].
sourceraw docstring

ipv4-in-subnet?clj

(ipv4-in-subnet? ip network netmask)

Returns true if ip belongs to network/netmask.

Returns true if `ip` belongs to `network`/`netmask`.
sourceraw docstring

ipv4-octetsclj

(ipv4-octets ip)
source

join-ip-o-linesclj

(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.
sourceraw docstring

parse-angled-flagsclj

(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.
sourceraw docstring

parse-ifconfigclj

(parse-ifconfig s)

Parses ifconfig -a output into a seq of interface maps.

Parses `ifconfig -a` output into a seq of interface maps.
sourceraw docstring

parse-ifconfig-blockclj

(parse-ifconfig-block [name header body])
source

parse-ip-o-addrclj

(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 [...]}.
sourceraw docstring

(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?}.
sourceraw docstring

parse-ip-route-defaultclj

(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}.
sourceraw docstring

parse-netsh-ipv4-show-configclj

(parse-netsh-ipv4-show-config s)
source

parse-netsh-ipv4-show-interfacesclj

(parse-netsh-ipv4-show-interfaces s)
source

parse-netstat-default-routeclj

(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
sourceraw docstring

parse-pipe-rowsclj

(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.
sourceraw docstring

parse-proc-net-default-routeclj

(parse-proc-net-default-route proc-net-route)
source

parse-proc-network-infoclj

(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.
sourceraw docstring

parse-resolv-confclj

(parse-resolv-conf s)

Parses /etc/resolv.conf into {:nameservers [...] :search [...]}.

Parses /etc/resolv.conf into {:nameservers [...] :search [...]}.
sourceraw docstring

parse-scutil-dnsclj

(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.
sourceraw docstring

route-reclj

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close