Documentation ¶
Index ¶
- Constants
- func GetASPath(mbs *MrtBufferStack) ([]uint32, error)
- func GetCollector(mbs *MrtBufferStack) net.IP
- func GetTimestamp(mbs *MrtBufferStack) time.Time
- func IsRib(a []byte) (bool, error)
- func MrtToBGPCapture(data []byte) (*monpb.BGPCapture, error)
- func MrtToBGPCapturev2(data []byte) (*monpb2.BGPCapture, error)
- func NewBGP4MPHeaderWrapper(dest *pbbgp.BGP4MPHeader) *bgp4mpHeaderWrapper
- func NewBgp4mpHdrBuf(buf []byte, as4 bool) *bgp4mpHdrBuf
- func NewMrtHdrBuf(buf []byte) *mrtHhdrBuf
- func NewMrtHeaderWrapper(m *mrtHhdrBuf) *mrtHeaderWrapper
- func NewRIBMrtHdrBuf(buf []byte, index pp.PbVal) *mrtHhdrBuf
- func SplitMrt(data []byte, atEOF bool) (advance int, token []byte, err error)
- type MrtBufferStack
- type Route
Constants ¶
View Source
const ( MRT_HEADER_LEN = 12 BGP4MP = 16 BGP4MP_ET = 17 MESSAGE = 1 MESSAGE_AS4 = 4 MESSAGE_LOCAL = 7 MESSAGE_AS4_LOCAL = 7 TABLE_DUMP = 12 TABLE_DUMP_V2 = 13 PEER_INDEX_TABLE = 1 )
Variables ¶
This section is empty.
Functions ¶
func GetASPath ¶
func GetASPath(mbs *MrtBufferStack) ([]uint32, error)
This will return the full AS path listed on the mbs This does no length checking, so the returned path could be empty, under very weird circumstances
func GetCollector ¶
func GetCollector(mbs *MrtBufferStack) net.IP
This will get the collector IP that received the message from the BGP4MP header
func GetTimestamp ¶
func GetTimestamp(mbs *MrtBufferStack) time.Time
This code just converts the 32 bit timestamp inside an MRT header and converts it to a standard go time.Time
func MrtToBGPCapture ¶
func MrtToBGPCapture(data []byte) (*monpb.BGPCapture, error)
func MrtToBGPCapturev2 ¶
func MrtToBGPCapturev2(data []byte) (*monpb2.BGPCapture, error)
func NewBGP4MPHeaderWrapper ¶
func NewBGP4MPHeaderWrapper(dest *pbbgp.BGP4MPHeader) *bgp4mpHeaderWrapper
func NewBgp4mpHdrBuf ¶
func NewMrtHdrBuf ¶
func NewMrtHdrBuf(buf []byte) *mrtHhdrBuf
func NewMrtHeaderWrapper ¶
func NewMrtHeaderWrapper(m *mrtHhdrBuf) *mrtHeaderWrapper
func NewRIBMrtHdrBuf ¶
Types ¶
type MrtBufferStack ¶
type MrtBufferStack struct { MrthBuf protoparse.PbVal `json:"mrt_header,omitempty"` Bgp4mpbuf protoparse.PbVal `json:"bgp4mp_header,omitempty"` Bgphbuf protoparse.PbVal `json:"bgp_header,omitempty"` Bgpupbuf protoparse.PbVal `json:"bgp_update,omitempty"` Ribbuf protoparse.PbVal `json:"rib_entry,omitempty"` }
func ParseHeaders ¶
func ParseHeaders(data []byte, ind bool) (*MrtBufferStack, error)
func ParseRibHeaders ¶
func ParseRibHeaders(data []byte, ind protoparse.PbVal) (*MrtBufferStack, error)
func (*MrtBufferStack) GetRawMessage ¶
func (mbs *MrtBufferStack) GetRawMessage() []byte
func (*MrtBufferStack) IsRibStack ¶
func (mbs *MrtBufferStack) IsRibStack() bool
type Route ¶
func GetAdvertizedPrefixes ¶
func GetAdvertizedPrefixes(mbs *MrtBufferStack) ([]Route, error)
This will return a list of prefixes <"ip/mask"> that appear in advertized routes Like getASPath, this does no length checking, and may return an empty array
func GetWithdrawnPrefixes ¶
func GetWithdrawnPrefixes(mbs *MrtBufferStack) ([]Route, error)
This will return a list of prefixes that appear in withdrawn routes
Click to show internal directories.
Click to hide internal directories.