connector

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 18 Imported by: 5

Documentation

Overview

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

Index

Constants

View Source
const (
	// OperationModeL3S will respect iptables rules e.g. set up for masquerading
	OperationModeL3S = "L3S"

	// OperationModeL3 will bypass iptables rules on the host
	OperationModeL3 = "L3"
)

Available option for DaemonConfig.Ipvlan.OperationMode

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

Variables

This section is empty.

Functions

func CreateAndSetupIpvlanSlave added in v1.8.0

func CreateAndSetupIpvlanSlave(id string, slaveIfName string, netNs ns.NetNS, mtu int, masterDev int, mode string, ep *models.EndpointChangeRequest) (*ebpf.Map, error)

CreateAndSetupIpvlanSlave creates an ipvlan slave device for the given master device, moves it to the given network namespace, and finally initializes it (see setupIpvlanInRemoteNs).

func CreateIpvlanSlave added in v1.8.0

func CreateIpvlanSlave(id string, mtu, masterDev int, mode string, ep *models.EndpointChangeRequest) (*netlink.IPVlan, *netlink.Link, string, error)

CreateIpvlanSlave creates an ipvlan slave in L3 based on the master device.

func DisableRpFilter

func DisableRpFilter(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 Endpoint2TempRandIfName added in v1.8.0

func Endpoint2TempRandIfName() string

Endpoint2TempRandIfName returns a random, temporary interface name for the given endpointID. This is similar to Endpoint2TempIfName() but uses a random string instead of endpoint ID.

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 SetupVeth

func SetupVeth(id string, mtu int, ep *models.EndpointChangeRequest) (*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 SetupVethRemoteNs

func SetupVethRemoteNs(netNs ns.NetNS, srcIfName, dstIfName string) (int, int, error)

SetupVethRemoteNs renames the netdevice in the target namespace to the provided dstIfName.

func SetupVethWithNames

func SetupVethWithNames(lxcIfName, tmpIfName string, mtu int, ep *models.EndpointChangeRequest) (*netlink.Veth, *netlink.Link, error)

SetupVethWithNames 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 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

This section is empty.

Jump to

Keyboard shortcuts

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