common

package
v0.18.1-calicov3.21.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultVRFIndex = uint32(0)
	PuntTableId     = uint32(1)
	PodVRFIndex     = uint32(2)
)

Variables

View Source
var (
	BgpFamilyUnicastIPv4 = bgpapi.Family{Afi: bgpapi.Family_AFI_IP, Safi: bgpapi.Family_SAFI_UNICAST}
	BgpFamilySRv6IPv4    = bgpapi.Family{Afi: bgpapi.Family_AFI_IP, Safi: bgpapi.Family_SAFI_SR_POLICY}
	BgpFamilyUnicastIPv6 = bgpapi.Family{Afi: bgpapi.Family_AFI_IP6, Safi: bgpapi.Family_SAFI_UNICAST}
	BgpFamilySRv6IPv6    = bgpapi.Family{Afi: bgpapi.Family_AFI_IP6, Safi: bgpapi.Family_SAFI_SR_POLICY}
)
View Source
var (
	ContainerSideMacAddress, _ = net.ParseMAC("02:00:00:00:00:01")
)

Functions

func CreateVppLink(socket string, log *logrus.Entry) (vpp *vpplink.VppLink, err error)

func FormatSlice

func FormatSlice(lst []interface{ String() string }) string

func FullyQualified

func FullyQualified(addr net.IP) *net.IPNet

func GetAggPrefixSetName

func GetAggPrefixSetName(isv6 bool) string

func GetBGPSpecAddresses

func GetBGPSpecAddresses(nodeBGPSpec *oldv3.NodeBGPSpec) (*net.IP, *net.IP)

func GetBGPSpecIPNet

func GetBGPSpecIPNet(nodeBGPSpec *oldv3.NodeBGPSpec) (ip4 *net.IPNet, ip6 *net.IPNet)

func GetHostPrefixSetName

func GetHostPrefixSetName(isv6 bool) string

func GetMaxCIDRMask

func GetMaxCIDRMask(addr net.IP) net.IPMask

func GetNodeSpecAddresses

func GetNodeSpecAddresses(node *oldv3.Node) (string, string)

func GetPolicyName

func GetPolicyName(isv6 bool) string

func GetVppTapSwifIndex

func GetVppTapSwifIndex() (swIfIndex uint32, err error)

This function and the related mechanism in vpmanager are curently kept around in case they're useful for the Host Endpoint policies implementation

func HandleVppManagerRestart

func HandleVppManagerRestart(log *logrus.Logger, vpp *vpplink.VppLink, servers []CalicoVppServer)

func InitRestartHandler

func InitRestartHandler()

func MakePath

func MakePath(prefix string, isWithdrawal bool, nodeIpv4 *net.IP, nodeIpv6 *net.IP) (*bgpapi.Path, error)

func MakePathSRv6Tunnel

func MakePathSRv6Tunnel(localSid net.IP, bSid net.IP, nodeIpv6 net.IP, trafficType int, isWithdrawal bool) (*bgpapi.Path, error)

func SafeFormat

func SafeFormat(e interface{ String() string }) string

func SendEvent

func SendEvent(event CalicoVppEvent)

func ToMaxLenCIDR

func ToMaxLenCIDR(addr net.IP) *net.IPNet

func WaitForVppManager

func WaitForVppManager() error

func WaitIfVppIsRestarting

func WaitIfVppIsRestarting()

func WritePidToFile

func WritePidToFile() error

Types

type CalicoVppEvent

type CalicoVppEvent struct {
	Type CalicoVppEventType

	Old interface{}
	New interface{}
}

type CalicoVppEventType

type CalicoVppEventType string
const (
	ChanSize = 500

	PeerNodeStateChanged CalicoVppEventType = "PeerNodeStateChanged"
	OurNodeStateChanged  CalicoVppEventType = "OurNodeStateChanged"
	FelixConfChanged     CalicoVppEventType = "FelixConfChanged"
	IpamConfChanged      CalicoVppEventType = "IpamConfChanged"
	BGPConfChanged       CalicoVppEventType = "BGPConfChanged"

	ConnectivityAdded   CalicoVppEventType = "ConnectivityAdded"
	ConnectivityDeleted CalicoVppEventType = "ConnectivityDeleted"

	SRv6PolicyAdded   CalicoVppEventType = "SRv6PolicyAdded"
	SRv6PolicyDeleted CalicoVppEventType = "SRv6PolicyDeleted"

	PodAdded   CalicoVppEventType = "PodAdded"
	PodDeleted CalicoVppEventType = "PodDeleted"

	LocalPodAddressAdded   CalicoVppEventType = "LocalPodAddressAdded"
	LocalPodAddressDeleted CalicoVppEventType = "LocalPodAddressDeleted"

	TunnelAdded   CalicoVppEventType = "TunnelAdded"
	TunnelDeleted CalicoVppEventType = "TunnelDeleted"

	BGPPeerAdded   CalicoVppEventType = "BGPPeerAdded"
	BGPPeerDeleted CalicoVppEventType = "BGPPeerDeleted"
	BGPPeerUpdated CalicoVppEventType = "BGPPeerUpdated"

	BGPDefinedSetAdded   CalicoVppEventType = "BGPDefinedSetAdded"
	BGPDefinedSetDeleted CalicoVppEventType = "BGPDefinedSetDeleted"

	BGPPathAdded   CalicoVppEventType = "BGPPathAdded"
	BGPPathDeleted CalicoVppEventType = "BGPPathDeleted"

	BGPReloadIP4 CalicoVppEventType = "BGPReloadIP4"
	BGPReloadIP6 CalicoVppEventType = "BGPReloadIP6"
)

type CalicoVppServer

type CalicoVppServer interface {
	/* Called when VPP signals us that it has restarted */
	OnVppRestart()
}

type CalicoVppServerData

type CalicoVppServerData struct{}

type ChangeType

type ChangeType int
const (
	ChangeNone    ChangeType = iota
	ChangeSame    ChangeType = iota
	ChangeAdded   ChangeType = iota
	ChangeDeleted ChangeType = iota
	ChangeUpdated ChangeType = iota
)

func GetStringChangeType

func GetStringChangeType(old, new string) ChangeType

type NodeConnectivity

type NodeConnectivity struct {
	Dst              net.IPNet
	NextHop          net.IP
	ResolvedProvider string
	Custom           interface{}
}

func (*NodeConnectivity) String

func (cn *NodeConnectivity) String() string

type NodeState

type NodeState struct {
	oldv3.Node
	SweepFlag bool
}

type PubSub

type PubSub struct {
	// contains filtered or unexported fields
}
var (
	ThePubSub *PubSub
)

func NewPubSub

func NewPubSub(log *logrus.Entry) *PubSub

type PubSubHandlerRegistration

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

func RegisterHandler

func RegisterHandler(channel chan CalicoVppEvent, name string) *PubSubHandlerRegistration

func (*PubSubHandlerRegistration) ExpectEvents

func (reg *PubSubHandlerRegistration) ExpectEvents(eventTypes ...CalicoVppEventType)

type SRv6Tunnel

type SRv6Tunnel struct {
	Dst      net.IP
	Bsid     net.IP
	Policy   *types.SrPolicy
	Sid      net.IP
	Behavior uint8
	Priority uint32
}

Jump to

Keyboard shortcuts

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