7 #include <boost/bind.hpp>
11 #include "sandesh/sandesh_trace.h"
13 #include "bgp/bgp_peer_types.h"
29 const MacAddress &mac, uint32_t label, uint32_t l3_label,
35 origin_vn_index_(-1) {
56 for (
size_t idx = 0; idx < encap_.size(); ++idx) {
60 for (
size_t idx = 0; idx < tag_list_.size(); ++idx) {
100 uint32_t label, uint32_t l3_label,
bool is_xmpp)
105 vrf_originated_(false) {
106 if (attr && is_xmpp) {
114 const BgpAttr *attr, uint32_t label,
bool include_nh,
bool is_xmpp)
119 vrf_originated_(route->BestPath()->IsVrfOriginated()) {
120 if (attr && include_nh) {
134 label_(0), l3_label_(0), is_xmpp_(is_xmpp), vrf_originated_(false) {
153 for (Route::PathList::const_iterator it = route->
GetPathList().begin();
155 const BgpPath *path =
static_cast<const BgpPath *
>(it.operator->());
218 uint32_t label, uint32_t l3_label,
bool vrf_originated,
bool is_xmpp) {
223 NextHop nexthop(table, attrp->nexthop(), attrp->mac_address(),
238 assert(
attr_out_->nexthop() == attrp->nexthop());
259 for (AdvertiseSList::List::const_iterator iter =
advertised_->begin();
261 if (iter->roattr == roattr)
return iter.operator->();
284 for (UpdateInfoSList::List::const_iterator iter = uinfo_slist->begin();
285 iter != uinfo_slist->end(); ++iter) {
287 if (!ainfo || iter->target != ainfo->
bitset)
306 name_ +=
" Type: XMPP";
308 name_ +=
" Type: IBGP";
310 name_ +=
" Type: EBGP";
315 name_ +=
" ASOverride";
319 updates_.push_back(BgpStaticObjectFactory::Create<RibOutUpdates>(
this, idx));
442 if (dbstate == NULL) {
447 if (rstate != NULL) {
449 for (AdvertiseSList::List::const_iterator iter =
451 iter != rstate->
Advertised()->end(); ++iter) {
452 count += iter->bitset.count();
458 if (rt_update != NULL) {
460 for (AdvertiseSList::List::const_iterator iter =
462 iter != rt_update->
History()->end(); ++iter) {
463 count += iter->bitset.count();
469 if (uplist != NULL) {
471 for (AdvertiseSList::List::const_iterator iter =
473 iter != uplist->
History()->end(); ++iter) {
474 count += iter->bitset.count();
486 uint32_t queue_size = 0;
519 peerset->
reset(index);
538 return (ps ? ps->
index : -1);
548 memset(&stats, 0,
sizeof(stats));
549 size_t queue_size = 0;
550 size_t queue_marker_count = 0;
558 ShowRibOutStatistics sros;
565 sros.set_pending_updates(queue_size);
566 sros.set_markers(queue_marker_count);
576 sros_list->push_back(sros);
uint64_t peer_dequeue_count_
int GetPeerIndex(IPeerUpdate *peer) const
RibOutAttr & operator=(const RibOutAttr &rhs)
const IpAddress & nexthop() const
void STLDeleteValues(Container *container)
uint64_t marker_move_count_
const BgpPath * BestPath() const
std::vector< RibOutUpdates * > updates_
uint64_t tail_dequeue_count_
DBState * GetState(DBTableBase *tbl_base, ListenerId listener) const
bool test(size_t pos) const
bool operator!=(const NextHop &rhs) const
const RibPeerSet & PeerSet() const
int virtual_network_index() const
Ip4Address source_address_
static std::string BgpPeerTypeString(BgpPeerType peer_type)
DBTableBase * get_table() const
size_t queue_size(int queue_id) const
Ip4Address source_address_
const std::string & ToString() const
BitSet & reset(size_t pos)
void MoveHistory(RouteUpdate *rt_update)
RoutingInstance * routing_instance()
#define KEY_COMPARE(x, y)
boost::asio::ip::address IpAddress
uint64_t messages_built_count_
BgpProto::BgpPeerType peer_type() const
void Unregister(IPeerUpdate *peer)
std::vector< int > tag_list_
void Register(IPeerUpdate *peer)
uint64_t messages_sent_count_
ValueType * At(int index) const
size_t queue_marker_count(int queue_id) const
void Unregister(ListenerId listener)
const Ip4Address & source_address() const
uint32_t GetQueueSize() const
MacAddress mac_address() const
int CompareTo(const NextHop &rhs) const
uint32_t GetL3Label() const
ListenerId Register(ChangeCallback callback, const std::string &name="unspecified")
AdvertiseSList & History()
boost::intrusive_ptr< const BgpAttr > BgpAttrPtr
bool vrf_originated() const
NextHopList nexthop_list_
uint64_t marker_merge_count_
static const std::string integerToString(const NumberType &num)
void Leave(RibOut *ribout, IPeerUpdate *peer)
void Remove(const KeyType &key, int index, bool clear_bit=true)
void GetSubsetPeerSet(RibPeerSet *peerset, const IPeerUpdate *cpeer) const
virtual bool send_ready() const
uint64_t marker_split_count_
BgpProto::BgpPeerType type
void set_attr(const BgpTable *table, const BgpAttrPtr &attrp)
bool IsRegistered(IPeerUpdate *peer)
std::vector< std::string > encap_
AdvertiseSList advertised_
IPeerUpdate * GetPeer(int index) const
void Join(RibOut *ribout, IPeerUpdate *peer)
bool IsVrfOriginated() const
bool IsActive(IPeerUpdate *peer) const
bool operator==(const NextHop &rhs) const
const std::string & name() const
RibOut(BgpTable *table, BgpUpdateSender *sender, const RibExportPolicy &policy)
uint32_t l3_label() const
uint32_t GetLabel() const
int PathCompare(const BgpPath &rhs, bool allow_ecmp) const
void FillStatisticsInfo(std::vector< ShowRibOutStatistics > *sros_list) const
AdvertiseSList & History()
const AdvertiseSList & Advertised() const
void Export(DBTablePartBase *root, DBEntryBase *db_entry)
const ExtCommunity * ext_community() const
std::string EncodingString() const
void RibOutActive(int index, RibOut *ribout, int queue_id)
BgpUpdateSender * sender_
bool operator<(const NextHop &rhs) const
size_t find_first() const
void AddStatisticsInfo(int queue_id, Stats *stats) const
const BgpAttr * GetAttr() const
int RouteAdvertiseCount(const BgpRoute *rt) const
static const int kInvalidId
void Deactivate(IPeerUpdate *peer)
void SwapHistory(AdvertiseSList &history)
size_t find_next(size_t pos) const
void BuildSendReadyBitSet(const RibPeerSet &peerset, RibPeerSet *mready) const
RibOutUpdates * updates(int idx)
RibPeerSet active_peerset_
static int PartitionCount()
void RibOutDelete(const RibExportPolicy &policy)
bool CompareUpdateInfo(const UpdateInfoSList &uinfo_slist) const
const AdvertiseInfo * FindHistory(const RibOutAttr &roattr) const
boost::scoped_ptr< BgpExport > bgp_export_
void SwapHistory(AdvertiseSList &history)
NextHop(const BgpTable *table, IpAddress address, const MacAddress &mac, uint32_t label, uint32_t l3_label, const ExtCommunity *ext_community, bool vrf_originated)
as_t autonomous_system() const
ValueType * Find(const KeyType &key) const
ValueType * Locate(const KeyType &key)
const PathList & GetPathList() const
int CompareTo(const RibOutAttr &rhs) const