netlink

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRoute

func AddRoute(_ string, to *net.IPNet, via net.IP) error

func AddrSubscribe

func AddrSubscribe(ctx context.Context, ch chan<- AddrUpdate) error

func DelRoute

func DelRoute(_ string, to *net.IPNet, via net.IP) error

func RouteSubscribe

func RouteSubscribe(ctx context.Context, ch chan<- RouteUpdate) error

RouteSubscribe takes a chan down which notifications will be sent when routes are added or deleted. Rules are not currently supported

func SetupLink(ifName, cidr string) error

Types

type AddrUpdate

type AddrUpdate struct {
	New       bool
	Addr      net.IPNet
	LinkIndex int
}

type Info

type Info struct {
	IPv4 string
	IPv6 string
}

func Show

func Show() Info
type Link struct {
	Name  string
	Index int
	Type  uint32
}

func LinkByIndex

func LinkByIndex(index int) (*Link, error)

type RouteUpdate

type RouteUpdate struct {
	New bool
	Dst *net.IPNet
	Via net.IP
}

Jump to

Keyboard shortcuts

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