netlink

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link interface {
	netlink.Link
}

type NetlinkLib

type NetlinkLib interface {
	// LinkByName finds a link by name and returns a pointer to the object.
	LinkByName(name string) (Link, error)
	// LinkSetUp enables the link device.
	// Equivalent to: `ip link set $link up`
	LinkSetUp(link Link) error
	// IsLinkAdminStateUp checks if the admin state of a link is up
	IsLinkAdminStateUp(link Link) bool
	// IPv4Addresses return the IPv4 addresses of a link
	IPv4Addresses(link Link) ([]netlink.Addr, error)
	// AddrDel delete an IP address from a link
	AddrDel(link Link, ip string) error
	// AddrAdd add an IP address to a link
	AddrAdd(link Link, ip string) error
	// GetRouteSrc returns the source IP address of a route
	GetRouteSrc(dst string) (string, error)
	// NieghList returns the neighbors of a link
	NeighList(linkIndex int) ([]netlink.Neigh, error)
}

func New

func New() NetlinkLib

Directories

Path Synopsis
Package mock_netlink is a generated GoMock package.
Package mock_netlink is a generated GoMock package.

Jump to

Keyboard shortcuts

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