connector

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 20 Imported by: 6

Documentation

Overview

Package connector is responsible for the datapath specific plumbing to connect an endpoint to the network

Index

Constants

View Source
const (
	// ContainerInterfacePrefix is the container's internal interface name prefix.
	ContainerInterfacePrefix = "cilium"
)
View Source
const (
	// HostInterfacePrefix is the Host interface prefix.
	HostInterfacePrefix = "lxc"
)

Variables

View Source
var Cell = cell.Module(
	"connector",
	"Datapath connector configuration mutator",

	cell.Provide(newConnectorConfig),
)

Functions

func DisableRpFilter

func DisableRpFilter(sysctl sysctl.Sysctl, ifName string) error

DisableRpFilter tries to disable rpfilter on specified interface

func Endpoint2IfName

func Endpoint2IfName(endpointID string) string

Endpoint2IfName returns the host interface name for the given endpointID.

func Endpoint2TempIfName

func Endpoint2TempIfName(endpointID string) string

Endpoint2TempIfName returns the temporary interface name for the given endpointID.

func IPv4Gateway

func IPv4Gateway(addr *models.NodeAddressing) string

IPv4Gateway returns the IPv4 gateway address for endpoints.

func IPv4Routes

func IPv4Routes(addr *models.NodeAddressing, linkMTU int) ([]route.Route, error)

IPv4Routes returns IPv4 routes to be installed in endpoint's networking namespace.

func IPv6Gateway

func IPv6Gateway(addr *models.NodeAddressing) string

IPv6Gateway returns the IPv6 gateway address for endpoints.

func IPv6Routes

func IPv6Routes(addr *models.NodeAddressing, linkMTU int) ([]route.Route, error)

IPv6Routes returns IPv6 routes to be installed in endpoint's networking namespace.

func SetupNetkit added in v1.16.0

func SetupNetkit(defaultLogger *slog.Logger, id string, cfg LinkConfig, l2Mode bool, sysctl sysctl.Sysctl) (*netlink.Netkit, netlink.Link, string, error)

SetupNetkit sets up the net interface, the temporary interface and fills up some endpoint fields such as mac, NodeMac, ifIndex and ifName. Returns a pointer for the created netkit, a pointer for the temporary link, the name of the temporary link and error if something fails.

func SetupNetkitWithNames added in v1.16.0

func SetupNetkitWithNames(defaultLogger *slog.Logger, lxcIfName, peerIfName string, cfg LinkConfig, l2Mode bool, sysctl sysctl.Sysctl) (*netlink.Netkit, netlink.Link, error)

SetupNetkitWithNames sets up the net interface, the peer interface and fills up some endpoint fields such as mac, NodeMac, ifIndex and ifName. Returns a pointer for the created netkit, a pointer for the peer link and error if something fails.

func SetupVeth

func SetupVeth(defaultLogger *slog.Logger, id string, cfg LinkConfig, sysctl sysctl.Sysctl) (*netlink.Veth, netlink.Link, string, error)

SetupVeth sets up the net interface, the temporary interface and fills up some endpoint fields such as mac, NodeMac, ifIndex and ifName. Returns a pointer for the created veth, a pointer for the temporary link, the name of the temporary link and error if something fails.

func SetupVethWithNames

func SetupVethWithNames(defaultLogger *slog.Logger, lxcIfName, peerIfName string, cfg LinkConfig, sysctl sysctl.Sysctl) (*netlink.Veth, netlink.Link, error)

SetupVethWithNames sets up the net interface, the peer interface and fills up some endpoint fields such as mac, NodeMac, ifIndex and ifName. Returns a pointer for the created veth, a pointer for the peer link and error if something fails.

func SufficientAddressing

func SufficientAddressing(addr *models.NodeAddressing) error

SufficientAddressing returns an error if the provided NodeAddressing does not provide sufficient information to derive all IPAM required settings.

Types

type ConnectorConfig added in v1.19.0

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

Connector configuration. As per BIGTCP, the values here will not be calculated until the Hive has started. This is necessary to allow other dependencies to setup their interfaces etc.

func (*ConnectorConfig) GetPodDeviceHeadroom added in v1.19.0

func (cc *ConnectorConfig) GetPodDeviceHeadroom() uint16

func (*ConnectorConfig) GetPodDeviceTailroom added in v1.19.0

func (cc *ConnectorConfig) GetPodDeviceTailroom() uint16

type LinkConfig added in v1.18.0

type LinkConfig struct {
	GROIPv6MaxSize int
	GSOIPv6MaxSize int

	GROIPv4MaxSize int
	GSOIPv4MaxSize int

	DeviceMTU      int
	DeviceHeadroom uint16
	DeviceTailroom uint16
}

LinkConfig contains the GRO/GSO, MTU values and buffer margins to be configured on both sides of the created pair.

Jump to

Keyboard shortcuts

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