linux

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 60 Imported by: 4

Documentation

Overview

Package linux implements the Linux specific datapath implementation

Index

Constants

This section is empty.

Variables

View Source
var DevicesControllerCell = cell.Module(
	"devices-controller",
	"Synchronizes the device and route tables with the kernel",

	cell.ProvidePrivate(
		tables.NewDeviceTable,
		tables.NewRouteTable,
	),

	cell.Provide(
		newDevicesController,
		newDeviceManager,
	),

	cell.Invoke(func(*devicesController) {}),
)

DevicesControllerCell registers a controller that subscribes to network devices and routes via netlink and populates the devices and routes devices.

Functions

func CheckMinRequirements

func CheckMinRequirements()

CheckMinRequirements checks that minimum kernel requirements are met for configuring the BPF datapath. If not, fatally exits.

func NewDatapath

NewDatapath creates a new Linux datapath

func NewNodeHandler

func NewNodeHandler(
	datapathConfig DatapathConfiguration,
	nodeAddressing datapath.NodeAddressing,
	nodeMap nodemap.Map,
	mtu datapath.MTUConfiguration,
) *linuxNodeHandler

NewNodeHandler returns a new node handler to handle node events and implement the implications in the Linux datapath

func NodeDeviceNameWithDefaultRoute

func NodeDeviceNameWithDefaultRoute() (string, error)

NodeDeviceNameWithDefaultRoute returns the node's device name which handles the default route in the current namespace

func NodeEnsureLocalRoutingRule

func NodeEnsureLocalRoutingRule() error

NodeEnsureLocalRoutingRule moves the kernel's default '0: from all lookup local' ip rule up to priority 100 to create space for Cilium to install rules with a lower pref (meaning a higher priority).

Cilium's 'new' rule is always installed before removing the default one with pref 0 to avoid breaking local packet delivery.

Types

type DatapathConfiguration

type DatapathConfiguration struct {
	// HostDevice is the name of the device to be used to access the host.
	HostDevice string

	// TunnelDevice is the name of the tunnel device (if any).
	TunnelDevice string

	ProcFs string
}

DatapathConfiguration is the static configuration of the datapath. The configuration cannot change throughout the lifetime of a datapath object.

type DatapathParams added in v1.15.0

type DatapathParams struct {
	ConfigWriter   datapath.ConfigWriter
	RuleManager    datapath.IptablesManager
	WGAgent        datapath.WireguardAgent
	NodeMap        nodemap.Map
	BWManager      bandwidth.Manager
	NodeAddressing datapath.NodeAddressing
	MTU            datapath.MTUConfiguration
}

type DeviceManager

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

DeviceManager is a temporary compatibility bridge to keep DeviceManager uses as is and reuse its tests against DevicesController and the devices table.

This will be refactored away in follow-up PRs that convert code over to the devices table. The DirectRoutingDevice and IPv6MCastDevice would computed from the devices table as necessary.

func (*DeviceManager) Detect

func (dm *DeviceManager) Detect(k8sEnabled bool) ([]string, error)

func (*DeviceManager) Stop

func (dm *DeviceManager) Stop()

type DevicesConfig

type DevicesConfig struct {
	// Devices is the user-specified devices to use. This can be
	// either concrete devices ("eth0,eth1"), or a wildcard "eth+".
	// If empty the devices are auto-detected according to rules defined
	// by isSelectedDevice().
	Devices []string
}
type NeighLink struct {
	Name string `json:"link-name"`
}

NeighLink contains the details of a NeighLink

type NextHop

type NextHop struct {
	Name  string
	IP    net.IP
	IsNew bool
}

Directories

Path Synopsis
Package bandwidth provides efficient EDT-based rate-limiting.
Package bandwidth provides efficient EDT-based rate-limiting.
Package bigtcp provides helpers to probe and enable BIG TCP for the Linux datapath
Package bigtcp provides helpers to probe and enable BIG TCP for the Linux datapath
Package ipsec provides the Linux datapath specific abstraction and useful helpers to manage IPSec via Linux xfrm.
Package ipsec provides the Linux datapath specific abstraction and useful helpers to manage IPSec via Linux xfrm.
Package linux_defaults provides the Linux datapath defaults
Package linux_defaults provides the Linux datapath defaults
Package modules contains a manager of loaded modules which supports search operation.
Package modules contains a manager of loaded modules which supports search operation.
Package probes provides BPF features checks based on bpftool.
Package probes provides BPF features checks based on bpftool.
Package route provides the Cilium specific abstraction and useful helpers to manage network routes
Package route provides the Cilium specific abstraction and useful helpers to manage network routes
Package utime converts between time.Time and Unix Epoch time in 512ns time unit.
Package utime converts between time.Time and Unix Epoch time in 512ns time unit.

Jump to

Keyboard shortcuts

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