Documentation
¶
Index ¶
- Constants
- type AddressFamilyConfig
- type BGPAPIServer
- func (s *BGPAPIServer) DumpRIBIn(in *api.DumpRIBRequest, stream api.BgpService_DumpRIBInServer) error
- func (s *BGPAPIServer) DumpRIBOut(in *api.DumpRIBRequest, stream api.BgpService_DumpRIBOutServer) error
- func (s *BGPAPIServer) ListSessions(ctx context.Context, in *api.ListSessionsRequest) (*api.ListSessionsResponse, error)
- type BGPServer
- type BGPServerConfig
- type BMPReceiver
- func (b *BMPReceiver) AddRouter(addr net.IP, port uint16, passive bool, dynamic bool) error
- func (b *BMPReceiver) Close() error
- func (b *BMPReceiver) GetRouter(name string) RouterInterface
- func (b *BMPReceiver) GetRouters() []RouterInterface
- func (b *BMPReceiver) Listen(addr string) error
- func (b *BMPReceiver) LocalAddr() net.Addr
- func (b *BMPReceiver) Metrics() (*metrics.BMPMetrics, error)
- func (b *BMPReceiver) RemoveRouter(addr net.IP)
- func (b *BMPReceiver) Serve() error
- type BMPReceiverConfig
- type BMPReceiverInterface
- type FSM
- type PeerConfig
- type PeerKey
- type Router
- type RouterConfig
- type RouterInterface
- type UpdateSender
- func (u *UpdateSender) AddPath(pfx *bnet.Prefix, p *route.Path) error
- func (u *UpdateSender) AddPathInitialDump(pfx *bnet.Prefix, p *route.Path) error
- func (u *UpdateSender) ClientCount() uint64
- func (u *UpdateSender) Destroy()
- func (u *UpdateSender) Dispose()
- func (u *UpdateSender) Dump() []*route.Route
- func (u *UpdateSender) EndOfRIB()
- func (a *UpdateSender) RefreshRoute(*bnet.Prefix, []*route.Path)
- func (a *UpdateSender) Register(client routingtable.RouteTableClient)
- func (a *UpdateSender) RegisterWithOptions(client routingtable.RouteTableClient, opt routingtable.ClientOptions)
- func (u *UpdateSender) RemovePath(pfx *bnet.Prefix, p *route.Path) bool
- func (a *UpdateSender) ReplaceFilterChain(c filter.Chain)
- func (a *UpdateSender) ReplacePath(*bnet.Prefix, *route.Path, *route.Path)
- func (u *UpdateSender) RouteCount() int64
- func (u *UpdateSender) Start(aggrTime time.Duration)
- func (a *UpdateSender) Unregister(client routingtable.RouteTableClient)
- func (u *UpdateSender) UpdateNewClient(client routingtable.RouteTableClient) error
Constants ¶
const ( // Administrative events ManualStart = 1 ManualStop = 2 AutomaticStart = 3 ManualStartWithPassiveTcpEstablishment = 4 AutomaticStartWithPassiveTcpEstablishment = 5 AutomaticStop = 8 Cease = 100 )
const ( // BGP Role configuration, these values will be translated into values defined by the RFC on peer setup PeerConfigRoleOff = 0 PeerConfigRoleProvider = 1 PeerConfigRoleRS = 2 PeerConfigRoleRSClient = 3 PeerConfigRoleCustomer = 4 PeerConfigRolePeer = 5 )
const ( BGPVersion = 4 DefaultLocaPreference = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressFamilyConfig ¶
type AddressFamilyConfig struct {
ImportFilterChain filter.Chain
ExportFilterChain filter.Chain
AddPathSend routingtable.ClientOptions
AddPathRecv bool
NextHopExtended bool
}
AddressFamilyConfig represents all configuration parameters specific for an address family
type BGPAPIServer ¶
type BGPAPIServer struct {
api.UnimplementedBgpServiceServer
// contains filtered or unexported fields
}
func NewBGPAPIServer ¶
func NewBGPAPIServer(s BGPServer, vrfReg *vrf.VRFRegistry) *BGPAPIServer
NewBGPAPIServer creates a new BGP API Server
func (*BGPAPIServer) DumpRIBIn ¶
func (s *BGPAPIServer) DumpRIBIn(in *api.DumpRIBRequest, stream api.BgpService_DumpRIBInServer) error
DumpRIBIn dumps the RIB in of a peer for a given AFI/SAFI
func (*BGPAPIServer) DumpRIBOut ¶
func (s *BGPAPIServer) DumpRIBOut(in *api.DumpRIBRequest, stream api.BgpService_DumpRIBOutServer) error
DumpRIBOut dumps the RIB out of a peer for a given AFI/SAFI
func (*BGPAPIServer) ListSessions ¶
func (s *BGPAPIServer) ListSessions(ctx context.Context, in *api.ListSessionsRequest) (*api.ListSessionsResponse, error)
type BGPServer ¶
type BGPServer interface {
RouterID() uint32
Start()
AddPeer(PeerConfig) error
GetPeerConfig(*vrf.VRF, *bnet.IP) *PeerConfig
DisposePeer(*vrf.VRF, *bnet.IP)
GetPeers() []PeerKey
Metrics() (*metrics.BGPMetrics, error)
GetRIBIn(vrf *vrf.VRF, peerIP *bnet.IP, afi uint16, safi uint8) *adjRIBIn.AdjRIBIn
GetRIBOut(vrf *vrf.VRF, peerIP *bnet.IP, afi uint16, safi uint8) *adjRIBOut.AdjRIBOut
ReplaceImportFilterChain(vrf *vrf.VRF, peer *bnet.IP, c filter.Chain) error
ReplaceExportFilterChain(vrf *vrf.VRF, peer *bnet.IP, c filter.Chain) error
GetDefaultVRF() *vrf.VRF
SetListenerManager(lm tcp.ListenerManagerI)
}
func NewBGPServer ¶
func NewBGPServer(config BGPServerConfig) BGPServer
NewBGPServer creates a new instance of BGPServer with the given BGPServerConfig
type BGPServerConfig ¶ added in v0.1.8
type BMPReceiver ¶ added in v0.1.6
type BMPReceiver struct {
// contains filtered or unexported fields
}
BMPReceiver represents a BMP receiver
func NewBMPReceiver ¶ added in v0.1.6
func NewBMPReceiver(cfg BMPReceiverConfig) *BMPReceiver
NewBMPReceiver creates a new BMP receiver
func NewBMPReceiverWithAdjRIBInFactory ¶ added in v0.1.6
func NewBMPReceiverWithAdjRIBInFactory(cfg BMPReceiverConfig, adjRIBInFactory adjRIBInFactoryI) *BMPReceiver
func (*BMPReceiver) AddRouter ¶ added in v0.1.6
AddRouter adds a router to which we connect with BMP
func (*BMPReceiver) Close ¶ added in v0.1.6
func (b *BMPReceiver) Close() error
Close tears down all open connections
func (*BMPReceiver) GetRouter ¶ added in v0.1.6
func (b *BMPReceiver) GetRouter(name string) RouterInterface
GetRouter gets a router
func (*BMPReceiver) GetRouters ¶ added in v0.1.6
func (b *BMPReceiver) GetRouters() []RouterInterface
GetRouters gets all routers
func (*BMPReceiver) Listen ¶ added in v0.1.6
func (b *BMPReceiver) Listen(addr string) error
Listen starts a listener for routers to start the BMP connection the listener needs to be closed by calling Close() on the BMPReceiver
func (*BMPReceiver) LocalAddr ¶ added in v0.1.6
func (b *BMPReceiver) LocalAddr() net.Addr
LocalAddr returns the local address the receiver is listening to.
func (*BMPReceiver) Metrics ¶ added in v0.1.6
func (b *BMPReceiver) Metrics() (*metrics.BMPMetrics, error)
Metrics gets BMP receiver metrics
func (*BMPReceiver) RemoveRouter ¶ added in v0.1.6
func (b *BMPReceiver) RemoveRouter(addr net.IP)
RemoveRouter removes a BMP monitored router
func (*BMPReceiver) Serve ¶ added in v0.1.6
func (b *BMPReceiver) Serve() error
Serve accepts all incoming connections for the BMP receiver until Close() is called.
type BMPReceiverConfig ¶ added in v0.1.6
type BMPReceiverInterface ¶ added in v0.1.6
type BMPReceiverInterface interface {
GetRouter(rtr string) RouterInterface
GetRouters() []RouterInterface
}
type FSM ¶
type FSM struct {
// contains filtered or unexported fields
}
FSM implements the BGP finite state machine (RFC4271)
func NewPassiveFSM ¶
NewPassiveFSM initiates a new passive FSM
type PeerConfig ¶
type PeerConfig struct {
AuthenticationKey string
AdminEnabled bool
ReconnectInterval time.Duration
KeepAlive time.Duration
HoldTime time.Duration
LocalAddress *bnet.IP
PeerAddress *bnet.IP
TTL uint8
LocalAS uint32
PeerAS uint32
Passive bool
RouterID uint32
RouteServerClient bool
RouteReflectorClient bool
RouteReflectorClusterID uint32
AdvertiseIPv4MultiProtocol bool
PeerRole uint8
PeerRoleStrictMode bool
IPv4 *AddressFamilyConfig
IPv6 *AddressFamilyConfig
VRF *vrf.VRF
Description string
}
PeerConfig defines the configuration for a BGP session
func (*PeerConfig) NeedsRestart ¶
func (pc *PeerConfig) NeedsRestart(x *PeerConfig) bool
NeedsRestart determines if the peer needs a restart on cfg change
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router represents a BMP enabled route in BMP context
type RouterConfig ¶ added in v0.1.5
type RouterConfig struct {
Passive bool
IgnorePeerASNs []uint32
IgnorePrePolicy bool
IgnorePostPolicy bool
}
RouterConfig represents the configuration required for BMP router
type RouterInterface ¶
type UpdateSender ¶
type UpdateSender struct {
// contains filtered or unexported fields
}
UpdateSender converts table changes into BGP update messages
func (*UpdateSender) AddPathInitialDump ¶
func (*UpdateSender) ClientCount ¶
func (u *UpdateSender) ClientCount() uint64
ClientCount is here to satisfy an interface
func (*UpdateSender) Destroy ¶
func (u *UpdateSender) Destroy()
Destroy destroys everything (with greetings to Hatebreed)
func (*UpdateSender) Dispose ¶
func (u *UpdateSender) Dispose()
Dispose is here to fulfill an interface
func (*UpdateSender) Dump ¶
func (u *UpdateSender) Dump() []*route.Route
Dump is here to fulfill an interface
func (*UpdateSender) EndOfRIB ¶ added in v0.1.1
func (u *UpdateSender) EndOfRIB()
func (*UpdateSender) RefreshRoute ¶
func (a *UpdateSender) RefreshRoute(*bnet.Prefix, []*route.Path)
RefreshRoute is here to fultill an interface
func (*UpdateSender) Register ¶
func (a *UpdateSender) Register(client routingtable.RouteTableClient)
Register registers a client for updates
func (*UpdateSender) RegisterWithOptions ¶
func (a *UpdateSender) RegisterWithOptions(client routingtable.RouteTableClient, opt routingtable.ClientOptions)
RegisterWithOptions registers a client with options for updates
func (*UpdateSender) RemovePath ¶
RemovePath withdraws prefix `pfx` from a peer
func (*UpdateSender) ReplaceFilterChain ¶
func (a *UpdateSender) ReplaceFilterChain(c filter.Chain)
ReplaceFilterChain is here to fulfill an interface
func (*UpdateSender) ReplacePath ¶
ReplacePath is here to fulfill an interface
func (*UpdateSender) RouteCount ¶
func (u *UpdateSender) RouteCount() int64
RouteCount returns the number of stored routes
func (*UpdateSender) Start ¶
func (u *UpdateSender) Start(aggrTime time.Duration)
Start starts the update sender
func (*UpdateSender) Unregister ¶
func (a *UpdateSender) Unregister(client routingtable.RouteTableClient)
Unregister unregisters a client
func (*UpdateSender) UpdateNewClient ¶
func (u *UpdateSender) UpdateNewClient(client routingtable.RouteTableClient) error
UpdateNewClient does nothing
Source Files
¶
- bgp_api.go
- bmp_metrics_service.go
- bmp_neighbor_manager.go
- bmp_receiver.go
- bmp_router.go
- fake_conn.go
- fsm.go
- fsm_active.go
- fsm_address_family.go
- fsm_cease.go
- fsm_connect.go
- fsm_counters.go
- fsm_established.go
- fsm_idle.go
- fsm_open_confirm.go
- fsm_open_sent.go
- metrics_service.go
- peer.go
- peer_manager.go
- peer_role.go
- server.go
- sockopt.go
- update_helper.go
- update_sender.go