gobgp

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GoBGPIPv6Family is a read-only pointer to a gobgp.Family structure
	// representing IPv6 address family.
	GoBGPIPv6Family = &gobgp.Family{
		Afi:  gobgp.Family_AFI_IP6,
		Safi: gobgp.Family_SAFI_UNICAST,
	}
	// GoBGPIPv4Family is a read-only pointer to a gobgp.Family structure
	// representing IPv4 address family.
	GoBGPIPv4Family = &gobgp.Family{
		Afi:  gobgp.Family_AFI_IP,
		Safi: gobgp.Family_SAFI_UNICAST,
	}
)

Functions

func NewGoBGPServer added in v1.15.0

func NewGoBGPServer(ctx context.Context, log *logrus.Entry, params types.ServerParameters) (types.Router, error)

NewGoBGPServer returns instance of go bgp router wrapper.

func ToAgentPath

func ToAgentPath(p *gobgp.Path) (*types.Path, error)

ToAgentPath converts the GoBGP Path type to the Agent Path type

func ToAgentPaths

func ToAgentPaths(paths []*gobgp.Path) ([]*types.Path, error)

ToAgentPaths converts slice of the GoBGP Path type to slice of the Agent Path type

func ToGoBGPPath

func ToGoBGPPath(p *types.Path) (*gobgp.Path, error)

ToGoBGPPath converts the Agent Path type to the GoBGP Path type

Types

type GoBGPServer

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

GoBGPServer is wrapper on top of go bgp server implementation

func (*GoBGPServer) AddNeighbor

func (g *GoBGPServer) AddNeighbor(ctx context.Context, n types.NeighborRequest) error

AddNeighbor will add the CiliumBGPNeighbor to the gobgp.BgpServer, creating a BGP peering connection.

func (*GoBGPServer) AddRoutePolicy added in v1.15.0

func (g *GoBGPServer) AddRoutePolicy(ctx context.Context, r types.RoutePolicyRequest) error

AddRoutePolicy adds a new routing policy into the global policies of the server.

func (*GoBGPServer) AdvertisePath

func (g *GoBGPServer) AdvertisePath(ctx context.Context, p types.PathRequest) (types.PathResponse, error)

AdvertisePath will advertise the provided Path to any existing and all subsequently added Neighbors currently peered with this BgpServer.

It is an error to advertise an IPv6 path when no IPv6 address is configured on this Cilium node, selfsame for IPv4.

A Path is returned which may be passed to WithdrawPath to stop advertising the Path.

func (*GoBGPServer) GetBGP

GetBgp returns bgp global configuration from gobgp server

func (*GoBGPServer) GetPeerState

func (g *GoBGPServer) GetPeerState(ctx context.Context) (types.GetPeerStateResponse, error)

GetPeerState invokes goBGP ListPeer API to get current peering state.

func (*GoBGPServer) GetRoutePolicies added in v1.15.0

func (g *GoBGPServer) GetRoutePolicies(ctx context.Context) (*types.GetRoutePoliciesResponse, error)

GetRoutePolicies retrieves route policies from the underlying router

func (*GoBGPServer) GetRoutes

GetRoutes retrieves routes from the RIB of underlying router

func (*GoBGPServer) RemoveNeighbor

func (g *GoBGPServer) RemoveNeighbor(ctx context.Context, n types.NeighborRequest) error

RemoveNeighbor will remove the CiliumBGPNeighbor from the gobgp.BgpServer, disconnecting the BGP peering connection.

func (*GoBGPServer) RemoveRoutePolicy added in v1.15.0

func (g *GoBGPServer) RemoveRoutePolicy(ctx context.Context, r types.RoutePolicyRequest) error

RemoveRoutePolicy removes a routing policy from the global policies of the server.

func (*GoBGPServer) ResetNeighbor added in v1.15.0

func (g *GoBGPServer) ResetNeighbor(ctx context.Context, r types.ResetNeighborRequest) error

ResetNeighbor resets BGP peering with the provided neighbor address.

func (*GoBGPServer) Stop

func (g *GoBGPServer) Stop()

Stop closes gobgp server

func (*GoBGPServer) UpdateNeighbor

func (g *GoBGPServer) UpdateNeighbor(ctx context.Context, n types.NeighborRequest) error

UpdateNeighbor will update the existing CiliumBGPNeighbor in the gobgp.BgpServer.

func (*GoBGPServer) WithdrawPath

func (g *GoBGPServer) WithdrawPath(ctx context.Context, p types.PathRequest) error

WithdrawPath withdraws a Path produced by AdvertisePath from this BgpServer.

type LogParams

type LogParams struct {
	AS        uint32
	Component string
	SubSys    string
}

type ServerLogger

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

implement github.com/osrg/gobgp/v3/pkg/log/Logger interface

func NewServerLogger

func NewServerLogger(l *logrus.Logger, params LogParams) *ServerLogger

func (*ServerLogger) Debug

func (l *ServerLogger) Debug(msg string, fields gobgpLog.Fields)

func (*ServerLogger) Error

func (l *ServerLogger) Error(msg string, fields gobgpLog.Fields)

func (*ServerLogger) Fatal

func (l *ServerLogger) Fatal(msg string, fields gobgpLog.Fields)

func (*ServerLogger) GetLevel

func (l *ServerLogger) GetLevel() gobgpLog.LogLevel

func (*ServerLogger) Info

func (l *ServerLogger) Info(msg string, fields gobgpLog.Fields)

func (*ServerLogger) Panic

func (l *ServerLogger) Panic(msg string, fields gobgpLog.Fields)

func (*ServerLogger) SetLevel

func (l *ServerLogger) SetLevel(level gobgpLog.LogLevel)

func (*ServerLogger) Warn

func (l *ServerLogger) Warn(msg string, fields gobgpLog.Fields)

Jump to

Keyboard shortcuts

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