connector

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndSetupIpvlanSlave

func CreateAndSetupIpvlanSlave(id string, slaveIfName string, netNs ns.NetNS, mtu int, masterDev int, mode string, ep *models.EndpointChangeRequest) (int, 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

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 DeriveEndpointFrom

func DeriveEndpointFrom(hostDevice, containerID string, pid int) (*models.EndpointChangeRequest, error)

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

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 GetNetInfoFromPID

func GetNetInfoFromPID(pid int) (int, string, net.IP, error)

GetNetInfoFromPID returns the index of the interface parent, the MAC address and IP address of the first interface that contains an IP address with global scope.

func GetVethInfo

func GetVethInfo(nodeIfName string, parentIdx int, netNSMac string, ep *models.EndpointChangeRequest) error

GetVethInfo populates the given endpoint with the arguments provided where * nodeIfName - Node Interface Name * parentIdx - Interface Index of the container veth pair in the host side. * netNSMac - MAC address of the veth pair in the container side.

func IPv4Gateway

func IPv4Gateway(addr *models.NodeAddressing) string

IPv4Gateway returns the IPv4 gateway address for endpoints.

func IPv4Routes