Documentation
¶
Index ¶
- Variables
- func NewGoBGPServer(ctx context.Context, log *slog.Logger, params types.ServerParameters) (types.Router, error)
- func NewRouterProvider() types.RouterProvider
- func ToAgentPath(p *gobgp.Path) (*types.Path, error)
- func ToAgentPaths(paths []*gobgp.Path) ([]*types.Path, error)
- func ToGoBGPPath(p *types.Path) (*gobgp.Path, error)
- func ToGoBGPPeer(n *types.Neighbor, oldPeer *gobgp.Peer, v4 bool) *gobgp.Peer
- type GoBGPServer
- func (g *GoBGPServer) AddNeighbor(ctx context.Context, n *types.Neighbor) error
- func (g *GoBGPServer) AddRoutePolicy(ctx context.Context, r types.RoutePolicyRequest) 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) GetRoutePolicies(ctx context.Context) (*types.GetRoutePoliciesResponse, error)
- func (g *GoBGPServer) GetRoutes(ctx context.Context, r *types.GetRoutesRequest) (*types.GetRoutesResponse, error)
- func (g *GoBGPServer) RemoveNeighbor(ctx context.Context, n *types.Neighbor) error
- func (g *GoBGPServer) RemoveRoutePolicy(ctx context.Context, r types.RoutePolicyRequest) error
- func (g *GoBGPServer) ResetAllNeighbors(ctx context.Context, r types.ResetAllNeighborsRequest) error
- func (g *GoBGPServer) ResetNeighbor(ctx context.Context, r types.ResetNeighborRequest) error
- func (g *GoBGPServer) Stop(_ context.Context, r types.StopRequest)
- func (g *GoBGPServer) UpdateNeighbor(ctx context.Context, n *types.Neighbor) error
- func (g *GoBGPServer) WithdrawPath(ctx context.Context, p types.PathRequest) error
- type LogParams
- type RouterProvider
- 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(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 NewGoBGPServer ¶
func NewGoBGPServer(ctx context.Context, log *slog.Logger, params types.ServerParameters) (types.Router, error)
NewGoBGPServer returns instance of go bgp router wrapper.
func NewRouterProvider ¶
func NewRouterProvider() types.RouterProvider
func ToAgentPath ¶
ToAgentPath converts the GoBGP Path type to the Agent Path type
func ToAgentPaths ¶
ToAgentPaths converts slice of the GoBGP Path type to slice of the Agent Path type
func ToGoBGPPath ¶
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 ¶
AddNeighbor will add the CiliumBGPNeighbor to the gobgp.BgpServer, creating a BGP peering connection.
func (*GoBGPServer) AddRoutePolicy ¶
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 ¶
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) GetRoutePolicies ¶
func (g *GoBGPServer) GetRoutePolicies(ctx context.Context) (*types.GetRoutePoliciesResponse, error)
GetRoutePolicies retrieves route policies from the underlying router
func (*GoBGPServer) GetRoutes ¶
func (g *GoBGPServer) GetRoutes(ctx context.Context, r *types.GetRoutesRequest) (*types.GetRoutesResponse, error)
GetRoutes retrieves routes from the RIB of underlying router
func (*GoBGPServer) RemoveNeighbor ¶
RemoveNeighbor will remove the peer from the gobgp.BgpServer, disconnecting the BGP peering connection.
func (*GoBGPServer) RemoveRoutePolicy ¶
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) ResetAllNeighbors ¶
func (g *GoBGPServer) ResetAllNeighbors(ctx context.Context, r types.ResetAllNeighborsRequest) error
ResetAllNeighbors resets BGP peering with all configured neighbors.
func (*GoBGPServer) ResetNeighbor ¶
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(_ context.Context, r types.StopRequest)
Stop closes gobgp server
func (*GoBGPServer) UpdateNeighbor ¶
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 ServerLogger ¶
type ServerLogger struct {
// contains filtered or unexported fields
}
implement github.com/osrg/gobgp/v3/pkg/log/Logger interface
func NewServerLogger ¶
func NewServerLogger(l *slog.Logger, params LogParams) *ServerLogger
func (*ServerLogger) GetLevel ¶
func (l *ServerLogger) GetLevel() gobgpLog.LogLevel
func (*ServerLogger) SetLevel ¶
func (l *ServerLogger) SetLevel(gobgpLog.LogLevel)