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

Function gather_all_network_interfaces

wifi_interfaces.py:408–413  ·  view source on GitHub ↗

Gather both WiFi and Ethernet interfaces.

(wifi_default: str = 'wlan0', ethernet_default: str = 'eth0')

Source from the content-addressed store, hash-verified

406 ip_addr = iface.get('ip_address')
407 if iface.get('connected') and iface.get('has_carrier') and ip_addr and not is_link_local_ip(ip_addr):
408 return iface
409 return None
410
411
412def is_ethernet_available() -> bool:
413 """Check if any Ethernet interface is available and connected."""
414 return get_active_ethernet_interface() is not None
415
416

Callers

nothing calls this directly

Calls 2

gather_wifi_interfacesFunction · 0.85

Tested by

no test coverage detected