gobgp

package
v0.0.0-...-4a05471 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package gobgp provides a source implementation for GoBGP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoutesResponse

func NewRoutesResponse() api.RoutesResponse

NewRoutesResponse creates a new routes response

func PeerHash

func PeerHash(peer *api.Peer) string

PeerHash calculates a peer hash

func PeerHashWithASAndAddress

func PeerHashWithASAndAddress(asn uint32, address string) string

PeerHashWithASAndAddress creates a peer hash (sha1) from the ASN and the address.

Types

type Config

type Config struct {
	ID   string
	Name string

	Host     string `ini:"host"`
	Insecure bool   `ini:"insecure"`
	// ProcessingTimeout is a timeout in seconds configured per gRPC call to a given GoBGP daemon
	ProcessingTimeout int    `ini:"processing_timeout"`
	TLSCert           string `ini:"tls_crt"`
	TLSCommonName     string `ini:"tls_common_name"`
}

Config is a GoBGP source config

type GoBGP

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

GoBGP is a source for Alice.

func NewGoBGP

func NewGoBGP(config Config) *GoBGP

NewGoBGP creates a new GoBGP source instance

func (*GoBGP) AllRoutes

func (gobgp *GoBGP) AllRoutes(
	ctx context.Context,
) (*api.RoutesResponse, error)

AllRoutes returns a routes dump (filtered, received), which is used to learn all prefixes to build up a local store for searching.

func (*GoBGP) ExpireCaches

func (gobgp *GoBGP) ExpireCaches() int

ExpireCaches clears all local caches

func (*GoBGP) GetNeighbors

func (gobgp *GoBGP) GetNeighbors(
	ctx context.Context,
) ([]*gobgpapi.Peer, error)

GetNeighbors retrievs all neighbors and returns a list of peers.

func (*GoBGP) GetRoutes

func (gobgp *GoBGP) GetRoutes(
	ctx context.Context,
	peer *gobgpapi.Peer,
	tableType gobgpapi.TableType,
	response *api.RoutesResponse,
) error

GetRoutes retrieves all routes from a peer for a table type.

func (*GoBGP) Neighbors

func (gobgp *GoBGP) Neighbors(
	ctx context.Context,
) (*api.NeighborsResponse, error)

Neighbors retrievs a list of neighbors

func (*GoBGP) NeighborsStatus

func (gobgp *GoBGP) NeighborsStatus(
	ctx context.Context,
) (*api.NeighborsStatusResponse, error)

NeighborsStatus retrievs all status information for all peers on the RS.

func (*GoBGP) NeighborsSummary

func (gobgp *GoBGP) NeighborsSummary(
	ctx context.Context,
) (*api.NeighborsResponse, error)

NeighborsSummary is an alias of Neighbors for now

func (*GoBGP) Routes

func (gobgp *GoBGP) Routes(
	ctx context.Context,
	neighborID string,
) (*api.RoutesResponse, error)

Routes retrieves filtered and exported routes

func (*GoBGP) RoutesFiltered

func (gobgp *GoBGP) RoutesFiltered(
	ctx context.Context,
	neighborID string,
) (*api.RoutesResponse, error)

RoutesFiltered gets all filtered routes

func (*GoBGP) RoutesNotExported

func (gobgp *GoBGP) RoutesNotExported(
	ctx context.Context,
	neighborID string,
) (*api.RoutesResponse, error)

RoutesNotExported gets all not exported routes

func (*GoBGP) RoutesReceived

func (gobgp *GoBGP) RoutesReceived(
	ctx context.Context,
	neighborID string,
) (*api.RoutesResponse, error)

RoutesReceived gets all received routes

func (*GoBGP) RoutesRequired

func (gobgp *GoBGP) RoutesRequired(
	ctx context.Context,
	neighborID string,
) (*api.RoutesResponse, error)

RoutesRequired is a specialized request to fetch:

- RoutesExported and - RoutesFiltered

from Birdwatcher. As the not exported routes can be very many these are optional and can be loaded on demand using the RoutesNotExported() API.

A route deduplication is applied.

func (*GoBGP) Status

func (gobgp *GoBGP) Status(
	ctx context.Context,
) (*api.StatusResponse, error)

Status retrievs the routers status

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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