frr

package
v0.0.0-...-6402844 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BGPNeighborshipHasState

func BGPNeighborshipHasState(frrPod *pod.Builder, neighborIPAddress string, state string) (bool, error)

BGPNeighborshipHasState verifies that BGP session on a pod has given state.

func DefineBGPConfig

func DefineBGPConfig(localBGPASN, remoteBGPASN int, neighborsIPAddresses []string, multiHop, bfd bool) string

DefineBGPConfig returns string which represents BGP config file peering to all given IP addresses.

func DefineBGPConfigWithStaticRouteAndNetwork

func DefineBGPConfigWithStaticRouteAndNetwork(localBGPASN, remoteBGPASN int, hubPodIPs,
	advertisedIPv4Routes, advertisedIPv6Routes, neighborsIPAddresses []string,
	multiHop, bfd bool) string

DefineBGPConfigWithStaticRouteAndNetwork defines BGP config file with static route and network.

func DefineBaseConfig

func DefineBaseConfig(daemonsConfig, frrConfig, vtyShConfig string) map[string]string

DefineBaseConfig defines minimal required FRR configuration.

func FetchBGPConnectTimeValue

func FetchBGPConnectTimeValue(frrk8sPods []*pod.Builder, bgpPeerIP string) (int, error)

FetchBGPConnectTimeValue fetches and returns the ConnectRetryTimer value for the specified BGP peer.

func GetBGPAdvertisedRoutes

func GetBGPAdvertisedRoutes(frrPod *pod.Builder, nodeIPs []string) (map[string]string, error)

GetBGPAdvertisedRoutes retrieves the routes advertised from the external frr pod to the frr nodes.

func GetBGPCommunityStatus

func GetBGPCommunityStatus(frrPod *pod.Builder, ipProtocolVersion string) (*bgpStatus, error)

GetBGPCommunityStatus returns bgp community status from frr pod.

func GetBGPStatus

func GetBGPStatus(frrPod *pod.Builder, protocolVersion string, containerName ...string) (*bgpStatus, error)

GetBGPStatus returns bgp status output from frr pod.

func GetMetricsByPrefix

func GetMetricsByPrefix(frrPod *pod.Builder, metricPrefix string) ([]string, error)

GetMetricsByPrefix pulls all metrics from frr pods and sort them in the list by given prefix.

func IsProtocolConfigured

func IsProtocolConfigured(frrPod *pod.Builder, protocol string) (bool, error)

IsProtocolConfigured verifies that given protocol is set in frr config.

func ResetBGPConnection

func ResetBGPConnection(frrPod *pod.Builder) error

ResetBGPConnection restarts the TCP connection.

func SetStaticRoute

func SetStaticRoute(frrPod *pod.Builder, action, destIP string, nextHopMap map[string]string) (string, error)

SetStaticRoute could set or delete static route on all Speaker pods.

func ValidateBGPRemoteAS

func ValidateBGPRemoteAS(frrk8sPods []*pod.Builder, bgpPeerIP string, expectedRemoteAS int) error

ValidateBGPRemoteAS validates the remoteAS value for the specified BGP peer across all FRR pods.

func VerifyBGPReceivedRoutesOnFrrNodes

func VerifyBGPReceivedRoutesOnFrrNodes(frrk8sPods []*pod.Builder) (string, error)

VerifyBGPReceivedRoutesOnFrrNodes verifies routes were received via BGP on Frr nodes.

Types

type BGPConnectionInfo

type BGPConnectionInfo struct {
	ConnectRetryTimer int `json:"connectRetryTimer"`
	RemoteAS          int `json:"remoteAS"`
}

BGPConnectionInfo struct includes the connectRetryTimer.

type BgpAdvertisedRoutes

type BgpAdvertisedRoutes struct {
	BGPTableVersion  int                        `json:"bgpTableVersion"`
	BGPLocalRouterID string                     `json:"bgpLocalRouterId"`
	DefaultLocPrf    int                        `json:"defaultLocPrf"`
	LocalAS          int                        `json:"localAS"`
	AdvertisedRoutes map[string]advertisedRoute `json:"advertisedRoutes"`
}

BgpAdvertisedRoutes creates struct from json output.

type BgpReceivedRoutes

type BgpReceivedRoutes struct {
	Routes map[string][]RouteInfo `json:"routes"`
}

BgpReceivedRoutes struct includes Routes map.

type Nexthop

type Nexthop struct {
	Flags          int    `json:"flags"`
	Fib            bool   `json:"fib"`
	IP             string `json:"ip"`
	Afi            string `json:"afi"`
	InterfaceIndex int    `json:"interfaceIndex"`
	InterfaceName  string `json:"interfaceName"`
	Active         bool   `json:"active"`
	Weight         int    `json:"weight"`
}

Nexthop struct includes nexthop route info.

type RouteInfo

type RouteInfo struct {
	Prefix    string    `json:"prefix"`
	PrefixLen int       `json:"prefixLen"`
	Protocol  string    `json:"protocol"`
	Metric    int       `json:"metric"`
	Uptime    string    `json:"uptime"`
	Nexthops  []Nexthop `json:"nexthops"`
}

RouteInfo struct includes route info.

Jump to

Keyboard shortcuts

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