forked from zhenggen-xu/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changet the name of the BGP vty patch
- Loading branch information
1 parent
c1c86e9
commit 348258e
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c | ||
index 874af821b..32b0ecffd 100644 | ||
--- a/bgpd/bgp_vty.c | ||
+++ b/bgpd/bgp_vty.c | ||
@@ -6819,6 +6819,11 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, | ||
int pfx_rcd_safi; | ||
json_object *json_peer = NULL; | ||
json_object *json_peers = NULL; | ||
+ struct bgp_table *table; | ||
+ struct bgp_node *rn; | ||
+ struct bgp_adj_out *adj; | ||
+ struct peer_af *paf; | ||
+ unsigned long output_count = 0; | ||
|
||
/* labeled-unicast routes are installed in the unicast table so in order | ||
* to | ||
@@ -6873,6 +6878,7 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, | ||
} | ||
|
||
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) { | ||
+ output_count = 0; | ||
if (!CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE)) | ||
continue; | ||
|
||
@@ -7093,7 +7099,26 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, | ||
if (peer->domainname) | ||
json_object_string_add(json_peer, "domainname", | ||
peer->domainname); | ||
- | ||
+ if (peer->desc) | ||
+ json_object_string_add(json_peer, "description", | ||
+ peer->desc); | ||
+ | ||
+ /* | ||
+ * advertised prefixes | ||
+ */ | ||
+ table = bgp->rib[afi][safi]; | ||
+ for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) { | ||
+ for (adj = rn->adj_out; adj; adj = adj->next) | ||
+ SUBGRP_FOREACH_PEER (adj->subgroup, paf) { | ||
+ if (paf->peer != peer) | ||
+ continue; | ||
+ if (adj->attr) { | ||
+ output_count++; | ||
+ } | ||
+ } | ||
+ } | ||
+ | ||
+ json_object_int_add(json_peer, "advertisedPrefixes", output_count); | ||
json_object_int_add(json_peer, "remoteAs", peer->as); | ||
json_object_int_add(json_peer, "version", 4); | ||
json_object_int_add(json_peer, "msgRcvd", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
0001-zebra-kernel-level-graceful-restart.patch | ||
0001-bgp-vty-show-sum.patch | ||
0002-bgp-vty-show-sum.patch |