Documentation
¶
Overview ¶
Package meta represents BGP message metadata.
Exported to a separate package in order to avoid dependency loops: message parsers take Meta, which is part of msg.Msg.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( AddPathOn = &AddPath{All: true} // ADD-PATH in all address families AddPathOff = &AddPath{} // no ADD-PATH )
var (
ErrValue = errors.New("invalid value")
)
Functions ¶
This section is empty.
Types ¶
type AddPath ¶ added in v0.25.0
AddPath tells which address families carry ADD-PATH Path Identifiers (RFC 7911). NB: shared and read-only, eg. AddPathOn and AddPathOff
type Meta ¶
type Meta struct {
Dir Dir // message direction
Seq int64 // sequence number
Time time.Time // message timestamp
// per-message parser options, overriding session capabilities
ParseAS4 int8 // 4-byte ASN encoding (CAP_AS4): 0 = no data, -1 = off, 1 = on
ParseAddPath *AddPath // ADD-PATH encoding (CAP_ADDPATH): nil = no data
Tags Tags // message tags
}
Meta holds optional BGP message metadata: the direction, sequence number and timestamp, plus per-message parser options.
NB: passed by value to parsers; the zero value means "no metadata".
type Tags ¶ added in v0.28.0
type Tags struct {
PeerIP netip.Addr // PEER_IP: BGP peer address
PeerAS uint32 // PEER_AS: BGP peer ASN
PeerID netip.Addr // PEER_ID: BGP peer identifier
LocalIP netip.Addr // LOCAL_IP: local address of the BGP session
LocalAS uint32 // LOCAL_AS: local ASN of the BGP session
Collector string // COLLECTOR: route collector name
Router string // ROUTER: BMP router name or address
Src string // SRC: source stage name
Other []Tag // other tags, sorted by key
}
Tags are message tags. The well-known ones, with ALL-CAPS keys, are typed fields; the others (lowercase by convention, eg. "rov/status") are kept sorted by key. Get and Set work for all keys. An empty value means no tag.
func (*Tags) Each ¶ added in v0.28.0
Each calls cb for each tag with a value: the well-known ones first, then the others