frr

package
v0.2.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 22 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) 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) ShowRoutes added in v0.2.0

func (frr *Cli) ShowRoutes(vrf string) (VRFDualStackRoutes, error)

func (*Cli) ShowVRFs added in v0.2.0

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

type Configuration added in v0.2.0

type Configuration struct {
	ASN  int
	VRFs []VRFConfiguration
}

type DualStackRoutes added in v0.2.0

type DualStackRoutes struct {
	IPv4 Routes `json:"ipv4"`
	IPv6 Routes `json:"ipv6"`
}

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) (bool, error)

func (*Manager) GetStatusFRR added in v0.2.0

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

func (*Manager) Init added in v0.2.0

func (m *Manager) Init() error

func (*Manager) ListNeighbors added in v0.2.0

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

func (*Manager) ListRoutes added in v0.2.0

func (m *Manager) ListRoutes(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 (*Manager) ReloadFRR() error

func (*Manager) RestartFRR added in v0.2.0

func (*Manager) RestartFRR() error

type NextHop added in v0.2.0

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"`
	OnLink         bool   `json:"onLink"`
	Weight         int    `json:"weight"`
}

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 Route added in v0.2.0

type Route struct {
	Prefix                   string    `json:"prefix"`
	PrefixLen                int       `json:"prefixLen"`
	Protocol                 string    `json:"protocol"`
	VrfID                    int       `json:"vrfId"`
	VrfName                  string    `json:"vrfName"`
	Selected                 bool      `json:"selected"`
	DestSelected             bool      `json:"destSelected"`
	Distance                 int       `json:"distance"`
	Metric                   int       `json:"metric"`
	Installed                bool      `json:"installed"`
	Tag                      int       `json:"tag"`
	Table                    int       `json:"table"`
	InternalStatus           int       `json:"internalStatus"`
	InternalFlags            int       `json:"internalFlags"`
	InternalNextHopNum       int       `json:"internalNextHopNum"`
	InternalNextHopActiveNum int       `json:"internalNextHopActiveNum"`
	NexthopGroupID           int       `json:"nexthopGroupId"`
	InstalledNexthopGroupID  int       `json:"installedNexthopGroupId"`
	Uptime                   string    `json:"uptime"`
	Nexthops                 []NextHop `json:"nexthops"`
}

type Routes added in v0.2.0

type Routes map[string][]Route

type VRFConfiguration

type VRFConfiguration struct {
	Name          string
	VNI           int
	RT            string
	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 VRFDualStackRoutes added in v0.2.0

type VRFDualStackRoutes map[string]DualStackRoutes

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"`
}

Jump to

Keyboard shortcuts

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