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