Documentation ¶ Index ¶ type Options type Tun func New(options Options) (*Tun, error) func (t *Tun) Attach(dispatcher stack.NetworkDispatcher) func (t *Tun) Close() func (t *Tun) Name() string func (t *Tun) Wait() 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() Source Files ¶ View all Source files options.gotun.gotun_endpoint.go Click to show internal directories. Click to hide internal directories.