Skip to main content

Module address

Module address 

Source
Expand description

Which machine a remote pane is connected to, by name and address, for its stats badge tooltip (blockstats.detail).

  • SSH: ssh -G says which host a destination really names (the user’s ssh config applies: an alias’s HostName, Include, Match), and a DNS lookup gives its address. Through a ProxyJump the address is what this computer resolves the name to, which may be none.
  • WSL: the distribution’s address on the interface its default route uses, from /proc/net/route and /proc/net/fib_trie, which every distribution has (BusyBox’s hostname has no -I).

Answers are kept for TTL, failures too, so a tooltip that asks every few seconds runs ssh or wsl.exe at most once in that time.

Structs§

RemoteAddress
A remote pane’s machine. Either part is None when it couldn’t be found.

Constants§

STEP_TIMEOUT 🔒
How long ssh -G, wsl.exe or a DNS lookup may take.
TTL 🔒
How long an answer is kept.

Functions§

linux_address 🔒
A Linux machine’s own IPv4 address, from /proc/net/route followed by /proc/net/fib_trie: of its local addresses, the one in a network on the interface the default route uses, else the first that isn’t loopback. WSL also puts its DNS proxy’s address on lo, which this skips.
of
RemoteAddress for a remote connection, from the cache when it is fresh; None for a local one.
parse_ssh_g 🔒
hostname and port from ssh -G’s output.
resolve 🔒
host’s address: itself when it is one, else the first a lookup gives, IPv4 first.
ssh 🔒
wsl_address 🔒

Type Aliases§

Slot 🔒