tunbased

package
v0.0.0-...-ee0ced5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCommand

func ExecCommand(name, sargs string) error

ExecCommand ...

func GetCfg

func GetCfg() water.Config

func GetWaterIfF

func GetWaterIfF(ifce *water.Interface) *os.File

func Ifconfig

func Ifconfig(tunName, network string, _ uint32)

func Ipv4MaskString

func Ipv4MaskString(m []byte) string

func MakeTcpipError

func MakeTcpipError(msg string, ignoreStats bool) *tcpip.Error

func New

func New(opts *Options) (stack.LinkEndpoint, error)

func SetUnexportedField

func SetUnexportedField(v reflect.Value) reflect.Value

Types

type NonBlockingRWInterface

type NonBlockingRWInterface interface {
	NonBlockingWrite(buf []byte) *tcpip.Error
	NonBlockingWrite3(b1, b2, b3 []byte) *tcpip.Error
	DispatchInboundLoop() *tcpip.Error
}

type Options

type Options struct {
	// ifce is tun device of songgao/water
	Ifce *water.Interface

	// MTU is the mtu to use for this endpoint.
	MTU uint32

	// EthernetHeader if true, indicates that the *endpoint should read/write
	// ethernet frames instead of IP packets.
	EthernetHeader bool

	// ClosedFunc is a function to be called when an endpoint's peer (if
	// any) closes its end of the communication pipe.
	ClosedFunc func(*tcpip.Error)

	// Address is the link address for this endpoint. Only used if
	// EthernetHeader is true.
	Address tcpip.LinkAddress

	// SaveRestore if true, indicates that this NIC capability set should
	// include CapabilitySaveRestore
	SaveRestore bool

	// DisconnectOk if true, indicates that this NIC capability set should
	// include CapabilityDisconnectOk.
	DisconnectOk bool

	// TXChecksumOffload if true, indicates that this endpoints capability
	// set should include CapabilityTXChecksumOffload.
	TXChecksumOffload bool

	// RXChecksumOffload if true, indicates that this endpoints capability
	// set should include CapabilityRXChecksumOffload.
	RXChecksumOffload bool
}

Options specify the details about the fd-based endpoint to be created.

type WaterRWNormal

type WaterRWNormal struct {
	// contains filtered or unexported fields
}

func NewWriterNormal

func NewWriterNormal(e *endpoint, ifce *water.Interface) *WaterRWNormal

func (*WaterRWNormal) DispatchInboundLoop

func (w *WaterRWNormal) DispatchInboundLoop() *tcpip.Error

func (*WaterRWNormal) NonBlockingWrite

func (w *WaterRWNormal) NonBlockingWrite(buf []byte) *tcpip.Error

func (*WaterRWNormal) NonBlockingWrite3

func (w *WaterRWNormal) NonBlockingWrite3(b1, b2, b3 []byte) *tcpip.Error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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