link

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EthernetMTU = 1500
)
View Source
const (
	RouteProtocol = 98
)
View Source
const (
	TypeWireGuard = "wireguard"
)

Variables

This section is empty.

Functions

func DetectDefaultMTU

func DetectDefaultMTU(_ int) (int, error)

func DetectMTU

func DetectMTU(ip net.IP, _ int) (int, error)

func Table

func Table(str string) (int, error)

Types

type Link interface {
	Close() error

	Name() string
	Index() int
	MTU() int
	Flags() net.Flags
	Type() string

	SetMTU(mtu int) error
	SetUp() error
	SetDown() error

	AddAddress(ip net.IPNet) error
	AddRoute(dst net.IPNet, gw net.IP, table int) error

	DeleteAddress(ip net.IPNet) error
	DeleteRoute(dst net.IPNet, table int) error
}
type LinuxLink struct {
	// contains filtered or unexported fields
}
func CreateWireGuardLink(name string) (*LinuxLink, error)
func FindLink(name string) (*LinuxLink, error)

func (*LinuxLink) AddAddress

func (d *LinuxLink) AddAddress(ip net.IPNet) error

func (*LinuxLink) AddRoute

func (d *LinuxLink) AddRoute(dst net.IPNet, gw net.IP, table int) error

func (*LinuxLink) Close

func (d *LinuxLink) Close() error

func (*LinuxLink) DeleteAddress

func (d *LinuxLink) DeleteAddress(ip net.IPNet) error

func (*LinuxLink) DeleteRoute

func (d *LinuxLink) DeleteRoute(dst net.IPNet, table int) error

func (*LinuxLink) Flags

func (d *LinuxLink) Flags() net.Flags

func (*LinuxLink) Index

func (d *LinuxLink) Index() int

func (*LinuxLink) MTU

func (d *LinuxLink) MTU() int

func (*LinuxLink) Name

func (d *LinuxLink) Name() string

func (*LinuxLink) SetDown

func (d *LinuxLink) SetDown() error

func (*LinuxLink) SetMTU

func (d *LinuxLink) SetMTU(mtu int) error

func (*LinuxLink) SetUp

func (d *LinuxLink) SetUp() error

func (*LinuxLink) Type

func (d *LinuxLink) Type() string

Jump to

Keyboard shortcuts

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