frr

package
v0.2.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunk added in v0.2.0

func Chunk[E any](values []E, size int) ([][]E, error)

func DeleteByIndex added in v0.2.0

func DeleteByIndex[T any](slice []T, index int) []T

func Exists added in v0.2.0

func Exists[T any](slice []T, predicate func(T) bool) (resultIndex int, ok bool)

func Filter added in v0.2.0

func Filter[T any](slice []T, predicate func(T) bool) (res []T)

func Find added in v0.2.0

func Find[T any](slice []T, predicate func(T) bool) (result T, resultIndex int, ok bool)

func In added in v0.2.0

func In[Item comparable](items []Item, item Item) bool

Types

type AfiAndSafi added in v0.2.0

type AfiAndSafi struct {
	RouterID        string          `json:"routerId"`
	As              int64           `json:"as"`
	VrfID           int             `json:"vrfId"`
	VrfName         string          `json:"vrfName"`
	TableVersion    int             `json:"tableVersion"`
	RibCount        int             `json:"ribCount"`
	RibMemory       int             `json:"ribMemory"`
	PeerCount       int             `json:"peerCount"`
	PeerMemory      int             `json:"peerMemory"`
	PeerGroupCount  int             `json:"peerGroupCount"`
	PeerGroupMemory int             `json:"peerGroupMemory"`
	Peers           map[string]Peer `json:"peers"`
	FailedPeers     int             `json:"failedPeers"`
	DisplayedPeers  int             `json:"displayedPeers"`
	TotalPeers      int             `json:"totalPeers"`
	DynamicPeers    int             `json:"dynamicPeers"`
	BestPath        bestPath        `json:"bestPath"`
}

type BGPAddressFamily added in v0.2.0

type BGPAddressFamily int

bgpAF == bgpAddressFamily.

const (
	IPv4Unicast BGPAddressFamily = iota
	IPv4Multicast
	IPv6Unicast
	IPv6Multicast
	L2VpnEvpn
	Unknown
)

func BGPAddressFamilyValues added in v0.2.0

func BGPAddressFamilyValues() (families []BGPAddressFamily)

func (BGPAddressFamily) Afi added in v0.2.0

func (af BGPAddressFamily) Afi() string

func (BGPAddressFamily) Safi added in v0.2.0

func (af BGPAddressFamily) Safi() string

func (BGPAddressFamily) String added in v0.2.0

func (af BGPAddressFamily) String() string

type BGPVrfSummary added in v0.2.0

type BGPVrfSummary map[string]BGPVrfSummarySpec

type BGPVrfSummarySpec added in v0.2.0

type BGPVrfSummarySpec map[string]AfiAndSafi

type Cli added in v0.2.0

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

func NewCli added in v0.2.0

func NewCli() *Cli

func (*Cli) ExecuteWithJSON added in v0.2.7

func (frr *Cli) ExecuteWithJSON(args []string) []byte

func (*Cli) ShowBGPSummary added in v0.2.0

func (frr *Cli) ShowBGPSummary(vrf string) (BGPVrfSummary, error)

func (*Cli) ShowEVPNVNIDetail added in v0.2.0

func (frr *Cli) ShowEVPNVNIDetail() (EVPNVniDetail, error)

func (*Cli) ShowRouteSummary added in v0.2.3

func (frr *Cli) ShowRouteSummary(vrf string) (VRFDualStackRouteSummary, error)

func (*Cli) ShowVRFs added in v0.2.0

func (frr *Cli) ShowVRFs(vrfName string) (VrfVni, error)

type Configuration added in v0.2.0

type Configuration struct {
	ASN              int
	VRFs             []VRFConfiguration
	HasCommunityDrop bool
}

type ConfigurationError added in v0.2.11

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

func (*ConfigurationError) Error added in v0.2.11

func (r *ConfigurationError) Error() string

type DualStackRouteSummary added in v0.2.3

type DualStackRouteSummary struct {
	IPv4  RouteSummaries `json:"ipv4"`
	IPv6  RouteSummaries `json:"ipv6"`
	Table string         `json:"table,omitempty"`
}

type EVPNVniDetail added in v0.2.0

type EVPNVniDetail struct {
	Vni                   int      `json:"vni"`
	Type                  string   `json:"type"`
	Vrf                   string   `json:"vrf"`
	VxlanInterface        string   `json:"vxlanInterface"`
	Ifindex               int      `json:"ifindex"`
	SviInterface          string   `json:"sviInterface"`
	SviIfindex            int      `json:"sviIfindex"`
	VtepIP                string   `json:"vtepIp"`
	McastGroup            string   `json:"mcastGroup"`
	AdvertiseGatewayMacip string   `json:"advertiseGatewayMacip"`
	AdvertiseSviMacip     string   `json:"advertiseSviMacip"`
	NumMacs               int      `json:"numMacs"`
	NumArpNd              int      `json:"numArpNd"`
	NumRemoteVteps        []string `json:"numRemoteVteps"`
}

type Manager added in v0.2.0

type Manager struct {
	ConfigPath   string
	TemplatePath string
	Cli          *Cli
	// contains filtered or unexported fields
}

func NewFRRManager

func NewFRRManager() *Manager

func (*Manager) Configure added in v0.2.0

func (m *Manager) Configure(in Configuration, nm *nl.Manager, nwopCfg *config.Config) (bool, error)

func (*Manager) GetStatusFRR added in v0.2.0

func (m *Manager) GetStatusFRR() (activeState, subState string, err error)

func (*Manager) Init added in v0.2.0

func (m *Manager) Init(mgmtVrf string) error

func (*Manager) ListBGPNeighbors added in v0.2.3

func (m *Manager) ListBGPNeighbors(vrf string) (bgpSummary BGPVrfSummary, err error)

func (*Manager) ListRouteSummary added in v0.2.3

func (m *Manager) ListRouteSummary(vrf string) ([]route.Information, error)

func (*Manager) ListVrfs added in v0.2.0

func (m *Manager) ListVrfs() ([]VrfVniSpec, error)

func (*Manager) ReloadFRR added in v0.2.0

func (m *Manager) ReloadFRR() error

func (*Manager) RestartFRR added in v0.2.0

func (m *Manager) RestartFRR() error

type Peer added in v0.2.0

type Peer struct {
	Hostname                   string `json:"hostname"`
	RemoteAs                   int64  `json:"remoteAs"`
	LocalAs                    int64  `json:"localAs"`
	Version                    int    `json:"version"`
	MsgRcvd                    int    `json:"msgRcvd"`
	MsgSent                    int    `json:"msgSent"`
	TableVersion               int    `json:"tableVersion"`
	Outq                       int    `json:"outq"`
	Inq                        int    `json:"inq"`
	PeerUptime                 string `json:"peerUptime"`
	PeerUptimeMsec             int    `json:"peerUptimeMsec"`
	PeerUptimeEstablishedEpoch int    `json:"peerUptimeEstablishedEpoch"`
	PfxRcd                     int    `json:"pfxRcd"`
	PfxSnt                     int    `json:"pfxSnt"`
	State                      string `json:"state"`
	PeerState                  string `json:"peerState"`
	ConnectionsEstablished     int    `json:"connectionsEstablished"`
	ConnectionsDropped         int    `json:"connectionsDropped"`
	IDType                     string `json:"idType"`
}

type PrefixList

type PrefixList struct {
	Items     []PrefixedRouteItem
	Seq       int
	Community *string
}

type PrefixedRouteItem

type PrefixedRouteItem struct {
	CIDR   net.IPNet
	IPv6   bool
	Seq    int
	Action string
	GE     *int
	LE     *int
}

type RouteSummaries added in v0.2.3

type RouteSummaries struct {
	Routes         []RouteSummary `json:"routes"`
	RoutesTotal    int            `json:"routesTotal"`
	RoutesTotalFib int            `json:"routesTotalFib"`
}

type RouteSummary added in v0.2.3

type RouteSummary struct {
	Fib          int    `json:"fib"`
	Rib          int    `json:"rib"`
	FibOffLoaded int    `json:"fibOffLoaded"`
	FibTrapped   int    `json:"fibTrapped"`
	Type         string `json:"type"`
}

type VRFConfiguration

type VRFConfiguration struct {
	Name          string
	VNI           int
	MTU           int
	RT            string
	IsTaaS        bool
	AggregateIPv4 []string
	AggregateIPv6 []string
	Import        []PrefixList
	Export        []PrefixList
}

func (*VRFConfiguration) ShouldDefineRT

func (v *VRFConfiguration) ShouldDefineRT() bool

func (*VRFConfiguration) ShouldTemplateVRF

func (v *VRFConfiguration) ShouldTemplateVRF() bool

type VRFDualStackRouteSummary added in v0.2.3

type VRFDualStackRouteSummary map[string]DualStackRouteSummary

type VrfVni added in v0.2.0

type VrfVni struct {
	Vrfs []VrfVniSpec `json:"vrfs"`
}

type VrfVniSpec added in v0.2.0

type VrfVniSpec struct {
	Vrf       string `json:"vrf"`
	Vni       int    `json:"vni"`
	VxlanIntf string `json:"vxlanIntf"`
	SviIntf   string `json:"sviIntf"`
	State     string `json:"state"`
	RouterMac string `json:"routerMac"`
	Table     string `json:"table,omitempty"`
}

Directories

Path Synopsis
mock
Package mock_dbus is a generated GoMock package.
Package mock_dbus is a generated GoMock package.

Jump to

Keyboard shortcuts

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