9 #include "bgp/bgp_peer_internal_types.h"
27 bool summary, uint32_t page_limit, uint32_t iter_limit,
28 const string &start_instance,
const string &search_string,
29 vector<ShowPathResolver> *spr_list,
string *next_instance) {
30 regex search_expr(search_string);
34 for (uint32_t iter_count = 0; it1 != rim->
name_cend();
35 ++it1, ++iter_count) {
37 for (RoutingInstance::RouteTableList::const_iterator it2 =
39 it2 != rtinstance->
GetTables().end(); ++it2, ++iter_count) {
42 (search_string !=
"deleted" || !table->
IsDeleted())) {
50 if (spr.get_path_count() == 0 &&
51 spr.get_modified_path_count() == 0 &&
52 spr.get_nexthop_count() == 0 &&
53 spr.get_modified_nexthop_count() == 0)
55 spr_list->push_back(spr);
57 if (spr_list->size() >= page_limit)
59 if (iter_count >= iter_limit)
69 bool done = spr_list->size() >= page_limit;
70 *next_instance = it1->second->name();
78 bool BgpShowHandler<ShowPathResolverReq, ShowPathResolverReqIterate,
79 ShowPathResolverResp, ShowPathResolver>::CallbackCommon(
87 if (!next_instance.empty())
88 SaveContextToData(next_instance, done, data);
97 ShowPathResolverReqIterate, ShowPathResolverResp,
98 ShowPathResolver>::FillShowList(ShowPathResolverResp *resp,
99 const vector<ShowPathResolver> &show_list) {
100 resp->set_resolvers(show_list);
108 ShowPathResolverSummaryReqIterate, ShowPathResolverSummaryResp,
109 ShowPathResolver>::CallbackCommon(
113 string next_instance;
117 if (!next_instance.empty())
118 SaveContextToData(next_instance, done, data);
127 ShowPathResolverSummaryReqIterate, ShowPathResolverSummaryResp,
128 ShowPathResolver>::FillShowList(ShowPathResolverSummaryResp *resp,
129 const vector<ShowPathResolver> &show_list) {
130 resp->set_resolvers(show_list);
136 void ShowPathResolverReq::HandleRequest()
const {
144 ShowPathResolverReqIterate,
145 ShowPathResolverResp,
146 ShowPathResolver>::Callback, _1, _2, _3, _4, _5);
149 ShowPathResolverReqIterate,
150 ShowPathResolverResp,
151 ShowPathResolver>::CreateData;
153 ps.stages_.push_back(s1);
160 void ShowPathResolverReqIterate::HandleRequest()
const {
168 ShowPathResolverReqIterate,
169 ShowPathResolverResp,
170 ShowPathResolver>::CallbackIterate, _1, _2, _3, _4, _5);
173 ShowPathResolverReqIterate,
174 ShowPathResolverResp,
175 ShowPathResolver>::CreateData;
177 ps.stages_.push_back(s1);
184 void ShowPathResolverSummaryReq::HandleRequest()
const {
191 ShowPathResolverSummaryReq,
192 ShowPathResolverSummaryReqIterate,
193 ShowPathResolverSummaryResp,
194 ShowPathResolver>::Callback, _1, _2, _3, _4, _5);
196 ShowPathResolverSummaryReq,
197 ShowPathResolverSummaryReqIterate,
198 ShowPathResolverSummaryResp,
199 ShowPathResolver>::CreateData;
201 ps.stages_.push_back(s1);
208 void ShowPathResolverSummaryReqIterate::HandleRequest()
const {
215 ShowPathResolverSummaryReq,
216 ShowPathResolverSummaryReqIterate,
217 ShowPathResolverSummaryResp,
218 ShowPathResolver>::CallbackIterate, _1, _2, _3, _4, _5);
220 ShowPathResolverSummaryReq,
221 ShowPathResolverSummaryReqIterate,
222 ShowPathResolverSummaryResp,
223 ShowPathResolver>::CreateData;
225 ps.stages_.push_back(s1);
RoutingInstanceMgr * routing_instance_mgr()
PathResolver * path_resolver()
const std::string & name() const
void FillShowInfo(ShowPathResolver *spr, bool summary) const
const_name_iterator name_cend()
const_name_iterator name_clower_bound(const std::string &name)
RoutingInstanceList::const_iterator const_name_iterator
RouteTableList & GetTables()
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
int GetTaskId(const std::string &name)
static TaskScheduler * GetInstance()
static bool regex_search(const std::string &input, const regex ®ex)
static bool regex_match(const std::string &input, const regex ®ex)
static bool FillPathResolverInfoList(const BgpSandeshContext *bsc, bool summary, uint32_t page_limit, uint32_t iter_limit, const string &start_instance, const string &search_string, vector< ShowPathResolver > *spr_list, string *next_instance)
uint32_t iter_limit() const
uint32_t page_limit() const
std::string search_string
std::vector< ShowT > show_list
std::vector< int > instances_