diff options
| author | Paul Jakma <paul.jakma@sun.com> | 2008-08-23 14:27:06 +0100 | 
|---|---|---|
| committer | Paul Jakma <paul@quagga.net> | 2008-08-23 14:27:06 +0100 | 
| commit | 62687ff1cd3d4460cdbd4b0fbf1e3298fe277ad2 (patch) | |
| tree | 6bea5c1cf07d9d702c95fabe356fcec418b91398 /bgpd/bgp_vty.c | |
| parent | b38309a4ee831a440ef78f8a27db584f2f8e8276 (diff) | |
[vty] Add support for a 'restricted mode' with anonymous vty connections
	* lib/command.h: Add a RESTRICTED_NODE, intended for use with
	  anonymous, 'no login' vtys, to provide a subset of 'view' mode
	  commands.
	* lib/command.c: Add RESTRICTED_NODE bits, nothing special, just
	  following VIEW_NODE.
	* lib/vty.c: (vty_auth) enable authentication should fall back to
	  restricted/view node as appropriate.
	  (vty_create) init vty's to restricted/view node as appropriate,
	  for the 'no login' case.
	  (vty_{no_,}restricted_mode_cmd) config commands to enable
	  'anonymous restricted' in vty configuration.
	  (vty_config_write) 'anonymous restricted' config.
	  (vty_init) Install some commands to restricted mode, and the
	  'anonymous restricted' config commands into VTY_NODE.
	* bgpd/*.c: Install some of the safe(r) BGP commands into
	  'restricted mode', i.e. lookup commands of non-sensitive data.
	  Useful with looking-glass route-servers.
Diffstat (limited to 'bgpd/bgp_vty.c')
| -rw-r--r-- | bgpd/bgp_vty.c | 30 | 
1 files changed, 30 insertions, 0 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 90867373..9237cb0d 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -9748,6 +9748,18 @@ bgp_vty_init (void)    install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd);    install_element (VIEW_NODE, &show_bgp_instance_ipv6_summary_cmd);  #endif /* HAVE_IPV6 */ +  install_element (RESTRICTED_NODE, &show_ip_bgp_summary_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_instance_summary_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_summary_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_summary_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd); +#ifdef HAVE_IPV6 +  install_element (RESTRICTED_NODE, &show_bgp_summary_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_instance_summary_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_ipv6_summary_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_summary_cmd); +#endif /* HAVE_IPV6 */    install_element (ENABLE_NODE, &show_ip_bgp_summary_cmd);    install_element (ENABLE_NODE, &show_ip_bgp_instance_summary_cmd);    install_element (ENABLE_NODE, &show_ip_bgp_ipv4_summary_cmd); @@ -9772,6 +9784,11 @@ bgp_vty_init (void)    install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd);    install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_cmd);    install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_peer_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_neighbors_peer_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_instance_neighbors_peer_cmd);    install_element (ENABLE_NODE, &show_ip_bgp_neighbors_cmd);    install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbors_cmd);    install_element (ENABLE_NODE, &show_ip_bgp_neighbors_peer_cmd); @@ -9792,6 +9809,10 @@ bgp_vty_init (void)    install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_cmd);    install_element (VIEW_NODE, &show_bgp_instance_neighbors_peer_cmd);    install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_neighbors_peer_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_ipv6_neighbors_peer_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_instance_neighbors_peer_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd);    install_element (ENABLE_NODE, &show_bgp_neighbors_cmd);    install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_cmd);    install_element (ENABLE_NODE, &show_bgp_neighbors_peer_cmd); @@ -9813,6 +9834,10 @@ bgp_vty_init (void)    install_element (VIEW_NODE, &show_ip_bgp_instance_rsclient_summary_cmd);    install_element (VIEW_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd);    install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_rsclient_summary_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_instance_rsclient_summary_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd); +  install_element (RESTRICTED_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd);    install_element (ENABLE_NODE, &show_ip_bgp_rsclient_summary_cmd);    install_element (ENABLE_NODE, &show_ip_bgp_instance_rsclient_summary_cmd);    install_element (ENABLE_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd); @@ -9823,6 +9848,10 @@ bgp_vty_init (void)    install_element (VIEW_NODE, &show_bgp_ipv6_rsclient_summary_cmd);    install_element (VIEW_NODE, &show_bgp_instance_rsclient_summary_cmd);    install_element (VIEW_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_rsclient_summary_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_ipv6_rsclient_summary_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_instance_rsclient_summary_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd);    install_element (ENABLE_NODE, &show_bgp_rsclient_summary_cmd);    install_element (ENABLE_NODE, &show_bgp_ipv6_rsclient_summary_cmd);    install_element (ENABLE_NODE, &show_bgp_instance_rsclient_summary_cmd); @@ -9869,6 +9898,7 @@ bgp_vty_init (void)    /* "show bgp memory" commands. */    install_element (VIEW_NODE, &show_bgp_memory_cmd); +  install_element (RESTRICTED_NODE, &show_bgp_memory_cmd);    install_element (ENABLE_NODE, &show_bgp_memory_cmd);    /* Community-list. */  | 
