9 #include "bgp/bgp_peer_internal_types.h"
24 bool summary, uint32_t page_limit, uint32_t iter_limit,
25 const string &start_neighbor,
const string &search_string,
26 vector<BgpNeighborResp> *show_list,
string *next_instance) {
27 regex search_expr(search_string);
31 if ((!
regex_search(peer->peer_basename(), search_expr)) &&
32 (!
regex_search(peer->peer_address_string(), search_expr)) &&
33 (search_string !=
"deleted" || !peer->IsDeleted())) {
38 peer->FillNeighborInfo(bsc, &bnr, summary);
39 show_list->push_back(bnr);
53 BgpNeighborListResp, BgpNeighborResp>::CallbackCommon(
69 if (!next_neighbor.empty())
70 SaveContextToData(next_neighbor, done, data);
79 BgpNeighborListResp, BgpNeighborResp>::FillShowList(
80 BgpNeighborListResp *resp,
const vector<BgpNeighborResp> &show_list) {
81 resp->set_neighbors(show_list);
92 bool BgpShowHandler<ShowBgpNeighborSummaryReq, ShowBgpNeighborSummaryReqIterate,
93 ShowBgpNeighborSummaryResp, BgpNeighborResp>::CallbackCommon(
105 string next_neighbor;
109 if (!next_neighbor.empty())
110 SaveContextToData(next_neighbor, done, data);
118 void BgpShowHandler<ShowBgpNeighborSummaryReq, ShowBgpNeighborSummaryReqIterate,
119 ShowBgpNeighborSummaryResp, BgpNeighborResp>::FillShowList(
120 ShowBgpNeighborSummaryResp *resp,
121 const vector<BgpNeighborResp> &show_list) {
122 resp->set_neighbors(show_list);
128 void BgpNeighborReq::HandleRequest()
const {
136 BgpNeighborReqIterate,
138 BgpNeighborResp>::Callback, _1, _2, _3, _4, _5);
141 BgpNeighborReqIterate,
143 BgpNeighborResp>::CreateData;
145 ps.stages_.push_back(s1);
152 void BgpNeighborReqIterate::HandleRequest()
const {
160 BgpNeighborReqIterate,
162 BgpNeighborResp>::CallbackIterate, _1, _2, _3, _4, _5);
165 BgpNeighborReqIterate,
167 BgpNeighborResp>::CreateData;
169 ps.stages_.push_back(s1);
176 void ShowBgpNeighborSummaryReq::HandleRequest()
const {
183 ShowBgpNeighborSummaryReq,
184 ShowBgpNeighborSummaryReqIterate,
185 ShowBgpNeighborSummaryResp,
186 BgpNeighborResp>::Callback, _1, _2, _3, _4, _5);
188 ShowBgpNeighborSummaryReq,
189 ShowBgpNeighborSummaryReqIterate,
190 ShowBgpNeighborSummaryResp,
191 BgpNeighborResp>::CreateData;
193 ps.stages_.push_back(s1);
200 void ShowBgpNeighborSummaryReqIterate::HandleRequest()
const {
207 ShowBgpNeighborSummaryReq,
208 ShowBgpNeighborSummaryReqIterate,
209 ShowBgpNeighborSummaryResp,
210 BgpNeighborResp>::CallbackIterate, _1, _2, _3, _4, _5);
212 ShowBgpNeighborSummaryReq,
213 ShowBgpNeighborSummaryReqIterate,
214 ShowBgpNeighborSummaryResp,
215 BgpNeighborResp>::CreateData;
217 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 ...
int GetTaskId(const std::string &name)
static bool regex_match(const std::string &input, const regex ®ex)
bool ShowNeighborExtension(const BgpSandeshContext *bsc, bool summary, uint32_t page_limit, uint32_t iter_limit, const std::string &start_neighbor, const std::string &search_string, std::vector< BgpNeighborResp > *list, std::string *next_neighbor) const
static TaskScheduler * GetInstance()
uint32_t iter_limit() const
static bool FillBgpNeighborInfoList(const BgpSandeshContext *bsc, bool summary, uint32_t page_limit, uint32_t iter_limit, const string &start_neighbor, const string &search_string, vector< BgpNeighborResp > *show_list, string *next_instance)
std::vector< ShowT > show_list
std::string search_string
static bool regex_search(const std::string &input, const regex ®ex)
uint32_t page_limit() const
BgpPeer * FindNextPeer(const std::string &name=std::string())