Help us shape the future of Go! Take the 2026 Go Developer Survey

netdev

package
v1.20.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package contains information about network devices for Cilium datapath. +groupName=maps

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"netdev-map",
	"eBPF map contains information about network devices for Cilium datapath",

	cell.Provide(newMap),

	NetDevMapSyncCell,
)

Cell initializes and manages the network devices map.

View Source
var NetDevMapSyncCell = cell.Module(
	"netdev-map-sync",
	"Synchronizes network devices state into the cilium_devices BPF map",
	cell.Invoke(registerNetDevMapSync),
)

NetDevMapSyncCell keeps the cilium_devices map in sync with the selected devices.

Functions

This section is empty.

Types

type DeviceState

type DeviceState struct {
	MAC types.MACAddr `align:"mac"`

	L3 DeviceStateL3 `align:"l3"`
	// contains filtered or unexported fields
}

DeviceState matches struct device_state in bpf/lib/network_device.h.

func NewDeviceState

func NewDeviceState(mac net.HardwareAddr) DeviceState

func (*DeviceState) New

func (s *DeviceState) New() bpf.MapValue

func (*DeviceState) String

func (s *DeviceState) String() string

type DeviceStateL3

type DeviceStateL3 uint8

DeviceStateL3 represents device L3 states.

type Index

type Index uint32

Index matches the BPF map key (__u32 ifindex).

func (*Index) New

func (k *Index) New() bpf.MapKey

func (*Index) String

func (k *Index) String() string

type IterateCallback

type IterateCallback func(*Index, *DeviceState)

IterateCallback represents the signature of the callback used for iteration.

type Map

type Map interface {
	Upsert(ifindex uint32, state DeviceState) error

	Lookup(ifindex uint32) (*DeviceState, error)

	IterateWithCallback(cb IterateCallback) error

	Delete(ifindex uint32) error
}

Map provides access to the eBPF map cilium_devices.

Jump to

Keyboard shortcuts

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