5 #ifndef SRC_BGP_ROUTING_INSTANCE_PATH_RESOLVER_H_
6 #define SRC_BGP_ROUTING_INSTANCE_PATH_RESOLVER_H_
8 #include <boost/scoped_ptr.hpp>
10 #include <tbb/spin_rw_mutex.h>
39 class ShowPathResolver;
116 void FillShowInfo(ShowPathResolver *spr,
bool summary)
const;
334 const BgpAttr *attr, uint32_t label,
bool is_replicated =
false);
397 virtual std::string
ToString()
const;
440 #endif // SRC_BGP_ROUTING_INSTANCE_PATH_RESOLVER_H_
ResolverNexthop * LocateResolverNexthop(IpAddress address, BgpTable *table)
bool RouteListener(DBTablePartBase *root, DBEntryBase *entry)
void PauseResolverPathUpdateProcessing()
int intrusive_ptr_add_ref(const AsPath *cpath)
boost::scoped_ptr< DeleteActor > deleter_
const ResolverNexthop * rnexthop() const
void FillShowInfo(ShowPathResolver *spr, bool summary) const
void ResumeResolverPathUpdateProcessing()
ResolverNexthopList nexthop_update_list_
bool nexthop_longest_match_
LifetimeRef< PathResolver > table_delete_ref_
ResolverPath * CreateResolverPath(const BgpPath *path, BgpRoute *route, ResolverNexthop *rnexthop)
std::set< BgpRoute *, ResolverRouteCompare > ResolverRouteSet
void DisableResolverPathUpdateProcessing()
virtual bool Match(BgpServer *server, BgpTable *table, BgpRoute *route, bool deleted)
bool ProcessResolverNexthopRegUnregList()
std::map< const BgpPath *, ResolverPath * > PathToResolverPathMap
ResolvedPathList resolved_path_list_
LifetimeRef< ResolverNexthop > table_delete_ref_
DISALLOW_COPY_AND_ASSIGN(ResolverPath)
void TriggerPathResolution(ResolverPath *rpath)
boost::asio::ip::address IpAddress
PathResolver(BgpTable *table)
size_t GetResolverPathUpdateListSize() const
DBTablePartBase * table_partition()
virtual ~ResolverNexthop()
PathResolverPartition(int part_id, PathResolver *resolver)
ResolverNexthop * rnexthop_
void StartPathResolution(BgpRoute *route, const BgpPath *path, BgpTable *nh_table=NULL)
const BgpRoute * GetRoute() const
ResolverNexthopList nexthop_reg_unreg_list_
tbb::spin_rw_mutex rw_mutex_
PathToResolverPathMap rpath_map_
void DeferPathResolution(ResolverPath *rpath)
friend void intrusive_ptr_add_ref(ResolverRouteState *state)
void DisableResolverNexthopUpdateProcessing()
bool ProcessResolverNexthopUpdateList()
ResolverPath * RemoveResolverPath(const BgpPath *path)
std::map< ResolverNexthopKey, ResolverNexthop * > ResolverNexthopMap
ResolverNexthop(PathResolver *resolver, IpAddress address, BgpTable *table)
void EnableResolverNexthopUpdateProcessing()
size_t resolved_path_count() const
void StopPathResolution(const BgpPath *path)
void RegisterUnregisterResolverNexthop(ResolverNexthop *rnexthop)
size_t GetResolverNexthopDeleteListSize() const
ResolverRouteState * LocateResolverRouteState(BgpRoute *route)
size_t GetResolverNexthopUpdateListSize() const
bool ProcessResolverPathUpdateList()
DBTableBase::ListenerId listener_id_
boost::intrusive_ptr< ResolverRouteState > ResolverRouteStatePtr
friend void intrusive_ptr_release(ResolverRouteState *state)
Address::Family family() const
BgpPath * LocateResolvedPath(const IPeer *peer, uint32_t path_id, const BgpAttr *attr, uint32_t label, bool is_replicated=false)
void UpdateResolverNexthop(ResolverNexthop *rnexthop)
size_t GetResolverPathUpdateListSize() const
DBTableBase::ListenerId listener_id() const
void RemoveResolverNexthop(ResolverNexthop *rnexthop)
boost::scoped_ptr< TaskTrigger > nexthop_reg_unreg_trigger_
void EnableResolverPathUpdateProcessing()
std::pair< IpAddress, BgpTable * > ResolverNexthopKey
void DisableResolverNexthopRegUnregProcessing()
ResolverRouteStatePtr state_
friend class PathResolverTest
void RemoveResolverPath(int part_id, ResolverPath *rpath)
DISALLOW_COPY_AND_ASSIGN(PathResolverPartition)
void UnregisterResolverNexthopDone(BgpTable *table, ConditionMatch *match)
bool InsertRoute(BgpRoute *route)
void TriggerAllResolverPaths() const
ResolverRouteState * GetResolverRouteState()
std::set< ResolverPath * > ResolverPathList
std::set< ResolverPath * > ResolverPathList
bool ProcessResolverNexthopRegUnreg(ResolverNexthop *rnexthop)
virtual std::string ToString() const
void DisableResolverPathUpdateProcessing()
void DeleteResolvedPath(ResolvedPathList::const_iterator it)
ResolverPath(PathResolverPartition *partition, const BgpPath *path, BgpRoute *route, ResolverNexthop *rnexthop)
ResolverNexthopMap nexthop_map_
void StartPathResolution(BgpRoute *route, const BgpPath *path, BgpTable *nh_table)
bool operator()(const BgpRoute *lhs, const BgpRoute *rhs) const
boost::scoped_ptr< TaskTrigger > rpath_update_trigger_
std::vector< PathResolverPartition * > partitions_
void ResumeResolverPathUpdateProcessing()
void StopPathResolution(int part_id, const BgpPath *path)
IpAddress address() const
void set_nexthop_longest_match(bool flag)
void intrusive_ptr_release(const AsPath *cpath)
void AddResolverPath(int part_id, ResolverPath *rpath)
void EnableResolverNexthopRegUnregProcessing()
static bool RoutePrefixMatch(const BgpRoute *route, const IpAddress &address)
size_t GetResolverNexthopRegUnregListSize() const
void PauseResolverPathUpdateProcessing()
ResolverPathList rpath_update_list_
ResolverNexthopList nexthop_delete_list_
std::vector< ResolverPathList > rpath_lists_
std::set< ResolverNexthop * > ResolverNexthopList
PathResolverPartition * GetPartition(int part_id)
boost::scoped_ptr< TaskTrigger > nexthop_update_trigger_
tbb::spin_rw_mutex & rw_mutex()
PathResolver * resolver() const
ResolverRouteState(PathResolver *resolver, BgpRoute *route)
DISALLOW_COPY_AND_ASSIGN(ResolverNexthop)
PathResolverPartition * partition_
DBTableBase::ListenerId listener_id() const
BgpConditionListener * get_condition_listener(Address::Family family)
bool nexthop_longest_match() const
ResolverRouteState * FindResolverRouteState(BgpRoute *route)
std::set< BgpPath * > ResolvedPathList
void AddResolvedPath(ResolvedPathList::const_iterator it)
void EnableResolverPathUpdateProcessing()
ResolverPath * FindResolverPath(const BgpPath *path)
PathResolverPartition * partition() const
bool RemoveRoute(BgpRoute *route)
size_t GetResolverNexthopMapSize() const
DISALLOW_COPY_AND_ASSIGN(PathResolver)
bool UpdateResolvedPaths()
virtual ~ResolverRouteState()