Split VirtualNetworkStack into an interface with two implementations: the existing lwIP stack, and a new one that creates a TUN or TAP interface and configures it over netlink, so the kernel handles the device's traffic. The factory prefers the TUN stack and falls back to lwIP when CAP_NET_ADMIN is missing. Tunnels now expose their network stack, and idund tells clients whether a tunnel is reachable directly through the system, in which case they connect with plain sockets instead of relaying through the daemon.
9 lines
227 B
Vala
9 lines
227 B
Vala
[CCode (cheader_filename = "linux/if_tun.h", cprefix = "", lower_case_cprefix = "")]
|
|
namespace Linux.If {
|
|
public const short IFF_TUN;
|
|
public const short IFF_TAP;
|
|
public const short IFF_NO_PI;
|
|
|
|
public const int TUNSETIFF;
|
|
}
|