def get_default_route_src_address_api(): from calibre.utils.iphlpapi import routes for route in routes(): if route.interface and route.destination == '0.0.0.0': for addr in get_addresses_for_interface(route.interface): return addr