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 BMPServer
- type BMPServerInterface
- type FSM
- type PeerConfig
- type Router
- type RouterInterface
- type TCPListener
- 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) Dump() []*route.Route
- func (a *UpdateSender) RefreshRoute(*net.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(*net.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 (
// BGPPORT is the port of the BGP protocol
BGPPORT = 179
)
const (
BGPVersion = 4
)
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 }
AddressFamilyConfig represents all configuration parameters specific for an address family
type BGPAPIServer ¶
type BGPAPIServer struct {
// contains filtered or unexported fields
}
func NewBGPAPIServer ¶
func NewBGPAPIServer(s BGPServer) *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() error AddPeer(PeerConfig) error GetPeerConfig(*bnet.IP) *PeerConfig DisposePeer(*bnet.IP) GetPeers() []*bnet.IP Metrics() (*metrics.BGPMetrics, error) GetRIBIn(peerIP *bnet.IP, afi uint16, safi uint8) *adjRIBIn.AdjRIBIn GetRIBOut(peerIP *bnet.IP, afi uint16, safi uint8) *adjRIBOut.AdjRIBOut ConnectMockPeer(peer PeerConfig, con net.Conn) ReplaceImportFilterChain(peer *bnet.IP, c filter.Chain) error ReplaceExportFilterChain(peer *bnet.IP, c filter.Chain) error }
func NewBGPServer ¶
NewBGPServer creates a new instance of bgpServer
type BMPServer ¶
type BMPServer struct {
// contains filtered or unexported fields
}
BMPServer represents a BMP server
func (*BMPServer) GetRouter ¶
func (b *BMPServer) GetRouter(name string) RouterInterface
GetRouter gets a router
func (*BMPServer) GetRouters ¶
func (b *BMPServer) GetRouters() []RouterInterface
GetRouters gets all routers
func (*BMPServer) Metrics ¶
func (b *BMPServer) Metrics() (*metrics.BMPMetrics, error)
Metrics gets BMP server metrics
func (*BMPServer) RemoveRouter ¶
RemoveRouter removes a BMP monitored router
type BMPServerInterface ¶
type BMPServerInterface 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 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 RouterInterface ¶
type TCPListener ¶
type TCPListener struct {
// contains filtered or unexported fields
}
TCPListener is a TCP listen wrapper
func NewTCPListener ¶
func NewTCPListener(addr string, ch chan net.Conn) (*TCPListener, error)
NewTCPListener creates a new TCPListener
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) Dump ¶
func (u *UpdateSender) Dump() []*route.Route
Dump is here to fulfill an interface
func (*UpdateSender) RefreshRoute ¶
func (a *UpdateSender) RefreshRoute(*net.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_router.go
- bmp_server.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_manager.go
- fsm_open_confirm.go
- fsm_open_sent.go
- metrics_service.go
- peer.go
- peer_manager.go
- server.go
- sockopt.go
- tcplistener.go
- update_helper.go
- update_sender.go