tailscale/net/interfaces
Josh Bleecher Snyder a16a793605 net/interfaces: use syscalls to find private gateway IP address
iOS doesn't let you run subprocesses,
which means we can't use netstat to get routing information.
Instead, use syscalls and grub around in the results.
We keep the old netstat version around,
both for use in non-cgo builds,
and for use testing the syscall-based version.

Note that iOS doesn't ship route.h,
so we include a copy here from the macOS 10.15 SDK
(which is itself unchanged from the 10.14 SDK).

I have tested manually that this yields the correct
gateway IP address on my own macOS and iOS devices.
More coverage would be most welcome.

Signed-off-by: Josh Bleecher Snyder <josharian@gmail.com>
2020-08-04 15:45:56 -07:00
..
interfaces_darwin_cgo_test.go net/interfaces: use syscalls to find private gateway IP address 2020-08-04 15:45:56 -07:00
interfaces_darwin_cgo.go net/interfaces: use syscalls to find private gateway IP address 2020-08-04 15:45:56 -07:00
interfaces_darwin_nocgo.go net/interfaces: use syscalls to find private gateway IP address 2020-08-04 15:45:56 -07:00
interfaces_darwin.go net/interfaces: use syscalls to find private gateway IP address 2020-08-04 15:45:56 -07:00
interfaces_linux.go net/interfaces: fix likelyHomeRouterIP on Android 2020-07-28 09:12:04 -07:00
interfaces_test.go netcheck, tailcfg, interfaces, magicsock: survey UPnP, NAT-PMP, PCP 2020-07-06 15:25:35 -07:00
interfaces_windows.go net/interfaces: set SysProcAttr.HideWindow to prevent cmd.exe flash on Windows 2020-07-15 12:43:48 -07:00
interfaces.go net/tsaddr: new package to hold Tailscale-specific IPs/ranges 2020-07-06 22:33:29 -07:00
route.h net/interfaces: use syscalls to find private gateway IP address 2020-08-04 15:45:56 -07:00