12 #include "bgp/bgp_peer_internal_types.h"
25 const string &search_string,
const regex &search_expr) {
28 string address_string = bx_channel->
remote_endpoint().address().to_string();
31 if (search_string ==
"deleted" && bx_channel->
peer_deleted())
39 bnr->set_peer(bx_channel->
ToString());
40 bnr->set_peer_address(bx_channel->
remote_endpoint().address().to_string());
44 bnr->set_local_address(bx_channel->
local_endpoint().address().to_string());
45 bnr->set_peer_type(
"internal");
46 bnr->set_encoding(
"XMPP");
61 bnr->set_dscp_value(dscp);
67 bnr->set_configured_address_families(vector<string>());
68 bnr->set_negotiated_address_families(vector<string>());
79 uint32_t page_limit, uint32_t iter_limit,
const string &start_neighbor,
80 const string &search_string, vector<BgpNeighborResp> *list,
81 string *next_neighbor) {
82 regex search_expr(search_string);
86 for (uint32_t iter_count = 0; it != bxcm->
name_cend(); ++it, ++iter_count) {
93 if (list->size() >= page_limit)
95 if (iter_count >= iter_limit)
105 bool done = list->size() >= page_limit;
106 *next_neighbor = it->second->ToString();
111 size_t *count,
const BgpServer *bgp_server,
string domain,
114 if (boost::iequals(up_or_down,
"up") && !channel->
Peer()->
IsReady()) {
117 if (boost::iequals(up_or_down,
"down") && channel->
Peer()->
IsReady()) {
121 if (!domain.empty()) {
141 const ShowNeighborStatisticsReq *req) {
145 req->get_up_or_down(), _1));
BgpXmppChannelManager * xmpp_peer_manager
virtual const XmppConnection * connection() const =0
std::string StateName() const
BgpTable * GetTable(Address::Family fmly)
RoutingInstance * GetRoutingInstance(const std::string &name)
uint64_t peer_closed_at() const
static void FillXmppNeighborInfo(BgpNeighborResp *bnr, const BgpSandeshContext *bsc, const BgpXmppChannel *bx_channel, bool summary)
virtual int GetPrimaryPathCount() const =0
void FillCloseInfo(BgpNeighborResp *resp) const
void FillInstanceMembershipInfo(BgpNeighborResp *resp) const
virtual IPeerDebugStats * peer_stats()=0
RoutingInstanceMgr * routing_instance_mgr()
virtual bool IsReady() const =0
void FillPeerMembershipInfo(const IPeer *peer, BgpNeighborResp *resp) const
int GetConfiguredHoldTime() const
bool GetRegistrationInfo(const IPeer *peer, const BgpTable *table, int *instance_id=NULL, uint64_t *subscription_gen_id=NULL) const
int GetNegotiatedHoldTime() const
static bool regex_match(const std::string &input, const regex ®ex)
virtual uint64_t num_flaps() const =0
const_name_iterator name_cend() const
virtual bool send_ready() const
XmppChannelNameMap::const_iterator const_name_iterator
TcpSession::Endpoint remote_endpoint() const
static bool ShowXmppNeighbor(const BgpSandeshContext *bsc, bool summary, uint32_t page_limit, uint32_t iter_limit, const string &start_neighbor, const string &search_string, vector< BgpNeighborResp > *list, string *next_neighbor)
static bool ShowXmppNeighborMatch(const BgpXmppChannel *bx_channel, const string &search_string, const regex &search_expr)
const_name_iterator name_clower_bound(const std::string &name) const
static bool regex_search(const std::string &input, const regex ®ex)
std::string GetXmppAuthenticationType() const
const std::string & ToString() const
TcpSession::Endpoint local_endpoint() const
int GetTaskInstance() const
bool peer_deleted() const
virtual std::string last_flap() const =0
static void ShowXmppNeighborStatisticsVisitor(size_t *count, const BgpServer *bgp_server, string domain, string up_or_down, const BgpXmppChannel *channel)
void SetNeighborShowExtensions(const NeighborListExtension &show_neighbor, const NeighborStatisticsExtension &show_neighbor_statistics)
BgpMembershipManager * membership_mgr()
void RegisterSandeshShowXmppExtensions(BgpSandeshContext *bsc)
static void ShowXmppNeighborStatistics(size_t *count, const BgpSandeshContext *bsc, const ShowNeighborStatisticsReq *req)
std::string transport_address_string() const
static void FillBgpNeighborDebugState(BgpNeighborResp *bnr, const IPeerDebugStats *peer)
const XmppSession * GetSession() const
void VisitChannels(BgpXmppChannelManager::VisitorFn)
void FillTableMembershipInfo(BgpNeighborResp *resp) const
const XmppChannel * channel() const
uint8_t GetDscpValue() const
static std::string UTCUsecToString(uint64_t tstamp)