8 #include "bgp/bgp_peer_internal_types.h"
26 bool summary, uint32_t page_limit, uint32_t iter_limit,
27 const string &start_instance,
const string &search_string,
28 vector<ShowPathResolver> *spr_list,
string *next_instance) {
29 regex search_expr(search_string);
33 for (uint32_t iter_count = 0; it1 != rim->
name_cend();
34 ++it1, ++iter_count) {
36 for (RoutingInstance::RouteTableList::const_iterator it2 =
38 it2 != rtinstance->
GetTables().end(); ++it2, ++iter_count) {
41 (search_string !=
"deleted" || !table->
IsDeleted())) {
49 if (spr.get_path_count() == 0 &&
50 spr.get_modified_path_count() == 0 &&
51 spr.get_nexthop_count() == 0 &&
52 spr.get_modified_nexthop_count() == 0)
54 spr_list->push_back(spr);
56 if (spr_list->size() >= page_limit)
58 if (iter_count >= iter_limit)
68 bool done = spr_list->size() >= page_limit;
69 *next_instance = it1->second->name();
77 bool BgpShowHandler<ShowPathResolverReq, ShowPathResolverReqIterate,
78 ShowPathResolverResp, ShowPathResolver>::CallbackCommon(
86 if (!next_instance.empty())
87 SaveContextToData(next_instance, done, data);
96 ShowPathResolverReqIterate, ShowPathResolverResp,
97 ShowPathResolver>::FillShowList(ShowPathResolverResp *resp,
98 const vector<ShowPathResolver> &show_list) {
99 resp->set_resolvers(show_list);
107 ShowPathResolverSummaryReqIterate, ShowPathResolverSummaryResp,
108 ShowPathResolver>::CallbackCommon(
112 string next_instance;
116 if (!next_instance.empty())
117 SaveContextToData(next_instance, done, data);
126 ShowPathResolverSummaryReqIterate, ShowPathResolverSummaryResp,
127 ShowPathResolver>::FillShowList(ShowPathResolverSummaryResp *resp,
128 const vector<ShowPathResolver> &show_list) {
129 resp->set_resolvers(show_list);
135 void ShowPathResolverReq::HandleRequest()
const {
143 ShowPathResolverReqIterate,
144 ShowPathResolverResp,
145 ShowPathResolver>::Callback, _1, _2, _3, _4, _5);
148 ShowPathResolverReqIterate,
149 ShowPathResolverResp,
150 ShowPathResolver>::CreateData;
152 ps.stages_.push_back(s1);
159 void ShowPathResolverReqIterate::HandleRequest()
const {
167 ShowPathResolverReqIterate,
168 ShowPathResolverResp,
169 ShowPathResolver>::CallbackIterate, _1, _2, _3, _4, _5);
172 ShowPathResolverReqIterate,
173 ShowPathResolverResp,
174 ShowPathResolver>::CreateData;
176 ps.stages_.push_back(s1);
183 void ShowPathResolverSummaryReq::HandleRequest()
const {
190 ShowPathResolverSummaryReq,
191 ShowPathResolverSummaryReqIterate,
192 ShowPathResolverSummaryResp,
193 ShowPathResolver>::Callback, _1, _2, _3, _4, _5);
195 ShowPathResolverSummaryReq,
196 ShowPathResolverSummaryReqIterate,
197 ShowPathResolverSummaryResp,
198 ShowPathResolver>::CreateData;
200 ps.stages_.push_back(s1);
207 void ShowPathResolverSummaryReqIterate::HandleRequest()
const {
214 ShowPathResolverSummaryReq,
215 ShowPathResolverSummaryReqIterate,
216 ShowPathResolverSummaryResp,
217 ShowPathResolver>::CallbackIterate, _1, _2, _3, _4, _5);
219 ShowPathResolverSummaryReq,
220 ShowPathResolverSummaryReqIterate,
221 ShowPathResolverSummaryResp,
222 ShowPathResolver>::CreateData;
224 ps.stages_.push_back(s1);
std::vector< int > instances_
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
void FillShowInfo(ShowPathResolver *spr, bool summary) const
const_name_iterator name_cend()
RoutingInstanceMgr * routing_instance_mgr()
int GetTaskId(const std::string &name)
RouteTableList & GetTables()
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)
static TaskScheduler * GetInstance()
uint32_t iter_limit() const
RoutingInstanceList::const_iterator const_name_iterator
const_name_iterator name_clower_bound(const std::string &name)
std::vector< ShowT > show_list
const std::string & name() const
std::string search_string
static bool regex_search(const std::string &input, const regex ®ex)
uint32_t page_limit() const
PathResolver * path_resolver()