2 Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
4 This file is part of GNU Zebra.
6 GNU Zebra is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 GNU Zebra is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Zebra; see the file COPYING. If not, write to the Free
18 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
35 #include "bgpd/bgpd.h"
36 #include "bgpd/bgp_advertise.h"
37 #include "bgpd/bgp_attr.h"
38 #include "bgpd/bgp_aspath.h"
39 #include "bgpd/bgp_community.h"
40 #include "bgpd/bgp_ecommunity.h"
41 #include "bgpd/bgp_lcommunity.h"
42 #include "bgpd/bgp_damp.h"
43 #include "bgpd/bgp_debug.h"
44 #include "bgpd/bgp_fsm.h"
45 #include "bgpd/bgp_mplsvpn.h"
46 #include "bgpd/bgp_nexthop.h"
47 #include "bgpd/bgp_open.h"
48 #include "bgpd/bgp_regex.h"
49 #include "bgpd/bgp_route.h"
50 #include "bgpd/bgp_zebra.h"
51 #include "bgpd/bgp_table.h"
52 #include "bgpd/bgp_vty.h"
53 #include "bgpd/bgp_mpath.h"
55 /* Utility function to get address family from current node. */
57 bgp_node_afi (struct vty *vty)
65 case BGP_ENCAPV6_NODE:
75 /* Utility function to get subsequent address family from current
78 bgp_node_safi (struct vty *vty)
84 case BGP_ENCAPV6_NODE:
93 safi = SAFI_MULTICAST;
103 bgp_parse_afi(const char *str, afi_t *afi)
105 if (!strcmp(str, "ipv4")) {
109 if (!strcmp(str, "ipv6")) {
117 bgp_parse_safi(const char *str, safi_t *safi)
119 if (!strcmp(str, "encap")) {
123 if (!strcmp(str, "multicast")) {
124 *safi = SAFI_MULTICAST;
127 if (!strcmp(str, "unicast")) {
128 *safi = SAFI_UNICAST;
131 if (!strcmp(str, "vpn")) {
132 *safi = SAFI_MPLS_VPN;
139 peer_address_self_check (union sockunion *su)
141 struct interface *ifp = NULL;
143 if (su->sa.sa_family == AF_INET)
144 ifp = if_lookup_by_ipv4_exact (&su->sin.sin_addr);
145 else if (su->sa.sa_family == AF_INET6)
146 ifp = if_lookup_by_ipv6_exact (&su->sin6.sin6_addr);
154 /* Utility function for looking up peer from VTY. */
156 peer_lookup_vty (struct vty *vty, const char *ip_str)
165 ret = str2sockunion (ip_str, &su);
168 vty_out (vty, "%% Malformed address: %s%s", ip_str, VTY_NEWLINE);
172 peer = peer_lookup (bgp, &su);
175 vty_out (vty, "%% Specify remote-as or peer-group commands first%s", VTY_NEWLINE);
181 /* Utility function for looking up peer or peer group. */
183 peer_and_group_lookup_vty (struct vty *vty, const char *peer_str)
189 struct peer_group *group;
193 ret = str2sockunion (peer_str, &su);
196 peer = peer_lookup (bgp, &su);
202 group = peer_group_lookup (bgp, peer_str);
207 vty_out (vty, "%% Specify remote-as or peer-group commands first%s",
214 bgp_vty_return (struct vty *vty, int ret)
216 const char *str = NULL;
220 case BGP_ERR_INVALID_VALUE:
221 str = "Invalid value";
223 case BGP_ERR_INVALID_FLAG:
224 str = "Invalid flag";
226 case BGP_ERR_PEER_INACTIVE:
227 str = "Activate the neighbor for the address family first";
229 case BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER:
230 str = "Invalid command for a peer-group member";
232 case BGP_ERR_PEER_GROUP_SHUTDOWN:
233 str = "Peer-group has been shutdown. Activate the peer-group first";
235 case BGP_ERR_PEER_GROUP_HAS_THE_FLAG:
236 str = "This peer is a peer-group member. Please change peer-group configuration";
238 case BGP_ERR_PEER_FLAG_CONFLICT:
239 str = "Can't set override-capability and strict-capability-match at the same time";
241 case BGP_ERR_PEER_GROUP_MEMBER_EXISTS:
242 str = "No activate for peergroup can be given only if peer-group has no members";
244 case BGP_ERR_PEER_BELONGS_TO_GROUP:
245 str = "No activate for an individual peer-group member is invalid";
247 case BGP_ERR_PEER_GROUP_AF_UNCONFIGURED:
248 str = "Activate the peer-group for the address family first";
250 case BGP_ERR_PEER_GROUP_NO_REMOTE_AS:
251 str = "Specify remote-as or peer-group remote AS first";
253 case BGP_ERR_PEER_GROUP_CANT_CHANGE:
254 str = "Cannot change the peer-group. Deconfigure first";
256 case BGP_ERR_PEER_GROUP_MISMATCH:
257 str = "Cannot have different peer-group for the neighbor";
259 case BGP_ERR_PEER_FILTER_CONFLICT:
260 str = "Prefix/distribute list can not co-exist";
262 case BGP_ERR_NOT_INTERNAL_PEER:
263 str = "Invalid command. Not an internal neighbor";
265 case BGP_ERR_REMOVE_PRIVATE_AS:
266 str = "Private AS cannot be removed for IBGP peers";
268 case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP:
269 str = "Local-AS allowed only for EBGP peers";
271 case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS:
272 str = "Cannot have local-as same as BGP AS number";
274 case BGP_ERR_TCPSIG_FAILED:
275 str = "Error while applying TCP-Sig to session(s)";
277 case BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK:
278 str = "ebgp-multihop and ttl-security cannot be configured together";
280 case BGP_ERR_NO_IBGP_WITH_TTLHACK:
281 str = "ttl-security only allowed for EBGP peers";
286 vty_out (vty, "%% %s%s", str, VTY_NEWLINE);
292 /* BGP global configuration. */
294 DEFUN (bgp_multiple_instance_func,
295 bgp_multiple_instance_cmd,
296 "bgp multiple-instance",
298 "Enable bgp multiple instance\n")
300 bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE);
304 DEFUN (no_bgp_multiple_instance,
305 no_bgp_multiple_instance_cmd,
306 "no bgp multiple-instance",
309 "BGP multiple instance\n")
313 ret = bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE);
316 vty_out (vty, "%% There are more than two BGP instances%s", VTY_NEWLINE);
322 DEFUN (bgp_config_type,
324 "bgp config-type (cisco|zebra)",
326 "Configuration type\n"
330 if (strncmp (argv[0], "c", 1) == 0)
331 bgp_option_set (BGP_OPT_CONFIG_CISCO);
333 bgp_option_unset (BGP_OPT_CONFIG_CISCO);
338 DEFUN (no_bgp_config_type,
339 no_bgp_config_type_cmd,
340 "no bgp config-type",
343 "Display configuration type\n")
345 bgp_option_unset (BGP_OPT_CONFIG_CISCO);
349 DEFUN (no_synchronization,
350 no_synchronization_cmd,
351 "no synchronization",
353 "Perform IGP synchronization\n")
358 DEFUN (no_auto_summary,
362 "Enable automatic network number summarization\n")
367 DEFUN_DEPRECATED (neighbor_version,
368 neighbor_version_cmd,
369 NEIGHBOR_CMD "version (4|4-)",
372 "Set the BGP version to match a neighbor\n"
373 "Neighbor's BGP version\n")
378 /* "router bgp" commands. */
381 "router bgp " CMD_AS_RANGE,
389 const char *name = NULL;
391 VTY_GET_INTEGER_RANGE ("AS", as, argv[0], 1, BGP_AS4_MAX);
396 ret = bgp_get (&bgp, &as, name);
399 case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET:
400 vty_out (vty, "Please specify 'bgp multiple-instance' first%s",
403 case BGP_ERR_AS_MISMATCH:
404 vty_out (vty, "BGP is already running; AS is %u%s", as, VTY_NEWLINE);
406 case BGP_ERR_INSTANCE_MISMATCH:
407 vty_out (vty, "BGP view name and AS number mismatch%s", VTY_NEWLINE);
408 vty_out (vty, "BGP instance is already running; AS is %u%s",
413 vty->node = BGP_NODE;
421 "router bgp " CMD_AS_RANGE " view WORD",
428 /* "no router bgp" commands. */
429 DEFUN (no_router_bgp,
431 "no router bgp " CMD_AS_RANGE,
439 const char *name = NULL;
441 VTY_GET_INTEGER_RANGE ("AS", as, argv[0], 1, BGP_AS4_MAX);
446 /* Lookup bgp structure. */
447 bgp = bgp_lookup (as, name);
450 vty_out (vty, "%% Can't find BGP instance%s", VTY_NEWLINE);
459 ALIAS (no_router_bgp,
460 no_router_bgp_view_cmd,
461 "no router bgp " CMD_AS_RANGE " view WORD",
471 DEFUN (bgp_router_id,
473 "bgp router-id A.B.C.D",
475 "Override configured router identifier\n"
476 "Manually configured router identifier\n")
484 ret = inet_aton (argv[0], &id);
487 vty_out (vty, "%% Malformed bgp router identifier%s", VTY_NEWLINE);
491 bgp_router_id_static_set (bgp, id);
496 DEFUN (no_bgp_router_id,
497 no_bgp_router_id_cmd,
501 "Override configured router identifier\n")
511 ret = inet_aton (argv[0], &id);
514 vty_out (vty, "%% Malformed BGP router identifier%s", VTY_NEWLINE);
518 if (! IPV4_ADDR_SAME (&bgp->router_id_static, &id))
520 vty_out (vty, "%% BGP router-id doesn't match%s", VTY_NEWLINE);
526 bgp_router_id_static_set (bgp, id);
531 ALIAS (no_bgp_router_id,
532 no_bgp_router_id_val_cmd,
533 "no bgp router-id A.B.C.D",
536 "Override configured router identifier\n"
537 "Manually configured router identifier\n")
539 /* BGP Cluster ID. */
541 DEFUN (bgp_cluster_id,
543 "bgp cluster-id A.B.C.D",
545 "Configure Route-Reflector Cluster-id\n"
546 "Route-Reflector Cluster-id in IP address format\n")
550 struct in_addr cluster;
554 ret = inet_aton (argv[0], &cluster);
557 vty_out (vty, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE);
561 bgp_cluster_id_set (bgp, &cluster);
566 ALIAS (bgp_cluster_id,
567 bgp_cluster_id32_cmd,
568 "bgp cluster-id <1-4294967295>",
570 "Configure Route-Reflector Cluster-id\n"
571 "Route-Reflector Cluster-id as 32 bit quantity\n")
573 DEFUN (no_bgp_cluster_id,
574 no_bgp_cluster_id_cmd,
578 "Configure Route-Reflector Cluster-id\n")
582 struct in_addr cluster;
588 ret = inet_aton (argv[0], &cluster);
591 vty_out (vty, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE);
596 bgp_cluster_id_unset (bgp);
601 ALIAS (no_bgp_cluster_id,
602 no_bgp_cluster_id_arg_cmd,
603 "no bgp cluster-id A.B.C.D",
606 "Configure Route-Reflector Cluster-id\n"
607 "Route-Reflector Cluster-id in IP address format\n")
609 DEFUN (bgp_confederation_identifier,
610 bgp_confederation_identifier_cmd,
611 "bgp confederation identifier " CMD_AS_RANGE,
612 "BGP specific commands\n"
613 "AS confederation parameters\n"
615 "Set routing domain confederation AS\n")
622 VTY_GET_INTEGER_RANGE ("AS", as, argv[0], 1, BGP_AS4_MAX);
624 bgp_confederation_id_set (bgp, as);
629 DEFUN (no_bgp_confederation_identifier,
630 no_bgp_confederation_identifier_cmd,
631 "no bgp confederation identifier",
633 "BGP specific commands\n"
634 "AS confederation parameters\n"
638 as_t as __attribute__((unused)); /* Dummy for VTY_GET_INTEGER_RANGE */
643 VTY_GET_INTEGER_RANGE ("AS", as, argv[0], 1, BGP_AS4_MAX);
645 bgp_confederation_id_unset (bgp);
650 ALIAS (no_bgp_confederation_identifier,
651 no_bgp_confederation_identifier_arg_cmd,
652 "no bgp confederation identifier " CMD_AS_RANGE,
654 "BGP specific commands\n"
655 "AS confederation parameters\n"
657 "Set routing domain confederation AS\n")
659 DEFUN (bgp_confederation_peers,
660 bgp_confederation_peers_cmd,
661 "bgp confederation peers ." CMD_AS_RANGE,
662 "BGP specific commands\n"
663 "AS confederation parameters\n"
664 "Peer ASs in BGP confederation\n"
673 for (i = 0; i < argc; i++)
675 VTY_GET_INTEGER_RANGE ("AS", as, argv[i], 1, BGP_AS4_MAX);
679 vty_out (vty, "%% Local member-AS not allowed in confed peer list%s",
684 bgp_confederation_peers_add (bgp, as);
689 DEFUN (no_bgp_confederation_peers,
690 no_bgp_confederation_peers_cmd,
691 "no bgp confederation peers ." CMD_AS_RANGE,
693 "BGP specific commands\n"
694 "AS confederation parameters\n"
695 "Peer ASs in BGP confederation\n"
704 for (i = 0; i < argc; i++)
706 VTY_GET_INTEGER_RANGE ("AS", as, argv[i], 1, BGP_AS4_MAX);
708 bgp_confederation_peers_remove (bgp, as);
713 /* Maximum-paths configuration */
716 "maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM),
717 "Forward packets over multiple paths\n"
726 VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths, argv[0], 1, 255);
728 ret = bgp_maximum_paths_set (bgp, bgp_node_afi (vty), bgp_node_safi(vty),
729 BGP_PEER_EBGP, maxpaths);
733 "%% Failed to set maximum-paths %u for afi %u, safi %u%s",
734 maxpaths, bgp_node_afi (vty), bgp_node_safi(vty), VTY_NEWLINE);
741 DEFUN (bgp_maxpaths_ibgp,
742 bgp_maxpaths_ibgp_cmd,
743 "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM),
744 "Forward packets over multiple paths\n"
754 VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths, argv[0], 1, 255);
756 ret = bgp_maximum_paths_set (bgp, bgp_node_afi (vty), bgp_node_safi(vty),
757 BGP_PEER_IBGP, maxpaths);
761 "%% Failed to set maximum-paths ibgp %u for afi %u, safi %u%s",
762 maxpaths, bgp_node_afi (vty), bgp_node_safi(vty), VTY_NEWLINE);
769 DEFUN (no_bgp_maxpaths,
773 "Forward packets over multiple paths\n"
781 ret = bgp_maximum_paths_unset (bgp, bgp_node_afi (vty), bgp_node_safi(vty),
786 "%% Failed to unset maximum-paths for afi %u, safi %u%s",
787 bgp_node_afi (vty), bgp_node_safi(vty), VTY_NEWLINE);
794 ALIAS (no_bgp_maxpaths,
795 no_bgp_maxpaths_arg_cmd,
796 "no maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM),
798 "Forward packets over multiple paths\n"
801 DEFUN (no_bgp_maxpaths_ibgp,
802 no_bgp_maxpaths_ibgp_cmd,
803 "no maximum-paths ibgp",
805 "Forward packets over multiple paths\n"
814 ret = bgp_maximum_paths_unset (bgp, bgp_node_afi (vty), bgp_node_safi(vty),
819 "%% Failed to unset maximum-paths ibgp for afi %u, safi %u%s",
820 bgp_node_afi (vty), bgp_node_safi(vty), VTY_NEWLINE);
827 ALIAS (no_bgp_maxpaths_ibgp,
828 no_bgp_maxpaths_ibgp_arg_cmd,
829 "no maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM),
831 "Forward packets over multiple paths\n"
836 bgp_config_write_maxpaths (struct vty *vty, struct bgp *bgp, afi_t afi,
837 safi_t safi, int *write)
839 if (bgp->maxpaths[afi][safi].maxpaths_ebgp != BGP_DEFAULT_MAXPATHS)
841 bgp_config_write_family_header (vty, afi, safi, write);
842 vty_out (vty, " maximum-paths %d%s",
843 bgp->maxpaths[afi][safi].maxpaths_ebgp, VTY_NEWLINE);
846 if (bgp->maxpaths[afi][safi].maxpaths_ibgp != BGP_DEFAULT_MAXPATHS)
848 bgp_config_write_family_header (vty, afi, safi, write);
849 vty_out (vty, " maximum-paths ibgp %d%s",
850 bgp->maxpaths[afi][safi].maxpaths_ibgp, VTY_NEWLINE);
860 "timers bgp <0-65535> <0-65535>",
861 "Adjust routing timers\n"
863 "Keepalive interval\n"
867 unsigned long keepalive = 0;
868 unsigned long holdtime = 0;
872 VTY_GET_INTEGER ("keepalive", keepalive, argv[0]);
873 VTY_GET_INTEGER ("holdtime", holdtime, argv[1]);
875 /* Holdtime value check. */
876 if (holdtime < 3 && holdtime != 0)
878 vty_out (vty, "%% hold time value must be either 0 or greater than 3%s",
883 bgp_timers_set (bgp, keepalive, holdtime);
888 DEFUN (no_bgp_timers,
892 "Adjust routing timers\n"
898 bgp_timers_unset (bgp);
903 ALIAS (no_bgp_timers,
904 no_bgp_timers_arg_cmd,
905 "no timers bgp <0-65535> <0-65535>",
907 "Adjust routing timers\n"
909 "Keepalive interval\n"
912 DEFUN (bgp_client_to_client_reflection,
913 bgp_client_to_client_reflection_cmd,
914 "bgp client-to-client reflection",
915 "BGP specific commands\n"
916 "Configure client to client route reflection\n"
917 "reflection of routes allowed\n")
922 bgp_flag_unset (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT);
926 DEFUN (no_bgp_client_to_client_reflection,
927 no_bgp_client_to_client_reflection_cmd,
928 "no bgp client-to-client reflection",
930 "BGP specific commands\n"
931 "Configure client to client route reflection\n"
932 "reflection of routes allowed\n")
937 bgp_flag_set (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT);
941 /* "bgp always-compare-med" configuration. */
942 DEFUN (bgp_always_compare_med,
943 bgp_always_compare_med_cmd,
944 "bgp always-compare-med",
945 "BGP specific commands\n"
946 "Allow comparing MED from different neighbors\n")
951 bgp_flag_set (bgp, BGP_FLAG_ALWAYS_COMPARE_MED);
955 DEFUN (no_bgp_always_compare_med,
956 no_bgp_always_compare_med_cmd,
957 "no bgp always-compare-med",
959 "BGP specific commands\n"
960 "Allow comparing MED from different neighbors\n")
965 bgp_flag_unset (bgp, BGP_FLAG_ALWAYS_COMPARE_MED);
969 /* "bgp deterministic-med" configuration. */
970 DEFUN (bgp_deterministic_med,
971 bgp_deterministic_med_cmd,
972 "bgp deterministic-med",
973 "BGP specific commands\n"
974 "Pick the best-MED path among paths advertised from the neighboring AS\n")
979 bgp_flag_set (bgp, BGP_FLAG_DETERMINISTIC_MED);
983 DEFUN (no_bgp_deterministic_med,
984 no_bgp_deterministic_med_cmd,
985 "no bgp deterministic-med",
987 "BGP specific commands\n"
988 "Pick the best-MED path among paths advertised from the neighboring AS\n")
993 bgp_flag_unset (bgp, BGP_FLAG_DETERMINISTIC_MED);
997 /* "bgp graceful-restart" configuration. */
998 DEFUN (bgp_graceful_restart,
999 bgp_graceful_restart_cmd,
1000 "bgp graceful-restart",
1001 "BGP specific commands\n"
1002 "Graceful restart capability parameters\n")
1007 bgp_flag_set (bgp, BGP_FLAG_GRACEFUL_RESTART);
1011 DEFUN (no_bgp_graceful_restart,
1012 no_bgp_graceful_restart_cmd,
1013 "no bgp graceful-restart",
1015 "BGP specific commands\n"
1016 "Graceful restart capability parameters\n")
1021 bgp_flag_unset (bgp, BGP_FLAG_GRACEFUL_RESTART);
1025 DEFUN (bgp_graceful_restart_stalepath_time,
1026 bgp_graceful_restart_stalepath_time_cmd,
1027 "bgp graceful-restart stalepath-time <1-3600>",
1028 "BGP specific commands\n"
1029 "Graceful restart capability parameters\n"
1030 "Set the max time to hold onto restarting peer's stale paths\n"
1031 "Delay value (seconds)\n")
1034 u_int32_t stalepath;
1040 VTY_GET_INTEGER_RANGE ("stalepath-time", stalepath, argv[0], 1, 3600);
1041 bgp->stalepath_time = stalepath;
1045 DEFUN (bgp_graceful_restart_restart_time,
1046 bgp_graceful_restart_restart_time_cmd,
1047 "bgp graceful-restart restart-time <1-3600>",
1048 "BGP specific commands\n"
1049 "Graceful restart capability parameters\n"
1050 "Set the time to wait to delete stale routes before a BGP open message is received\n"
1051 "Delay value (seconds)\n")
1060 VTY_GET_INTEGER_RANGE ("restart-time", restart, argv[0], 1, 3600);
1061 bgp->restart_time = restart;
1065 DEFUN (no_bgp_graceful_restart_stalepath_time,
1066 no_bgp_graceful_restart_stalepath_time_cmd,
1067 "no bgp graceful-restart stalepath-time",
1069 "BGP specific commands\n"
1070 "Graceful restart capability parameters\n"
1071 "Set the max time to hold onto restarting peer's stale paths\n")
1079 bgp->stalepath_time = BGP_DEFAULT_STALEPATH_TIME;
1083 DEFUN (no_bgp_graceful_restart_restart_time,
1084 no_bgp_graceful_restart_restart_time_cmd,
1085 "no bgp graceful-restart restart-time",
1087 "BGP specific commands\n"
1088 "Graceful restart capability parameters\n"
1089 "Set the time to wait to delete stale routes before a BGP open message is received\n")
1097 bgp->restart_time = BGP_DEFAULT_RESTART_TIME;
1101 ALIAS (no_bgp_graceful_restart_stalepath_time,
1102 no_bgp_graceful_restart_stalepath_time_val_cmd,
1103 "no bgp graceful-restart stalepath-time <1-3600>",
1105 "BGP specific commands\n"
1106 "Graceful restart capability parameters\n"
1107 "Set the max time to hold onto restarting peer's stale paths\n"
1108 "Delay value (seconds)\n")
1110 ALIAS (no_bgp_graceful_restart_restart_time,
1111 no_bgp_graceful_restart_restart_time_val_cmd,
1112 "no bgp graceful-restart restart-time <1-3600>",
1114 "BGP specific commands\n"
1115 "Graceful restart capability parameters\n"
1116 "Set the time to wait to delete stale routes before a BGP open message is received\n"
1117 "Delay value (seconds)\n")
1119 /* "bgp fast-external-failover" configuration. */
1120 DEFUN (bgp_fast_external_failover,
1121 bgp_fast_external_failover_cmd,
1122 "bgp fast-external-failover",
1124 "Immediately reset session if a link to a directly connected external peer goes down\n")
1129 bgp_flag_unset (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER);
1133 DEFUN (no_bgp_fast_external_failover,
1134 no_bgp_fast_external_failover_cmd,
1135 "no bgp fast-external-failover",
1138 "Immediately reset session if a link to a directly connected external peer goes down\n")
1143 bgp_flag_set (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER);
1147 /* "bgp enforce-first-as" configuration. */
1148 DEFUN (bgp_enforce_first_as,
1149 bgp_enforce_first_as_cmd,
1150 "bgp enforce-first-as",
1152 "Enforce the first AS for EBGP routes\n")
1157 bgp_flag_set (bgp, BGP_FLAG_ENFORCE_FIRST_AS);
1161 DEFUN (no_bgp_enforce_first_as,
1162 no_bgp_enforce_first_as_cmd,
1163 "no bgp enforce-first-as",
1166 "Enforce the first AS for EBGP routes\n")
1171 bgp_flag_unset (bgp, BGP_FLAG_ENFORCE_FIRST_AS);
1175 /* "bgp bestpath compare-routerid" configuration. */
1176 DEFUN (bgp_bestpath_compare_router_id,
1177 bgp_bestpath_compare_router_id_cmd,
1178 "bgp bestpath compare-routerid",
1179 "BGP specific commands\n"
1180 "Change the default bestpath selection\n"
1181 "Compare router-id for identical EBGP paths\n")
1186 bgp_flag_set (bgp, BGP_FLAG_COMPARE_ROUTER_ID);
1190 DEFUN (no_bgp_bestpath_compare_router_id,
1191 no_bgp_bestpath_compare_router_id_cmd,
1192 "no bgp bestpath compare-routerid",
1194 "BGP specific commands\n"
1195 "Change the default bestpath selection\n"
1196 "Compare router-id for identical EBGP paths\n")
1201 bgp_flag_unset (bgp, BGP_FLAG_COMPARE_ROUTER_ID);
1205 /* "bgp bestpath as-path ignore" configuration. */
1206 DEFUN (bgp_bestpath_aspath_ignore,
1207 bgp_bestpath_aspath_ignore_cmd,
1208 "bgp bestpath as-path ignore",
1209 "BGP specific commands\n"
1210 "Change the default bestpath selection\n"
1211 "AS-path attribute\n"
1212 "Ignore as-path length in selecting a route\n")
1217 bgp_flag_set (bgp, BGP_FLAG_ASPATH_IGNORE);
1221 DEFUN (no_bgp_bestpath_aspath_ignore,
1222 no_bgp_bestpath_aspath_ignore_cmd,
1223 "no bgp bestpath as-path ignore",
1225 "BGP specific commands\n"
1226 "Change the default bestpath selection\n"
1227 "AS-path attribute\n"
1228 "Ignore as-path length in selecting a route\n")
1233 bgp_flag_unset (bgp, BGP_FLAG_ASPATH_IGNORE);
1237 /* "bgp bestpath as-path confed" configuration. */
1238 DEFUN (bgp_bestpath_aspath_confed,
1239 bgp_bestpath_aspath_confed_cmd,
1240 "bgp bestpath as-path confed",
1241 "BGP specific commands\n"
1242 "Change the default bestpath selection\n"
1243 "AS-path attribute\n"
1244 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1249 bgp_flag_set (bgp, BGP_FLAG_ASPATH_CONFED);
1253 DEFUN (no_bgp_bestpath_aspath_confed,
1254 no_bgp_bestpath_aspath_confed_cmd,
1255 "no bgp bestpath as-path confed",
1257 "BGP specific commands\n"
1258 "Change the default bestpath selection\n"
1259 "AS-path attribute\n"
1260 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1265 bgp_flag_unset (bgp, BGP_FLAG_ASPATH_CONFED);
1269 /* "bgp bestpath as-path multipath-relax" configuration. */
1270 DEFUN (bgp_bestpath_aspath_multipath_relax,
1271 bgp_bestpath_aspath_multipath_relax_cmd,
1272 "bgp bestpath as-path multipath-relax",
1273 "BGP specific commands\n"
1274 "Change the default bestpath selection\n"
1275 "AS-path attribute\n"
1276 "Allow load sharing across routes that have different AS paths (but same length)\n")
1281 bgp_flag_set (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
1285 DEFUN (no_bgp_bestpath_aspath_multipath_relax,
1286 no_bgp_bestpath_aspath_multipath_relax_cmd,
1287 "no bgp bestpath as-path multipath-relax",
1289 "BGP specific commands\n"
1290 "Change the default bestpath selection\n"
1291 "AS-path attribute\n"
1292 "Allow load sharing across routes that have different AS paths (but same length)\n")
1297 bgp_flag_unset (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
1301 /* "bgp log-neighbor-changes" configuration. */
1302 DEFUN (bgp_log_neighbor_changes,
1303 bgp_log_neighbor_changes_cmd,
1304 "bgp log-neighbor-changes",
1305 "BGP specific commands\n"
1306 "Log neighbor up/down and reset reason\n")
1311 bgp_flag_set (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES);
1315 DEFUN (no_bgp_log_neighbor_changes,
1316 no_bgp_log_neighbor_changes_cmd,
1317 "no bgp log-neighbor-changes",
1319 "BGP specific commands\n"
1320 "Log neighbor up/down and reset reason\n")
1325 bgp_flag_unset (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES);
1329 /* "bgp bestpath med" configuration. */
1330 DEFUN (bgp_bestpath_med,
1331 bgp_bestpath_med_cmd,
1332 "bgp bestpath med (confed|missing-as-worst)",
1333 "BGP specific commands\n"
1334 "Change the default bestpath selection\n"
1336 "Compare MED among confederation paths\n"
1337 "Treat missing MED as the least preferred one\n")
1343 if (strncmp (argv[0], "confed", 1) == 0)
1344 bgp_flag_set (bgp, BGP_FLAG_MED_CONFED);
1346 bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST);
1351 DEFUN (bgp_bestpath_med2,
1352 bgp_bestpath_med2_cmd,
1353 "bgp bestpath med confed missing-as-worst",
1354 "BGP specific commands\n"
1355 "Change the default bestpath selection\n"
1357 "Compare MED among confederation paths\n"
1358 "Treat missing MED as the least preferred one\n")
1363 bgp_flag_set (bgp, BGP_FLAG_MED_CONFED);
1364 bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST);
1368 ALIAS (bgp_bestpath_med2,
1369 bgp_bestpath_med3_cmd,
1370 "bgp bestpath med missing-as-worst confed",
1371 "BGP specific commands\n"
1372 "Change the default bestpath selection\n"
1374 "Treat missing MED as the least preferred one\n"
1375 "Compare MED among confederation paths\n")
1377 DEFUN (no_bgp_bestpath_med,
1378 no_bgp_bestpath_med_cmd,
1379 "no bgp bestpath med (confed|missing-as-worst)",
1381 "BGP specific commands\n"
1382 "Change the default bestpath selection\n"
1384 "Compare MED among confederation paths\n"
1385 "Treat missing MED as the least preferred one\n")
1391 if (strncmp (argv[0], "confed", 1) == 0)
1392 bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED);
1394 bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST);
1399 DEFUN (no_bgp_bestpath_med2,
1400 no_bgp_bestpath_med2_cmd,
1401 "no bgp bestpath med confed missing-as-worst",
1403 "BGP specific commands\n"
1404 "Change the default bestpath selection\n"
1406 "Compare MED among confederation paths\n"
1407 "Treat missing MED as the least preferred one\n")
1412 bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED);
1413 bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST);
1417 ALIAS (no_bgp_bestpath_med2,
1418 no_bgp_bestpath_med3_cmd,
1419 "no bgp bestpath med missing-as-worst confed",
1421 "BGP specific commands\n"
1422 "Change the default bestpath selection\n"
1424 "Treat missing MED as the least preferred one\n"
1425 "Compare MED among confederation paths\n")
1427 /* "no bgp default ipv4-unicast". */
1428 DEFUN (no_bgp_default_ipv4_unicast,
1429 no_bgp_default_ipv4_unicast_cmd,
1430 "no bgp default ipv4-unicast",
1432 "BGP specific commands\n"
1433 "Configure BGP defaults\n"
1434 "Activate ipv4-unicast for a peer by default\n")
1439 bgp_flag_set (bgp, BGP_FLAG_NO_DEFAULT_IPV4);
1443 DEFUN (bgp_default_ipv4_unicast,
1444 bgp_default_ipv4_unicast_cmd,
1445 "bgp default ipv4-unicast",
1446 "BGP specific commands\n"
1447 "Configure BGP defaults\n"
1448 "Activate ipv4-unicast for a peer by default\n")
1453 bgp_flag_unset (bgp, BGP_FLAG_NO_DEFAULT_IPV4);
1457 /* "bgp import-check" configuration. */
1458 DEFUN (bgp_network_import_check,
1459 bgp_network_import_check_cmd,
1460 "bgp network import-check",
1461 "BGP specific commands\n"
1462 "BGP network command\n"
1463 "Check BGP network route exists in IGP\n")
1468 bgp_flag_set (bgp, BGP_FLAG_IMPORT_CHECK);
1472 DEFUN (no_bgp_network_import_check,
1473 no_bgp_network_import_check_cmd,
1474 "no bgp network import-check",
1476 "BGP specific commands\n"
1477 "BGP network command\n"
1478 "Check BGP network route exists in IGP\n")
1483 bgp_flag_unset (bgp, BGP_FLAG_IMPORT_CHECK);
1487 DEFUN (bgp_default_local_preference,
1488 bgp_default_local_preference_cmd,
1489 "bgp default local-preference <0-4294967295>",
1490 "BGP specific commands\n"
1491 "Configure BGP defaults\n"
1492 "local preference (higher=more preferred)\n"
1493 "Configure default local preference value\n")
1496 u_int32_t local_pref;
1500 VTY_GET_INTEGER ("local preference", local_pref, argv[0]);
1502 bgp_default_local_preference_set (bgp, local_pref);
1507 DEFUN (no_bgp_default_local_preference,
1508 no_bgp_default_local_preference_cmd,
1509 "no bgp default local-preference",
1511 "BGP specific commands\n"
1512 "Configure BGP defaults\n"
1513 "local preference (higher=more preferred)\n")
1518 bgp_default_local_preference_unset (bgp);
1522 ALIAS (no_bgp_default_local_preference,
1523 no_bgp_default_local_preference_val_cmd,
1524 "no bgp default local-preference <0-4294967295>",
1526 "BGP specific commands\n"
1527 "Configure BGP defaults\n"
1528 "local preference (higher=more preferred)\n"
1529 "Configure default local preference value\n")
1532 peer_announce_routes_if_rmap_out (struct bgp *bgp)
1535 struct listnode *node, *nnode;
1536 struct bgp_filter *filter;
1540 /* Reannounce all routes to appropriate neighbors */
1541 for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
1543 for (afi = AFI_IP; afi < AFI_MAX; afi++)
1544 for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
1546 if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT))
1548 /* check if there's an out route-map on this client */
1549 filter = &peer->filter[afi][safi];
1550 if (ROUTE_MAP_OUT_NAME(filter))
1552 if (BGP_DEBUG(update, UPDATE_OUT))
1553 zlog_debug("%s: Announcing routes again for peer %s"
1554 "(afi=%d, safi=%d", __func__, peer->host, afi,
1557 bgp_announce_route_all(peer);
1564 DEFUN (bgp_rr_allow_outbound_policy,
1565 bgp_rr_allow_outbound_policy_cmd,
1566 "bgp route-reflector allow-outbound-policy",
1567 "BGP specific commands\n"
1568 "Allow modifications made by out route-map\n"
1569 "on ibgp neighbors\n")
1575 if (!bgp_flag_check(bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY))
1577 bgp_flag_set(bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY);
1578 peer_announce_routes_if_rmap_out(bgp);
1584 DEFUN (no_bgp_rr_allow_outbound_policy,
1585 no_bgp_rr_allow_outbound_policy_cmd,
1586 "no bgp route-reflector allow-outbound-policy",
1588 "BGP specific commands\n"
1589 "Allow modifications made by out route-map\n"
1590 "on ibgp neighbors\n")
1596 if (bgp_flag_check(bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY))
1598 bgp_flag_unset(bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY);
1599 peer_announce_routes_if_rmap_out(bgp);
1606 peer_remote_as_vty (struct vty *vty, const char *peer_str,
1607 const char *as_str, afi_t afi, safi_t safi)
1616 /* Get AS number. */
1617 VTY_GET_INTEGER_RANGE ("AS", as, as_str, 1, BGP_AS4_MAX);
1619 /* If peer is peer group, call proper function. */
1620 ret = str2sockunion (peer_str, &su);
1623 ret = peer_group_remote_as (bgp, peer_str, &as);
1626 vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE);
1632 if (peer_address_self_check (&su))
1634 vty_out (vty, "%% Can not configure the local system as neighbor%s",
1639 ret = peer_remote_as (bgp, &su, &as, afi, safi);
1641 /* This peer belongs to peer group. */
1644 case BGP_ERR_PEER_GROUP_MEMBER:
1645 vty_out (vty, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as, VTY_NEWLINE);
1647 case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT:
1648 vty_out (vty, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external%s", as, as_str, VTY_NEWLINE);
1651 return bgp_vty_return (vty, ret);
1654 DEFUN (neighbor_remote_as,
1655 neighbor_remote_as_cmd,
1656 NEIGHBOR_CMD2 "remote-as " CMD_AS_RANGE,
1659 "Specify a BGP neighbor\n"
1662 return peer_remote_as_vty (vty, argv[0], argv[1], AFI_IP, SAFI_UNICAST);
1665 DEFUN (neighbor_peer_group,
1666 neighbor_peer_group_cmd,
1667 "neighbor WORD peer-group",
1670 "Configure peer-group\n")
1673 struct peer_group *group;
1677 group = peer_group_get (bgp, argv[0]);
1693 struct peer_group *group;
1696 ret = str2sockunion (argv[0], &su);
1699 group = peer_group_lookup (vty->index, argv[0]);
1701 peer_group_delete (group);
1704 vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE);
1710 peer = peer_lookup (vty->index, &su);
1719 no_neighbor_remote_as_cmd,
1720 NO_NEIGHBOR_CMD "remote-as " CMD_AS_RANGE,
1724 "Specify a BGP neighbor\n"
1727 DEFUN (no_neighbor_peer_group,
1728 no_neighbor_peer_group_cmd,
1729 "no neighbor WORD peer-group",
1733 "Configure peer-group\n")
1735 struct peer_group *group;
1737 group = peer_group_lookup (vty->index, argv[0]);
1739 peer_group_delete (group);
1742 vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE);
1748 DEFUN (no_neighbor_peer_group_remote_as,
1749 no_neighbor_peer_group_remote_as_cmd,
1750 "no neighbor WORD remote-as " CMD_AS_RANGE,
1754 "Specify a BGP neighbor\n"
1757 struct peer_group *group;
1759 group = peer_group_lookup (vty->index, argv[0]);
1761 peer_group_remote_as_delete (group);
1764 vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE);
1770 DEFUN (neighbor_local_as,
1771 neighbor_local_as_cmd,
1772 NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE,
1775 "Specify a local-as number\n"
1776 "AS number used as local AS\n")
1781 peer = peer_and_group_lookup_vty (vty, argv[0]);
1785 ret = peer_local_as_set (peer, atoi (argv[1]), 0, 0);
1786 return bgp_vty_return (vty, ret);
1789 DEFUN (neighbor_local_as_no_prepend,
1790 neighbor_local_as_no_prepend_cmd,
1791 NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend",
1794 "Specify a local-as number\n"
1795 "AS number used as local AS\n"
1796 "Do not prepend local-as to updates from ebgp peers\n")
1801 peer = peer_and_group_lookup_vty (vty, argv[0]);
1805 ret = peer_local_as_set (peer, atoi (argv[1]), 1, 0);
1806 return bgp_vty_return (vty, ret);
1809 DEFUN (neighbor_local_as_no_prepend_replace_as,
1810 neighbor_local_as_no_prepend_replace_as_cmd,
1811 NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend replace-as",
1814 "Specify a local-as number\n"
1815 "AS number used as local AS\n"
1816 "Do not prepend local-as to updates from ebgp peers\n"
1817 "Do not prepend local-as to updates from ibgp peers\n")
1822 peer = peer_and_group_lookup_vty (vty, argv[0]);
1826 ret = peer_local_as_set (peer, atoi (argv[1]), 1, 1);
1827 return bgp_vty_return (vty, ret);
1831 DEFUN (no_neighbor_local_as,
1832 no_neighbor_local_as_cmd,
1833 NO_NEIGHBOR_CMD2 "local-as",
1837 "Specify a local-as number\n")
1842 peer = peer_and_group_lookup_vty (vty, argv[0]);
1846 ret = peer_local_as_unset (peer);
1847 return bgp_vty_return (vty, ret);
1850 ALIAS (no_neighbor_local_as,
1851 no_neighbor_local_as_val_cmd,
1852 NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE,
1856 "Specify a local-as number\n"
1857 "AS number used as local AS\n")
1859 ALIAS (no_neighbor_local_as,
1860 no_neighbor_local_as_val2_cmd,
1861 NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend",
1865 "Specify a local-as number\n"
1866 "AS number used as local AS\n"
1867 "Do not prepend local-as to updates from ebgp peers\n")
1869 ALIAS (no_neighbor_local_as,
1870 no_neighbor_local_as_val3_cmd,
1871 NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend replace-as",
1875 "Specify a local-as number\n"
1876 "AS number used as local AS\n"
1877 "Do not prepend local-as to updates from ebgp peers\n"
1878 "Do not prepend local-as to updates from ibgp peers\n")
1880 DEFUN (neighbor_password,
1881 neighbor_password_cmd,
1882 NEIGHBOR_CMD2 "password LINE",
1891 peer = peer_and_group_lookup_vty (vty, argv[0]);
1895 ret = peer_password_set (peer, argv[1]);
1896 return bgp_vty_return (vty, ret);
1899 DEFUN (no_neighbor_password,
1900 no_neighbor_password_cmd,
1901 NO_NEIGHBOR_CMD2 "password",
1910 peer = peer_and_group_lookup_vty (vty, argv[0]);
1914 ret = peer_password_unset (peer);
1915 return bgp_vty_return (vty, ret);
1918 DEFUN (neighbor_activate,
1919 neighbor_activate_cmd,
1920 NEIGHBOR_CMD2 "activate",
1923 "Enable the Address Family for this Neighbor\n")
1927 peer = peer_and_group_lookup_vty (vty, argv[0]);
1931 peer_activate (peer, bgp_node_afi (vty), bgp_node_safi (vty));
1936 DEFUN (no_neighbor_activate,
1937 no_neighbor_activate_cmd,
1938 NO_NEIGHBOR_CMD2 "activate",
1942 "Enable the Address Family for this Neighbor\n")
1948 peer = peer_and_group_lookup_vty (vty, argv[0]);
1952 ret = peer_deactivate (peer, bgp_node_afi (vty), bgp_node_safi (vty));
1954 return bgp_vty_return (vty, ret);
1957 DEFUN (neighbor_set_peer_group,
1958 neighbor_set_peer_group_cmd,
1959 NEIGHBOR_CMD "peer-group WORD",
1962 "Member of the peer-group\n"
1963 "peer-group name\n")
1969 struct peer_group *group;
1973 ret = str2sockunion (argv[0], &su);
1976 vty_out (vty, "%% Malformed address: %s%s", argv[0], VTY_NEWLINE);
1980 group = peer_group_lookup (bgp, argv[1]);
1983 vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE);
1987 if (peer_address_self_check (&su))
1989 vty_out (vty, "%% Can not configure the local system as neighbor%s",
1994 ret = peer_group_bind (bgp, &su, group, bgp_node_afi (vty),
1995 bgp_node_safi (vty), &as);
1997 if (ret == BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT)
1999 vty_out (vty, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external%s", as, VTY_NEWLINE);
2003 return bgp_vty_return (vty, ret);
2006 DEFUN (no_neighbor_set_peer_group,
2007 no_neighbor_set_peer_group_cmd,
2008 NO_NEIGHBOR_CMD "peer-group WORD",
2012 "Member of the peer-group\n"
2013 "peer-group name\n")
2018 struct peer_group *group;
2022 peer = peer_lookup_vty (vty, argv[0]);
2026 group = peer_group_lookup (bgp, argv[1]);
2029 vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE);
2033 ret = peer_group_unbind (bgp, peer, group, bgp_node_afi (vty),
2034 bgp_node_safi (vty));
2036 return bgp_vty_return (vty, ret);
2040 peer_flag_modify_vty (struct vty *vty, const char *ip_str,
2041 u_int16_t flag, int set)
2046 peer = peer_and_group_lookup_vty (vty, ip_str);
2051 ret = peer_flag_set (peer, flag);
2053 ret = peer_flag_unset (peer, flag);
2055 return bgp_vty_return (vty, ret);
2059 peer_flag_set_vty (struct vty *vty, const char *ip_str, u_int16_t flag)
2061 return peer_flag_modify_vty (vty, ip_str, flag, 1);
2065 peer_flag_unset_vty (struct vty *vty, const char *ip_str, u_int16_t flag)
2067 return peer_flag_modify_vty (vty, ip_str, flag, 0);
2070 /* neighbor passive. */
2071 DEFUN (neighbor_passive,
2072 neighbor_passive_cmd,
2073 NEIGHBOR_CMD2 "passive",
2076 "Don't send open messages to this neighbor\n")
2078 return peer_flag_set_vty (vty, argv[0], PEER_FLAG_PASSIVE);
2081 DEFUN (no_neighbor_passive,
2082 no_neighbor_passive_cmd,
2083 NO_NEIGHBOR_CMD2 "passive",
2087 "Don't send open messages to this neighbor\n")
2089 return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_PASSIVE);
2092 /* neighbor shutdown. */
2093 DEFUN (neighbor_shutdown,
2094 neighbor_shutdown_cmd,
2095 NEIGHBOR_CMD2 "shutdown",
2098 "Administratively shut down this neighbor\n")
2100 return peer_flag_set_vty (vty, argv[0], PEER_FLAG_SHUTDOWN);
2103 DEFUN (no_neighbor_shutdown,
2104 no_neighbor_shutdown_cmd,
2105 NO_NEIGHBOR_CMD2 "shutdown",
2109 "Administratively shut down this neighbor\n")
2111 return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_SHUTDOWN);
2114 /* Deprecated neighbor capability route-refresh. */
2115 DEFUN_DEPRECATED (neighbor_capability_route_refresh,
2116 neighbor_capability_route_refresh_cmd,
2117 NEIGHBOR_CMD2 "capability route-refresh",
2120 "Advertise capability to the peer\n"
2121 "Advertise route-refresh capability to this neighbor\n")
2126 DEFUN_DEPRECATED (no_neighbor_capability_route_refresh,
2127 no_neighbor_capability_route_refresh_cmd,
2128 NO_NEIGHBOR_CMD2 "capability route-refresh",
2132 "Advertise capability to the peer\n"
2133 "Advertise route-refresh capability to this neighbor\n")
2138 /* neighbor capability dynamic. */
2139 DEFUN (neighbor_capability_dynamic,
2140 neighbor_capability_dynamic_cmd,
2141 NEIGHBOR_CMD2 "capability dynamic",
2144 "Advertise capability to the peer\n"
2145 "Advertise dynamic capability to this neighbor\n")
2147 return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DYNAMIC_CAPABILITY);
2150 DEFUN (no_neighbor_capability_dynamic,
2151 no_neighbor_capability_dynamic_cmd,
2152 NO_NEIGHBOR_CMD2 "capability dynamic",
2156 "Advertise capability to the peer\n"
2157 "Advertise dynamic capability to this neighbor\n")
2159 return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DYNAMIC_CAPABILITY);
2162 /* neighbor dont-capability-negotiate */
2163 DEFUN (neighbor_dont_capability_negotiate,
2164 neighbor_dont_capability_negotiate_cmd,
2165 NEIGHBOR_CMD2 "dont-capability-negotiate",
2168 "Do not perform capability negotiation\n")
2170 return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DONT_CAPABILITY);
2173 DEFUN (no_neighbor_dont_capability_negotiate,
2174 no_neighbor_dont_capability_negotiate_cmd,
2175 NO_NEIGHBOR_CMD2 "dont-capability-negotiate",
2179 "Do not perform capability negotiation\n")
2181 return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DONT_CAPABILITY);
2185 peer_af_flag_modify_vty (struct vty *vty, const char *peer_str, afi_t afi,
2186 safi_t safi, u_int32_t flag, int set)
2191 peer = peer_and_group_lookup_vty (vty, peer_str);
2196 ret = peer_af_flag_set (peer, afi, safi, flag);
2198 ret = peer_af_flag_unset (peer, afi, safi, flag);
2200 return bgp_vty_return (vty, ret);
2204 peer_af_flag_set_vty (struct vty *vty, const char *peer_str, afi_t afi,
2205 safi_t safi, u_int32_t flag)
2207 return peer_af_flag_modify_vty (vty, peer_str, afi, safi, flag, 1);
2211 peer_af_flag_unset_vty (struct vty *vty, const char *peer_str, afi_t afi,
2212 safi_t safi, u_int32_t flag)
2214 return peer_af_flag_modify_vty (vty, peer_str, afi, safi, flag, 0);
2217 /* neighbor capability orf prefix-list. */
2218 DEFUN (neighbor_capability_orf_prefix,
2219 neighbor_capability_orf_prefix_cmd,
2220 NEIGHBOR_CMD2 "capability orf prefix-list (both|send|receive)",
2223 "Advertise capability to the peer\n"
2224 "Advertise ORF capability to the peer\n"
2225 "Advertise prefixlist ORF capability to this neighbor\n"
2226 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
2227 "Capability to RECEIVE the ORF from this neighbor\n"
2228 "Capability to SEND the ORF to this neighbor\n")
2232 if (strncmp (argv[1], "s", 1) == 0)
2233 flag = PEER_FLAG_ORF_PREFIX_SM;
2234 else if (strncmp (argv[1], "r", 1) == 0)
2235 flag = PEER_FLAG_ORF_PREFIX_RM;
2236 else if (strncmp (argv[1], "b", 1) == 0)
2237 flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM;
2241 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2242 bgp_node_safi (vty), flag);
2245 DEFUN (no_neighbor_capability_orf_prefix,
2246 no_neighbor_capability_orf_prefix_cmd,
2247 NO_NEIGHBOR_CMD2 "capability orf prefix-list (both|send|receive)",
2251 "Advertise capability to the peer\n"
2252 "Advertise ORF capability to the peer\n"
2253 "Advertise prefixlist ORF capability to this neighbor\n"
2254 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
2255 "Capability to RECEIVE the ORF from this neighbor\n"
2256 "Capability to SEND the ORF to this neighbor\n")
2260 if (strncmp (argv[1], "s", 1) == 0)
2261 flag = PEER_FLAG_ORF_PREFIX_SM;
2262 else if (strncmp (argv[1], "r", 1) == 0)
2263 flag = PEER_FLAG_ORF_PREFIX_RM;
2264 else if (strncmp (argv[1], "b", 1) == 0)
2265 flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM;
2269 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2270 bgp_node_safi (vty), flag);
2273 /* neighbor next-hop-self. */
2274 DEFUN (neighbor_nexthop_self,
2275 neighbor_nexthop_self_cmd,
2276 NEIGHBOR_CMD2 "next-hop-self {all}",
2279 "Disable the next hop calculation for this neighbor\n"
2280 "Apply also to ibgp-learned routes when acting as a route reflector\n")
2282 u_int32_t flags = PEER_FLAG_NEXTHOP_SELF, unset = 0;
2285 /* Check if "all" is specified */
2286 if (argv[1] != NULL)
2287 flags |= PEER_FLAG_NEXTHOP_SELF_ALL;
2289 unset |= PEER_FLAG_NEXTHOP_SELF_ALL;
2291 rc = peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2292 bgp_node_safi (vty), flags);
2293 if ( rc == CMD_SUCCESS && unset )
2294 rc = peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2295 bgp_node_safi (vty), unset);
2299 DEFUN (no_neighbor_nexthop_self,
2300 no_neighbor_nexthop_self_cmd,
2301 NO_NEIGHBOR_CMD2 "next-hop-self {all}",
2305 "Disable the next hop calculation for this neighbor\n"
2306 "Apply also to ibgp-learned routes when acting as a route reflector\n")
2308 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2309 bgp_node_safi (vty),
2310 PEER_FLAG_NEXTHOP_SELF|PEER_FLAG_NEXTHOP_SELF_ALL);
2313 /* neighbor remove-private-AS. */
2314 DEFUN (neighbor_remove_private_as,
2315 neighbor_remove_private_as_cmd,
2316 NEIGHBOR_CMD2 "remove-private-AS",
2319 "Remove private AS number from outbound updates\n")
2321 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2322 bgp_node_safi (vty),
2323 PEER_FLAG_REMOVE_PRIVATE_AS);
2326 DEFUN (no_neighbor_remove_private_as,
2327 no_neighbor_remove_private_as_cmd,
2328 NO_NEIGHBOR_CMD2 "remove-private-AS",
2332 "Remove private AS number from outbound updates\n")
2334 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2335 bgp_node_safi (vty),
2336 PEER_FLAG_REMOVE_PRIVATE_AS);
2339 /* neighbor send-community. */
2340 DEFUN (neighbor_send_community,
2341 neighbor_send_community_cmd,
2342 NEIGHBOR_CMD2 "send-community",
2345 "Send Community attribute to this neighbor\n")
2347 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2348 bgp_node_safi (vty),
2349 PEER_FLAG_SEND_COMMUNITY);
2352 DEFUN (no_neighbor_send_community,
2353 no_neighbor_send_community_cmd,
2354 NO_NEIGHBOR_CMD2 "send-community",
2358 "Send Community attribute to this neighbor\n")
2360 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2361 bgp_node_safi (vty),
2362 PEER_FLAG_SEND_COMMUNITY);
2365 /* neighbor send-community extended. */
2366 DEFUN (neighbor_send_community_type,
2367 neighbor_send_community_type_cmd,
2368 NEIGHBOR_CMD2 "send-community (both|all|extended|standard|large)",
2371 "Send Community attribute to this neighbor\n"
2372 "Send Standard, Large and Extended Community attributes\n"
2373 "Send Standard, Large and Extended Community attributes\n"
2374 "Send Extended Community attributes\n"
2375 "Send Standard Community attributes\n"
2376 "Send Large Community attributes\n")
2378 if (strncmp (argv[1], "s", 1) == 0)
2379 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2380 bgp_node_safi (vty),
2381 PEER_FLAG_SEND_COMMUNITY);
2382 if (strncmp (argv[1], "e", 1) == 0)
2383 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2384 bgp_node_safi (vty),
2385 PEER_FLAG_SEND_EXT_COMMUNITY);
2386 if (strncmp (argv[1], "l", 1) == 0)
2387 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2388 bgp_node_safi (vty),
2389 PEER_FLAG_SEND_LARGE_COMMUNITY);
2391 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2392 bgp_node_safi (vty),
2393 (PEER_FLAG_SEND_COMMUNITY|
2394 PEER_FLAG_SEND_EXT_COMMUNITY|
2395 PEER_FLAG_SEND_LARGE_COMMUNITY));
2398 DEFUN (no_neighbor_send_community_type,
2399 no_neighbor_send_community_type_cmd,
2400 NO_NEIGHBOR_CMD2 "send-community (both|all|extended|standard|large)",
2404 "Send Community attribute to this neighbor\n"
2405 "Send Standard, Large and Extended Community attributes\n"
2406 "Send Standard, Large and Extended Community attributes\n"
2407 "Send Extended Community attributes\n"
2408 "Send Standard Community attributes\n"
2409 "Send Large Community attributes\n")
2411 if (strncmp (argv[1], "s", 1) == 0)
2412 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2413 bgp_node_safi (vty),
2414 PEER_FLAG_SEND_COMMUNITY);
2415 if (strncmp (argv[1], "e", 1) == 0)
2416 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2417 bgp_node_safi (vty),
2418 PEER_FLAG_SEND_EXT_COMMUNITY);
2419 if (strncmp (argv[1], "l", 1) == 0)
2420 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2421 bgp_node_safi (vty),
2422 PEER_FLAG_SEND_LARGE_COMMUNITY);
2424 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2425 bgp_node_safi (vty),
2426 (PEER_FLAG_SEND_COMMUNITY |
2427 PEER_FLAG_SEND_EXT_COMMUNITY|
2428 PEER_FLAG_SEND_LARGE_COMMUNITY));
2431 /* neighbor soft-reconfig. */
2432 DEFUN (neighbor_soft_reconfiguration,
2433 neighbor_soft_reconfiguration_cmd,
2434 NEIGHBOR_CMD2 "soft-reconfiguration inbound",
2437 "Per neighbor soft reconfiguration\n"
2438 "Allow inbound soft reconfiguration for this neighbor\n")
2440 return peer_af_flag_set_vty (vty, argv[0],
2441 bgp_node_afi (vty), bgp_node_safi (vty),
2442 PEER_FLAG_SOFT_RECONFIG);
2445 DEFUN (no_neighbor_soft_reconfiguration,
2446 no_neighbor_soft_reconfiguration_cmd,
2447 NO_NEIGHBOR_CMD2 "soft-reconfiguration inbound",
2451 "Per neighbor soft reconfiguration\n"
2452 "Allow inbound soft reconfiguration for this neighbor\n")
2454 return peer_af_flag_unset_vty (vty, argv[0],
2455 bgp_node_afi (vty), bgp_node_safi (vty),
2456 PEER_FLAG_SOFT_RECONFIG);
2459 DEFUN (neighbor_route_reflector_client,
2460 neighbor_route_reflector_client_cmd,
2461 NEIGHBOR_CMD2 "route-reflector-client",
2464 "Configure a neighbor as Route Reflector client\n")
2469 peer = peer_and_group_lookup_vty (vty, argv[0]);
2473 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2474 bgp_node_safi (vty),
2475 PEER_FLAG_REFLECTOR_CLIENT);
2478 DEFUN (no_neighbor_route_reflector_client,
2479 no_neighbor_route_reflector_client_cmd,
2480 NO_NEIGHBOR_CMD2 "route-reflector-client",
2484 "Configure a neighbor as Route Reflector client\n")
2486 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2487 bgp_node_safi (vty),
2488 PEER_FLAG_REFLECTOR_CLIENT);
2492 peer_rsclient_set_vty (struct vty *vty, const char *peer_str,
2498 struct peer_group *group;
2499 struct listnode *node, *nnode;
2500 struct bgp_filter *pfilter;
2501 struct bgp_filter *gfilter;
2502 int locked_and_added = 0;
2506 peer = peer_and_group_lookup_vty (vty, peer_str);
2510 /* If it is already a RS-Client, don't do anything. */
2511 if ( CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT) )
2514 if ( ! peer_rsclient_active (peer) )
2516 peer = peer_lock (peer); /* rsclient peer list reference */
2517 listnode_add_sort (bgp->rsclient, peer);
2518 locked_and_added = 1;
2521 ret = peer_af_flag_set (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT);
2524 if (locked_and_added)
2526 listnode_delete (bgp->rsclient, peer);
2527 peer_unlock (peer); /* rsclient peer list reference */
2530 return bgp_vty_return (vty, ret);
2533 peer->rib[afi][safi] = bgp_table_init (afi, safi);
2534 peer->rib[afi][safi]->type = BGP_TABLE_RSCLIENT;
2535 /* RIB peer reference. Released when table is free'd in bgp_table_free. */
2536 peer->rib[afi][safi]->owner = peer_lock (peer);
2538 /* Check for existing 'network' and 'redistribute' routes. */
2539 bgp_check_local_routes_rsclient (peer, afi, safi);
2541 /* Check for routes for peers configured with 'soft-reconfiguration'. */
2542 bgp_soft_reconfig_rsclient (peer, afi, safi);
2544 if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
2546 group = peer->group;
2547 gfilter = &peer->filter[afi][safi];
2549 for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
2551 pfilter = &peer->filter[afi][safi];
2553 /* Members of a non-RS-Client group should not be RS-Clients, as that
2554 is checked when the become part of the peer-group */
2555 ret = peer_af_flag_set (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT);
2557 return bgp_vty_return (vty, ret);
2559 /* Make peer's RIB point to group's RIB. */
2560 peer->rib[afi][safi] = group->conf->rib[afi][safi];
2562 /* Import policy. */
2563 if (pfilter->map[RMAP_IMPORT].name)
2564 free (pfilter->map[RMAP_IMPORT].name);
2565 if (gfilter->map[RMAP_IMPORT].name)
2567 pfilter->map[RMAP_IMPORT].name = strdup (gfilter->map[RMAP_IMPORT].name);
2568 pfilter->map[RMAP_IMPORT].map = gfilter->map[RMAP_IMPORT].map;
2572 pfilter->map[RMAP_IMPORT].name = NULL;
2573 pfilter->map[RMAP_IMPORT].map =NULL;
2576 /* Export policy. */
2577 if (gfilter->map[RMAP_EXPORT].name && ! pfilter->map[RMAP_EXPORT].name)
2579 pfilter->map[RMAP_EXPORT].name = strdup (gfilter->map[RMAP_EXPORT].name);
2580 pfilter->map[RMAP_EXPORT].map = gfilter->map[RMAP_EXPORT].map;
2588 peer_rsclient_unset_vty (struct vty *vty, const char *peer_str,
2594 struct peer_group *group;
2595 struct listnode *node, *nnode;
2599 peer = peer_and_group_lookup_vty (vty, peer_str);
2603 /* If it is not a RS-Client, don't do anything. */
2604 if ( ! CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT) )
2607 if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
2609 group = peer->group;
2611 for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
2613 ret = peer_af_flag_unset (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT);
2615 return bgp_vty_return (vty, ret);
2617 peer->rib[afi][safi] = NULL;
2623 ret = peer_af_flag_unset (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT);
2625 return bgp_vty_return (vty, ret);
2627 if ( ! peer_rsclient_active (peer) )
2629 bgp_clear_route (peer, afi, safi, BGP_CLEAR_ROUTE_MY_RSCLIENT);
2630 listnode_delete (bgp->rsclient, peer);
2631 peer_unlock (peer); /* peer bgp rsclient reference */
2634 bgp_table_finish (&peer->rib[bgp_node_afi(vty)][bgp_node_safi(vty)]);
2639 /* neighbor route-server-client. */
2640 DEFUN (neighbor_route_server_client,
2641 neighbor_route_server_client_cmd,
2642 NEIGHBOR_CMD2 "route-server-client",
2645 "Configure a neighbor as Route Server client\n")
2647 return peer_rsclient_set_vty (vty, argv[0], bgp_node_afi(vty),
2648 bgp_node_safi(vty));
2651 DEFUN (no_neighbor_route_server_client,
2652 no_neighbor_route_server_client_cmd,
2653 NO_NEIGHBOR_CMD2 "route-server-client",
2657 "Configure a neighbor as Route Server client\n")
2659 return peer_rsclient_unset_vty (vty, argv[0], bgp_node_afi(vty),
2660 bgp_node_safi(vty));
2663 DEFUN (neighbor_nexthop_local_unchanged,
2664 neighbor_nexthop_local_unchanged_cmd,
2665 NEIGHBOR_CMD2 "nexthop-local unchanged",
2668 "Configure treatment of outgoing link-local nexthop attribute\n"
2669 "Leave link-local nexthop unchanged for this peer\n")
2671 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2672 bgp_node_safi (vty),
2673 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED );
2676 DEFUN (no_neighbor_nexthop_local_unchanged,
2677 no_neighbor_nexthop_local_unchanged_cmd,
2678 NO_NEIGHBOR_CMD2 "nexthop-local unchanged",
2682 "Configure treatment of outgoing link-local-nexthop attribute\n"
2683 "Leave link-local nexthop unchanged for this peer\n")
2685 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2686 bgp_node_safi (vty),
2687 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED );
2690 DEFUN (neighbor_attr_unchanged,
2691 neighbor_attr_unchanged_cmd,
2692 NEIGHBOR_CMD2 "attribute-unchanged",
2695 "BGP attribute is propagated unchanged to this neighbor\n")
2697 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2698 bgp_node_safi (vty),
2699 (PEER_FLAG_AS_PATH_UNCHANGED |
2700 PEER_FLAG_NEXTHOP_UNCHANGED |
2701 PEER_FLAG_MED_UNCHANGED));
2704 DEFUN (neighbor_attr_unchanged1,
2705 neighbor_attr_unchanged1_cmd,
2706 NEIGHBOR_CMD2 "attribute-unchanged (as-path|next-hop|med)",
2709 "BGP attribute is propagated unchanged to this neighbor\n"
2710 "As-path attribute\n"
2711 "Nexthop attribute\n"
2714 u_int16_t flags = 0;
2716 if (strncmp (argv[1], "as-path", 1) == 0)
2717 SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);
2718 else if (strncmp (argv[1], "next-hop", 1) == 0)
2719 SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);
2720 else if (strncmp (argv[1], "med", 1) == 0)
2721 SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);
2723 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2724 bgp_node_safi (vty), flags);
2727 DEFUN (neighbor_attr_unchanged2,
2728 neighbor_attr_unchanged2_cmd,
2729 NEIGHBOR_CMD2 "attribute-unchanged as-path (next-hop|med)",
2732 "BGP attribute is propagated unchanged to this neighbor\n"
2733 "As-path attribute\n"
2734 "Nexthop attribute\n"
2737 u_int16_t flags = PEER_FLAG_AS_PATH_UNCHANGED;
2739 if (strncmp (argv[1], "next-hop", 1) == 0)
2740 SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);
2741 else if (strncmp (argv[1], "med", 1) == 0)
2742 SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);
2744 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2745 bgp_node_safi (vty), flags);
2749 DEFUN (neighbor_attr_unchanged3,
2750 neighbor_attr_unchanged3_cmd,
2751 NEIGHBOR_CMD2 "attribute-unchanged next-hop (as-path|med)",
2754 "BGP attribute is propagated unchanged to this neighbor\n"
2755 "Nexthop attribute\n"
2756 "As-path attribute\n"
2759 u_int16_t flags = PEER_FLAG_NEXTHOP_UNCHANGED;
2761 if (strncmp (argv[1], "as-path", 1) == 0)
2762 SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);
2763 else if (strncmp (argv[1], "med", 1) == 0)
2764 SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);
2766 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2767 bgp_node_safi (vty), flags);
2770 DEFUN (neighbor_attr_unchanged4,
2771 neighbor_attr_unchanged4_cmd,
2772 NEIGHBOR_CMD2 "attribute-unchanged med (as-path|next-hop)",
2775 "BGP attribute is propagated unchanged to this neighbor\n"
2777 "As-path attribute\n"
2778 "Nexthop attribute\n")
2780 u_int16_t flags = PEER_FLAG_MED_UNCHANGED;
2782 if (strncmp (argv[1], "as-path", 1) == 0)
2783 SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);
2784 else if (strncmp (argv[1], "next-hop", 1) == 0)
2785 SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);
2787 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
2788 bgp_node_safi (vty), flags);
2791 ALIAS (neighbor_attr_unchanged,
2792 neighbor_attr_unchanged5_cmd,
2793 NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med",
2796 "BGP attribute is propagated unchanged to this neighbor\n"
2797 "As-path attribute\n"
2798 "Nexthop attribute\n"
2801 ALIAS (neighbor_attr_unchanged,
2802 neighbor_attr_unchanged6_cmd,
2803 NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop",
2806 "BGP attribute is propagated unchanged to this neighbor\n"
2807 "As-path attribute\n"
2809 "Nexthop attribute\n")
2811 ALIAS (neighbor_attr_unchanged,
2812 neighbor_attr_unchanged7_cmd,
2813 NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path",
2816 "BGP attribute is propagated unchanged to this neighbor\n"
2817 "Nexthop attribute\n"
2819 "As-path attribute\n")
2821 ALIAS (neighbor_attr_unchanged,
2822 neighbor_attr_unchanged8_cmd,
2823 NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med",
2826 "BGP attribute is propagated unchanged to this neighbor\n"
2827 "Nexthop attribute\n"
2828 "As-path attribute\n"
2831 ALIAS (neighbor_attr_unchanged,
2832 neighbor_attr_unchanged9_cmd,
2833 NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path",
2836 "BGP attribute is propagated unchanged to this neighbor\n"
2838 "Nexthop attribute\n"
2839 "As-path attribute\n")
2841 ALIAS (neighbor_attr_unchanged,
2842 neighbor_attr_unchanged10_cmd,
2843 NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop",
2846 "BGP attribute is propagated unchanged to this neighbor\n"
2848 "As-path attribute\n"
2849 "Nexthop attribute\n")
2851 DEFUN (no_neighbor_attr_unchanged,
2852 no_neighbor_attr_unchanged_cmd,
2853 NO_NEIGHBOR_CMD2 "attribute-unchanged",
2857 "BGP attribute is propagated unchanged to this neighbor\n")
2859 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2860 bgp_node_safi (vty),
2861 (PEER_FLAG_AS_PATH_UNCHANGED |
2862 PEER_FLAG_NEXTHOP_UNCHANGED |
2863 PEER_FLAG_MED_UNCHANGED));
2866 DEFUN (no_neighbor_attr_unchanged1,
2867 no_neighbor_attr_unchanged1_cmd,
2868 NO_NEIGHBOR_CMD2 "attribute-unchanged (as-path|next-hop|med)",
2872 "BGP attribute is propagated unchanged to this neighbor\n"
2873 "As-path attribute\n"
2874 "Nexthop attribute\n"
2877 u_int16_t flags = 0;
2879 if (strncmp (argv[1], "as-path", 1) == 0)
2880 SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);
2881 else if (strncmp (argv[1], "next-hop", 1) == 0)
2882 SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);
2883 else if (strncmp (argv[1], "med", 1) == 0)
2884 SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);
2886 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2887 bgp_node_safi (vty), flags);
2890 DEFUN (no_neighbor_attr_unchanged2,
2891 no_neighbor_attr_unchanged2_cmd,
2892 NO_NEIGHBOR_CMD2 "attribute-unchanged as-path (next-hop|med)",
2896 "BGP attribute is propagated unchanged to this neighbor\n"
2897 "As-path attribute\n"
2898 "Nexthop attribute\n"
2901 u_int16_t flags = PEER_FLAG_AS_PATH_UNCHANGED;
2903 if (strncmp (argv[1], "next-hop", 1) == 0)
2904 SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);
2905 else if (strncmp (argv[1], "med", 1) == 0)
2906 SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);
2908 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2909 bgp_node_safi (vty), flags);
2912 DEFUN (no_neighbor_attr_unchanged3,
2913 no_neighbor_attr_unchanged3_cmd,
2914 NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop (as-path|med)",
2918 "BGP attribute is propagated unchanged to this neighbor\n"
2919 "Nexthop attribute\n"
2920 "As-path attribute\n"
2923 u_int16_t flags = PEER_FLAG_NEXTHOP_UNCHANGED;
2925 if (strncmp (argv[1], "as-path", 1) == 0)
2926 SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);
2927 else if (strncmp (argv[1], "med", 1) == 0)
2928 SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);
2930 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2931 bgp_node_safi (vty), flags);
2934 DEFUN (no_neighbor_attr_unchanged4,
2935 no_neighbor_attr_unchanged4_cmd,
2936 NO_NEIGHBOR_CMD2 "attribute-unchanged med (as-path|next-hop)",
2940 "BGP attribute is propagated unchanged to this neighbor\n"
2942 "As-path attribute\n"
2943 "Nexthop attribute\n")
2945 u_int16_t flags = PEER_FLAG_MED_UNCHANGED;
2947 if (strncmp (argv[1], "as-path", 1) == 0)
2948 SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);
2949 else if (strncmp (argv[1], "next-hop", 1) == 0)
2950 SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);
2952 return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),
2953 bgp_node_safi (vty), flags);
2956 ALIAS (no_neighbor_attr_unchanged,
2957 no_neighbor_attr_unchanged5_cmd,
2958 NO_NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med",
2962 "BGP attribute is propagated unchanged to this neighbor\n"
2963 "As-path attribute\n"
2964 "Nexthop attribute\n"
2967 ALIAS (no_neighbor_attr_unchanged,
2968 no_neighbor_attr_unchanged6_cmd,
2969 NO_NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop",
2973 "BGP attribute is propagated unchanged to this neighbor\n"
2974 "As-path attribute\n"
2976 "Nexthop attribute\n")
2978 ALIAS (no_neighbor_attr_unchanged,
2979 no_neighbor_attr_unchanged7_cmd,
2980 NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path",
2984 "BGP attribute is propagated unchanged to this neighbor\n"
2985 "Nexthop attribute\n"
2987 "As-path attribute\n")
2989 ALIAS (no_neighbor_attr_unchanged,
2990 no_neighbor_attr_unchanged8_cmd,
2991 NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med",
2995 "BGP attribute is propagated unchanged to this neighbor\n"
2996 "Nexthop attribute\n"
2997 "As-path attribute\n"
3000 ALIAS (no_neighbor_attr_unchanged,
3001 no_neighbor_attr_unchanged9_cmd,
3002 NO_NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path",
3006 "BGP attribute is propagated unchanged to this neighbor\n"
3008 "Nexthop attribute\n"
3009 "As-path attribute\n")
3011 ALIAS (no_neighbor_attr_unchanged,
3012 no_neighbor_attr_unchanged10_cmd,
3013 NO_NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop",
3017 "BGP attribute is propagated unchanged to this neighbor\n"
3019 "As-path attribute\n"
3020 "Nexthop attribute\n")
3022 /* For old version Zebra compatibility. */
3023 DEFUN_DEPRECATED (neighbor_transparent_as,
3024 neighbor_transparent_as_cmd,
3025 NEIGHBOR_CMD "transparent-as",
3028 "Do not append my AS number even peer is EBGP peer\n")
3030 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
3031 bgp_node_safi (vty),
3032 PEER_FLAG_AS_PATH_UNCHANGED);
3035 DEFUN_DEPRECATED (neighbor_transparent_nexthop,
3036 neighbor_transparent_nexthop_cmd,
3037 NEIGHBOR_CMD "transparent-nexthop",
3040 "Do not change nexthop even peer is EBGP peer\n")
3042 return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),
3043 bgp_node_safi (vty),
3044 PEER_FLAG_NEXTHOP_UNCHANGED);
3047 /* EBGP multihop configuration. */
3049 peer_ebgp_multihop_set_vty (struct vty *vty, const char *ip_str,
3050 const char *ttl_str)
3055 peer = peer_and_group_lookup_vty (vty, ip_str);
3062 VTY_GET_INTEGER_RANGE ("TTL", ttl, ttl_str, 1, 255);
3064 return bgp_vty_return (vty, peer_ebgp_multihop_set (peer, ttl));
3068 peer_ebgp_multihop_unset_vty (struct vty *vty, const char *ip_str)
3072 peer = peer_and_group_lookup_vty (vty, ip_str);
3076 return bgp_vty_return (vty, peer_ebgp_multihop_set (peer, 0));
3079 /* neighbor ebgp-multihop. */
3080 DEFUN (neighbor_ebgp_multihop,
3081 neighbor_ebgp_multihop_cmd,
3082 NEIGHBOR_CMD2 "ebgp-multihop",
3085 "Allow EBGP neighbors not on directly connected networks\n")
3087 return peer_ebgp_multihop_set_vty (vty, argv[0], NULL);
3090 DEFUN (neighbor_ebgp_multihop_ttl,
3091 neighbor_ebgp_multihop_ttl_cmd,
3092 NEIGHBOR_CMD2 "ebgp-multihop <1-255>",
3095 "Allow EBGP neighbors not on directly connected networks\n"
3096 "maximum hop count\n")
3098 return peer_ebgp_multihop_set_vty (vty, argv[0], argv[1]);
3101 DEFUN (no_neighbor_ebgp_multihop,
3102 no_neighbor_ebgp_multihop_cmd,
3103 NO_NEIGHBOR_CMD2 "ebgp-multihop",
3107 "Allow EBGP neighbors not on directly connected networks\n")
3109 return peer_ebgp_multihop_unset_vty (vty, argv[0]);
3112 ALIAS (no_neighbor_ebgp_multihop,
3113 no_neighbor_ebgp_multihop_ttl_cmd,
3114 NO_NEIGHBOR_CMD2 "ebgp-multihop <1-255>",
3118 "Allow EBGP neighbors not on directly connected networks\n"
3119 "maximum hop count\n")
3121 /* disable-connected-check */
3122 DEFUN (neighbor_disable_connected_check,
3123 neighbor_disable_connected_check_cmd,
3124 NEIGHBOR_CMD2 "disable-connected-check",
3127 "one-hop away EBGP peer using loopback address\n")
3129 return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DISABLE_CONNECTED_CHECK);
3132 DEFUN (no_neighbor_disable_connected_check,
3133 no_neighbor_disable_connected_check_cmd,
3134 NO_NEIGHBOR_CMD2 "disable-connected-check",
3138 "one-hop away EBGP peer using loopback address\n")
3140 return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DISABLE_CONNECTED_CHECK);
3143 /* Enforce multihop. */
3144 ALIAS (neighbor_disable_connected_check,
3145 neighbor_enforce_multihop_cmd,
3146 NEIGHBOR_CMD2 "enforce-multihop",
3149 "Enforce EBGP neighbors perform multihop\n")
3151 /* Enforce multihop. */
3152 ALIAS (no_neighbor_disable_connected_check,
3153 no_neighbor_enforce_multihop_cmd,
3154 NO_NEIGHBOR_CMD2 "enforce-multihop",
3158 "Enforce EBGP neighbors perform multihop\n")
3160 DEFUN (neighbor_description,
3161 neighbor_description_cmd,
3162 NEIGHBOR_CMD2 "description .LINE",
3165 "Neighbor specific description\n"
3166 "Up to 80 characters describing this neighbor\n")
3171 peer = peer_and_group_lookup_vty (vty, argv[0]);
3178 str = argv_concat(argv, argc, 1);
3180 peer_description_set (peer, str);
3182 XFREE (MTYPE_TMP, str);
3187 DEFUN (no_neighbor_description,
3188 no_neighbor_description_cmd,
3189 NO_NEIGHBOR_CMD2 "description",
3193 "Neighbor specific description\n")
3197 peer = peer_and_group_lookup_vty (vty, argv[0]);
3201 peer_description_unset (peer);
3206 ALIAS (no_neighbor_description,
3207 no_neighbor_description_val_cmd,
3208 NO_NEIGHBOR_CMD2 "description .LINE",
3212 "Neighbor specific description\n"
3213 "Up to 80 characters describing this neighbor\n")
3215 /* Neighbor update-source. */
3217 peer_update_source_vty (struct vty *vty, const char *peer_str,
3218 const char *source_str)
3222 peer = peer_and_group_lookup_vty (vty, peer_str);
3229 int ret = str2sockunion (source_str, &su);
3232 peer_update_source_addr_set (peer, &su);
3234 peer_update_source_if_set (peer, source_str);
3237 peer_update_source_unset (peer);
3242 #define BGP_UPDATE_SOURCE_STR "(A.B.C.D|X:X::X:X|WORD)"
3243 #define BGP_UPDATE_SOURCE_HELP_STR \
3246 "Interface name (requires zebra to be running)\n"
3248 DEFUN (neighbor_update_source,
3249 neighbor_update_source_cmd,
3250 NEIGHBOR_CMD2 "update-source " BGP_UPDATE_SOURCE_STR,
3253 "Source of routing updates\n"
3254 BGP_UPDATE_SOURCE_HELP_STR)
3256 return peer_update_source_vty (vty, argv[0], argv[1]);
3259 DEFUN (no_neighbor_update_source,
3260 no_neighbor_update_source_cmd,
3261 NO_NEIGHBOR_CMD2 "update-source",
3265 "Source of routing updates\n")
3267 return peer_update_source_vty (vty, argv[0], NULL);
3271 peer_default_originate_set_vty (struct vty *vty, const char *peer_str,
3272 afi_t afi, safi_t safi,
3273 const char *rmap, int set)
3278 peer = peer_and_group_lookup_vty (vty, peer_str);
3283 ret = peer_default_originate_set (peer, afi, safi, rmap);
3285 ret = peer_default_originate_unset (peer, afi, safi);
3287 return bgp_vty_return (vty, ret);
3290 /* neighbor default-originate. */
3291 DEFUN (neighbor_default_originate,
3292 neighbor_default_originate_cmd,
3293 NEIGHBOR_CMD2 "default-originate",
3296 "Originate default route to this neighbor\n")
3298 return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty),
3299 bgp_node_safi (vty), NULL, 1);
3302 DEFUN (neighbor_default_originate_rmap,
3303 neighbor_default_originate_rmap_cmd,
3304 NEIGHBOR_CMD2 "default-originate route-map WORD",
3307 "Originate default route to this neighbor\n"
3308 "Route-map to specify criteria to originate default\n"
3311 return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty),
3312 bgp_node_safi (vty), argv[1], 1);
3315 DEFUN (no_neighbor_default_originate,
3316 no_neighbor_default_originate_cmd,
3317 NO_NEIGHBOR_CMD2 "default-originate",
3321 "Originate default route to this neighbor\n")
3323 return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty),
3324 bgp_node_safi (vty), NULL, 0);
3327 ALIAS (no_neighbor_default_originate,
3328 no_neighbor_default_originate_rmap_cmd,
3329 NO_NEIGHBOR_CMD2 "default-originate route-map WORD",
3333 "Originate default route to this neighbor\n"
3334 "Route-map to specify criteria to originate default\n"
3337 /* Set neighbor's BGP port. */
3339 peer_port_vty (struct vty *vty, const char *ip_str, int afi,
3340 const char *port_str)
3346 peer = peer_lookup_vty (vty, ip_str);
3352 sp = getservbyname ("bgp", "tcp");
3353 port = (sp == NULL) ? BGP_PORT_DEFAULT : ntohs (sp->s_port);
3357 VTY_GET_INTEGER("port", port, port_str);
3360 peer_port_set (peer, port);
3365 /* Set specified peer's BGP port. */
3366 DEFUN (neighbor_port,
3368 NEIGHBOR_CMD "port <0-65535>",
3371 "Neighbor's BGP port\n"
3372 "TCP port number\n")
3374 return peer_port_vty (vty, argv[0], AFI_IP, argv[1]);
3377 DEFUN (no_neighbor_port,
3378 no_neighbor_port_cmd,
3379 NO_NEIGHBOR_CMD "port",
3383 "Neighbor's BGP port\n")
3385 return peer_port_vty (vty, argv[0], AFI_IP, NULL);
3388 ALIAS (no_neighbor_port,
3389 no_neighbor_port_val_cmd,
3390 NO_NEIGHBOR_CMD "port <0-65535>",
3394 "Neighbor's BGP port\n"
3395 "TCP port number\n")
3397 /* neighbor weight. */
3399 peer_weight_set_vty (struct vty *vty, const char *ip_str,
3400 const char *weight_str)
3403 unsigned long weight;
3405 peer = peer_and_group_lookup_vty (vty, ip_str);
3409 VTY_GET_INTEGER_RANGE("weight", weight, weight_str, 0, 65535);
3411 return bgp_vty_return (vty, peer_weight_set (peer, weight));
3415 peer_weight_unset_vty (struct vty *vty, const char *ip_str)
3419 peer = peer_and_group_lookup_vty (vty, ip_str);
3423 return bgp_vty_return (vty, peer_weight_unset (peer));
3426 DEFUN (neighbor_weight,
3427 neighbor_weight_cmd,
3428 NEIGHBOR_CMD2 "weight <0-65535>",
3431 "Set default weight for routes from this neighbor\n"
3434 return peer_weight_set_vty (vty, argv[0], argv[1]);
3437 DEFUN (no_neighbor_weight,
3438 no_neighbor_weight_cmd,
3439 NO_NEIGHBOR_CMD2 "weight",
3443 "Set default weight for routes from this neighbor\n")
3445 return peer_weight_unset_vty (vty, argv[0]);
3448 ALIAS (no_neighbor_weight,
3449 no_neighbor_weight_val_cmd,
3450 NO_NEIGHBOR_CMD2 "weight <0-65535>",
3454 "Set default weight for routes from this neighbor\n"
3457 /* Override capability negotiation. */
3458 DEFUN (neighbor_override_capability,
3459 neighbor_override_capability_cmd,
3460 NEIGHBOR_CMD2 "override-capability",
3463 "Override capability negotiation result\n")
3465 return peer_flag_set_vty (vty, argv[0], PEER_FLAG_OVERRIDE_CAPABILITY);
3468 DEFUN (no_neighbor_override_capability,
3469 no_neighbor_override_capability_cmd,
3470 NO_NEIGHBOR_CMD2 "override-capability",
3474 "Override capability negotiation result\n")
3476 return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_OVERRIDE_CAPABILITY);
3479 DEFUN (neighbor_strict_capability,
3480 neighbor_strict_capability_cmd,
3481 NEIGHBOR_CMD "strict-capability-match",
3484 "Strict capability negotiation match\n")
3486 return peer_flag_set_vty (vty, argv[0], PEER_FLAG_STRICT_CAP_MATCH);
3489 DEFUN (no_neighbor_strict_capability,
3490 no_neighbor_strict_capability_cmd,
3491 NO_NEIGHBOR_CMD "strict-capability-match",
3495 "Strict capability negotiation match\n")
3497 return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_STRICT_CAP_MATCH);
3501 peer_timers_set_vty (struct vty *vty, const char *ip_str,
3502 const char *keep_str, const char *hold_str)
3506 u_int32_t keepalive;
3509 peer = peer_and_group_lookup_vty (vty, ip_str);
3513 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive, keep_str, 0, 65535);
3514 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime, hold_str, 0, 65535);
3516 ret = peer_timers_set (peer, keepalive, holdtime);
3518 return bgp_vty_return (vty, ret);
3522 peer_timers_unset_vty (struct vty *vty, const char *ip_str)
3527 peer = peer_lookup_vty (vty, ip_str);
3531 ret = peer_timers_unset (peer);
3533 return bgp_vty_return (vty, ret);
3536 DEFUN (neighbor_timers,
3537 neighbor_timers_cmd,
3538 NEIGHBOR_CMD2 "timers <0-65535> <0-65535>",
3541 "BGP per neighbor timers\n"
3542 "Keepalive interval\n"
3545 return peer_timers_set_vty (vty, argv[0], argv[1], argv[2]);
3548 DEFUN (no_neighbor_timers,
3549 no_neighbor_timers_cmd,
3550 NO_NEIGHBOR_CMD2 "timers",
3554 "BGP per neighbor timers\n")
3556 return peer_timers_unset_vty (vty, argv[0]);
3560 peer_timers_connect_set_vty (struct vty *vty, const char *ip_str,
3561 const char *time_str)
3566 peer = peer_and_group_lookup_vty (vty, ip_str);
3570 VTY_GET_INTEGER_RANGE ("Connect time", connect, time_str, 0, 65535);
3572 return bgp_vty_return (vty, peer_timers_connect_set (peer, connect));
3576 peer_timers_connect_unset_vty (struct vty *vty, const char *ip_str)
3580 peer = peer_and_group_lookup_vty (vty, ip_str);
3584 return bgp_vty_return (vty, peer_timers_connect_unset (peer));
3587 DEFUN (neighbor_timers_connect,
3588 neighbor_timers_connect_cmd,
3589 NEIGHBOR_CMD2 "timers connect <1-65535>",
3592 "BGP per neighbor timers\n"
3593 "BGP connect timer\n"
3596 return peer_timers_connect_set_vty (vty, argv[0], argv[1]);
3599 DEFUN (no_neighbor_timers_connect,
3600 no_neighbor_timers_connect_cmd,
3601 NO_NEIGHBOR_CMD2 "timers connect",
3605 "BGP per neighbor timers\n"
3606 "BGP connect timer\n")
3608 return peer_timers_connect_unset_vty (vty, argv[0]);
3611 ALIAS (no_neighbor_timers_connect,
3612 no_neighbor_timers_connect_val_cmd,
3613 NO_NEIGHBOR_CMD2 "timers connect <1-65535>",
3617 "BGP per neighbor timers\n"
3618 "BGP connect timer\n"
3622 peer_advertise_interval_vty (struct vty *vty, const char *ip_str,
3623 const char *time_str, int set)
3627 u_int32_t routeadv = 0;
3629 peer = peer_and_group_lookup_vty (vty, ip_str);
3634 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv, time_str, 0, 600);
3637 ret = peer_advertise_interval_set (peer, routeadv);
3639 ret = peer_advertise_interval_unset (peer);
3641 return bgp_vty_return (vty, ret);
3644 DEFUN (neighbor_advertise_interval,
3645 neighbor_advertise_interval_cmd,
3646 NEIGHBOR_CMD2 "advertisement-interval <0-600>",
3649 "Minimum interval between sending BGP routing updates\n"
3650 "time in seconds\n")
3652 return peer_advertise_interval_vty (vty, argv[0], argv[1], 1);
3655 DEFUN (no_neighbor_advertise_interval,
3656 no_neighbor_advertise_interval_cmd,
3657 NO_NEIGHBOR_CMD2 "advertisement-interval",
3661 "Minimum interval between sending BGP routing updates\n")
3663 return peer_advertise_interval_vty (vty, argv[0], NULL, 0);
3666 ALIAS (no_neighbor_advertise_interval,
3667 no_neighbor_advertise_interval_val_cmd,
3668 NO_NEIGHBOR_CMD2 "advertisement-interval <0-600>",
3672 "Minimum interval between sending BGP routing updates\n"
3673 "time in seconds\n")
3675 /* neighbor interface */
3677 peer_interface_vty (struct vty *vty, const char *ip_str, const char *str)
3682 peer = peer_lookup_vty (vty, ip_str);
3687 ret = peer_interface_set (peer, str);
3689 ret = peer_interface_unset (peer);
3691 return bgp_vty_return (vty, ret);
3694 DEFUN (neighbor_interface,
3695 neighbor_interface_cmd,
3696 NEIGHBOR_CMD "interface WORD",
3702 return peer_interface_vty (vty, argv[0], argv[1]);
3705 DEFUN (no_neighbor_interface,
3706 no_neighbor_interface_cmd,
3707 NO_NEIGHBOR_CMD "interface WORD",
3714 return peer_interface_vty (vty, argv[0], NULL);
3717 /* Set distribute list to the peer. */
3719 peer_distribute_set_vty (struct vty *vty, const char *ip_str,
3720 afi_t afi, safi_t safi,
3721 const char *name_str, const char *direct_str)
3725 int direct = FILTER_IN;
3727 peer = peer_and_group_lookup_vty (vty, ip_str);
3731 /* Check filter direction. */
3732 if (strncmp (direct_str, "i", 1) == 0)
3734 else if (strncmp (direct_str, "o", 1) == 0)
3735 direct = FILTER_OUT;
3737 ret = peer_distribute_set (peer, afi, safi, direct, name_str);
3739 return bgp_vty_return (vty, ret);
3743 peer_distribute_unset_vty (struct vty *vty, const char *ip_str, afi_t afi,
3744 safi_t safi, const char *direct_str)
3748 int direct = FILTER_IN;
3750 peer = peer_and_group_lookup_vty (vty, ip_str);
3754 /* Check filter direction. */
3755 if (strncmp (direct_str, "i", 1) == 0)
3757 else if (strncmp (direct_str, "o", 1) == 0)
3758 direct = FILTER_OUT;
3760 ret = peer_distribute_unset (peer, afi, safi, direct);
3762 return bgp_vty_return (vty, ret);
3765 DEFUN (neighbor_distribute_list,
3766 neighbor_distribute_list_cmd,
3767 NEIGHBOR_CMD2 "distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3770 "Filter updates to/from this neighbor\n"
3771 "IP access-list number\n"
3772 "IP access-list number (expanded range)\n"
3773 "IP Access-list name\n"
3774 "Filter incoming updates\n"
3775 "Filter outgoing updates\n")
3777 return peer_distribute_set_vty (vty, argv[0], bgp_node_afi (vty),
3778 bgp_node_safi (vty), argv[1], argv[2]);
3781 DEFUN (no_neighbor_distribute_list,
3782 no_neighbor_distribute_list_cmd,
3783 NO_NEIGHBOR_CMD2 "distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3787 "Filter updates to/from this neighbor\n"
3788 "IP access-list number\n"
3789 "IP access-list number (expanded range)\n"
3790 "IP Access-list name\n"
3791 "Filter incoming updates\n"
3792 "Filter outgoing updates\n")
3794 return peer_distribute_unset_vty (vty, argv[0], bgp_node_afi (vty),
3795 bgp_node_safi (vty), argv[2]);
3798 /* Set prefix list to the peer. */
3800 peer_prefix_list_set_vty (struct vty *vty, const char *ip_str, afi_t afi,
3801 safi_t safi, const char *name_str,
3802 const char *direct_str)
3806 int direct = FILTER_IN;
3808 peer = peer_and_group_lookup_vty (vty, ip_str);
3812 /* Check filter direction. */
3813 if (strncmp (direct_str, "i", 1) == 0)
3815 else if (strncmp (direct_str, "o", 1) == 0)
3816 direct = FILTER_OUT;
3818 ret = peer_prefix_list_set (peer, afi, safi, direct, name_str);
3820 return bgp_vty_return (vty, ret);
3824 peer_prefix_list_unset_vty (struct vty *vty, const char *ip_str, afi_t afi,
3825 safi_t safi, const char *direct_str)
3829 int direct = FILTER_IN;
3831 peer = peer_and_group_lookup_vty (vty, ip_str);
3835 /* Check filter direction. */
3836 if (strncmp (direct_str, "i", 1) == 0)
3838 else if (strncmp (direct_str, "o", 1) == 0)
3839 direct = FILTER_OUT;
3841 ret = peer_prefix_list_unset (peer, afi, safi, direct);
3843 return bgp_vty_return (vty, ret);
3846 DEFUN (neighbor_prefix_list,
3847 neighbor_prefix_list_cmd,
3848 NEIGHBOR_CMD2 "prefix-list WORD (in|out)",
3851 "Filter updates to/from this neighbor\n"
3852 "Name of a prefix list\n"
3853 "Filter incoming updates\n"
3854 "Filter outgoing updates\n")
3856 return peer_prefix_list_set_vty (vty, argv[0], bgp_node_afi (vty),
3857 bgp_node_safi (vty), argv[1], argv[2]);
3860 DEFUN (no_neighbor_prefix_list,
3861 no_neighbor_prefix_list_cmd,
3862 NO_NEIGHBOR_CMD2 "prefix-list WORD (in|out)",
3866 "Filter updates to/from this neighbor\n"
3867 "Name of a prefix list\n"
3868 "Filter incoming updates\n"
3869 "Filter outgoing updates\n")
3871 return peer_prefix_list_unset_vty (vty, argv[0], bgp_node_afi (vty),
3872 bgp_node_safi (vty), argv[2]);
3876 peer_aslist_set_vty (struct vty *vty, const char *ip_str,
3877 afi_t afi, safi_t safi,
3878 const char *name_str, const char *direct_str)
3882 int direct = FILTER_IN;
3884 peer = peer_and_group_lookup_vty (vty, ip_str);
3888 /* Check filter direction. */
3889 if (strncmp (direct_str, "i", 1) == 0)
3891 else if (strncmp (direct_str, "o", 1) == 0)
3892 direct = FILTER_OUT;
3894 ret = peer_aslist_set (peer, afi, safi, direct, name_str);
3896 return bgp_vty_return (vty, ret);
3900 peer_aslist_unset_vty (struct vty *vty, const char *ip_str,
3901 afi_t afi, safi_t safi,
3902 const char *direct_str)
3906 int direct = FILTER_IN;
3908 peer = peer_and_group_lookup_vty (vty, ip_str);
3912 /* Check filter direction. */
3913 if (strncmp (direct_str, "i", 1) == 0)
3915 else if (strncmp (direct_str, "o", 1) == 0)
3916 direct = FILTER_OUT;
3918 ret = peer_aslist_unset (peer, afi, safi, direct);
3920 return bgp_vty_return (vty, ret);
3923 DEFUN (neighbor_filter_list,
3924 neighbor_filter_list_cmd,
3925 NEIGHBOR_CMD2 "filter-list WORD (in|out)",
3928 "Establish BGP filters\n"
3929 "AS path access-list name\n"
3930 "Filter incoming routes\n"
3931 "Filter outgoing routes\n")
3933 return peer_aslist_set_vty (vty, argv[0], bgp_node_afi (vty),
3934 bgp_node_safi (vty), argv[1], argv[2]);
3937 DEFUN (no_neighbor_filter_list,
3938 no_neighbor_filter_list_cmd,
3939 NO_NEIGHBOR_CMD2 "filter-list WORD (in|out)",
3943 "Establish BGP filters\n"
3944 "AS path access-list name\n"
3945 "Filter incoming routes\n"
3946 "Filter outgoing routes\n")
3948 return peer_aslist_unset_vty (vty, argv[0], bgp_node_afi (vty),
3949 bgp_node_safi (vty), argv[2]);
3952 /* Set route-map to the peer. */
3954 peer_route_map_set_vty (struct vty *vty, const char *ip_str,
3955 afi_t afi, safi_t safi,
3956 const char *name_str, const char *direct_str)
3960 int direct = RMAP_IN;
3962 peer = peer_and_group_lookup_vty (vty, ip_str);
3966 /* Check filter direction. */
3967 if (strncmp (direct_str, "in", 2) == 0)
3969 else if (strncmp (direct_str, "o", 1) == 0)
3971 else if (strncmp (direct_str, "im", 2) == 0)
3972 direct = RMAP_IMPORT;
3973 else if (strncmp (direct_str, "e", 1) == 0)
3974 direct = RMAP_EXPORT;
3976 ret = peer_route_map_set (peer, afi, safi, direct, name_str);
3978 return bgp_vty_return (vty, ret);
3982 peer_route_map_unset_vty (struct vty *vty, const char *ip_str, afi_t afi,
3983 safi_t safi, const char *direct_str)
3987 int direct = RMAP_IN;
3989 peer = peer_and_group_lookup_vty (vty, ip_str);
3993 /* Check filter direction. */
3994 if (strncmp (direct_str, "in", 2) == 0)
3996 else if (strncmp (direct_str, "o", 1) == 0)
3998 else if (strncmp (direct_str, "im", 2) == 0)
3999 direct = RMAP_IMPORT;
4000 else if (strncmp (direct_str, "e", 1) == 0)
4001 direct = RMAP_EXPORT;
4003 ret = peer_route_map_unset (peer, afi, safi, direct);
4005 return bgp_vty_return (vty, ret);
4008 DEFUN (neighbor_route_map,
4009 neighbor_route_map_cmd,
4010 NEIGHBOR_CMD2 "route-map WORD (in|out|import|export)",
4013 "Apply route map to neighbor\n"
4014 "Name of route map\n"
4015 "Apply map to incoming routes\n"
4016 "Apply map to outbound routes\n"
4017 "Apply map to routes going into a Route-Server client's table\n"
4018 "Apply map to routes coming from a Route-Server client")
4020 return peer_route_map_set_vty (vty, argv[0], bgp_node_afi (vty),
4021 bgp_node_safi (vty), argv[1], argv[2]);
4024 DEFUN (no_neighbor_route_map,
4025 no_neighbor_route_map_cmd,
4026 NO_NEIGHBOR_CMD2 "route-map WORD (in|out|import|export)",
4030 "Apply route map to neighbor\n"
4031 "Name of route map\n"
4032 "Apply map to incoming routes\n"
4033 "Apply map to outbound routes\n"
4034 "Apply map to routes going into a Route-Server client's table\n"
4035 "Apply map to routes coming from a Route-Server client")
4037 return peer_route_map_unset_vty (vty, argv[0], bgp_node_afi (vty),
4038 bgp_node_safi (vty), argv[2]);
4041 /* Set unsuppress-map to the peer. */
4043 peer_unsuppress_map_set_vty (struct vty *vty, const char *ip_str, afi_t afi,
4044 safi_t safi, const char *name_str)
4049 peer = peer_and_group_lookup_vty (vty, ip_str);
4053 ret = peer_unsuppress_map_set (peer, afi, safi, name_str);
4055 return bgp_vty_return (vty, ret);
4058 /* Unset route-map from the peer. */
4060 peer_unsuppress_map_unset_vty (struct vty *vty, const char *ip_str, afi_t afi,
4066 peer = peer_and_group_lookup_vty (vty, ip_str);
4070 ret = peer_unsuppress_map_unset (peer, afi, safi);
4072 return bgp_vty_return (vty, ret);
4075 DEFUN (neighbor_unsuppress_map,
4076 neighbor_unsuppress_map_cmd,
4077 NEIGHBOR_CMD2 "unsuppress-map WORD",
4080 "Route-map to selectively unsuppress suppressed routes\n"
4081 "Name of route map\n")
4083 return peer_unsuppress_map_set_vty (vty, argv[0], bgp_node_afi (vty),
4084 bgp_node_safi (vty), argv[1]);
4087 DEFUN (no_neighbor_unsuppress_map,
4088 no_neighbor_unsuppress_map_cmd,
4089 NO_NEIGHBOR_CMD2 "unsuppress-map WORD",
4093 "Route-map to selectively unsuppress suppressed routes\n"
4094 "Name of route map\n")
4096 return peer_unsuppress_map_unset_vty (vty, argv[0], bgp_node_afi (vty),
4097 bgp_node_safi (vty));
4101 peer_maximum_prefix_set_vty (struct vty *vty, const char *ip_str, afi_t afi,
4102 safi_t safi, const char *num_str,
4103 const char *threshold_str, int warning,
4104 const char *restart_str)
4112 peer = peer_and_group_lookup_vty (vty, ip_str);
4116 VTY_GET_INTEGER ("maximum number", max, num_str);
4118 threshold = atoi (threshold_str);
4120 threshold = MAXIMUM_PREFIX_THRESHOLD_DEFAULT;
4123 restart = atoi (restart_str);
4127 ret = peer_maximum_prefix_set (peer, afi, safi, max, threshold, warning, restart);
4129 return bgp_vty_return (vty, ret);
4133 peer_maximum_prefix_unset_vty (struct vty *vty, const char *ip_str, afi_t afi,
4139 peer = peer_and_group_lookup_vty (vty, ip_str);
4143 ret = peer_maximum_prefix_unset (peer, afi, safi);
4145 return bgp_vty_return (vty, ret);
4148 /* Maximum number of prefix configuration. prefix count is different
4149 for each peer configuration. So this configuration can be set for
4150 each peer configuration. */
4151 DEFUN (neighbor_maximum_prefix,
4152 neighbor_maximum_prefix_cmd,
4153 NEIGHBOR_CMD2 "maximum-prefix <1-4294967295>",
4156 "Maximum number of prefix accept from this peer\n"
4157 "maximum no. of prefix limit\n")
4159 return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty),
4160 bgp_node_safi (vty), argv[1], NULL, 0,
4164 DEFUN (neighbor_maximum_prefix_threshold,
4165 neighbor_maximum_prefix_threshold_cmd,
4166 NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100>",
4169 "Maximum number of prefix accept from this peer\n"
4170 "maximum no. of prefix limit\n"
4171 "Threshold value (%) at which to generate a warning msg\n")
4173 return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty),
4174 bgp_node_safi (vty), argv[1], argv[2], 0,
4178 DEFUN (neighbor_maximum_prefix_warning,
4179 neighbor_maximum_prefix_warning_cmd,
4180 NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only",
4183 "Maximum number of prefix accept from this peer\n"
4184 "maximum no. of prefix limit\n"
4185 "Only give warning message when limit is exceeded\n")
4187 return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty),
4188 bgp_node_safi (vty), argv[1], NULL, 1,
4192 DEFUN (neighbor_maximum_prefix_threshold_warning,
4193 neighbor_maximum_prefix_threshold_warning_cmd,
4194 NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> warning-only",
4197 "Maximum number of prefix accept from this peer\n"
4198 "maximum no. of prefix limit\n"
4199 "Threshold value (%) at which to generate a warning msg\n"
4200 "Only give warning message when limit is exceeded\n")
4202 return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty),
4203 bgp_node_safi (vty), argv[1], argv[2], 1, NULL);
4206 DEFUN (neighbor_maximum_prefix_restart,
4207 neighbor_maximum_prefix_restart_cmd,
4208 NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> restart <1-65535>",
4211 "Maximum number of prefix accept from this peer\n"
4212 "maximum no. of prefix limit\n"
4213 "Restart bgp connection after limit is exceeded\n"
4214 "Restart interval in minutes")
4216 return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty),
4217 bgp_node_safi (vty), argv[1], NULL, 0, argv[2]);
4220 DEFUN (neighbor_maximum_prefix_threshold_restart,
4221 neighbor_maximum_prefix_threshold_restart_cmd,
4222 NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
4225 "Maximum number of prefix accept from this peer\n"
4226 "maximum no. of prefix limit\n"
4227 "Threshold value (%) at which to generate a warning msg\n"
4228 "Restart bgp connection after limit is exceeded\n"
4229 "Restart interval in minutes")
4231 return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty),
4232 bgp_node_safi (vty), argv[1], argv[2], 0, argv[3]);
4235 DEFUN (no_neighbor_maximum_prefix,
4236 no_neighbor_maximum_prefix_cmd,
4237 NO_NEIGHBOR_CMD2 "maximum-prefix",
4241 "Maximum number of prefix accept from this peer\n")
4243 return peer_maximum_prefix_unset_vty (vty, argv[0], bgp_node_afi (vty),
4244 bgp_node_safi (vty));
4247 ALIAS (no_neighbor_maximum_prefix,
4248 no_neighbor_maximum_prefix_val_cmd,
4249 NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295>",
4253 "Maximum number of prefix accept from this peer\n"
4254 "maximum no. of prefix limit\n")
4256 ALIAS (no_neighbor_maximum_prefix,
4257 no_neighbor_maximum_prefix_threshold_cmd,
4258 NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only",
4262 "Maximum number of prefix accept from this peer\n"
4263 "maximum no. of prefix limit\n"
4264 "Threshold value (%) at which to generate a warning msg\n")
4266 ALIAS (no_neighbor_maximum_prefix,
4267 no_neighbor_maximum_prefix_warning_cmd,
4268 NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only",
4272 "Maximum number of prefix accept from this peer\n"
4273 "maximum no. of prefix limit\n"
4274 "Only give warning message when limit is exceeded\n")
4276 ALIAS (no_neighbor_maximum_prefix,
4277 no_neighbor_maximum_prefix_threshold_warning_cmd,
4278 NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> warning-only",
4282 "Maximum number of prefix accept from this peer\n"
4283 "maximum no. of prefix limit\n"
4284 "Threshold value (%) at which to generate a warning msg\n"
4285 "Only give warning message when limit is exceeded\n")
4287 ALIAS (no_neighbor_maximum_prefix,
4288 no_neighbor_maximum_prefix_restart_cmd,
4289 NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> restart <1-65535>",
4293 "Maximum number of prefix accept from this peer\n"
4294 "maximum no. of prefix limit\n"
4295 "Restart bgp connection after limit is exceeded\n"
4296 "Restart interval in minutes")
4298 ALIAS (no_neighbor_maximum_prefix,
4299 no_neighbor_maximum_prefix_threshold_restart_cmd,
4300 NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
4304 "Maximum number of prefix accept from this peer\n"
4305 "maximum no. of prefix limit\n"
4306 "Threshold value (%) at which to generate a warning msg\n"
4307 "Restart bgp connection after limit is exceeded\n"
4308 "Restart interval in minutes")
4310 /* "neighbor allowas-in" */
4311 DEFUN (neighbor_allowas_in,
4312 neighbor_allowas_in_cmd,
4313 NEIGHBOR_CMD2 "allowas-in",
4316 "Accept as-path with my AS present in it\n")
4320 unsigned int allow_num;
4322 peer = peer_and_group_lookup_vty (vty, argv[0]);
4329 VTY_GET_INTEGER_RANGE ("AS number", allow_num, argv[1], 1, 10);
4331 ret = peer_allowas_in_set (peer, bgp_node_afi (vty), bgp_node_safi (vty),
4334 return bgp_vty_return (vty, ret);
4337 ALIAS (neighbor_allowas_in,
4338 neighbor_allowas_in_arg_cmd,
4339 NEIGHBOR_CMD2 "allowas-in <1-10>",
4342 "Accept as-path with my AS present in it\n"
4343 "Number of occurrences of AS number\n")
4345 DEFUN (no_neighbor_allowas_in,
4346 no_neighbor_allowas_in_cmd,
4347 NO_NEIGHBOR_CMD2 "allowas-in",
4351 "allow local ASN appears in aspath attribute\n")
4356 peer = peer_and_group_lookup_vty (vty, argv[0]);
4360 ret = peer_allowas_in_unset (peer, bgp_node_afi (vty), bgp_node_safi (vty));
4362 return bgp_vty_return (vty, ret);
4365 DEFUN (neighbor_ttl_security,
4366 neighbor_ttl_security_cmd,
4367 NEIGHBOR_CMD2 "ttl-security hops <1-254>",
4370 "Specify the maximum number of hops to the BGP peer\n")
4375 peer = peer_and_group_lookup_vty (vty, argv[0]);
4379 VTY_GET_INTEGER_RANGE ("", gtsm_hops, argv[1], 1, 254);
4381 return bgp_vty_return (vty, peer_ttl_security_hops_set (peer, gtsm_hops));
4384 DEFUN (no_neighbor_ttl_security,
4385 no_neighbor_ttl_security_cmd,
4386 NO_NEIGHBOR_CMD2 "ttl-security hops <1-254>",
4390 "Specify the maximum number of hops to the BGP peer\n")
4394 peer = peer_and_group_lookup_vty (vty, argv[0]);
4398 return bgp_vty_return (vty, peer_ttl_security_hops_set (peer, 0));
4401 /* Address family configuration. */
4402 DEFUN (address_family_ipv4,
4403 address_family_ipv4_cmd,
4404 "address-family ipv4",
4405 "Enter Address Family command mode\n"
4408 vty->node = BGP_IPV4_NODE;
4412 DEFUN (address_family_ipv4_safi,
4413 address_family_ipv4_safi_cmd,
4414 "address-family ipv4 (unicast|multicast)",
4415 "Enter Address Family command mode\n"
4417 "Address Family modifier\n"
4418 "Address Family modifier\n")
4420 if (strncmp (argv[0], "m", 1) == 0)
4421 vty->node = BGP_IPV4M_NODE;
4423 vty->node = BGP_IPV4_NODE;
4428 DEFUN (address_family_ipv6,
4429 address_family_ipv6_cmd,
4430 "address-family ipv6",
4431 "Enter Address Family command mode\n"
4434 vty->node = BGP_IPV6_NODE;
4438 DEFUN (address_family_ipv6_safi,
4439 address_family_ipv6_safi_cmd,
4440 "address-family ipv6 (unicast|multicast)",
4441 "Enter Address Family command mode\n"
4443 "Address Family modifier\n"
4444 "Address Family modifier\n")
4446 if (strncmp (argv[0], "m", 1) == 0)
4447 vty->node = BGP_IPV6M_NODE;
4449 vty->node = BGP_IPV6_NODE;
4454 DEFUN (address_family_vpnv4,
4455 address_family_vpnv4_cmd,
4456 "address-family vpnv4",
4457 "Enter Address Family command mode\n"
4460 vty->node = BGP_VPNV4_NODE;
4464 ALIAS (address_family_vpnv4,
4465 address_family_vpnv4_unicast_cmd,
4466 "address-family vpnv4 unicast",
4467 "Enter Address Family command mode\n"
4469 "Address Family Modifier\n")
4471 DEFUN (address_family_vpnv6,
4472 address_family_vpnv6_cmd,
4473 "address-family vpnv6",
4474 "Enter Address Family command mode\n"
4477 vty->node = BGP_VPNV6_NODE;
4481 ALIAS (address_family_vpnv6,
4482 address_family_vpnv6_unicast_cmd,
4483 "address-family vpnv6 unicast",
4484 "Enter Address Family command mode\n"
4486 "Address Family Modifier\n")
4488 DEFUN (address_family_encap,
4489 address_family_encap_cmd,
4490 "address-family encap",
4491 "Enter Address Family command mode\n"
4494 vty->node = BGP_ENCAP_NODE;
4498 ALIAS (address_family_encap,
4499 address_family_encapv4_cmd,
4500 "address-family encapv4",
4501 "Enter Address Family command mode\n"
4504 DEFUN (address_family_encapv6,
4505 address_family_encapv6_cmd,
4506 "address-family encapv6",
4507 "Enter Address Family command mode\n"
4510 vty->node = BGP_ENCAPV6_NODE;
4514 DEFUN (exit_address_family,
4515 exit_address_family_cmd,
4516 "exit-address-family",
4517 "Exit from Address Family configuration mode\n")
4519 /* should match list in command.c:config_exit */
4520 if (vty->node == BGP_IPV4_NODE
4521 || vty->node == BGP_ENCAP_NODE
4522 || vty->node == BGP_ENCAPV6_NODE
4523 || vty->node == BGP_IPV4M_NODE
4524 || vty->node == BGP_VPNV4_NODE
4525 || vty->node == BGP_VPNV6_NODE
4526 || vty->node == BGP_IPV6_NODE
4527 || vty->node == BGP_IPV6M_NODE)
4528 vty->node = BGP_NODE;
4532 /* BGP clear sort. */
4543 bgp_clear_vty_error (struct vty *vty, struct peer *peer, afi_t afi,
4544 safi_t safi, int error)
4548 case BGP_ERR_AF_UNCONFIGURED:
4550 "%%BGP: Enable %s %s address family for the neighbor %s%s",
4551 afi == AFI_IP6 ? "IPv6" : safi == SAFI_MPLS_VPN ? "VPNv4" : "IPv4",
4552 safi == SAFI_MULTICAST ? "Multicast" : "Unicast",
4553 peer->host, VTY_NEWLINE);
4555 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED:
4556 vty_out (vty, "%%BGP: Inbound soft reconfig for %s not possible as it%s has neither refresh capability, nor inbound soft reconfig%s", peer->host, VTY_NEWLINE, VTY_NEWLINE);
4563 /* `clear ip bgp' functions. */
4565 bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
4566 enum clear_sort sort,enum bgp_clear_type stype, const char *arg)
4570 struct listnode *node, *nnode;
4572 /* Clear all neighbors. */
4573 if (sort == clear_all)
4575 for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
4577 if (stype == BGP_CLEAR_SOFT_NONE)
4578 ret = peer_clear (peer);
4580 ret = peer_clear_soft (peer, afi, safi, stype);
4583 bgp_clear_vty_error (vty, peer, afi, safi, ret);
4588 /* Clear specified neighbors. */
4589 if (sort == clear_peer)
4594 /* Make sockunion for lookup. */
4595 ret = str2sockunion (arg, &su);
4598 vty_out (vty, "Malformed address: %s%s", arg, VTY_NEWLINE);
4601 peer = peer_lookup (bgp, &su);
4604 vty_out (vty, "%%BGP: Unknown neighbor - \"%s\"%s", arg, VTY_NEWLINE);
4608 if (stype == BGP_CLEAR_SOFT_NONE)
4609 ret = peer_clear (peer);
4611 ret = peer_clear_soft (peer, afi, safi, stype);
4614 bgp_clear_vty_error (vty, peer, afi, safi, ret);
4619 /* Clear all peer-group members. */
4620 if (sort == clear_group)
4622 struct peer_group *group;
4624 group = peer_group_lookup (bgp, arg);
4627 vty_out (vty, "%%BGP: No such peer-group %s%s", arg, VTY_NEWLINE);
4631 for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
4633 if (stype == BGP_CLEAR_SOFT_NONE)
4635 ret = peer_clear (peer);
4639 if (! peer->af_group[afi][safi])
4642 ret = peer_clear_soft (peer, afi, safi, stype);
4645 bgp_clear_vty_error (vty, peer, afi, safi, ret);
4650 if (sort == clear_external)
4652 for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
4654 if (peer->sort == BGP_PEER_IBGP)
4657 if (stype == BGP_CLEAR_SOFT_NONE)
4658 ret = peer_clear (peer);
4660 ret = peer_clear_soft (peer, afi, safi, stype);
4663 bgp_clear_vty_error (vty, peer, afi, safi, ret);
4668 if (sort == clear_as)
4673 VTY_GET_INTEGER_RANGE ("AS", as, arg, 1, BGP_AS4_MAX);
4675 for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
4681 if (stype == BGP_CLEAR_SOFT_NONE)
4682 ret = peer_clear (peer);
4684 ret = peer_clear_soft (peer, afi, safi, stype);
4687 bgp_clear_vty_error (vty, peer, afi, safi, ret);
4690 vty_out (vty, "%%BGP: No peer is configured with AS %s%s", arg,
4698 /* Recalculate bestpath and re-advertise a prefix */
4700 bgp_clear_prefix (struct vty *vty, char *view_name, const char *ip_str,
4701 afi_t afi, safi_t safi, struct prefix_rd *prd)
4704 struct prefix match;
4705 struct bgp_node *rn;
4706 struct bgp_node *rm;
4708 struct bgp_table *table;
4709 struct bgp_table *rib;
4711 /* BGP structure lookup. */
4714 bgp = bgp_lookup_by_name (view_name);
4717 vty_out (vty, "%% Can't find BGP view %s%s", view_name, VTY_NEWLINE);
4723 bgp = bgp_get_default ();
4726 vty_out (vty, "%% No BGP process is configured%s", VTY_NEWLINE);
4731 /* Check IP address argument. */
4732 ret = str2prefix (ip_str, &match);
4735 vty_out (vty, "%% address is malformed%s", VTY_NEWLINE);
4739 match.family = afi2family (afi);
4740 rib = bgp->rib[afi][safi];
4742 if (safi == SAFI_MPLS_VPN)
4744 for (rn = bgp_table_top (rib); rn; rn = bgp_route_next (rn))
4746 if (prd && memcmp (rn->p.u.val, prd->val, 8) != 0)
4749 if ((table = rn->info) != NULL)
4751 if ((rm = bgp_node_match (table, &match)) != NULL)
4753 if (rm->p.prefixlen == match.prefixlen)
4755 SET_FLAG (rn->flags, BGP_NODE_USER_CLEAR);
4756 bgp_process (bgp, rm, afi, safi);
4758 bgp_unlock_node (rm);
4765 if ((rn = bgp_node_match (rib, &match)) != NULL)
4767 if (rn->p.prefixlen == match.prefixlen)
4769 SET_FLAG (rn->flags, BGP_NODE_USER_CLEAR);
4770 bgp_process (bgp, rn, afi, safi);
4772 bgp_unlock_node (rn);
4780 bgp_clear_vty (struct vty *vty, const char *name, afi_t afi, safi_t safi,
4781 enum clear_sort sort, enum bgp_clear_type stype,
4786 /* BGP structure lookup. */
4789 bgp = bgp_lookup_by_name (name);
4792 vty_out (vty, "Can't find BGP view %s%s", name, VTY_NEWLINE);
4798 bgp = bgp_get_default ();
4801 vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
4806 return bgp_clear (vty, bgp, afi, safi, sort, stype, arg);
4809 DEFUN (clear_ip_bgp_all,
4810 clear_ip_bgp_all_cmd,
4815 "Clear all peers\n")
4818 return bgp_clear_vty (vty, argv[0], 0, 0, clear_all, BGP_CLEAR_SOFT_NONE, NULL);
4820 return bgp_clear_vty (vty, NULL, 0, 0, clear_all, BGP_CLEAR_SOFT_NONE, NULL);
4823 ALIAS (clear_ip_bgp_all,
4828 "Clear all peers\n")
4830 ALIAS (clear_ip_bgp_all,
4831 clear_bgp_ipv6_all_cmd,
4836 "Clear all peers\n")
4838 ALIAS (clear_ip_bgp_all,
4839 clear_ip_bgp_instance_all_cmd,
4840 "clear ip bgp view WORD *",
4846 "Clear all peers\n")
4848 ALIAS (clear_ip_bgp_all,
4849 clear_bgp_instance_all_cmd,
4850 "clear bgp view WORD *",
4855 "Clear all peers\n")
4857 DEFUN (clear_ip_bgp_peer,
4858 clear_ip_bgp_peer_cmd,
4859 "clear ip bgp (A.B.C.D|X:X::X:X)",
4863 "BGP neighbor IP address to clear\n"
4864 "BGP IPv6 neighbor to clear\n")
4866 return bgp_clear_vty (vty, NULL, 0, 0, clear_peer, BGP_CLEAR_SOFT_NONE, argv[0]);
4869 ALIAS (clear_ip_bgp_peer,
4871 "clear bgp (A.B.C.D|X:X::X:X)",
4874 "BGP neighbor address to clear\n"
4875 "BGP IPv6 neighbor to clear\n")
4877 ALIAS (clear_ip_bgp_peer,
4878 clear_bgp_ipv6_peer_cmd,
4879 "clear bgp ipv6 (A.B.C.D|X:X::X:X)",
4883 "BGP neighbor address to clear\n"
4884 "BGP IPv6 neighbor to clear\n")
4886 DEFUN (clear_ip_bgp_peer_group,
4887 clear_ip_bgp_peer_group_cmd,
4888 "clear ip bgp peer-group WORD",
4892 "Clear all members of peer-group\n"
4893 "BGP peer-group name\n")
4895 return bgp_clear_vty (vty, NULL, 0, 0, clear_group, BGP_CLEAR_SOFT_NONE, argv[0]);
4898 ALIAS (clear_ip_bgp_peer_group,
4899 clear_bgp_peer_group_cmd,
4900 "clear bgp peer-group WORD",
4903 "Clear all members of peer-group\n"
4904 "BGP peer-group name\n")
4906 ALIAS (clear_ip_bgp_peer_group,
4907 clear_bgp_ipv6_peer_group_cmd,
4908 "clear bgp ipv6 peer-group WORD",
4912 "Clear all members of peer-group\n"
4913 "BGP peer-group name\n")
4915 DEFUN (clear_ip_bgp_external,
4916 clear_ip_bgp_external_cmd,
4917 "clear ip bgp external",
4921 "Clear all external peers\n")
4923 return bgp_clear_vty (vty, NULL, 0, 0, clear_external, BGP_CLEAR_SOFT_NONE, NULL);
4926 ALIAS (clear_ip_bgp_external,
4927 clear_bgp_external_cmd,
4928 "clear bgp external",
4931 "Clear all external peers\n")
4933 ALIAS (clear_ip_bgp_external,
4934 clear_bgp_ipv6_external_cmd,
4935 "clear bgp ipv6 external",
4939 "Clear all external peers\n")
4941 DEFUN (clear_ip_bgp_prefix,
4942 clear_ip_bgp_prefix_cmd,
4943 "clear ip bgp prefix A.B.C.D/M",
4947 "Clear bestpath and re-advertise\n"
4948 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
4950 return bgp_clear_prefix (vty, NULL, argv[0], AFI_IP, SAFI_UNICAST, NULL);
4953 ALIAS (clear_ip_bgp_prefix,
4954 clear_bgp_prefix_cmd,
4955 "clear bgp prefix A.B.C.D/M",
4958 "Clear bestpath and re-advertise\n"
4959 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
4962 DEFUN (clear_ip_bgp_as,
4963 clear_ip_bgp_as_cmd,
4964 "clear ip bgp " CMD_AS_RANGE,
4968 "Clear peers with the AS number\n")
4970 return bgp_clear_vty (vty, NULL, 0, 0, clear_as, BGP_CLEAR_SOFT_NONE, argv[0]);
4973 ALIAS (clear_ip_bgp_as,
4975 "clear bgp " CMD_AS_RANGE,
4978 "Clear peers with the AS number\n")
4980 ALIAS (clear_ip_bgp_as,
4981 clear_bgp_ipv6_as_cmd,
4982 "clear bgp ipv6 " CMD_AS_RANGE,
4986 "Clear peers with the AS number\n")
4988 /* Outbound soft-reconfiguration */
4989 DEFUN (clear_ip_bgp_all_soft_out,
4990 clear_ip_bgp_all_soft_out_cmd,
4991 "clear ip bgp * soft out",
5000 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all,
5001 BGP_CLEAR_SOFT_OUT, NULL);
5003 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
5004 BGP_CLEAR_SOFT_OUT, NULL);
5007 ALIAS (clear_ip_bgp_all_soft_out,
5008 clear_ip_bgp_all_out_cmd,
5009 "clear ip bgp * out",
5016 ALIAS (clear_ip_bgp_all_soft_out,
5017 clear_ip_bgp_instance_all_soft_out_cmd,
5018 "clear ip bgp view WORD * soft out",
5028 DEFUN (clear_ip_bgp_all_ipv4_soft_out,
5029 clear_ip_bgp_all_ipv4_soft_out_cmd,
5030 "clear ip bgp * ipv4 (unicast|multicast) soft out",
5036 "Address Family modifier\n"
5037 "Address Family modifier\n"
5041 if (strncmp (argv[0], "m", 1) == 0)
5042 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all,
5043 BGP_CLEAR_SOFT_OUT, NULL);
5045 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
5046 BGP_CLEAR_SOFT_OUT, NULL);
5049 ALIAS (clear_ip_bgp_all_ipv4_soft_out,
5050 clear_ip_bgp_all_ipv4_out_cmd,
5051 "clear ip bgp * ipv4 (unicast|multicast) out",
5057 "Address Family modifier\n"
5058 "Address Family modifier\n"
5061 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out,
5062 clear_ip_bgp_instance_all_ipv4_soft_out_cmd,
5063 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out",
5071 "Address Family modifier\n"
5072 "Address Family modifier\n"
5075 if (strncmp (argv[1], "m", 1) == 0)
5076 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all,
5077 BGP_CLEAR_SOFT_OUT, NULL);
5079 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all,
5080 BGP_CLEAR_SOFT_OUT, NULL);
5083 DEFUN (clear_ip_bgp_all_vpnv4_soft_out,
5084 clear_ip_bgp_all_vpnv4_soft_out_cmd,
5085 "clear ip bgp * vpnv4 unicast soft out",
5091 "Address Family Modifier\n"
5095 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all,
5096 BGP_CLEAR_SOFT_OUT, NULL);
5099 ALIAS (clear_ip_bgp_all_vpnv4_soft_out,
5100 clear_ip_bgp_all_vpnv4_out_cmd,
5101 "clear ip bgp * vpnv4 unicast out",
5107 "Address Family Modifier\n"
5110 DEFUN (clear_ip_bgp_all_encap_soft_out,
5111 clear_ip_bgp_all_encap_soft_out_cmd,
5112 "clear ip bgp * encap unicast soft out",
5118 "Address Family Modifier\n"
5120 "Soft reconfig outbound update\n")
5122 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all,
5123 BGP_CLEAR_SOFT_OUT, NULL);
5126 ALIAS (clear_ip_bgp_all_encap_soft_out,
5127 clear_ip_bgp_all_encap_out_cmd,
5128 "clear ip bgp * encap unicast out",
5134 "Address Family Modifier\n"
5135 "Soft reconfig outbound update\n")
5137 DEFUN (clear_bgp_all_soft_out,
5138 clear_bgp_all_soft_out_cmd,
5139 "clear bgp * soft out",
5147 return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all,
5148 BGP_CLEAR_SOFT_OUT, NULL);
5150 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all,
5151 BGP_CLEAR_SOFT_OUT, NULL);
5154 ALIAS (clear_bgp_all_soft_out,
5155 clear_bgp_instance_all_soft_out_cmd,
5156 "clear bgp view WORD * soft out",
5165 ALIAS (clear_bgp_all_soft_out,
5166 clear_bgp_all_out_cmd,
5173 ALIAS (clear_bgp_all_soft_out,
5174 clear_bgp_ipv6_all_soft_out_cmd,
5175 "clear bgp ipv6 * soft out",
5183 ALIAS (clear_bgp_all_soft_out,
5184 clear_bgp_ipv6_all_out_cmd,
5185 "clear bgp ipv6 * out",
5192 DEFUN (clear_bgp_ipv6_safi_prefix,
5193 clear_bgp_ipv6_safi_prefix_cmd,
5194 "clear bgp ipv6 (unicast|multicast) prefix X:X::X:X/M",
5198 "Address Family Modifier\n"
5199 "Clear bestpath and re-advertise\n"
5200 "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
5202 if (strncmp (argv[0], "m", 1) == 0)
5203 return bgp_clear_prefix (vty, NULL, argv[1], AFI_IP6, SAFI_MULTICAST, NULL);
5205 return bgp_clear_prefix (vty, NULL, argv[1], AFI_IP6, SAFI_UNICAST, NULL);
5208 DEFUN (clear_ip_bgp_peer_soft_out,
5209 clear_ip_bgp_peer_soft_out_cmd,
5210 "clear ip bgp A.B.C.D soft out",
5214 "BGP neighbor address to clear\n"
5218 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
5219 BGP_CLEAR_SOFT_OUT, argv[0]);
5222 ALIAS (clear_ip_bgp_peer_soft_out,
5223 clear_ip_bgp_peer_out_cmd,
5224 "clear ip bgp A.B.C.D out",
5228 "BGP neighbor address to clear\n"
5231 DEFUN (clear_ip_bgp_peer_ipv4_soft_out,
5232 clear_ip_bgp_peer_ipv4_soft_out_cmd,
5233 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out",
5237 "BGP neighbor address to clear\n"
5239 "Address Family modifier\n"
5240 "Address Family modifier\n"
5244 if (strncmp (argv[1], "m", 1) == 0)
5245 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer,
5246 BGP_CLEAR_SOFT_OUT, argv[0]);
5248 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
5249 BGP_CLEAR_SOFT_OUT, argv[0]);
5252 ALIAS (clear_ip_bgp_peer_ipv4_soft_out,
5253 clear_ip_bgp_peer_ipv4_out_cmd,
5254 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out",
5258 "BGP neighbor address to clear\n"
5260 "Address Family modifier\n"
5261 "Address Family modifier\n"
5264 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out,
5265 clear_ip_bgp_peer_vpnv4_soft_out_cmd,
5266 "clear ip bgp A.B.C.D vpnv4 unicast soft out",
5270 "BGP neighbor address to clear\n"
5272 "Address Family Modifier\n"
5276 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer,
5277 BGP_CLEAR_SOFT_OUT, argv[0]);
5280 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out,
5281 clear_ip_bgp_peer_vpnv4_out_cmd,
5282 "clear ip bgp A.B.C.D vpnv4 unicast out",
5286 "BGP neighbor address to clear\n"
5288 "Address Family Modifier\n"
5291 DEFUN (clear_ip_bgp_peer_encap_soft_out,
5292 clear_ip_bgp_peer_encap_soft_out_cmd,
5293 "clear ip bgp A.B.C.D encap unicast soft out",
5297 "BGP neighbor address to clear\n"
5299 "Address Family Modifier\n"
5301 "Soft reconfig outbound update\n")
5303 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer,
5304 BGP_CLEAR_SOFT_OUT, argv[0]);
5307 ALIAS (clear_ip_bgp_peer_encap_soft_out,
5308 clear_ip_bgp_peer_encap_out_cmd,
5309 "clear ip bgp A.B.C.D encap unicast out",
5313 "BGP neighbor address to clear\n"
5315 "Address Family Modifier\n"
5316 "Soft reconfig outbound update\n")
5318 DEFUN (clear_bgp_peer_soft_out,
5319 clear_bgp_peer_soft_out_cmd,
5320 "clear bgp (A.B.C.D|X:X::X:X) soft out",
5323 "BGP neighbor address to clear\n"
5324 "BGP IPv6 neighbor to clear\n"
5328 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer,
5329 BGP_CLEAR_SOFT_OUT, argv[0]);
5332 ALIAS (clear_bgp_peer_soft_out,
5333 clear_bgp_ipv6_peer_soft_out_cmd,
5334 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out",
5338 "BGP neighbor address to clear\n"
5339 "BGP IPv6 neighbor to clear\n"
5343 ALIAS (clear_bgp_peer_soft_out,
5344 clear_bgp_peer_out_cmd,
5345 "clear bgp (A.B.C.D|X:X::X:X) out",
5348 "BGP neighbor address to clear\n"
5349 "BGP IPv6 neighbor to clear\n"
5352 ALIAS (clear_bgp_peer_soft_out,
5353 clear_bgp_ipv6_peer_out_cmd,
5354 "clear bgp ipv6 (A.B.C.D|X:X::X:X) out",
5358 "BGP neighbor address to clear\n"
5359 "BGP IPv6 neighbor to clear\n"
5362 DEFUN (clear_ip_bgp_peer_group_soft_out,
5363 clear_ip_bgp_peer_group_soft_out_cmd,
5364 "clear ip bgp peer-group WORD soft out",
5368 "Clear all members of peer-group\n"
5369 "BGP peer-group name\n"
5373 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
5374 BGP_CLEAR_SOFT_OUT, argv[0]);
5377 ALIAS (clear_ip_bgp_peer_group_soft_out,
5378 clear_ip_bgp_peer_group_out_cmd,
5379 "clear ip bgp peer-group WORD out",
5383 "Clear all members of peer-group\n"
5384 "BGP peer-group name\n"
5387 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out,
5388 clear_ip_bgp_peer_group_ipv4_soft_out_cmd,
5389 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
5393 "Clear all members of peer-group\n"
5394 "BGP peer-group name\n"
5396 "Address Family modifier\n"
5397 "Address Family modifier\n"
5401 if (strncmp (argv[1], "m", 1) == 0)
5402 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group,
5403 BGP_CLEAR_SOFT_OUT, argv[0]);
5405 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
5406 BGP_CLEAR_SOFT_OUT, argv[0]);
5409 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out,
5410 clear_ip_bgp_peer_group_ipv4_out_cmd,
5411 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
5415 "Clear all members of peer-group\n"
5416 "BGP peer-group name\n"
5418 "Address Family modifier\n"
5419 "Address Family modifier\n"
5422 DEFUN (clear_bgp_peer_group_soft_out,
5423 clear_bgp_peer_group_soft_out_cmd,
5424 "clear bgp peer-group WORD soft out",
5427 "Clear all members of peer-group\n"
5428 "BGP peer-group name\n"
5432 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group,
5433 BGP_CLEAR_SOFT_OUT, argv[0]);
5436 ALIAS (clear_bgp_peer_group_soft_out,
5437 clear_bgp_ipv6_peer_group_soft_out_cmd,
5438 "clear bgp ipv6 peer-group WORD soft out",
5442 "Clear all members of peer-group\n"
5443 "BGP peer-group name\n"
5447 ALIAS (clear_bgp_peer_group_soft_out,
5448 clear_bgp_peer_group_out_cmd,
5449 "clear bgp peer-group WORD out",
5452 "Clear all members of peer-group\n"
5453 "BGP peer-group name\n"
5456 ALIAS (clear_bgp_peer_group_soft_out,
5457 clear_bgp_ipv6_peer_group_out_cmd,
5458 "clear bgp ipv6 peer-group WORD out",
5462 "Clear all members of peer-group\n"
5463 "BGP peer-group name\n"
5466 DEFUN (clear_ip_bgp_external_soft_out,
5467 clear_ip_bgp_external_soft_out_cmd,
5468 "clear ip bgp external soft out",
5472 "Clear all external peers\n"
5476 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
5477 BGP_CLEAR_SOFT_OUT, NULL);
5480 ALIAS (clear_ip_bgp_external_soft_out,
5481 clear_ip_bgp_external_out_cmd,
5482 "clear ip bgp external out",
5486 "Clear all external peers\n"
5489 DEFUN (clear_ip_bgp_external_ipv4_soft_out,
5490 clear_ip_bgp_external_ipv4_soft_out_cmd,
5491 "clear ip bgp external ipv4 (unicast|multicast) soft out",
5495 "Clear all external peers\n"
5497 "Address Family modifier\n"
5498 "Address Family modifier\n"
5502 if (strncmp (argv[0], "m", 1) == 0)
5503 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external,
5504 BGP_CLEAR_SOFT_OUT, NULL);
5506 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
5507 BGP_CLEAR_SOFT_OUT, NULL);
5510 ALIAS (clear_ip_bgp_external_ipv4_soft_out,
5511 clear_ip_bgp_external_ipv4_out_cmd,
5512 "clear ip bgp external ipv4 (unicast|multicast) out",
5516 "Clear all external peers\n"
5518 "Address Family modifier\n"
5519 "Address Family modifier\n"
5522 DEFUN (clear_bgp_external_soft_out,
5523 clear_bgp_external_soft_out_cmd,
5524 "clear bgp external soft out",
5527 "Clear all external peers\n"
5531 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external,
5532 BGP_CLEAR_SOFT_OUT, NULL);
5535 ALIAS (clear_bgp_external_soft_out,
5536 clear_bgp_ipv6_external_soft_out_cmd,
5537 "clear bgp ipv6 external soft out",
5541 "Clear all external peers\n"
5545 ALIAS (clear_bgp_external_soft_out,
5546 clear_bgp_external_out_cmd,
5547 "clear bgp external out",
5550 "Clear all external peers\n"
5553 ALIAS (clear_bgp_external_soft_out,
5554 clear_bgp_ipv6_external_out_cmd,
5555 "clear bgp ipv6 external WORD out",
5559 "Clear all external peers\n"
5562 DEFUN (clear_ip_bgp_as_soft_out,
5563 clear_ip_bgp_as_soft_out_cmd,
5564 "clear ip bgp " CMD_AS_RANGE " soft out",
5568 "Clear peers with the AS number\n"
5572 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as,
5573 BGP_CLEAR_SOFT_OUT, argv[0]);
5576 ALIAS (clear_ip_bgp_as_soft_out,
5577 clear_ip_bgp_as_out_cmd,
5578 "clear ip bgp " CMD_AS_RANGE " out",
5582 "Clear peers with the AS number\n"
5585 DEFUN (clear_ip_bgp_as_ipv4_soft_out,
5586 clear_ip_bgp_as_ipv4_soft_out_cmd,
5587 "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft out",
5591 "Clear peers with the AS number\n"
5593 "Address Family modifier\n"
5594 "Address Family modifier\n"
5598 if (strncmp (argv[1], "m", 1) == 0)
5599 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as,
5600 BGP_CLEAR_SOFT_OUT, argv[0]);
5602 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as,
5603 BGP_CLEAR_SOFT_OUT, argv[0]);
5606 ALIAS (clear_ip_bgp_as_ipv4_soft_out,
5607 clear_ip_bgp_as_ipv4_out_cmd,
5608 "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) out",
5612 "Clear peers with the AS number\n"
5614 "Address Family modifier\n"
5615 "Address Family modifier\n"
5618 DEFUN (clear_ip_bgp_as_vpnv4_soft_out,
5619 clear_ip_bgp_as_vpnv4_soft_out_cmd,
5620 "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast soft out",
5624 "Clear peers with the AS number\n"
5626 "Address Family modifier\n"
5630 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as,
5631 BGP_CLEAR_SOFT_OUT, argv[0]);
5634 ALIAS (clear_ip_bgp_as_vpnv4_soft_out,
5635 clear_ip_bgp_as_vpnv4_out_cmd,
5636 "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast out",
5640 "Clear peers with the AS number\n"
5642 "Address Family modifier\n"
5645 DEFUN (clear_ip_bgp_as_encap_soft_out,
5646 clear_ip_bgp_as_encap_soft_out_cmd,
5647 "clear ip bgp " CMD_AS_RANGE " encap unicast soft out",
5651 "Clear peers with the AS number\n"
5653 "Address Family modifier\n"
5655 "Soft reconfig outbound update\n")
5657 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as,
5658 BGP_CLEAR_SOFT_OUT, argv[0]);
5661 ALIAS (clear_ip_bgp_as_encap_soft_out,
5662 clear_ip_bgp_as_encap_out_cmd,
5663 "clear ip bgp " CMD_AS_RANGE " encap unicast out",
5667 "Clear peers with the AS number\n"
5669 "Address Family modifier\n"
5670 "Soft reconfig outbound update\n")
5672 DEFUN (clear_bgp_as_soft_out,
5673 clear_bgp_as_soft_out_cmd,
5674 "clear bgp " CMD_AS_RANGE " soft out",
5677 "Clear peers with the AS number\n"
5681 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as,
5682 BGP_CLEAR_SOFT_OUT, argv[0]);
5685 ALIAS (clear_bgp_as_soft_out,
5686 clear_bgp_ipv6_as_soft_out_cmd,
5687 "clear bgp ipv6 " CMD_AS_RANGE " soft out",
5691 "Clear peers with the AS number\n"
5695 ALIAS (clear_bgp_as_soft_out,
5696 clear_bgp_as_out_cmd,
5697 "clear bgp " CMD_AS_RANGE " out",
5700 "Clear peers with the AS number\n"
5703 ALIAS (clear_bgp_as_soft_out,
5704 clear_bgp_ipv6_as_out_cmd,
5705 "clear bgp ipv6 " CMD_AS_RANGE " out",
5709 "Clear peers with the AS number\n"
5712 /* Inbound soft-reconfiguration */
5713 DEFUN (clear_ip_bgp_all_soft_in,
5714 clear_ip_bgp_all_soft_in_cmd,
5715 "clear ip bgp * soft in",
5724 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all,
5725 BGP_CLEAR_SOFT_IN, NULL);
5727 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
5728 BGP_CLEAR_SOFT_IN, NULL);
5731 ALIAS (clear_ip_bgp_all_soft_in,
5732 clear_ip_bgp_instance_all_soft_in_cmd,
5733 "clear ip bgp view WORD * soft in",
5743 ALIAS (clear_ip_bgp_all_soft_in,
5744 clear_ip_bgp_all_in_cmd,
5745 "clear ip bgp * in",
5752 DEFUN (clear_ip_bgp_all_in_prefix_filter,
5753 clear_ip_bgp_all_in_prefix_filter_cmd,
5754 "clear ip bgp * in prefix-filter",
5760 "Push out prefix-list ORF and do inbound soft reconfig\n")
5763 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all,
5764 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
5766 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
5767 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
5770 ALIAS (clear_ip_bgp_all_in_prefix_filter,
5771 clear_ip_bgp_instance_all_in_prefix_filter_cmd,
5772 "clear ip bgp view WORD * in prefix-filter",
5780 "Push out prefix-list ORF and do inbound soft reconfig\n")
5783 DEFUN (clear_ip_bgp_all_ipv4_soft_in,
5784 clear_ip_bgp_all_ipv4_soft_in_cmd,
5785 "clear ip bgp * ipv4 (unicast|multicast) soft in",
5791 "Address Family modifier\n"
5792 "Address Family modifier\n"
5796 if (strncmp (argv[0], "m", 1) == 0)
5797 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all,
5798 BGP_CLEAR_SOFT_IN, NULL);
5800 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
5801 BGP_CLEAR_SOFT_IN, NULL);
5804 ALIAS (clear_ip_bgp_all_ipv4_soft_in,
5805 clear_ip_bgp_all_ipv4_in_cmd,
5806 "clear ip bgp * ipv4 (unicast|multicast) in",
5812 "Address Family modifier\n"
5813 "Address Family modifier\n"
5816 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in,
5817 clear_ip_bgp_instance_all_ipv4_soft_in_cmd,
5818 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in",
5826 "Address Family modifier\n"
5827 "Address Family modifier\n"
5831 if (strncmp (argv[1], "m", 1) == 0)
5832 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all,
5833 BGP_CLEAR_SOFT_IN, NULL);
5835 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all,
5836 BGP_CLEAR_SOFT_IN, NULL);
5839 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter,
5840 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd,
5841 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
5847 "Address Family modifier\n"
5848 "Address Family modifier\n"
5850 "Push out prefix-list ORF and do inbound soft reconfig\n")
5852 if (strncmp (argv[0], "m", 1) == 0)
5853 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all,
5854 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
5856 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
5857 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
5860 DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter,
5861 clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd,
5862 "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter",
5868 "Address Family modifier\n"
5869 "Address Family modifier\n"
5871 "Push out prefix-list ORF and do inbound soft reconfig\n")
5873 if (strncmp (argv[1], "m", 1) == 0)
5874 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all,
5875 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
5877 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all,
5878 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
5881 DEFUN (clear_ip_bgp_all_vpnv4_soft_in,
5882 clear_ip_bgp_all_vpnv4_soft_in_cmd,
5883 "clear ip bgp * vpnv4 unicast soft in",
5889 "Address Family Modifier\n"
5893 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all,
5894 BGP_CLEAR_SOFT_IN, NULL);
5897 ALIAS (clear_ip_bgp_all_vpnv4_soft_in,
5898 clear_ip_bgp_all_vpnv4_in_cmd,
5899 "clear ip bgp * vpnv4 unicast in",
5905 "Address Family Modifier\n"
5908 DEFUN (clear_ip_bgp_all_encap_soft_in,
5909 clear_ip_bgp_all_encap_soft_in_cmd,
5910 "clear ip bgp * encap unicast soft in",
5916 "Address Family Modifier\n"
5918 "Soft reconfig inbound update\n")
5920 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all,
5921 BGP_CLEAR_SOFT_IN, NULL);
5924 ALIAS (clear_ip_bgp_all_encap_soft_in,
5925 clear_ip_bgp_all_encap_in_cmd,
5926 "clear ip bgp * encap unicast in",
5932 "Address Family Modifier\n"
5933 "Soft reconfig inbound update\n")
5935 DEFUN (clear_bgp_all_soft_in,
5936 clear_bgp_all_soft_in_cmd,
5937 "clear bgp * soft in",
5945 return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all,
5946 BGP_CLEAR_SOFT_IN, NULL);
5948 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all,
5949 BGP_CLEAR_SOFT_IN, NULL);
5952 ALIAS (clear_bgp_all_soft_in,
5953 clear_bgp_instance_all_soft_in_cmd,
5954 "clear bgp view WORD * soft in",
5963 ALIAS (clear_bgp_all_soft_in,
5964 clear_bgp_ipv6_all_soft_in_cmd,
5965 "clear bgp ipv6 * soft in",
5973 ALIAS (clear_bgp_all_soft_in,
5974 clear_bgp_all_in_cmd,
5981 ALIAS (clear_bgp_all_soft_in,
5982 clear_bgp_ipv6_all_in_cmd,
5983 "clear bgp ipv6 * in",
5990 DEFUN (clear_bgp_all_in_prefix_filter,
5991 clear_bgp_all_in_prefix_filter_cmd,
5992 "clear bgp * in prefix-filter",
5997 "Push out prefix-list ORF and do inbound soft reconfig\n")
5999 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all,
6000 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
6003 ALIAS (clear_bgp_all_in_prefix_filter,
6004 clear_bgp_ipv6_all_in_prefix_filter_cmd,
6005 "clear bgp ipv6 * in prefix-filter",
6011 "Push out prefix-list ORF and do inbound soft reconfig\n")
6013 DEFUN (clear_ip_bgp_peer_soft_in,
6014 clear_ip_bgp_peer_soft_in_cmd,
6015 "clear ip bgp A.B.C.D soft in",
6019 "BGP neighbor address to clear\n"
6023 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
6024 BGP_CLEAR_SOFT_IN, argv[0]);
6027 ALIAS (clear_ip_bgp_peer_soft_in,
6028 clear_ip_bgp_peer_in_cmd,
6029 "clear ip bgp A.B.C.D in",
6033 "BGP neighbor address to clear\n"
6036 DEFUN (clear_ip_bgp_peer_in_prefix_filter,
6037 clear_ip_bgp_peer_in_prefix_filter_cmd,
6038 "clear ip bgp A.B.C.D in prefix-filter",
6042 "BGP neighbor address to clear\n"
6044 "Push out the existing ORF prefix-list\n")
6046 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
6047 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6050 DEFUN (clear_ip_bgp_peer_ipv4_soft_in,
6051 clear_ip_bgp_peer_ipv4_soft_in_cmd,
6052 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in",
6056 "BGP neighbor address to clear\n"
6058 "Address Family modifier\n"
6059 "Address Family modifier\n"
6063 if (strncmp (argv[1], "m", 1) == 0)
6064 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer,
6065 BGP_CLEAR_SOFT_IN, argv[0]);
6067 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
6068 BGP_CLEAR_SOFT_IN, argv[0]);
6071 ALIAS (clear_ip_bgp_peer_ipv4_soft_in,
6072 clear_ip_bgp_peer_ipv4_in_cmd,
6073 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in",
6077 "BGP neighbor address to clear\n"
6079 "Address Family modifier\n"
6080 "Address Family modifier\n"
6083 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter,
6084 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd,
6085 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter",
6089 "BGP neighbor address to clear\n"
6091 "Address Family modifier\n"
6092 "Address Family modifier\n"
6094 "Push out the existing ORF prefix-list\n")
6096 if (strncmp (argv[1], "m", 1) == 0)
6097 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer,
6098 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6100 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
6101 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6104 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in,
6105 clear_ip_bgp_peer_vpnv4_soft_in_cmd,
6106 "clear ip bgp A.B.C.D vpnv4 unicast soft in",
6110 "BGP neighbor address to clear\n"
6112 "Address Family Modifier\n"
6116 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer,
6117 BGP_CLEAR_SOFT_IN, argv[0]);
6120 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in,
6121 clear_ip_bgp_peer_vpnv4_in_cmd,
6122 "clear ip bgp A.B.C.D vpnv4 unicast in",
6126 "BGP neighbor address to clear\n"
6128 "Address Family Modifier\n"
6131 DEFUN (clear_ip_bgp_peer_encap_soft_in,
6132 clear_ip_bgp_peer_encap_soft_in_cmd,
6133 "clear ip bgp A.B.C.D encap unicast soft in",
6137 "BGP neighbor address to clear\n"
6139 "Address Family Modifier\n"
6141 "Soft reconfig inbound update\n")
6143 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer,
6144 BGP_CLEAR_SOFT_IN, argv[0]);
6147 ALIAS (clear_ip_bgp_peer_encap_soft_in,
6148 clear_ip_bgp_peer_encap_in_cmd,
6149 "clear ip bgp A.B.C.D encap unicast in",
6153 "BGP neighbor address to clear\n"
6155 "Address Family Modifier\n"
6156 "Soft reconfig inbound update\n")
6158 DEFUN (clear_bgp_peer_soft_in,
6159 clear_bgp_peer_soft_in_cmd,
6160 "clear bgp (A.B.C.D|X:X::X:X) soft in",
6163 "BGP neighbor address to clear\n"
6164 "BGP IPv6 neighbor to clear\n"
6168 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer,
6169 BGP_CLEAR_SOFT_IN, argv[0]);
6172 ALIAS (clear_bgp_peer_soft_in,
6173 clear_bgp_ipv6_peer_soft_in_cmd,
6174 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in",
6178 "BGP neighbor address to clear\n"
6179 "BGP IPv6 neighbor to clear\n"
6183 ALIAS (clear_bgp_peer_soft_in,
6184 clear_bgp_peer_in_cmd,
6185 "clear bgp (A.B.C.D|X:X::X:X) in",
6188 "BGP neighbor address to clear\n"
6189 "BGP IPv6 neighbor to clear\n"
6192 ALIAS (clear_bgp_peer_soft_in,
6193 clear_bgp_ipv6_peer_in_cmd,
6194 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in",
6198 "BGP neighbor address to clear\n"
6199 "BGP IPv6 neighbor to clear\n"
6202 DEFUN (clear_bgp_peer_in_prefix_filter,
6203 clear_bgp_peer_in_prefix_filter_cmd,
6204 "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter",
6207 "BGP neighbor address to clear\n"
6208 "BGP IPv6 neighbor to clear\n"
6210 "Push out the existing ORF prefix-list\n")
6212 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer,
6213 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6216 ALIAS (clear_bgp_peer_in_prefix_filter,
6217 clear_bgp_ipv6_peer_in_prefix_filter_cmd,
6218 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter",
6222 "BGP neighbor address to clear\n"
6223 "BGP IPv6 neighbor to clear\n"
6225 "Push out the existing ORF prefix-list\n")
6227 DEFUN (clear_ip_bgp_peer_group_soft_in,
6228 clear_ip_bgp_peer_group_soft_in_cmd,
6229 "clear ip bgp peer-group WORD soft in",
6233 "Clear all members of peer-group\n"
6234 "BGP peer-group name\n"
6238 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
6239 BGP_CLEAR_SOFT_IN, argv[0]);
6242 ALIAS (clear_ip_bgp_peer_group_soft_in,
6243 clear_ip_bgp_peer_group_in_cmd,
6244 "clear ip bgp peer-group WORD in",
6248 "Clear all members of peer-group\n"
6249 "BGP peer-group name\n"
6252 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter,
6253 clear_ip_bgp_peer_group_in_prefix_filter_cmd,
6254 "clear ip bgp peer-group WORD in prefix-filter",
6258 "Clear all members of peer-group\n"
6259 "BGP peer-group name\n"
6261 "Push out prefix-list ORF and do inbound soft reconfig\n")
6263 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
6264 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6267 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in,
6268 clear_ip_bgp_peer_group_ipv4_soft_in_cmd,
6269 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
6273 "Clear all members of peer-group\n"
6274 "BGP peer-group name\n"
6276 "Address Family modifier\n"
6277 "Address Family modifier\n"
6281 if (strncmp (argv[1], "m", 1) == 0)
6282 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group,
6283 BGP_CLEAR_SOFT_IN, argv[0]);
6285 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
6286 BGP_CLEAR_SOFT_IN, argv[0]);
6289 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in,
6290 clear_ip_bgp_peer_group_ipv4_in_cmd,
6291 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
6295 "Clear all members of peer-group\n"
6296 "BGP peer-group name\n"
6298 "Address Family modifier\n"
6299 "Address Family modifier\n"
6302 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter,
6303 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd,
6304 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
6308 "Clear all members of peer-group\n"
6309 "BGP peer-group name\n"
6311 "Address Family modifier\n"
6312 "Address Family modifier\n"
6314 "Push out prefix-list ORF and do inbound soft reconfig\n")
6316 if (strncmp (argv[1], "m", 1) == 0)
6317 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group,
6318 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6320 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
6321 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6324 DEFUN (clear_bgp_peer_group_soft_in,
6325 clear_bgp_peer_group_soft_in_cmd,
6326 "clear bgp peer-group WORD soft in",
6329 "Clear all members of peer-group\n"
6330 "BGP peer-group name\n"
6334 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group,
6335 BGP_CLEAR_SOFT_IN, argv[0]);
6338 ALIAS (clear_bgp_peer_group_soft_in,
6339 clear_bgp_ipv6_peer_group_soft_in_cmd,
6340 "clear bgp ipv6 peer-group WORD soft in",
6344 "Clear all members of peer-group\n"
6345 "BGP peer-group name\n"
6349 ALIAS (clear_bgp_peer_group_soft_in,
6350 clear_bgp_peer_group_in_cmd,
6351 "clear bgp peer-group WORD in",
6354 "Clear all members of peer-group\n"
6355 "BGP peer-group name\n"
6358 ALIAS (clear_bgp_peer_group_soft_in,
6359 clear_bgp_ipv6_peer_group_in_cmd,
6360 "clear bgp ipv6 peer-group WORD in",
6364 "Clear all members of peer-group\n"
6365 "BGP peer-group name\n"
6368 DEFUN (clear_bgp_peer_group_in_prefix_filter,
6369 clear_bgp_peer_group_in_prefix_filter_cmd,
6370 "clear bgp peer-group WORD in prefix-filter",
6373 "Clear all members of peer-group\n"
6374 "BGP peer-group name\n"
6376 "Push out prefix-list ORF and do inbound soft reconfig\n")
6378 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group,
6379 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6382 ALIAS (clear_bgp_peer_group_in_prefix_filter,
6383 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd,
6384 "clear bgp ipv6 peer-group WORD in prefix-filter",
6388 "Clear all members of peer-group\n"
6389 "BGP peer-group name\n"
6391 "Push out prefix-list ORF and do inbound soft reconfig\n")
6393 DEFUN (clear_ip_bgp_external_soft_in,
6394 clear_ip_bgp_external_soft_in_cmd,
6395 "clear ip bgp external soft in",
6399 "Clear all external peers\n"
6403 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
6404 BGP_CLEAR_SOFT_IN, NULL);
6407 ALIAS (clear_ip_bgp_external_soft_in,
6408 clear_ip_bgp_external_in_cmd,
6409 "clear ip bgp external in",
6413 "Clear all external peers\n"
6416 DEFUN (clear_ip_bgp_external_in_prefix_filter,
6417 clear_ip_bgp_external_in_prefix_filter_cmd,
6418 "clear ip bgp external in prefix-filter",
6422 "Clear all external peers\n"
6424 "Push out prefix-list ORF and do inbound soft reconfig\n")
6426 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
6427 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
6430 DEFUN (clear_ip_bgp_external_ipv4_soft_in,
6431 clear_ip_bgp_external_ipv4_soft_in_cmd,
6432 "clear ip bgp external ipv4 (unicast|multicast) soft in",
6436 "Clear all external peers\n"
6438 "Address Family modifier\n"
6439 "Address Family modifier\n"
6443 if (strncmp (argv[0], "m", 1) == 0)
6444 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external,
6445 BGP_CLEAR_SOFT_IN, NULL);
6447 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
6448 BGP_CLEAR_SOFT_IN, NULL);
6451 ALIAS (clear_ip_bgp_external_ipv4_soft_in,
6452 clear_ip_bgp_external_ipv4_in_cmd,
6453 "clear ip bgp external ipv4 (unicast|multicast) in",
6457 "Clear all external peers\n"
6459 "Address Family modifier\n"
6460 "Address Family modifier\n"
6463 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter,
6464 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd,
6465 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
6469 "Clear all external peers\n"
6471 "Address Family modifier\n"
6472 "Address Family modifier\n"
6474 "Push out prefix-list ORF and do inbound soft reconfig\n")
6476 if (strncmp (argv[0], "m", 1) == 0)
6477 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external,
6478 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
6480 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
6481 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
6484 DEFUN (clear_bgp_external_soft_in,
6485 clear_bgp_external_soft_in_cmd,
6486 "clear bgp external soft in",
6489 "Clear all external peers\n"
6493 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external,
6494 BGP_CLEAR_SOFT_IN, NULL);
6497 ALIAS (clear_bgp_external_soft_in,
6498 clear_bgp_ipv6_external_soft_in_cmd,
6499 "clear bgp ipv6 external soft in",
6503 "Clear all external peers\n"
6507 ALIAS (clear_bgp_external_soft_in,
6508 clear_bgp_external_in_cmd,
6509 "clear bgp external in",
6512 "Clear all external peers\n"
6515 ALIAS (clear_bgp_external_soft_in,
6516 clear_bgp_ipv6_external_in_cmd,
6517 "clear bgp ipv6 external WORD in",
6521 "Clear all external peers\n"
6524 DEFUN (clear_bgp_external_in_prefix_filter,
6525 clear_bgp_external_in_prefix_filter_cmd,
6526 "clear bgp external in prefix-filter",
6529 "Clear all external peers\n"
6531 "Push out prefix-list ORF and do inbound soft reconfig\n")
6533 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external,
6534 BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
6537 ALIAS (clear_bgp_external_in_prefix_filter,
6538 clear_bgp_ipv6_external_in_prefix_filter_cmd,
6539 "clear bgp ipv6 external in prefix-filter",
6543 "Clear all external peers\n"
6545 "Push out prefix-list ORF and do inbound soft reconfig\n")
6547 DEFUN (clear_ip_bgp_as_soft_in,
6548 clear_ip_bgp_as_soft_in_cmd,
6549 "clear ip bgp " CMD_AS_RANGE " soft in",
6553 "Clear peers with the AS number\n"
6557 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as,
6558 BGP_CLEAR_SOFT_IN, argv[0]);
6561 ALIAS (clear_ip_bgp_as_soft_in,
6562 clear_ip_bgp_as_in_cmd,
6563 "clear ip bgp " CMD_AS_RANGE " in",
6567 "Clear peers with the AS number\n"
6570 DEFUN (clear_ip_bgp_as_in_prefix_filter,
6571 clear_ip_bgp_as_in_prefix_filter_cmd,
6572 "clear ip bgp " CMD_AS_RANGE " in prefix-filter",
6576 "Clear peers with the AS number\n"
6578 "Push out prefix-list ORF and do inbound soft reconfig\n")
6580 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as,
6581 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6584 DEFUN (clear_ip_bgp_as_ipv4_soft_in,
6585 clear_ip_bgp_as_ipv4_soft_in_cmd,
6586 "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft in",
6590 "Clear peers with the AS number\n"
6592 "Address Family modifier\n"
6593 "Address Family modifier\n"
6597 if (strncmp (argv[1], "m", 1) == 0)
6598 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as,
6599 BGP_CLEAR_SOFT_IN, argv[0]);
6601 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as,
6602 BGP_CLEAR_SOFT_IN, argv[0]);
6605 ALIAS (clear_ip_bgp_as_ipv4_soft_in,
6606 clear_ip_bgp_as_ipv4_in_cmd,
6607 "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) in",
6611 "Clear peers with the AS number\n"
6613 "Address Family modifier\n"
6614 "Address Family modifier\n"
6617 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter,
6618 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd,
6619 "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) in prefix-filter",
6623 "Clear peers with the AS number\n"
6625 "Address Family modifier\n"
6626 "Address Family modifier\n"
6628 "Push out prefix-list ORF and do inbound soft reconfig\n")
6630 if (strncmp (argv[1], "m", 1) == 0)
6631 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as,
6632 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6634 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as,
6635 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6638 DEFUN (clear_ip_bgp_as_vpnv4_soft_in,
6639 clear_ip_bgp_as_vpnv4_soft_in_cmd,
6640 "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast soft in",
6644 "Clear peers with the AS number\n"
6646 "Address Family modifier\n"
6650 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as,
6651 BGP_CLEAR_SOFT_IN, argv[0]);
6654 ALIAS (clear_ip_bgp_as_vpnv4_soft_in,
6655 clear_ip_bgp_as_vpnv4_in_cmd,
6656 "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast in",
6660 "Clear peers with the AS number\n"
6662 "Address Family modifier\n"
6665 DEFUN (clear_ip_bgp_as_encap_soft_in,
6666 clear_ip_bgp_as_encap_soft_in_cmd,
6667 "clear ip bgp " CMD_AS_RANGE " encap unicast soft in",
6671 "Clear peers with the AS number\n"
6673 "Address Family modifier\n"
6675 "Soft reconfig inbound update\n")
6677 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as,
6678 BGP_CLEAR_SOFT_IN, argv[0]);
6681 ALIAS (clear_ip_bgp_as_encap_soft_in,
6682 clear_ip_bgp_as_encap_in_cmd,
6683 "clear ip bgp " CMD_AS_RANGE " encap unicast in",
6687 "Clear peers with the AS number\n"
6689 "Address Family modifier\n"
6690 "Soft reconfig inbound update\n")
6692 DEFUN (clear_bgp_as_soft_in,
6693 clear_bgp_as_soft_in_cmd,
6694 "clear bgp " CMD_AS_RANGE " soft in",
6697 "Clear peers with the AS number\n"
6701 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as,
6702 BGP_CLEAR_SOFT_IN, argv[0]);
6705 ALIAS (clear_bgp_as_soft_in,
6706 clear_bgp_ipv6_as_soft_in_cmd,
6707 "clear bgp ipv6 " CMD_AS_RANGE " soft in",
6711 "Clear peers with the AS number\n"
6715 ALIAS (clear_bgp_as_soft_in,
6716 clear_bgp_as_in_cmd,
6717 "clear bgp " CMD_AS_RANGE " in",
6720 "Clear peers with the AS number\n"
6723 ALIAS (clear_bgp_as_soft_in,
6724 clear_bgp_ipv6_as_in_cmd,
6725 "clear bgp ipv6 " CMD_AS_RANGE " in",
6729 "Clear peers with the AS number\n"
6732 DEFUN (clear_bgp_as_in_prefix_filter,
6733 clear_bgp_as_in_prefix_filter_cmd,
6734 "clear bgp " CMD_AS_RANGE " in prefix-filter",
6737 "Clear peers with the AS number\n"
6739 "Push out prefix-list ORF and do inbound soft reconfig\n")
6741 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as,
6742 BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
6745 ALIAS (clear_bgp_as_in_prefix_filter,
6746 clear_bgp_ipv6_as_in_prefix_filter_cmd,
6747 "clear bgp ipv6 " CMD_AS_RANGE " in prefix-filter",
6751 "Clear peers with the AS number\n"
6753 "Push out prefix-list ORF and do inbound soft reconfig\n")
6755 /* Both soft-reconfiguration */
6756 DEFUN (clear_ip_bgp_all_soft,
6757 clear_ip_bgp_all_soft_cmd,
6758 "clear ip bgp * soft",
6766 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all,
6767 BGP_CLEAR_SOFT_BOTH, NULL);
6769 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
6770 BGP_CLEAR_SOFT_BOTH, NULL);
6773 ALIAS (clear_ip_bgp_all_soft,
6774 clear_ip_bgp_instance_all_soft_cmd,
6775 "clear ip bgp view WORD * soft",
6785 DEFUN (clear_ip_bgp_all_ipv4_soft,
6786 clear_ip_bgp_all_ipv4_soft_cmd,
6787 "clear ip bgp * ipv4 (unicast|multicast) soft",
6793 "Address Family Modifier\n"
6794 "Address Family Modifier\n"
6797 if (strncmp (argv[0], "m", 1) == 0)
6798 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all,
6799 BGP_CLEAR_SOFT_BOTH, NULL);
6801 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
6802 BGP_CLEAR_SOFT_BOTH, NULL);
6805 DEFUN (clear_ip_bgp_instance_all_ipv4_soft,
6806 clear_ip_bgp_instance_all_ipv4_soft_cmd,
6807 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft",
6815 "Address Family Modifier\n"
6816 "Address Family Modifier\n"
6819 if (strncmp (argv[1], "m", 1) == 0)
6820 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all,
6821 BGP_CLEAR_SOFT_BOTH, NULL);
6823 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
6824 BGP_CLEAR_SOFT_BOTH, NULL);
6827 DEFUN (clear_ip_bgp_all_vpnv4_soft,
6828 clear_ip_bgp_all_vpnv4_soft_cmd,
6829 "clear ip bgp * vpnv4 unicast soft",
6835 "Address Family Modifier\n"
6838 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all,
6839 BGP_CLEAR_SOFT_BOTH, argv[0]);
6842 DEFUN (clear_ip_bgp_all_encap_soft,
6843 clear_ip_bgp_all_encap_soft_cmd,
6844 "clear ip bgp * encap unicast soft",
6850 "Address Family Modifier\n"
6853 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all,
6854 BGP_CLEAR_SOFT_BOTH, argv[0]);
6857 DEFUN (clear_bgp_all_soft,
6858 clear_bgp_all_soft_cmd,
6866 return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all,
6867 BGP_CLEAR_SOFT_BOTH, argv[0]);
6869 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all,
6870 BGP_CLEAR_SOFT_BOTH, argv[0]);
6873 ALIAS (clear_bgp_all_soft,
6874 clear_bgp_instance_all_soft_cmd,
6875 "clear bgp view WORD * soft",
6883 ALIAS (clear_bgp_all_soft,
6884 clear_bgp_ipv6_all_soft_cmd,
6885 "clear bgp ipv6 * soft",
6892 DEFUN (clear_ip_bgp_peer_soft,
6893 clear_ip_bgp_peer_soft_cmd,
6894 "clear ip bgp A.B.C.D soft",
6898 "BGP neighbor address to clear\n"
6901 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
6902 BGP_CLEAR_SOFT_BOTH, argv[0]);
6905 DEFUN (clear_ip_bgp_peer_ipv4_soft,
6906 clear_ip_bgp_peer_ipv4_soft_cmd,
6907 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft",
6911 "BGP neighbor address to clear\n"
6913 "Address Family Modifier\n"
6914 "Address Family Modifier\n"
6917 if (strncmp (argv[1], "m", 1) == 0)
6918 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer,
6919 BGP_CLEAR_SOFT_BOTH, argv[0]);
6921 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
6922 BGP_CLEAR_SOFT_BOTH, argv[0]);
6925 DEFUN (clear_ip_bgp_peer_vpnv4_soft,
6926 clear_ip_bgp_peer_vpnv4_soft_cmd,
6927 "clear ip bgp A.B.C.D vpnv4 unicast soft",
6931 "BGP neighbor address to clear\n"
6933 "Address Family Modifier\n"
6936 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer,
6937 BGP_CLEAR_SOFT_BOTH, argv[0]);
6940 DEFUN (clear_ip_bgp_peer_encap_soft,
6941 clear_ip_bgp_peer_encap_soft_cmd,
6942 "clear ip bgp A.B.C.D encap unicast soft",
6946 "BGP neighbor address to clear\n"
6948 "Address Family Modifier\n"
6951 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer,
6952 BGP_CLEAR_SOFT_BOTH, argv[0]);
6955 DEFUN (clear_bgp_peer_soft,
6956 clear_bgp_peer_soft_cmd,
6957 "clear bgp (A.B.C.D|X:X::X:X) soft",
6960 "BGP neighbor address to clear\n"
6961 "BGP IPv6 neighbor to clear\n"
6964 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer,
6965 BGP_CLEAR_SOFT_BOTH, argv[0]);
6968 ALIAS (clear_bgp_peer_soft,
6969 clear_bgp_ipv6_peer_soft_cmd,
6970 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft",
6974 "BGP neighbor address to clear\n"
6975 "BGP IPv6 neighbor to clear\n"
6978 DEFUN (clear_ip_bgp_peer_group_soft,
6979 clear_ip_bgp_peer_group_soft_cmd,
6980 "clear ip bgp peer-group WORD soft",
6984 "Clear all members of peer-group\n"
6985 "BGP peer-group name\n"
6988 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
6989 BGP_CLEAR_SOFT_BOTH, argv[0]);
6992 DEFUN (clear_ip_bgp_peer_group_ipv4_soft,
6993 clear_ip_bgp_peer_group_ipv4_soft_cmd,
6994 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
6998 "Clear all members of peer-group\n"
6999 "BGP peer-group name\n"
7001 "Address Family modifier\n"
7002 "Address Family modifier\n"
7005 if (strncmp (argv[1], "m", 1) == 0)
7006 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group,
7007 BGP_CLEAR_SOFT_BOTH, argv[0]);
7009 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
7010 BGP_CLEAR_SOFT_BOTH, argv[0]);
7013 DEFUN (clear_bgp_peer_group_soft,
7014 clear_bgp_peer_group_soft_cmd,
7015 "clear bgp peer-group WORD soft",
7018 "Clear all members of peer-group\n"
7019 "BGP peer-group name\n"
7022 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group,
7023 BGP_CLEAR_SOFT_BOTH, argv[0]);
7026 ALIAS (clear_bgp_peer_group_soft,
7027 clear_bgp_ipv6_peer_group_soft_cmd,
7028 "clear bgp ipv6 peer-group WORD soft",
7032 "Clear all members of peer-group\n"
7033 "BGP peer-group name\n"
7036 DEFUN (clear_ip_bgp_external_soft,
7037 clear_ip_bgp_external_soft_cmd,
7038 "clear ip bgp external soft",
7042 "Clear all external peers\n"
7045 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
7046 BGP_CLEAR_SOFT_BOTH, NULL);
7049 DEFUN (clear_ip_bgp_external_ipv4_soft,
7050 clear_ip_bgp_external_ipv4_soft_cmd,
7051 "clear ip bgp external ipv4 (unicast|multicast) soft",
7055 "Clear all external peers\n"
7057 "Address Family modifier\n"
7058 "Address Family modifier\n"
7061 if (strncmp (argv[0], "m", 1) == 0)
7062 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external,
7063 BGP_CLEAR_SOFT_BOTH, NULL);
7065 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
7066 BGP_CLEAR_SOFT_BOTH, NULL);
7069 DEFUN (clear_bgp_external_soft,
7070 clear_bgp_external_soft_cmd,
7071 "clear bgp external soft",
7074 "Clear all external peers\n"
7077 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external,
7078 BGP_CLEAR_SOFT_BOTH, NULL);
7081 ALIAS (clear_bgp_external_soft,
7082 clear_bgp_ipv6_external_soft_cmd,
7083 "clear bgp ipv6 external soft",
7087 "Clear all external peers\n"
7090 DEFUN (clear_ip_bgp_as_soft,
7091 clear_ip_bgp_as_soft_cmd,
7092 "clear ip bgp " CMD_AS_RANGE " soft",
7096 "Clear peers with the AS number\n"
7099 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as,
7100 BGP_CLEAR_SOFT_BOTH, argv[0]);
7103 DEFUN (clear_ip_bgp_as_ipv4_soft,
7104 clear_ip_bgp_as_ipv4_soft_cmd,
7105 "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft",
7109 "Clear peers with the AS number\n"
7111 "Address Family Modifier\n"
7112 "Address Family Modifier\n"
7115 if (strncmp (argv[1], "m", 1) == 0)
7116 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as,
7117 BGP_CLEAR_SOFT_BOTH, argv[0]);
7119 return bgp_clear_vty (vty, NULL,AFI_IP, SAFI_UNICAST, clear_as,
7120 BGP_CLEAR_SOFT_BOTH, argv[0]);
7123 DEFUN (clear_ip_bgp_as_vpnv4_soft,
7124 clear_ip_bgp_as_vpnv4_soft_cmd,
7125 "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast soft",
7129 "Clear peers with the AS number\n"
7131 "Address Family Modifier\n"
7134 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as,
7135 BGP_CLEAR_SOFT_BOTH, argv[0]);
7138 DEFUN (clear_ip_bgp_as_encap_soft,
7139 clear_ip_bgp_as_encap_soft_cmd,
7140 "clear ip bgp " CMD_AS_RANGE " encap unicast soft",
7144 "Clear peers with the AS number\n"
7146 "Address Family Modifier\n"
7149 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as,
7150 BGP_CLEAR_SOFT_BOTH, argv[0]);
7153 DEFUN (clear_bgp_as_soft,
7154 clear_bgp_as_soft_cmd,
7155 "clear bgp " CMD_AS_RANGE " soft",
7158 "Clear peers with the AS number\n"
7161 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as,
7162 BGP_CLEAR_SOFT_BOTH, argv[0]);
7165 ALIAS (clear_bgp_as_soft,
7166 clear_bgp_ipv6_as_soft_cmd,
7167 "clear bgp ipv6 " CMD_AS_RANGE " soft",
7171 "Clear peers with the AS number\n"
7174 /* RS-client soft reconfiguration. */
7175 DEFUN (clear_bgp_all_rsclient,
7176 clear_bgp_all_rsclient_cmd,
7177 "clear bgp * rsclient",
7181 BGP_SOFT_RSCLIENT_RIB_STR)
7184 return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all,
7185 BGP_CLEAR_SOFT_RSCLIENT, NULL);
7187 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all,
7188 BGP_CLEAR_SOFT_RSCLIENT, NULL);
7191 ALIAS (clear_bgp_all_rsclient,
7192 clear_bgp_ipv6_all_rsclient_cmd,
7193 "clear bgp ipv6 * rsclient",
7198 BGP_SOFT_RSCLIENT_RIB_STR)
7200 ALIAS (clear_bgp_all_rsclient,
7201 clear_bgp_instance_all_rsclient_cmd,
7202 "clear bgp view WORD * rsclient",
7208 BGP_SOFT_RSCLIENT_RIB_STR)
7210 ALIAS (clear_bgp_all_rsclient,
7211 clear_bgp_ipv6_instance_all_rsclient_cmd,
7212 "clear bgp ipv6 view WORD * rsclient",
7219 BGP_SOFT_RSCLIENT_RIB_STR)
7221 DEFUN (clear_ip_bgp_all_rsclient,
7222 clear_ip_bgp_all_rsclient_cmd,
7223 "clear ip bgp * rsclient",
7228 BGP_SOFT_RSCLIENT_RIB_STR)
7231 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all,
7232 BGP_CLEAR_SOFT_RSCLIENT, NULL);
7234 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
7235 BGP_CLEAR_SOFT_RSCLIENT, NULL);
7238 ALIAS (clear_ip_bgp_all_rsclient,
7239 clear_ip_bgp_instance_all_rsclient_cmd,
7240 "clear ip bgp view WORD * rsclient",
7247 BGP_SOFT_RSCLIENT_RIB_STR)
7249 DEFUN (clear_bgp_peer_rsclient,
7250 clear_bgp_peer_rsclient_cmd,
7251 "clear bgp (A.B.C.D|X:X::X:X) rsclient",
7254 "BGP neighbor IP address to clear\n"
7255 "BGP IPv6 neighbor to clear\n"
7256 BGP_SOFT_RSCLIENT_RIB_STR)
7259 return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_peer,
7260 BGP_CLEAR_SOFT_RSCLIENT, argv[1]);
7262 return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer,
7263 BGP_CLEAR_SOFT_RSCLIENT, argv[0]);
7266 ALIAS (clear_bgp_peer_rsclient,
7267 clear_bgp_ipv6_peer_rsclient_cmd,
7268 "clear bgp ipv6 (A.B.C.D|X:X::X:X) rsclient",
7272 "BGP neighbor IP address to clear\n"
7273 "BGP IPv6 neighbor to clear\n"
7274 BGP_SOFT_RSCLIENT_RIB_STR)
7276 ALIAS (clear_bgp_peer_rsclient,
7277 clear_bgp_instance_peer_rsclient_cmd,
7278 "clear bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
7283 "BGP neighbor IP address to clear\n"
7284 "BGP IPv6 neighbor to clear\n"
7285 BGP_SOFT_RSCLIENT_RIB_STR)
7287 ALIAS (clear_bgp_peer_rsclient,
7288 clear_bgp_ipv6_instance_peer_rsclient_cmd,
7289 "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X) rsclient",
7295 "BGP neighbor IP address to clear\n"
7296 "BGP IPv6 neighbor to clear\n"
7297 BGP_SOFT_RSCLIENT_RIB_STR)
7299 DEFUN (clear_ip_bgp_peer_rsclient,
7300 clear_ip_bgp_peer_rsclient_cmd,
7301 "clear ip bgp (A.B.C.D|X:X::X:X) rsclient",
7305 "BGP neighbor IP address to clear\n"
7306 "BGP IPv6 neighbor to clear\n"
7307 BGP_SOFT_RSCLIENT_RIB_STR)
7310 return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_peer,
7311 BGP_CLEAR_SOFT_RSCLIENT, argv[1]);
7313 return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
7314 BGP_CLEAR_SOFT_RSCLIENT, argv[0]);
7317 ALIAS (clear_ip_bgp_peer_rsclient,
7318 clear_ip_bgp_instance_peer_rsclient_cmd,
7319 "clear ip bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
7325 "BGP neighbor IP address to clear\n"
7326 "BGP IPv6 neighbor to clear\n"
7327 BGP_SOFT_RSCLIENT_RIB_STR)
7329 DEFUN (show_bgp_views,
7334 "Show the defined BGP views\n")
7336 struct list *inst = bm->bgp;
7337 struct listnode *node;
7340 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE))
7342 vty_out (vty, "Multiple BGP views are not defined%s", VTY_NEWLINE);
7346 vty_out (vty, "Defined BGP views:%s", VTY_NEWLINE);
7347 for (ALL_LIST_ELEMENTS_RO(inst, node, bgp))
7348 vty_out (vty, "\t%s (AS%u)%s",
7349 bgp->name ? bgp->name : "(null)",
7350 bgp->as, VTY_NEWLINE);
7355 DEFUN (show_bgp_memory,
7356 show_bgp_memory_cmd,
7360 "Global BGP memory statistics\n")
7362 char memstrbuf[MTYPE_MEMSTR_LEN];
7363 unsigned long count;
7365 /* RIB related usage stats */
7366 count = mtype_stats_alloc (MTYPE_BGP_NODE);
7367 vty_out (vty, "%ld RIB nodes, using %s of memory%s", count,
7368 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7369 count * sizeof (struct bgp_node)),
7372 count = mtype_stats_alloc (MTYPE_BGP_ROUTE);
7373 vty_out (vty, "%ld BGP routes, using %s of memory%s", count,
7374 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7375 count * sizeof (struct bgp_info)),
7377 if ((count = mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA)))
7378 vty_out (vty, "%ld BGP route ancillaries, using %s of memory%s", count,
7379 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7380 count * sizeof (struct bgp_info_extra)),
7383 if ((count = mtype_stats_alloc (MTYPE_BGP_STATIC)))
7384 vty_out (vty, "%ld Static routes, using %s of memory%s", count,
7385 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7386 count * sizeof (struct bgp_static)),
7390 if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_IN)))
7391 vty_out (vty, "%ld Adj-In entries, using %s of memory%s", count,
7392 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7393 count * sizeof (struct bgp_adj_in)),
7395 if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_OUT)))
7396 vty_out (vty, "%ld Adj-Out entries, using %s of memory%s", count,
7397 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7398 count * sizeof (struct bgp_adj_out)),
7401 if ((count = mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE)))
7402 vty_out (vty, "%ld Nexthop cache entries, using %s of memory%s", count,
7403 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7404 count * sizeof (struct bgp_nexthop_cache)),
7407 if ((count = mtype_stats_alloc (MTYPE_BGP_DAMP_INFO)))
7408 vty_out (vty, "%ld Dampening entries, using %s of memory%s", count,
7409 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7410 count * sizeof (struct bgp_damp_info)),
7414 count = attr_count();
7415 vty_out (vty, "%ld BGP attributes, using %s of memory%s", count,
7416 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7417 count * sizeof(struct attr)),
7419 if ((count = mtype_stats_alloc (MTYPE_ATTR_EXTRA)))
7420 vty_out (vty, "%ld BGP extra attributes, using %s of memory%s", count,
7421 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7422 count * sizeof(struct attr_extra)),
7425 if ((count = attr_unknown_count()))
7426 vty_out (vty, "%ld unknown attributes%s", count, VTY_NEWLINE);
7428 /* AS_PATH attributes */
7429 count = aspath_count ();
7430 vty_out (vty, "%ld BGP AS-PATH entries, using %s of memory%s", count,
7431 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7432 count * sizeof (struct aspath)),
7435 count = mtype_stats_alloc (MTYPE_AS_SEG);
7436 vty_out (vty, "%ld BGP AS-PATH segments, using %s of memory%s", count,
7437 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7438 count * sizeof (struct assegment)),
7441 /* Other attributes */
7442 if ((count = community_count ()))
7443 vty_out (vty, "%ld BGP community entries, using %s of memory%s", count,
7444 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7445 count * sizeof (struct community)),
7447 if ((count = mtype_stats_alloc (MTYPE_ECOMMUNITY)))
7448 vty_out (vty, "%ld BGP community entries, using %s of memory%s", count,
7449 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7450 count * sizeof (struct ecommunity)),
7452 if ((count = mtype_stats_alloc (MTYPE_LCOMMUNITY)))
7453 vty_out (vty, "%ld BGP large-community entries, using %s of memory%s",
7455 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7456 count * sizeof (struct lcommunity)),
7458 if ((count = mtype_stats_alloc (MTYPE_CLUSTER)))
7459 vty_out (vty, "%ld Cluster lists, using %s of memory%s", count,
7460 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7461 count * sizeof (struct cluster_list)),
7464 /* Peer related usage */
7465 count = mtype_stats_alloc (MTYPE_BGP_PEER);
7466 vty_out (vty, "%ld peers, using %s of memory%s", count,
7467 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7468 count * sizeof (struct peer)),
7471 if ((count = mtype_stats_alloc (MTYPE_PEER_GROUP)))
7472 vty_out (vty, "%ld peer groups, using %s of memory%s", count,
7473 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7474 count * sizeof (struct peer_group)),
7478 if ((count = mtype_stats_alloc (MTYPE_HASH)))
7479 vty_out (vty, "%ld hash tables, using %s of memory%s", count,
7480 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7481 count * sizeof (struct hash)),
7483 if ((count = mtype_stats_alloc (MTYPE_HASH_BACKET)))
7484 vty_out (vty, "%ld hash buckets, using %s of memory%s", count,
7485 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7486 count * sizeof (struct hash_backet)),
7488 if ((count = mtype_stats_alloc (MTYPE_BGP_REGEXP)))
7489 vty_out (vty, "%ld compiled regexes, using %s of memory%s", count,
7490 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7491 count * sizeof (regex_t)),
7496 /* Show BGP peer's summary information. */
7498 bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi)
7501 struct listnode *node, *nnode;
7502 unsigned int count = 0;
7503 unsigned int totrcount = 0;
7504 unsigned int totecount = 0;
7505 char timebuf[BGP_UPTIME_LEN];
7508 /* Header string for each address family. */
7509 static char header[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
7511 for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
7513 if (peer->afc[afi][safi])
7518 char memstrbuf[MTYPE_MEMSTR_LEN];
7520 /* Usage summary and header */
7522 "BGP router identifier %s, local AS number %u%s",
7523 inet_ntoa (bgp->router_id), bgp->as, VTY_NEWLINE);
7525 ents = bgp_table_count (bgp->rib[afi][safi]);
7526 vty_out (vty, "RIB entries %ld, using %s of memory%s", ents,
7527 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7528 ents * sizeof (struct bgp_node)),
7531 /* Peer related usage */
7532 ents = listcount (bgp->peer);
7533 vty_out (vty, "Peers %ld, using %s of memory%s",
7535 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7536 ents * sizeof (struct peer)),
7539 if ((ents = listcount (bgp->rsclient)))
7540 vty_out (vty, "RS-Client peers %ld, using %s of memory%s",
7542 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7543 ents * sizeof (struct peer)),
7546 if ((ents = listcount (bgp->group)))
7547 vty_out (vty, "Peer groups %ld, using %s of memory%s", ents,
7548 mtype_memstr (memstrbuf, sizeof (memstrbuf),
7549 ents * sizeof (struct peer_group)),
7552 if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
7553 vty_out (vty, "Dampening enabled.%s", VTY_NEWLINE);
7554 vty_out (vty, "%s", VTY_NEWLINE);
7555 vty_out (vty, "%s%s", header, VTY_NEWLINE);
7560 len = vty_out (vty, "%s", peer->host);
7563 vty_out (vty, "%s%*s", VTY_NEWLINE, 16, " ");
7565 vty_out (vty, "%*s", len, " ");
7567 vty_out (vty, "4 ");
7569 vty_out (vty, "%5u %7d %7d %8d %4d %4d ",
7571 peer->open_in + peer->update_in + peer->keepalive_in
7572 + peer->notify_in + peer->refresh_in + peer->dynamic_cap_in,
7573 peer->open_out + peer->update_out + peer->keepalive_out
7574 + peer->notify_out + peer->refresh_out
7575 + peer->dynamic_cap_out,
7577 peer->sync[afi][safi]->update.count +
7578 peer->sync[afi][safi]->withdraw.count);
7580 vty_out (vty, "%8s",
7581 peer_uptime (peer->uptime, timebuf, BGP_UPTIME_LEN));
7583 if (peer->status == Established)
7585 vty_out (vty, " %8ld", peer->pcount[afi][safi]);
7586 totrcount += peer->pcount[afi][safi];
7591 if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))
7592 vty_out (vty, " Idle (Admin)");
7593 else if (CHECK_FLAG (peer->sflags, PEER_STATUS_PREFIX_OVERFLOW))
7594 vty_out (vty, " Idle (PfxCt)");
7596 vty_out (vty, " %-11s", LOOKUP(bgp_status_msg, peer->status));
7599 vty_out (vty, "%s", VTY_NEWLINE);
7605 vty_out (vty, "%sTotal number of neighbors %d%s", VTY_NEWLINE,
7606 count, VTY_NEWLINE);
7607 vty_out (vty, "%sTotal num. Established sessions %d%s", VTY_NEWLINE,
7608 totecount, VTY_NEWLINE);
7609 vty_out (vty, "Total num. of routes received %d%s",
7610 totrcount, VTY_NEWLINE);
7613 vty_out (vty, "No %s neighbor is configured%s",
7614 afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE);
7619 bgp_show_summary_vty (struct vty *vty, const char *name,
7620 afi_t afi, safi_t safi)
7626 bgp = bgp_lookup_by_name (name);
7630 vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE);
7634 bgp_show_summary (vty, bgp, afi, safi);
7638 bgp = bgp_get_default ();
7641 bgp_show_summary (vty, bgp, afi, safi);
7646 /* `show ip bgp summary' commands. */
7647 DEFUN (show_ip_bgp_summary,
7648 show_ip_bgp_summary_cmd,
7649 "show ip bgp summary",
7653 "Summary of BGP neighbor status\n")
7655 return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
7658 DEFUN (show_ip_bgp_instance_summary,
7659 show_ip_bgp_instance_summary_cmd,
7660 "show ip bgp view WORD summary",
7666 "Summary of BGP neighbor status\n")
7668 return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
7671 DEFUN (show_ip_bgp_ipv4_summary,
7672 show_ip_bgp_ipv4_summary_cmd,
7673 "show ip bgp ipv4 (unicast|multicast) summary",
7678 "Address Family modifier\n"
7679 "Address Family modifier\n"
7680 "Summary of BGP neighbor status\n")
7682 if (strncmp (argv[0], "m", 1) == 0)
7683 return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
7685 return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
7688 DEFUN (show_ip_bgp_instance_ipv4_summary,
7689 show_ip_bgp_instance_ipv4_summary_cmd,
7690 "show ip bgp view WORD ipv4 (unicast|multicast) summary",
7697 "Address Family modifier\n"
7698 "Address Family modifier\n"
7699 "Summary of BGP neighbor status\n")
7701 if (strncmp (argv[1], "m", 1) == 0)
7702 return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST);
7704 return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
7707 DEFUN (show_ip_bgp_vpnv4_all_summary,
7708 show_ip_bgp_vpnv4_all_summary_cmd,
7709 "show ip bgp vpnv4 all summary",
7713 "Display VPNv4 NLRI specific information\n"
7714 "Display information about all VPNv4 NLRIs\n"
7715 "Summary of BGP neighbor status\n")
7717 return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
7720 DEFUN (show_ip_bgp_vpnv4_rd_summary,
7721 show_ip_bgp_vpnv4_rd_summary_cmd,
7722 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary",
7726 "Display VPNv4 NLRI specific information\n"
7727 "Display information for a route distinguisher\n"
7728 "VPN Route Distinguisher\n"
7729 "Summary of BGP neighbor status\n")
7732 struct prefix_rd prd;
7734 ret = str2prefix_rd (argv[0], &prd);
7737 vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
7741 return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
7744 DEFUN (show_bgp_ipv4_safi_summary,
7745 show_bgp_ipv4_safi_summary_cmd,
7746 "show bgp ipv4 (unicast|multicast) summary",
7750 "Address Family modifier\n"
7751 "Address Family modifier\n"
7752 "Summary of BGP neighbor status\n")
7754 if (strncmp (argv[0], "m", 1) == 0)
7755 return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
7757 return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
7760 DEFUN (show_bgp_instance_ipv4_safi_summary,
7761 show_bgp_instance_ipv4_safi_summary_cmd,
7762 "show bgp view WORD ipv4 (unicast|multicast) summary",
7768 "Address Family modifier\n"
7769 "Address Family modifier\n"
7770 "Summary of BGP neighbor status\n")
7772 if (strncmp (argv[1], "m", 1) == 0)
7773 return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST);
7775 return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
7778 DEFUN (show_bgp_ipv4_vpn_summary,
7779 show_bgp_ipv4_vpn_summary_cmd,
7780 "show bgp ipv4 vpn summary",
7784 "Display VPN NLRI specific information\n"
7785 "Summary of BGP neighbor status\n")
7787 return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
7790 /* `show ip bgp summary' commands. */
7791 DEFUN (show_bgp_ipv6_vpn_summary,
7792 show_bgp_ipv6_vpn_summary_cmd,
7793 "show bgp ipv6 vpn summary",
7797 "Display VPN NLRI specific information\n"
7798 "Summary of BGP neighbor status\n")
7800 return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN);
7803 DEFUN (show_bgp_ipv4_encap_summary,
7804 show_bgp_ipv4_encap_summary_cmd,
7805 "show bgp ipv4 encap summary",
7809 "Display ENCAP NLRI specific information\n"
7810 "Summary of BGP neighbor status\n")
7812 return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP);
7815 DEFUN (show_bgp_ipv6_encap_summary,
7816 show_bgp_ipv6_encap_summary_cmd,
7817 "show bgp ipv6 encap summary",
7821 "Display ENCAP NLRI specific information\n"
7822 "Summary of BGP neighbor status\n")
7824 return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
7827 DEFUN (show_bgp_instance_summary,
7828 show_bgp_instance_summary_cmd,
7829 "show bgp view WORD summary",
7834 "Summary of BGP neighbor status\n")
7836 vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7837 vty_out(vty, "---------------------%s", VTY_NEWLINE);
7838 bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
7839 vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7840 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
7841 bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST);
7842 vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7843 vty_out(vty, "-----------------%s", VTY_NEWLINE);
7844 bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN);
7845 vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7846 vty_out(vty, "-------------------%s", VTY_NEWLINE);
7847 bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP);
7849 vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7850 vty_out(vty, "---------------------%s", VTY_NEWLINE);
7851 bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
7852 vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7853 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
7854 bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST);
7855 vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7856 vty_out(vty, "-----------------%s", VTY_NEWLINE);
7857 bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN);
7858 vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7859 vty_out(vty, "-------------------%s", VTY_NEWLINE);
7860 bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP);
7865 DEFUN (show_bgp_instance_ipv4_summary,
7866 show_bgp_instance_ipv4_summary_cmd,
7867 "show bgp view WORD ipv4 summary",
7871 "Address Family modifier\n"
7872 "Address Family modifier\n"
7875 "Summary of BGP neighbor status\n")
7877 vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7878 vty_out(vty, "---------------------%s", VTY_NEWLINE);
7879 bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
7880 vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7881 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
7882 bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST);
7883 vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7884 vty_out(vty, "-----------------%s", VTY_NEWLINE);
7885 bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN);
7886 vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7887 vty_out(vty, "-------------------%s", VTY_NEWLINE);
7888 bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP);
7893 DEFUN (show_bgp_instance_ipv6_summary,
7894 show_bgp_instance_ipv6_summary_cmd,
7895 "show bgp view WORD ipv6 summary",
7899 "Address Family modifier\n"
7900 "Address Family modifier\n"
7903 "Summary of BGP neighbor status\n")
7905 vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7906 vty_out(vty, "---------------------%s", VTY_NEWLINE);
7907 bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
7908 vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7909 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
7910 bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST);
7911 vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7912 vty_out(vty, "-----------------%s", VTY_NEWLINE);
7913 bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN);
7914 vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7915 vty_out(vty, "-------------------%s", VTY_NEWLINE);
7916 bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP);
7921 DEFUN (show_bgp_ipv6_safi_summary,
7922 show_bgp_ipv6_safi_summary_cmd,
7923 "show bgp ipv6 (unicast|multicast) summary",
7927 "Address Family modifier\n"
7928 "Address Family modifier\n"
7929 "Summary of BGP neighbor status\n")
7931 if (strncmp (argv[0], "m", 1) == 0)
7932 return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
7934 return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
7937 DEFUN (show_bgp_instance_ipv6_safi_summary,
7938 show_bgp_instance_ipv6_safi_summary_cmd,
7939 "show bgp view WORD ipv6 (unicast|multicast) summary",
7945 "Address Family modifier\n"
7946 "Address Family modifier\n"
7947 "Summary of BGP neighbor status\n")
7949 if (strncmp (argv[1], "m", 1) == 0)
7950 return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST);
7952 return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
7956 DEFUN (show_ipv6_bgp_summary,
7957 show_ipv6_bgp_summary_cmd,
7958 "show ipv6 bgp summary",
7962 "Summary of BGP neighbor status\n")
7964 return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
7968 DEFUN (show_ipv6_mbgp_summary,
7969 show_ipv6_mbgp_summary_cmd,
7970 "show ipv6 mbgp summary",
7974 "Summary of BGP neighbor status\n")
7976 return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
7979 /* variations of show bgp [...] summary */
7981 /* This one is for the 0-keyword variant */
7982 DEFUN (show_bgp_summary,
7983 show_bgp_summary_cmd,
7987 "Summary of BGP neighbor status\n")
7989 vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7990 vty_out(vty, "---------------------%s", VTY_NEWLINE);
7991 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
7992 vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7993 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
7994 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
7995 vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7996 vty_out(vty, "-----------------%s", VTY_NEWLINE);
7997 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
7998 vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
7999 vty_out(vty, "-------------------%s", VTY_NEWLINE);
8000 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP);
8002 vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8003 vty_out(vty, "---------------------%s", VTY_NEWLINE);
8004 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
8005 vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8006 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
8007 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
8008 vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8009 vty_out(vty, "-----------------%s", VTY_NEWLINE);
8010 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN);
8011 vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8012 vty_out(vty, "-------------------%s", VTY_NEWLINE);
8013 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
8018 ALIAS (show_bgp_summary,
8019 show_bgp_ipv6_summary_cmd,
8020 "show bgp ipv6 summary",
8024 "Summary of BGP neighbor status\n")
8026 DEFUN (show_bgp_summary_1w,
8027 show_bgp_summary_1w_cmd,
8028 "show bgp (ipv4|ipv6|unicast|multicast|vpn|encap) summary",
8033 "Address Family modifier\n"
8034 "Address Family modifier\n"
8035 "Address Family modifier\n"
8036 "Address Family modifier\n"
8037 "Summary of BGP neighbor status\n")
8039 if (strcmp (argv[0], "ipv4") == 0) {
8040 vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8041 vty_out(vty, "---------------------%s", VTY_NEWLINE);
8042 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
8043 vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8044 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
8045 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
8046 vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8047 vty_out(vty, "-----------------%s", VTY_NEWLINE);
8048 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
8049 vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8050 vty_out(vty, "-------------------%s", VTY_NEWLINE);
8051 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP);
8055 if (strcmp (argv[0], "ipv6") == 0) {
8056 vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8057 vty_out(vty, "---------------------%s", VTY_NEWLINE);
8058 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
8059 vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8060 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
8061 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
8062 vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8063 vty_out(vty, "-----------------%s", VTY_NEWLINE);
8064 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN);
8065 vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
8066 vty_out(vty, "-------------------%s", VTY_NEWLINE);
8067 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
8071 if (strcmp (argv[0], "unicast") == 0) {
8072 vty_out(vty, "IPv4 Unicast Summary:%s", VTY_NEWLINE);
8073 vty_out(vty, "---------------------%s", VTY_NEWLINE);
8074 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
8075 vty_out(vty, "%s", VTY_NEWLINE);
8076 vty_out(vty, "IPv6 Unicast Summary:%s", VTY_NEWLINE);
8077 vty_out(vty, "---------------------%s", VTY_NEWLINE);
8078 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
8081 if (strcmp (argv[0], "multicast") == 0) {
8082 vty_out(vty, "IPv4 Multicast Summary:%s", VTY_NEWLINE);
8083 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
8084 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
8085 vty_out(vty, "%s", VTY_NEWLINE);
8086 vty_out(vty, "IPv6 Multicast Summary:%s", VTY_NEWLINE);
8087 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
8088 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
8091 if (strcmp (argv[0], "vpn") == 0) {
8092 vty_out(vty, "IPv4 VPN Summary:%s", VTY_NEWLINE);
8093 vty_out(vty, "-----------------%s", VTY_NEWLINE);
8094 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
8095 vty_out(vty, "%s", VTY_NEWLINE);
8096 vty_out(vty, "IPv6 VPN Summary:%s", VTY_NEWLINE);
8097 vty_out(vty, "-----------------%s", VTY_NEWLINE);
8098 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN);
8101 if (strcmp (argv[0], "encap") == 0) {
8102 vty_out(vty, "IPv4 Encap Summary:%s", VTY_NEWLINE);
8103 vty_out(vty, "-------------------%s", VTY_NEWLINE);
8104 bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP);
8105 vty_out(vty, "%s", VTY_NEWLINE);
8106 vty_out(vty, "IPv6 Encap Summary:%s", VTY_NEWLINE);
8107 vty_out(vty, "-------------------%s", VTY_NEWLINE);
8108 bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
8111 vty_out(vty, "Unknown keyword: %s%s", argv[0], VTY_NEWLINE);
8118 afi_safi_print (afi_t afi, safi_t safi)
8120 if (afi == AFI_IP && safi == SAFI_UNICAST)
8121 return "IPv4 Unicast";
8122 else if (afi == AFI_IP && safi == SAFI_MULTICAST)
8123 return "IPv4 Multicast";
8124 else if (afi == AFI_IP && safi == SAFI_MPLS_VPN)
8125 return "VPN-IPv4 Unicast";
8126 else if (afi == AFI_IP && safi == SAFI_ENCAP)
8127 return "ENCAP-IPv4 Unicast";
8128 else if (afi == AFI_IP6 && safi == SAFI_UNICAST)
8129 return "IPv6 Unicast";
8130 else if (afi == AFI_IP6 && safi == SAFI_MULTICAST)
8131 return "IPv6 Multicast";
8132 else if (afi == AFI_IP6 && safi == SAFI_MPLS_VPN)
8133 return "VPN-IPv6 Unicast";
8134 else if (afi == AFI_IP6 && safi == SAFI_ENCAP)
8135 return "ENCAP-IPv6 Unicast";
8140 /* Show BGP peer's information. */
8148 bgp_show_peer_afi_orf_cap (struct vty *vty, struct peer *p,
8149 afi_t afi, safi_t safi,
8150 u_int16_t adv_smcap, u_int16_t adv_rmcap,
8151 u_int16_t rcv_smcap, u_int16_t rcv_rmcap)
8154 if (CHECK_FLAG (p->af_cap[afi][safi], adv_smcap)
8155 || CHECK_FLAG (p->af_cap[afi][safi], rcv_smcap))
8157 vty_out (vty, " Send-mode: ");
8158 if (CHECK_FLAG (p->af_cap[afi][safi], adv_smcap))
8159 vty_out (vty, "advertised");
8160 if (CHECK_FLAG (p->af_cap[afi][safi], rcv_smcap))
8161 vty_out (vty, "%sreceived",
8162 CHECK_FLAG (p->af_cap[afi][safi], adv_smcap) ?
8164 vty_out (vty, "%s", VTY_NEWLINE);
8168 if (CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap)
8169 || CHECK_FLAG (p->af_cap[afi][safi], rcv_rmcap))
8171 vty_out (vty, " Receive-mode: ");
8172 if (CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap))
8173 vty_out (vty, "advertised");
8174 if (CHECK_FLAG (p->af_cap[afi][safi], rcv_rmcap))
8175 vty_out (vty, "%sreceived",
8176 CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap) ?
8178 vty_out (vty, "%s", VTY_NEWLINE);
8183 bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi)
8185 struct bgp_filter *filter;
8186 char orf_pfx_name[BUFSIZ];
8189 filter = &p->filter[afi][safi];
8191 vty_out (vty, " For address family: %s%s", afi_safi_print (afi, safi),
8194 if (p->af_group[afi][safi])
8195 vty_out (vty, " %s peer-group member%s", p->group->name, VTY_NEWLINE);
8197 if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV)
8198 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV)
8199 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_OLD_RCV)
8200 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV)
8201 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV)
8202 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV))
8203 vty_out (vty, " AF-dependant capabilities:%s", VTY_NEWLINE);
8205 if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV)
8206 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV)
8207 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV)
8208 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV))
8210 vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
8211 ORF_TYPE_PREFIX, VTY_NEWLINE);
8212 bgp_show_peer_afi_orf_cap (vty, p, afi, safi,
8213 PEER_CAP_ORF_PREFIX_SM_ADV,
8214 PEER_CAP_ORF_PREFIX_RM_ADV,
8215 PEER_CAP_ORF_PREFIX_SM_RCV,
8216 PEER_CAP_ORF_PREFIX_RM_RCV);
8218 if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV)
8219 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_OLD_RCV)
8220 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV)
8221 || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV))
8223 vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
8224 ORF_TYPE_PREFIX_OLD, VTY_NEWLINE);
8225 bgp_show_peer_afi_orf_cap (vty, p, afi, safi,
8226 PEER_CAP_ORF_PREFIX_SM_ADV,
8227 PEER_CAP_ORF_PREFIX_RM_ADV,
8228 PEER_CAP_ORF_PREFIX_SM_OLD_RCV,
8229 PEER_CAP_ORF_PREFIX_RM_OLD_RCV);
8232 sprintf (orf_pfx_name, "%s.%d.%d", p->host, afi, safi);
8233 orf_pfx_count = prefix_bgp_show_prefix_list (NULL, afi, orf_pfx_name);
8235 if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_PREFIX_SEND)
8238 vty_out (vty, " Outbound Route Filter (ORF):");
8239 if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_PREFIX_SEND))
8240 vty_out (vty, " sent;");
8242 vty_out (vty, " received (%d entries)", orf_pfx_count);
8243 vty_out (vty, "%s", VTY_NEWLINE);
8245 if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_WAIT_REFRESH))
8246 vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE);
8248 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT))
8249 vty_out (vty, " Route-Reflector Client%s", VTY_NEWLINE);
8250 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT))
8251 vty_out (vty, " Route-Server Client%s", VTY_NEWLINE);
8252 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG))
8253 vty_out (vty, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE);
8254 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS))
8255 vty_out (vty, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE);
8256 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF))
8257 vty_out (vty, " NEXT_HOP is always this router%s", VTY_NEWLINE);
8258 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_AS_PATH_UNCHANGED))
8259 vty_out (vty, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE);
8260 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED))
8261 vty_out (vty, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE);
8262 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MED_UNCHANGED))
8263 vty_out (vty, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE);
8264 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY)
8265 || CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)
8266 || CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY))
8268 vty_out (vty, " Community attribute sent to this neighbor");
8269 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY)
8270 && CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)
8271 && CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY))
8272 vty_out (vty, "(all)%s", VTY_NEWLINE);
8273 else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY))
8274 vty_out (vty, "(extended)%s", VTY_NEWLINE);
8275 else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_LARGE_COMMUNITY))
8276 vty_out (vty, "(large)%s", VTY_NEWLINE);
8278 vty_out (vty, "(standard)%s", VTY_NEWLINE);
8280 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_DEFAULT_ORIGINATE))
8282 vty_out (vty, " Default information originate,");
8284 if (p->default_rmap[afi][safi].name)
8285 vty_out (vty, " default route-map %s%s,",
8286 p->default_rmap[afi][safi].map ? "*" : "",
8287 p->default_rmap[afi][safi].name);
8288 if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_DEFAULT_ORIGINATE))
8289 vty_out (vty, " default sent%s", VTY_NEWLINE);
8291 vty_out (vty, " default not sent%s", VTY_NEWLINE);
8294 if (filter->plist[FILTER_IN].name
8295 || filter->dlist[FILTER_IN].name
8296 || filter->aslist[FILTER_IN].name
8297 || filter->map[RMAP_IN].name)
8298 vty_out (vty, " Inbound path policy configured%s", VTY_NEWLINE);
8299 if (filter->plist[FILTER_OUT].name
8300 || filter->dlist[FILTER_OUT].name
8301 || filter->aslist[FILTER_OUT].name
8302 || filter->map[RMAP_OUT].name
8303 || filter->usmap.name)
8304 vty_out (vty, " Outbound path policy configured%s", VTY_NEWLINE);
8305 if (filter->map[RMAP_IMPORT].name)
8306 vty_out (vty, " Import policy for this RS-client configured%s", VTY_NEWLINE);
8307 if (filter->map[RMAP_EXPORT].name)
8308 vty_out (vty, " Export policy for this RS-client configured%s", VTY_NEWLINE);
8311 if (filter->plist[FILTER_IN].name)
8312 vty_out (vty, " Incoming update prefix filter list is %s%s%s",
8313 filter->plist[FILTER_IN].plist ? "*" : "",
8314 filter->plist[FILTER_IN].name,
8316 if (filter->plist[FILTER_OUT].name)
8317 vty_out (vty, " Outgoing update prefix filter list is %s%s%s",
8318 filter->plist[FILTER_OUT].plist ? "*" : "",
8319 filter->plist[FILTER_OUT].name,
8322 /* distribute-list */
8323 if (filter->dlist[FILTER_IN].name)
8324 vty_out (vty, " Incoming update network filter list is %s%s%s",
8325 filter->dlist[FILTER_IN].alist ? "*" : "",
8326 filter->dlist[FILTER_IN].name,
8328 if (filter->dlist[FILTER_OUT].name)
8329 vty_out (vty, " Outgoing update network filter list is %s%s%s",
8330 filter->dlist[FILTER_OUT].alist ? "*" : "",
8331 filter->dlist[FILTER_OUT].name,
8335 if (filter->aslist[FILTER_IN].name)
8336 vty_out (vty, " Incoming update AS path filter list is %s%s%s",
8337 filter->aslist[FILTER_IN].aslist ? "*" : "",
8338 filter->aslist[FILTER_IN].name,
8340 if (filter->aslist[FILTER_OUT].name)
8341 vty_out (vty, " Outgoing update AS path filter list is %s%s%s",
8342 filter->aslist[FILTER_OUT].aslist ? "*" : "",
8343 filter->aslist[FILTER_OUT].name,
8347 if (filter->map[RMAP_IN].name)
8348 vty_out (vty, " Route map for incoming advertisements is %s%s%s",
8349 filter->map[RMAP_IN].map ? "*" : "",
8350 filter->map[RMAP_IN].name,
8352 if (filter->map[RMAP_OUT].name)
8353 vty_out (vty, " Route map for outgoing advertisements is %s%s%s",
8354 filter->map[RMAP_OUT].map ? "*" : "",
8355 filter->map[RMAP_OUT].name,
8357 if (filter->map[RMAP_IMPORT].name)
8358 vty_out (vty, " Route map for advertisements going into this RS-client's table is %s%s%s",
8359 filter->map[RMAP_IMPORT].map ? "*" : "",
8360 filter->map[RMAP_IMPORT].name,
8362 if (filter->map[RMAP_EXPORT].name)
8363 vty_out (vty, " Route map for advertisements coming from this RS-client is %s%s%s",
8364 filter->map[RMAP_EXPORT].map ? "*" : "",
8365 filter->map[RMAP_EXPORT].name,
8368 /* unsuppress-map */
8369 if (filter->usmap.name)
8370 vty_out (vty, " Route map for selective unsuppress is %s%s%s",
8371 filter->usmap.map ? "*" : "",
8372 filter->usmap.name, VTY_NEWLINE);
8374 /* Receive prefix count */
8375 vty_out (vty, " %ld accepted prefixes%s", p->pcount[afi][safi], VTY_NEWLINE);
8377 /* Maximum prefix */
8378 if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX))
8380 vty_out (vty, " Maximum prefixes allowed %ld%s%s", p->pmax[afi][safi],
8381 CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING)
8382 ? " (warning-only)" : "", VTY_NEWLINE);
8383 vty_out (vty, " Threshold for warning message %d%%",
8384 p->pmax_threshold[afi][safi]);
8385 if (p->pmax_restart[afi][safi])
8386 vty_out (vty, ", restart interval %d min", p->pmax_restart[afi][safi]);
8387 vty_out (vty, "%s", VTY_NEWLINE);
8390 vty_out (vty, "%s", VTY_NEWLINE);
8394 bgp_show_peer (struct vty *vty, struct peer *p)
8398 char timebuf[BGP_UPTIME_LEN];
8405 /* Configured IP address. */
8406 vty_out (vty, "BGP neighbor is %s, ", p->host);
8407 vty_out (vty, "remote AS %u, ", p->as);
8408 vty_out (vty, "local AS %u%s%s, ",
8409 p->change_local_as ? p->change_local_as : p->local_as,
8410 CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ?
8412 CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS) ?
8413 " replace-as" : "");
8414 vty_out (vty, "%s link%s",
8415 p->as == p->local_as ? "internal" : "external",
8420 vty_out (vty, " Description: %s%s", p->desc, VTY_NEWLINE);
8424 vty_out (vty, " Member of peer-group %s for session parameters%s",
8425 p->group->name, VTY_NEWLINE);
8427 /* Administrative shutdown. */
8428 if (CHECK_FLAG (p->flags, PEER_FLAG_SHUTDOWN))
8429 vty_out (vty, " Administratively shut down%s", VTY_NEWLINE);
8432 vty_out (vty, " BGP version 4");
8433 vty_out (vty, ", remote router ID %s%s",
8434 inet_ntop (AF_INET, &p->remote_id, buf1, BUFSIZ),
8438 if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION)
8439 && bgp_confederation_peers_check (bgp, p->as))
8440 vty_out (vty, " Neighbor under common administration%s", VTY_NEWLINE);
8443 vty_out (vty, " BGP state = %s",
8444 LOOKUP (bgp_status_msg, p->status));
8445 if (p->status == Established)
8446 vty_out (vty, ", up for %8s",
8447 peer_uptime (p->uptime, timebuf, BGP_UPTIME_LEN));
8448 else if (p->status == Active)
8450 if (CHECK_FLAG (p->flags, PEER_FLAG_PASSIVE))
8451 vty_out (vty, " (passive)");
8452 else if (CHECK_FLAG (p->sflags, PEER_STATUS_NSF_WAIT))
8453 vty_out (vty, " (NSF passive)");
8455 vty_out (vty, "%s", VTY_NEWLINE);
8458 vty_out (vty, " Last read %s", peer_uptime (p->readtime, timebuf, BGP_UPTIME_LEN));
8460 /* Configured timer values. */
8461 vty_out (vty, ", hold time is %d, keepalive interval is %d seconds%s",
8462 p->v_holdtime, p->v_keepalive, VTY_NEWLINE);
8463 if (CHECK_FLAG (p->config, PEER_CONFIG_TIMER))
8465 vty_out (vty, " Configured hold time is %d", p->holdtime);
8466 vty_out (vty, ", keepalive interval is %d seconds%s",
8467 p->keepalive, VTY_NEWLINE);
8471 if (p->status == Established)
8474 || p->afc_adv[AFI_IP][SAFI_UNICAST]
8475 || p->afc_recv[AFI_IP][SAFI_UNICAST]
8476 || p->afc_adv[AFI_IP][SAFI_MULTICAST]
8477 || p->afc_recv[AFI_IP][SAFI_MULTICAST]
8478 || p->afc_adv[AFI_IP6][SAFI_UNICAST]
8479 || p->afc_recv[AFI_IP6][SAFI_UNICAST]
8480 || p->afc_adv[AFI_IP6][SAFI_MULTICAST]
8481 || p->afc_recv[AFI_IP6][SAFI_MULTICAST]
8482 || p->afc_adv[AFI_IP6][SAFI_MPLS_VPN]
8483 || p->afc_recv[AFI_IP6][SAFI_MPLS_VPN]
8484 || p->afc_adv[AFI_IP6][SAFI_ENCAP]
8485 || p->afc_recv[AFI_IP6][SAFI_ENCAP]
8486 || p->afc_adv[AFI_IP][SAFI_ENCAP]
8487 || p->afc_recv[AFI_IP][SAFI_ENCAP]
8488 || p->afc_adv[AFI_IP][SAFI_MPLS_VPN]
8489 || p->afc_recv[AFI_IP][SAFI_MPLS_VPN])
8491 vty_out (vty, " Neighbor capabilities:%s", VTY_NEWLINE);
8494 if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV)
8495 || CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV))
8497 vty_out (vty, " 4 Byte AS:");
8498 if (CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV))
8499 vty_out (vty, " advertised");
8500 if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV))
8501 vty_out (vty, " %sreceived",
8502 CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV) ? "and " : "");
8503 vty_out (vty, "%s", VTY_NEWLINE);
8506 if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV)
8507 || CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV))
8509 vty_out (vty, " Dynamic:");
8510 if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV))
8511 vty_out (vty, " advertised");
8512 if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV))
8513 vty_out (vty, " %sreceived",
8514 CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV) ? "and " : "");
8515 vty_out (vty, "%s", VTY_NEWLINE);
8519 if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV)
8520 || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)
8521 || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV))
8523 vty_out (vty, " Route refresh:");
8524 if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV))
8525 vty_out (vty, " advertised");
8526 if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)
8527 || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV))
8528 vty_out (vty, " %sreceived(%s)",
8529 CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV) ? "and " : "",
8530 (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV)
8531 && CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)) ?
8532 "old & new" : CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) ? "old" : "new");
8534 vty_out (vty, "%s", VTY_NEWLINE);
8537 /* Multiprotocol Extensions */
8538 for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
8539 for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
8540 if (p->afc_adv[afi][safi] || p->afc_recv[afi][safi])
8542 vty_out (vty, " Address family %s:", afi_safi_print (afi, safi));
8543 if (p->afc_adv[afi][safi])
8544 vty_out (vty, " advertised");
8545 if (p->afc_recv[afi][safi])
8546 vty_out (vty, " %sreceived", p->afc_adv[afi][safi] ? "and " : "");
8547 vty_out (vty, "%s", VTY_NEWLINE);
8550 /* Gracefull Restart */
8551 if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)
8552 || CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV))
8554 vty_out (vty, " Graceful Restart Capabilty:");
8555 if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV))
8556 vty_out (vty, " advertised");
8557 if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV))
8558 vty_out (vty, " %sreceived",
8559 CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV) ? "and " : "");
8560 vty_out (vty, "%s", VTY_NEWLINE);
8562 if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV))
8564 int restart_af_count = 0;
8566 vty_out (vty, " Remote Restart timer is %d seconds%s",
8567 p->v_gr_restart, VTY_NEWLINE);
8568 vty_out (vty, " Address families by peer:%s ", VTY_NEWLINE);
8570 for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
8571 for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
8572 if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_RESTART_AF_RCV))
8574 vty_out (vty, "%s%s(%s)", restart_af_count ? ", " : "",
8575 afi_safi_print (afi, safi),
8576 CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_RESTART_AF_PRESERVE_RCV) ?
8577 "preserved" : "not preserved");
8580 if (! restart_af_count)
8581 vty_out (vty, "none");
8582 vty_out (vty, "%s", VTY_NEWLINE);
8588 /* graceful restart information */
8589 if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)
8593 int eor_send_af_count = 0;
8594 int eor_receive_af_count = 0;
8596 vty_out (vty, " Graceful restart informations:%s", VTY_NEWLINE);
8597 if (p->status == Established)
8599 vty_out (vty, " End-of-RIB send: ");
8600 for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
8601 for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
8602 if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_EOR_SEND))
8604 vty_out (vty, "%s%s", eor_send_af_count ? ", " : "",
8605 afi_safi_print (afi, safi));
8606 eor_send_af_count++;
8608 vty_out (vty, "%s", VTY_NEWLINE);
8610 vty_out (vty, " End-of-RIB received: ");
8611 for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
8612 for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
8613 if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_EOR_RECEIVED))
8615 vty_out (vty, "%s%s", eor_receive_af_count ? ", " : "",
8616 afi_safi_print (afi, safi));
8617 eor_receive_af_count++;
8619 vty_out (vty, "%s", VTY_NEWLINE);
8622 if (p->t_gr_restart)
8623 vty_out (vty, " The remaining time of restart timer is %ld%s",
8624 thread_timer_remain_second (p->t_gr_restart), VTY_NEWLINE);
8627 vty_out (vty, " The remaining time of stalepath timer is %ld%s",
8628 thread_timer_remain_second (p->t_gr_stale), VTY_NEWLINE);
8631 /* Packet counts. */
8632 vty_out (vty, " Message statistics:%s", VTY_NEWLINE);
8633 vty_out (vty, " Inq depth is 0%s", VTY_NEWLINE);
8634 vty_out (vty, " Outq depth is %lu%s", (unsigned long) p->obuf->count, VTY_NEWLINE);
8635 vty_out (vty, " Sent Rcvd%s", VTY_NEWLINE);
8636 vty_out (vty, " Opens: %10d %10d%s", p->open_out, p->open_in, VTY_NEWLINE);
8637 vty_out (vty, " Notifications: %10d %10d%s", p->notify_out, p->notify_in, VTY_NEWLINE);
8638 vty_out (vty, " Updates: %10d %10d%s", p->update_out, p->update_in, VTY_NEWLINE);
8639 vty_out (vty, " Keepalives: %10d %10d%s", p->keepalive_out, p->keepalive_in, VTY_NEWLINE);
8640 vty_out (vty, " Route Refresh: %10d %10d%s", p->refresh_out, p->refresh_in, VTY_NEWLINE);
8641 vty_out (vty, " Capability: %10d %10d%s", p->dynamic_cap_out, p->dynamic_cap_in, VTY_NEWLINE);
8642 vty_out (vty, " Total: %10d %10d%s", p->open_out + p->notify_out +
8643 p->update_out + p->keepalive_out + p->refresh_out + p->dynamic_cap_out,
8644 p->open_in + p->notify_in + p->update_in + p->keepalive_in + p->refresh_in +
8645 p->dynamic_cap_in, VTY_NEWLINE);
8647 /* advertisement-interval */
8648 vty_out (vty, " Minimum time between advertisement runs is %d seconds%s",
8649 p->v_routeadv, VTY_NEWLINE);
8651 /* Update-source. */
8652 if (p->update_if || p->update_source)
8654 vty_out (vty, " Update source is ");
8656 vty_out (vty, "%s", p->update_if);
8657 else if (p->update_source)
8659 sockunion2str (p->update_source, buf1, SU_ADDRSTRLEN));
8660 vty_out (vty, "%s", VTY_NEWLINE);
8663 /* Default weight */
8664 if (CHECK_FLAG (p->config, PEER_CONFIG_WEIGHT))
8665 vty_out (vty, " Default weight %d%s", p->weight,
8668 vty_out (vty, "%s", VTY_NEWLINE);
8670 /* Address Family Information */
8671 for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
8672 for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
8673 if (p->afc[afi][safi])
8674 bgp_show_peer_afi (vty, p, afi, safi);
8676 vty_out (vty, " Connections established %d; dropped %d%s",
8677 p->established, p->dropped,
8681 vty_out (vty, " Last reset never%s", VTY_NEWLINE);
8683 vty_out (vty, " Last reset %s, due to %s%s",
8684 peer_uptime (p->resettime, timebuf, BGP_UPTIME_LEN),
8685 peer_down_str[(int) p->last_reset], VTY_NEWLINE);
8687 if (CHECK_FLAG (p->sflags, PEER_STATUS_PREFIX_OVERFLOW))
8689 vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE);
8691 if (p->t_pmax_restart)
8692 vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
8693 p->host, thread_timer_remain_second (p->t_pmax_restart),
8696 vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
8697 p->host, VTY_NEWLINE);
8700 /* EBGP Multihop and GTSM */
8704 vty_out (vty, " %s BGP neighbor may be up to %d hops away.%s",
8705 p->sort == BGP_PEER_IBGP ? "Internal" : "External",
8708 /* Local address. */
8711 vty_out (vty, "Local host: %s, Local port: %d%s",
8712 sockunion2str (p->su_local, buf1, SU_ADDRSTRLEN),
8713 ntohs (p->su_local->sin.sin_port),
8717 /* Remote address. */
8720 vty_out (vty, "Foreign host: %s, Foreign port: %d%s",
8721 sockunion2str (p->su_remote, buf1, SU_ADDRSTRLEN),
8722 ntohs (p->su_remote->sin.sin_port),
8726 /* Nexthop display. */
8729 vty_out (vty, "Nexthop: %s%s",
8730 inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ),
8732 vty_out (vty, "Nexthop global: %s%s",
8733 inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ),
8735 vty_out (vty, "Nexthop local: %s%s",
8736 inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, BUFSIZ),
8738 vty_out (vty, "BGP connection: %s%s",
8739 p->shared_network ? "shared network" : "non shared network",
8744 if (p->status == Established && p->rtt)
8745 vty_out (vty, "Estimated round trip time: %d ms%s",
8746 p->rtt, VTY_NEWLINE);
8748 /* Timer information. */
8750 vty_out (vty, "Next start timer due in %ld seconds%s",
8751 thread_timer_remain_second (p->t_start), VTY_NEWLINE);
8753 vty_out (vty, "Next connect timer due in %ld seconds%s",
8754 thread_timer_remain_second (p->t_connect), VTY_NEWLINE);
8756 vty_out (vty, "Read thread: %s Write thread: %s%s",
8757 p->t_read ? "on" : "off",
8758 p->t_write ? "on" : "off",
8761 if (p->notify.code == BGP_NOTIFY_OPEN_ERR
8762 && p->notify.subcode == BGP_NOTIFY_OPEN_UNSUP_CAPBL)
8763 bgp_capability_vty_out (vty, p);
8765 vty_out (vty, "%s", VTY_NEWLINE);
8769 bgp_show_neighbor (struct vty *vty, struct bgp *bgp,
8770 enum show_type type, union sockunion *su)
8772 struct listnode *node, *nnode;
8776 for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
8781 bgp_show_peer (vty, peer);
8784 if (sockunion_same (&peer->su, su))
8787 bgp_show_peer (vty, peer);
8793 if (type == show_peer && ! find)
8794 vty_out (vty, "%% No such neighbor%s", VTY_NEWLINE);
8800 bgp_show_neighbor_vty (struct vty *vty, const char *name,
8801 enum show_type type, const char *ip_str)
8809 ret = str2sockunion (ip_str, &su);
8812 vty_out (vty, "%% Malformed address: %s%s", ip_str, VTY_NEWLINE);
8819 bgp = bgp_lookup_by_name (name);
8823 vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE);
8827 bgp_show_neighbor (vty, bgp, type, &su);
8832 bgp = bgp_get_default ();
8835 bgp_show_neighbor (vty, bgp, type, &su);
8840 /* "show ip bgp neighbors" commands. */DEFUN (show_ip_bgp_neighbors,
8841 show_ip_bgp_neighbors_cmd,
8842 "show ip bgp neighbors",
8846 "Detailed information on TCP and BGP neighbor connections\n")
8848 return bgp_show_neighbor_vty (vty, NULL, show_all, NULL);
8851 ALIAS (show_ip_bgp_neighbors,
8852 show_ip_bgp_ipv4_neighbors_cmd,
8853 "show ip bgp ipv4 (unicast|multicast) neighbors",
8858 "Address Family modifier\n"
8859 "Address Family modifier\n"
8860 "Detailed information on TCP and BGP neighbor connections\n")
8862 ALIAS (show_ip_bgp_neighbors,
8863 show_ip_bgp_vpnv4_all_neighbors_cmd,
8864 "show ip bgp vpnv4 all neighbors",
8868 "Display VPNv4 NLRI specific information\n"
8869 "Display information about all VPNv4 NLRIs\n"
8870 "Detailed information on TCP and BGP neighbor connections\n")
8872 ALIAS (show_ip_bgp_neighbors,
8873 show_ip_bgp_vpnv4_rd_neighbors_cmd,
8874 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
8878 "Display VPNv4 NLRI specific information\n"
8879 "Display information for a route distinguisher\n"
8880 "VPN Route Distinguisher\n"
8881 "Detailed information on TCP and BGP neighbor connections\n")
8883 ALIAS (show_ip_bgp_neighbors,
8884 show_bgp_ipv6_neighbors_cmd,
8885 "show bgp ipv6 neighbors",
8889 "Detailed information on TCP and BGP neighbor connections\n")
8891 DEFUN (show_ip_bgp_neighbors_peer,
8892 show_ip_bgp_neighbors_peer_cmd,
8893 "show ip bgp neighbors (A.B.C.D|X:X::X:X)",
8897 "Detailed information on TCP and BGP neighbor connections\n"
8898 "Neighbor to display information about\n"
8899 "Neighbor to display information about\n")
8901 return bgp_show_neighbor_vty (vty, NULL, show_peer, argv[argc - 1]);
8904 ALIAS (show_ip_bgp_neighbors_peer,
8905 show_ip_bgp_ipv4_neighbors_peer_cmd,
8906 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)",
8911 "Address Family modifier\n"
8912 "Address Family modifier\n"
8913 "Detailed information on TCP and BGP neighbor connections\n"
8914 "Neighbor to display information about\n"
8915 "Neighbor to display information about\n")
8917 ALIAS (show_ip_bgp_neighbors_peer,
8918 show_ip_bgp_vpnv4_all_neighbors_peer_cmd,
8919 "show ip bgp vpnv4 all neighbors A.B.C.D",
8923 "Display VPNv4 NLRI specific information\n"
8924 "Display information about all VPNv4 NLRIs\n"
8925 "Detailed information on TCP and BGP neighbor connections\n"
8926 "Neighbor to display information about\n")
8928 ALIAS (show_ip_bgp_neighbors_peer,
8929 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd,
8930 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
8934 "Display VPNv4 NLRI specific information\n"
8935 "Display information about all VPNv4 NLRIs\n"
8936 "Detailed information on TCP and BGP neighbor connections\n"
8937 "Neighbor to display information about\n")
8939 ALIAS (show_ip_bgp_neighbors_peer,
8940 show_bgp_ipv6_neighbors_peer_cmd,
8941 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)",
8945 "Detailed information on TCP and BGP neighbor connections\n"
8946 "Neighbor to display information about\n"
8947 "Neighbor to display information about\n")
8949 DEFUN (show_ip_bgp_instance_neighbors,
8950 show_ip_bgp_instance_neighbors_cmd,
8951 "show ip bgp view WORD neighbors",
8957 "Detailed information on TCP and BGP neighbor connections\n")
8959 return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL);
8962 ALIAS (show_ip_bgp_instance_neighbors,
8963 show_bgp_instance_ipv6_neighbors_cmd,
8964 "show bgp view WORD ipv6 neighbors",
8970 "Detailed information on TCP and BGP neighbor connections\n")
8972 DEFUN (show_ip_bgp_instance_neighbors_peer,
8973 show_ip_bgp_instance_neighbors_peer_cmd,
8974 "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
8980 "Detailed information on TCP and BGP neighbor connections\n"
8981 "Neighbor to display information about\n"
8982 "Neighbor to display information about\n")
8984 return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]);
8987 /* Show BGP's AS paths internal data. There are both `show ip bgp
8988 paths' and `show ip mbgp paths'. Those functions results are the
8990 DEFUN (show_ip_bgp_paths,
8991 show_ip_bgp_paths_cmd,
8992 "show ip bgp paths",
8996 "Path information\n")
8998 vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE);
8999 aspath_print_all_vty (vty);
9003 DEFUN (show_ip_bgp_ipv4_paths,
9004 show_ip_bgp_ipv4_paths_cmd,
9005 "show ip bgp ipv4 (unicast|multicast) paths",
9010 "Address Family modifier\n"
9011 "Address Family modifier\n"
9012 "Path information\n")
9014 vty_out (vty, "Address Refcnt Path\r\n");
9015 aspath_print_all_vty (vty);
9020 DEFUN (show_bgp_neighbors,
9021 show_bgp_neighbors_cmd,
9022 "show bgp neighbors",
9025 "Detailed information on TCP and BGP neighbor connections\n")
9027 return bgp_show_neighbor_vty (vty, NULL, show_all, NULL);
9030 DEFUN (show_bgp_neighbors_peer,
9031 show_bgp_neighbors_peer_cmd,
9032 "show bgp neighbors (A.B.C.D|X:X::X:X)",
9035 "Detailed information on TCP and BGP neighbor connections\n"
9036 "Neighbor to display information about\n"
9037 "Neighbor to display information about\n")
9039 return bgp_show_neighbor_vty (vty, NULL, show_peer, argv[argc - 1]);
9042 DEFUN (show_bgp_instance_neighbors,
9043 show_bgp_instance_neighbors_cmd,
9044 "show bgp view WORD neighbors",
9049 "Detailed information on TCP and BGP neighbor connections\n")
9051 return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL);
9054 DEFUN (show_bgp_instance_neighbors_peer,
9055 show_bgp_instance_neighbors_peer_cmd,
9056 "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
9061 "Detailed information on TCP and BGP neighbor connections\n"
9062 "Neighbor to display information about\n"
9063 "Neighbor to display information about\n")
9065 return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]);
9068 ALIAS (show_bgp_instance_neighbors_peer,
9069 show_bgp_instance_ipv6_neighbors_peer_cmd,
9070 "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)",
9076 "Detailed information on TCP and BGP neighbor connections\n"
9077 "Neighbor to display information about\n"
9078 "Neighbor to display information about\n")
9080 /* Show BGP's AS paths internal data. There are both `show ip bgp
9081 paths' and `show ip mbgp paths'. Those functions results are the
9083 DEFUN (show_bgp_ipv4_paths,
9084 show_bgp_ipv4_paths_cmd,
9088 "Path information\n")
9090 vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE);
9091 aspath_print_all_vty (vty);
9098 community_show_all_iterator (struct hash_backet *backet, struct vty *vty)
9100 struct community *com;
9102 com = (struct community *) backet->data;
9103 vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, com->refcnt,
9104 community_str (com), VTY_NEWLINE);
9107 /* Show BGP's community internal data. */
9108 DEFUN (show_ip_bgp_community_info,
9109 show_ip_bgp_community_info_cmd,
9110 "show ip bgp community-info",
9114 "List all bgp community information\n")
9116 vty_out (vty, "Address Refcnt Community%s", VTY_NEWLINE);
9118 hash_iterate (community_hash (),
9119 (void (*) (struct hash_backet *, void *))
9120 community_show_all_iterator,
9127 lcommunity_show_all_iterator (struct hash_backet *backet, struct vty *vty)
9129 struct lcommunity *lcom;
9131 lcom = (struct lcommunity *) backet->data;
9132 vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, lcom->refcnt,
9133 lcommunity_str (lcom), VTY_NEWLINE);
9136 /* Show BGP's community internal data. */
9137 DEFUN (show_ip_bgp_lcommunity_info,
9138 show_ip_bgp_lcommunity_info_cmd,
9139 "show ip bgp large-community-info",
9143 "List all bgp large-community information\n")
9145 vty_out (vty, "Address Refcnt Large-community%s", VTY_NEWLINE);
9147 hash_iterate (lcommunity_hash (),
9148 (void (*) (struct hash_backet *, void *))
9149 lcommunity_show_all_iterator,
9155 DEFUN (show_ip_bgp_attr_info,
9156 show_ip_bgp_attr_info_cmd,
9157 "show ip bgp attribute-info",
9161 "List all bgp attribute information\n")
9163 attr_show_all (vty);
9168 bgp_write_rsclient_summary (struct vty *vty, struct peer *rsclient,
9169 afi_t afi, safi_t safi)
9171 char timebuf[BGP_UPTIME_LEN];
9175 struct listnode *node, *nnode;
9179 if (CHECK_FLAG (rsclient->sflags, PEER_STATUS_GROUP))
9181 for (ALL_LIST_ELEMENTS (rsclient->group->peer, node, nnode, peer))
9184 bgp_write_rsclient_summary (vty, peer, afi, safi);
9189 len = vty_out (vty, "%s", rsclient->host);
9193 vty_out (vty, "%s%*s", VTY_NEWLINE, 16, " ");
9195 vty_out (vty, "%*s", len, " ");
9197 vty_out (vty, "4 ");
9199 vty_out (vty, "%10u ", rsclient->as);
9201 rmname = ROUTE_MAP_EXPORT_NAME(&rsclient->filter[afi][safi]);
9202 if ( rmname && strlen (rmname) > 13 )
9204 sprintf (rmbuf, "%13s", "...");
9205 rmname = strncpy (rmbuf, rmname, 10);
9209 vty_out (vty, " %13s ", rmname);
9211 rmname = ROUTE_MAP_IMPORT_NAME(&rsclient->filter[afi][safi]);
9212 if ( rmname && strlen (rmname) > 13 )
9214 sprintf (rmbuf, "%13s", "...");
9215 rmname = strncpy (rmbuf, rmname, 10);
9219 vty_out (vty, " %13s ", rmname);
9221 vty_out (vty, "%8s", peer_uptime (rsclient->uptime, timebuf, BGP_UPTIME_LEN));
9223 if (CHECK_FLAG (rsclient->flags, PEER_FLAG_SHUTDOWN))
9224 vty_out (vty, " Idle (Admin)");
9225 else if (CHECK_FLAG (rsclient->sflags, PEER_STATUS_PREFIX_OVERFLOW))
9226 vty_out (vty, " Idle (PfxCt)");
9228 vty_out (vty, " %-11s", LOOKUP(bgp_status_msg, rsclient->status));
9230 vty_out (vty, "%s", VTY_NEWLINE);
9236 bgp_show_rsclient_summary (struct vty *vty, struct bgp *bgp,
9237 afi_t afi, safi_t safi)
9240 struct listnode *node, *nnode;
9243 /* Header string for each address family. */
9244 static char header[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
9246 for (ALL_LIST_ELEMENTS (bgp->rsclient, node, nnode, peer))
9248 if (peer->afc[afi][safi] &&
9249 CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT))
9254 "Route Server's BGP router identifier %s%s",
9255 inet_ntoa (bgp->router_id), VTY_NEWLINE);
9257 "Route Server's local AS number %u%s", bgp->as,
9260 vty_out (vty, "%s", VTY_NEWLINE);
9261 vty_out (vty, "%s%s", header, VTY_NEWLINE);
9264 count += bgp_write_rsclient_summary (vty, peer, afi, safi);
9269 vty_out (vty, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE,
9270 count, VTY_NEWLINE);
9272 vty_out (vty, "No %s Route Server Client is configured%s",
9273 afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE);
9279 bgp_show_rsclient_summary_vty (struct vty *vty, const char *name,
9280 afi_t afi, safi_t safi)
9286 bgp = bgp_lookup_by_name (name);
9290 vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE);
9294 bgp_show_rsclient_summary (vty, bgp, afi, safi);
9298 bgp = bgp_get_default ();
9301 bgp_show_rsclient_summary (vty, bgp, afi, safi);
9306 /* 'show bgp rsclient' commands. */
9307 DEFUN (show_ip_bgp_rsclient_summary,
9308 show_ip_bgp_rsclient_summary_cmd,
9309 "show ip bgp rsclient summary",
9313 "Information about Route Server Clients\n"
9314 "Summary of all Route Server Clients\n")
9316 return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
9319 DEFUN (show_ip_bgp_instance_rsclient_summary,
9320 show_ip_bgp_instance_rsclient_summary_cmd,
9321 "show ip bgp view WORD rsclient summary",
9327 "Information about Route Server Clients\n"
9328 "Summary of all Route Server Clients\n")
9330 return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
9333 DEFUN (show_ip_bgp_ipv4_rsclient_summary,
9334 show_ip_bgp_ipv4_rsclient_summary_cmd,
9335 "show ip bgp ipv4 (unicast|multicast) rsclient summary",
9340 "Address Family modifier\n"
9341 "Address Family modifier\n"
9342 "Information about Route Server Clients\n"
9343 "Summary of all Route Server Clients\n")
9345 if (strncmp (argv[0], "m", 1) == 0)
9346 return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
9348 return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
9351 DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary,
9352 show_ip_bgp_instance_ipv4_rsclient_summary_cmd,
9353 "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary",
9360 "Address Family modifier\n"
9361 "Address Family modifier\n"
9362 "Information about Route Server Clients\n"
9363 "Summary of all Route Server Clients\n")
9365 if (strncmp (argv[1], "m", 1) == 0)
9366 return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST);
9368 return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
9371 DEFUN (show_bgp_instance_ipv4_safi_rsclient_summary,
9372 show_bgp_instance_ipv4_safi_rsclient_summary_cmd,
9373 "show bgp view WORD ipv4 (unicast|multicast) rsclient summary",
9379 "Address Family modifier\n"
9380 "Address Family modifier\n"
9381 "Information about Route Server Clients\n"
9382 "Summary of all Route Server Clients\n")
9387 safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
9388 return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, safi);
9390 safi = (strncmp (argv[0], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
9391 return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, safi);
9395 ALIAS (show_bgp_instance_ipv4_safi_rsclient_summary,
9396 show_bgp_ipv4_safi_rsclient_summary_cmd,
9397 "show bgp ipv4 (unicast|multicast) rsclient summary",
9401 "Address Family modifier\n"
9402 "Address Family modifier\n"
9403 "Information about Route Server Clients\n"
9404 "Summary of all Route Server Clients\n")
9406 DEFUN (show_bgp_rsclient_summary,
9407 show_bgp_rsclient_summary_cmd,
9408 "show bgp rsclient summary",
9411 "Information about Route Server Clients\n"
9412 "Summary of all Route Server Clients\n")
9414 vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9415 vty_out(vty, "---------------------%s", VTY_NEWLINE);
9416 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
9417 vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9418 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
9419 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
9420 vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9421 vty_out(vty, "-----------------%s", VTY_NEWLINE);
9422 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
9423 vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9424 vty_out(vty, "-------------------%s", VTY_NEWLINE);
9425 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP);
9427 vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9428 vty_out(vty, "---------------------%s", VTY_NEWLINE);
9429 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
9430 vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9431 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
9432 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
9433 vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9434 vty_out(vty, "-----------------%s", VTY_NEWLINE);
9435 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN);
9436 vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9437 vty_out(vty, "-------------------%s", VTY_NEWLINE);
9438 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
9443 DEFUN (show_bgp_instance_rsclient_summary,
9444 show_bgp_instance_rsclient_summary_cmd,
9445 "show bgp view WORD rsclient summary",
9450 "Information about Route Server Clients\n"
9451 "Summary of all Route Server Clients\n")
9453 vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9454 vty_out(vty, "---------------------%s", VTY_NEWLINE);
9455 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
9456 vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9457 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
9458 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST);
9459 vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9460 vty_out(vty, "-----------------%s", VTY_NEWLINE);
9461 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN);
9462 vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9463 vty_out(vty, "-------------------%s", VTY_NEWLINE);
9464 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP);
9466 vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9467 vty_out(vty, "---------------------%s", VTY_NEWLINE);
9468 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
9469 vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9470 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
9471 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST);
9472 vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9473 vty_out(vty, "-----------------%s", VTY_NEWLINE);
9474 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN);
9475 vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9476 vty_out(vty, "-------------------%s", VTY_NEWLINE);
9477 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP);
9482 DEFUN (show_bgp_ipv6_rsclient_summary,
9483 show_bgp_ipv6_rsclient_summary_cmd,
9484 "show bgp ipv6 rsclient summary",
9488 "Information about Route Server Clients\n"
9489 "Summary of all Route Server Clients\n")
9491 vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9492 vty_out(vty, "---------------------%s", VTY_NEWLINE);
9493 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
9494 vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9495 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
9496 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
9497 vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9498 vty_out(vty, "-----------------%s", VTY_NEWLINE);
9499 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN);
9500 vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9501 vty_out(vty, "-------------------%s", VTY_NEWLINE);
9502 bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP);
9507 DEFUN (show_bgp_instance_ipv6_rsclient_summary,
9508 show_bgp_instance_ipv6_rsclient_summary_cmd,
9509 "show bgp view WORD ipv6 rsclient summary",
9515 "Information about Route Server Clients\n"
9516 "Summary of all Route Server Clients\n")
9518 vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9519 vty_out(vty, "---------------------%s", VTY_NEWLINE);
9520 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
9521 vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9522 vty_out(vty, "-----------------------%s", VTY_NEWLINE);
9523 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST);
9524 vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9525 vty_out(vty, "-----------------%s", VTY_NEWLINE);
9526 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN);
9527 vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE);
9528 vty_out(vty, "-------------------%s", VTY_NEWLINE);
9529 bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP);
9534 DEFUN (show_bgp_instance_ipv6_safi_rsclient_summary,
9535 show_bgp_instance_ipv6_safi_rsclient_summary_cmd,
9536 "show bgp view WORD ipv6 (unicast|multicast) rsclient summary",
9542 "Address Family modifier\n"
9543 "Address Family modifier\n"
9544 "Information about Route Server Clients\n"
9545 "Summary of all Route Server Clients\n")
9550 safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
9551 return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, safi);
9553 safi = (strncmp (argv[0], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
9554 return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, safi);
9558 ALIAS (show_bgp_instance_ipv6_safi_rsclient_summary,
9559 show_bgp_ipv6_safi_rsclient_summary_cmd,
9560 "show bgp ipv6 (unicast|multicast) rsclient summary",
9564 "Address Family modifier\n"
9565 "Address Family modifier\n"
9566 "Information about Route Server Clients\n"
9567 "Summary of all Route Server Clients\n")
9569 /* Redistribute VTY commands. */
9571 DEFUN (bgp_redistribute_ipv4,
9572 bgp_redistribute_ipv4_cmd,
9573 "redistribute " QUAGGA_IP_REDIST_STR_BGPD,
9574 "Redistribute information from another routing protocol\n"
9575 QUAGGA_IP_REDIST_HELP_STR_BGPD)
9579 type = proto_redistnum (AFI_IP, argv[0]);
9580 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9582 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9585 return bgp_redistribute_set (vty->index, AFI_IP, type);
9588 DEFUN (bgp_redistribute_ipv4_rmap,
9589 bgp_redistribute_ipv4_rmap_cmd,
9590 "redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD",
9591 "Redistribute information from another routing protocol\n"
9592 QUAGGA_IP_REDIST_HELP_STR_BGPD
9593 "Route map reference\n"
9594 "Pointer to route-map entries\n")
9598 type = proto_redistnum (AFI_IP, argv[0]);
9599 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9601 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9605 bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[1]);
9606 return bgp_redistribute_set (vty->index, AFI_IP, type);
9609 DEFUN (bgp_redistribute_ipv4_metric,
9610 bgp_redistribute_ipv4_metric_cmd,
9611 "redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295>",
9612 "Redistribute information from another routing protocol\n"
9613 QUAGGA_IP_REDIST_HELP_STR_BGPD
9614 "Metric for redistributed routes\n"
9620 type = proto_redistnum (AFI_IP, argv[0]);
9621 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9623 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9626 VTY_GET_INTEGER ("metric", metric, argv[1]);
9628 bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric);
9629 return bgp_redistribute_set (vty->index, AFI_IP, type);
9632 DEFUN (bgp_redistribute_ipv4_rmap_metric,
9633 bgp_redistribute_ipv4_rmap_metric_cmd,
9634 "redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>",
9635 "Redistribute information from another routing protocol\n"
9636 QUAGGA_IP_REDIST_HELP_STR_BGPD
9637 "Route map reference\n"
9638 "Pointer to route-map entries\n"
9639 "Metric for redistributed routes\n"
9645 type = proto_redistnum (AFI_IP, argv[0]);
9646 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9648 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9651 VTY_GET_INTEGER ("metric", metric, argv[2]);
9653 bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[1]);
9654 bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric);
9655 return bgp_redistribute_set (vty->index, AFI_IP, type);
9658 DEFUN (bgp_redistribute_ipv4_metric_rmap,
9659 bgp_redistribute_ipv4_metric_rmap_cmd,
9660 "redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD",
9661 "Redistribute information from another routing protocol\n"
9662 QUAGGA_IP_REDIST_HELP_STR_BGPD
9663 "Metric for redistributed routes\n"
9665 "Route map reference\n"
9666 "Pointer to route-map entries\n")
9671 type = proto_redistnum (AFI_IP, argv[0]);
9672 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9674 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9677 VTY_GET_INTEGER ("metric", metric, argv[1]);
9679 bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric);
9680 bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[2]);
9681 return bgp_redistribute_set (vty->index, AFI_IP, type);
9684 DEFUN (no_bgp_redistribute_ipv4,
9685 no_bgp_redistribute_ipv4_cmd,
9686 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD,
9688 "Redistribute information from another routing protocol\n"
9689 QUAGGA_IP_REDIST_HELP_STR_BGPD)
9693 type = proto_redistnum (AFI_IP, argv[0]);
9694 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9696 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9700 return bgp_redistribute_unset (vty->index, AFI_IP, type);
9703 ALIAS (no_bgp_redistribute_ipv4,
9704 no_bgp_redistribute_ipv4_rmap_cmd,
9705 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD",
9707 "Redistribute information from another routing protocol\n"
9708 QUAGGA_IP_REDIST_HELP_STR_BGPD
9709 "Route map reference\n"
9710 "Pointer to route-map entries\n")
9712 ALIAS (no_bgp_redistribute_ipv4,
9713 no_bgp_redistribute_ipv4_metric_cmd,
9714 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295>",
9716 "Redistribute information from another routing protocol\n"
9717 QUAGGA_IP_REDIST_HELP_STR_BGPD
9718 "Metric for redistributed routes\n"
9721 ALIAS (no_bgp_redistribute_ipv4,
9722 no_bgp_redistribute_ipv4_rmap_metric_cmd,
9723 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>",
9725 "Redistribute information from another routing protocol\n"
9726 QUAGGA_IP_REDIST_HELP_STR_BGPD
9727 "Route map reference\n"
9728 "Pointer to route-map entries\n"
9729 "Metric for redistributed routes\n"
9732 ALIAS (no_bgp_redistribute_ipv4,
9733 no_bgp_redistribute_ipv4_metric_rmap_cmd,
9734 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD",
9736 "Redistribute information from another routing protocol\n"
9737 QUAGGA_IP_REDIST_HELP_STR_BGPD
9738 "Metric for redistributed routes\n"
9740 "Route map reference\n"
9741 "Pointer to route-map entries\n")
9743 DEFUN (bgp_redistribute_ipv6,
9744 bgp_redistribute_ipv6_cmd,
9745 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD,
9746 "Redistribute information from another routing protocol\n"
9747 QUAGGA_IP6_REDIST_HELP_STR_BGPD)
9751 type = proto_redistnum (AFI_IP6, argv[0]);
9752 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9754 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9758 return bgp_redistribute_set (vty->index, AFI_IP6, type);
9761 DEFUN (bgp_redistribute_ipv6_rmap,
9762 bgp_redistribute_ipv6_rmap_cmd,
9763 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD",
9764 "Redistribute information from another routing protocol\n"
9765 QUAGGA_IP6_REDIST_HELP_STR_BGPD
9766 "Route map reference\n"
9767 "Pointer to route-map entries\n")
9771 type = proto_redistnum (AFI_IP6, argv[0]);
9772 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9774 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9778 bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[1]);
9779 return bgp_redistribute_set (vty->index, AFI_IP6, type);
9782 DEFUN (bgp_redistribute_ipv6_metric,
9783 bgp_redistribute_ipv6_metric_cmd,
9784 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295>",
9785 "Redistribute information from another routing protocol\n"
9786 QUAGGA_IP6_REDIST_HELP_STR_BGPD
9787 "Metric for redistributed routes\n"
9793 type = proto_redistnum (AFI_IP6, argv[0]);
9794 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9796 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9799 VTY_GET_INTEGER ("metric", metric, argv[1]);
9801 bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric);
9802 return bgp_redistribute_set (vty->index, AFI_IP6, type);
9805 DEFUN (bgp_redistribute_ipv6_rmap_metric,
9806 bgp_redistribute_ipv6_rmap_metric_cmd,
9807 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>",
9808 "Redistribute information from another routing protocol\n"
9809 QUAGGA_IP6_REDIST_HELP_STR_BGPD
9810 "Route map reference\n"
9811 "Pointer to route-map entries\n"
9812 "Metric for redistributed routes\n"
9818 type = proto_redistnum (AFI_IP6, argv[0]);
9819 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9821 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9824 VTY_GET_INTEGER ("metric", metric, argv[2]);
9826 bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[1]);
9827 bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric);
9828 return bgp_redistribute_set (vty->index, AFI_IP6, type);
9831 DEFUN (bgp_redistribute_ipv6_metric_rmap,
9832 bgp_redistribute_ipv6_metric_rmap_cmd,
9833 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD",
9834 "Redistribute information from another routing protocol\n"
9835 QUAGGA_IP6_REDIST_HELP_STR_BGPD
9836 "Metric for redistributed routes\n"
9838 "Route map reference\n"
9839 "Pointer to route-map entries\n")
9844 type = proto_redistnum (AFI_IP6, argv[0]);
9845 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9847 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9850 VTY_GET_INTEGER ("metric", metric, argv[1]);
9852 bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric);
9853 bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[2]);
9854 return bgp_redistribute_set (vty->index, AFI_IP6, type);
9857 DEFUN (no_bgp_redistribute_ipv6,
9858 no_bgp_redistribute_ipv6_cmd,
9859 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD,
9861 "Redistribute information from another routing protocol\n"
9862 QUAGGA_IP6_REDIST_HELP_STR_BGPD)
9866 type = proto_redistnum (AFI_IP6, argv[0]);
9867 if (type < 0 || type == ZEBRA_ROUTE_BGP)
9869 vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
9873 return bgp_redistribute_unset (vty->index, AFI_IP6, type);
9876 ALIAS (no_bgp_redistribute_ipv6,
9877 no_bgp_redistribute_ipv6_rmap_cmd,
9878 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD",
9880 "Redistribute information from another routing protocol\n"
9881 QUAGGA_IP6_REDIST_HELP_STR_BGPD
9882 "Route map reference\n"
9883 "Pointer to route-map entries\n")
9885 ALIAS (no_bgp_redistribute_ipv6,
9886 no_bgp_redistribute_ipv6_metric_cmd,
9887 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295>",
9889 "Redistribute information from another routing protocol\n"
9890 QUAGGA_IP6_REDIST_HELP_STR_BGPD
9891 "Metric for redistributed routes\n"
9894 ALIAS (no_bgp_redistribute_ipv6,
9895 no_bgp_redistribute_ipv6_rmap_metric_cmd,
9896 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>",
9898 "Redistribute information from another routing protocol\n"
9899 QUAGGA_IP6_REDIST_HELP_STR_BGPD
9900 "Route map reference\n"
9901 "Pointer to route-map entries\n"
9902 "Metric for redistributed routes\n"
9905 ALIAS (no_bgp_redistribute_ipv6,
9906 no_bgp_redistribute_ipv6_metric_rmap_cmd,
9907 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD",
9909 "Redistribute information from another routing protocol\n"
9910 QUAGGA_IP6_REDIST_HELP_STR_BGPD
9911 "Metric for redistributed routes\n"
9913 "Route map reference\n"
9914 "Pointer to route-map entries\n")
9917 bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi,
9918 safi_t safi, int *write)
9922 /* Unicast redistribution only. */
9923 if (safi != SAFI_UNICAST)
9926 for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
9928 /* Redistribute BGP does not make sense. */
9929 if (bgp->redist[afi][i] && i != ZEBRA_ROUTE_BGP)
9931 /* Display "address-family" when it is not yet diplayed. */
9932 bgp_config_write_family_header (vty, afi, safi, write);
9934 /* "redistribute" configuration. */
9935 vty_out (vty, " redistribute %s", zebra_route_string(i));
9937 if (bgp->redist_metric_flag[afi][i])
9938 vty_out (vty, " metric %u", bgp->redist_metric[afi][i]);
9940 if (bgp->rmap[afi][i].name)
9941 vty_out (vty, " route-map %s", bgp->rmap[afi][i].name);
9943 vty_out (vty, "%s", VTY_NEWLINE);
9949 /* BGP node structure. */
9950 static struct cmd_node bgp_node =
9953 "%s(config-router)# ",
9957 static struct cmd_node bgp_ipv4_unicast_node =
9960 "%s(config-router-af)# ",
9964 static struct cmd_node bgp_ipv4_multicast_node =
9967 "%s(config-router-af)# ",
9971 static struct cmd_node bgp_ipv6_unicast_node =
9974 "%s(config-router-af)# ",
9978 static struct cmd_node bgp_ipv6_multicast_node =
9981 "%s(config-router-af)# ",
9985 static struct cmd_node bgp_vpnv4_node =
9988 "%s(config-router-af)# ",
9992 static struct cmd_node bgp_vpnv6_node =
9995 "%s(config-router-af-vpnv6)# ",
9999 static struct cmd_node bgp_encap_node =
10002 "%s(config-router-af-encap)# ",
10006 static struct cmd_node bgp_encapv6_node =
10009 "%s(config-router-af-encapv6)# ",
10013 static void community_list_vty (void);
10016 bgp_vty_init (void)
10018 /* Install bgp top node. */
10019 install_node (&bgp_node, bgp_config_write);
10020 install_node (&bgp_ipv4_unicast_node, NULL);
10021 install_node (&bgp_ipv4_multicast_node, NULL);
10022 install_node (&bgp_ipv6_unicast_node, NULL);
10023 install_node (&bgp_ipv6_multicast_node, NULL);
10024 install_node (&bgp_vpnv4_node, NULL);
10025 install_node (&bgp_vpnv6_node, NULL);
10026 install_node (&bgp_encap_node, NULL);
10027 install_node (&bgp_encapv6_node, NULL);
10029 /* Install default VTY commands to new nodes. */
10030 install_default (BGP_NODE);
10031 install_default (BGP_IPV4_NODE);
10032 install_default (BGP_IPV4M_NODE);
10033 install_default (BGP_IPV6_NODE);
10034 install_default (BGP_IPV6M_NODE);
10035 install_default (BGP_VPNV4_NODE);
10036 install_default (BGP_VPNV6_NODE);
10037 install_default (BGP_ENCAP_NODE);
10038 install_default (BGP_ENCAPV6_NODE);
10040 /* "bgp multiple-instance" commands. */
10041 install_element (CONFIG_NODE, &bgp_multiple_instance_cmd);
10042 install_element (CONFIG_NODE, &no_bgp_multiple_instance_cmd);
10044 /* "bgp config-type" commands. */
10045 install_element (CONFIG_NODE, &bgp_config_type_cmd);
10046 install_element (CONFIG_NODE, &no_bgp_config_type_cmd);
10048 /* Dummy commands (Currently not supported) */
10049 install_element (BGP_NODE, &no_synchronization_cmd);
10050 install_element (BGP_NODE, &no_auto_summary_cmd);
10052 /* "router bgp" commands. */
10053 install_element (CONFIG_NODE, &router_bgp_cmd);
10054 install_element (CONFIG_NODE, &router_bgp_view_cmd);
10056 /* "no router bgp" commands. */
10057 install_element (CONFIG_NODE, &no_router_bgp_cmd);
10058 install_element (CONFIG_NODE, &no_router_bgp_view_cmd);
10060 /* "bgp router-id" commands. */
10061 install_element (BGP_NODE, &bgp_router_id_cmd);
10062 install_element (BGP_NODE, &no_bgp_router_id_cmd);
10063 install_element (BGP_NODE, &no_bgp_router_id_val_cmd);
10065 /* "bgp cluster-id" commands. */
10066 install_element (BGP_NODE, &bgp_cluster_id_cmd);
10067 install_element (BGP_NODE, &bgp_cluster_id32_cmd);
10068 install_element (BGP_NODE, &no_bgp_cluster_id_cmd);
10069 install_element (BGP_NODE, &no_bgp_cluster_id_arg_cmd);
10071 /* "bgp confederation" commands. */
10072 install_element (BGP_NODE, &bgp_confederation_identifier_cmd);
10073 install_element (BGP_NODE, &no_bgp_confederation_identifier_cmd);
10074 install_element (BGP_NODE, &no_bgp_confederation_identifier_arg_cmd);
10076 /* "bgp confederation peers" commands. */
10077 install_element (BGP_NODE, &bgp_confederation_peers_cmd);
10078 install_element (BGP_NODE, &no_bgp_confederation_peers_cmd);
10080 /* "maximum-paths" commands. */
10081 install_element (BGP_NODE, &bgp_maxpaths_cmd);
10082 install_element (BGP_NODE, &no_bgp_maxpaths_cmd);
10083 install_element (BGP_NODE, &no_bgp_maxpaths_arg_cmd);
10084 install_element (BGP_IPV4_NODE, &bgp_maxpaths_cmd);
10085 install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_cmd);
10086 install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_arg_cmd);
10087 install_element (BGP_IPV6_NODE, &bgp_maxpaths_cmd);
10088 install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_cmd);
10089 install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_arg_cmd);
10090 install_element (BGP_NODE, &bgp_maxpaths_ibgp_cmd);
10091 install_element (BGP_NODE, &no_bgp_maxpaths_ibgp_cmd);
10092 install_element (BGP_NODE, &no_bgp_maxpaths_ibgp_arg_cmd);
10093 install_element (BGP_IPV4_NODE, &bgp_maxpaths_ibgp_cmd);
10094 install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_ibgp_cmd);
10095 install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_ibgp_arg_cmd);
10096 install_element (BGP_IPV6_NODE, &bgp_maxpaths_ibgp_cmd);
10097 install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_ibgp_cmd);
10098 install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_ibgp_arg_cmd);
10100 /* "timers bgp" commands. */
10101 install_element (BGP_NODE, &bgp_timers_cmd);
10102 install_element (BGP_NODE, &no_bgp_timers_cmd);
10103 install_element (BGP_NODE, &no_bgp_timers_arg_cmd);
10105 /* "bgp client-to-client reflection" commands */
10106 install_element (BGP_NODE, &no_bgp_client_to_client_reflection_cmd);
10107 install_element (BGP_NODE, &bgp_client_to_client_reflection_cmd);
10109 /* "bgp always-compare-med" commands */
10110 install_element (BGP_NODE, &bgp_always_compare_med_cmd);
10111 install_element (BGP_NODE, &no_bgp_always_compare_med_cmd);
10113 /* "bgp deterministic-med" commands */
10114 install_element (BGP_NODE, &bgp_deterministic_med_cmd);
10115 install_element (BGP_NODE, &no_bgp_deterministic_med_cmd);
10117 /* "bgp graceful-restart" commands */
10118 install_element (BGP_NODE, &bgp_graceful_restart_cmd);
10119 install_element (BGP_NODE, &no_bgp_graceful_restart_cmd);
10120 install_element (BGP_NODE, &bgp_graceful_restart_stalepath_time_cmd);
10121 install_element (BGP_NODE, &no_bgp_graceful_restart_stalepath_time_cmd);
10122 install_element (BGP_NODE, &no_bgp_graceful_restart_stalepath_time_val_cmd);
10123 install_element (BGP_NODE, &bgp_graceful_restart_restart_time_cmd);
10124 install_element (BGP_NODE, &no_bgp_graceful_restart_restart_time_cmd);
10125 install_element (BGP_NODE, &no_bgp_graceful_restart_restart_time_val_cmd);
10127 /* "bgp fast-external-failover" commands */
10128 install_element (BGP_NODE, &bgp_fast_external_failover_cmd);
10129 install_element (BGP_NODE, &no_bgp_fast_external_failover_cmd);
10131 /* "bgp enforce-first-as" commands */
10132 install_element (BGP_NODE, &bgp_enforce_first_as_cmd);
10133 install_element (BGP_NODE, &no_bgp_enforce_first_as_cmd);
10135 /* "bgp bestpath compare-routerid" commands */
10136 install_element (BGP_NODE, &bgp_bestpath_compare_router_id_cmd);
10137 install_element (BGP_NODE, &no_bgp_bestpath_compare_router_id_cmd);
10139 /* "bgp bestpath as-path ignore" commands */
10140 install_element (BGP_NODE, &bgp_bestpath_aspath_ignore_cmd);
10141 install_element (BGP_NODE, &no_bgp_bestpath_aspath_ignore_cmd);
10143 /* "bgp bestpath as-path confed" commands */
10144 install_element (BGP_NODE, &bgp_bestpath_aspath_confed_cmd);
10145 install_element (BGP_NODE, &no_bgp_bestpath_aspath_confed_cmd);
10147 /* "bgp bestpath as-path multipath-relax" commands */
10148 install_element (BGP_NODE, &bgp_bestpath_aspath_multipath_relax_cmd);
10149 install_element (BGP_NODE, &no_bgp_bestpath_aspath_multipath_relax_cmd);
10151 /* "bgp log-neighbor-changes" commands */
10152 install_element (BGP_NODE, &bgp_log_neighbor_changes_cmd);
10153 install_element (BGP_NODE, &no_bgp_log_neighbor_changes_cmd);
10155 /* "bgp bestpath med" commands */
10156 install_element (BGP_NODE, &bgp_bestpath_med_cmd);
10157 install_element (BGP_NODE, &bgp_bestpath_med2_cmd);
10158 install_element (BGP_NODE, &bgp_bestpath_med3_cmd);
10159 install_element (BGP_NODE, &no_bgp_bestpath_med_cmd);
10160 install_element (BGP_NODE, &no_bgp_bestpath_med2_cmd);
10161 install_element (BGP_NODE, &no_bgp_bestpath_med3_cmd);
10163 /* "no bgp default ipv4-unicast" commands. */
10164 install_element (BGP_NODE, &no_bgp_default_ipv4_unicast_cmd);
10165 install_element (BGP_NODE, &bgp_default_ipv4_unicast_cmd);
10167 /* "bgp network import-check" commands. */
10168 install_element (BGP_NODE, &bgp_network_import_check_cmd);
10169 install_element (BGP_NODE, &no_bgp_network_import_check_cmd);
10171 /* "bgp default local-preference" commands. */
10172 install_element (BGP_NODE, &bgp_default_local_preference_cmd);
10173 install_element (BGP_NODE, &no_bgp_default_local_preference_cmd);
10174 install_element (BGP_NODE, &no_bgp_default_local_preference_val_cmd);
10176 /* bgp ibgp-allow-policy-mods command */
10177 install_element (BGP_NODE, &bgp_rr_allow_outbound_policy_cmd);
10178 install_element (BGP_NODE, &no_bgp_rr_allow_outbound_policy_cmd);
10180 /* "neighbor remote-as" commands. */
10181 install_element (BGP_NODE, &neighbor_remote_as_cmd);
10182 install_element (BGP_NODE, &no_neighbor_cmd);
10183 install_element (BGP_NODE, &no_neighbor_remote_as_cmd);
10185 /* "neighbor peer-group" commands. */
10186 install_element (BGP_NODE, &neighbor_peer_group_cmd);
10187 install_element (BGP_NODE, &no_neighbor_peer_group_cmd);
10188 install_element (BGP_NODE, &no_neighbor_peer_group_remote_as_cmd);
10190 /* "neighbor local-as" commands. */
10191 install_element (BGP_NODE, &neighbor_local_as_cmd);
10192 install_element (BGP_NODE, &neighbor_local_as_no_prepend_cmd);
10193 install_element (BGP_NODE, &neighbor_local_as_no_prepend_replace_as_cmd);
10194 install_element (BGP_NODE, &no_neighbor_local_as_cmd);
10195 install_element (BGP_NODE, &no_neighbor_local_as_val_cmd);
10196 install_element (BGP_NODE, &no_neighbor_local_as_val2_cmd);
10197 install_element (BGP_NODE, &no_neighbor_local_as_val3_cmd);
10199 /* "neighbor password" commands. */
10200 install_element (BGP_NODE, &neighbor_password_cmd);
10201 install_element (BGP_NODE, &no_neighbor_password_cmd);
10203 /* "neighbor activate" commands. */
10204 install_element (BGP_NODE, &neighbor_activate_cmd);
10205 install_element (BGP_IPV4_NODE, &neighbor_activate_cmd);
10206 install_element (BGP_IPV4M_NODE, &neighbor_activate_cmd);
10207 install_element (BGP_IPV6_NODE, &neighbor_activate_cmd);
10208 install_element (BGP_IPV6M_NODE, &neighbor_activate_cmd);
10209 install_element (BGP_VPNV4_NODE, &neighbor_activate_cmd);
10210 install_element (BGP_VPNV6_NODE, &neighbor_activate_cmd);
10211 install_element (BGP_ENCAP_NODE, &neighbor_activate_cmd);
10212 install_element (BGP_ENCAPV6_NODE, &neighbor_activate_cmd);
10214 /* "no neighbor activate" commands. */
10215 install_element (BGP_NODE, &no_neighbor_activate_cmd);
10216 install_element (BGP_IPV4_NODE, &no_neighbor_activate_cmd);
10217 install_element (BGP_IPV4M_NODE, &no_neighbor_activate_cmd);
10218 install_element (BGP_IPV6_NODE, &no_neighbor_activate_cmd);
10219 install_element (BGP_IPV6M_NODE, &no_neighbor_activate_cmd);
10220 install_element (BGP_VPNV4_NODE, &no_neighbor_activate_cmd);
10221 install_element (BGP_VPNV6_NODE, &no_neighbor_activate_cmd);
10222 install_element (BGP_ENCAP_NODE, &no_neighbor_activate_cmd);
10223 install_element (BGP_ENCAPV6_NODE, &no_neighbor_activate_cmd);
10225 /* "neighbor peer-group set" commands. */
10226 install_element (BGP_NODE, &neighbor_set_peer_group_cmd);
10227 install_element (BGP_IPV4_NODE, &neighbor_set_peer_group_cmd);
10228 install_element (BGP_IPV4M_NODE, &neighbor_set_peer_group_cmd);
10229 install_element (BGP_IPV6_NODE, &neighbor_set_peer_group_cmd);
10230 install_element (BGP_IPV6M_NODE, &neighbor_set_peer_group_cmd);
10231 install_element (BGP_VPNV4_NODE, &neighbor_set_peer_group_cmd);
10232 install_element (BGP_VPNV6_NODE, &neighbor_set_peer_group_cmd);
10233 install_element (BGP_ENCAP_NODE, &neighbor_set_peer_group_cmd);
10234 install_element (BGP_ENCAPV6_NODE, &neighbor_set_peer_group_cmd);
10236 /* "no neighbor peer-group unset" commands. */
10237 install_element (BGP_NODE, &no_neighbor_set_peer_group_cmd);
10238 install_element (BGP_IPV4_NODE, &no_neighbor_set_peer_group_cmd);
10239 install_element (BGP_IPV4M_NODE, &no_neighbor_set_peer_group_cmd);
10240 install_element (BGP_IPV6_NODE, &no_neighbor_set_peer_group_cmd);
10241 install_element (BGP_IPV6M_NODE, &no_neighbor_set_peer_group_cmd);
10242 install_element (BGP_VPNV4_NODE, &no_neighbor_set_peer_group_cmd);
10243 install_element (BGP_VPNV6_NODE, &no_neighbor_set_peer_group_cmd);
10244 install_element (BGP_ENCAP_NODE, &no_neighbor_set_peer_group_cmd);
10245 install_element (BGP_ENCAPV6_NODE, &no_neighbor_set_peer_group_cmd);
10247 /* "neighbor softreconfiguration inbound" commands.*/
10248 install_element (BGP_NODE, &neighbor_soft_reconfiguration_cmd);
10249 install_element (BGP_NODE, &no_neighbor_soft_reconfiguration_cmd);
10250 install_element (BGP_IPV4_NODE, &neighbor_soft_reconfiguration_cmd);
10251 install_element (BGP_IPV4_NODE, &no_neighbor_soft_reconfiguration_cmd);
10252 install_element (BGP_IPV4M_NODE, &neighbor_soft_reconfiguration_cmd);
10253 install_element (BGP_IPV4M_NODE, &no_neighbor_soft_reconfiguration_cmd);
10254 install_element (BGP_IPV6_NODE, &neighbor_soft_reconfiguration_cmd);
10255 install_element (BGP_IPV6_NODE, &no_neighbor_soft_reconfiguration_cmd);
10256 install_element (BGP_IPV6M_NODE, &neighbor_soft_reconfiguration_cmd);
10257 install_element (BGP_IPV6M_NODE, &no_neighbor_soft_reconfiguration_cmd);
10258 install_element (BGP_VPNV4_NODE, &neighbor_soft_reconfiguration_cmd);
10259 install_element (BGP_VPNV4_NODE, &no_neighbor_soft_reconfiguration_cmd);
10260 install_element (BGP_VPNV6_NODE, &neighbor_soft_reconfiguration_cmd);
10261 install_element (BGP_VPNV6_NODE, &no_neighbor_soft_reconfiguration_cmd);
10262 install_element (BGP_ENCAP_NODE, &neighbor_soft_reconfiguration_cmd);
10263 install_element (BGP_ENCAP_NODE, &no_neighbor_soft_reconfiguration_cmd);
10264 install_element (BGP_ENCAPV6_NODE, &neighbor_soft_reconfiguration_cmd);
10265 install_element (BGP_ENCAPV6_NODE, &no_neighbor_soft_reconfiguration_cmd);
10267 /* "neighbor attribute-unchanged" commands. */
10268 install_element (BGP_NODE, &neighbor_attr_unchanged_cmd);
10269 install_element (BGP_NODE, &neighbor_attr_unchanged1_cmd);
10270 install_element (BGP_NODE, &neighbor_attr_unchanged2_cmd);
10271 install_element (BGP_NODE, &neighbor_attr_unchanged3_cmd);
10272 install_element (BGP_NODE, &neighbor_attr_unchanged4_cmd);
10273 install_element (BGP_NODE, &neighbor_attr_unchanged5_cmd);
10274 install_element (BGP_NODE, &neighbor_attr_unchanged6_cmd);
10275 install_element (BGP_NODE, &neighbor_attr_unchanged7_cmd);
10276 install_element (BGP_NODE, &neighbor_attr_unchanged8_cmd);
10277 install_element (BGP_NODE, &neighbor_attr_unchanged9_cmd);
10278 install_element (BGP_NODE, &neighbor_attr_unchanged10_cmd);
10279 install_element (BGP_NODE, &no_neighbor_attr_unchanged_cmd);
10280 install_element (BGP_NODE, &no_neighbor_attr_unchanged1_cmd);
10281 install_element (BGP_NODE, &no_neighbor_attr_unchanged2_cmd);
10282 install_element (BGP_NODE, &no_neighbor_attr_unchanged3_cmd);
10283 install_element (BGP_NODE, &no_neighbor_attr_unchanged4_cmd);
10284 install_element (BGP_NODE, &no_neighbor_attr_unchanged5_cmd);
10285 install_element (BGP_NODE, &no_neighbor_attr_unchanged6_cmd);
10286 install_element (BGP_NODE, &no_neighbor_attr_unchanged7_cmd);
10287 install_element (BGP_NODE, &no_neighbor_attr_unchanged8_cmd);
10288 install_element (BGP_NODE, &no_neighbor_attr_unchanged9_cmd);
10289 install_element (BGP_NODE, &no_neighbor_attr_unchanged10_cmd);
10290 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged_cmd);
10291 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged1_cmd);
10292 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged2_cmd);
10293 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged3_cmd);
10294 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged4_cmd);
10295 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged5_cmd);
10296 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged6_cmd);
10297 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged7_cmd);
10298 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged8_cmd);
10299 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged9_cmd);
10300 install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged10_cmd);
10301 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged_cmd);
10302 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged1_cmd);
10303 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged2_cmd);
10304 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged3_cmd);
10305 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged4_cmd);
10306 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged5_cmd);
10307 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged6_cmd);
10308 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged7_cmd);
10309 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged8_cmd);
10310 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged9_cmd);
10311 install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged10_cmd);
10312 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged_cmd);
10313 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged1_cmd);
10314 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged2_cmd);
10315 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged3_cmd);
10316 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged4_cmd);
10317 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged5_cmd);
10318 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged6_cmd);
10319 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged7_cmd);
10320 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged8_cmd);
10321 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged9_cmd);
10322 install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged10_cmd);
10323 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged_cmd);
10324 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged1_cmd);
10325 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged2_cmd);
10326 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged3_cmd);
10327 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged4_cmd);
10328 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged5_cmd);
10329 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged6_cmd);
10330 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged7_cmd);
10331 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged8_cmd);
10332 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged9_cmd);
10333 install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged10_cmd);
10334 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged_cmd);
10335 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged1_cmd);
10336 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged2_cmd);
10337 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged3_cmd);
10338 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged4_cmd);
10339 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged5_cmd);
10340 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged6_cmd);
10341 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged7_cmd);
10342 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged8_cmd);
10343 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged9_cmd);
10344 install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged10_cmd);
10345 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged_cmd);
10346 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged1_cmd);
10347 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged2_cmd);
10348 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged3_cmd);
10349 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged4_cmd);
10350 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged5_cmd);
10351 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged6_cmd);
10352 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged7_cmd);
10353 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged8_cmd);
10354 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged9_cmd);
10355 install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged10_cmd);
10356 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged_cmd);
10357 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged1_cmd);
10358 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged2_cmd);
10359 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged3_cmd);
10360 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged4_cmd);
10361 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged5_cmd);
10362 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged6_cmd);
10363 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged7_cmd);
10364 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged8_cmd);
10365 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged9_cmd);
10366 install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged10_cmd);
10367 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged_cmd);
10368 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged1_cmd);
10369 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged2_cmd);
10370 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged3_cmd);
10371 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged4_cmd);
10372 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged5_cmd);
10373 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged6_cmd);
10374 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged7_cmd);
10375 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged8_cmd);
10376 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged9_cmd);
10377 install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged10_cmd);
10378 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged_cmd);
10379 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged1_cmd);
10380 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged2_cmd);
10381 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged3_cmd);
10382 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged4_cmd);
10383 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged5_cmd);
10384 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged6_cmd);
10385 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged7_cmd);
10386 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged8_cmd);
10387 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged9_cmd);
10388 install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged10_cmd);
10389 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged_cmd);
10390 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged1_cmd);
10391 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged2_cmd);
10392 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged3_cmd);
10393 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged4_cmd);
10394 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged5_cmd);
10395 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged6_cmd);
10396 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged7_cmd);
10397 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged8_cmd);
10398 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged9_cmd);
10399 install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged10_cmd);
10401 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged_cmd);
10402 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged1_cmd);
10403 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged2_cmd);
10404 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged3_cmd);
10405 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged4_cmd);
10406 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged5_cmd);
10407 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged6_cmd);
10408 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged7_cmd);
10409 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged8_cmd);
10410 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged9_cmd);
10411 install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged10_cmd);
10412 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged_cmd);
10413 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged1_cmd);
10414 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged2_cmd);
10415 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged3_cmd);
10416 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged4_cmd);
10417 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged5_cmd);
10418 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged6_cmd);
10419 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged7_cmd);
10420 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged8_cmd);
10421 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged9_cmd);
10422 install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged10_cmd);
10424 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged_cmd);
10425 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged1_cmd);
10426 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged2_cmd);
10427 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged3_cmd);
10428 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged4_cmd);
10429 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged5_cmd);
10430 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged6_cmd);
10431 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged7_cmd);
10432 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged8_cmd);
10433 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged9_cmd);
10434 install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged10_cmd);
10435 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged_cmd);
10436 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged1_cmd);
10437 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged2_cmd);
10438 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged3_cmd);
10439 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged4_cmd);
10440 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged5_cmd);
10441 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged6_cmd);
10442 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged7_cmd);
10443 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged8_cmd);
10444 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged9_cmd);
10445 install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged10_cmd);
10447 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged_cmd);
10448 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged1_cmd);
10449 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged2_cmd);
10450 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged3_cmd);
10451 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged4_cmd);
10452 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged5_cmd);
10453 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged6_cmd);
10454 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged7_cmd);
10455 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged8_cmd);
10456 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged9_cmd);
10457 install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged10_cmd);
10458 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged_cmd);
10459 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged1_cmd);
10460 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged2_cmd);
10461 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged3_cmd);
10462 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged4_cmd);
10463 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged5_cmd);
10464 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged6_cmd);
10465 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged7_cmd);
10466 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged8_cmd);
10467 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged9_cmd);
10468 install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged10_cmd);
10470 /* "nexthop-local unchanged" commands */
10471 install_element (BGP_IPV6_NODE, &neighbor_nexthop_local_unchanged_cmd);
10472 install_element (BGP_IPV6_NODE, &no_neighbor_nexthop_local_unchanged_cmd);
10474 /* "transparent-as" and "transparent-nexthop" for old version
10476 install_element (BGP_NODE, &neighbor_transparent_as_cmd);
10477 install_element (BGP_NODE, &neighbor_transparent_nexthop_cmd);
10479 /* "neighbor next-hop-self" commands. */
10480 install_element (BGP_NODE, &neighbor_nexthop_self_cmd);
10481 install_element (BGP_NODE, &no_neighbor_nexthop_self_cmd);
10482 install_element (BGP_IPV4_NODE, &neighbor_nexthop_self_cmd);
10483 install_element (BGP_IPV4_NODE, &no_neighbor_nexthop_self_cmd);
10484 install_element (BGP_IPV4M_NODE, &neighbor_nexthop_self_cmd);
10485 install_element (BGP_IPV4M_NODE, &no_neighbor_nexthop_self_cmd);
10486 install_element (BGP_IPV6_NODE, &neighbor_nexthop_self_cmd);
10487 install_element (BGP_IPV6_NODE, &no_neighbor_nexthop_self_cmd);
10488 install_element (BGP_IPV6M_NODE, &neighbor_nexthop_self_cmd);
10489 install_element (BGP_IPV6M_NODE, &no_neighbor_nexthop_self_cmd);
10490 install_element (BGP_VPNV4_NODE, &neighbor_nexthop_self_cmd);
10491 install_element (BGP_VPNV4_NODE, &no_neighbor_nexthop_self_cmd);
10492 install_element (BGP_VPNV6_NODE, &neighbor_nexthop_self_cmd);
10493 install_element (BGP_VPNV6_NODE, &no_neighbor_nexthop_self_cmd);
10494 install_element (BGP_ENCAP_NODE, &neighbor_nexthop_self_cmd);
10495 install_element (BGP_ENCAP_NODE, &no_neighbor_nexthop_self_cmd);
10496 install_element (BGP_ENCAPV6_NODE, &neighbor_nexthop_self_cmd);
10497 install_element (BGP_ENCAPV6_NODE, &no_neighbor_nexthop_self_cmd);
10499 /* "neighbor remove-private-AS" commands. */
10500 install_element (BGP_NODE, &neighbor_remove_private_as_cmd);
10501 install_element (BGP_NODE, &no_neighbor_remove_private_as_cmd);
10502 install_element (BGP_IPV4_NODE, &neighbor_remove_private_as_cmd);
10503 install_element (BGP_IPV4_NODE, &no_neighbor_remove_private_as_cmd);
10504 install_element (BGP_IPV4M_NODE, &neighbor_remove_private_as_cmd);
10505 install_element (BGP_IPV4M_NODE, &no_neighbor_remove_private_as_cmd);
10506 install_element (BGP_IPV6_NODE, &neighbor_remove_private_as_cmd);
10507 install_element (BGP_IPV6_NODE, &no_neighbor_remove_private_as_cmd);
10508 install_element (BGP_IPV6M_NODE, &neighbor_remove_private_as_cmd);
10509 install_element (BGP_IPV6M_NODE, &no_neighbor_remove_private_as_cmd);
10510 install_element (BGP_VPNV4_NODE, &neighbor_remove_private_as_cmd);
10511 install_element (BGP_VPNV4_NODE, &no_neighbor_remove_private_as_cmd);
10512 install_element (BGP_VPNV6_NODE, &neighbor_remove_private_as_cmd);
10513 install_element (BGP_VPNV6_NODE, &no_neighbor_remove_private_as_cmd);
10514 install_element (BGP_ENCAP_NODE, &neighbor_remove_private_as_cmd);
10515 install_element (BGP_ENCAP_NODE, &no_neighbor_remove_private_as_cmd);
10516 install_element (BGP_ENCAPV6_NODE, &neighbor_remove_private_as_cmd);
10517 install_element (BGP_ENCAPV6_NODE, &no_neighbor_remove_private_as_cmd);
10519 /* "neighbor send-community" commands.*/
10520 install_element (BGP_NODE, &neighbor_send_community_cmd);
10521 install_element (BGP_NODE, &neighbor_send_community_type_cmd);
10522 install_element (BGP_NODE, &no_neighbor_send_community_cmd);
10523 install_element (BGP_NODE, &no_neighbor_send_community_type_cmd);
10524 install_element (BGP_IPV4_NODE, &neighbor_send_community_cmd);
10525 install_element (BGP_IPV4_NODE, &neighbor_send_community_type_cmd);
10526 install_element (BGP_IPV4_NODE, &no_neighbor_send_community_cmd);
10527 install_element (BGP_IPV4_NODE, &no_neighbor_send_community_type_cmd);
10528 install_element (BGP_IPV4M_NODE, &neighbor_send_community_cmd);
10529 install_element (BGP_IPV4M_NODE, &neighbor_send_community_type_cmd);
10530 install_element (BGP_IPV4M_NODE, &no_neighbor_send_community_cmd);
10531 install_element (BGP_IPV4M_NODE, &no_neighbor_send_community_type_cmd);
10532 install_element (BGP_IPV6_NODE, &neighbor_send_community_cmd);
10533 install_element (BGP_IPV6_NODE, &neighbor_send_community_type_cmd);
10534 install_element (BGP_IPV6_NODE, &no_neighbor_send_community_cmd);
10535 install_element (BGP_IPV6_NODE, &no_neighbor_send_community_type_cmd);
10536 install_element (BGP_IPV6M_NODE, &neighbor_send_community_cmd);
10537 install_element (BGP_IPV6M_NODE, &neighbor_send_community_type_cmd);
10538 install_element (BGP_IPV6M_NODE, &no_neighbor_send_community_cmd);
10539 install_element (BGP_IPV6M_NODE, &no_neighbor_send_community_type_cmd);
10540 install_element (BGP_VPNV4_NODE, &neighbor_send_community_cmd);
10541 install_element (BGP_VPNV4_NODE, &neighbor_send_community_type_cmd);
10542 install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_cmd);
10543 install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_type_cmd);
10544 install_element (BGP_VPNV6_NODE, &neighbor_send_community_cmd);
10545 install_element (BGP_VPNV6_NODE, &neighbor_send_community_type_cmd);
10546 install_element (BGP_VPNV6_NODE, &no_neighbor_send_community_cmd);
10547 install_element (BGP_VPNV6_NODE, &no_neighbor_send_community_type_cmd);
10548 install_element (BGP_ENCAP_NODE, &neighbor_send_community_cmd);
10549 install_element (BGP_ENCAP_NODE, &neighbor_send_community_type_cmd);
10550 install_element (BGP_ENCAP_NODE, &no_neighbor_send_community_cmd);
10551 install_element (BGP_ENCAP_NODE, &no_neighbor_send_community_type_cmd);
10552 install_element (BGP_ENCAPV6_NODE, &neighbor_send_community_cmd);
10553 install_element (BGP_ENCAPV6_NODE, &neighbor_send_community_type_cmd);
10554 install_element (BGP_ENCAPV6_NODE, &no_neighbor_send_community_cmd);
10555 install_element (BGP_ENCAPV6_NODE, &no_neighbor_send_community_type_cmd);
10557 /* "neighbor route-reflector" commands.*/
10558 install_element (BGP_NODE, &neighbor_route_reflector_client_cmd);
10559 install_element (BGP_NODE, &no_neighbor_route_reflector_client_cmd);
10560 install_element (BGP_IPV4_NODE, &neighbor_route_reflector_client_cmd);
10561 install_element (BGP_IPV4_NODE, &no_neighbor_route_reflector_client_cmd);
10562 install_element (BGP_IPV4M_NODE, &neighbor_route_reflector_client_cmd);
10563 install_element (BGP_IPV4M_NODE, &no_neighbor_route_reflector_client_cmd);
10564 install_element (BGP_IPV6_NODE, &neighbor_route_reflector_client_cmd);
10565 install_element (BGP_IPV6_NODE, &no_neighbor_route_reflector_client_cmd);
10566 install_element (BGP_IPV6M_NODE, &neighbor_route_reflector_client_cmd);
10567 install_element (BGP_IPV6M_NODE, &no_neighbor_route_reflector_client_cmd);
10568 install_element (BGP_VPNV4_NODE, &neighbor_route_reflector_client_cmd);
10569 install_element (BGP_VPNV4_NODE, &no_neighbor_route_reflector_client_cmd);
10570 install_element (BGP_VPNV6_NODE, &neighbor_route_reflector_client_cmd);
10571 install_element (BGP_VPNV6_NODE, &no_neighbor_route_reflector_client_cmd);
10572 install_element (BGP_ENCAP_NODE, &neighbor_route_reflector_client_cmd);
10573 install_element (BGP_ENCAP_NODE, &no_neighbor_route_reflector_client_cmd);
10574 install_element (BGP_ENCAPV6_NODE, &neighbor_route_reflector_client_cmd);
10575 install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_reflector_client_cmd);
10577 /* "neighbor route-server" commands.*/
10578 install_element (BGP_NODE, &neighbor_route_server_client_cmd);
10579 install_element (BGP_NODE, &no_neighbor_route_server_client_cmd);
10580 install_element (BGP_IPV4_NODE, &neighbor_route_server_client_cmd);
10581 install_element (BGP_IPV4_NODE, &no_neighbor_route_server_client_cmd);
10582 install_element (BGP_IPV4M_NODE, &neighbor_route_server_client_cmd);
10583 install_element (BGP_IPV4M_NODE, &no_neighbor_route_server_client_cmd);
10584 install_element (BGP_IPV6_NODE, &neighbor_route_server_client_cmd);
10585 install_element (BGP_IPV6_NODE, &no_neighbor_route_server_client_cmd);
10586 install_element (BGP_IPV6M_NODE, &neighbor_route_server_client_cmd);
10587 install_element (BGP_IPV6M_NODE, &no_neighbor_route_server_client_cmd);
10588 install_element (BGP_VPNV4_NODE, &neighbor_route_server_client_cmd);
10589 install_element (BGP_VPNV4_NODE, &no_neighbor_route_server_client_cmd);
10590 install_element (BGP_VPNV6_NODE, &neighbor_route_server_client_cmd);
10591 install_element (BGP_VPNV6_NODE, &no_neighbor_route_server_client_cmd);
10592 install_element (BGP_ENCAP_NODE, &neighbor_route_server_client_cmd);
10593 install_element (BGP_ENCAP_NODE, &no_neighbor_route_server_client_cmd);
10594 install_element (BGP_ENCAPV6_NODE, &neighbor_route_server_client_cmd);
10595 install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_server_client_cmd);
10597 /* "neighbor passive" commands. */
10598 install_element (BGP_NODE, &neighbor_passive_cmd);
10599 install_element (BGP_NODE, &no_neighbor_passive_cmd);
10601 /* "neighbor shutdown" commands. */
10602 install_element (BGP_NODE, &neighbor_shutdown_cmd);
10603 install_element (BGP_NODE, &no_neighbor_shutdown_cmd);
10605 /* Deprecated "neighbor capability route-refresh" commands.*/
10606 install_element (BGP_NODE, &neighbor_capability_route_refresh_cmd);
10607 install_element (BGP_NODE, &no_neighbor_capability_route_refresh_cmd);
10609 /* "neighbor capability orf prefix-list" commands.*/
10610 install_element (BGP_NODE, &neighbor_capability_orf_prefix_cmd);
10611 install_element (BGP_NODE, &no_neighbor_capability_orf_prefix_cmd);
10612 install_element (BGP_IPV4_NODE, &neighbor_capability_orf_prefix_cmd);
10613 install_element (BGP_IPV4_NODE, &no_neighbor_capability_orf_prefix_cmd);
10614 install_element (BGP_IPV4M_NODE, &neighbor_capability_orf_prefix_cmd);
10615 install_element (BGP_IPV4M_NODE, &no_neighbor_capability_orf_prefix_cmd);
10616 install_element (BGP_IPV6_NODE, &neighbor_capability_orf_prefix_cmd);
10617 install_element (BGP_IPV6_NODE, &no_neighbor_capability_orf_prefix_cmd);
10618 install_element (BGP_IPV6M_NODE, &neighbor_capability_orf_prefix_cmd);
10619 install_element (BGP_IPV6M_NODE, &no_neighbor_capability_orf_prefix_cmd);
10621 /* "neighbor capability dynamic" commands.*/
10622 install_element (BGP_NODE, &neighbor_capability_dynamic_cmd);
10623 install_element (BGP_NODE, &no_neighbor_capability_dynamic_cmd);
10625 /* "neighbor dont-capability-negotiate" commands. */
10626 install_element (BGP_NODE, &neighbor_dont_capability_negotiate_cmd);
10627 install_element (BGP_NODE, &no_neighbor_dont_capability_negotiate_cmd);
10629 /* "neighbor ebgp-multihop" commands. */
10630 install_element (BGP_NODE, &neighbor_ebgp_multihop_cmd);
10631 install_element (BGP_NODE, &neighbor_ebgp_multihop_ttl_cmd);
10632 install_element (BGP_NODE, &no_neighbor_ebgp_multihop_cmd);
10633 install_element (BGP_NODE, &no_neighbor_ebgp_multihop_ttl_cmd);
10635 /* "neighbor disable-connected-check" commands. */
10636 install_element (BGP_NODE, &neighbor_disable_connected_check_cmd);
10637 install_element (BGP_NODE, &no_neighbor_disable_connected_check_cmd);
10638 install_element (BGP_NODE, &neighbor_enforce_multihop_cmd);
10639 install_element (BGP_NODE, &no_neighbor_enforce_multihop_cmd);
10641 /* "neighbor description" commands. */
10642 install_element (BGP_NODE, &neighbor_description_cmd);
10643 install_element (BGP_NODE, &no_neighbor_description_cmd);
10644 install_element (BGP_NODE, &no_neighbor_description_val_cmd);
10646 /* "neighbor update-source" commands. "*/
10647 install_element (BGP_NODE, &neighbor_update_source_cmd);
10648 install_element (BGP_NODE, &no_neighbor_update_source_cmd);
10650 /* "neighbor default-originate" commands. */
10651 install_element (BGP_NODE, &neighbor_default_originate_cmd);
10652 install_element (BGP_NODE, &neighbor_default_originate_rmap_cmd);
10653 install_element (BGP_NODE, &no_neighbor_default_originate_cmd);
10654 install_element (BGP_NODE, &no_neighbor_default_originate_rmap_cmd);
10655 install_element (BGP_IPV4_NODE, &neighbor_default_originate_cmd);
10656 install_element (BGP_IPV4_NODE, &neighbor_default_originate_rmap_cmd);
10657 install_element (BGP_IPV4_NODE, &no_neighbor_default_originate_cmd);
10658 install_element (BGP_IPV4_NODE, &no_neighbor_default_originate_rmap_cmd);
10659 install_element (BGP_IPV4M_NODE, &neighbor_default_originate_cmd);
10660 install_element (BGP_IPV4M_NODE, &neighbor_default_originate_rmap_cmd);
10661 install_element (BGP_IPV4M_NODE, &no_neighbor_default_originate_cmd);
10662 install_element (BGP_IPV4M_NODE, &no_neighbor_default_originate_rmap_cmd);
10663 install_element (BGP_IPV6_NODE, &neighbor_default_originate_cmd);
10664 install_element (BGP_IPV6_NODE, &neighbor_default_originate_rmap_cmd);
10665 install_element (BGP_IPV6_NODE, &no_neighbor_default_originate_cmd);
10666 install_element (BGP_IPV6_NODE, &no_neighbor_default_originate_rmap_cmd);
10667 install_element (BGP_IPV6M_NODE, &neighbor_default_originate_cmd);
10668 install_element (BGP_IPV6M_NODE, &neighbor_default_originate_rmap_cmd);
10669 install_element (BGP_IPV6M_NODE, &no_neighbor_default_originate_cmd);
10670 install_element (BGP_IPV6M_NODE, &no_neighbor_default_originate_rmap_cmd);
10672 /* "neighbor port" commands. */
10673 install_element (BGP_NODE, &neighbor_port_cmd);
10674 install_element (BGP_NODE, &no_neighbor_port_cmd);
10675 install_element (BGP_NODE, &no_neighbor_port_val_cmd);
10677 /* "neighbor weight" commands. */
10678 install_element (BGP_NODE, &neighbor_weight_cmd);
10679 install_element (BGP_NODE, &no_neighbor_weight_cmd);
10680 install_element (BGP_NODE, &no_neighbor_weight_val_cmd);
10682 /* "neighbor override-capability" commands. */
10683 install_element (BGP_NODE, &neighbor_override_capability_cmd);
10684 install_element (BGP_NODE, &no_neighbor_override_capability_cmd);
10686 /* "neighbor strict-capability-match" commands. */
10687 install_element (BGP_NODE, &neighbor_strict_capability_cmd);
10688 install_element (BGP_NODE, &no_neighbor_strict_capability_cmd);
10690 /* "neighbor timers" commands. */
10691 install_element (BGP_NODE, &neighbor_timers_cmd);
10692 install_element (BGP_NODE, &no_neighbor_timers_cmd);
10694 /* "neighbor timers connect" commands. */
10695 install_element (BGP_NODE, &neighbor_timers_connect_cmd);
10696 install_element (BGP_NODE, &no_neighbor_timers_connect_cmd);
10697 install_element (BGP_NODE, &no_neighbor_timers_connect_val_cmd);
10699 /* "neighbor advertisement-interval" commands. */
10700 install_element (BGP_NODE, &neighbor_advertise_interval_cmd);
10701 install_element (BGP_NODE, &no_neighbor_advertise_interval_cmd);
10702 install_element (BGP_NODE, &no_neighbor_advertise_interval_val_cmd);
10704 /* "neighbor version" commands. */
10705 install_element (BGP_NODE, &neighbor_version_cmd);
10707 /* "neighbor interface" commands. */
10708 install_element (BGP_NODE, &neighbor_interface_cmd);
10709 install_element (BGP_NODE, &no_neighbor_interface_cmd);
10711 /* "neighbor distribute" commands. */
10712 install_element (BGP_NODE, &neighbor_distribute_list_cmd);
10713 install_element (BGP_NODE, &no_neighbor_distribute_list_cmd);
10714 install_element (BGP_IPV4_NODE, &neighbor_distribute_list_cmd);
10715 install_element (BGP_IPV4_NODE, &no_neighbor_distribute_list_cmd);
10716 install_element (BGP_IPV4M_NODE, &neighbor_distribute_list_cmd);
10717 install_element (BGP_IPV4M_NODE, &no_neighbor_distribute_list_cmd);
10718 install_element (BGP_IPV6_NODE, &neighbor_distribute_list_cmd);
10719 install_element (BGP_IPV6_NODE, &no_neighbor_distribute_list_cmd);
10720 install_element (BGP_IPV6M_NODE, &neighbor_distribute_list_cmd);
10721 install_element (BGP_IPV6M_NODE, &no_neighbor_distribute_list_cmd);
10722 install_element (BGP_VPNV4_NODE, &neighbor_distribute_list_cmd);
10723 install_element (BGP_VPNV4_NODE, &no_neighbor_distribute_list_cmd);
10724 install_element (BGP_VPNV6_NODE, &neighbor_distribute_list_cmd);
10725 install_element (BGP_VPNV6_NODE, &no_neighbor_distribute_list_cmd);
10726 install_element (BGP_ENCAP_NODE, &neighbor_distribute_list_cmd);
10727 install_element (BGP_ENCAP_NODE, &no_neighbor_distribute_list_cmd);
10728 install_element (BGP_ENCAPV6_NODE, &neighbor_distribute_list_cmd);
10729 install_element (BGP_ENCAPV6_NODE, &no_neighbor_distribute_list_cmd);
10731 /* "neighbor prefix-list" commands. */
10732 install_element (BGP_NODE, &neighbor_prefix_list_cmd);
10733 install_element (BGP_NODE, &no_neighbor_prefix_list_cmd);
10734 install_element (BGP_IPV4_NODE, &neighbor_prefix_list_cmd);
10735 install_element (BGP_IPV4_NODE, &no_neighbor_prefix_list_cmd);
10736 install_element (BGP_IPV4M_NODE, &neighbor_prefix_list_cmd);
10737 install_element (BGP_IPV4M_NODE, &no_neighbor_prefix_list_cmd);
10738 install_element (BGP_IPV6_NODE, &neighbor_prefix_list_cmd);
10739 install_element (BGP_IPV6_NODE, &no_neighbor_prefix_list_cmd);
10740 install_element (BGP_IPV6M_NODE, &neighbor_prefix_list_cmd);
10741 install_element (BGP_IPV6M_NODE, &no_neighbor_prefix_list_cmd);
10742 install_element (BGP_VPNV4_NODE, &neighbor_prefix_list_cmd);
10743 install_element (BGP_VPNV4_NODE, &no_neighbor_prefix_list_cmd);
10744 install_element (BGP_VPNV6_NODE, &neighbor_prefix_list_cmd);
10745 install_element (BGP_VPNV6_NODE, &no_neighbor_prefix_list_cmd);
10746 install_element (BGP_ENCAP_NODE, &neighbor_prefix_list_cmd);
10747 install_element (BGP_ENCAP_NODE, &no_neighbor_prefix_list_cmd);
10748 install_element (BGP_ENCAPV6_NODE, &neighbor_prefix_list_cmd);
10749 install_element (BGP_ENCAPV6_NODE, &no_neighbor_prefix_list_cmd);
10751 /* "neighbor filter-list" commands. */
10752 install_element (BGP_NODE, &neighbor_filter_list_cmd);
10753 install_element (BGP_NODE, &no_neighbor_filter_list_cmd);
10754 install_element (BGP_IPV4_NODE, &neighbor_filter_list_cmd);
10755 install_element (BGP_IPV4_NODE, &no_neighbor_filter_list_cmd);
10756 install_element (BGP_IPV4M_NODE, &neighbor_filter_list_cmd);
10757 install_element (BGP_IPV4M_NODE, &no_neighbor_filter_list_cmd);
10758 install_element (BGP_IPV6_NODE, &neighbor_filter_list_cmd);
10759 install_element (BGP_IPV6_NODE, &no_neighbor_filter_list_cmd);
10760 install_element (BGP_IPV6M_NODE, &neighbor_filter_list_cmd);
10761 install_element (BGP_IPV6M_NODE, &no_neighbor_filter_list_cmd);
10762 install_element (BGP_VPNV4_NODE, &neighbor_filter_list_cmd);
10763 install_element (BGP_VPNV4_NODE, &no_neighbor_filter_list_cmd);
10764 install_element (BGP_VPNV6_NODE, &neighbor_filter_list_cmd);
10765 install_element (BGP_VPNV6_NODE, &no_neighbor_filter_list_cmd);
10766 install_element (BGP_ENCAP_NODE, &neighbor_filter_list_cmd);
10767 install_element (BGP_ENCAP_NODE, &no_neighbor_filter_list_cmd);
10768 install_element (BGP_ENCAPV6_NODE, &neighbor_filter_list_cmd);
10769 install_element (BGP_ENCAPV6_NODE, &no_neighbor_filter_list_cmd);
10771 /* "neighbor route-map" commands. */
10772 install_element (BGP_NODE, &neighbor_route_map_cmd);
10773 install_element (BGP_NODE, &no_neighbor_route_map_cmd);
10774 install_element (BGP_IPV4_NODE, &neighbor_route_map_cmd);
10775 install_element (BGP_IPV4_NODE, &no_neighbor_route_map_cmd);
10776 install_element (BGP_IPV4M_NODE, &neighbor_route_map_cmd);
10777 install_element (BGP_IPV4M_NODE, &no_neighbor_route_map_cmd);
10778 install_element (BGP_IPV6_NODE, &neighbor_route_map_cmd);
10779 install_element (BGP_IPV6_NODE, &no_neighbor_route_map_cmd);
10780 install_element (BGP_IPV6M_NODE, &neighbor_route_map_cmd);
10781 install_element (BGP_IPV6M_NODE, &no_neighbor_route_map_cmd);
10782 install_element (BGP_VPNV4_NODE, &neighbor_route_map_cmd);
10783 install_element (BGP_VPNV4_NODE, &no_neighbor_route_map_cmd);
10784 install_element (BGP_VPNV6_NODE, &neighbor_route_map_cmd);
10785 install_element (BGP_VPNV6_NODE, &no_neighbor_route_map_cmd);
10786 install_element (BGP_ENCAP_NODE, &neighbor_route_map_cmd);
10787 install_element (BGP_ENCAP_NODE, &no_neighbor_route_map_cmd);
10788 install_element (BGP_ENCAPV6_NODE, &neighbor_route_map_cmd);
10789 install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_map_cmd);
10791 /* "neighbor unsuppress-map" commands. */
10792 install_element (BGP_NODE, &neighbor_unsuppress_map_cmd);
10793 install_element (BGP_NODE, &no_neighbor_unsuppress_map_cmd);
10794 install_element (BGP_IPV4_NODE, &neighbor_unsuppress_map_cmd);
10795 install_element (BGP_IPV4_NODE, &no_neighbor_unsuppress_map_cmd);
10796 install_element (BGP_IPV4M_NODE, &neighbor_unsuppress_map_cmd);
10797 install_element (BGP_IPV4M_NODE, &no_neighbor_unsuppress_map_cmd);
10798 install_element (BGP_IPV6_NODE, &neighbor_unsuppress_map_cmd);
10799 install_element (BGP_IPV6_NODE, &no_neighbor_unsuppress_map_cmd);
10800 install_element (BGP_IPV6M_NODE, &neighbor_unsuppress_map_cmd);
10801 install_element (BGP_IPV6M_NODE, &no_neighbor_unsuppress_map_cmd);
10802 install_element (BGP_VPNV4_NODE, &neighbor_unsuppress_map_cmd);
10803 install_element (BGP_VPNV4_NODE, &no_neighbor_unsuppress_map_cmd);
10804 install_element (BGP_VPNV6_NODE, &neighbor_unsuppress_map_cmd);
10805 install_element (BGP_VPNV6_NODE, &no_neighbor_unsuppress_map_cmd);
10806 install_element (BGP_ENCAP_NODE, &neighbor_unsuppress_map_cmd);
10807 install_element (BGP_ENCAP_NODE, &no_neighbor_unsuppress_map_cmd);
10808 install_element (BGP_ENCAPV6_NODE, &neighbor_unsuppress_map_cmd);
10809 install_element (BGP_ENCAPV6_NODE, &no_neighbor_unsuppress_map_cmd);
10811 /* "neighbor maximum-prefix" commands. */
10812 install_element (BGP_NODE, &neighbor_maximum_prefix_cmd);
10813 install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_cmd);
10814 install_element (BGP_NODE, &neighbor_maximum_prefix_warning_cmd);
10815 install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
10816 install_element (BGP_NODE, &neighbor_maximum_prefix_restart_cmd);
10817 install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
10818 install_element (BGP_NODE, &no_neighbor_maximum_prefix_cmd);
10819 install_element (BGP_NODE, &no_neighbor_maximum_prefix_val_cmd);
10820 install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
10821 install_element (BGP_NODE, &no_neighbor_maximum_prefix_warning_cmd);
10822 install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
10823 install_element (BGP_NODE, &no_neighbor_maximum_prefix_restart_cmd);
10824 install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
10825 install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_cmd);
10826 install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_cmd);
10827 install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_warning_cmd);
10828 install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
10829 install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_restart_cmd);
10830 install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
10831 install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_cmd);
10832 install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_val_cmd);
10833 install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
10834 install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_warning_cmd);
10835 install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
10836 install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_restart_cmd);
10837 install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
10838 install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_cmd);
10839 install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_cmd);
10840 install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_warning_cmd);
10841 install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
10842 install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_restart_cmd);
10843 install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
10844 install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_cmd);
10845 install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_val_cmd);
10846 install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
10847 install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_warning_cmd);
10848 install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
10849 install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_restart_cmd);
10850 install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
10851 install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_cmd);
10852 install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_cmd);
10853 install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_warning_cmd);
10854 install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
10855 install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_restart_cmd);
10856 install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
10857 install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_cmd);
10858 install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_val_cmd);
10859 install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
10860 install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_warning_cmd);
10861 install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
10862 install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_restart_cmd);
10863 install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
10864 install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_cmd);
10865 install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_cmd);
10866 install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_warning_cmd);
10867 install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
10868 install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_restart_cmd);
10869 install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
10870 install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_cmd);
10871 install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_val_cmd);
10872 install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
10873 install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_warning_cmd);
10874 install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
10875 install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_restart_cmd);
10876 install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
10877 install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_cmd);
10878 install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_cmd);
10879 install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_warning_cmd);
10880 install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
10881 install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_restart_cmd);
10882 install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
10883 install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_cmd);
10884 install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_val_cmd);
10885 install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
10886 install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_warning_cmd);
10887 install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
10888 install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_restart_cmd);
10889 install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
10891 install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_cmd);
10892 install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_threshold_cmd);
10893 install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_warning_cmd);
10894 install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
10895 install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_restart_cmd);
10896 install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
10897 install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_cmd);
10898 install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_val_cmd);
10899 install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
10900 install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_warning_cmd);
10901 install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
10902 install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_restart_cmd);
10903 install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
10905 install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_cmd);
10906 install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_cmd);
10907 install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_warning_cmd);
10908 install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
10909 install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_restart_cmd);
10910 install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
10911 install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_cmd);
10912 install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_val_cmd);
10913 install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
10914 install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_warning_cmd);
10915 install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
10916 install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_restart_cmd);
10917 install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
10919 install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_cmd);
10920 install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_cmd);
10921 install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_warning_cmd);
10922 install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
10923 install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_restart_cmd);
10924 install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
10925 install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_cmd);
10926 install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_val_cmd);
10927 install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
10928 install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_warning_cmd);
10929 install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
10930 install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_restart_cmd);
10931 install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
10933 /* "neighbor allowas-in" */
10934 install_element (BGP_NODE, &neighbor_allowas_in_cmd);
10935 install_element (BGP_NODE, &neighbor_allowas_in_arg_cmd);
10936 install_element (BGP_NODE, &no_neighbor_allowas_in_cmd);
10937 install_element (BGP_IPV4_NODE, &neighbor_allowas_in_cmd);
10938 install_element (BGP_IPV4_NODE, &neighbor_allowas_in_arg_cmd);
10939 install_element (BGP_IPV4_NODE, &no_neighbor_allowas_in_cmd);
10940 install_element (BGP_IPV4M_NODE, &neighbor_allowas_in_cmd);
10941 install_element (BGP_IPV4M_NODE, &neighbor_allowas_in_arg_cmd);
10942 install_element (BGP_IPV4M_NODE, &no_neighbor_allowas_in_cmd);
10943 install_element (BGP_IPV6_NODE, &neighbor_allowas_in_cmd);
10944 install_element (BGP_IPV6_NODE, &neighbor_allowas_in_arg_cmd);
10945 install_element (BGP_IPV6_NODE, &no_neighbor_allowas_in_cmd);
10946 install_element (BGP_IPV6M_NODE, &neighbor_allowas_in_cmd);
10947 install_element (BGP_IPV6M_NODE, &neighbor_allowas_in_arg_cmd);
10948 install_element (BGP_IPV6M_NODE, &no_neighbor_allowas_in_cmd);
10949 install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_cmd);
10950 install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_arg_cmd);
10951 install_element (BGP_VPNV4_NODE, &no_neighbor_allowas_in_cmd);
10952 install_element (BGP_VPNV6_NODE, &neighbor_allowas_in_cmd);
10953 install_element (BGP_VPNV6_NODE, &neighbor_allowas_in_arg_cmd);
10954 install_element (BGP_VPNV6_NODE, &no_neighbor_allowas_in_cmd);
10955 install_element (BGP_ENCAP_NODE, &neighbor_allowas_in_cmd);
10956 install_element (BGP_ENCAP_NODE, &neighbor_allowas_in_arg_cmd);
10957 install_element (BGP_ENCAP_NODE, &no_neighbor_allowas_in_cmd);
10958 install_element (BGP_ENCAPV6_NODE, &neighbor_allowas_in_cmd);
10959 install_element (BGP_ENCAPV6_NODE, &neighbor_allowas_in_arg_cmd);
10960 install_element (BGP_ENCAPV6_NODE, &no_neighbor_allowas_in_cmd);
10962 /* address-family commands. */
10963 install_element (BGP_NODE, &address_family_ipv4_cmd);
10964 install_element (BGP_NODE, &address_family_ipv4_safi_cmd);
10965 install_element (BGP_NODE, &address_family_ipv6_cmd);
10966 install_element (BGP_NODE, &address_family_ipv6_safi_cmd);
10967 install_element (BGP_NODE, &address_family_vpnv4_cmd);
10968 install_element (BGP_NODE, &address_family_vpnv4_unicast_cmd);
10970 install_element (BGP_NODE, &address_family_vpnv6_cmd);
10971 install_element (BGP_NODE, &address_family_vpnv6_unicast_cmd);
10973 install_element (BGP_NODE, &address_family_encap_cmd);
10974 install_element (BGP_NODE, &address_family_encapv4_cmd);
10975 install_element (BGP_NODE, &address_family_encapv6_cmd);
10977 /* "exit-address-family" command. */
10978 install_element (BGP_IPV4_NODE, &exit_address_family_cmd);
10979 install_element (BGP_IPV4M_NODE, &exit_address_family_cmd);
10980 install_element (BGP_IPV6_NODE, &exit_address_family_cmd);
10981 install_element (BGP_IPV6M_NODE, &exit_address_family_cmd);
10982 install_element (BGP_VPNV4_NODE, &exit_address_family_cmd);
10983 install_element (BGP_VPNV6_NODE, &exit_address_family_cmd);
10984 install_element (BGP_ENCAP_NODE, &exit_address_family_cmd);
10985 install_element (BGP_ENCAPV6_NODE, &exit_address_family_cmd);
10987 /* "clear ip bgp commands" */
10988 install_element (ENABLE_NODE, &clear_ip_bgp_all_cmd);
10989 install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_cmd);
10990 install_element (ENABLE_NODE, &clear_ip_bgp_as_cmd);
10991 install_element (ENABLE_NODE, &clear_ip_bgp_peer_cmd);
10992 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_cmd);
10993 install_element (ENABLE_NODE, &clear_ip_bgp_external_cmd);
10994 install_element (ENABLE_NODE, &clear_bgp_all_cmd);
10995 install_element (ENABLE_NODE, &clear_bgp_instance_all_cmd);
10996 install_element (ENABLE_NODE, &clear_bgp_ipv6_all_cmd);
10997 install_element (ENABLE_NODE, &clear_bgp_peer_cmd);
10998 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_cmd);
10999 install_element (ENABLE_NODE, &clear_bgp_peer_group_cmd);
11000 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_cmd);
11001 install_element (ENABLE_NODE, &clear_bgp_external_cmd);
11002 install_element (ENABLE_NODE, &clear_bgp_ipv6_external_cmd);
11003 install_element (ENABLE_NODE, &clear_bgp_as_cmd);
11004 install_element (ENABLE_NODE, &clear_bgp_ipv6_as_cmd);
11006 /* "clear ip bgp neighbor soft in" */
11007 install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_in_cmd);
11008 install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_in_cmd);
11009 install_element (ENABLE_NODE, &clear_ip_bgp_all_in_cmd);
11010 install_element (ENABLE_NODE, &clear_ip_bgp_all_in_prefix_filter_cmd);
11011 install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_in_prefix_filter_cmd);
11012 install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_in_cmd);
11013 install_element (ENABLE_NODE, &clear_ip_bgp_peer_in_cmd);
11014 install_element (ENABLE_NODE, &clear_ip_bgp_peer_in_prefix_filter_cmd);
11015 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_in_cmd);
11016 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_in_cmd);
11017 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_in_prefix_filter_cmd);
11018 install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_in_cmd);
11019 install_element (ENABLE_NODE, &clear_ip_bgp_external_in_cmd);
11020 install_element (ENABLE_NODE, &clear_ip_bgp_external_in_prefix_filter_cmd);
11021 install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_in_cmd);
11022 install_element (ENABLE_NODE, &clear_ip_bgp_as_in_cmd);
11023 install_element (ENABLE_NODE, &clear_ip_bgp_as_in_prefix_filter_cmd);
11024 install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_in_cmd);
11025 install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd);
11026 install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_in_cmd);
11027 install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd);
11028 install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd);
11029 install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_in_cmd);
11030 install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_in_cmd);
11031 install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd);
11032 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd);
11033 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_in_cmd);
11034 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd);
11035 install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_in_cmd);
11036 install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_in_cmd);
11037 install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd);
11038 install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_in_cmd);
11039 install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_in_cmd);
11040 install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd);
11041 install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_in_cmd);
11042 install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_in_cmd);
11043 install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_in_cmd);
11044 install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_in_cmd);
11045 install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_in_cmd);
11046 install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_in_cmd);
11047 install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_soft_in_cmd);
11048 install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_in_cmd);
11049 install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_soft_in_cmd);
11050 install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_in_cmd);
11051 install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_in_cmd);
11052 install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_in_cmd);
11053 install_element (ENABLE_NODE, &clear_bgp_all_soft_in_cmd);
11054 install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_in_cmd);
11055 install_element (ENABLE_NODE, &clear_bgp_all_in_cmd);
11056 install_element (ENABLE_NODE, &clear_bgp_all_in_prefix_filter_cmd);
11057 install_element (ENABLE_NODE, &clear_bgp_peer_soft_in_cmd);
11058 install_element (ENABLE_NODE, &clear_bgp_peer_in_cmd);
11059 install_element (ENABLE_NODE, &clear_bgp_peer_in_prefix_filter_cmd);
11060 install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_in_cmd);
11061 install_element (ENABLE_NODE, &clear_bgp_peer_group_in_cmd);
11062 install_element (ENABLE_NODE, &clear_bgp_peer_group_in_prefix_filter_cmd);
11063 install_element (ENABLE_NODE, &clear_bgp_external_soft_in_cmd);
11064 install_element (ENABLE_NODE, &clear_bgp_external_in_cmd);
11065 install_element (ENABLE_NODE, &clear_bgp_external_in_prefix_filter_cmd);
11066 install_element (ENABLE_NODE, &clear_bgp_as_soft_in_cmd);
11067 install_element (ENABLE_NODE, &clear_bgp_as_in_cmd);
11068 install_element (ENABLE_NODE, &clear_bgp_as_in_prefix_filter_cmd);
11069 install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_in_cmd);
11070 install_element (ENABLE_NODE, &clear_bgp_ipv6_all_in_cmd);
11071 install_element (ENABLE_NODE, &clear_bgp_ipv6_all_in_prefix_filter_cmd);
11072 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_in_cmd);
11073 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_in_cmd);
11074 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_in_prefix_filter_cmd);
11075 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_in_cmd);
11076 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_in_cmd);
11077 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd);
11078 install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_in_cmd);
11079 install_element (ENABLE_NODE, &clear_bgp_ipv6_external_in_cmd);
11080 install_element (ENABLE_NODE, &clear_bgp_ipv6_external_in_prefix_filter_cmd);
11081 install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_in_cmd);
11082 install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_cmd);
11083 install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_prefix_filter_cmd);
11085 /* clear ip bgp prefix */
11086 install_element (ENABLE_NODE, &clear_ip_bgp_prefix_cmd);
11087 install_element (ENABLE_NODE, &clear_bgp_ipv6_safi_prefix_cmd);
11089 /* "clear ip bgp neighbor soft out" */
11090 install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_out_cmd);
11091 install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_out_cmd);
11092 install_element (ENABLE_NODE, &clear_ip_bgp_all_out_cmd);
11093 install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_out_cmd);
11094 install_element (ENABLE_NODE, &clear_ip_bgp_peer_out_cmd);
11095 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_out_cmd);
11096 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_out_cmd);
11097 install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_out_cmd);
11098 install_element (ENABLE_NODE, &clear_ip_bgp_external_out_cmd);
11099 install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_out_cmd);
11100 install_element (ENABLE_NODE, &clear_ip_bgp_as_out_cmd);
11101 install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_out_cmd);
11102 install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd);
11103 install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_out_cmd);
11104 install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_out_cmd);
11105 install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_out_cmd);
11106 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd);
11107 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_out_cmd);
11108 install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_out_cmd);
11109 install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_out_cmd);
11110 install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_out_cmd);
11111 install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_out_cmd);
11112 install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_out_cmd);
11113 install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_out_cmd);
11114 install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_out_cmd);
11115 install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_out_cmd);
11116 install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_out_cmd);
11117 install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_out_cmd);
11118 install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_soft_out_cmd);
11119 install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_out_cmd);
11120 install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_soft_out_cmd);
11121 install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_out_cmd);
11122 install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_out_cmd);
11123 install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_out_cmd);
11124 install_element (ENABLE_NODE, &clear_bgp_all_soft_out_cmd);
11125 install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_out_cmd);
11126 install_element (ENABLE_NODE, &clear_bgp_all_out_cmd);
11127 install_element (ENABLE_NODE, &clear_bgp_peer_soft_out_cmd);
11128 install_element (ENABLE_NODE, &clear_bgp_peer_out_cmd);
11129 install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_out_cmd);
11130 install_element (ENABLE_NODE, &clear_bgp_peer_group_out_cmd);
11131 install_element (ENABLE_NODE, &clear_bgp_external_soft_out_cmd);
11132 install_element (ENABLE_NODE, &clear_bgp_external_out_cmd);
11133 install_element (ENABLE_NODE, &clear_bgp_as_soft_out_cmd);
11134 install_element (ENABLE_NODE, &clear_bgp_as_out_cmd);
11135 install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_out_cmd);
11136 install_element (ENABLE_NODE, &clear_bgp_ipv6_all_out_cmd);
11137 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_out_cmd);
11138 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_out_cmd);
11139 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_out_cmd);
11140 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_out_cmd);
11141 install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_out_cmd);
11142 install_element (ENABLE_NODE, &clear_bgp_ipv6_external_out_cmd);
11143 install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_out_cmd);
11144 install_element (ENABLE_NODE, &clear_bgp_ipv6_as_out_cmd);
11146 /* "clear ip bgp neighbor soft" */
11147 install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_cmd);
11148 install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_cmd);
11149 install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_cmd);
11150 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_cmd);
11151 install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_cmd);
11152 install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_cmd);
11153 install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_cmd);
11154 install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_cmd);
11155 install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_cmd);
11156 install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_cmd);
11157 install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_cmd);
11158 install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_cmd);
11159 install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_cmd);
11160 install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_cmd);
11161 install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_cmd);
11162 install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_soft_cmd);
11163 install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_soft_cmd);
11164 install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_cmd);
11165 install_element (ENABLE_NODE, &clear_bgp_all_soft_cmd);
11166 install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_cmd);
11167 install_element (ENABLE_NODE, &clear_bgp_peer_soft_cmd);
11168 install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_cmd);
11169 install_element (ENABLE_NODE, &clear_bgp_external_soft_cmd);
11170 install_element (ENABLE_NODE, &clear_bgp_as_soft_cmd);
11171 install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_cmd);
11172 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_cmd);
11173 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_cmd);
11174 install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_cmd);
11175 install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_cmd);
11177 /* "clear ip bgp neighbor rsclient" */
11178 install_element (ENABLE_NODE, &clear_ip_bgp_all_rsclient_cmd);
11179 install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_rsclient_cmd);
11180 install_element (ENABLE_NODE, &clear_ip_bgp_peer_rsclient_cmd);
11181 install_element (ENABLE_NODE, &clear_ip_bgp_instance_peer_rsclient_cmd);
11182 install_element (ENABLE_NODE, &clear_bgp_all_rsclient_cmd);
11183 install_element (ENABLE_NODE, &clear_bgp_instance_all_rsclient_cmd);
11184 install_element (ENABLE_NODE, &clear_bgp_ipv6_all_rsclient_cmd);
11185 install_element (ENABLE_NODE, &clear_bgp_ipv6_instance_all_rsclient_cmd);
11186 install_element (ENABLE_NODE, &clear_bgp_peer_rsclient_cmd);
11187 install_element (ENABLE_NODE, &clear_bgp_instance_peer_rsclient_cmd);
11188 install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_rsclient_cmd);
11189 install_element (ENABLE_NODE, &clear_bgp_ipv6_instance_peer_rsclient_cmd);
11191 /* "show ip bgp summary" commands. */
11192 install_element (VIEW_NODE, &show_bgp_summary_cmd);
11193 install_element (RESTRICTED_NODE, &show_bgp_summary_cmd);
11195 install_element (VIEW_NODE, &show_bgp_summary_1w_cmd);
11196 install_element (RESTRICTED_NODE, &show_bgp_summary_1w_cmd);
11198 install_element (VIEW_NODE, &show_bgp_ipv4_safi_summary_cmd);
11199 install_element (VIEW_NODE, &show_bgp_instance_ipv4_safi_summary_cmd);
11200 install_element (VIEW_NODE, &show_bgp_instance_ipv4_summary_cmd);
11202 install_element (VIEW_NODE, &show_bgp_ipv4_vpn_summary_cmd);
11203 install_element (VIEW_NODE, &show_bgp_ipv4_encap_summary_cmd);
11204 install_element (VIEW_NODE, &show_bgp_ipv6_vpn_summary_cmd);
11205 install_element (VIEW_NODE, &show_bgp_ipv6_encap_summary_cmd);
11207 install_element (VIEW_NODE, &show_bgp_instance_summary_cmd);
11208 install_element (VIEW_NODE, &show_bgp_ipv6_safi_summary_cmd);
11209 install_element (VIEW_NODE, &show_bgp_instance_ipv6_summary_cmd);
11210 install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_summary_cmd);
11212 install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_summary_cmd);
11213 install_element (RESTRICTED_NODE, &show_bgp_instance_ipv4_summary_cmd);
11214 install_element (RESTRICTED_NODE, &show_bgp_instance_ipv4_safi_summary_cmd);
11216 install_element (RESTRICTED_NODE, &show_bgp_ipv4_vpn_summary_cmd);
11217 install_element (RESTRICTED_NODE, &show_bgp_ipv4_encap_summary_cmd);
11218 install_element (RESTRICTED_NODE, &show_bgp_ipv6_vpn_summary_cmd);
11219 install_element (RESTRICTED_NODE, &show_bgp_ipv6_encap_summary_cmd);
11221 install_element (RESTRICTED_NODE, &show_bgp_instance_summary_cmd);
11222 install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_summary_cmd);
11223 install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_summary_cmd);
11224 install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_safi_summary_cmd);
11226 /* "show ip bgp neighbors" commands. */
11227 install_element (VIEW_NODE, &show_bgp_instance_neighbors_cmd);
11229 install_element (VIEW_NODE, &show_bgp_neighbors_cmd);
11230 install_element (VIEW_NODE, &show_bgp_neighbors_peer_cmd);
11231 install_element (VIEW_NODE, &show_bgp_instance_neighbors_peer_cmd);
11232 install_element (RESTRICTED_NODE, &show_bgp_neighbors_peer_cmd);
11233 install_element (RESTRICTED_NODE, &show_bgp_instance_neighbors_peer_cmd);
11234 install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_cmd);
11235 install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd);
11236 install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd);
11238 /* "show ip bgp rsclient" commands. */
11239 install_element (VIEW_NODE, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd);
11240 install_element (VIEW_NODE, &show_bgp_ipv4_safi_rsclient_summary_cmd);
11241 install_element (RESTRICTED_NODE, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd);
11242 install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_rsclient_summary_cmd);
11244 install_element (VIEW_NODE, &show_bgp_rsclient_summary_cmd);
11245 install_element (VIEW_NODE, &show_bgp_instance_rsclient_summary_cmd);
11246 install_element (RESTRICTED_NODE, &show_bgp_rsclient_summary_cmd);
11247 install_element (RESTRICTED_NODE, &show_bgp_instance_rsclient_summary_cmd);
11249 install_element (VIEW_NODE, &show_bgp_ipv6_rsclient_summary_cmd);
11250 install_element (VIEW_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd);
11251 install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd);
11252 install_element (VIEW_NODE, &show_bgp_ipv6_safi_rsclient_summary_cmd);
11253 install_element (RESTRICTED_NODE, &show_bgp_ipv6_rsclient_summary_cmd);
11254 install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd);
11255 install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd);
11256 install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_rsclient_summary_cmd);
11258 /* "show ip bgp paths" commands. */
11259 install_element (VIEW_NODE, &show_bgp_ipv4_paths_cmd);
11261 /* "show ip bgp community" commands. */
11262 install_element (VIEW_NODE, &show_ip_bgp_community_info_cmd);
11264 /* "show ip bgp large-community" commands. */
11265 install_element (VIEW_NODE, &show_ip_bgp_lcommunity_info_cmd);
11267 /* "show ip bgp attribute-info" commands. */
11268 install_element (VIEW_NODE, &show_ip_bgp_attr_info_cmd);
11270 /* "redistribute" commands. */
11271 install_element (BGP_NODE, &bgp_redistribute_ipv4_cmd);
11272 install_element (BGP_NODE, &no_bgp_redistribute_ipv4_cmd);
11273 install_element (BGP_NODE, &bgp_redistribute_ipv4_rmap_cmd);
11274 install_element (BGP_NODE, &no_bgp_redistribute_ipv4_rmap_cmd);
11275 install_element (BGP_NODE, &bgp_redistribute_ipv4_metric_cmd);
11276 install_element (BGP_NODE, &no_bgp_redistribute_ipv4_metric_cmd);
11277 install_element (BGP_NODE, &bgp_redistribute_ipv4_rmap_metric_cmd);
11278 install_element (BGP_NODE, &bgp_redistribute_ipv4_metric_rmap_cmd);
11279 install_element (BGP_NODE, &no_bgp_redistribute_ipv4_rmap_metric_cmd);
11280 install_element (BGP_NODE, &no_bgp_redistribute_ipv4_metric_rmap_cmd);
11281 install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_cmd);
11282 install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_cmd);
11283 install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_cmd);
11284 install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_cmd);
11285 install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_cmd);
11286 install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_cmd);
11287 install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_metric_cmd);
11288 install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_rmap_cmd);
11289 install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_metric_cmd);
11290 install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_rmap_cmd);
11292 /* ttl_security commands */
11293 install_element (BGP_NODE, &neighbor_ttl_security_cmd);
11294 install_element (BGP_NODE, &no_neighbor_ttl_security_cmd);
11296 /* "show bgp memory" commands. */
11297 install_element (VIEW_NODE, &show_bgp_memory_cmd);
11298 install_element (RESTRICTED_NODE, &show_bgp_memory_cmd);
11300 /* "show bgp views" commands. */
11301 install_element (VIEW_NODE, &show_bgp_views_cmd);
11302 install_element (RESTRICTED_NODE, &show_bgp_views_cmd);
11304 /* non afi/safi forms of commands */
11305 install_element (VIEW_NODE, &show_ip_bgp_summary_cmd);
11306 install_element (VIEW_NODE, &show_ip_bgp_instance_summary_cmd);
11307 install_element (VIEW_NODE, &show_ip_bgp_ipv4_summary_cmd);
11308 install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_summary_cmd);
11309 install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
11310 install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
11311 install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd);
11312 install_element (RESTRICTED_NODE, &show_ip_bgp_summary_cmd);
11313 install_element (RESTRICTED_NODE, &show_ip_bgp_instance_summary_cmd);
11314 install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_summary_cmd);
11315 install_element (RESTRICTED_NODE, &show_ip_bgp_instance_ipv4_summary_cmd);
11316 install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
11317 install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
11318 install_element (RESTRICTED_NODE, &show_bgp_ipv6_summary_cmd);
11319 install_element (VIEW_NODE, &show_ip_bgp_neighbors_cmd);
11320 install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_cmd);
11321 install_element (VIEW_NODE, &show_ip_bgp_neighbors_peer_cmd);
11322 install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd);
11323 install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd);
11324 install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd);
11325 install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd);
11326 install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd);
11327 install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_cmd);
11328 install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_peer_cmd);
11329 install_element (RESTRICTED_NODE, &show_ip_bgp_neighbors_peer_cmd);
11330 install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd);
11331 install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd);
11332 install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd);
11333 install_element (RESTRICTED_NODE, &show_ip_bgp_instance_neighbors_peer_cmd);
11334 install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_cmd);
11335 install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_peer_cmd);
11336 install_element (RESTRICTED_NODE, &show_bgp_ipv6_neighbors_peer_cmd);
11337 install_element (VIEW_NODE, &show_ipv6_bgp_summary_cmd);
11338 install_element (VIEW_NODE, &show_ipv6_mbgp_summary_cmd);
11339 install_element (VIEW_NODE, &show_ip_bgp_rsclient_summary_cmd);
11340 install_element (VIEW_NODE, &show_ip_bgp_instance_rsclient_summary_cmd);
11341 install_element (VIEW_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd);
11342 install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd);
11343 install_element (RESTRICTED_NODE, &show_ip_bgp_rsclient_summary_cmd);
11344 install_element (RESTRICTED_NODE, &show_ip_bgp_instance_rsclient_summary_cmd);
11345 install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd);
11346 install_element (RESTRICTED_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd);
11347 install_element (VIEW_NODE, &show_ip_bgp_paths_cmd);
11348 install_element (VIEW_NODE, &show_ip_bgp_ipv4_paths_cmd);
11349 /* Community-list. */
11350 community_list_vty ();
11353 #include "memory.h"
11354 #include "bgp_regex.h"
11355 #include "bgp_clist.h"
11356 #include "bgp_ecommunity.h"
11358 /* VTY functions. */
11360 /* Direction value to string conversion. */
11361 static const char *
11362 community_direct_str (int direct)
11366 case COMMUNITY_DENY:
11368 case COMMUNITY_PERMIT:
11375 /* Display error string. */
11377 community_list_perror (struct vty *vty, int ret)
11381 case COMMUNITY_LIST_ERR_CANT_FIND_LIST:
11382 vty_out (vty, "%% Can't find community-list%s", VTY_NEWLINE);
11384 case COMMUNITY_LIST_ERR_MALFORMED_VAL:
11385 vty_out (vty, "%% Malformed community-list value%s", VTY_NEWLINE);
11387 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT:
11388 vty_out (vty, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE);
11390 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT:
11391 vty_out (vty, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE);
11396 /* VTY interface for community_set() function. */
11398 community_list_set_vty (struct vty *vty, int argc, const char **argv,
11399 int style, int reject_all_digit_name)
11405 /* Check the list type. */
11406 if (strncmp (argv[1], "p", 1) == 0)
11407 direct = COMMUNITY_PERMIT;
11408 else if (strncmp (argv[1], "d", 1) == 0)
11409 direct = COMMUNITY_DENY;
11412 vty_out (vty, "%% Matching condition must be permit or deny%s",
11414 return CMD_WARNING;
11417 /* All digit name check. */
11418 if (reject_all_digit_name && all_digit (argv[0]))
11420 vty_out (vty, "%% Community name cannot have all digits%s", VTY_NEWLINE);
11421 return CMD_WARNING;
11424 /* Concat community string argument. */
11426 str = argv_concat (argv, argc, 2);
11430 /* When community_list_set() return nevetive value, it means
11431 malformed community string. */
11432 ret = community_list_set (bgp_clist, argv[0], str, direct, style);
11434 /* Free temporary community list string allocated by
11437 XFREE (MTYPE_TMP, str);
11441 /* Display error string. */
11442 community_list_perror (vty, ret);
11443 return CMD_WARNING;
11446 return CMD_SUCCESS;
11449 /* Communiyt-list entry delete. */
11451 community_list_unset_vty (struct vty *vty, int argc, const char **argv,
11460 /* Check the list direct. */
11461 if (strncmp (argv[1], "p", 1) == 0)
11462 direct = COMMUNITY_PERMIT;
11463 else if (strncmp (argv[1], "d", 1) == 0)
11464 direct = COMMUNITY_DENY;
11467 vty_out (vty, "%% Matching condition must be permit or deny%s",
11469 return CMD_WARNING;
11472 /* Concat community string argument. */
11473 str = argv_concat (argv, argc, 2);
11476 /* Unset community list. */
11477 ret = community_list_unset (bgp_clist, argv[0], str, direct, style);
11479 /* Free temporary community list string allocated by
11482 XFREE (MTYPE_TMP, str);
11486 community_list_perror (vty, ret);
11487 return CMD_WARNING;
11490 return CMD_SUCCESS;
11493 /* "community-list" keyword help string. */
11494 #define COMMUNITY_LIST_STR "Add a community list entry\n"
11495 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
11497 DEFUN (ip_community_list_standard,
11498 ip_community_list_standard_cmd,
11499 "ip community-list <1-99> (deny|permit) .AA:NN",
11502 "Community list number (standard)\n"
11503 "Specify community to reject\n"
11504 "Specify community to accept\n"
11507 return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 0);
11510 ALIAS (ip_community_list_standard,
11511 ip_community_list_standard2_cmd,
11512 "ip community-list <1-99> (deny|permit)",
11515 "Community list number (standard)\n"
11516 "Specify community to reject\n"
11517 "Specify community to accept\n")
11519 DEFUN (ip_community_list_expanded,
11520 ip_community_list_expanded_cmd,
11521 "ip community-list <100-500> (deny|permit) .LINE",
11524 "Community list number (expanded)\n"
11525 "Specify community to reject\n"
11526 "Specify community to accept\n"
11527 "An ordered list as a regular-expression\n")
11529 return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 0);
11532 DEFUN (ip_community_list_name_standard,
11533 ip_community_list_name_standard_cmd,
11534 "ip community-list standard WORD (deny|permit) .AA:NN",
11537 "Add a standard community-list entry\n"
11538 "Community list name\n"
11539 "Specify community to reject\n"
11540 "Specify community to accept\n"
11543 return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 1);
11546 ALIAS (ip_community_list_name_standard,
11547 ip_community_list_name_standard2_cmd,
11548 "ip community-list standard WORD (deny|permit)",
11551 "Add a standard community-list entry\n"
11552 "Community list name\n"
11553 "Specify community to reject\n"
11554 "Specify community to accept\n")
11556 DEFUN (ip_community_list_name_expanded,
11557 ip_community_list_name_expanded_cmd,
11558 "ip community-list expanded WORD (deny|permit) .LINE",
11561 "Add an expanded community-list entry\n"
11562 "Community list name\n"
11563 "Specify community to reject\n"
11564 "Specify community to accept\n"
11565 "An ordered list as a regular-expression\n")
11567 return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 1);
11570 DEFUN (no_ip_community_list_standard_all,
11571 no_ip_community_list_standard_all_cmd,
11572 "no ip community-list <1-99>",
11576 "Community list number (standard)\n")
11578 return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
11581 DEFUN (no_ip_community_list_expanded_all,
11582 no_ip_community_list_expanded_all_cmd,
11583 "no ip community-list <100-500>",
11587 "Community list number (expanded)\n")
11589 return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
11592 DEFUN (no_ip_community_list_name_standard_all,
11593 no_ip_community_list_name_standard_all_cmd,
11594 "no ip community-list standard WORD",
11598 "Add a standard community-list entry\n"
11599 "Community list name\n")
11601 return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
11604 DEFUN (no_ip_community_list_name_expanded_all,
11605 no_ip_community_list_name_expanded_all_cmd,
11606 "no ip community-list expanded WORD",
11610 "Add an expanded community-list entry\n"
11611 "Community list name\n")
11613 return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
11616 DEFUN (no_ip_community_list_standard,
11617 no_ip_community_list_standard_cmd,
11618 "no ip community-list <1-99> (deny|permit) .AA:NN",
11622 "Community list number (standard)\n"
11623 "Specify community to reject\n"
11624 "Specify community to accept\n"
11627 return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
11630 DEFUN (no_ip_community_list_expanded,
11631 no_ip_community_list_expanded_cmd,
11632 "no ip community-list <100-500> (deny|permit) .LINE",
11636 "Community list number (expanded)\n"
11637 "Specify community to reject\n"
11638 "Specify community to accept\n"
11639 "An ordered list as a regular-expression\n")
11641 return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
11644 DEFUN (no_ip_community_list_name_standard,
11645 no_ip_community_list_name_standard_cmd,
11646 "no ip community-list standard WORD (deny|permit) .AA:NN",
11650 "Specify a standard community-list\n"
11651 "Community list name\n"
11652 "Specify community to reject\n"
11653 "Specify community to accept\n"
11656 return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
11659 DEFUN (no_ip_community_list_name_expanded,
11660 no_ip_community_list_name_expanded_cmd,
11661 "no ip community-list expanded WORD (deny|permit) .LINE",
11665 "Specify an expanded community-list\n"
11666 "Community list name\n"
11667 "Specify community to reject\n"
11668 "Specify community to accept\n"
11669 "An ordered list as a regular-expression\n")
11671 return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
11675 community_list_show (struct vty *vty, struct community_list *list)
11677 struct community_entry *entry;
11679 for (entry = list->head; entry; entry = entry->next)
11681 if (entry == list->head)
11683 if (all_digit (list->name))
11684 vty_out (vty, "Community %s list %s%s",
11685 entry->style == COMMUNITY_LIST_STANDARD ?
11686 "standard" : "(expanded) access",
11687 list->name, VTY_NEWLINE);
11689 vty_out (vty, "Named Community %s list %s%s",
11690 entry->style == COMMUNITY_LIST_STANDARD ?
11691 "standard" : "expanded",
11692 list->name, VTY_NEWLINE);
11695 vty_out (vty, " %s%s",
11696 community_direct_str (entry->direct), VTY_NEWLINE);
11698 vty_out (vty, " %s %s%s",
11699 community_direct_str (entry->direct),
11700 entry->style == COMMUNITY_LIST_STANDARD
11701 ? community_str (entry->u.com) : entry->config,
11706 DEFUN (show_ip_community_list,
11707 show_ip_community_list_cmd,
11708 "show ip community-list",
11711 "List community-list\n")
11713 struct community_list *list;
11714 struct community_list_master *cm;
11716 cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER);
11718 return CMD_SUCCESS;
11720 for (list = cm->num.head; list; list = list->next)
11721 community_list_show (vty, list);
11723 for (list = cm->str.head; list; list = list->next)
11724 community_list_show (vty, list);
11726 return CMD_SUCCESS;
11729 DEFUN (show_ip_community_list_arg,
11730 show_ip_community_list_arg_cmd,
11731 "show ip community-list (<1-500>|WORD)",
11734 "List community-list\n"
11735 "Community-list number\n"
11736 "Community-list name\n")
11738 struct community_list *list;
11740 list = community_list_lookup (bgp_clist, argv[0], COMMUNITY_LIST_MASTER);
11743 vty_out (vty, "%% Can't find community-list%s", VTY_NEWLINE);
11744 return CMD_WARNING;
11747 community_list_show (vty, list);
11749 return CMD_SUCCESS;
11753 * Large Community code.
11756 lcommunity_list_set_vty (struct vty *vty, int argc, const char **argv,
11757 int style, int reject_all_digit_name)
11763 /* Check the list type. */
11764 if (strncmp (argv[1], "p", 1) == 0)
11765 direct = COMMUNITY_PERMIT;
11766 else if (strncmp (argv[1], "d", 1) == 0)
11767 direct = COMMUNITY_DENY;
11770 vty_out (vty, "%% Matching condition must be permit or deny%s",
11772 return CMD_WARNING;
11775 /* All digit name check. */
11776 if (reject_all_digit_name && all_digit (argv[0]))
11778 vty_out (vty, "%% Community name cannot have all digits%s", VTY_NEWLINE);
11779 return CMD_WARNING;
11782 /* Concat community string argument. */
11784 str = argv_concat (argv, argc, 2);
11788 ret = lcommunity_list_set (bgp_clist, argv[0], str, direct, style);
11790 /* Free temporary community list string allocated by
11793 XFREE (MTYPE_TMP, str);
11797 community_list_perror (vty, ret);
11798 return CMD_WARNING;
11800 return CMD_SUCCESS;
11804 lcommunity_list_unset_vty (struct vty *vty, int argc, const char **argv,
11813 /* Check the list direct. */
11814 if (strncmp (argv[1], "p", 1) == 0)
11815 direct = COMMUNITY_PERMIT;
11816 else if (strncmp (argv[1], "d", 1) == 0)
11817 direct = COMMUNITY_DENY;
11820 vty_out (vty, "%% Matching condition must be permit or deny%s",
11822 return CMD_WARNING;
11825 /* Concat community string argument. */
11826 str = argv_concat (argv, argc, 2);
11829 /* Unset community list. */
11830 ret = lcommunity_list_unset (bgp_clist, argv[0], str, direct, style);
11832 /* Free temporary community list string allocated by
11835 XFREE (MTYPE_TMP, str);
11839 community_list_perror (vty, ret);
11840 return CMD_WARNING;
11843 return CMD_SUCCESS;
11846 /* "large-community-list" keyword help string. */
11847 #define LCOMMUNITY_LIST_STR "Add a large community list entry\n"
11848 #define LCOMMUNITY_VAL_STR "large community in 'aa:bb:cc' format\n"
11850 DEFUN (ip_lcommunity_list_standard,
11851 ip_lcommunity_list_standard_cmd,
11852 "ip large-community-list <1-99> (deny|permit) .AA:BB:CC",
11854 LCOMMUNITY_LIST_STR
11855 "Large Community list number (standard)\n"
11856 "Specify large community to reject\n"
11857 "Specify large community to accept\n"
11858 LCOMMUNITY_VAL_STR)
11860 return lcommunity_list_set_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_STANDARD, 0);
11863 ALIAS (ip_lcommunity_list_standard,
11864 ip_lcommunity_list_standard2_cmd,
11865 "ip large-community-list <1-99> (deny|permit)",
11867 LCOMMUNITY_LIST_STR
11868 "Large Community list number (standard)\n"
11869 "Specify large community to reject\n"
11870 "Specify large community to accept\n")
11872 DEFUN (ip_lcommunity_list_expanded,
11873 ip_lcommunity_list_expanded_cmd,
11874 "ip large-community-list <100-500> (deny|permit) .LINE",
11876 LCOMMUNITY_LIST_STR
11877 "Large Community list number (expanded)\n"
11878 "Specify large community to reject\n"
11879 "Specify large community to accept\n"
11880 "An ordered list as a regular-expression\n")
11882 return lcommunity_list_set_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_EXPANDED, 0);
11885 DEFUN (ip_lcommunity_list_name_standard,
11886 ip_lcommunity_list_name_standard_cmd,
11887 "ip large-community-list standard WORD (deny|permit) .AA:BB.CC",
11889 LCOMMUNITY_LIST_STR
11890 "Specify standard large-community-list\n"
11891 "Large Community list name\n"
11892 "Specify large community to reject\n"
11893 "Specify large community to accept\n"
11894 LCOMMUNITY_VAL_STR)
11896 return lcommunity_list_set_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_STANDARD, 1);
11899 ALIAS (ip_lcommunity_list_name_standard,
11900 ip_lcommunity_list_name_standard2_cmd,
11901 "ip large-community-list standard WORD (deny|permit)",
11903 LCOMMUNITY_LIST_STR
11904 "Specify standard large-community-list\n"
11905 "Large Community list name\n"
11906 "Specify large community to reject\n"
11907 "Specify large community to accept\n")
11909 DEFUN (ip_lcommunity_list_name_expanded,
11910 ip_lcommunity_list_name_expanded_cmd,
11911 "ip large-community-list expanded WORD (deny|permit) .LINE",
11913 LCOMMUNITY_LIST_STR
11914 "Specify expanded large-community-list\n"
11915 "Large Community list name\n"
11916 "Specify large community to reject\n"
11917 "Specify large community to accept\n"
11918 "An ordered list as a regular-expression\n")
11920 return lcommunity_list_set_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_EXPANDED, 1);
11923 DEFUN (no_ip_lcommunity_list_standard_all,
11924 no_ip_lcommunity_list_standard_all_cmd,
11925 "no ip large-community-list <1-99>",
11928 LCOMMUNITY_LIST_STR
11929 "Large Community list number (standard)\n")
11931 return lcommunity_list_unset_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_STANDARD);
11934 DEFUN (no_ip_lcommunity_list_expanded_all,
11935 no_ip_lcommunity_list_expanded_all_cmd,
11936 "no ip large-community-list <100-500>",
11939 LCOMMUNITY_LIST_STR
11940 "Large Community list number (expanded)\n")
11942 return lcommunity_list_unset_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_EXPANDED);
11945 DEFUN (no_ip_lcommunity_list_name_standard_all,
11946 no_ip_lcommunity_list_name_standard_all_cmd,
11947 "no ip large-community-list standard WORD",
11950 LCOMMUNITY_LIST_STR
11951 "Specify standard large-community-list\n"
11952 "Large Community list name\n")
11954 return lcommunity_list_unset_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_STANDARD);
11957 DEFUN (no_ip_lcommunity_list_name_expanded_all,
11958 no_ip_lcommunity_list_name_expanded_all_cmd,
11959 "no ip large-community-list expanded WORD",
11962 LCOMMUNITY_LIST_STR
11963 "Specify expanded large-community-list\n"
11964 "Large Community list name\n")
11966 return lcommunity_list_unset_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_EXPANDED);
11969 DEFUN (no_ip_lcommunity_list_standard,
11970 no_ip_lcommunity_list_standard_cmd,
11971 "no ip large-community-list <1-99> (deny|permit) .AA:.AA:NN",
11974 LCOMMUNITY_LIST_STR
11975 "Large Community list number (standard)\n"
11976 "Specify large community to reject\n"
11977 "Specify large community to accept\n"
11978 LCOMMUNITY_VAL_STR)
11980 return lcommunity_list_unset_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_STANDARD);
11983 DEFUN (no_ip_lcommunity_list_expanded,
11984 no_ip_lcommunity_list_expanded_cmd,
11985 "no ip large-community-list <100-500> (deny|permit) .LINE",
11988 LCOMMUNITY_LIST_STR
11989 "Large Community list number (expanded)\n"
11990 "Specify large community to reject\n"
11991 "Specify large community to accept\n"
11992 "An ordered list as a regular-expression\n")
11994 return lcommunity_list_unset_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_EXPANDED);
11997 DEFUN (no_ip_lcommunity_list_name_standard,
11998 no_ip_lcommunity_list_name_standard_cmd,
11999 "no ip large-community-list standard WORD (deny|permit) .AA:.AA:NN",
12002 LCOMMUNITY_LIST_STR
12003 "Specify standard large-community-list\n"
12004 "Large Community list name\n"
12005 "Specify large community to reject\n"
12006 "Specify large community to accept\n"
12007 LCOMMUNITY_VAL_STR)
12009 return lcommunity_list_unset_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_STANDARD);
12012 DEFUN (no_ip_lcommunity_list_name_expanded,
12013 no_ip_lcommunity_list_name_expanded_cmd,
12014 "no ip large-community-list expanded WORD (deny|permit) .LINE",
12017 LCOMMUNITY_LIST_STR
12018 "Specify expanded large-community-list\n"
12019 "Large community list name\n"
12020 "Specify large community to reject\n"
12021 "Specify large community to accept\n"
12022 "An ordered list as a regular-expression\n")
12024 return lcommunity_list_unset_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_EXPANDED);
12028 lcommunity_list_show (struct vty *vty, struct community_list *list)
12030 struct community_entry *entry;
12032 for (entry = list->head; entry; entry = entry->next)
12034 if (entry == list->head)
12036 if (all_digit (list->name))
12037 vty_out (vty, "Large community %s list %s%s",
12038 entry->style == EXTCOMMUNITY_LIST_STANDARD ?
12039 "standard" : "(expanded) access",
12040 list->name, VTY_NEWLINE);
12042 vty_out (vty, "Named large community %s list %s%s",
12043 entry->style == EXTCOMMUNITY_LIST_STANDARD ?
12044 "standard" : "expanded",
12045 list->name, VTY_NEWLINE);
12048 vty_out (vty, " %s%s",
12049 community_direct_str (entry->direct), VTY_NEWLINE);
12051 vty_out (vty, " %s %s%s",
12052 community_direct_str (entry->direct),
12053 entry->style == EXTCOMMUNITY_LIST_STANDARD ?
12054 entry->u.ecom->str : entry->config,
12059 DEFUN (show_ip_lcommunity_list,
12060 show_ip_lcommunity_list_cmd,
12061 "show ip large-community-list",
12064 "List large-community list\n")
12066 struct community_list *list;
12067 struct community_list_master *cm;
12069 cm = community_list_master_lookup (bgp_clist, LARGE_COMMUNITY_LIST_MASTER);
12071 return CMD_SUCCESS;
12073 for (list = cm->num.head; list; list = list->next)
12074 lcommunity_list_show (vty, list);
12076 for (list = cm->str.head; list; list = list->next)
12077 lcommunity_list_show (vty, list);
12079 return CMD_SUCCESS;
12082 DEFUN (show_ip_lcommunity_list_arg,
12083 show_ip_lcommunity_list_arg_cmd,
12084 "show ip large-community-list (<1-500>|WORD)",
12087 "List large-community list\n"
12088 "large-community-list number\n"
12089 "large-community-list name\n")
12091 struct community_list *list;
12093 list = community_list_lookup (bgp_clist, argv[0], LARGE_COMMUNITY_LIST_MASTER);
12096 vty_out (vty, "%% Can't find extcommunity-list%s", VTY_NEWLINE);
12097 return CMD_WARNING;
12100 lcommunity_list_show (vty, list);
12102 return CMD_SUCCESS;
12106 extcommunity_list_set_vty (struct vty *vty, int argc, const char **argv,
12107 int style, int reject_all_digit_name)
12113 /* Check the list type. */
12114 if (strncmp (argv[1], "p", 1) == 0)
12115 direct = COMMUNITY_PERMIT;
12116 else if (strncmp (argv[1], "d", 1) == 0)
12117 direct = COMMUNITY_DENY;
12120 vty_out (vty, "%% Matching condition must be permit or deny%s",
12122 return CMD_WARNING;
12125 /* All digit name check. */
12126 if (reject_all_digit_name && all_digit (argv[0]))
12128 vty_out (vty, "%% Community name cannot have all digits%s", VTY_NEWLINE);
12129 return CMD_WARNING;
12132 /* Concat community string argument. */
12134 str = argv_concat (argv, argc, 2);
12138 ret = extcommunity_list_set (bgp_clist, argv[0], str, direct, style);
12140 /* Free temporary community list string allocated by
12143 XFREE (MTYPE_TMP, str);
12147 community_list_perror (vty, ret);
12148 return CMD_WARNING;
12150 return CMD_SUCCESS;
12154 extcommunity_list_unset_vty (struct vty *vty, int argc, const char **argv,
12163 /* Check the list direct. */
12164 if (strncmp (argv[1], "p", 1) == 0)
12165 direct = COMMUNITY_PERMIT;
12166 else if (strncmp (argv[1], "d", 1) == 0)
12167 direct = COMMUNITY_DENY;
12170 vty_out (vty, "%% Matching condition must be permit or deny%s",
12172 return CMD_WARNING;
12175 /* Concat community string argument. */
12176 str = argv_concat (argv, argc, 2);
12179 /* Unset community list. */
12180 ret = extcommunity_list_unset (bgp_clist, argv[0], str, direct, style);
12182 /* Free temporary community list string allocated by
12185 XFREE (MTYPE_TMP, str);
12189 community_list_perror (vty, ret);
12190 return CMD_WARNING;
12193 return CMD_SUCCESS;
12196 /* "extcommunity-list" keyword help string. */
12197 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
12198 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
12200 DEFUN (ip_extcommunity_list_standard,
12201 ip_extcommunity_list_standard_cmd,
12202 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
12204 EXTCOMMUNITY_LIST_STR
12205 "Extended Community list number (standard)\n"
12206 "Specify community to reject\n"
12207 "Specify community to accept\n"
12208 EXTCOMMUNITY_VAL_STR)
12210 return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 0);
12213 ALIAS (ip_extcommunity_list_standard,
12214 ip_extcommunity_list_standard2_cmd,
12215 "ip extcommunity-list <1-99> (deny|permit)",
12217 EXTCOMMUNITY_LIST_STR
12218 "Extended Community list number (standard)\n"
12219 "Specify community to reject\n"
12220 "Specify community to accept\n")
12222 DEFUN (ip_extcommunity_list_expanded,
12223 ip_extcommunity_list_expanded_cmd,
12224 "ip extcommunity-list <100-500> (deny|permit) .LINE",
12226 EXTCOMMUNITY_LIST_STR
12227 "Extended Community list number (expanded)\n"
12228 "Specify community to reject\n"
12229 "Specify community to accept\n"
12230 "An ordered list as a regular-expression\n")
12232 return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 0);
12235 DEFUN (ip_extcommunity_list_name_standard,
12236 ip_extcommunity_list_name_standard_cmd,
12237 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
12239 EXTCOMMUNITY_LIST_STR
12240 "Specify standard extcommunity-list\n"
12241 "Extended Community list name\n"
12242 "Specify community to reject\n"
12243 "Specify community to accept\n"
12244 EXTCOMMUNITY_VAL_STR)
12246 return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 1);
12249 ALIAS (ip_extcommunity_list_name_standard,
12250 ip_extcommunity_list_name_standard2_cmd,
12251 "ip extcommunity-list standard WORD (deny|permit)",
12253 EXTCOMMUNITY_LIST_STR
12254 "Specify standard extcommunity-list\n"
12255 "Extended Community list name\n"
12256 "Specify community to reject\n"
12257 "Specify community to accept\n")
12259 DEFUN (ip_extcommunity_list_name_expanded,
12260 ip_extcommunity_list_name_expanded_cmd,
12261 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
12263 EXTCOMMUNITY_LIST_STR
12264 "Specify expanded extcommunity-list\n"
12265 "Extended Community list name\n"
12266 "Specify community to reject\n"
12267 "Specify community to accept\n"
12268 "An ordered list as a regular-expression\n")
12270 return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 1);
12273 DEFUN (no_ip_extcommunity_list_standard_all,
12274 no_ip_extcommunity_list_standard_all_cmd,
12275 "no ip extcommunity-list <1-99>",
12278 EXTCOMMUNITY_LIST_STR
12279 "Extended Community list number (standard)\n")
12281 return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
12284 DEFUN (no_ip_extcommunity_list_expanded_all,
12285 no_ip_extcommunity_list_expanded_all_cmd,
12286 "no ip extcommunity-list <100-500>",
12289 EXTCOMMUNITY_LIST_STR
12290 "Extended Community list number (expanded)\n")
12292 return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
12295 DEFUN (no_ip_extcommunity_list_name_standard_all,
12296 no_ip_extcommunity_list_name_standard_all_cmd,
12297 "no ip extcommunity-list standard WORD",
12300 EXTCOMMUNITY_LIST_STR
12301 "Specify standard extcommunity-list\n"
12302 "Extended Community list name\n")
12304 return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
12307 DEFUN (no_ip_extcommunity_list_name_expanded_all,
12308 no_ip_extcommunity_list_name_expanded_all_cmd,
12309 "no ip extcommunity-list expanded WORD",
12312 EXTCOMMUNITY_LIST_STR
12313 "Specify expanded extcommunity-list\n"
12314 "Extended Community list name\n")
12316 return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
12319 DEFUN (no_ip_extcommunity_list_standard,
12320 no_ip_extcommunity_list_standard_cmd,
12321 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
12324 EXTCOMMUNITY_LIST_STR
12325 "Extended Community list number (standard)\n"
12326 "Specify community to reject\n"
12327 "Specify community to accept\n"
12328 EXTCOMMUNITY_VAL_STR)
12330 return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
12333 DEFUN (no_ip_extcommunity_list_expanded,
12334 no_ip_extcommunity_list_expanded_cmd,
12335 "no ip extcommunity-list <100-500> (deny|permit) .LINE",
12338 EXTCOMMUNITY_LIST_STR
12339 "Extended Community list number (expanded)\n"
12340 "Specify community to reject\n"
12341 "Specify community to accept\n"
12342 "An ordered list as a regular-expression\n")
12344 return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
12347 DEFUN (no_ip_extcommunity_list_name_standard,
12348 no_ip_extcommunity_list_name_standard_cmd,
12349 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
12352 EXTCOMMUNITY_LIST_STR
12353 "Specify standard extcommunity-list\n"
12354 "Extended Community list name\n"
12355 "Specify community to reject\n"
12356 "Specify community to accept\n"
12357 EXTCOMMUNITY_VAL_STR)
12359 return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
12362 DEFUN (no_ip_extcommunity_list_name_expanded,
12363 no_ip_extcommunity_list_name_expanded_cmd,
12364 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
12367 EXTCOMMUNITY_LIST_STR
12368 "Specify expanded extcommunity-list\n"
12369 "Community list name\n"
12370 "Specify community to reject\n"
12371 "Specify community to accept\n"
12372 "An ordered list as a regular-expression\n")
12374 return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
12378 extcommunity_list_show (struct vty *vty, struct community_list *list)
12380 struct community_entry *entry;
12382 for (entry = list->head; entry; entry = entry->next)
12384 if (entry == list->head)
12386 if (all_digit (list->name))
12387 vty_out (vty, "Extended community %s list %s%s",
12388 entry->style == EXTCOMMUNITY_LIST_STANDARD ?
12389 "standard" : "(expanded) access",
12390 list->name, VTY_NEWLINE);
12392 vty_out (vty, "Named extended community %s list %s%s",
12393 entry->style == EXTCOMMUNITY_LIST_STANDARD ?
12394 "standard" : "expanded",
12395 list->name, VTY_NEWLINE);
12398 vty_out (vty, " %s%s",
12399 community_direct_str (entry->direct), VTY_NEWLINE);
12401 vty_out (vty, " %s %s%s",
12402 community_direct_str (entry->direct),
12403 entry->style == EXTCOMMUNITY_LIST_STANDARD ?
12404 entry->u.ecom->str : entry->config,
12409 DEFUN (show_ip_extcommunity_list,
12410 show_ip_extcommunity_list_cmd,
12411 "show ip extcommunity-list",
12414 "List extended-community list\n")
12416 struct community_list *list;
12417 struct community_list_master *cm;
12419 cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER);
12421 return CMD_SUCCESS;
12423 for (list = cm->num.head; list; list = list->next)
12424 extcommunity_list_show (vty, list);
12426 for (list = cm->str.head; list; list = list->next)
12427 extcommunity_list_show (vty, list);
12429 return CMD_SUCCESS;
12432 DEFUN (show_ip_extcommunity_list_arg,
12433 show_ip_extcommunity_list_arg_cmd,
12434 "show ip extcommunity-list (<1-500>|WORD)",
12437 "List extended-community list\n"
12438 "Extcommunity-list number\n"
12439 "Extcommunity-list name\n")
12441 struct community_list *list;
12443 list = community_list_lookup (bgp_clist, argv[0], EXTCOMMUNITY_LIST_MASTER);
12446 vty_out (vty, "%% Can't find extcommunity-list%s", VTY_NEWLINE);
12447 return CMD_WARNING;
12450 extcommunity_list_show (vty, list);
12452 return CMD_SUCCESS;
12455 /* Return configuration string of community-list entry. */
12456 static const char *
12457 community_list_config_str (struct community_entry *entry)
12465 if (entry->style == COMMUNITY_LIST_STANDARD)
12466 str = community_str (entry->u.com);
12468 str = entry->config;
12473 /* Display community-list and extcommunity-list configuration. */
12475 community_list_config_write (struct vty *vty)
12477 struct community_list *list;
12478 struct community_entry *entry;
12479 struct community_list_master *cm;
12482 /* Community-list. */
12483 cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER);
12485 for (list = cm->num.head; list; list = list->next)
12486 for (entry = list->head; entry; entry = entry->next)
12488 vty_out (vty, "ip community-list %s %s %s%s",
12489 list->name, community_direct_str (entry->direct),
12490 community_list_config_str (entry),
12494 for (list = cm->str.head; list; list = list->next)
12495 for (entry = list->head; entry; entry = entry->next)
12497 vty_out (vty, "ip community-list %s %s %s %s%s",
12498 entry->style == COMMUNITY_LIST_STANDARD
12499 ? "standard" : "expanded",
12500 list->name, community_direct_str (entry->direct),
12501 community_list_config_str (entry),
12506 /* Extcommunity-list. */
12507 cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER);
12509 for (list = cm->num.head; list; list = list->next)
12510 for (entry = list->head; entry; entry = entry->next)
12512 vty_out (vty, "ip extcommunity-list %s %s %s%s",
12513 list->name, community_direct_str (entry->direct),
12514 community_list_config_str (entry), VTY_NEWLINE);
12517 for (list = cm->str.head; list; list = list->next)
12518 for (entry = list->head; entry; entry = entry->next)
12520 vty_out (vty, "ip extcommunity-list %s %s %s %s%s",
12521 entry->style == EXTCOMMUNITY_LIST_STANDARD
12522 ? "standard" : "expanded",
12523 list->name, community_direct_str (entry->direct),
12524 community_list_config_str (entry), VTY_NEWLINE);
12529 /* lcommunity-list. */
12530 cm = community_list_master_lookup (bgp_clist, LARGE_COMMUNITY_LIST_MASTER);
12532 for (list = cm->num.head; list; list = list->next)
12533 for (entry = list->head; entry; entry = entry->next)
12535 vty_out (vty, "ip large-community-list %s %s %s%s",
12536 list->name, community_direct_str (entry->direct),
12537 community_list_config_str (entry), VTY_NEWLINE);
12540 for (list = cm->str.head; list; list = list->next)
12541 for (entry = list->head; entry; entry = entry->next)
12543 vty_out (vty, "ip large-community-list %s %s %s %s%s",
12544 entry->style == LARGE_COMMUNITY_LIST_STANDARD
12545 ? "standard" : "expanded",
12546 list->name, community_direct_str (entry->direct),
12547 community_list_config_str (entry), VTY_NEWLINE);
12554 static struct cmd_node community_list_node =
12556 COMMUNITY_LIST_NODE,
12558 1 /* Export to vtysh. */
12562 community_list_vty (void)
12564 install_node (&community_list_node, community_list_config_write);
12566 /* Community-list. */
12567 install_element (CONFIG_NODE, &ip_community_list_standard_cmd);
12568 install_element (CONFIG_NODE, &ip_community_list_standard2_cmd);
12569 install_element (CONFIG_NODE, &ip_community_list_expanded_cmd);
12570 install_element (CONFIG_NODE, &ip_community_list_name_standard_cmd);
12571 install_element (CONFIG_NODE, &ip_community_list_name_standard2_cmd);
12572 install_element (CONFIG_NODE, &ip_community_list_name_expanded_cmd);
12573 install_element (CONFIG_NODE, &no_ip_community_list_standard_all_cmd);
12574 install_element (CONFIG_NODE, &no_ip_community_list_expanded_all_cmd);
12575 install_element (CONFIG_NODE, &no_ip_community_list_name_standard_all_cmd);
12576 install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_all_cmd);
12577 install_element (CONFIG_NODE, &no_ip_community_list_standard_cmd);
12578 install_element (CONFIG_NODE, &no_ip_community_list_expanded_cmd);
12579 install_element (CONFIG_NODE, &no_ip_community_list_name_standard_cmd);
12580 install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_cmd);
12581 install_element (VIEW_NODE, &show_ip_community_list_cmd);
12582 install_element (VIEW_NODE, &show_ip_community_list_arg_cmd);
12584 /* Extcommunity-list. */
12585 install_element (CONFIG_NODE, &ip_extcommunity_list_standard_cmd);
12586 install_element (CONFIG_NODE, &ip_extcommunity_list_standard2_cmd);
12587 install_element (CONFIG_NODE, &ip_extcommunity_list_expanded_cmd);
12588 install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard_cmd);
12589 install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard2_cmd);
12590 install_element (CONFIG_NODE, &ip_extcommunity_list_name_expanded_cmd);
12591 install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_all_cmd);
12592 install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_all_cmd);
12593 install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_all_cmd);
12594 install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_all_cmd);
12595 install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_cmd);
12596 install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_cmd);
12597 install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_cmd);
12598 install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_cmd);
12599 install_element (VIEW_NODE, &show_ip_extcommunity_list_cmd);
12600 install_element (VIEW_NODE, &show_ip_extcommunity_list_arg_cmd);
12602 /* Large Community List */
12603 install_element (CONFIG_NODE, &ip_lcommunity_list_standard_cmd);
12604 install_element (CONFIG_NODE, &ip_lcommunity_list_standard2_cmd);
12605 install_element (CONFIG_NODE, &ip_lcommunity_list_expanded_cmd);
12606 install_element (CONFIG_NODE, &ip_lcommunity_list_name_standard_cmd);
12607 install_element (CONFIG_NODE, &ip_lcommunity_list_name_standard2_cmd);
12608 install_element (CONFIG_NODE, &ip_lcommunity_list_name_expanded_cmd);
12609 install_element (CONFIG_NODE, &no_ip_lcommunity_list_standard_all_cmd);
12610 install_element (CONFIG_NODE, &no_ip_lcommunity_list_expanded_all_cmd);
12611 install_element (CONFIG_NODE, &no_ip_lcommunity_list_name_standard_all_cmd);
12612 install_element (CONFIG_NODE, &no_ip_lcommunity_list_name_expanded_all_cmd);
12613 install_element (CONFIG_NODE, &no_ip_lcommunity_list_standard_cmd);
12614 install_element (CONFIG_NODE, &no_ip_lcommunity_list_expanded_cmd);
12615 install_element (CONFIG_NODE, &no_ip_lcommunity_list_name_standard_cmd);
12616 install_element (CONFIG_NODE, &no_ip_lcommunity_list_name_expanded_cmd);
12617 install_element (VIEW_NODE, &show_ip_lcommunity_list_cmd);
12618 install_element (VIEW_NODE, &show_ip_lcommunity_list_arg_cmd);