Documentation ¶
Overview ¶
Package gobgp provides a source implementation for GoBGP.
Index ¶
- func NewRoutesResponse() api.RoutesResponse
- func PeerHash(peer *api.Peer) string
- func PeerHashWithASAndAddress(asn uint32, address string) string
- type Config
- type GoBGP
- func (gobgp *GoBGP) AllRoutes(ctx context.Context) (*api.RoutesResponse, error)
- func (gobgp *GoBGP) ExpireCaches() int
- func (gobgp *GoBGP) GetNeighbors(ctx context.Context) ([]*gobgpapi.Peer, error)
- func (gobgp *GoBGP) GetRoutes(ctx context.Context, peer *gobgpapi.Peer, tableType gobgpapi.TableType, ...) error
- func (gobgp *GoBGP) Neighbors(ctx context.Context) (*api.NeighborsResponse, error)
- func (gobgp *GoBGP) NeighborsStatus(ctx context.Context) (*api.NeighborsStatusResponse, error)
- func (gobgp *GoBGP) NeighborsSummary(ctx context.Context) (*api.NeighborsResponse, error)
- func (gobgp *GoBGP) Routes(ctx context.Context, neighborID string) (*api.RoutesResponse, error)
- func (gobgp *GoBGP) RoutesFiltered(ctx context.Context, neighborID string) (*api.RoutesResponse, error)
- func (gobgp *GoBGP) RoutesNotExported(ctx context.Context, neighborID string) (*api.RoutesResponse, error)
- func (gobgp *GoBGP) RoutesReceived(ctx context.Context, neighborID string) (*api.RoutesResponse, error)
- func (gobgp *GoBGP) RoutesRequired(ctx context.Context, neighborID string) (*api.RoutesResponse, error)
- func (gobgp *GoBGP) Status(ctx context.Context) (*api.StatusResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRoutesResponse ¶
func NewRoutesResponse() api.RoutesResponse
NewRoutesResponse creates a new routes response
func PeerHashWithASAndAddress ¶
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 (*GoBGP) AllRoutes ¶
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 ¶
ExpireCaches clears all local caches
func (*GoBGP) GetNeighbors ¶
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) NeighborsStatus ¶
NeighborsStatus retrievs all status information for all peers on the RS.
func (*GoBGP) NeighborsSummary ¶
NeighborsSummary is an alias of Neighbors for now
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.