Skip to main content

Module network

Module network 

Source
Expand description

Network interface detection, IP resolution, Wi-Fi, and related helpers.

Structs§

LinkDomains
One link’s DNS search domains, as reported by resolvectl status.
ResolvectlDomains
DNS search domains from resolvectl status, split by scope.
WifiLink

Enums§

DefaultRouteDomain
Outcome of looking up the default-route link in ResolvectlDomains.

Functions§

detect_active_interface_and_local_ip
Detects the local IP address and active network interface name.
detect_dns
Returns the list of configured DNS nameserver addresses.
detect_domain
Returns the configured DNS domain name.
detect_domain_search
Returns per-interface DNS search domain lists.
detect_networks
Builds the formatted list of network interfaces with IP addresses and RX/TX stats.
detect_public_ip
Fetches the public IP address via an external service (best-effort, 2s timeout).
detect_wifi
Detects the connected Wi-Fi network and link parameters.
format_bytes
Formats a byte count into human-readable form (KB, MB, GB, etc.)
format_global_search_domains
Renders a scope-less (global) search-domain list in the same shape as the per-link resolvectl path: one entry of "<scope>: a, b".
lookup_pci_vendor
Looks up a PCI vendor name from /usr/share/hwdata/pci.ids (or fallback paths).
parse_domain_from_resolv_conf
Parses the domain directive (or first search entry as fallback) from /etc/resolv.conf content.
parse_iw_link_output
parse_netsh_output
parse_proc_net_route
parse_resolv_conf
parse_resolvectl_domains
Parses resolvectl status --no-pager output into per-scope DNS search domains.
parse_resolvectl_search
Parses resolvectl status --no-pager output into per-interface search domain strings.
parse_search_from_resolv_conf
Parses all entries from the search directive in /etc/resolv.conf content.
resolve_default_route_domain
Picks the domain to display for interface from parsed resolvectl output.