Return types of os:type/0 and default route discovery

zxq9 zxq9@REDACTED
Fri Feb 5 08:16:55 CET 2021

On 2021/02/05 16:03, zxq9 wrote:
>    default_iface({Family, Name} ->
>        %...?

I've been made aware of this in the OTP code:

{unix, linux}
{unix, openbsd}
{unix, freebsd}
{unix, netbsd}
{unix, darwin}
{unix, sunos}
{win32, nt}

This isn't comprehensive, but it's probably good enough to solve the 90% 

With that in mind...
What commands are the equivalent to `ip route get` on Linux
or `route -4` on Windows 10?

Both of those give me the default route, the default gateway, the 
default interface and the default interface's address and subnet (or a 
way I can get at all of those).

If I can just discover the default interface I can get the rest sorted 
out from information in inet:getifaddrs/0.


More information about the erlang-questions mailing list