link

package
v1.12.18 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 13

Documentation

Overview

Package link provides the Cilium specific abstraction and useful helpers to manage network interfaces

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteByName

func DeleteByName(ifName string) error

DeleteByName deletes the interface with the name ifName.

func GetHardwareAddr

func GetHardwareAddr(ifName string) (mac.MAC, error)

func GetIfIndex

func GetIfIndex(ifName string) (uint32, error)

func Rename

func Rename(curName, newName string) error

Rename renames a network link

Types

type LinkCache

type LinkCache struct {
	// contains filtered or unexported fields
}

func NewLinkCache

func NewLinkCache() *LinkCache

NewLinkCache begins monitoring local interfaces for changes in order to track local link information.

func (*LinkCache) GetIfNameCached

func (c *LinkCache) GetIfNameCached(ifIndex int) (string, bool)

GetIfNameCached returns the name of an interface (if it exists) by looking it up in a regularly updated cache. The return result is the same as a map lookup, ie nil, false if there is no entry cached for this ifindex.

func (*LinkCache) Name

func (c *LinkCache) Name(ifIndex uint32) string

Name returns the name of a link by looking up the 'LinkCache', or returns a string containing the ifindex on cache miss.

Jump to

Keyboard shortcuts

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