Documentation ¶
Index ¶
- Variables
- func NewGoBGPServer(ctx context.Context, log *logrus.Entry, params types.ServerParameters) (types.Router, error)
- func ToAgentPath(p *gobgp.Path) (*types.Path, error)
- func ToAgentPaths(paths []*gobgp.Path) ([]*types.Path, error)
- func ToGoBGPPath(p *types.Path) (*gobgp.Path, error)
- type GoBGPServer
- func (g *GoBGPServer) AddNeighbor(ctx context.Context, n types.NeighborRequest) 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.NeighborRequest) error
- func (g *GoBGPServer) RemoveRoutePolicy(ctx context.Context, r types.RoutePolicyRequest) error
- func (g *GoBGPServer) ResetNeighbor(ctx context.Context, r types.ResetNeighborRequest) 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 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 ¶
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
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 ¶
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 ¶ 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 ¶
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 ¶
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) 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 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)