7 #include <boost/foreach.hpp>
8 #include <boost/assign/list_of.hpp>
9 #include <boost/functional/hash.hpp>
27 #include "bgp/routing-instance/routing_table_types.h"
32 using boost::assign::list_of;
33 using boost::system::error_code;
36 using std::ostringstream;
66 instance_config_lists_(
68 default_rtinstance_(NULL),
70 asn_listener_id_(server->RegisterASNUpdateCallback(
72 identifier_listener_id_(server->RegisterIdentifierUpdateCallback(
75 dormant_trace_buf_size_(
76 GetEnvRoutingInstanceDormantTraceBufferCapacity()),
78 GetEnvRoutingInstanceDormantTraceBufferThreshold()),
80 server_delete_ref_(this, server->
deleter()) {
83 for (
int idx = 0; idx < hw_thread_count; ++idx) {
103 const string &network)
const {
104 tbb::mutex::scoped_lock lock(
mutex_);
106 MvpnProjectManagerNetworks::const_iterator iter =
110 return iter->second.size();
151 tbb::mutex::scoped_lock lock(
mutex_);
152 for (RoutingInstance::RouteTargetList::const_iterator it =
170 tbb::mutex::scoped_lock lock(
mutex_);
171 for (RoutingInstance::RouteTargetList::const_iterator it =
175 for (InstanceTargetMap::iterator loc =
target_map_.find(*it);
176 loc !=
target_map_.end() && loc->first == *it; ++loc) {
177 if (loc->second == rti) {
190 InstanceTargetMap::const_iterator loc =
target_map_.find(rtarget);
201 tbb::mutex::scoped_lock lock(
mutex_);
212 tbb::mutex::scoped_lock lock(
mutex_);
217 for (VnIndexMap::iterator loc =
vn_index_map_.find(vn_index);
218 loc !=
vn_index_map_.end() && loc->first == vn_index; ++loc) {
219 if (loc->second == rti) {
230 int vn_index)
const {
231 VnIndexMap::const_iterator loc =
vn_index_map_.find(vn_index);
241 int vn_index)
const {
256 for (InstanceTargetMap::const_iterator loc =
target_map_.find(rtarget);
257 loc !=
target_map_.end() && loc->first == rtarget; ++loc) {
258 int ri_vn_index = loc->second->virtual_network_index();
259 if (vn_index && ri_vn_index && ri_vn_index != vn_index)
261 vn_index = ri_vn_index;
284 if (rtgt_vn_index < 0 ||
285 (vn_index && rtgt_vn_index && rtgt_vn_index != vn_index)) {
288 }
else if (rtgt_vn_index) {
289 vn_index = rtgt_vn_index;
298 tbb::mutex::scoped_lock lock(
mutex_);
299 size_t i =
bmap_.find_first();
300 if (i ==
bmap_.npos) {
314 tbb::mutex::scoped_lock lock(
mutex_);
316 if ((
size_t) listener ==
callbacks_.size() - 1) {
324 if ((
size_t) listener >=
bmap_.size()) {
325 bmap_.resize(listener + 1);
332 tbb::mutex::scoped_lock lock(
mutex_);
333 for (InstanceOpListenersList::iterator iter =
callbacks_.begin();
368 RoutingInstanceList::iterator iter =
instances_.find(name);
375 const string &name)
const {
376 RoutingInstanceList::const_iterator iter =
instances_.find(name);
383 const string &name) {
384 tbb::mutex::scoped_lock lock(
mutex_);
385 RoutingInstanceList::iterator iter =
instances_.find(name);
392 tbb::mutex::scoped_lock lock(
mutex_);
405 "Instance recreated before pending deletion is complete");
415 static boost::hash<string> string_hash;
431 const string &virtual_network,
const string &instance_name) {
432 tbb::mutex::scoped_lock lock(
mutex_);
434 VirtualNetworksMap::iterator iter;
438 assert(iter->second.insert(instance_name).second);
443 const string &virtual_network,
const string &instance_name) {
444 tbb::mutex::scoped_lock lock(
mutex_);
450 assert(iter->second.erase(instance_name) == 1);
452 RoutingInstanceStatsData instance_info;
453 bool mapping_deleted = iter->second.empty();
456 if (mapping_deleted) {
460 instance_info.set_deleted(
true);
464 map<string, RoutingTableStats> stats_map;
465 stats_map.insert(make_pair(instance_name, RoutingTableStats()));
466 stats_map[instance_name].set_deleted(
true);
476 instance_info.set_name(virtual_network);
477 assert(!instance_info.get_name().empty());
480 return mapping_deleted;
484 const map<string, RoutingTableStats> &stats_map,
485 RoutingInstanceStatsData *instance_info)
const {
493 instance_info->set_raw_ipv4_stats(stats_map);
496 instance_info->set_raw_ipv6_stats(stats_map);
499 instance_info->set_raw_inetvpn_stats(stats_map);
502 instance_info->set_raw_inet6vpn_stats(stats_map);
505 instance_info->set_raw_rtarget_stats(stats_map);
508 instance_info->set_raw_evpn_stats(stats_map);
511 instance_info->set_raw_ermvpn_stats(stats_map);
514 instance_info->set_raw_mvpn_stats(stats_map);
522 uint32_t out_q_depth = 0;
525 RoutingInstanceStatsData instance_info;
526 map<string, RoutingTableStats> stats_map;
528 stats_map.insert(make_pair(rit->second->name(), RoutingTableStats()));
530 rit->second->GetTables();
533 for (RoutingInstance::RouteTableList::const_iterator it =
534 rt_list.begin(); it != rt_list.end(); ++it) {
540 stats_map[rit->second->name()].set_prefixes(table->
Size());
541 stats_map[rit->second->name()].set_primary_paths(
543 stats_map[rit->second->name()].set_secondary_paths(
545 stats_map[rit->second->name()].set_infeasible_paths(
551 stats_map[rit->second->name()].set_total_paths(total_paths);
556 instance_info.set_name(rit->second->GetVirtualNetworkName());
557 assert(!instance_info.get_name().empty());
566 RoutingInstance *rtinstance = BgpStaticObjectFactory::Create<RoutingInstance>(
568 uint32_t ri_index = config->
index();
585 vector<string> import_rt(config->
import_list().begin(),
587 vector<string> export_rt(config->
export_list().begin(),
627 vector<string> import_rt(config->
import_list().begin(),
629 vector<string> export_rt(config->
export_list().begin(),
650 if (rtinstance && rtinstance->
deleted()) {
653 "Duplicate instance delete while pending deletion");
655 }
else if (!rtinstance) {
657 name, name,
"Instance not found during delete");
691 const string name = rtinstance->
name();
692 RoutingInstanceList::iterator loc =
instances_.find(rtinstance->
name());
695 int index = rtinstance->
index();
720 const std::string &name) {
724 if (trace_buf == NULL) {
732 const std::string &name) {
733 tbb::spin_rw_mutex::scoped_lock write_lock(
rw_mutex_,
true);
735 RoutingInstanceTraceBufferMap::iterator iter;
746 trace_buf = iter->second;
762 tbb::spin_rw_mutex::scoped_lock write_lock(
rw_mutex_,
true);
765 RoutingInstanceTraceBufferMap::iterator iter;
766 std::pair<RoutingInstanceTraceBufferMap::iterator, bool> ret;
772 trace_buf = iter->second;
786 for (
size_t i = 0; i < del_count; i++) {
790 trace_buf_delete = iter->second;
793 trace_buf_delete.reset();
797 assert(ret.second ==
true);
807 tbb::spin_rw_mutex::scoped_lock read_lock(
rw_mutex_,
false);
808 RoutingInstanceTraceBufferMap::const_iterator iter =
820 tbb::spin_rw_mutex::scoped_lock read_lock(
rw_mutex_,
false);
821 RoutingInstanceTraceBufferMap::const_iterator iter =
833 tbb::spin_rw_mutex::scoped_lock read_lock(
rw_mutex_,
false);
834 RoutingInstanceTraceBufferMap::const_iterator iter =
842 tbb::spin_rw_mutex::scoped_lock read_lock(
rw_mutex_,
false);
843 RoutingInstanceTraceBufferMap::const_iterator iter =
850 char *buffer_capacity_str = getenv(
851 "CONTRAIL_ROUTING_INSTANCE_DORMANT_TRACE_BUFFER_SIZE");
853 if (buffer_capacity_str) {
854 size_t env_buffer_capacity = strtoul(buffer_capacity_str, NULL, 0);
855 return env_buffer_capacity;
862 char *buffer_threshold_str = getenv(
863 "CONTRAIL_ROUTING_INSTANCE_DORMANT_TRACE_BUFFER_THRESHOLD");
864 if (buffer_threshold_str) {
865 size_t env_buffer_threshold = strtoul(buffer_threshold_str, NULL, 0);
866 return env_buffer_threshold;
872 tbb::spin_rw_mutex::scoped_lock read_lock(
rw_mutex_,
false);
877 tbb::spin_rw_mutex::scoped_lock read_lock(
rw_mutex_,
false);
885 tbb::mutex::scoped_lock lock(
mutex_);
896 if (!rtinstance || rtinstance->
deleted())
910 it->second->FlushAllRTargetRoutes(old_local_asn);
992 : name_(name), index_(-1), server_(server), mgr_(mgr), config_(config),
993 is_master_(false), always_subscribe_(false), virtual_network_index_(0),
994 virtual_network_allow_transit_(false),
995 virtual_network_pbb_evpn_enable_(false),
998 manager_delete_ref_(this, NULL),
1001 tbb::mutex::scoped_lock lock(mgr->
mutex());
1073 vector<SCAddress::Family> families = list_of
1184 string id_str =
"target:" + old_ip.to_string() +
":0";
1193 string id_str =
"target:" + server_ip.to_string() +
":0";
1212 vector<string> import_rt, export_rt;
1218 import_rt.push_back(irt);
1226 export_rt.push_back(ert);
1233 if (import_rt.size())
1234 info.set_add_import_rt(import_rt);
1235 if (export_rt.size())
1236 info.set_add_export_rt(export_rt);
1237 if (import_rt.size() || export_rt.size())
1260 assert(table_inetmpls);
1265 assert(table_inet6);
1307 bool notify_routes =
false;
1309 notify_routes =
true;
1312 notify_routes =
true;
1314 notify_routes =
true;
1316 notify_routes =
true;
1319 if (notify_routes) {
1352 vector<string> add_import_rt, remove_import_rt;
1353 BOOST_FOREACH(
const string &rtarget_str, cfg->
import_list()) {
1357 future_import.insert(rt);
1361 &add_import_rt, _1),
1363 &remove_import_rt, _1));
1366 vector<string> add_export_rt, remove_export_rt;
1367 BOOST_FOREACH(
const string &rtarget_str, cfg->
export_list()) {
1371 future_export.insert(rt);
1375 &add_export_rt, _1),
1377 &remove_export_rt, _1));
1380 if (add_import_rt.size())
1381 info.set_add_import_rt(add_import_rt);
1382 if (remove_import_rt.size())
1383 info.set_remove_import_rt(remove_import_rt);
1384 if (add_export_rt.size())
1385 info.set_add_export_rt(add_export_rt);
1386 if (remove_export_rt.size())
1387 info.set_remove_export_rt(remove_export_rt);
1388 if (add_import_rt.size() || remove_import_rt.size() ||
1389 add_export_rt.size() || remove_export_rt.size())
1451 size_t pos =
name_.rfind(
':');
1452 if (pos == string::npos) {
1455 return name_.substr(0, pos);
1481 replicator->
Leave(table, rt,
true);
1484 replicator->
Leave(table, rt,
false);
1501 tbb::mutex::scoped_lock lock(
mgr_->
mutex());
1506 tbl_partition->
Add(route);
1508 route->ClearDelete();
1516 attr_spec.push_back(&nexthop);
1518 attr_spec.push_back(&origin);
1522 route->InsertPath(path);
1523 tbl_partition->
Notify(route);
1525 route,
"Insert Local path with path id " <<
index_);
1543 tbb::mutex::scoped_lock lock(
mgr_->
mutex());
1550 route,
"Delete Local path with path id " <<
index_);
1551 if (!route->HasPaths()) {
1552 tbl_partition->
Delete(route);
1554 tbl_partition->
Notify(route);
1586 vector<string> *change_list, RouteTargetList::const_iterator it) {
1603 change_list->push_back(it->ToString());
1612 ermvpn_replicator->
Join(ermvpn_table, *it,
import);
1613 mvpn_replicator->
Join(mvpn_table, *it,
import);
1614 evpn_replicator->
Join(evpn_table, *it,
import);
1615 inetvpn_replicator->
Join(inet_table, *it,
import);
1616 inet6vpn_replicator->
Join(inet6_table, *it,
import);
1620 vector<string> *change_list, RouteTargetList::iterator it) {
1637 ermvpn_replicator->
Leave(ermvpn_table, *it,
import);
1638 mvpn_replicator->
Leave(mvpn_table, *it,
import);
1639 evpn_replicator->
Leave(evpn_table, *it,
import);
1640 inetvpn_replicator->
Leave(inet_table, *it,
import);
1641 inet6vpn_replicator->
Leave(inet6_table, *it,
import);
1643 change_list->push_back(it->ToString());
1704 replicator->
Join(table, rt,
true);
1707 replicator->
Join(table, rt,
false);
1747 assert(table->
Size() == 0);
1781 static set<string> master_tables = list_of(
"inet.0")(
"inet.3")(
"inet6.0");
1782 static set<string> vpn_tables =
1783 list_of(
"bgp.l3vpn.0")(
"bgp.ermvpn.0")(
"bgp.evpn.0")(
"bgp.rtarget.0")
1784 (
"bgp.l3vpn-inet6.0")(
"bgp.mvpn.0");
1786 if (master_tables.find(table) != master_tables.end())
1788 if (vpn_tables.find(table) != vpn_tables.end())
1791 size_t pos1 = table.rfind(
'.');
1792 if (pos1 == string::npos)
1793 return "__unknown__";
1794 size_t pos2 = table.rfind(
'.', pos1 - 1);
1795 if (pos2 == string::npos)
1796 return "__unknown__";
1798 return table.substr(0, pos2);
1810 RoutingInstanceInfo info;
1812 info.set_instance_name(
name_);
1814 if (
rd_.get()) info.set_route_distinguisher(
rd_->ToString());
1815 if (operation) info.set_operation(operation);
1870 ext_community && ext_community->GetSubClusterId()) {
1873 if (route->
SubClusterId() == ext_community->GetSubClusterId()) {
1875 route,
"Not applying policy since sub-cluster associated "
1876 "with path is same as that with route");
1883 route,
"Not applying policy for service-chain secondary "
1900 if (!result.second) {
1902 path->SetPolicyReject();
1903 }
else if (path->IsPolicyReject()) {
1906 path->ResetPolicyReject();
1908 IPeer *peer = path->GetPeer();
1918 path->SetAttr(modified_attr, path->GetOriginalAttr());
1919 return result.second;
1943 BgpStaticObjectFactory::Create<IStaticRouteMgr, Address::INET>(
this));
1947 BgpStaticObjectFactory::Create<IStaticRouteMgr, Address::INET6>(
this));
1961 BgpStaticObjectFactory::Create<IRouteAggregator, Address::INET>(
this));
1967 BgpStaticObjectFactory::Create<IRouteAggregator, Address::INET6>(
this));
2016 peer_manager_.reset(BgpStaticObjectFactory::Create<PeerManager>(
this));
2027 vector<string> tokens;
2028 boost::split(tokens, n, boost::is_any_of(
":"));
2029 if (tokens.size() < 3)
2032 os << tokens[0] <<
":" << tokens[1] <<
":" << tokens[2] <<
":" << tokens[2];
void DisableInstanceConfigListProcessing()
BgpTable * VrfTableCreate(Address::Family vrf_family, Address::Family vpn_family)
const RoutingInstance * GetInstanceByTarget(const RouteTarget &target) const
InstanceTargetMap target_map_
void AddTable(BgpTable *tbl)
virtual void StopServiceChain(RoutingInstance *rtinstance)=0
#define RTINSTANCE_LOG_TABLE(type, rtinstance, table, level, flags,...)
void increment_deleted_count()
const std::string & virtual_network() const
RoutingInstance(std::string name, BgpServer *server, RoutingInstanceMgr *mgr, const BgpInstanceConfig *config)
const BgpInstanceConfig * config_
virtual void ResetRoutingInstanceIndexBit(int index)=0
MvpnProjectManagerNetworks mvpn_project_managers_
size_t GetRoutingInstanceActiveTraceBufSize() const
const RouteTargetList & import_list() const
size_t GetRoutingInstanceDormantTraceBufSize() const
RoutingInstanceTraceBufferMap trace_buffer_dormant_
const RouteTargetList & GetImportList() const
RoutingInstance * default_rtinstance_
virtual ~RoutingInstance()
bool ProcessNeighborConfigList()
void STLDeleteValues(Container *container)
BgpTable * GetTable(Address::Family fmly)
virtual BgpPeer * PeerLookup(std::string name) const
void UpdateAllStaticRoutes()
int RegisterInstanceOpCallback(RoutingInstanceCb cb)
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
static std::string GetTableName(std::string instance_name, Address::Family fmly)
TypePtr Locate(Type *attr)
const RouteTargetList & GetExportList() const
PeerManager * peer_manager()
void DisableTraceBuffer(const std::string &name)
void FlushRouteAggregationConfig()
RoutingInstance * GetRoutingInstance(const std::string &name)
boost::scoped_ptr< TaskTrigger > neighbor_config_trigger_
void DeleteRTargetRoute(as_t asn, const RouteTarget &rtarget)
void UpdateConfig(const BgpInstanceConfig *config)
int virtual_network_index() const
bool set_synchronize(const SetType *set1, const SetType *set2, AddFunctor add_fn, DelFunctor del_fn)
void EnableNeighborConfigListProcessing()
void UnregisterASNUpdateCallback(int listener)
DBEntry * Find(const DBEntry *entry)
virtual void UpdateAggregateRouteConfig()=0
RoutingPolicy * GetRoutingPolicy(const std::string &name)
DBTableBase * CreateTable(const std::string &name)
bool UpdateRoutingPolicyList(const RoutingPolicyConfigList &cfg_list, RoutingPolicyAttachList *oper_list)
SandeshTraceBufferPtr GetDormantTraceBuffer(const std::string &name) const
RoutingInstanceList instances_
static const char * kMasterInstance
IRouteAggregator * LocateRouteAggregator(Address::Family family)
boost::scoped_ptr< IRouteAggregator > inet6_route_aggregator_
LifetimeActor * deleter()
void DestroyRouteAggregator(Address::Family family)
boost::scoped_ptr< IRouteAggregator > inet_route_aggregator_
void FlushStaticRouteConfig()
BgpTable * RTargetTableCreate()
virtual void DeleteRoutingInstance(const std::string &name)
void InstanceVnIndexRemove(const RoutingInstance *rti)
void IdentifierUpdateCallback(Ip4Address old_identifier)
DeleteActor(BgpServer *server, RoutingInstance *parent)
void ProcessRoutingPolicyConfig()
void InitAllRTargetRoutes(as_t asn)
static std::string GetPrimaryRoutingInstanceName(const string &name_in)
#define BGP_LOG_ROUTE(table, peer, route, arg)
RoutingInstanceIterator end()
#define BGP_UVE_SEND(type, object)
std::string virtual_network_
RoutingInstanceMgr * manager_
void NotifyInstanceOp(std::string name, Operation deleted)
std::vector< BgpAttribute * > BgpAttrSpec
const std::string & name() const
void LocatePathResolver()
void UpdateRouteAggregationConfig()
const RouteTargetList & export_list() const
int GetVnIndexByExtCommunity(const ExtCommunity *community) const
RoutingInstance * GetDefaultRoutingInstance()
boost::scoped_ptr< IStaticRouteMgr > inet_static_route_mgr_
RoutePathReplicator * replicator(Address::Family family)
static Family AddressFamilyToSCFamily(Address::Family family)
void AddRouteTarget(bool import, std::vector< std::string > *change_list, RouteTargetList::const_iterator it)
LifetimeRef< RoutingInstanceMgr > server_delete_ref_
RoutingPolicyAttachList * routing_policies()
RoutingInstanceInfo GetDataCollection(const char *operation)
boost::scoped_ptr< PeerManager > peer_manager_
static std::string FamilyToTableString(Family family)
bool virtual_network_pbb_evpn_enable() const
int GetVnIndexByRouteTarget(const RouteTarget &rtarget) const
virtual void UpdateAllRoutes()=0
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
void Delete(DBEntryBase *)
virtual const BgpInstanceConfig * FindInstance(const std::string &name) const =0
virtual Address::Family family() const =0
SandeshTraceBufferPtr LocateTraceBuffer(const std::string &name)
void RemoveTable(DBTableBase *tbl_base)
void ProcessServiceChainConfig()
RouteTableFamilyList vrf_tables_by_family_
boost::dynamic_bitset bmap_
int GetTaskId(const std::string &name)
void CreateMvpnManagers()
boost::scoped_ptr< DeleteActor > deleter_
virtual bool LocateServiceChain(RoutingInstance *rtinstance, const ServiceChainConfig &config)=0
RoutingInstanceTraceBufferMap trace_buffer_active_
virtual void UpdateStaticRouteConfig()=0
as_t local_autonomous_system() const
bool virtual_network_allow_transit() const
size_t GetEnvRoutingInstanceDormantTraceBufferThreshold() const
void CreateRoutingInstanceNeighbors(const BgpInstanceConfig *config)
RoutingPolicyMgr * routing_policy_mgr()
void DeleteRouteTarget(bool import, std::vector< std::string > *change_list, RouteTargetList::iterator it)
boost::intrusive_ptr< const BgpAttr > BgpAttrPtr
virtual size_t Size() const
void DestroyDBTable(DBTable *table)
bool IsAggregateRoute(const BgpTable *table, const BgpRoute *route) const
IRouteAggregator * route_aggregator(Address::Family family) const
RoutingInstance * CreateRoutingInstance(const BgpInstanceConfig *config)
int identifier_listener_id_
void DisableNeighborConfigListProcessing()
void DeleteMvpnRTargetRoute(as_t old_asn, Ip4Address old_ip)
bool virtual_network_pbb_evpn_enable_
bool ProcessInstanceConfigList(int idx)
const uint64_t GetInfeasiblePathCount() const
void UpdateStaticRouteConfig()
void DestroyRoutingInstance(RoutingInstance *rtinstance)
const ServiceChainConfig * service_chain_info(SCAddress::Family family) const
void PeerResurrect(std::string name)
ExtCommunityDB * extcomm_db()
static TaskScheduler * GetInstance()
void Reset(LifetimeActor *actor)
size_t trace_buf_threshold_
void UpdateRoutingPolicyConfig()
tbb::spin_rw_mutex rw_mutex_
BgpConfigManager * config_manager()
#define RTINSTANCE_TRACE_BUF
IServiceChainMgr * service_chain_mgr(SCAddress::Family family)
#define RTINSTANCE_LOG_FLAG_ALL
boost::scoped_ptr< DeleteActor > deleter_
uint32_t SendTableStatsUve()
RoutingPolicy::PolicyResult ExecuteRoutingPolicy(const RoutingPolicy *policy, const BgpRoute *route, const BgpPath *path, BgpAttr *attr) const
boost::function< void(std::string, int)> RoutingInstanceCb
size_t peer_manager_size() const
LifetimeRef< RoutingInstance > manager_delete_ref_
std::string routing_instance
SandeshTraceBufferPtr trace_buffer() const
#define CHECK_CONCURRENCY(...)
bool virtual_network_allow_transit_
void EnableInstanceConfigListProcessing()
bool IsContributingRoute(const BgpTable *table, const BgpRoute *route) const
VirtualNetworksMap virtual_networks_
bool HasRoutingInstanceActiveTraceBuf(const std::string &name) const
DeleteActor(RoutingInstanceMgr *manager)
RoutingInstance * parent_
bool HasExportTarget(const ExtCommunity *extcomm) const
const BgpInstanceConfig * config() const
const std::string & name() const
RoutingInstance * GetRoutingInstanceLocked(const std::string &name)
void ProcessStaticRouteConfig()
static RouteTarget FromString(const std::string &str, boost::system::error_code *error=NULL)
void InsertRoutingInstance(RoutingInstance *rtinstance)
#define ROUTING_INSTANCE_DORMANT_TRACE_BUFFER_THRESHOLD_1K
void InstanceTargetAdd(RoutingInstance *rti)
BgpTable * VpnTableCreate(Address::Family vpn_family)
std::pair< bool, bool > PolicyResult
void LocateRoutingInstance(const BgpInstanceConfig *config)
void AddRTargetRoute(as_t asn, const RouteTarget &rtarget)
bool ProcessRoutingPolicy(const BgpRoute *route, BgpPath *path) const
LifetimeActor * deleter()
void UnregisterInstanceOpCallback(int id)
boost::asio::ip::address_v4 Ip4Address
std::vector< TaskTrigger * > instance_config_triggers_
std::map< std::string, BgpTable * > RouteTableList
uint32_t SubClusterId() const
size_t GetPendingRiboutsCount(size_t *markers) const
static std::string GetVrfFromTableName(const std::string table)
const BgpAttr * GetOriginalAttr() const
virtual DBTablePartBase * GetTablePartition(const DBRequestKey *key)
virtual ~RoutingInstanceMgr()
InstanceOpListenersList callbacks_
int virtual_network_index_
static std::string FamilyToString(Family fmly)
const RoutingInstanceMgr * manager() const
bool virtual_network_pbb_evpn_enable() const
virtual void FlushAggregateRouteConfig()=0
uint32_t bgp_identifier() const
bool DeleteVirtualNetworkMapping(const std::string &virtual_network, const std::string &instance_name)
#define ROUTING_INSTANCE_COLLECTOR_INFO(info)
bool IsMasterRoutingInstance() const
const uint64_t GetPrimaryPathCount() const
RoutingPolicyAttachList routing_policies_
virtual void ProcessStaticRouteConfig()=0
const ExtCommunity * ext_community() const
const AggregateRouteList & aggregate_routes(Address::Family family) const
size_t dormant_trace_buf_size_
const RoutingInstance * GetInstanceByVnIndex(int vn_index) const
std::pair< RoutingPolicyPtr, uint32_t > RoutingPolicyInfo
void Join(BgpTable *table, const RouteTarget &rt, bool import)
void ClearFamilyRouteTarget(Address::Family vrf_family, Address::Family vpn_family)
bool IsPolicyReject() const
uint32_t generation() const
RoutingInstanceConfigList neighbor_config_list_
IStaticRouteMgr * static_route_mgr(Address::Family family)
bool CreateVirtualNetworkMapping(const std::string &virtual_network, const std::string &instance_name)
int GetOriginVnForAggregateRoute(Address::Family family) const
void ProcessIdentifierUpdate(as_t asn)
std::string GetVirtualNetworkByVnIndex(int vn_index) const
bool IsServiceChainRoute(const BgpRoute *route) const
const std::string GetVirtualNetworkName() const
RoutingInstanceMgr * mgr_
const RoutingPolicyConfigList & routing_policy_list() const
#define RTINSTANCE_LOG(type, rtinstance, level, flags,...)
bool HasRoutingInstanceDormantTraceBuf(const std::string &name) const
size_t GetMvpnProjectManagerCount(const std::string &network) const
virtual void set_routing_instance(RoutingInstance *rtinstance)
RoutingInstanceMgr(BgpServer *server)
RoutingInstanceIterator begin()
SandeshTraceBufferPtr RoutingInstanceTraceBuf
IStaticRouteMgr * LocateStaticRouteMgr(Address::Family family)
boost::intrusive_ptr< RoutingPolicy > RoutingPolicyPtr
RouteTableList vrf_tables_by_name_
virtual void Add(DBEntry *entry)
RoutingInstanceTraceBufferList trace_buffer_dormant_list_
void FlushAllRTargetRoutes(as_t asn)
#define RTINSTANCE_LOG_WARNING_MESSAGE(server, flags,...)
void Notify(DBEntryBase *entry)
const NeighborList & neighbor_list() const
void InstanceVnIndexAdd(RoutingInstance *rti)
void Leave(BgpTable *table, const RouteTarget &rt, bool import)
int virtual_network_index() const
const std::string & name() const
virtual void ProcessPathTunnelEncapsulation(const BgpPath *path, BgpAttr *attr, ExtCommunityDB *extcomm_db, const BgpTable *table) const =0
void decrement_deleted_count()
boost::scoped_ptr< IStaticRouteMgr > inet6_static_route_mgr_
bool virtual_network_allow_transit() const
virtual void ProcessAggregateRouteConfig()=0
virtual bool IsReplicated() const
virtual bool MayDelete() const
virtual void FlushStaticRouteConfig()=0
void AddMvpnRTargetRoute(as_t asn)
PeerManager * LocatePeerManager()
std::set< RouteTarget > RouteTargetList
void UnregisterIdentifierUpdateCallback(int listener)
bool always_subscribe() const
void ASNUpdateCallback(as_t old_asn, as_t old_local_asn)
void SetTableStatsUve(Address::Family family, const std::map< std::string, RoutingTableStats > &stats_map, RoutingInstanceStatsData *instance_info) const
const StaticRouteList & static_routes(Address::Family family) const
RoutingInstanceList::iterator RoutingInstanceIterator
void ApplyRoutingPolicy(RoutingInstance *instance)
SandeshTraceBufferPtr GetActiveTraceBuffer(const std::string &name) const
void ProcessRouteAggregationConfig()
SandeshTraceBufferPtr GetTraceBuffer(const std::string &name)
void SetAttr(const BgpAttrPtr attr, const BgpAttrPtr original_attr)
int HardwareThreadCount()
void UpdateRoutingInstance(RoutingInstance *rtinstance, const BgpInstanceConfig *config)
size_t GetEnvRoutingInstanceDormantTraceBufferCapacity() const
virtual bool MayDelete() const
std::string routing_policy_
void set_index(int index)
std::vector< RoutingInstanceConfigList > instance_config_lists_
void RemoveTable(BgpTable *tbl)
std::unique_ptr< RouteDistinguisher > rd_
SandeshTraceBufferPtr SandeshTraceBufferCreate(const std::string &buf_name, size_t buf_size, bool trace_enable=true)
RTargetGroupMgr * rtarget_group_mgr()
const uint64_t GetSecondaryPathCount() const
void InstanceTargetRemove(const RoutingInstance *rti)
const std::string & localname() const