netdev

package
v1.20.0-pre.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 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) IsL3

func (s *DeviceState) IsL3() bool

func (*DeviceState) New

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

func (*DeviceState) SetL3

func (s *DeviceState) SetL3(enabled bool)

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

	Clear(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