netlinkops

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetNetlinkOps

func ResetNetlinkOps()

ResetNetlinkOps resets nlOpsImpl to nil

func SetNetlinkOps

func SetNetlinkOps(nlops NetlinkOps)

SetNetlinkOps sets NetlinkOps interface (to be used by unit tests)

Types

type NetlinkOps

type NetlinkOps interface {
	// LinkByName gets link by netdev name
	LinkByName(name string) (netlink.Link, error)
	// LinkSetUp sets Link state to up
	LinkSetUp(link netlink.Link) error
	// LinkSetVfHardwareAddr sets VF hardware address
	LinkSetVfHardwareAddr(link netlink.Link, vf int, hwaddr net.HardwareAddr) error
	// LinkSetVfVlan sets VF vlan
	LinkSetVfVlan(link netlink.Link, vf, vlan int) error
	// LinkSetVfNodeGUID sets VF Node GUID
	LinkSetVfNodeGUID(link netlink.Link, vf int, nodeguid net.HardwareAddr) error
	// LinkSetVfPortGUID sets VF Port GUID
	LinkSetVfPortGUID(link netlink.Link, vf int, portguid net.HardwareAddr) error
	// LinkSetVfTrust sets VF trust for the given VF
	LinkSetVfTrust(link netlink.Link, vf int, state bool) error
	// LinkSetVfSpoofchk sets VF spoofchk for the given VF
	LinkSetVfSpoofchk(link netlink.Link, vf int, check bool) error
	// DevLinkGetAllPortList gets all devlink ports
	DevLinkGetAllPortList() ([]*netlink.DevlinkPort, error)
	// DevLinkGetPortByNetdevName gets devlink port by netdev name
	DevLinkGetPortByNetdevName(netdev string) (*netlink.DevlinkPort, error)
}

NetlinkOps is an interface wrapping netlink to be used by sriovnet

func GetNetlinkOps

func GetNetlinkOps() NetlinkOps

GetNetlinkOps returns NetlinkOps interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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