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

Function _flap_sequence

network_diagnostics.py:1318–1331  ·  view source on GitHub ↗

Bring the link down/up `count` times so the switch's LINK LED blinks in a recognisable cadence. Always leaves the interface up when finished.

(interface, count, on_ms, off_ms)

Source from the content-addressed store, hash-verified

1316 reasons.append(f"MAC {imp['mac']} answers for {len(ips)} IPs "
1317 f"({', '.join(ips[:4])}{'…' if len(ips) > 4 else ''}) "
1318 '— possible ARP spoofing')
1319
1320 # Optional passive ARP-frame capture (opt-in via capture_seconds > 0). The
1321 # fast neighbour-table analysis above always runs; this only adds live-frame
1322 # signals when a caller asks for them (the Net Integrity rotation), so the
1323 # every-cycle fast core stays a cheap table read.
1324 capture = None
1325 if capture_seconds and int(capture_seconds) > 0:
1326 exempt = _local_macs()
1327 if gw_mac:
1328 exempt.add(gw_mac.lower())
1329 if confirmed_vmac:
1330 exempt.add(confirmed_vmac)
1331 events = _arp_frame_capture(iface, int(capture_seconds))
1332 cfind, cverdict, creasons = _arp_capture_analyze(events, int(capture_seconds), exempt)
1333 capture = {'seconds': int(capture_seconds), 'frames': len(events),
1334 'findings': cfind}

Callers

nothing calls this directly

Calls 4

rangeFunction · 0.85
_runFunction · 0.85
popMethod · 0.80
sleepMethod · 0.45

Tested by

no test coverage detected