--- embedaddon/quagga/bgpd/bgp_vty.c 2013/07/21 23:54:38 1.1.1.3 +++ embedaddon/quagga/bgpd/bgp_vty.c 2016/11/02 10:09:10 1.1.1.4 @@ -30,6 +30,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330 #include "log.h" #include "memory.h" #include "hash.h" +#include "filter.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_advertise.h" @@ -56,9 +57,20 @@ extern struct in_addr router_id_zebra; afi_t bgp_node_afi (struct vty *vty) { - if (vty->node == BGP_IPV6_NODE || vty->node == BGP_IPV6M_NODE) - return AFI_IP6; - return AFI_IP; + afi_t afi; + switch (vty->node) + { + case BGP_IPV6_NODE: + case BGP_IPV6M_NODE: + case BGP_VPNV6_NODE: + case BGP_ENCAPV6_NODE: + afi = AFI_IP6; + break; + default: + afi = AFI_IP; + break; + } + return afi; } /* Utility function to get subsequent address family from current @@ -66,13 +78,64 @@ bgp_node_afi (struct vty *vty) safi_t bgp_node_safi (struct vty *vty) { - if (vty->node == BGP_VPNV4_NODE) - return SAFI_MPLS_VPN; - if (vty->node == BGP_IPV4M_NODE || vty->node == BGP_IPV6M_NODE) - return SAFI_MULTICAST; - return SAFI_UNICAST; + safi_t safi; + switch (vty->node) + { + case BGP_ENCAP_NODE: + case BGP_ENCAPV6_NODE: + safi = SAFI_ENCAP; + break; + case BGP_VPNV4_NODE: + case BGP_VPNV6_NODE: + safi = SAFI_MPLS_VPN; + break; + case BGP_IPV4M_NODE: + case BGP_IPV6M_NODE: + safi = SAFI_MULTICAST; + break; + default: + safi = SAFI_UNICAST; + break; + } + return safi; } +int +bgp_parse_afi(const char *str, afi_t *afi) +{ + if (!strcmp(str, "ipv4")) { + *afi = AFI_IP; + return 0; + } + if (!strcmp(str, "ipv6")) { + *afi = AFI_IP6; + return 0; + } + return -1; +} + +int +bgp_parse_safi(const char *str, safi_t *safi) +{ + if (!strcmp(str, "encap")) { + *safi = SAFI_ENCAP; + return 0; + } + if (!strcmp(str, "multicast")) { + *safi = SAFI_MULTICAST; + return 0; + } + if (!strcmp(str, "unicast")) { + *safi = SAFI_UNICAST; + return 0; + } + if (!strcmp(str, "vpn")) { + *safi = SAFI_MPLS_VPN; + return 0; + } + return -1; +} + static int peer_address_self_check (union sockunion *su) { @@ -80,10 +143,8 @@ peer_address_self_check (union sockunion *su) if (su->sa.sa_family == AF_INET) ifp = if_lookup_by_ipv4_exact (&su->sin.sin_addr); -#ifdef HAVE_IPV6 else if (su->sa.sa_family == AF_INET6) ifp = if_lookup_by_ipv6_exact (&su->sin6.sin6_addr); -#endif /* HAVE IPV6 */ if (ifp) return 1; @@ -314,7 +375,7 @@ DEFUN_DEPRECATED (neighbor_version, { return CMD_SUCCESS; } - + /* "router bgp" commands. */ DEFUN (router_bgp, router_bgp_cmd, @@ -364,7 +425,7 @@ ALIAS (router_bgp, AS_STR "BGP view\n" "view name\n") - + /* "no router bgp" commands. */ DEFUN (no_router_bgp, no_router_bgp_cmd, @@ -405,7 +466,7 @@ ALIAS (no_router_bgp, AS_STR "BGP view\n" "view name\n") - + /* BGP router-id. */ DEFUN (bgp_router_id, @@ -476,7 +537,7 @@ ALIAS (no_bgp_router_id, BGP_STR "Override configured router identifier\n" "Manually configured router identifier\n") - + /* BGP Cluster ID. */ DEFUN (bgp_cluster_id, @@ -546,7 +607,7 @@ ALIAS (no_bgp_cluster_id, BGP_STR "Configure Route-Reflector Cluster-id\n" "Route-Reflector Cluster-id in IP address format\n") - + DEFUN (bgp_confederation_identifier, bgp_confederation_identifier_cmd, "bgp confederation identifier " CMD_AS_RANGE, @@ -576,7 +637,7 @@ DEFUN (no_bgp_confederation_identifier, "AS number\n") { struct bgp *bgp; - as_t as; + as_t as __attribute__((unused)); /* Dummy for VTY_GET_INTEGER_RANGE */ bgp = vty->index; @@ -596,7 +657,7 @@ ALIAS (no_bgp_confederation_identifier, "AS confederation parameters\n" "AS number\n" "Set routing domain confederation AS\n") - + DEFUN (bgp_confederation_peers, bgp_confederation_peers_cmd, "bgp confederation peers ." CMD_AS_RANGE, @@ -650,11 +711,11 @@ DEFUN (no_bgp_confederation_peers, } return CMD_SUCCESS; } - + /* Maximum-paths configuration */ DEFUN (bgp_maxpaths, bgp_maxpaths_cmd, - "maximum-paths <1-255>", + "maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM), "Forward packets over multiple paths\n" "Number of paths\n") { @@ -681,7 +742,7 @@ DEFUN (bgp_maxpaths, DEFUN (bgp_maxpaths_ibgp, bgp_maxpaths_ibgp_cmd, - "maximum-paths ibgp <1-255>", + "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM), "Forward packets over multiple paths\n" "iBGP-multipath\n" "Number of paths\n") @@ -734,7 +795,7 @@ DEFUN (no_bgp_maxpaths, ALIAS (no_bgp_maxpaths, no_bgp_maxpaths_arg_cmd, - "no maximum-paths <1-255>", + "no maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM), NO_STR "Forward packets over multiple paths\n" "Number of paths\n") @@ -767,7 +828,7 @@ DEFUN (no_bgp_maxpaths_ibgp, ALIAS (no_bgp_maxpaths_ibgp, no_bgp_maxpaths_ibgp_arg_cmd, - "no maximum-paths ibgp <1-255>", + "no maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM), NO_STR "Forward packets over multiple paths\n" "iBGP-multipath\n" @@ -793,7 +854,7 @@ bgp_config_write_maxpaths (struct vty *vty, struct bgp return 0; } - + /* BGP timers. */ DEFUN (bgp_timers, @@ -849,7 +910,7 @@ ALIAS (no_bgp_timers, "BGP timers\n" "Keepalive interval\n" "Holdtime\n") - + DEFUN (bgp_client_to_client_reflection, bgp_client_to_client_reflection_cmd, "bgp client-to-client reflection", @@ -906,7 +967,7 @@ DEFUN (no_bgp_always_compare_med, bgp_flag_unset (bgp, BGP_FLAG_ALWAYS_COMPARE_MED); return CMD_SUCCESS; } - + /* "bgp deterministic-med" configuration. */ DEFUN (bgp_deterministic_med, bgp_deterministic_med_cmd, @@ -1037,7 +1098,7 @@ DEFUN (no_bgp_fast_external_failover, bgp_flag_set (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER); return CMD_SUCCESS; } - + /* "bgp enforce-first-as" configuration. */ DEFUN (bgp_enforce_first_as, bgp_enforce_first_as_cmd, @@ -1065,7 +1126,7 @@ DEFUN (no_bgp_enforce_first_as, bgp_flag_unset (bgp, BGP_FLAG_ENFORCE_FIRST_AS); return CMD_SUCCESS; } - + /* "bgp bestpath compare-routerid" configuration. */ DEFUN (bgp_bestpath_compare_router_id, bgp_bestpath_compare_router_id_cmd, @@ -1095,7 +1156,7 @@ DEFUN (no_bgp_bestpath_compare_router_id, bgp_flag_unset (bgp, BGP_FLAG_COMPARE_ROUTER_ID); return CMD_SUCCESS; } - + /* "bgp bestpath as-path ignore" configuration. */ DEFUN (bgp_bestpath_aspath_ignore, bgp_bestpath_aspath_ignore_cmd, @@ -1127,7 +1188,7 @@ DEFUN (no_bgp_bestpath_aspath_ignore, bgp_flag_unset (bgp, BGP_FLAG_ASPATH_IGNORE); return CMD_SUCCESS; } - + /* "bgp bestpath as-path confed" configuration. */ DEFUN (bgp_bestpath_aspath_confed, bgp_bestpath_aspath_confed_cmd, @@ -1159,7 +1220,39 @@ DEFUN (no_bgp_bestpath_aspath_confed, bgp_flag_unset (bgp, BGP_FLAG_ASPATH_CONFED); return CMD_SUCCESS; } - + +/* "bgp bestpath as-path multipath-relax" configuration. */ +DEFUN (bgp_bestpath_aspath_multipath_relax, + bgp_bestpath_aspath_multipath_relax_cmd, + "bgp bestpath as-path multipath-relax", + "BGP specific commands\n" + "Change the default bestpath selection\n" + "AS-path attribute\n" + "Allow load sharing across routes that have different AS paths (but same length)\n") +{ + struct bgp *bgp; + + bgp = vty->index; + bgp_flag_set (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX); + return CMD_SUCCESS; +} + +DEFUN (no_bgp_bestpath_aspath_multipath_relax, + no_bgp_bestpath_aspath_multipath_relax_cmd, + "no bgp bestpath as-path multipath-relax", + NO_STR + "BGP specific commands\n" + "Change the default bestpath selection\n" + "AS-path attribute\n" + "Allow load sharing across routes that have different AS paths (but same length)\n") +{ + struct bgp *bgp; + + bgp = vty->index; + bgp_flag_unset (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX); + return CMD_SUCCESS; +} + /* "bgp log-neighbor-changes" configuration. */ DEFUN (bgp_log_neighbor_changes, bgp_log_neighbor_changes_cmd, @@ -1187,7 +1280,7 @@ DEFUN (no_bgp_log_neighbor_changes, bgp_flag_unset (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES); return CMD_SUCCESS; } - + /* "bgp bestpath med" configuration. */ DEFUN (bgp_bestpath_med, bgp_bestpath_med_cmd, @@ -1285,7 +1378,7 @@ ALIAS (no_bgp_bestpath_med2, "MED attribute\n" "Treat missing MED as the least preferred one\n" "Compare MED among confederation paths\n") - + /* "no bgp default ipv4-unicast". */ DEFUN (no_bgp_default_ipv4_unicast, no_bgp_default_ipv4_unicast_cmd, @@ -1315,7 +1408,7 @@ DEFUN (bgp_default_ipv4_unicast, bgp_flag_unset (bgp, BGP_FLAG_NO_DEFAULT_IPV4); return CMD_SUCCESS; } - + /* "bgp import-check" configuration. */ DEFUN (bgp_network_import_check, bgp_network_import_check_cmd, @@ -1345,7 +1438,7 @@ DEFUN (no_bgp_network_import_check, bgp_flag_unset (bgp, BGP_FLAG_IMPORT_CHECK); return CMD_SUCCESS; } - + DEFUN (bgp_default_local_preference, bgp_default_local_preference_cmd, "bgp default local-preference <0-4294967295>", @@ -1389,7 +1482,7 @@ ALIAS (no_bgp_default_local_preference, "Configure BGP defaults\n" "local preference (higher=more preferred)\n" "Configure default local preference value\n") - + static int peer_remote_as_vty (struct vty *vty, const char *peer_str, const char *as_str, afi_t afi, safi_t safi) @@ -1449,7 +1542,7 @@ DEFUN (neighbor_remote_as, { return peer_remote_as_vty (vty, argv[0], argv[1], AFI_IP, SAFI_UNICAST); } - + DEFUN (neighbor_peer_group, neighbor_peer_group_cmd, "neighbor WORD peer-group", @@ -1554,7 +1647,7 @@ DEFUN (no_neighbor_peer_group_remote_as, } return CMD_SUCCESS; } - + DEFUN (neighbor_local_as, neighbor_local_as_cmd, NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE, @@ -1664,7 +1757,7 @@ ALIAS (no_neighbor_local_as, "AS number used as local AS\n" "Do not prepend local-as to updates from ebgp peers\n" "Do not prepend local-as to updates from ibgp peers\n") - + DEFUN (neighbor_password, neighbor_password_cmd, NEIGHBOR_CMD2 "password LINE", @@ -1702,7 +1795,7 @@ DEFUN (no_neighbor_password, ret = peer_password_unset (peer); return bgp_vty_return (vty, ret); } - + DEFUN (neighbor_activate, neighbor_activate_cmd, NEIGHBOR_CMD2 "activate", @@ -1741,7 +1834,7 @@ DEFUN (no_neighbor_activate, return bgp_vty_return (vty, ret); } - + DEFUN (neighbor_set_peer_group, neighbor_set_peer_group_cmd, NEIGHBOR_CMD "peer-group WORD", @@ -1823,7 +1916,7 @@ DEFUN (no_neighbor_set_peer_group, return bgp_vty_return (vty, ret); } - + static int peer_flag_modify_vty (struct vty *vty, const char *ip_str, u_int16_t flag, int set) @@ -1876,7 +1969,7 @@ DEFUN (no_neighbor_passive, { return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_PASSIVE); } - + /* neighbor shutdown. */ DEFUN (neighbor_shutdown, neighbor_shutdown_cmd, @@ -1898,7 +1991,7 @@ DEFUN (no_neighbor_shutdown, { return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_SHUTDOWN); } - + /* Deprecated neighbor capability route-refresh. */ DEFUN_DEPRECATED (neighbor_capability_route_refresh, neighbor_capability_route_refresh_cmd, @@ -1922,7 +2015,7 @@ DEFUN_DEPRECATED (no_neighbor_capability_route_refresh { return CMD_SUCCESS; } - + /* neighbor capability dynamic. */ DEFUN (neighbor_capability_dynamic, neighbor_capability_dynamic_cmd, @@ -1946,7 +2039,7 @@ DEFUN (no_neighbor_capability_dynamic, { return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DYNAMIC_CAPABILITY); } - + /* neighbor dont-capability-negotiate */ DEFUN (neighbor_dont_capability_negotiate, neighbor_dont_capability_negotiate_cmd, @@ -1968,7 +2061,7 @@ DEFUN (no_neighbor_dont_capability_negotiate, { return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DONT_CAPABILITY); } - + static int peer_af_flag_modify_vty (struct vty *vty, const char *peer_str, afi_t afi, safi_t safi, u_int32_t flag, int set) @@ -2001,7 +2094,7 @@ peer_af_flag_unset_vty (struct vty *vty, const char *p { return peer_af_flag_modify_vty (vty, peer_str, afi, safi, flag, 0); } - + /* neighbor capability orf prefix-list. */ DEFUN (neighbor_capability_orf_prefix, neighbor_capability_orf_prefix_cmd, @@ -2057,31 +2150,47 @@ DEFUN (no_neighbor_capability_orf_prefix, return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), bgp_node_safi (vty), flag); } - + /* neighbor next-hop-self. */ DEFUN (neighbor_nexthop_self, neighbor_nexthop_self_cmd, - NEIGHBOR_CMD2 "next-hop-self", + NEIGHBOR_CMD2 "next-hop-self {all}", NEIGHBOR_STR NEIGHBOR_ADDR_STR2 - "Disable the next hop calculation for this neighbor\n") + "Disable the next hop calculation for this neighbor\n" + "Apply also to ibgp-learned routes when acting as a route reflector\n") { - return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), - bgp_node_safi (vty), PEER_FLAG_NEXTHOP_SELF); + u_int32_t flags = PEER_FLAG_NEXTHOP_SELF, unset = 0; + int rc; + + /* Check if "all" is specified */ + if (argv[1] != NULL) + flags |= PEER_FLAG_NEXTHOP_SELF_ALL; + else + unset |= PEER_FLAG_NEXTHOP_SELF_ALL; + + rc = peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), + bgp_node_safi (vty), flags); + if ( rc == CMD_SUCCESS && unset ) + rc = peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), + bgp_node_safi (vty), unset); + return rc; } DEFUN (no_neighbor_nexthop_self, no_neighbor_nexthop_self_cmd, - NO_NEIGHBOR_CMD2 "next-hop-self", + NO_NEIGHBOR_CMD2 "next-hop-self {all}", NO_STR NEIGHBOR_STR NEIGHBOR_ADDR_STR2 - "Disable the next hop calculation for this neighbor\n") + "Disable the next hop calculation for this neighbor\n" + "Apply also to ibgp-learned routes when acting as a route reflector\n") { return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), - bgp_node_safi (vty), PEER_FLAG_NEXTHOP_SELF); + bgp_node_safi (vty), + PEER_FLAG_NEXTHOP_SELF|PEER_FLAG_NEXTHOP_SELF_ALL); } - + /* neighbor remove-private-AS. */ DEFUN (neighbor_remove_private_as, neighbor_remove_private_as_cmd, @@ -2107,7 +2216,7 @@ DEFUN (no_neighbor_remove_private_as, bgp_node_safi (vty), PEER_FLAG_REMOVE_PRIVATE_AS); } - + /* neighbor send-community. */ DEFUN (neighbor_send_community, neighbor_send_community_cmd, @@ -2133,7 +2242,7 @@ DEFUN (no_neighbor_send_community, bgp_node_safi (vty), PEER_FLAG_SEND_COMMUNITY); } - + /* neighbor send-community extended. */ DEFUN (neighbor_send_community_type, neighbor_send_community_type_cmd, @@ -2185,7 +2294,7 @@ DEFUN (no_neighbor_send_community_type, (PEER_FLAG_SEND_COMMUNITY | PEER_FLAG_SEND_EXT_COMMUNITY)); } - + /* neighbor soft-reconfig. */ DEFUN (neighbor_soft_reconfiguration, neighbor_soft_reconfiguration_cmd, @@ -2213,7 +2322,7 @@ DEFUN (no_neighbor_soft_reconfiguration, bgp_node_afi (vty), bgp_node_safi (vty), PEER_FLAG_SOFT_RECONFIG); } - + DEFUN (neighbor_route_reflector_client, neighbor_route_reflector_client_cmd, NEIGHBOR_CMD2 "route-reflector-client", @@ -2245,7 +2354,7 @@ DEFUN (no_neighbor_route_reflector_client, bgp_node_safi (vty), PEER_FLAG_REFLECTOR_CLIENT); } - + static int peer_rsclient_set_vty (struct vty *vty, const char *peer_str, int afi, int safi) @@ -2393,7 +2502,7 @@ peer_rsclient_unset_vty (struct vty *vty, const char * return CMD_SUCCESS; } - + /* neighbor route-server-client. */ DEFUN (neighbor_route_server_client, neighbor_route_server_client_cmd, @@ -2417,7 +2526,7 @@ DEFUN (no_neighbor_route_server_client, return peer_rsclient_unset_vty (vty, argv[0], bgp_node_afi(vty), bgp_node_safi(vty)); } - + DEFUN (neighbor_nexthop_local_unchanged, neighbor_nexthop_local_unchanged_cmd, NEIGHBOR_CMD2 "nexthop-local unchanged", @@ -2430,7 +2539,7 @@ DEFUN (neighbor_nexthop_local_unchanged, bgp_node_safi (vty), PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED ); } - + DEFUN (no_neighbor_nexthop_local_unchanged, no_neighbor_nexthop_local_unchanged_cmd, NO_NEIGHBOR_CMD2 "nexthop-local unchanged", @@ -2444,7 +2553,7 @@ DEFUN (no_neighbor_nexthop_local_unchanged, bgp_node_safi (vty), PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED ); } - + DEFUN (neighbor_attr_unchanged, neighbor_attr_unchanged_cmd, NEIGHBOR_CMD2 "attribute-unchanged", @@ -2801,7 +2910,7 @@ DEFUN_DEPRECATED (neighbor_transparent_nexthop, bgp_node_safi (vty), PEER_FLAG_NEXTHOP_UNCHANGED); } - + /* EBGP multihop configuration. */ static int peer_ebgp_multihop_set_vty (struct vty *vty, const char *ip_str, @@ -2875,7 +2984,7 @@ ALIAS (no_neighbor_ebgp_multihop, NEIGHBOR_ADDR_STR2 "Allow EBGP neighbors not on directly connected networks\n" "maximum hop count\n") - + /* disable-connected-check */ DEFUN (neighbor_disable_connected_check, neighbor_disable_connected_check_cmd, @@ -2914,7 +3023,7 @@ ALIAS (no_neighbor_disable_connected_check, NEIGHBOR_STR NEIGHBOR_ADDR_STR2 "Enforce EBGP neighbors perform multihop\n") - + DEFUN (neighbor_description, neighbor_description_cmd, NEIGHBOR_CMD2 "description .LINE", @@ -2969,7 +3078,7 @@ ALIAS (no_neighbor_description, NEIGHBOR_ADDR_STR2 "Neighbor specific description\n" "Up to 80 characters describing this neighbor\n") - + /* Neighbor update-source. */ static int peer_update_source_vty (struct vty *vty, const char *peer_str, @@ -3024,7 +3133,7 @@ DEFUN (no_neighbor_update_source, { return peer_update_source_vty (vty, argv[0], NULL); } - + static int peer_default_originate_set_vty (struct vty *vty, const char *peer_str, afi_t afi, safi_t safi, @@ -3091,7 +3200,7 @@ ALIAS (no_neighbor_default_originate, "Originate default route to this neighbor\n" "Route-map to specify criteria to originate default\n" "route-map name\n") - + /* Set neighbor's BGP port. */ static int peer_port_vty (struct vty *vty, const char *ip_str, int afi, @@ -3151,13 +3260,12 @@ ALIAS (no_neighbor_port, NEIGHBOR_ADDR_STR "Neighbor's BGP port\n" "TCP port number\n") - + /* neighbor weight. */ static int peer_weight_set_vty (struct vty *vty, const char *ip_str, const char *weight_str) { - int ret; struct peer *peer; unsigned long weight; @@ -3167,9 +3275,7 @@ peer_weight_set_vty (struct vty *vty, const char *ip_s VTY_GET_INTEGER_RANGE("weight", weight, weight_str, 0, 65535); - ret = peer_weight_set (peer, weight); - - return CMD_SUCCESS; + return bgp_vty_return (vty, peer_weight_set (peer, weight)); } static int @@ -3181,9 +3287,7 @@ peer_weight_unset_vty (struct vty *vty, const char *ip if (! peer) return CMD_WARNING; - peer_weight_unset (peer); - - return CMD_SUCCESS; + return bgp_vty_return (vty, peer_weight_unset (peer)); } DEFUN (neighbor_weight, @@ -3216,7 +3320,7 @@ ALIAS (no_neighbor_weight, NEIGHBOR_ADDR_STR2 "Set default weight for routes from this neighbor\n" "default weight\n") - + /* Override capability negotiation. */ DEFUN (neighbor_override_capability, neighbor_override_capability_cmd, @@ -3238,7 +3342,7 @@ DEFUN (no_neighbor_override_capability, { return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_OVERRIDE_CAPABILITY); } - + DEFUN (neighbor_strict_capability, neighbor_strict_capability_cmd, NEIGHBOR_CMD "strict-capability-match", @@ -3259,7 +3363,7 @@ DEFUN (no_neighbor_strict_capability, { return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_STRICT_CAP_MATCH); } - + static int peer_timers_set_vty (struct vty *vty, const char *ip_str, const char *keep_str, const char *hold_str) @@ -3280,7 +3384,7 @@ peer_timers_set_vty (struct vty *vty, const char *ip_s return bgp_vty_return (vty, ret); } - + static int peer_timers_unset_vty (struct vty *vty, const char *ip_str) { @@ -3318,46 +3422,40 @@ DEFUN (no_neighbor_timers, { return peer_timers_unset_vty (vty, argv[0]); } - + static int peer_timers_connect_set_vty (struct vty *vty, const char *ip_str, const char *time_str) { - int ret; struct peer *peer; u_int32_t connect; - peer = peer_lookup_vty (vty, ip_str); + peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) return CMD_WARNING; VTY_GET_INTEGER_RANGE ("Connect time", connect, time_str, 0, 65535); - ret = peer_timers_connect_set (peer, connect); - - return CMD_SUCCESS; + return bgp_vty_return (vty, peer_timers_connect_set (peer, connect)); } static int peer_timers_connect_unset_vty (struct vty *vty, const char *ip_str) { - int ret; struct peer *peer; peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) return CMD_WARNING; - ret = peer_timers_connect_unset (peer); - - return CMD_SUCCESS; + return bgp_vty_return (vty, peer_timers_connect_unset (peer)); } DEFUN (neighbor_timers_connect, neighbor_timers_connect_cmd, - NEIGHBOR_CMD "timers connect <0-65535>", + NEIGHBOR_CMD2 "timers connect <1-65535>", NEIGHBOR_STR - NEIGHBOR_ADDR_STR + NEIGHBOR_ADDR_STR2 "BGP per neighbor timers\n" "BGP connect timer\n" "Connect timer\n") @@ -3367,10 +3465,10 @@ DEFUN (neighbor_timers_connect, DEFUN (no_neighbor_timers_connect, no_neighbor_timers_connect_cmd, - NO_NEIGHBOR_CMD "timers connect", + NO_NEIGHBOR_CMD2 "timers connect", NO_STR NEIGHBOR_STR - NEIGHBOR_ADDR_STR + NEIGHBOR_ADDR_STR2 "BGP per neighbor timers\n" "BGP connect timer\n") { @@ -3379,14 +3477,14 @@ DEFUN (no_neighbor_timers_connect, ALIAS (no_neighbor_timers_connect, no_neighbor_timers_connect_val_cmd, - NO_NEIGHBOR_CMD "timers connect <0-65535>", + NO_NEIGHBOR_CMD2 "timers connect <1-65535>", NO_STR NEIGHBOR_STR - NEIGHBOR_ADDR_STR + NEIGHBOR_ADDR_STR2 "BGP per neighbor timers\n" "BGP connect timer\n" "Connect timer\n") - + static int peer_advertise_interval_vty (struct vty *vty, const char *ip_str, const char *time_str, int set) @@ -3395,7 +3493,7 @@ peer_advertise_interval_vty (struct vty *vty, const ch struct peer *peer; u_int32_t routeadv = 0; - peer = peer_lookup_vty (vty, ip_str); + peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) return CMD_WARNING; @@ -3407,14 +3505,14 @@ peer_advertise_interval_vty (struct vty *vty, const ch else ret = peer_advertise_interval_unset (peer); - return CMD_SUCCESS; + return bgp_vty_return (vty, ret); } DEFUN (neighbor_advertise_interval, neighbor_advertise_interval_cmd, - NEIGHBOR_CMD "advertisement-interval <0-600>", + NEIGHBOR_CMD2 "advertisement-interval <0-600>", NEIGHBOR_STR - NEIGHBOR_ADDR_STR + NEIGHBOR_ADDR_STR2 "Minimum interval between sending BGP routing updates\n" "time in seconds\n") { @@ -3423,10 +3521,10 @@ DEFUN (neighbor_advertise_interval, DEFUN (no_neighbor_advertise_interval, no_neighbor_advertise_interval_cmd, - NO_NEIGHBOR_CMD "advertisement-interval", + NO_NEIGHBOR_CMD2 "advertisement-interval", NO_STR NEIGHBOR_STR - NEIGHBOR_ADDR_STR + NEIGHBOR_ADDR_STR2 "Minimum interval between sending BGP routing updates\n") { return peer_advertise_interval_vty (vty, argv[0], NULL, 0); @@ -3434,13 +3532,13 @@ DEFUN (no_neighbor_advertise_interval, ALIAS (no_neighbor_advertise_interval, no_neighbor_advertise_interval_val_cmd, - NO_NEIGHBOR_CMD "advertisement-interval <0-600>", + NO_NEIGHBOR_CMD2 "advertisement-interval <0-600>", NO_STR NEIGHBOR_STR - NEIGHBOR_ADDR_STR + NEIGHBOR_ADDR_STR2 "Minimum interval between sending BGP routing updates\n" "time in seconds\n") - + /* neighbor interface */ static int peer_interface_vty (struct vty *vty, const char *ip_str, const char *str) @@ -3457,7 +3555,7 @@ peer_interface_vty (struct vty *vty, const char *ip_st else ret = peer_interface_unset (peer); - return CMD_SUCCESS; + return bgp_vty_return (vty, ret); } DEFUN (neighbor_interface, @@ -3482,7 +3580,7 @@ DEFUN (no_neighbor_interface, { return peer_interface_vty (vty, argv[0], NULL); } - + /* Set distribute list to the peer. */ static int peer_distribute_set_vty (struct vty *vty, const char *ip_str, @@ -3563,7 +3661,7 @@ DEFUN (no_neighbor_distribute_list, return peer_distribute_unset_vty (vty, argv[0], bgp_node_afi (vty), bgp_node_safi (vty), argv[2]); } - + /* Set prefix list to the peer. */ static int peer_prefix_list_set_vty (struct vty *vty, const char *ip_str, afi_t afi, @@ -3640,7 +3738,7 @@ DEFUN (no_neighbor_prefix_list, return peer_prefix_list_unset_vty (vty, argv[0], bgp_node_afi (vty), bgp_node_safi (vty), argv[2]); } - + static int peer_aslist_set_vty (struct vty *vty, const char *ip_str, afi_t afi, safi_t safi, @@ -3717,7 +3815,7 @@ DEFUN (no_neighbor_filter_list, return peer_aslist_unset_vty (vty, argv[0], bgp_node_afi (vty), bgp_node_safi (vty), argv[2]); } - + /* Set route-map to the peer. */ static int peer_route_map_set_vty (struct vty *vty, const char *ip_str, @@ -3806,7 +3904,7 @@ DEFUN (no_neighbor_route_map, return peer_route_map_unset_vty (vty, argv[0], bgp_node_afi (vty), bgp_node_safi (vty), argv[2]); } - + /* Set unsuppress-map to the peer. */ static int peer_unsuppress_map_set_vty (struct vty *vty, const char *ip_str, afi_t afi, @@ -3865,7 +3963,7 @@ DEFUN (no_neighbor_unsuppress_map, return peer_unsuppress_map_unset_vty (vty, argv[0], bgp_node_afi (vty), bgp_node_safi (vty)); } - + static int peer_maximum_prefix_set_vty (struct vty *vty, const char *ip_str, afi_t afi, safi_t safi, const char *num_str, @@ -4075,7 +4173,7 @@ ALIAS (no_neighbor_maximum_prefix, "Threshold value (%) at which to generate a warning msg\n" "Restart bgp connection after limit is exceeded\n" "Restart interval in minutes") - + /* "neighbor allowas-in" */ DEFUN (neighbor_allowas_in, neighbor_allowas_in_cmd, @@ -4130,7 +4228,7 @@ DEFUN (no_neighbor_allowas_in, return bgp_vty_return (vty, ret); } - + DEFUN (neighbor_ttl_security, neighbor_ttl_security_cmd, NEIGHBOR_CMD2 "ttl-security hops <1-254>", @@ -4166,7 +4264,7 @@ DEFUN (no_neighbor_ttl_security, return bgp_vty_return (vty, peer_ttl_security_hops_unset (peer)); } - + /* Address family configuration. */ DEFUN (address_family_ipv4, address_family_ipv4_cmd, @@ -4237,20 +4335,67 @@ ALIAS (address_family_vpnv4, "Address family\n" "Address Family Modifier\n") +DEFUN (address_family_vpnv6, + address_family_vpnv6_cmd, + "address-family vpnv6", + "Enter Address Family command mode\n" + "Address family\n") +{ + vty->node = BGP_VPNV6_NODE; + return CMD_SUCCESS; +} + +ALIAS (address_family_vpnv6, + address_family_vpnv6_unicast_cmd, + "address-family vpnv6 unicast", + "Enter Address Family command mode\n" + "Address family\n" + "Address Family Modifier\n") + +DEFUN (address_family_encap, + address_family_encap_cmd, + "address-family encap", + "Enter Address Family command mode\n" + "Address family\n") +{ + vty->node = BGP_ENCAP_NODE; + return CMD_SUCCESS; +} + +ALIAS (address_family_encap, + address_family_encapv4_cmd, + "address-family encapv4", + "Enter Address Family command mode\n" + "Address family\n") + +DEFUN (address_family_encapv6, + address_family_encapv6_cmd, + "address-family encapv6", + "Enter Address Family command mode\n" + "Address family\n") +{ + vty->node = BGP_ENCAPV6_NODE; + return CMD_SUCCESS; +} + DEFUN (exit_address_family, exit_address_family_cmd, "exit-address-family", "Exit from Address Family configuration mode\n") { + /* should match list in command.c:config_exit */ if (vty->node == BGP_IPV4_NODE + || vty->node == BGP_ENCAP_NODE + || vty->node == BGP_ENCAPV6_NODE || vty->node == BGP_IPV4M_NODE || vty->node == BGP_VPNV4_NODE + || vty->node == BGP_VPNV6_NODE || vty->node == BGP_IPV6_NODE || vty->node == BGP_IPV6M_NODE) vty->node = BGP_NODE; return CMD_SUCCESS; } - + /* BGP clear sort. */ enum clear_sort { @@ -4604,7 +4749,7 @@ ALIAS (clear_ip_bgp_as, BGP_STR "Address family\n" "Clear peers with the AS number\n") - + /* Outbound soft-reconfiguration */ DEFUN (clear_ip_bgp_all_soft_out, clear_ip_bgp_all_soft_out_cmd, @@ -4727,6 +4872,33 @@ ALIAS (clear_ip_bgp_all_vpnv4_soft_out, "Address Family Modifier\n" "Soft reconfig outbound update\n") +DEFUN (clear_ip_bgp_all_encap_soft_out, + clear_ip_bgp_all_encap_soft_out_cmd, + "clear ip bgp * encap unicast soft out", + CLEAR_STR + IP_STR + BGP_STR + "Clear all peers\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig\n" + "Soft reconfig outbound update\n") +{ + return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all, + BGP_CLEAR_SOFT_OUT, NULL); +} + +ALIAS (clear_ip_bgp_all_encap_soft_out, + clear_ip_bgp_all_encap_out_cmd, + "clear ip bgp * encap unicast out", + CLEAR_STR + IP_STR + BGP_STR + "Clear all peers\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig outbound update\n") + DEFUN (clear_bgp_all_soft_out, clear_bgp_all_soft_out_cmd, "clear bgp * soft out", @@ -4865,6 +5037,33 @@ ALIAS (clear_ip_bgp_peer_vpnv4_soft_out, "Address Family Modifier\n" "Soft reconfig outbound update\n") +DEFUN (clear_ip_bgp_peer_encap_soft_out, + clear_ip_bgp_peer_encap_soft_out_cmd, + "clear ip bgp A.B.C.D encap unicast soft out", + CLEAR_STR + IP_STR + BGP_STR + "BGP neighbor address to clear\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig\n" + "Soft reconfig outbound update\n") +{ + return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer, + BGP_CLEAR_SOFT_OUT, argv[0]); +} + +ALIAS (clear_ip_bgp_peer_encap_soft_out, + clear_ip_bgp_peer_encap_out_cmd, + "clear ip bgp A.B.C.D encap unicast out", + CLEAR_STR + IP_STR + BGP_STR + "BGP neighbor address to clear\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig outbound update\n") + DEFUN (clear_bgp_peer_soft_out, clear_bgp_peer_soft_out_cmd, "clear bgp (A.B.C.D|X:X::X:X) soft out", @@ -5192,6 +5391,33 @@ ALIAS (clear_ip_bgp_as_vpnv4_soft_out, "Address Family modifier\n" "Soft reconfig outbound update\n") +DEFUN (clear_ip_bgp_as_encap_soft_out, + clear_ip_bgp_as_encap_soft_out_cmd, + "clear ip bgp " CMD_AS_RANGE " encap unicast soft out", + CLEAR_STR + IP_STR + BGP_STR + "Clear peers with the AS number\n" + "Address family\n" + "Address Family modifier\n" + "Soft reconfig\n" + "Soft reconfig outbound update\n") +{ + return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as, + BGP_CLEAR_SOFT_OUT, argv[0]); +} + +ALIAS (clear_ip_bgp_as_encap_soft_out, + clear_ip_bgp_as_encap_out_cmd, + "clear ip bgp " CMD_AS_RANGE " encap unicast out", + CLEAR_STR + IP_STR + BGP_STR + "Clear peers with the AS number\n" + "Address family\n" + "Address Family modifier\n" + "Soft reconfig outbound update\n") + DEFUN (clear_bgp_as_soft_out, clear_bgp_as_soft_out_cmd, "clear bgp " CMD_AS_RANGE " soft out", @@ -5231,7 +5457,7 @@ ALIAS (clear_bgp_as_soft_out, "Address family\n" "Clear peers with the AS number\n" "Soft reconfig outbound update\n") - + /* Inbound soft-reconfiguration */ DEFUN (clear_ip_bgp_all_soft_in, clear_ip_bgp_all_soft_in_cmd, @@ -5428,6 +5654,33 @@ ALIAS (clear_ip_bgp_all_vpnv4_soft_in, "Address Family Modifier\n" "Soft reconfig inbound update\n") +DEFUN (clear_ip_bgp_all_encap_soft_in, + clear_ip_bgp_all_encap_soft_in_cmd, + "clear ip bgp * encap unicast soft in", + CLEAR_STR + IP_STR + BGP_STR + "Clear all peers\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig\n" + "Soft reconfig inbound update\n") +{ + return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all, + BGP_CLEAR_SOFT_IN, NULL); +} + +ALIAS (clear_ip_bgp_all_encap_soft_in, + clear_ip_bgp_all_encap_in_cmd, + "clear ip bgp * encap unicast in", + CLEAR_STR + IP_STR + BGP_STR + "Clear all peers\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig inbound update\n") + DEFUN (clear_bgp_all_soft_in, clear_bgp_all_soft_in_cmd, "clear bgp * soft in", @@ -5624,6 +5877,33 @@ ALIAS (clear_ip_bgp_peer_vpnv4_soft_in, "Address Family Modifier\n" "Soft reconfig inbound update\n") +DEFUN (clear_ip_bgp_peer_encap_soft_in, + clear_ip_bgp_peer_encap_soft_in_cmd, + "clear ip bgp A.B.C.D encap unicast soft in", + CLEAR_STR + IP_STR + BGP_STR + "BGP neighbor address to clear\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig\n" + "Soft reconfig inbound update\n") +{ + return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer, + BGP_CLEAR_SOFT_IN, argv[0]); +} + +ALIAS (clear_ip_bgp_peer_encap_soft_in, + clear_ip_bgp_peer_encap_in_cmd, + "clear ip bgp A.B.C.D encap unicast in", + CLEAR_STR + IP_STR + BGP_STR + "BGP neighbor address to clear\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig inbound update\n") + DEFUN (clear_bgp_peer_soft_in, clear_bgp_peer_soft_in_cmd, "clear bgp (A.B.C.D|X:X::X:X) soft in", @@ -6131,6 +6411,33 @@ ALIAS (clear_ip_bgp_as_vpnv4_soft_in, "Address Family modifier\n" "Soft reconfig inbound update\n") +DEFUN (clear_ip_bgp_as_encap_soft_in, + clear_ip_bgp_as_encap_soft_in_cmd, + "clear ip bgp " CMD_AS_RANGE " encap unicast soft in", + CLEAR_STR + IP_STR + BGP_STR + "Clear peers with the AS number\n" + "Address family\n" + "Address Family modifier\n" + "Soft reconfig\n" + "Soft reconfig inbound update\n") +{ + return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as, + BGP_CLEAR_SOFT_IN, argv[0]); +} + +ALIAS (clear_ip_bgp_as_encap_soft_in, + clear_ip_bgp_as_encap_in_cmd, + "clear ip bgp " CMD_AS_RANGE " encap unicast in", + CLEAR_STR + IP_STR + BGP_STR + "Clear peers with the AS number\n" + "Address family\n" + "Address Family modifier\n" + "Soft reconfig inbound update\n") + DEFUN (clear_bgp_as_soft_in, clear_bgp_as_soft_in_cmd, "clear bgp " CMD_AS_RANGE " soft in", @@ -6193,7 +6500,7 @@ ALIAS (clear_bgp_as_in_prefix_filter, "Clear peers with the AS number\n" "Soft reconfig inbound update\n" "Push out prefix-list ORF and do inbound soft reconfig\n") - + /* Both soft-reconfiguration */ DEFUN (clear_ip_bgp_all_soft, clear_ip_bgp_all_soft_cmd, @@ -6281,6 +6588,21 @@ DEFUN (clear_ip_bgp_all_vpnv4_soft, BGP_CLEAR_SOFT_BOTH, argv[0]); } +DEFUN (clear_ip_bgp_all_encap_soft, + clear_ip_bgp_all_encap_soft_cmd, + "clear ip bgp * encap unicast soft", + CLEAR_STR + IP_STR + BGP_STR + "Clear all peers\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig\n") +{ + return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all, + BGP_CLEAR_SOFT_BOTH, argv[0]); +} + DEFUN (clear_bgp_all_soft, clear_bgp_all_soft_cmd, "clear bgp * soft", @@ -6364,6 +6686,21 @@ DEFUN (clear_ip_bgp_peer_vpnv4_soft, BGP_CLEAR_SOFT_BOTH, argv[0]); } +DEFUN (clear_ip_bgp_peer_encap_soft, + clear_ip_bgp_peer_encap_soft_cmd, + "clear ip bgp A.B.C.D encap unicast soft", + CLEAR_STR + IP_STR + BGP_STR + "BGP neighbor address to clear\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig\n") +{ + return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer, + BGP_CLEAR_SOFT_BOTH, argv[0]); +} + DEFUN (clear_bgp_peer_soft, clear_bgp_peer_soft_cmd, "clear bgp (A.B.C.D|X:X::X:X) soft", @@ -6547,6 +6884,21 @@ DEFUN (clear_ip_bgp_as_vpnv4_soft, BGP_CLEAR_SOFT_BOTH, argv[0]); } +DEFUN (clear_ip_bgp_as_encap_soft, + clear_ip_bgp_as_encap_soft_cmd, + "clear ip bgp " CMD_AS_RANGE " encap unicast soft", + CLEAR_STR + IP_STR + BGP_STR + "Clear peers with the AS number\n" + "Address family\n" + "Address Family Modifier\n" + "Soft reconfig\n") +{ + return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as, + BGP_CLEAR_SOFT_BOTH, argv[0]); +} + DEFUN (clear_bgp_as_soft, clear_bgp_as_soft_cmd, "clear bgp " CMD_AS_RANGE " soft", @@ -6567,9 +6919,8 @@ ALIAS (clear_bgp_as_soft, "Address family\n" "Clear peers with the AS number\n" "Soft reconfig\n") - + /* RS-client soft reconfiguration. */ -#ifdef HAVE_IPV6 DEFUN (clear_bgp_all_rsclient, clear_bgp_all_rsclient_cmd, "clear bgp * rsclient", @@ -6615,7 +6966,6 @@ ALIAS (clear_bgp_all_rsclient, "view name\n" "Clear all peers\n" "Soft reconfig for rsclient RIB\n") -#endif /* HAVE_IPV6 */ DEFUN (clear_ip_bgp_all_rsclient, clear_ip_bgp_all_rsclient_cmd, @@ -6645,7 +6995,6 @@ ALIAS (clear_ip_bgp_all_rsclient, "Clear all peers\n" "Soft reconfig for rsclient RIB\n") -#ifdef HAVE_IPV6 DEFUN (clear_bgp_peer_rsclient, clear_bgp_peer_rsclient_cmd, "clear bgp (A.B.C.D|X:X::X:X) rsclient", @@ -6695,7 +7044,6 @@ ALIAS (clear_bgp_peer_rsclient, "BGP neighbor IP address to clear\n" "BGP IPv6 neighbor to clear\n" "Soft reconfig for rsclient RIB\n") -#endif /* HAVE_IPV6 */ DEFUN (clear_ip_bgp_peer_rsclient, clear_ip_bgp_peer_rsclient_cmd, @@ -6900,7 +7248,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, in int len; /* Header string for each address family. */ - static char header[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd"; + static char header[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd"; for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) { @@ -7069,16 +7417,6 @@ DEFUN (show_ip_bgp_ipv4_summary, return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); } -ALIAS (show_ip_bgp_ipv4_summary, - show_bgp_ipv4_safi_summary_cmd, - "show bgp ipv4 (unicast|multicast) summary", - SHOW_STR - BGP_STR - "Address family\n" - "Address Family modifier\n" - "Address Family modifier\n" - "Summary of BGP neighbor status\n") - DEFUN (show_ip_bgp_instance_ipv4_summary, show_ip_bgp_instance_ipv4_summary_cmd, "show ip bgp view WORD ipv4 (unicast|multicast) summary", @@ -7098,18 +7436,6 @@ DEFUN (show_ip_bgp_instance_ipv4_summary, return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); } -ALIAS (show_ip_bgp_instance_ipv4_summary, - show_bgp_instance_ipv4_safi_summary_cmd, - "show bgp view WORD ipv4 (unicast|multicast) summary", - SHOW_STR - BGP_STR - "BGP view\n" - "View name\n" - "Address family\n" - "Address Family modifier\n" - "Address Family modifier\n" - "Summary of BGP neighbor status\n") - DEFUN (show_ip_bgp_vpnv4_all_summary, show_ip_bgp_vpnv4_all_summary_cmd, "show ip bgp vpnv4 all summary", @@ -7147,17 +7473,89 @@ DEFUN (show_ip_bgp_vpnv4_rd_summary, return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); } -#ifdef HAVE_IPV6 -DEFUN (show_bgp_summary, - show_bgp_summary_cmd, - "show bgp summary", +DEFUN (show_bgp_ipv4_safi_summary, + show_bgp_ipv4_safi_summary_cmd, + "show bgp ipv4 (unicast|multicast) summary", SHOW_STR BGP_STR + "Address family\n" + "Address Family modifier\n" + "Address Family modifier\n" "Summary of BGP neighbor status\n") { - return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); + if (strncmp (argv[0], "m", 1) == 0) + return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); + + return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); } +DEFUN (show_bgp_instance_ipv4_safi_summary, + show_bgp_instance_ipv4_safi_summary_cmd, + "show bgp view WORD ipv4 (unicast|multicast) summary", + SHOW_STR + BGP_STR + "BGP view\n" + "View name\n" + "Address family\n" + "Address Family modifier\n" + "Address Family modifier\n" + "Summary of BGP neighbor status\n") +{ + if (strncmp (argv[1], "m", 1) == 0) + return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); + else + return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); +} + +DEFUN (show_bgp_ipv4_vpn_summary, + show_bgp_ipv4_vpn_summary_cmd, + "show bgp ipv4 vpn summary", + SHOW_STR + BGP_STR + "IPv4\n" + "Display VPN NLRI specific information\n" + "Summary of BGP neighbor status\n") +{ + return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); +} + +/* `show ip bgp summary' commands. */ +DEFUN (show_bgp_ipv6_vpn_summary, + show_bgp_ipv6_vpn_summary_cmd, + "show bgp ipv6 vpn summary", + SHOW_STR + BGP_STR + "IPv6\n" + "Display VPN NLRI specific information\n" + "Summary of BGP neighbor status\n") +{ + return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); +} + +DEFUN (show_bgp_ipv4_encap_summary, + show_bgp_ipv4_encap_summary_cmd, + "show bgp ipv4 encap summary", + SHOW_STR + BGP_STR + "IPv4\n" + "Display ENCAP NLRI specific information\n" + "Summary of BGP neighbor status\n") +{ + return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); +} + +DEFUN (show_bgp_ipv6_encap_summary, + show_bgp_ipv6_encap_summary_cmd, + "show bgp ipv6 encap summary", + SHOW_STR + BGP_STR + "IPv6\n" + "Display ENCAP NLRI specific information\n" + "Summary of BGP neighbor status\n") +{ + return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); +} + DEFUN (show_bgp_instance_summary, show_bgp_instance_summary_cmd, "show bgp view WORD summary", @@ -7167,27 +7565,91 @@ DEFUN (show_bgp_instance_summary, "View name\n" "Summary of BGP neighbor status\n") { - return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); + vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); + vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP); + + vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); + vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); + + return CMD_SUCCESS; } -ALIAS (show_bgp_summary, - show_bgp_ipv6_summary_cmd, - "show bgp ipv6 summary", +DEFUN (show_bgp_instance_ipv4_summary, + show_bgp_instance_ipv4_summary_cmd, + "show bgp view WORD ipv4 summary", SHOW_STR BGP_STR - "Address family\n" + IP_STR + "Address Family modifier\n" + "Address Family modifier\n" + "BGP view\n" + "View name\n" "Summary of BGP neighbor status\n") +{ + vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); + vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); + vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP); -ALIAS (show_bgp_instance_summary, + return CMD_SUCCESS; +} + +DEFUN (show_bgp_instance_ipv6_summary, show_bgp_instance_ipv6_summary_cmd, "show bgp view WORD ipv6 summary", SHOW_STR BGP_STR + IPV6_STR + "Address Family modifier\n" + "Address Family modifier\n" "BGP view\n" "View name\n" - "Address family\n" "Summary of BGP neighbor status\n") +{ + vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); + vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); + return CMD_SUCCESS; +} + DEFUN (show_bgp_ipv6_safi_summary, show_bgp_ipv6_safi_summary_cmd, "show bgp ipv6 (unicast|multicast) summary", @@ -7245,8 +7707,145 @@ DEFUN (show_ipv6_mbgp_summary, { return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); } -#endif /* HAVE_IPV6 */ - + +/* variations of show bgp [...] summary */ + +/* This one is for the 0-keyword variant */ +DEFUN (show_bgp_summary, + show_bgp_summary_cmd, + "show bgp summary", + SHOW_STR + BGP_STR + "Summary of BGP neighbor status\n") +{ + vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); + vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); + vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); + + vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); + vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); + + return CMD_SUCCESS; +} + +ALIAS (show_bgp_summary, + show_bgp_ipv6_summary_cmd, + "show bgp ipv6 summary", + SHOW_STR + BGP_STR + "Address family\n" + "Summary of BGP neighbor status\n") + +DEFUN (show_bgp_summary_1w, + show_bgp_summary_1w_cmd, + "show bgp (ipv4|ipv6|unicast|multicast|vpn|encap) summary", + SHOW_STR + BGP_STR + IP_STR + IP6_STR + "Address Family modifier\n" + "Address Family modifier\n" + "Address Family modifier\n" + "Address Family modifier\n" + "Summary of BGP neighbor status\n") +{ + if (strcmp (argv[0], "ipv4") == 0) { + vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); + vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); + vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); + return CMD_SUCCESS; + } + + if (strcmp (argv[0], "ipv6") == 0) { + vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); + vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); + return CMD_SUCCESS; + } + + if (strcmp (argv[0], "unicast") == 0) { + vty_out(vty, "IPv4 Unicast Summary:%s", VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); + vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "IPv6 Unicast Summary:%s", VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); + return CMD_SUCCESS; + } + if (strcmp (argv[0], "multicast") == 0) { + vty_out(vty, "IPv4 Multicast Summary:%s", VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); + vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "IPv6 Multicast Summary:%s", VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); + return CMD_SUCCESS; + } + if (strcmp (argv[0], "vpn") == 0) { + vty_out(vty, "IPv4 VPN Summary:%s", VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); + vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "IPv6 VPN Summary:%s", VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); + return CMD_SUCCESS; + } + if (strcmp (argv[0], "encap") == 0) { + vty_out(vty, "IPv4 Encap Summary:%s", VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); + vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "IPv6 Encap Summary:%s", VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); + return CMD_SUCCESS; + } + vty_out(vty, "Unknown keyword: %s%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; +} + + + const char * afi_safi_print (afi_t afi, safi_t safi) { @@ -7255,11 +7854,17 @@ afi_safi_print (afi_t afi, safi_t safi) else if (afi == AFI_IP && safi == SAFI_MULTICAST) return "IPv4 Multicast"; else if (afi == AFI_IP && safi == SAFI_MPLS_VPN) - return "VPNv4 Unicast"; + return "VPN-IPv4 Unicast"; + else if (afi == AFI_IP && safi == SAFI_ENCAP) + return "ENCAP-IPv4 Unicast"; else if (afi == AFI_IP6 && safi == SAFI_UNICAST) return "IPv6 Unicast"; else if (afi == AFI_IP6 && safi == SAFI_MULTICAST) return "IPv6 Multicast"; + else if (afi == AFI_IP6 && safi == SAFI_MPLS_VPN) + return "VPN-IPv6 Unicast"; + else if (afi == AFI_IP6 && safi == SAFI_ENCAP) + return "ENCAP-IPv6 Unicast"; else return "Unknown"; } @@ -7597,12 +8202,16 @@ bgp_show_peer (struct vty *vty, struct peer *p) || p->afc_recv[AFI_IP][SAFI_UNICAST] || p->afc_adv[AFI_IP][SAFI_MULTICAST] || p->afc_recv[AFI_IP][SAFI_MULTICAST] -#ifdef HAVE_IPV6 || p->afc_adv[AFI_IP6][SAFI_UNICAST] || p->afc_recv[AFI_IP6][SAFI_UNICAST] || p->afc_adv[AFI_IP6][SAFI_MULTICAST] || p->afc_recv[AFI_IP6][SAFI_MULTICAST] -#endif /* HAVE_IPV6 */ + || p->afc_adv[AFI_IP6][SAFI_MPLS_VPN] + || p->afc_recv[AFI_IP6][SAFI_MPLS_VPN] + || p->afc_adv[AFI_IP6][SAFI_ENCAP] + || p->afc_recv[AFI_IP6][SAFI_ENCAP] + || p->afc_adv[AFI_IP][SAFI_ENCAP] + || p->afc_recv[AFI_IP][SAFI_ENCAP] || p->afc_adv[AFI_IP][SAFI_MPLS_VPN] || p->afc_recv[AFI_IP][SAFI_MPLS_VPN]) { @@ -7825,6 +8434,12 @@ bgp_show_peer (struct vty *vty, struct peer *p) vty_out (vty, " External BGP neighbor may be up to %d hops away.%s", p->ttl, VTY_NEWLINE); } + else + { + if (p->gtsm_hops > 0) + vty_out (vty, " Internal BGP neighbor may be up to %d hops away.%s", + p->gtsm_hops, VTY_NEWLINE); + } /* Local address. */ if (p->su_local) @@ -7850,7 +8465,6 @@ bgp_show_peer (struct vty *vty, struct peer *p) vty_out (vty, "Nexthop: %s%s", inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ), VTY_NEWLINE); -#ifdef HAVE_IPV6 vty_out (vty, "Nexthop global: %s%s", inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ), VTY_NEWLINE); @@ -7860,9 +8474,13 @@ bgp_show_peer (struct vty *vty, struct peer *p) vty_out (vty, "BGP connection: %s%s", p->shared_network ? "shared network" : "non shared network", VTY_NEWLINE); -#endif /* HAVE_IPV6 */ } + /* TCP metrics. */ + if (p->status == Established && p->rtt) + vty_out (vty, "Estimated round trip time: %d ms%s", + p->rtt, VTY_NEWLINE); + /* Timer information. */ if (p->t_start) vty_out (vty, "Next start timer due in %ld seconds%s", @@ -7955,8 +8573,7 @@ bgp_show_neighbor_vty (struct vty *vty, const char *na return CMD_SUCCESS; } -/* "show ip bgp neighbors" commands. */ -DEFUN (show_ip_bgp_neighbors, +/* "show ip bgp neighbors" commands. */DEFUN (show_ip_bgp_neighbors, show_ip_bgp_neighbors_cmd, "show ip bgp neighbors", SHOW_STR @@ -8000,13 +8617,6 @@ ALIAS (show_ip_bgp_neighbors, "Detailed information on TCP and BGP neighbor connections\n") ALIAS (show_ip_bgp_neighbors, - show_bgp_neighbors_cmd, - "show bgp neighbors", - SHOW_STR - BGP_STR - "Detailed information on TCP and BGP neighbor connections\n") - -ALIAS (show_ip_bgp_neighbors, show_bgp_ipv6_neighbors_cmd, "show bgp ipv6 neighbors", SHOW_STR @@ -8063,15 +8673,6 @@ ALIAS (show_ip_bgp_neighbors_peer, "Neighbor to display information about\n") ALIAS (show_ip_bgp_neighbors_peer, - show_bgp_neighbors_peer_cmd, - "show bgp neighbors (A.B.C.D|X:X::X:X)", - SHOW_STR - BGP_STR - "Detailed information on TCP and BGP neighbor connections\n" - "Neighbor to display information about\n" - "Neighbor to display information about\n") - -ALIAS (show_ip_bgp_neighbors_peer, show_bgp_ipv6_neighbors_peer_cmd, "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)", SHOW_STR @@ -8095,15 +8696,6 @@ DEFUN (show_ip_bgp_instance_neighbors, } ALIAS (show_ip_bgp_instance_neighbors, - show_bgp_instance_neighbors_cmd, - "show bgp view WORD neighbors", - SHOW_STR - BGP_STR - "BGP view\n" - "View name\n" - "Detailed information on TCP and BGP neighbor connections\n") - -ALIAS (show_ip_bgp_instance_neighbors, show_bgp_instance_ipv6_neighbors_cmd, "show bgp view WORD ipv6 neighbors", SHOW_STR @@ -8128,29 +8720,6 @@ DEFUN (show_ip_bgp_instance_neighbors_peer, return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]); } -ALIAS (show_ip_bgp_instance_neighbors_peer, - show_bgp_instance_neighbors_peer_cmd, - "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)", - SHOW_STR - BGP_STR - "BGP view\n" - "View name\n" - "Detailed information on TCP and BGP neighbor connections\n" - "Neighbor to display information about\n" - "Neighbor to display information about\n") - -ALIAS (show_ip_bgp_instance_neighbors_peer, - show_bgp_instance_ipv6_neighbors_peer_cmd, - "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)", - SHOW_STR - BGP_STR - "BGP view\n" - "View name\n" - "Address family\n" - "Detailed information on TCP and BGP neighbor connections\n" - "Neighbor to display information about\n" - "Neighbor to display information about\n") - /* Show BGP's AS paths internal data. There are both `show ip bgp paths' and `show ip mbgp paths'. Those functions results are the same.*/ @@ -8183,7 +8752,82 @@ DEFUN (show_ip_bgp_ipv4_paths, return CMD_SUCCESS; } - + +DEFUN (show_bgp_neighbors, + show_bgp_neighbors_cmd, + "show bgp neighbors", + SHOW_STR + BGP_STR + "Detailed information on TCP and BGP neighbor connections\n") +{ + return bgp_show_neighbor_vty (vty, NULL, show_all, NULL); +} + +DEFUN (show_bgp_neighbors_peer, + show_bgp_neighbors_peer_cmd, + "show bgp neighbors (A.B.C.D|X:X::X:X)", + SHOW_STR + BGP_STR + "Detailed information on TCP and BGP neighbor connections\n" + "Neighbor to display information about\n" + "Neighbor to display information about\n") +{ + return bgp_show_neighbor_vty (vty, NULL, show_peer, argv[argc - 1]); +} + +DEFUN (show_bgp_instance_neighbors, + show_bgp_instance_neighbors_cmd, + "show bgp view WORD neighbors", + SHOW_STR + BGP_STR + "BGP view\n" + "View name\n" + "Detailed information on TCP and BGP neighbor connections\n") +{ + return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL); +} + +DEFUN (show_bgp_instance_neighbors_peer, + show_bgp_instance_neighbors_peer_cmd, + "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)", + SHOW_STR + BGP_STR + "BGP view\n" + "View name\n" + "Detailed information on TCP and BGP neighbor connections\n" + "Neighbor to display information about\n" + "Neighbor to display information about\n") +{ + return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]); +} + +ALIAS (show_bgp_instance_neighbors_peer, + show_bgp_instance_ipv6_neighbors_peer_cmd, + "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)", + SHOW_STR + BGP_STR + "BGP view\n" + "View name\n" + "Address family\n" + "Detailed information on TCP and BGP neighbor connections\n" + "Neighbor to display information about\n" + "Neighbor to display information about\n") + +/* Show BGP's AS paths internal data. There are both `show ip bgp + paths' and `show ip mbgp paths'. Those functions results are the + same.*/ +DEFUN (show_bgp_ipv4_paths, + show_bgp_ipv4_paths_cmd, + "show bgp paths", + SHOW_STR + BGP_STR + "Path information\n") +{ + vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE); + aspath_print_all_vty (vty); + return CMD_SUCCESS; +} + #include "hash.h" static void @@ -8192,7 +8836,7 @@ community_show_all_iterator (struct hash_backet *backe struct community *com; com = (struct community *) backet->data; - vty_out (vty, "[%p] (%ld) %s%s", backet, com->refcnt, + vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, com->refcnt, community_str (com), VTY_NEWLINE); } @@ -8226,7 +8870,7 @@ DEFUN (show_ip_bgp_attr_info, attr_show_all (vty); return CMD_SUCCESS; } - + static int bgp_write_rsclient_summary (struct vty *vty, struct peer *rsclient, afi_t afi, safi_t safi) @@ -8259,7 +8903,7 @@ bgp_write_rsclient_summary (struct vty *vty, struct pe vty_out (vty, "4 "); - vty_out (vty, "%11d ", rsclient->as); + vty_out (vty, "%10u ", rsclient->as); rmname = ROUTE_MAP_EXPORT_NAME(&rsclient->filter[afi][safi]); if ( rmname && strlen (rmname) > 13 ) @@ -8304,7 +8948,7 @@ bgp_show_rsclient_summary (struct vty *vty, struct bgp int count = 0; /* Header string for each address family. */ - static char header[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State"; + static char header[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State"; for (ALL_LIST_ELEMENTS (bgp->rsclient, node, nnode, peer)) { @@ -8466,7 +9110,6 @@ ALIAS (show_bgp_instance_ipv4_safi_rsclient_summary, "Information about Route Server Clients\n" "Summary of all Route Server Clients\n") -#ifdef HAVE_IPV6 DEFUN (show_bgp_rsclient_summary, show_bgp_rsclient_summary_cmd, "show bgp rsclient summary", @@ -8475,7 +9118,33 @@ DEFUN (show_bgp_rsclient_summary, "Information about Route Server Clients\n" "Summary of all Route Server Clients\n") { - return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); + vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); + vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); + + vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); + vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); + + return CMD_SUCCESS; } DEFUN (show_bgp_instance_rsclient_summary, @@ -8488,10 +9157,36 @@ DEFUN (show_bgp_instance_rsclient_summary, "Information about Route Server Clients\n" "Summary of all Route Server Clients\n") { - return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); + vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); + vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP); + + vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); + vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); + + return CMD_SUCCESS; } -ALIAS (show_bgp_rsclient_summary, +DEFUN (show_bgp_ipv6_rsclient_summary, show_bgp_ipv6_rsclient_summary_cmd, "show bgp ipv6 rsclient summary", SHOW_STR @@ -8499,8 +9194,24 @@ ALIAS (show_bgp_rsclient_summary, "Address family\n" "Information about Route Server Clients\n" "Summary of all Route Server Clients\n") +{ + vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); + vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); -ALIAS (show_bgp_instance_rsclient_summary, + return CMD_SUCCESS; +} + +DEFUN (show_bgp_instance_ipv6_rsclient_summary, show_bgp_instance_ipv6_rsclient_summary_cmd, "show bgp view WORD ipv6 rsclient summary", SHOW_STR @@ -8510,7 +9221,23 @@ ALIAS (show_bgp_instance_rsclient_summary, "Address family\n" "Information about Route Server Clients\n" "Summary of all Route Server Clients\n") +{ + vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "---------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); + vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); + vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-----------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); + vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); + vty_out(vty, "-------------------%s", VTY_NEWLINE); + bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); + return CMD_SUCCESS; +} + DEFUN (show_bgp_instance_ipv6_safi_rsclient_summary, show_bgp_instance_ipv6_safi_rsclient_summary_cmd, "show bgp view WORD ipv6 (unicast|multicast) rsclient summary", @@ -8540,14 +9267,12 @@ ALIAS (show_bgp_instance_ipv6_safi_rsclient_summary, "show bgp ipv6 (unicast|multicast) rsclient summary", SHOW_STR BGP_STR - "Address family\n" + IPV6_STR "Address Family modifier\n" "Address Family modifier\n" "Information about Route Server Clients\n" "Summary of all Route Server Clients\n") -#endif /* HAVE IPV6 */ - /* Redistribute VTY commands. */ DEFUN (bgp_redistribute_ipv4, @@ -8761,8 +9486,7 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_metric, "Default metric\n" "Route map reference\n" "Pointer to route-map entries\n") - -#ifdef HAVE_IPV6 + DEFUN (bgp_redistribute_ipv6, bgp_redistribute_ipv6_cmd, "redistribute " QUAGGA_IP6_REDIST_STR_BGPD, @@ -8975,8 +9699,7 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_metric, "Default metric\n" "Route map reference\n" "Pointer to route-map entries\n") -#endif /* HAVE_IPV6 */ - + int bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, int *write) @@ -9009,7 +9732,7 @@ bgp_config_write_redistribute (struct vty *vty, struct } return *write; } - + /* BGP node structure. */ static struct cmd_node bgp_node = { @@ -9052,7 +9775,28 @@ static struct cmd_node bgp_vpnv4_node = "%s(config-router-af)# ", 1 }; - + +static struct cmd_node bgp_vpnv6_node = +{ + BGP_VPNV6_NODE, + "%s(config-router-af-vpnv6)# ", + 1 +}; + +static struct cmd_node bgp_encap_node = +{ + BGP_ENCAP_NODE, + "%s(config-router-af-encap)# ", + 1 +}; + +static struct cmd_node bgp_encapv6_node = +{ + BGP_ENCAPV6_NODE, + "%s(config-router-af-encapv6)# ", + 1 +}; + static void community_list_vty (void); void @@ -9065,6 +9809,9 @@ bgp_vty_init (void) install_node (&bgp_ipv6_unicast_node, NULL); install_node (&bgp_ipv6_multicast_node, NULL); install_node (&bgp_vpnv4_node, NULL); + install_node (&bgp_vpnv6_node, NULL); + install_node (&bgp_encap_node, NULL); + install_node (&bgp_encapv6_node, NULL); /* Install default VTY commands to new nodes. */ install_default (BGP_NODE); @@ -9073,6 +9820,9 @@ bgp_vty_init (void) install_default (BGP_IPV6_NODE); install_default (BGP_IPV6M_NODE); install_default (BGP_VPNV4_NODE); + install_default (BGP_VPNV6_NODE); + install_default (BGP_ENCAP_NODE); + install_default (BGP_ENCAPV6_NODE); /* "bgp multiple-instance" commands. */ install_element (CONFIG_NODE, &bgp_multiple_instance_cmd); @@ -9172,6 +9922,10 @@ bgp_vty_init (void) install_element (BGP_NODE, &bgp_bestpath_aspath_confed_cmd); install_element (BGP_NODE, &no_bgp_bestpath_aspath_confed_cmd); + /* "bgp bestpath as-path multipath-relax" commands */ + install_element (BGP_NODE, &bgp_bestpath_aspath_multipath_relax_cmd); + install_element (BGP_NODE, &no_bgp_bestpath_aspath_multipath_relax_cmd); + /* "bgp log-neighbor-changes" commands */ install_element (BGP_NODE, &bgp_log_neighbor_changes_cmd); install_element (BGP_NODE, &no_bgp_log_neighbor_changes_cmd); @@ -9227,6 +9981,9 @@ bgp_vty_init (void) install_element (BGP_IPV6_NODE, &neighbor_activate_cmd); install_element (BGP_IPV6M_NODE, &neighbor_activate_cmd); install_element (BGP_VPNV4_NODE, &neighbor_activate_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_activate_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_activate_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_activate_cmd); /* "no neighbor activate" commands. */ install_element (BGP_NODE, &no_neighbor_activate_cmd); @@ -9235,6 +9992,9 @@ bgp_vty_init (void) install_element (BGP_IPV6_NODE, &no_neighbor_activate_cmd); install_element (BGP_IPV6M_NODE, &no_neighbor_activate_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_activate_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_activate_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_activate_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_activate_cmd); /* "neighbor peer-group set" commands. */ install_element (BGP_NODE, &neighbor_set_peer_group_cmd); @@ -9243,6 +10003,9 @@ bgp_vty_init (void) install_element (BGP_IPV6_NODE, &neighbor_set_peer_group_cmd); install_element (BGP_IPV6M_NODE, &neighbor_set_peer_group_cmd); install_element (BGP_VPNV4_NODE, &neighbor_set_peer_group_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_set_peer_group_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_set_peer_group_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_set_peer_group_cmd); /* "no neighbor peer-group unset" commands. */ install_element (BGP_NODE, &no_neighbor_set_peer_group_cmd); @@ -9251,6 +10014,9 @@ bgp_vty_init (void) install_element (BGP_IPV6_NODE, &no_neighbor_set_peer_group_cmd); install_element (BGP_IPV6M_NODE, &no_neighbor_set_peer_group_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_set_peer_group_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_set_peer_group_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_set_peer_group_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_set_peer_group_cmd); /* "neighbor softreconfiguration inbound" commands.*/ install_element (BGP_NODE, &neighbor_soft_reconfiguration_cmd); @@ -9265,6 +10031,12 @@ bgp_vty_init (void) install_element (BGP_IPV6M_NODE, &no_neighbor_soft_reconfiguration_cmd); install_element (BGP_VPNV4_NODE, &neighbor_soft_reconfiguration_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_soft_reconfiguration_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_soft_reconfiguration_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_soft_reconfiguration_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_soft_reconfiguration_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_soft_reconfiguration_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_soft_reconfiguration_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_soft_reconfiguration_cmd); /* "neighbor attribute-unchanged" commands. */ install_element (BGP_NODE, &neighbor_attr_unchanged_cmd); @@ -9400,6 +10172,75 @@ bgp_vty_init (void) install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged9_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged10_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged1_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged2_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged3_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged4_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged5_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged6_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged7_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged8_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged9_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged10_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged1_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged2_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged3_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged4_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged5_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged6_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged7_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged8_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged9_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged10_cmd); + + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged1_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged2_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged3_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged4_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged5_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged6_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged7_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged8_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged9_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged10_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged1_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged2_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged3_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged4_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged5_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged6_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged7_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged8_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged9_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged10_cmd); + + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged1_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged2_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged3_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged4_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged5_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged6_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged7_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged8_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged9_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged10_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged1_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged2_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged3_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged4_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged5_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged6_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged7_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged8_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged9_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged10_cmd); + /* "nexthop-local unchanged" commands */ install_element (BGP_IPV6_NODE, &neighbor_nexthop_local_unchanged_cmd); install_element (BGP_IPV6_NODE, &no_neighbor_nexthop_local_unchanged_cmd); @@ -9422,6 +10263,12 @@ bgp_vty_init (void) install_element (BGP_IPV6M_NODE, &no_neighbor_nexthop_self_cmd); install_element (BGP_VPNV4_NODE, &neighbor_nexthop_self_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_nexthop_self_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_nexthop_self_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_nexthop_self_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_nexthop_self_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_nexthop_self_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_nexthop_self_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_nexthop_self_cmd); /* "neighbor remove-private-AS" commands. */ install_element (BGP_NODE, &neighbor_remove_private_as_cmd); @@ -9436,6 +10283,12 @@ bgp_vty_init (void) install_element (BGP_IPV6M_NODE, &no_neighbor_remove_private_as_cmd); install_element (BGP_VPNV4_NODE, &neighbor_remove_private_as_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_remove_private_as_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_remove_private_as_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_remove_private_as_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_remove_private_as_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_remove_private_as_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_remove_private_as_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_remove_private_as_cmd); /* "neighbor send-community" commands.*/ install_element (BGP_NODE, &neighbor_send_community_cmd); @@ -9462,6 +10315,18 @@ bgp_vty_init (void) install_element (BGP_VPNV4_NODE, &neighbor_send_community_type_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_type_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_send_community_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_send_community_type_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_send_community_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_send_community_type_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_send_community_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_send_community_type_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_send_community_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_send_community_type_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_send_community_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_send_community_type_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_send_community_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_send_community_type_cmd); /* "neighbor route-reflector" commands.*/ install_element (BGP_NODE, &neighbor_route_reflector_client_cmd); @@ -9476,6 +10341,12 @@ bgp_vty_init (void) install_element (BGP_IPV6M_NODE, &no_neighbor_route_reflector_client_cmd); install_element (BGP_VPNV4_NODE, &neighbor_route_reflector_client_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_route_reflector_client_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_route_reflector_client_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_route_reflector_client_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_route_reflector_client_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_route_reflector_client_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_route_reflector_client_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_reflector_client_cmd); /* "neighbor route-server" commands.*/ install_element (BGP_NODE, &neighbor_route_server_client_cmd); @@ -9490,6 +10361,12 @@ bgp_vty_init (void) install_element (BGP_IPV6M_NODE, &no_neighbor_route_server_client_cmd); install_element (BGP_VPNV4_NODE, &neighbor_route_server_client_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_route_server_client_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_route_server_client_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_route_server_client_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_route_server_client_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_route_server_client_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_route_server_client_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_server_client_cmd); /* "neighbor passive" commands. */ install_element (BGP_NODE, &neighbor_passive_cmd); @@ -9618,6 +10495,12 @@ bgp_vty_init (void) install_element (BGP_IPV6M_NODE, &no_neighbor_distribute_list_cmd); install_element (BGP_VPNV4_NODE, &neighbor_distribute_list_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_distribute_list_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_distribute_list_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_distribute_list_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_distribute_list_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_distribute_list_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_distribute_list_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_distribute_list_cmd); /* "neighbor prefix-list" commands. */ install_element (BGP_NODE, &neighbor_prefix_list_cmd); @@ -9632,6 +10515,12 @@ bgp_vty_init (void) install_element (BGP_IPV6M_NODE, &no_neighbor_prefix_list_cmd); install_element (BGP_VPNV4_NODE, &neighbor_prefix_list_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_prefix_list_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_prefix_list_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_prefix_list_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_prefix_list_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_prefix_list_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_prefix_list_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_prefix_list_cmd); /* "neighbor filter-list" commands. */ install_element (BGP_NODE, &neighbor_filter_list_cmd); @@ -9646,6 +10535,12 @@ bgp_vty_init (void) install_element (BGP_IPV6M_NODE, &no_neighbor_filter_list_cmd); install_element (BGP_VPNV4_NODE, &neighbor_filter_list_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_filter_list_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_filter_list_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_filter_list_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_filter_list_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_filter_list_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_filter_list_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_filter_list_cmd); /* "neighbor route-map" commands. */ install_element (BGP_NODE, &neighbor_route_map_cmd); @@ -9660,6 +10555,12 @@ bgp_vty_init (void) install_element (BGP_IPV6M_NODE, &no_neighbor_route_map_cmd); install_element (BGP_VPNV4_NODE, &neighbor_route_map_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_route_map_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_route_map_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_route_map_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_route_map_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_route_map_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_route_map_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_map_cmd); /* "neighbor unsuppress-map" commands. */ install_element (BGP_NODE, &neighbor_unsuppress_map_cmd); @@ -9673,7 +10574,13 @@ bgp_vty_init (void) install_element (BGP_IPV6M_NODE, &neighbor_unsuppress_map_cmd); install_element (BGP_IPV6M_NODE, &no_neighbor_unsuppress_map_cmd); install_element (BGP_VPNV4_NODE, &neighbor_unsuppress_map_cmd); - install_element (BGP_VPNV4_NODE, &no_neighbor_unsuppress_map_cmd); + install_element (BGP_VPNV4_NODE, &no_neighbor_unsuppress_map_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_unsuppress_map_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_unsuppress_map_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_unsuppress_map_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_unsuppress_map_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_unsuppress_map_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_unsuppress_map_cmd); /* "neighbor maximum-prefix" commands. */ install_element (BGP_NODE, &neighbor_maximum_prefix_cmd); @@ -9755,6 +10662,48 @@ bgp_vty_init (void) install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_restart_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_threshold_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_warning_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_restart_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_val_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_threshold_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_warning_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_restart_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); + + install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_warning_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_restart_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_val_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_threshold_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_warning_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_restart_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); + + install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_warning_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_restart_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_val_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_threshold_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_warning_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_restart_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); + /* "neighbor allowas-in" */ install_element (BGP_NODE, &neighbor_allowas_in_cmd); install_element (BGP_NODE, &neighbor_allowas_in_arg_cmd); @@ -9774,23 +10723,40 @@ bgp_vty_init (void) install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_cmd); install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_arg_cmd); install_element (BGP_VPNV4_NODE, &no_neighbor_allowas_in_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_allowas_in_cmd); + install_element (BGP_VPNV6_NODE, &neighbor_allowas_in_arg_cmd); + install_element (BGP_VPNV6_NODE, &no_neighbor_allowas_in_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_allowas_in_cmd); + install_element (BGP_ENCAP_NODE, &neighbor_allowas_in_arg_cmd); + install_element (BGP_ENCAP_NODE, &no_neighbor_allowas_in_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_allowas_in_cmd); + install_element (BGP_ENCAPV6_NODE, &neighbor_allowas_in_arg_cmd); + install_element (BGP_ENCAPV6_NODE, &no_neighbor_allowas_in_cmd); /* address-family commands. */ install_element (BGP_NODE, &address_family_ipv4_cmd); install_element (BGP_NODE, &address_family_ipv4_safi_cmd); -#ifdef HAVE_IPV6 install_element (BGP_NODE, &address_family_ipv6_cmd); install_element (BGP_NODE, &address_family_ipv6_safi_cmd); -#endif /* HAVE_IPV6 */ install_element (BGP_NODE, &address_family_vpnv4_cmd); install_element (BGP_NODE, &address_family_vpnv4_unicast_cmd); + install_element (BGP_NODE, &address_family_vpnv6_cmd); + install_element (BGP_NODE, &address_family_vpnv6_unicast_cmd); + + install_element (BGP_NODE, &address_family_encap_cmd); + install_element (BGP_NODE, &address_family_encapv4_cmd); + install_element (BGP_NODE, &address_family_encapv6_cmd); + /* "exit-address-family" command. */ install_element (BGP_IPV4_NODE, &exit_address_family_cmd); install_element (BGP_IPV4M_NODE, &exit_address_family_cmd); install_element (BGP_IPV6_NODE, &exit_address_family_cmd); install_element (BGP_IPV6M_NODE, &exit_address_family_cmd); install_element (BGP_VPNV4_NODE, &exit_address_family_cmd); + install_element (BGP_VPNV6_NODE, &exit_address_family_cmd); + install_element (BGP_ENCAP_NODE, &exit_address_family_cmd); + install_element (BGP_ENCAPV6_NODE, &exit_address_family_cmd); /* "clear ip bgp commands" */ install_element (ENABLE_NODE, &clear_ip_bgp_all_cmd); @@ -9799,7 +10765,6 @@ bgp_vty_init (void) install_element (ENABLE_NODE, &clear_ip_bgp_peer_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_external_cmd); -#ifdef HAVE_IPV6 install_element (ENABLE_NODE, &clear_bgp_all_cmd); install_element (ENABLE_NODE, &clear_bgp_instance_all_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_all_cmd); @@ -9811,7 +10776,6 @@ bgp_vty_init (void) install_element (ENABLE_NODE, &clear_bgp_ipv6_external_cmd); install_element (ENABLE_NODE, &clear_bgp_as_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_as_cmd); -#endif /* HAVE_IPV6 */ /* "clear ip bgp neighbor soft in" */ install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_in_cmd); @@ -9854,7 +10818,12 @@ bgp_vty_init (void) install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_in_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_in_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_in_cmd); -#ifdef HAVE_IPV6 + install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_soft_in_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_in_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_soft_in_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_in_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_in_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_in_cmd); install_element (ENABLE_NODE, &clear_bgp_all_soft_in_cmd); install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_in_cmd); install_element (ENABLE_NODE, &clear_bgp_all_in_cmd); @@ -9886,7 +10855,6 @@ bgp_vty_init (void) install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_in_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_prefix_filter_cmd); -#endif /* HAVE_IPV6 */ /* "clear ip bgp neighbor soft out" */ install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_out_cmd); @@ -9917,7 +10885,12 @@ bgp_vty_init (void) install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_out_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_out_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_out_cmd); -#ifdef HAVE_IPV6 + install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_soft_out_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_out_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_soft_out_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_out_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_out_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_out_cmd); install_element (ENABLE_NODE, &clear_bgp_all_soft_out_cmd); install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_out_cmd); install_element (ENABLE_NODE, &clear_bgp_all_out_cmd); @@ -9939,7 +10912,6 @@ bgp_vty_init (void) install_element (ENABLE_NODE, &clear_bgp_ipv6_external_out_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_out_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_as_out_cmd); -#endif /* HAVE_IPV6 */ /* "clear ip bgp neighbor soft" */ install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_cmd); @@ -9957,7 +10929,9 @@ bgp_vty_init (void) install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_cmd); -#ifdef HAVE_IPV6 + install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_soft_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_soft_cmd); + install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_cmd); install_element (ENABLE_NODE, &clear_bgp_all_soft_cmd); install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_cmd); install_element (ENABLE_NODE, &clear_bgp_peer_soft_cmd); @@ -9969,14 +10943,12 @@ bgp_vty_init (void) install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_cmd); -#endif /* HAVE_IPV6 */ /* "clear ip bgp neighbor rsclient" */ install_element (ENABLE_NODE, &clear_ip_bgp_all_rsclient_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_rsclient_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_peer_rsclient_cmd); install_element (ENABLE_NODE, &clear_ip_bgp_instance_peer_rsclient_cmd); -#ifdef HAVE_IPV6 install_element (ENABLE_NODE, &clear_bgp_all_rsclient_cmd); install_element (ENABLE_NODE, &clear_bgp_instance_all_rsclient_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_all_rsclient_cmd); @@ -9985,160 +10957,104 @@ bgp_vty_init (void) install_element (ENABLE_NODE, &clear_bgp_instance_peer_rsclient_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_rsclient_cmd); install_element (ENABLE_NODE, &clear_bgp_ipv6_instance_peer_rsclient_cmd); -#endif /* HAVE_IPV6 */ /* "show ip bgp summary" commands. */ - install_element (VIEW_NODE, &show_ip_bgp_summary_cmd); - install_element (VIEW_NODE, &show_ip_bgp_instance_summary_cmd); - install_element (VIEW_NODE, &show_ip_bgp_ipv4_summary_cmd); + install_element (VIEW_NODE, &show_bgp_summary_cmd); + install_element (RESTRICTED_NODE, &show_bgp_summary_cmd); + install_element (ENABLE_NODE, &show_bgp_summary_cmd); + + install_element (VIEW_NODE, &show_bgp_summary_1w_cmd); + install_element (RESTRICTED_NODE, &show_bgp_summary_1w_cmd); + install_element (ENABLE_NODE, &show_bgp_summary_1w_cmd); + install_element (VIEW_NODE, &show_bgp_ipv4_safi_summary_cmd); - install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_ipv4_safi_summary_cmd); - install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_summary_cmd); - install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd); -#ifdef HAVE_IPV6 - install_element (VIEW_NODE, &show_bgp_summary_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv4_summary_cmd); + + install_element (VIEW_NODE, &show_bgp_ipv4_vpn_summary_cmd); + install_element (VIEW_NODE, &show_bgp_ipv4_encap_summary_cmd); + install_element (VIEW_NODE, &show_bgp_ipv6_vpn_summary_cmd); + install_element (VIEW_NODE, &show_bgp_ipv6_encap_summary_cmd); + install_element (VIEW_NODE, &show_bgp_instance_summary_cmd); - install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd); install_element (VIEW_NODE, &show_bgp_ipv6_safi_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_ipv6_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_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_bgp_ipv4_safi_summary_cmd); - install_element (RESTRICTED_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_ipv4_summary_cmd); install_element (RESTRICTED_NODE, &show_bgp_instance_ipv4_safi_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_ipv4_vpn_summary_cmd); + install_element (RESTRICTED_NODE, &show_bgp_ipv4_encap_summary_cmd); + install_element (RESTRICTED_NODE, &show_bgp_ipv6_vpn_summary_cmd); + install_element (RESTRICTED_NODE, &show_bgp_ipv6_encap_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_ipv6_safi_summary_cmd); install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_summary_cmd); install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_safi_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); install_element (ENABLE_NODE, &show_bgp_ipv4_safi_summary_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv4_summary_cmd); install_element (ENABLE_NODE, &show_bgp_instance_ipv4_safi_summary_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_summary_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd); -#ifdef HAVE_IPV6 - install_element (ENABLE_NODE, &show_bgp_summary_cmd); + + install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_summary_cmd); + install_element (ENABLE_NODE, &show_bgp_ipv4_encap_summary_cmd); + install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_summary_cmd); + install_element (ENABLE_NODE, &show_bgp_ipv6_encap_summary_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_summary_cmd); - install_element (ENABLE_NODE, &show_bgp_ipv6_summary_cmd); install_element (ENABLE_NODE, &show_bgp_ipv6_safi_summary_cmd); install_element (ENABLE_NODE, &show_bgp_instance_ipv6_summary_cmd); install_element (ENABLE_NODE, &show_bgp_instance_ipv6_safi_summary_cmd); -#endif /* HAVE_IPV6 */ /* "show ip bgp neighbors" commands. */ - install_element (VIEW_NODE, &show_ip_bgp_neighbors_cmd); - install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_cmd); - install_element (VIEW_NODE, &show_ip_bgp_neighbors_peer_cmd); - install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd); - install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd); - install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd); - install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd); - 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); - install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbors_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbors_peer_cmd); + install_element (VIEW_NODE, &show_bgp_instance_neighbors_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_neighbors_cmd); -#ifdef HAVE_IPV6 install_element (VIEW_NODE, &show_bgp_neighbors_cmd); - install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_cmd); install_element (VIEW_NODE, &show_bgp_neighbors_peer_cmd); - install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_peer_cmd); - install_element (VIEW_NODE, &show_bgp_instance_neighbors_cmd); - 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); - install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_peer_cmd); - install_element (ENABLE_NODE, &show_bgp_instance_neighbors_cmd); - install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbors_cmd); install_element (ENABLE_NODE, &show_bgp_instance_neighbors_peer_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbors_cmd); install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd); - /* Old commands. */ - install_element (VIEW_NODE, &show_ipv6_bgp_summary_cmd); - install_element (VIEW_NODE, &show_ipv6_mbgp_summary_cmd); - install_element (ENABLE_NODE, &show_ipv6_bgp_summary_cmd); - install_element (ENABLE_NODE, &show_ipv6_mbgp_summary_cmd); -#endif /* HAVE_IPV6 */ - /* "show ip bgp rsclient" commands. */ - install_element (VIEW_NODE, &show_ip_bgp_rsclient_summary_cmd); - 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 (VIEW_NODE, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd); install_element (VIEW_NODE, &show_bgp_ipv4_safi_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 (RESTRICTED_NODE, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_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); - install_element (ENABLE_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd); install_element (ENABLE_NODE, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd); install_element (ENABLE_NODE, &show_bgp_ipv4_safi_rsclient_summary_cmd); -#ifdef HAVE_IPV6 install_element (VIEW_NODE, &show_bgp_rsclient_summary_cmd); - install_element (VIEW_NODE, &show_bgp_ipv6_rsclient_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_rsclient_summary_cmd); + install_element (RESTRICTED_NODE, &show_bgp_rsclient_summary_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_rsclient_summary_cmd); + install_element (ENABLE_NODE, &show_bgp_rsclient_summary_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_rsclient_summary_cmd); + install_element (VIEW_NODE, &show_bgp_ipv6_rsclient_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd); install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd); install_element (VIEW_NODE, &show_bgp_ipv6_safi_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 (RESTRICTED_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_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); install_element (ENABLE_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd); install_element (ENABLE_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd); install_element (ENABLE_NODE, &show_bgp_ipv6_safi_rsclient_summary_cmd); -#endif /* HAVE_IPV6 */ /* "show ip bgp paths" commands. */ - install_element (VIEW_NODE, &show_ip_bgp_paths_cmd); - install_element (VIEW_NODE, &show_ip_bgp_ipv4_paths_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_paths_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_ipv4_paths_cmd); + install_element (VIEW_NODE, &show_bgp_ipv4_paths_cmd); + install_element (ENABLE_NODE, &show_bgp_ipv4_paths_cmd); /* "show ip bgp community" commands. */ install_element (VIEW_NODE, &show_ip_bgp_community_info_cmd); @@ -10159,7 +11075,6 @@ bgp_vty_init (void) install_element (BGP_NODE, &bgp_redistribute_ipv4_metric_rmap_cmd); install_element (BGP_NODE, &no_bgp_redistribute_ipv4_rmap_metric_cmd); install_element (BGP_NODE, &no_bgp_redistribute_ipv4_metric_rmap_cmd); -#ifdef HAVE_IPV6 install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_cmd); install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_cmd); install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_cmd); @@ -10170,7 +11085,6 @@ bgp_vty_init (void) install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_rmap_cmd); install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_metric_cmd); install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_rmap_cmd); -#endif /* HAVE_IPV6 */ /* ttl_security commands */ install_element (BGP_NODE, &neighbor_ttl_security_cmd); @@ -10185,11 +11099,83 @@ bgp_vty_init (void) install_element (VIEW_NODE, &show_bgp_views_cmd); install_element (RESTRICTED_NODE, &show_bgp_views_cmd); install_element (ENABLE_NODE, &show_bgp_views_cmd); - + + /* non afi/safi forms of commands */ + install_element (VIEW_NODE, &show_ip_bgp_summary_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_summary_cmd); + install_element (VIEW_NODE, &show_ip_bgp_ipv4_summary_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); + install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_summary_cmd); + install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd); + install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd); + 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); + install_element (RESTRICTED_NODE, &show_bgp_ipv6_summary_cmd); + 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); + install_element (ENABLE_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_summary_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd); + install_element (ENABLE_NODE, &show_bgp_ipv6_summary_cmd); + install_element (VIEW_NODE, &show_ip_bgp_neighbors_cmd); + install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_cmd); + install_element (VIEW_NODE, &show_ip_bgp_neighbors_peer_cmd); + install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd); + install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd); + install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd); + install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd); + 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); + install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbors_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbors_peer_cmd); + install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_cmd); + install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_peer_cmd); + install_element (RESTRICTED_NODE, &show_bgp_ipv6_neighbors_peer_cmd); + install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_cmd); + install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_peer_cmd); + install_element (VIEW_NODE, &show_ipv6_bgp_summary_cmd); + install_element (VIEW_NODE, &show_ipv6_mbgp_summary_cmd); + install_element (ENABLE_NODE, &show_ipv6_bgp_summary_cmd); + install_element (ENABLE_NODE, &show_ipv6_mbgp_summary_cmd); + install_element (VIEW_NODE, &show_ip_bgp_rsclient_summary_cmd); + 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); + install_element (ENABLE_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd); + install_element (VIEW_NODE, &show_ip_bgp_paths_cmd); + install_element (VIEW_NODE, &show_ip_bgp_ipv4_paths_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_paths_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_ipv4_paths_cmd); /* Community-list. */ community_list_vty (); } - + #include "memory.h" #include "bgp_regex.h" #include "bgp_clist.h" @@ -10588,7 +11574,7 @@ DEFUN (show_ip_community_list_arg, return CMD_SUCCESS; } - + static int extcommunity_list_set_vty (struct vty *vty, int argc, const char **argv, int style, int reject_all_digit_name) @@ -10938,7 +11924,7 @@ DEFUN (show_ip_extcommunity_list_arg, return CMD_SUCCESS; } - + /* Return configuration string of community-list entry. */ static const char * community_list_config_str (struct community_entry *entry)