7 #include <boost/foreach.hpp>
19 using std::unique_ptr;
24 family_ = (name.at(name.length()-1) ==
'3') ?
39 return unique_ptr<DBEntry>(
new InetRoute(prefix));
72 boost::scoped_ptr<Ip4Prefix> inet_prefix;
90 if (dest_route == NULL) {
110 uint32_t prev_flags = 0 , prev_label = 0;
111 const BgpAttr *prev_attr = NULL;
112 if (dest_path != NULL) {
116 if ((new_attr != prev_attr) ||
155 if (dest_path != NULL) {
157 (replicated_path->
GetFlags() == prev_flags) &&
158 (replicated_path->
GetLabel() == prev_label))
192 uinfo_slist->push_front(*uinfo);
206 ext_commp->communities()) {
218 roattr->
attr(), NULL);
225 if (ext_commp->communities().size() > 1) {
227 list.push_back(*origin_vnp);
232 roattr->
attr(), ext_commp);
246 if (inetvpn_attrp && inetvpn_attrp->ext_community()) {
248 inetvpn_attrp->ext_community()->communities()) {
251 inetvpn_rt_origin_vn = &comm;
257 if (inet_attrp && inet_attrp->ext_community()) {
259 inet_attrp->ext_community()->communities()) {
262 inet_rt_origin_vn = &comm;
268 if (inetvpn_rt_origin_vn == inet_rt_origin_vn)
273 if (!inetvpn_rt_origin_vn) {
275 inet_attrp->ext_community());
278 inet_attrp->ext_community(), *inetvpn_rt_origin_vn);
300 attrp->ext_community(), vit.GetExtCommunity());
303 sas.GetExtCommunity());
318 if (!inet_attrp || inet_attrp->source_rd().IsZero())
329 assert(inetvpn_table);
339 assert(inet_partition->
index() == inetvpn_partition->
index());
341 inetvpn_table->
TableFind(inetvpn_partition, &inetvpn_rt_key));
344 BgpPath *inetvpn_path = inetvpn_route->FindPath(peer,
true);
365 assert(inetvpn_table);
370 assert(inet_partition->
index() == inetvpn_partition->
index());
373 TableFind(inet_partition, &inet_rt_key));
377 BgpPath *inet_path = inet_route->FindPath(peer);
389 if (new_inet_attrp == inet_attrp)
394 inet_route->Notify();
bool IsNextHopCheckEnabled() const
BgpTable * GetTable(Address::Family fmly)
const BgpAttr * attr() const
static void RegisterFactory()
UpdateInfo * GetUpdateInfo(RibOut *ribout, BgpRoute *route, const RibPeerSet &peerset)
bool RemoveSecondaryPath(const BgpRoute *src_rt, BgpPath::PathSource src, const IPeer *peer, uint32_t path_id)
DBEntry * Find(const DBEntry *entry)
BgpAttrPtr UpdateAttributes(const BgpAttrPtr inetvpn_attrp, const BgpAttrPtr inet_attrp)
RoutingInstance * routing_instance()
const RibExportPolicy & ExportPolicy() const
void UpdateRoute(const InetVpnPrefix &inetvpn_prefix, const IPeer *peer, BgpAttrPtr inetvpn_attrp)
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *key) const
const InetVpnPrefix & GetPrefix() const
void StartPathResolution(BgpRoute *route, const BgpPath *path, BgpTable *nh_table=NULL)
virtual size_t Hash(const DBEntry *entry) const
RoutingInstanceMgr * routing_instance_mgr()
const uint32_t GetPathId() const
const OriginVnPath * origin_vn_path() const
const RouteDistinguisher & route_distinguisher() const
RoutingInstance * GetDefaultRoutingInstance()
virtual BgpRoute * TableFind(DBTablePartition *rtp, const DBRequestKey *prefix)
virtual PathResolver * CreatePathResolver()
static DBTableBase * CreateTable(DB *db, const std::string &name)
uint32_t GetFlags() const
BgpAttrPtr ReplaceExtCommunityAndLocate(const BgpAttr *attr, ExtCommunityPtr extcomm)
virtual Address::Family family() const
boost::intrusive_ptr< const BgpAttr > BgpAttrPtr
void SetReplicateInfo(const BgpTable *table, const BgpRoute *rt)
Ip4Address ip4_addr() const
BgpRoute * RouteReplicate(BgpServer *server, BgpTable *src_tbl, BgpRoute *src_rt, const BgpPath *path, ExtCommunityPtr ptr)
PathSource GetSource() const
ExtCommunityDB * extcomm_db()
bool mvpn_ipv4_enable() const
static Ip4Prefix FromString(const std::string &str, boost::system::error_code *errorp=NULL)
void set_attr(const BgpTable *table, const BgpAttrPtr &attrp)
#define CHECK_CONCURRENCY(...)
virtual BgpAttrPtr GetAttributes(BgpRoute *rt, BgpAttrPtr attrp, const IPeer *peer)
BgpAttrPtr ReplaceSourceRdAndLocate(const BgpAttr *attr, const RouteDistinguisher &source_rd)
static size_t HashFunction(const Ip4Prefix &addr)
void UpdateExtendedCommunity(RibOutAttr *roattr)
uint32_t GetLabel() const
const Ip4Prefix & GetPrefix() const
BgpAttrPtr GetMvpnAttributes(BgpAttrPtr attrp)
void InsertPath(BgpPath *path)
const BgpAttr * GetOriginalAttr() const
virtual DBTablePartBase * GetTablePartition(const DBRequestKey *key)
uint32_t bgp_identifier() const
Address::Family nexthop_family() const
BgpPath * FindSecondaryPath(BgpRoute *src_rt, BgpPath::PathSource src, const IPeer *peer, uint32_t path_id)
const ExtCommunity * ext_community() const
void StopPathResolution(int part_id, const BgpPath *path)
const BgpAttr * GetAttr() const
virtual bool Export(RibOut *ribout, Route *route, const RibPeerSet &peerset, UpdateInfoSList &info_slist)
static int PartitionCount()
virtual void Add(DBEntry *entry)
bool NeedsResolution() const
void Notify(DBEntryBase *entry)
std::size_t hash_value(BgpAttr const &attr)
virtual std::unique_ptr< DBEntry > AllocEntryStr(const std::string &key) const
BgpAttrPtr GetFabricAttributes(BgpRoute *rt, BgpAttrPtr attrp, const IPeer *peer)
InetTable(DB *db, const std::string &name)
as_t autonomous_system() const
BgpAttrPtr ReplaceOriginVnPathAndLocate(const BgpAttr *attr, OriginVnPathPtr ovnpath)
#define MODULE_INITIALIZER(Func)
void SetAttr(const BgpAttrPtr attr, const BgpAttrPtr original_attr)
virtual BgpRoute * TableFind(DBTablePartition *rtp, const DBRequestKey *prefix)
PathResolver * path_resolver()
static void RegisterFactory(const std::string &prefix, CreateFunction create_fn)