tun

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TUNIC

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

TUNIC implements nic.NIC use os TUN device

func Create

func Create(cfg nic.Config) (*TUNIC, error)

func CreateFD

func CreateFD(tunFD int, cfg nic.Config) (*TUNIC, error)

func (*TUNIC) Close

func (tun *TUNIC) Close() error

func (*TUNIC) Read

func (tun *TUNIC) Read() (*nic.Packet, error)

Read read ip packet from nic. no concurrency support

func (*TUNIC) Write

func (tun *TUNIC) Write(p *nic.Packet) error

Write write ip packet to nic

Jump to

Keyboard shortcuts

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