tun

package
v0.0.0-...-ef10d44 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Name string
	MTU  int
	// 	macOS (Darwin) 和其他 BSD 系统在处理 utun 设备时,底层内核协议栈强制要求一个 4 字节的“元数据头”。
	// 这 4 个字节被称为 Packet Information (PI) 或 Family Header。
	Offset int
	IP     netip.Prefix
}

type Tun

type Tun struct {
	*channel.Endpoint
	sync.Once
	sync.WaitGroup
	// contains filtered or unexported fields
}

func New

func New(options Options) (*Tun, error)

return stack.LinkEndpoint interface

func (*Tun) Attach

func (t *Tun) Attach(dispatcher stack.NetworkDispatcher)

协议栈启动

func (*Tun) Close

func (t *Tun) Close()

func (*Tun) Name

func (t *Tun) Name() string

func (*Tun) Wait

func (t *Tun) Wait()

Jump to

Keyboard shortcuts

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