Documentation ¶
Index ¶
Constants ¶
const ( // MinLen is the minimal length of a BMP message MinLen = 6 RouteMonitoringType = 0 StatisticsReportType = 1 PeerDownNotificationType = 2 PeerUpNotificationType = 3 InitiationMessageType = 4 TerminationMessageType = 5 RouteMirroringMessageType = 6 BGPMessage = 0 BGPInformation = 1 ErroredPDU = 0 MessageLost = 1 // BMPVersion is the supported BMP version BMPVersion = 3 )
const (
// CommonHeaderLen is the length of a common header
CommonHeaderLen = 6
)
const (
MinInformationTLVLen = 4
)
const (
// OpenMsgMinLen is the minimal length of a BGP open message
OpenMsgMinLen = 29
)
const (
// PerPeerHeaderLen is the length of a per peer header
PerPeerHeaderLen = 42
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonHeader ¶
CommonHeader represents a common header
func (*CommonHeader) Serialize ¶
func (c *CommonHeader) Serialize(buf *bytes.Buffer)
Serialize serializes a common header
type InformationTLV ¶
InformationTLV represents an information TLV
type InitiationMessage ¶
type InitiationMessage struct { CommonHeader *CommonHeader TLVs []*InformationTLV }
InitiationMessage represents an initiation message
func (*InitiationMessage) MsgType ¶
func (im *InitiationMessage) MsgType() uint8
MsgType returns the type of this message
type Msg ¶
type Msg interface {
MsgType() uint8
}
Msg is an interface that every BMP message must fulfill
type PeerDownNotification ¶
type PeerDownNotification struct { CommonHeader *CommonHeader PerPeerHeader *PerPeerHeader Reason uint8 Data []byte }
PeerDownNotification represents a peer down notification
func (*PeerDownNotification) MsgType ¶
func (p *PeerDownNotification) MsgType() uint8
MsgType returns the type of this message
type PeerUpNotification ¶
type PeerUpNotification struct { CommonHeader *CommonHeader PerPeerHeader *PerPeerHeader LocalAddress [16]byte LocalPort uint16 RemotePort uint16 SentOpenMsg []byte ReceivedOpenMsg []byte Information []byte }
PeerUpNotification represents a peer up notification
func (*PeerUpNotification) MsgType ¶
func (p *PeerUpNotification) MsgType() uint8
MsgType returns the type of this message
type PerPeerHeader ¶
type PerPeerHeader struct { PeerType uint8 PeerFlags uint8 PeerDistinguisher uint64 PeerAddress [16]byte PeerAS uint32 PeerBGPID uint32 Timestamp uint32 TimestampMicroSeconds uint32 }
PerPeerHeader represents a BMP per peer header
func (*PerPeerHeader) GetAFlag ¶
func (p *PerPeerHeader) GetAFlag() bool
GetAFlag checks if the A flag is set
func (*PerPeerHeader) GetIPVersion ¶
func (p *PerPeerHeader) GetIPVersion() uint8
GetIPVersion gets the IP version of the BGP session
func (*PerPeerHeader) Serialize ¶
func (p *PerPeerHeader) Serialize(buf *bytes.Buffer)
Serialize serializes a per peer header
type RouteMirroringMsg ¶
type RouteMirroringMsg struct { CommonHeader *CommonHeader PerPeerHeader *PerPeerHeader TLVs []*InformationTLV }
RouteMirroringMsg represents a route mirroring message
func (*RouteMirroringMsg) MsgType ¶
func (rm *RouteMirroringMsg) MsgType() uint8
MsgType returns the type of this message
type RouteMonitoringMsg ¶
type RouteMonitoringMsg struct { CommonHeader *CommonHeader PerPeerHeader *PerPeerHeader BGPUpdate []byte }
RouteMonitoringMsg represents a Route Monitoring Message
func (*RouteMonitoringMsg) MsgType ¶
func (rm *RouteMonitoringMsg) MsgType() uint8
MsgType returns the type of this message
type StatsReport ¶
type StatsReport struct { CommonHeader *CommonHeader PerPeerHeader *PerPeerHeader StatsCount uint32 Stats []*InformationTLV }
StatsReport represents a stats report message
func (*StatsReport) MsgType ¶
func (s *StatsReport) MsgType() uint8
MsgType returns the type of this message
type TerminationMessage ¶
type TerminationMessage struct { CommonHeader *CommonHeader TLVs []*InformationTLV }
TerminationMessage represents a termination message
func (*TerminationMessage) MsgType ¶
func (t *TerminationMessage) MsgType() uint8
MsgType returns the type of this message