link

package
v0.0.0-...-984f6f0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

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

func NewEndpoint

func NewEndpoint(epctx *EndpointCtx) *Endpoint

func (*Endpoint) Deploy

func (r *Endpoint) Deploy(peerEp *Endpoint) error

func (*Endpoint) Destroy

func (r *Endpoint) Destroy() error

Destroy destroys the endpoint for local endpoints it deletes the veth itfce from the container ns for remote endpoints it deletes the tun interface and xdp

func (*Endpoint) Exists

func (r *Endpoint) Exists() bool

Exists validates if the endpoint exists Local endpoints check interface in container namespace Remote endpoints get peerID random name from peerIndex

func (*Endpoint) InitPeerVethIndex

func (r *Endpoint) InitPeerVethIndex(peerEp *Endpoint)

func (*Endpoint) SetMAC

func (r *Endpoint) SetMAC(mac net.HardwareAddr)

SetMAC sets the mac on the endpoint

type EndpointCtx

type EndpointCtx struct {
	IfName              string
	HostConnectivity    invv1alpha1.HostConnectivity
	ClusterConnectivity invv1alpha1.ClusterConnectivity
	NsPath              string
	HostIP              string
	XDP                 xdp.XDP
}
type Link struct {
	// contains filtered or unexported fields
}
func NewLink(cr *invv1alpha1.Link, lctx *LinkCtx) *Link

func (*Link) Deploy

func (r *Link) Deploy() error

Deploy deploys the link on the host Creates a veth pair Per endpoint deploys either a veth itfce in the container namespace or a remote tunnel for which a veth pair gets cross connected with BPF XDP

func (*Link) Destroy

func (r *Link) Destroy() error

func (*Link) Exists

func (r *Link) Exists() bool

Exists returns true if the link exists. Since we have 2 endpoints it might be some part does not exist. if only a part exists we return true

func (*Link) GetConn

func (r *Link) GetConn() string

GetConn is a debugging facility

func (*Link) HasLocal

func (r *Link) HasLocal() bool

HasLocal returns true is one endpoint of the link is local to the host this indicated that a wiring activity is needed

func (*Link) IsCrossCluster

func (r *Link) IsCrossCluster() bool

IsCrossCluster returns true if the link is connected accross clusters

func (*Link) IsHostLocal

func (r *Link) IsHostLocal() bool

IsHostLocal returns true if both endpoints are on the same host the wiring in this case is all local to the host

func (*Link) IsReady

func (r *Link) IsReady() bool

IsReady returns true if cluster and host information of both endpoints are known

func (*Link) SetMtu

func (r *Link) SetMtu(mtu int)

SetMtu sets the mtu on the link

type LinkCtx

type LinkCtx struct {
	PodManager pod.Manager
	Topologies map[string]struct{}
	XDP        xdp.XDP
}

Jump to

Keyboard shortcuts

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