10 #include "bgp/bgp_peer_internal_types.h"
25 bool summary, uint32_t page_limit, uint32_t iter_limit,
26 const string &start_neighbor,
const string &search_string,
27 vector<BgpNeighborResp> *show_list,
string *next_instance) {
28 regex search_expr(search_string);
32 if ((!
regex_search(peer->peer_basename(), search_expr)) &&
33 (!
regex_search(peer->peer_address_string(), search_expr)) &&
34 (search_string !=
"deleted" || !peer->IsDeleted())) {
39 peer->FillNeighborInfo(bsc, &bnr, summary);
40 show_list->push_back(bnr);
54 BgpNeighborListResp, BgpNeighborResp>::CallbackCommon(
70 if (!next_neighbor.empty())
71 SaveContextToData(next_neighbor, done, data);
80 BgpNeighborListResp, BgpNeighborResp>::FillShowList(
81 BgpNeighborListResp *resp,
const vector<BgpNeighborResp> &show_list) {
82 resp->set_neighbors(show_list);
93 bool BgpShowHandler<ShowBgpNeighborSummaryReq, ShowBgpNeighborSummaryReqIterate,
94 ShowBgpNeighborSummaryResp, BgpNeighborResp>::CallbackCommon(
106 string next_neighbor;
110 if (!next_neighbor.empty())
111 SaveContextToData(next_neighbor, done, data);
119 void BgpShowHandler<ShowBgpNeighborSummaryReq, ShowBgpNeighborSummaryReqIterate,
120 ShowBgpNeighborSummaryResp, BgpNeighborResp>::FillShowList(
121 ShowBgpNeighborSummaryResp *resp,
122 const vector<BgpNeighborResp> &show_list) {
123 resp->set_neighbors(show_list);
129 void BgpNeighborReq::HandleRequest()
const {
137 BgpNeighborReqIterate,
139 BgpNeighborResp>::Callback, _1, _2, _3, _4, _5);
142 BgpNeighborReqIterate,
144 BgpNeighborResp>::CreateData;
146 ps.stages_.push_back(s1);
153 void BgpNeighborReqIterate::HandleRequest()
const {
161 BgpNeighborReqIterate,
163 BgpNeighborResp>::CallbackIterate, _1, _2, _3, _4, _5);
166 BgpNeighborReqIterate,
168 BgpNeighborResp>::CreateData;
170 ps.stages_.push_back(s1);
177 void ShowBgpNeighborSummaryReq::HandleRequest()
const {
184 ShowBgpNeighborSummaryReq,
185 ShowBgpNeighborSummaryReqIterate,
186 ShowBgpNeighborSummaryResp,
187 BgpNeighborResp>::Callback, _1, _2, _3, _4, _5);
189 ShowBgpNeighborSummaryReq,
190 ShowBgpNeighborSummaryReqIterate,
191 ShowBgpNeighborSummaryResp,
192 BgpNeighborResp>::CreateData;
194 ps.stages_.push_back(s1);
201 void ShowBgpNeighborSummaryReqIterate::HandleRequest()
const {
208 ShowBgpNeighborSummaryReq,
209 ShowBgpNeighborSummaryReqIterate,
210 ShowBgpNeighborSummaryResp,
211 BgpNeighborResp>::CallbackIterate, _1, _2, _3, _4, _5);
213 ShowBgpNeighborSummaryReq,
214 ShowBgpNeighborSummaryReqIterate,
215 ShowBgpNeighborSummaryResp,
216 BgpNeighborResp>::CreateData;
218 ps.stages_.push_back(s1);
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)
BgpPeer * FindNextPeer(const std::string &name=std::string())
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)
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
uint32_t iter_limit() const
uint32_t page_limit() const
std::string search_string
std::vector< ShowT > show_list
std::vector< int > instances_