You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
4 years ago
..
interfaces.go net/tsaddr: new package to hold Tailscale-specific IPs/ranges 4 years ago
interfaces_darwin.go net/interfaces: use syscalls to find private gateway IP address 4 years ago
interfaces_darwin_cgo.go net/interfaces: use syscalls to find private gateway IP address 4 years ago
interfaces_darwin_cgo_test.go net/interfaces: use syscalls to find private gateway IP address 4 years ago
interfaces_darwin_nocgo.go net/interfaces: use syscalls to find private gateway IP address 4 years ago
interfaces_linux.go net/interfaces: fix likelyHomeRouterIP on Android 4 years ago
interfaces_test.go netcheck, tailcfg, interfaces, magicsock: survey UPnP, NAT-PMP, PCP 4 years ago
interfaces_windows.go net/interfaces: set SysProcAttr.HideWindow to prevent cmd.exe flash on Windows 4 years ago
route.h net/interfaces: use syscalls to find private gateway IP address 4 years ago