bgp

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommunityMaxSize     = 32
	CommunityMaxPartSize = 16
)

Variables

This section is empty.

Functions

func GenerateRouterID

func GenerateRouterID(nodeIPAware utils.NodeIPAware, configRouterID string) (string, error)

GenerateRouterID will generate a router ID based upon the user's configuration (or lack there of) and the node's primary IP address if the user has not specified. If the user has configured the router ID as "generate" then we will generate a router ID based upon fnv hashing the node's primary IP address.

func ParseNextHop

func ParseNextHop(path *gobgpapi.Path) (net.IP, error)

ParseNextHop takes in a GoBGP Path and parses out the destination's next hop from its attributes. If it can't parse a next hop IP from the GoBGP Path, it returns an error.

func ParsePath

func ParsePath(path *gobgpapi.Path) (*net.IPNet, net.IP, error)

ParsePath takes in a GoBGP Path and parses out the destination subnet and the next hop from its attributes. If successful, it will return the destination of the BGP path as a subnet form and the next hop. If it can't parse the destination or the next hop IP, it returns an error.

func ValidateCommunity

func ValidateCommunity(arg string) error

ValidateCommunity takes in a string and attempts to parse a BGP community out of it in a way that is similar to gobgp (internal/pkg/table/policy.go:ParseCommunity()). If it is not able to parse the community information it returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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