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

Function do_arp_scan

network_diagnostics.py:431–446  ·  view source on GitHub ↗
(interface)

Source from the content-addressed store, hash-verified

429 # A device updated from the UI may not have finished (or may have missed)
430 # background tool provisioning, and the old behaviour was to just error out
431 # telling the user to run the installer. Install it here so the button works.
432 if not _have('speedtest-cli') and not _have('speedtest'):
433 do_install_tool('speedtest-cli')
434
435 kind, exe = _speedtest_client()
436 if not kind:
437 return {'success': False, **meta,
438 'error': 'speedtest is not installed. Click Install to add it.',
439 'missing_tool': 'speedtest-cli'}
440
441 if kind == 'ookla':
442 cmd = [exe, '--format=json', '--accept-license', '--accept-gdpr']
443 if bind:
444 cmd += ['--interface', iface] # a real device bind
445 res = _run(cmd, timeout=120)
446 if res['rc'] == 0:
447 try:
448 d = json.loads(res['out'])
449 dl = d.get('download', {}).get('bandwidth', 0) * 8 / 1e6

Callers 1

net_arp_scanFunction · 0.85

Calls 3

_haveFunction · 0.85
_runFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected