netlink

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindProcessName added in v0.3.6

func FindProcessName(network string, ip net.IP, srcPort uint16, to net.IP, toPort uint16) (string, error)

func Route added in v0.3.5

func Route(opt *Options) error

Types

type Options

type Options struct {
	Endpoint     stack.LinkEndpoint
	Writer       Tun
	Interface    TunScheme
	Inet6Address []netip.Prefix
	Inet4Address []netip.Prefix
	Routes       []netip.Prefix
	MTU          int
}

func (*Options) V4Address

func (o *Options) V4Address() netip.Prefix

func (*Options) V6Address

func (o *Options) V6Address() netip.Prefix

type Tun added in v0.3.5

type Tun interface {
	Tun() wun.Device
	Write(bufs [][]byte) (int, error)
	Read(bufs [][]byte, sizes []int) (n int, err error)
	io.Closer
	Offset() int
	MTU() int
}

type TunScheme

type TunScheme struct {
	Scheme string
	Name   string
	Fd     int
}

func ParseTunScheme

func ParseTunScheme(str string) (TunScheme, error)

Jump to

Keyboard shortcuts

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