Documentation ¶
Index ¶
- Variables
- func NewGoBGPServerWithConfig(ctx context.Context, log *logrus.Entry, params types.ServerParameters, ...) (types.Router, error)
- type GoBGPServer
- func (g *GoBGPServer) AddNeighbor(ctx context.Context, n types.NeighborRequest) error
- func (g *GoBGPServer) AdvertisePath(ctx context.Context, p types.PathRequest) (types.PathResponse, error)
- func (g *GoBGPServer) GetBGP(ctx context.Context) (types.GetBGPResponse, error)
- func (g *GoBGPServer) GetPeerState(ctx context.Context) (types.GetPeerStateResponse, error)
- func (g *GoBGPServer) RemoveNeighbor(ctx context.Context, n types.NeighborRequest) error
- func (g *GoBGPServer) Stop()
- func (g *GoBGPServer) UpdateNeighbor(ctx context.Context, n types.NeighborRequest) error
- func (g *GoBGPServer) WithdrawPath(ctx context.Context, p types.PathRequest) error
- type LogParams
- type ServerLogger
- func (l *ServerLogger) Debug(msg string, fields gobgpLog.Fields)
- func (l *ServerLogger) Error(msg string, fields gobgpLog.Fields)
- func (l *ServerLogger) Fatal(msg string, fields gobgpLog.Fields)
- func (l *ServerLogger) GetLevel() gobgpLog.LogLevel
- func (l *ServerLogger) Info(msg string, fields gobgpLog.Fields)
- func (l *ServerLogger) Panic(msg string, fields gobgpLog.Fields)
- func (l *ServerLogger) SetLevel(level gobgpLog.LogLevel)
- func (l *ServerLogger) Warn(msg string, fields gobgpLog.Fields)
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (g *GoBGPServer) GetBGP(ctx context.Context) (types.GetBGPResponse, error)
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) 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 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) GetLevel ¶
func (l *ServerLogger) GetLevel() gobgpLog.LogLevel
func (*ServerLogger) SetLevel ¶
func (l *ServerLogger) SetLevel(level gobgpLog.LogLevel)