netlinkwrapper

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// LinkByName finds a link by name
	LinkByName(name string) (netlink.Link, error)
	// LinkAdd adds a new link device
	LinkAdd(link netlink.Link) error
	// LinkList lists all link devices
	LinkList() ([]netlink.Link, error)
	// LinkDel deletes link device
	LinkDel(link netlink.Link) error
	// LinkSetUp enables the link device
	LinkSetUp(link netlink.Link) error
	// LinkSetDown disables the link device
	LinkSetDown(link netlink.Link) error
	// LinkSetNsFd puts the device into a new network namespace
	LinkSetNsFd(link netlink.Link, fd int) error
	// LinkSetName sets the name of the link device
	LinkSetName(link netlink.Link, name string) error
	// LinkSetAlias sets the alias of the link device
	LinkSetAlias(link netlink.Link, name string) error
	// AddrList gets a list of IP addresses in the system
	AddrList(link netlink.Link, family int) ([]netlink.Addr, error)
	// AddrAdd adds an IP address to a link device
	AddrAdd(link netlink.Link, addr *netlink.Addr) error
	// AddrDel deletes an IP address from a link device
	AddrDel(link netlink.Link, addr *netlink.Addr) error
	// AddrReplace replaces (or, if not present, adds) an IP address on a link device
	AddrReplace(link netlink.Link, addr *netlink.Addr) error
	// RouteReplace adds a route to the system
	RouteReplace(route *netlink.Route) error
	// RouteDel deletes a route from the system
	RouteDel(route *netlink.Route) error
	// RouteList gets a list of routes in the system
	RouteList(link netlink.Link, family int) ([]netlink.Route, error)
	// RuleAdd adds a rule
	RuleAdd(rule *netlink.Rule) error
}
func NewNetLink() Interface

Directories

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

Jump to

Keyboard shortcuts

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