gobgp

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 13 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 NewGoBGPServerWithConfig

func NewGoBGPServerWithConfig(ctx context.Context, log *logrus.Entry, params types.ServerParameters, _ *agent.ControlPlaneState) (types.Router, error)

NewGoBGPServerWithConfig returns instance of go bgp router wrapper.

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) AdvertisePath

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

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

`ip` can be an ipv4 or ipv6 and this method will handle the differences between MP BGP and BGP.

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

Nexthop of the path will always set to "0.0.0.0" in IPv4 and "::" in IPv6, so that GoBGP selects appropriate actual nexthop address and advertise it.

An Advertisement is returned which may be passed to WithdrawPath to remove this Advertisement.

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) 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) 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 an Advertisement 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