bgp¶
BGP management module.
Border Gateway Protocol (BGP) is a standardized exterior gateway routing protocol designed to exchange routing and reachability information among autonomous systems (AS). In EOS, BGP follows RFC4271.
This module provides APIs to query BGP information including BGP peer state.
An example of the API usage is in examples/BgpAgent.cpp
-
namespace
eos
-
class
bgp_peer_handler
: public eos::base_handler<bgp_mgr, bgp_peer_handler>¶ - #include <bgp.h>
The BGP peer handler.
This class provides handler APIs to react to a BGP peer’s session state change.
Public Functions
-
void
watch_all_peers
(bool)¶ Register to receive notifications when any peer changes state.
-
void
watch_peer
(bgp_peer_key_t const &peer_key, bool)¶ Register to receive notifications when the specified peer changes state.
-
virtual void
on_peer_state
(bgp_peer_key_t const &peer_key, bgp_peer_state_t peer_state)¶ Called when BGP peer state change.
-
virtual void
on_peer_set
(bgp_peer_key_t const &peer_key)¶ Called when a BGP peer is created.
-
virtual void
on_peer_del
(bgp_peer_key_t const &peer_key)¶ Called when a BGP peer is deleted.
-
void
-
class
bgp_mgr
: public eos::base_mgr<bgp_peer_handler, bgp_peer_key_t>¶ - #include <bgp.h>
A manager of BGP configurations.
Public Functions
-
virtual
~bgp_mgr
()¶
-
virtual bool
exists
(bgp_peer_key_t const &peer_key) const = 0¶ Test for existence of a BGP peer.
-
virtual bgp_peer_state_t
peer_state
(bgp_peer_key_t const &peer_key) const = 0¶ Returns the state of a peer session.
If the given peer does not have a valid status or it didn’t match any peers in the system, this would returns PEER_UNKNOWN;
Protected Functions
-
bgp_mgr
()¶
Private Members
-
bgp_mgr
Friends
- friend class bgp_peer_handler
-
virtual
-
class
Type definitions in bgp¶
-
namespace
eos
Typedefs
-
typedef uint32_t
bgp_asn_t
¶
Enums
-
class
bgp_peer_key_t
¶ - #include <bgp.h>
The BGP peer key which consists of the peer address and the VRF itresides in.
Public Functions
-
bgp_peer_key_t
()¶
-
bgp_peer_key_t
(const bgp_peer_key_t &other)¶
-
bgp_peer_key_t &
operator=
(bgp_peer_key_t const &other)¶
-
bgp_peer_key_t
(bgp_peer_key_t &&other) noexcept¶
-
bgp_peer_key_t &
operator=
(bgp_peer_key_t &&other) noexcept¶
-
bool
operator==
(bgp_peer_key_t const &other) const¶
-
bool
operator!=
(bgp_peer_key_t const &other) const¶
-
bool
operator<
(bgp_peer_key_t const &other) const¶
-
uint32_t
hash
() const¶ The hash function for type bgp_peer_key_t.
-
void
mix_me
(hash_mix &h) const¶ The hash mix function for type bgp_peer_key_t.
Public Static Functions
-
static void
operator delete
(void*) noexcept¶
Friends
-
friend std::ostream &
operator<<
(std::ostream &os, const bgp_peer_key_t &obj)¶ A utility stream operator that adds a string representation of bgp_peer_key_t to the ostream.
-
-
typedef uint32_t