vrf

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const DefaultVRFName = "main"

Variables

This section is empty.

Functions

func Metrics

func Metrics(r *VRFRegistry) []*metrics.VRFMetrics

Metrics returns metrics for all VRFs

func MetricsForVRF

func MetricsForVRF(v *VRF) *metrics.VRFMetrics

func ParseHumanReadableRouteDistinguisher

func ParseHumanReadableRouteDistinguisher(x string) (uint64, error)

ParseHumanReadableRouteDistinguisher parses a human readable route distinguisher

func RouteDistinguisherHumanReadable

func RouteDistinguisherHumanReadable(rdi uint64) string

RouteDistinguisherHumanReadable converts 64bit route distinguisher to human readable string form

Types

type VRF

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

VRF a list of RIBs for different address families building a routing instance

func New

func New(name string, rd uint64) (*VRF, error)

New creates a new VRF. The VRF is registered automatically to the global VRF registry.

func NewUntrackedVRF added in v0.1.8

func NewUntrackedVRF(name string, rd uint64) *VRF

func (*VRF) AddContributingASN added in v0.1.8

func (v *VRF) AddContributingASN(asn uint32)

AddContributingASN adds the given ASN to the list of ASNs is used by this BGP speaker somewhere within this VRF

func (*VRF) AddContributingClusterID added in v0.1.8

func (v *VRF) AddContributingClusterID(cid uint32)

AddContributingASN adds the given ClusterID to the list of ClusterIDs is used by this BGP speaker somewhere within this VRF

func (*VRF) CreateIPv4UnicastLocRIB

func (v *VRF) CreateIPv4UnicastLocRIB(name string) (*locRIB.LocRIB, error)

CreateIPv4UnicastLocRIB creates a LocRIB for the IPv4 unicast address family

func (*VRF) CreateIPv6UnicastLocRIB

func (v *VRF) CreateIPv6UnicastLocRIB(name string) (*locRIB.LocRIB, error)

CreateIPv6UnicastLocRIB creates a LocRIB for the IPv6 unicast address family

func (*VRF) Dispose

func (v *VRF) Dispose()

Dispose drops all referenes to all RIBs within a VRF

func (*VRF) IPv4UnicastRIB

func (v *VRF) IPv4UnicastRIB() *locRIB.LocRIB

IPv4UnicastRIB returns the local RIB for the IPv4 unicast address family

func (*VRF) IPv6UnicastRIB

func (v *VRF) IPv6UnicastRIB() *locRIB.LocRIB

IPv6UnicastRIB returns the local RIB for the IPv6 unicast address family

func (*VRF) IsContributingASN added in v0.1.8

func (v *VRF) IsContributingASN(asn uint32) bool

IsContributingASN returns wether the given ASN is used by this BGP speaker somewhere within this VRF

func (*VRF) IsContributingClusterID added in v0.1.8

func (v *VRF) IsContributingClusterID(cid uint32) bool

IsContributingASN returns wether the given ClusterID is used by this BGP speaker somewhere within this VRF

func (*VRF) Name

func (v *VRF) Name() string

Name is the name of the VRF

func (*VRF) RD

func (v *VRF) RD() uint64

RD returns the route distinguisher of the VRF

func (*VRF) RIBByName

func (v *VRF) RIBByName(name string) (rib *locRIB.LocRIB, found bool)

RIBByName returns the RIB for a given name. If there is no RIB with this name, found is false

func (*VRF) RemoveContributingASN added in v0.1.8

func (v *VRF) RemoveContributingASN(asn uint32)

RemoveContributingASN removes the given ASN from the list of ASNs is used by this BGP speaker somewhere within this VRF

func (*VRF) RemoveContributingClusterID added in v0.1.8

func (v *VRF) RemoveContributingClusterID(cid uint32)

RemoveContributingASN removes the given ClusterID from the list of ClusterIDs is used by this BGP speaker somewhere within this VRF

func (*VRF) Unregister

func (v *VRF) Unregister()

Unregister removes this VRF from the global registry.

type VRFRegistry

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

VRFRegistry holds a reference to all active VRFs. Every VRF have to have a different name.

func GetGlobalRegistry

func GetGlobalRegistry() *VRFRegistry

GetGlobalRegistry gets the global registry

func NewVRFRegistry

func NewVRFRegistry() *VRFRegistry

func (*VRFRegistry) CreateVRFIfNotExists

func (r *VRFRegistry) CreateVRFIfNotExists(name string, rd uint64) *VRF

func (*VRFRegistry) DisposeAll

func (r *VRFRegistry) DisposeAll()

DisposeAll dosposes all VRFs

func (*VRFRegistry) GetVRFByName

func (r *VRFRegistry) GetVRFByName(name string) *VRF

GetVRFByRD gets a VRF by route distinguisher

func (*VRFRegistry) List

func (r *VRFRegistry) List() []*VRF

func (*VRFRegistry) UnregisterVRF

func (r *VRFRegistry) UnregisterVRF(v *VRF)

unregisterVRF removes the given VRF from the registry.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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