tun

package
v0.0.0-...-83b6606 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateProxyTUN

func CreateProxyTUN(addr *proxy.ProxyAddr) (*proxy.Proxy, error)

Types

type NativeTUN

type NativeTUN struct {
	*os.File
	netlink.Link
	// contains filtered or unexported fields
}

func CreateNativeTun

func CreateNativeTun(addr *proxy.ProxyAddr) (*NativeTUN, error)

func (*NativeTUN) AddAddressCIDR

func (tun *NativeTUN) AddAddressCIDR(cidrAddr string) error

func (*NativeTUN) Close

func (tun *NativeTUN) Close() error

func (*NativeTUN) Index

func (tun *NativeTUN) Index() int

func (*NativeTUN) LocalAddr

func (tun *NativeTUN) LocalAddr() net.Addr

func (*NativeTUN) MTU

func (tun *NativeTUN) MTU() int

func (*NativeTUN) RemoteAddr

func (tun *NativeTUN) RemoteAddr() net.Addr

func (*NativeTUN) SetMTU

func (tun *NativeTUN) SetMTU(mtu int) error

func (*NativeTUN) SetUP

func (tun *NativeTUN) SetUP() error

type ProxyTUN

type ProxyTUN struct {
	TUNDevice
}

type TUNDevice

type TUNDevice interface {
	net.Conn
	MTU() int
	SetMTU(mtu int) error
	SetUP() error
	AddAddressCIDR(addrCIDR string) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL