Documentation
¶
Index ¶
- Variables
- type BgpServer
- type NLRI
- type PeerConfig
- type Plugin
- func (p *Plugin) GetCapabilities(peer corebgp.PeerConfig) []corebgp.Capability
- func (p *Plugin) OnClose(peer corebgp.PeerConfig)
- func (p *Plugin) OnEstablished(peer corebgp.PeerConfig, writer corebgp.UpdateMessageWriter) corebgp.UpdateMessageHandler
- func (p *Plugin) OnOpenMessage(peer corebgp.PeerConfig, routerID netip.Addr, ...) *corebgp.Notification
- type RouteReaderWriter
- type Session
- type SessionEvent
- type SessionStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBgpPeerExists = errors.New("bgp peer already exists") ErrBgpPeerNotExists = errors.New("bgp peer does not exist") )
View Source
var ( MetricSessionStatus = promauto.NewGauge( prometheus.GaugeOpts{ Name: "doublezero_session_is_up", Help: "Status of session to doublezero", }, ) MetricSessionStatusDesc = `` /* 131-byte string literal not displayed */ )
Functions ¶
This section is empty.
Types ¶
type BgpServer ¶
type BgpServer struct {
// contains filtered or unexported fields
}
func NewBgpServer ¶
func NewBgpServer(routerID net.IP, r RouteReaderWriter) (*BgpServer, error)
func (*BgpServer) GetStatusEvent ¶
func (b *BgpServer) GetStatusEvent() <-chan SessionEvent
type PeerConfig ¶
type Plugin ¶
type Plugin struct {
AdvertisedNLRI []NLRI
PeerStatusChan chan SessionEvent
RouteSrc net.IP
RouteTable int // kernel routing table to target for writing/removing
FlushRoutes bool
NoInstall bool
RouteReaderWriter RouteReaderWriter
}
func NewBgpPlugin ¶
func NewBgpPlugin( advertised []NLRI, routeSrc net.IP, routeTable int, peerStatus chan SessionEvent, flushRoutes bool, noInstall bool, routeReaderWriter RouteReaderWriter) *Plugin
func (*Plugin) GetCapabilities ¶
func (p *Plugin) GetCapabilities(peer corebgp.PeerConfig) []corebgp.Capability
func (*Plugin) OnClose ¶
func (p *Plugin) OnClose(peer corebgp.PeerConfig)
func (*Plugin) OnEstablished ¶
func (p *Plugin) OnEstablished(peer corebgp.PeerConfig, writer corebgp.UpdateMessageWriter) corebgp.UpdateMessageHandler
func (*Plugin) OnOpenMessage ¶
func (p *Plugin) OnOpenMessage(peer corebgp.PeerConfig, routerID netip.Addr, capabilities []corebgp.Capability) *corebgp.Notification
type RouteReaderWriter ¶
type Session ¶
type Session struct {
SessionStatus SessionStatus `json:"session_status"`
LastSessionUpdate int64 `json:"last_session_update"`
}
func (*Session) MarshalJSON ¶
type SessionEvent ¶
type SessionStatus ¶
type SessionStatus int
const ( SessionStatusunknown SessionStatus = iota SessionStatusPending SessionStatusInitializing SessionStatusDown SessionStatusUp )
func (SessionStatus) FromString ¶
func (s SessionStatus) FromString(sessionStatus string) SessionStatus
func (SessionStatus) MarshalJSON ¶
func (s SessionStatus) MarshalJSON() ([]byte, error)
func (SessionStatus) String ¶
func (s SessionStatus) String() string
func (*SessionStatus) UnmarshalJSON ¶
func (s *SessionStatus) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.