Header file that exposes the public interface of a bgpstream elem.
Public Enums
bgpstream_elem_peerstate_t
¶Peer state encodes the state of the peer:
Values:
BGPSTREAM_ELEM_PEERSTATE_UNKNOWN
= 0¶Peer state unknown.
BGPSTREAM_ELEM_PEERSTATE_IDLE
= 1¶Peer state idle.
BGPSTREAM_ELEM_PEERSTATE_CONNECT
= 2¶Peer state connect.
BGPSTREAM_ELEM_PEERSTATE_ACTIVE
= 3¶Peer state active.
BGPSTREAM_ELEM_PEERSTATE_OPENSENT
= 4¶Peer state open-sent.
BGPSTREAM_ELEM_PEERSTATE_OPENCONFIRM
= 5¶Peer state open-confirm.
BGPSTREAM_ELEM_PEERSTATE_ESTABLISHED
= 6¶Peer state established.
BGPSTREAM_ELEM_PEERSTATE_CLEARING
= 7¶Peer state clearing.
BGPSTREAM_ELEM_PEERSTATE_DELETED
= 8¶Peer state clearing.
bgpstream_elem_origin_type_t
¶BGP ORIGIN Path Attribute values.
Values:
BGPSTREAM_ELEM_BGP_UPDATE_ORIGIN_IGP
= 0¶IGP - Network Layer Reachability Information is interior to the originating AS.
BGPSTREAM_ELEM_BGP_UPDATE_ORIGIN_EGP
= 1¶EGP - Network Layer Reachability Information learned via the EGP protocol [RFC904].
BGPSTREAM_ELEM_BGP_UPDATE_ORIGIN_INCOMPLETE
= 2¶INCOMPLETE - Network Layer Reachability Information learned by some other means.
bgpstream_elem_type_t
¶Elem types.
Values:
BGPSTREAM_ELEM_TYPE_UNKNOWN
= 0¶Unknown.
BGPSTREAM_ELEM_TYPE_RIB
= 1¶RIB Entry.
BGPSTREAM_ELEM_TYPE_ANNOUNCEMENT
= 2¶Announcement.
BGPSTREAM_ELEM_TYPE_WITHDRAWAL
= 3¶Withdrawal.
BGPSTREAM_ELEM_TYPE_PEERSTATE
= 4¶Peer state change.
bgpstream_annotations_t
¶bgpstream_elem_aggregator_t
¶Elem aggregator object.
Public Data Structures
bgpstream_elem_t
¶A BGP Stream Elem object.
Public API Functions
bgpstream_elem_create
(void)¶Create a new BGP Stream Elem instance.
bgpstream_elem_destroy
(bgpstream_elem_t
*elem)¶Destroy the given BGP Stream Elem instance.
elem
: pointer to a BGP
Stream Elem instance to destroy
bgpstream_elem_clear
(bgpstream_elem_t
*elem)¶Clear the given BGP Stream Elem instance.
elem
: pointer to a BGP
Stream Elem instance to clear
bgpstream_elem_copy
(bgpstream_elem_t
*dst, const bgpstream_elem_t
*src)¶Copy the given BGP Stream Elem to the given destination.
The dst
elem must have been created
using bgpstream_elem_create, or if being re-used, cleared using bgpstream_elem_clear before calling
this function.
dst
: pointer to an elem
to copy into
src
: pointer to an elem
to copy from
bgpstream_elem_type_snprintf
(char
*buf, size_t len, bgpstream_elem_type_t
type)¶Write the string representation of the elem type into the provided buffer.
buf
: pointer to a char
array
len
: length of the char
array
type
: BGP Stream Elem
type to convert to string
bgpstream_elem_peerstate_snprintf
(char *buf,
size_t len, bgpstream_elem_peerstate_t state)¶Write the string representation of the elem peerstate into the provided buffer.
buf
: pointer to a char
array
len
: length of the char
array
state
: BGP Stream Elem
peerstate to convert to string
bgpstream_elem_snprintf
(char *buf,
size_t len, const bgpstream_elem_t
*elem)¶Write the string representation of the elem into the provided buffer.
buf
: pointer to a char
array
len
: length of the char
array
elem
: pointer to a BGP
Stream Elem to convert to string
struct_bgpstream_annotations_t
¶bgpstream_elem_aggregator
¶Elem aggregator object.
bgpstream_elem
¶A BGP Stream Elem object.
Public Members
type
¶Type.
orig_time_sec
¶Originated Time (seconds component).
For RIB records, this is the time the prefix was heard (e.g., https://tools.ietf.org/html/rfc6396#section-4.3.4); for BMP messages, this is the timestamp in the Peer Header (see https://tools.ietf.org/html/rfc7854#section-4.2). Care must be taken when using this value as it will often be zero (e.g., there is a bug in a Cisco implementation of BMP that does not set the time in the peer header), and even if it is set, its meaning is dependent on the data source.
NOTE: This is NOT the same as the time_sec
field in the record. It MUST NOT be used in place of
that field. If you are unsure about which time to use, then you probably want the timestamp
in the record structure.
orig_time_usec
¶Originated Time (microseconds component)
peer_ip
¶Peer IP address.
This is the IP address that the peer used to connect to the collector (or router in the case of BMP).
peer_asn
¶Peer AS number.
prefix
¶IP prefix.
Available only for RIB, Announcement and Withdrawal elem types
nexthop
¶Next hop.
Available only for RIB and Announcement elem types
as_path
¶AS path.
Available only for RIB and Announcement elem types
communities
¶Communities.
Available only for RIB and Announcement elem types
old_state
¶Old peer state.
Available only for the Peer-state elem type
new_state
¶New peer state.
Available only for the Peer-state elem type
annotations
¶Annotations.
Annotations from other libraries
origin
¶ORIGIN as-path attribute This attribute indicates where the update comes from: internal network (IGP), external network (EGP), or other means (INCOMPLETE).
med
¶MED attribute.
local_pref
¶LOCAL_PREF attribute.
atomic_aggregate
¶Atomic aggregate attribute.
aggregator
¶Atomic aggregate attribute.