Documentation ¶
Overview ¶
Package linux implements the Linux specific datapath implementation
Index ¶
- Variables
- func CheckRequirements(log *slog.Logger) error
- func NewDatapath(p DatapathParams) datapath.Datapath
- func NewNodeHandler(log *slog.Logger, tunnelConfig dpTunnel.Config, nodeMap nodemap.MapV2, ...) (datapath.NodeHandler, datapath.NodeIDHandler, datapath.NodeNeighbors)
- func NodeDeviceNameWithDefaultRoute() (string, error)
- func NodeEnsureLocalRoutingRule() error
- type DatapathConfiguration
- type DatapathParams
- type DeviceManager
- type DevicesConfig
- type NeighLink
- type NextHop
Constants ¶
This section is empty.
Variables ¶
var DevicesControllerCell = cell.Module( "devices-controller", "Synchronizes the device and route tables with the kernel", cell.ProvidePrivate( tables.NewDeviceTable, tables.NewRouteTable, ), cell.Invoke( statedb.RegisterTable[*tables.Device], statedb.RegisterTable[*tables.Route], ), cell.Provide( newDevicesController, newDeviceManager, ), cell.Config(DevicesConfig{}), 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 CheckRequirements ¶ added in v1.16.0
CheckRequirements checks that minimum kernel requirements are met for configuring the BPF datapath.
func NewDatapath ¶
func NewDatapath(p DatapathParams) datapath.Datapath
NewDatapath creates a new Linux datapath
func NewNodeHandler ¶
func NewNodeHandler( log *slog.Logger, tunnelConfig dpTunnel.Config, nodeMap nodemap.MapV2, nodeManager manager.NodeManager, ) (datapath.NodeHandler, datapath.NodeIDHandler, datapath.NodeNeighbors)
NewNodeHandler returns a new node handler to handle node events and implement the implications in the Linux datapath
func NodeDeviceNameWithDefaultRoute ¶
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 }
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.MapV2 BWManager datapath.BandwidthManager NodeAddressing datapath.NodeAddressing MTU datapath.MTUConfiguration Loader datapath.Loader NodeManager manager.NodeManager DB *statedb.DB Devices statedb.Table[*tables.Device] Orchestrator datapath.Orchestrator NodeHandler datapath.NodeHandler NodeIDHandler datapath.NodeIDHandler NodeNeighbors datapath.NodeNeighbors }
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.
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 // ForceDeviceDetection forces the auto-detection of devices, // even if user-specific devices are explicitly listed. ForceDeviceDetection bool }
func (DevicesConfig) Flags ¶ added in v1.16.0
func (c DevicesConfig) Flags(flags *pflag.FlagSet)
Source Files ¶
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 sysctl allows to change kernel parameters at runtime.
|
Package sysctl allows to change kernel parameters at runtime. |
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. |