lower

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NIC

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

NIC 虚拟网卡

func (*NIC) Close

func (n *NIC) Close() error

Close 关闭网卡

func (*NIC) Down

func (n *NIC) Down()

func (*NIC) Read

func (nc *NIC) Read(buf []byte) (int, error)

Read 匹配 PacketsIO Interface

func (*NIC) Up

func (n *NIC) Up()

func (*NIC) Write

func (nc *NIC) Write(packet []byte) (int, error)

type NICIO

type NICIO interface {
	io.ReadWriteCloser
	Up()
	Down()
}

func NewNIC

func NewNIC(ip, subnet, mtu string, cidrs ...string) NICIO

NewNIC 新建 TUN 网络接口卡 网卡地址为 ip, 所属子网为 subnet 以本网卡为下一跳的所有子网为 cidrs cidrs 不包括本网卡 subnet

Jump to

Keyboard shortcuts

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