Documentation ¶
Overview ¶
tun_linux.go: Open a Tunnel (L3 virtual interface) using the Universal TUN/TAP device driver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IoctlGetInterfaceIndex ¶
IoctlGetInterfaceIndex wraps the SIOCGIFINDEX ioctl
func IoctlTunSetInterfaceFlags ¶
IoctlTunSetInterfaceFlags wraps the TUNSETIFF ioctl
Types ¶
type InterfaceWithDNS ¶
type InterfaceWithDNS struct { io.ReadWriteCloser // contains filtered or unexported fields }
An InterfaceWithDNS is a TUN device capable of dispatching DNS requests that are sent to its configured DNS to a DNS server that uses a local address.
func CreateInterfaceWithDNS ¶
CreateInterfaceWithDNS creates a new TUN device and assigns the first available class C subnet to it. The x.x.x.2 address of that network is then declared to be the DNS service of that network. The interface is then set to state "up".
func (*InterfaceWithDNS) ForwardDNS ¶
func (*InterfaceWithDNS) InterfaceIndex ¶
func (t *InterfaceWithDNS) InterfaceIndex() int
func (*InterfaceWithDNS) Name ¶
func (t *InterfaceWithDNS) Name() string
func (*InterfaceWithDNS) RequestCount ¶
func (t *InterfaceWithDNS) RequestCount() uint64
Click to show internal directories.
Click to hide internal directories.