summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorMichael Lambert <lambert@psc.edu>2008-11-16 20:12:04 +0000
committerPaul Jakma <paul@quagga.net>2008-11-16 20:12:04 +0000
commite0081f70ede76bc7a3db53eaab3e45ba657cc4d3 (patch)
tree27e143772053a699d10671832e3c7d989ee85392 /bgpd
parent5d4b8cf2faba9f5386810a7c70837e5b7fae3572 (diff)
[bgpd] Add 'show bgp views' command
* bgp_vty.c: (show_bgp_views_cmd) new command to list all defined views. (with small edits by Paul Jakma) Signed-off-by: Paul Jakma <paul@quagga.net>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_vty.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 7acf27cc..380dbdaf 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -6509,6 +6509,32 @@ ALIAS (clear_ip_bgp_peer_rsclient,
"BGP IPv6 neighbor to clear\n"
"Soft reconfig for rsclient RIB\n")
+DEFUN (show_bgp_views,
+ show_bgp_views_cmd,
+ "show bgp views",
+ SHOW_STR
+ BGP_STR
+ "Show the defined BGP views\n")
+{
+ struct list *inst = bm->bgp;
+ struct listnode *node;
+ struct bgp *bgp;
+
+ if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE))
+ {
+ vty_out (vty, "Multiple BGP views are not defined%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ vty_out (vty, "Defined BGP views:%s", VTY_NEWLINE);
+ for (ALL_LIST_ELEMENTS_RO(inst, node, bgp))
+ vty_out (vty, "\t%s (AS%u)%s",
+ bgp->name ? bgp->name : "(null)",
+ bgp->as, VTY_NEWLINE);
+
+ return CMD_SUCCESS;
+}
+
DEFUN (show_bgp_memory,
show_bgp_memory_cmd,
"show bgp memory",
@@ -9875,6 +9901,11 @@ bgp_vty_init (void)
install_element (RESTRICTED_NODE, &show_bgp_memory_cmd);
install_element (ENABLE_NODE, &show_bgp_memory_cmd);
+ /* "show bgp views" commands. */
+ install_element (VIEW_NODE, &show_bgp_views_cmd);
+ install_element (RESTRICTED_NODE, &show_bgp_views_cmd);
+ install_element (ENABLE_NODE, &show_bgp_views_cmd);
+
/* Community-list. */
community_list_vty ();
}