MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _nmcli_global_values

Function _nmcli_global_values

network_diagnostics.py:744–760  ·  view source on GitHub ↗

Collect values for an nmcli field (e.g. IP4.DOMAINS, IP4.DNS) across all devices. nmcli prints repeated keys as `FIELD[1]:value`.

(field)

Source from the content-addressed store, hash-verified

742# single MAC answering for many IPs (one host impersonating the whole subnet).
743# The kernel neighbour table is authoritative and needs no capture, so this is
744# cheap enough to run on a schedule from the integrity monitor.
745# --------------------------------------------------------------------------
746
747_ARP_BASELINE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)),
748 'data', 'arp_baseline.json')
749_arp_baseline_lock = threading.Lock()
750# A MAC bound to at least this many IPs in the neighbour table is treated as a
751# possible impersonator. Proxy-ARP routers can legitimately answer for a few, so
752# keep the floor above normal noise.
753_ARP_IMPERSONATOR_MIN_IPS = 4
754
755
756def _neigh_entries(iface=None):
757 """Parse `ip -4 neigh` into [(ip, mac, state)] for entries with a lladdr.
758 Scoped to one interface's segment when `iface` is given."""
759 cmd = ['ip', '-4', 'neigh', 'show']
760 if iface:
761 cmd += ['dev', iface]
762 res = _run(cmd, timeout=5)
763 out = []

Callers 2

do_network_identityFunction · 0.85
_system_resolversFunction · 0.85

Calls 3

_haveFunction · 0.85
_runFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected