kernel

package
v1.7.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package kernel contains Link representation of network interface

Index

Constants

View Source
const (
	// FamilyAll is netlink.FAMILY_ALL
	FamilyAll = netlink.FAMILY_ALL
	// NudReachable is netlink.NUD_REACHABLE
	NudReachable = netlink.NUD_REACHABLE
)

Variables

This section is empty.

Functions

func GetNetlinkHandle

func GetNetlinkHandle(urlString string) (*netlink.Handle, error)

GetNetlinkHandle - mechanism to netlink.Handle for the NetNS specified in mechanism

Types

type Link interface {
	AddAddress(ip string) error
	DeleteAddress(ip string) error
	MoveToNetns(target netns.NsHandle) error
	SetAdminState(state State) error
	SetName(name string) error
	GetName() string
	GetLink() netlink.Link
}

Link represents network interface and specifies operations that can be performed on that interface.

func FindHostDevice

func FindHostDevice(pciAddress, name string, namespaces ...netns.NsHandle) (Link, error)

FindHostDevice returns a new instance of link representing host device, based on the PCI address and/or target interface name.

type State

type State uint

State defines admin state of the network interface

const (
	// DOWN is link admin state down
	DOWN State = iota
	// UP is link admin state down
	UP
)

Directories

Path Synopsis
networkservice
tools

Jump to

Keyboard shortcuts

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