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
34 #include "bgpd/bgpd.h"
35 #include "bgpd/bgp_advertise.h"
36 #include "bgpd/bgp_attr.h"
37 #include "bgpd/bgp_aspath.h"
38 #include "bgpd/bgp_community.h"
39 #include "bgpd/bgp_ecommunity.h"
40 #include "bgpd/bgp_damp.h"
41 #include "bgpd/bgp_debug.h"
42 #include "bgpd/bgp_fsm.h"
43 #include "bgpd/bgp_mplsvpn.h"
44 #include "bgpd/bgp_nexthop.h"
45 #include "bgpd/bgp_open.h"
46 #include "bgpd/bgp_regex.h"
47 #include "bgpd/bgp_route.h"
48 #include "bgpd/bgp_zebra.h"
49 #include "bgpd/bgp_table.h"
50 #include "bgpd/bgp_vty.h"
51 #include "bgpd/bgp_mpath.h"
53 extern struct in_addr router_id_zebra
;
55 /* Utility function to get address family from current node. */
57 bgp_node_afi (struct vty
*vty
)
59 if (vty
->node
== BGP_IPV6_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
64 /* Utility function to get subsequent address family from current
67 bgp_node_safi (struct vty
*vty
)
69 if (vty
->node
== BGP_VPNV4_NODE
)
71 if (vty
->node
== BGP_IPV4M_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
72 return SAFI_MULTICAST
;
77 peer_address_self_check (union sockunion
*su
)
79 struct interface
*ifp
= NULL
;
81 if (su
->sa
.sa_family
== AF_INET
)
82 ifp
= if_lookup_by_ipv4_exact (&su
->sin
.sin_addr
);
84 else if (su
->sa
.sa_family
== AF_INET6
)
85 ifp
= if_lookup_by_ipv6_exact (&su
->sin6
.sin6_addr
);
86 #endif /* HAVE IPV6 */
94 /* Utility function for looking up peer from VTY. */
96 peer_lookup_vty (struct vty
*vty
, const char *ip_str
)
105 ret
= str2sockunion (ip_str
, &su
);
108 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
112 peer
= peer_lookup (bgp
, &su
);
115 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s", VTY_NEWLINE
);
121 /* Utility function for looking up peer or peer group. */
123 peer_and_group_lookup_vty (struct vty
*vty
, const char *peer_str
)
129 struct peer_group
*group
;
133 ret
= str2sockunion (peer_str
, &su
);
136 peer
= peer_lookup (bgp
, &su
);
142 group
= peer_group_lookup (bgp
, peer_str
);
147 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
154 bgp_vty_return (struct vty
*vty
, int ret
)
156 const char *str
= NULL
;
160 case BGP_ERR_INVALID_VALUE
:
161 str
= "Invalid value";
163 case BGP_ERR_INVALID_FLAG
:
164 str
= "Invalid flag";
166 case BGP_ERR_PEER_INACTIVE
:
167 str
= "Activate the neighbor for the address family first";
169 case BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER
:
170 str
= "Invalid command for a peer-group member";
172 case BGP_ERR_PEER_GROUP_SHUTDOWN
:
173 str
= "Peer-group has been shutdown. Activate the peer-group first";
175 case BGP_ERR_PEER_GROUP_HAS_THE_FLAG
:
176 str
= "This peer is a peer-group member. Please change peer-group configuration";
178 case BGP_ERR_PEER_FLAG_CONFLICT
:
179 str
= "Can't set override-capability and strict-capability-match at the same time";
181 case BGP_ERR_PEER_GROUP_MEMBER_EXISTS
:
182 str
= "No activate for peergroup can be given only if peer-group has no members";
184 case BGP_ERR_PEER_BELONGS_TO_GROUP
:
185 str
= "No activate for an individual peer-group member is invalid";
187 case BGP_ERR_PEER_GROUP_AF_UNCONFIGURED
:
188 str
= "Activate the peer-group for the address family first";
190 case BGP_ERR_PEER_GROUP_NO_REMOTE_AS
:
191 str
= "Specify remote-as or peer-group remote AS first";
193 case BGP_ERR_PEER_GROUP_CANT_CHANGE
:
194 str
= "Cannot change the peer-group. Deconfigure first";
196 case BGP_ERR_PEER_GROUP_MISMATCH
:
197 str
= "Cannot have different peer-group for the neighbor";
199 case BGP_ERR_PEER_FILTER_CONFLICT
:
200 str
= "Prefix/distribute list can not co-exist";
202 case BGP_ERR_NOT_INTERNAL_PEER
:
203 str
= "Invalid command. Not an internal neighbor";
205 case BGP_ERR_REMOVE_PRIVATE_AS
:
206 str
= "Private AS cannot be removed for IBGP peers";
208 case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP
:
209 str
= "Local-AS allowed only for EBGP peers";
211 case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS
:
212 str
= "Cannot have local-as same as BGP AS number";
214 case BGP_ERR_TCPSIG_FAILED
:
215 str
= "Error while applying TCP-Sig to session(s)";
217 case BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK
:
218 str
= "ebgp-multihop and ttl-security cannot be configured together";
220 case BGP_ERR_NO_IBGP_WITH_TTLHACK
:
221 str
= "ttl-security only allowed for EBGP peers";
226 vty_out (vty
, "%% %s%s", str
, VTY_NEWLINE
);
232 /* BGP global configuration. */
234 DEFUN (bgp_multiple_instance_func
,
235 bgp_multiple_instance_cmd
,
236 "bgp multiple-instance",
238 "Enable bgp multiple instance\n")
240 bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE
);
244 DEFUN (no_bgp_multiple_instance
,
245 no_bgp_multiple_instance_cmd
,
246 "no bgp multiple-instance",
249 "BGP multiple instance\n")
253 ret
= bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE
);
256 vty_out (vty
, "%% There are more than two BGP instances%s", VTY_NEWLINE
);
262 DEFUN (bgp_config_type
,
264 "bgp config-type (cisco|zebra)",
266 "Configuration type\n"
270 if (strncmp (argv
[0], "c", 1) == 0)
271 bgp_option_set (BGP_OPT_CONFIG_CISCO
);
273 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
278 DEFUN (no_bgp_config_type
,
279 no_bgp_config_type_cmd
,
280 "no bgp config-type",
283 "Display configuration type\n")
285 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
289 DEFUN (no_synchronization
,
290 no_synchronization_cmd
,
291 "no synchronization",
293 "Perform IGP synchronization\n")
298 DEFUN (no_auto_summary
,
302 "Enable automatic network number summarization\n")
307 DEFUN_DEPRECATED (neighbor_version
,
308 neighbor_version_cmd
,
309 NEIGHBOR_CMD
"version (4|4-)",
312 "Set the BGP version to match a neighbor\n"
313 "Neighbor's BGP version\n")
318 /* "router bgp" commands. */
321 "router bgp " CMD_AS_RANGE
,
329 const char *name
= NULL
;
331 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
336 ret
= bgp_get (&bgp
, &as
, name
);
339 case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET
:
340 vty_out (vty
, "Please specify 'bgp multiple-instance' first%s",
343 case BGP_ERR_AS_MISMATCH
:
344 vty_out (vty
, "BGP is already running; AS is %u%s", as
, VTY_NEWLINE
);
346 case BGP_ERR_INSTANCE_MISMATCH
:
347 vty_out (vty
, "BGP view name and AS number mismatch%s", VTY_NEWLINE
);
348 vty_out (vty
, "BGP instance is already running; AS is %u%s",
353 vty
->node
= BGP_NODE
;
361 "router bgp " CMD_AS_RANGE
" view WORD",
368 /* "no router bgp" commands. */
369 DEFUN (no_router_bgp
,
371 "no router bgp " CMD_AS_RANGE
,
379 const char *name
= NULL
;
381 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
386 /* Lookup bgp structure. */
387 bgp
= bgp_lookup (as
, name
);
390 vty_out (vty
, "%% Can't find BGP instance%s", VTY_NEWLINE
);
399 ALIAS (no_router_bgp
,
400 no_router_bgp_view_cmd
,
401 "no router bgp " CMD_AS_RANGE
" view WORD",
411 DEFUN (bgp_router_id
,
413 "bgp router-id A.B.C.D",
415 "Override configured router identifier\n"
416 "Manually configured router identifier\n")
424 ret
= inet_aton (argv
[0], &id
);
427 vty_out (vty
, "%% Malformed bgp router identifier%s", VTY_NEWLINE
);
431 bgp
->router_id_static
= id
;
432 bgp_router_id_set (bgp
, &id
);
437 DEFUN (no_bgp_router_id
,
438 no_bgp_router_id_cmd
,
442 "Override configured router identifier\n")
452 ret
= inet_aton (argv
[0], &id
);
455 vty_out (vty
, "%% Malformed BGP router identifier%s", VTY_NEWLINE
);
459 if (! IPV4_ADDR_SAME (&bgp
->router_id_static
, &id
))
461 vty_out (vty
, "%% BGP router-id doesn't match%s", VTY_NEWLINE
);
466 bgp
->router_id_static
.s_addr
= 0;
467 bgp_router_id_set (bgp
, &router_id_zebra
);
472 ALIAS (no_bgp_router_id
,
473 no_bgp_router_id_val_cmd
,
474 "no bgp router-id A.B.C.D",
477 "Override configured router identifier\n"
478 "Manually configured router identifier\n")
480 /* BGP Cluster ID. */
482 DEFUN (bgp_cluster_id
,
484 "bgp cluster-id A.B.C.D",
486 "Configure Route-Reflector Cluster-id\n"
487 "Route-Reflector Cluster-id in IP address format\n")
491 struct in_addr cluster
;
495 ret
= inet_aton (argv
[0], &cluster
);
498 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
502 bgp_cluster_id_set (bgp
, &cluster
);
507 ALIAS (bgp_cluster_id
,
508 bgp_cluster_id32_cmd
,
509 "bgp cluster-id <1-4294967295>",
511 "Configure Route-Reflector Cluster-id\n"
512 "Route-Reflector Cluster-id as 32 bit quantity\n")
514 DEFUN (no_bgp_cluster_id
,
515 no_bgp_cluster_id_cmd
,
519 "Configure Route-Reflector Cluster-id\n")
523 struct in_addr cluster
;
529 ret
= inet_aton (argv
[0], &cluster
);
532 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
537 bgp_cluster_id_unset (bgp
);
542 ALIAS (no_bgp_cluster_id
,
543 no_bgp_cluster_id_arg_cmd
,
544 "no bgp cluster-id A.B.C.D",
547 "Configure Route-Reflector Cluster-id\n"
548 "Route-Reflector Cluster-id in IP address format\n")
550 DEFUN (bgp_confederation_identifier
,
551 bgp_confederation_identifier_cmd
,
552 "bgp confederation identifier " CMD_AS_RANGE
,
553 "BGP specific commands\n"
554 "AS confederation parameters\n"
556 "Set routing domain confederation AS\n")
563 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
565 bgp_confederation_id_set (bgp
, as
);
570 DEFUN (no_bgp_confederation_identifier
,
571 no_bgp_confederation_identifier_cmd
,
572 "no bgp confederation identifier",
574 "BGP specific commands\n"
575 "AS confederation parameters\n"
584 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
586 bgp_confederation_id_unset (bgp
);
591 ALIAS (no_bgp_confederation_identifier
,
592 no_bgp_confederation_identifier_arg_cmd
,
593 "no bgp confederation identifier " CMD_AS_RANGE
,
595 "BGP specific commands\n"
596 "AS confederation parameters\n"
598 "Set routing domain confederation AS\n")
600 DEFUN (bgp_confederation_peers
,
601 bgp_confederation_peers_cmd
,
602 "bgp confederation peers ." CMD_AS_RANGE
,
603 "BGP specific commands\n"
604 "AS confederation parameters\n"
605 "Peer ASs in BGP confederation\n"
614 for (i
= 0; i
< argc
; i
++)
616 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
620 vty_out (vty
, "%% Local member-AS not allowed in confed peer list%s",
625 bgp_confederation_peers_add (bgp
, as
);
630 DEFUN (no_bgp_confederation_peers
,
631 no_bgp_confederation_peers_cmd
,
632 "no bgp confederation peers ." CMD_AS_RANGE
,
634 "BGP specific commands\n"
635 "AS confederation parameters\n"
636 "Peer ASs in BGP confederation\n"
645 for (i
= 0; i
< argc
; i
++)
647 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
649 bgp_confederation_peers_remove (bgp
, as
);
654 /* Maximum-paths configuration */
657 "maximum-paths <1-255>",
658 "Forward packets over multiple paths\n"
667 VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths
, argv
[0], 1, 255);
669 ret
= bgp_maximum_paths_set (bgp
, bgp_node_afi (vty
), bgp_node_safi(vty
),
670 BGP_PEER_EBGP
, maxpaths
);
674 "%% Failed to set maximum-paths %u for afi %u, safi %u%s",
675 maxpaths
, bgp_node_afi (vty
), bgp_node_safi(vty
), VTY_NEWLINE
);
682 DEFUN (bgp_maxpaths_ibgp
,
683 bgp_maxpaths_ibgp_cmd
,
684 "maximum-paths ibgp <1-255>",
685 "Forward packets over multiple paths\n"
695 VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths
, argv
[0], 1, 255);
697 ret
= bgp_maximum_paths_set (bgp
, bgp_node_afi (vty
), bgp_node_safi(vty
),
698 BGP_PEER_IBGP
, maxpaths
);
702 "%% Failed to set maximum-paths ibgp %u for afi %u, safi %u%s",
703 maxpaths
, bgp_node_afi (vty
), bgp_node_safi(vty
), VTY_NEWLINE
);
710 DEFUN (no_bgp_maxpaths
,
714 "Forward packets over multiple paths\n"
722 ret
= bgp_maximum_paths_unset (bgp
, bgp_node_afi (vty
), bgp_node_safi(vty
),
727 "%% Failed to unset maximum-paths for afi %u, safi %u%s",
728 bgp_node_afi (vty
), bgp_node_safi(vty
), VTY_NEWLINE
);
735 ALIAS (no_bgp_maxpaths
,
736 no_bgp_maxpaths_arg_cmd
,
737 "no maximum-paths <1-255>",
739 "Forward packets over multiple paths\n"
742 DEFUN (no_bgp_maxpaths_ibgp
,
743 no_bgp_maxpaths_ibgp_cmd
,
744 "no maximum-paths ibgp",
746 "Forward packets over multiple paths\n"
755 ret
= bgp_maximum_paths_unset (bgp
, bgp_node_afi (vty
), bgp_node_safi(vty
),
760 "%% Failed to unset maximum-paths ibgp for afi %u, safi %u%s",
761 bgp_node_afi (vty
), bgp_node_safi(vty
), VTY_NEWLINE
);
768 ALIAS (no_bgp_maxpaths_ibgp
,
769 no_bgp_maxpaths_ibgp_arg_cmd
,
770 "no maximum-paths ibgp <1-255>",
772 "Forward packets over multiple paths\n"
777 bgp_config_write_maxpaths (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
778 safi_t safi
, int *write
)
780 if (bgp
->maxpaths
[afi
][safi
].maxpaths_ebgp
!= BGP_DEFAULT_MAXPATHS
)
782 bgp_config_write_family_header (vty
, afi
, safi
, write
);
783 vty_out (vty
, " maximum-paths %d%s",
784 bgp
->maxpaths
[afi
][safi
].maxpaths_ebgp
, VTY_NEWLINE
);
787 if (bgp
->maxpaths
[afi
][safi
].maxpaths_ibgp
!= BGP_DEFAULT_MAXPATHS
)
789 bgp_config_write_family_header (vty
, afi
, safi
, write
);
790 vty_out (vty
, " maximum-paths ibgp %d%s",
791 bgp
->maxpaths
[afi
][safi
].maxpaths_ibgp
, VTY_NEWLINE
);
801 "timers bgp <0-65535> <0-65535>",
802 "Adjust routing timers\n"
804 "Keepalive interval\n"
808 unsigned long keepalive
= 0;
809 unsigned long holdtime
= 0;
813 VTY_GET_INTEGER ("keepalive", keepalive
, argv
[0]);
814 VTY_GET_INTEGER ("holdtime", holdtime
, argv
[1]);
816 /* Holdtime value check. */
817 if (holdtime
< 3 && holdtime
!= 0)
819 vty_out (vty
, "%% hold time value must be either 0 or greater than 3%s",
824 bgp_timers_set (bgp
, keepalive
, holdtime
);
829 DEFUN (no_bgp_timers
,
833 "Adjust routing timers\n"
839 bgp_timers_unset (bgp
);
844 ALIAS (no_bgp_timers
,
845 no_bgp_timers_arg_cmd
,
846 "no timers bgp <0-65535> <0-65535>",
848 "Adjust routing timers\n"
850 "Keepalive interval\n"
853 DEFUN (bgp_client_to_client_reflection
,
854 bgp_client_to_client_reflection_cmd
,
855 "bgp client-to-client reflection",
856 "BGP specific commands\n"
857 "Configure client to client route reflection\n"
858 "reflection of routes allowed\n")
863 bgp_flag_unset (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
867 DEFUN (no_bgp_client_to_client_reflection
,
868 no_bgp_client_to_client_reflection_cmd
,
869 "no bgp client-to-client reflection",
871 "BGP specific commands\n"
872 "Configure client to client route reflection\n"
873 "reflection of routes allowed\n")
878 bgp_flag_set (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
882 /* "bgp always-compare-med" configuration. */
883 DEFUN (bgp_always_compare_med
,
884 bgp_always_compare_med_cmd
,
885 "bgp always-compare-med",
886 "BGP specific commands\n"
887 "Allow comparing MED from different neighbors\n")
892 bgp_flag_set (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
896 DEFUN (no_bgp_always_compare_med
,
897 no_bgp_always_compare_med_cmd
,
898 "no bgp always-compare-med",
900 "BGP specific commands\n"
901 "Allow comparing MED from different neighbors\n")
906 bgp_flag_unset (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
910 /* "bgp deterministic-med" configuration. */
911 DEFUN (bgp_deterministic_med
,
912 bgp_deterministic_med_cmd
,
913 "bgp deterministic-med",
914 "BGP specific commands\n"
915 "Pick the best-MED path among paths advertised from the neighboring AS\n")
920 bgp_flag_set (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
924 DEFUN (no_bgp_deterministic_med
,
925 no_bgp_deterministic_med_cmd
,
926 "no bgp deterministic-med",
928 "BGP specific commands\n"
929 "Pick the best-MED path among paths advertised from the neighboring AS\n")
934 bgp_flag_unset (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
938 /* "bgp graceful-restart" configuration. */
939 DEFUN (bgp_graceful_restart
,
940 bgp_graceful_restart_cmd
,
941 "bgp graceful-restart",
942 "BGP specific commands\n"
943 "Graceful restart capability parameters\n")
948 bgp_flag_set (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
952 DEFUN (no_bgp_graceful_restart
,
953 no_bgp_graceful_restart_cmd
,
954 "no bgp graceful-restart",
956 "BGP specific commands\n"
957 "Graceful restart capability parameters\n")
962 bgp_flag_unset (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
966 DEFUN (bgp_graceful_restart_stalepath_time
,
967 bgp_graceful_restart_stalepath_time_cmd
,
968 "bgp graceful-restart stalepath-time <1-3600>",
969 "BGP specific commands\n"
970 "Graceful restart capability parameters\n"
971 "Set the max time to hold onto restarting peer's stale paths\n"
972 "Delay value (seconds)\n")
981 VTY_GET_INTEGER_RANGE ("stalepath-time", stalepath
, argv
[0], 1, 3600);
982 bgp
->stalepath_time
= stalepath
;
986 DEFUN (no_bgp_graceful_restart_stalepath_time
,
987 no_bgp_graceful_restart_stalepath_time_cmd
,
988 "no bgp graceful-restart stalepath-time",
990 "BGP specific commands\n"
991 "Graceful restart capability parameters\n"
992 "Set the max time to hold onto restarting peer's stale paths\n")
1000 bgp
->stalepath_time
= BGP_DEFAULT_STALEPATH_TIME
;
1004 ALIAS (no_bgp_graceful_restart_stalepath_time
,
1005 no_bgp_graceful_restart_stalepath_time_val_cmd
,
1006 "no bgp graceful-restart stalepath-time <1-3600>",
1008 "BGP specific commands\n"
1009 "Graceful restart capability parameters\n"
1010 "Set the max time to hold onto restarting peer's stale paths\n"
1011 "Delay value (seconds)\n")
1013 /* "bgp fast-external-failover" configuration. */
1014 DEFUN (bgp_fast_external_failover
,
1015 bgp_fast_external_failover_cmd
,
1016 "bgp fast-external-failover",
1018 "Immediately reset session if a link to a directly connected external peer goes down\n")
1023 bgp_flag_unset (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
1027 DEFUN (no_bgp_fast_external_failover
,
1028 no_bgp_fast_external_failover_cmd
,
1029 "no bgp fast-external-failover",
1032 "Immediately reset session if a link to a directly connected external peer goes down\n")
1037 bgp_flag_set (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
1041 /* "bgp enforce-first-as" configuration. */
1042 DEFUN (bgp_enforce_first_as
,
1043 bgp_enforce_first_as_cmd
,
1044 "bgp enforce-first-as",
1046 "Enforce the first AS for EBGP routes\n")
1051 bgp_flag_set (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
1055 DEFUN (no_bgp_enforce_first_as
,
1056 no_bgp_enforce_first_as_cmd
,
1057 "no bgp enforce-first-as",
1060 "Enforce the first AS for EBGP routes\n")
1065 bgp_flag_unset (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
1069 /* "bgp bestpath compare-routerid" configuration. */
1070 DEFUN (bgp_bestpath_compare_router_id
,
1071 bgp_bestpath_compare_router_id_cmd
,
1072 "bgp bestpath compare-routerid",
1073 "BGP specific commands\n"
1074 "Change the default bestpath selection\n"
1075 "Compare router-id for identical EBGP paths\n")
1080 bgp_flag_set (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
1084 DEFUN (no_bgp_bestpath_compare_router_id
,
1085 no_bgp_bestpath_compare_router_id_cmd
,
1086 "no bgp bestpath compare-routerid",
1088 "BGP specific commands\n"
1089 "Change the default bestpath selection\n"
1090 "Compare router-id for identical EBGP paths\n")
1095 bgp_flag_unset (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
1099 /* "bgp bestpath as-path ignore" configuration. */
1100 DEFUN (bgp_bestpath_aspath_ignore
,
1101 bgp_bestpath_aspath_ignore_cmd
,
1102 "bgp bestpath as-path ignore",
1103 "BGP specific commands\n"
1104 "Change the default bestpath selection\n"
1105 "AS-path attribute\n"
1106 "Ignore as-path length in selecting a route\n")
1111 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_IGNORE
);
1115 DEFUN (no_bgp_bestpath_aspath_ignore
,
1116 no_bgp_bestpath_aspath_ignore_cmd
,
1117 "no bgp bestpath as-path ignore",
1119 "BGP specific commands\n"
1120 "Change the default bestpath selection\n"
1121 "AS-path attribute\n"
1122 "Ignore as-path length in selecting a route\n")
1127 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_IGNORE
);
1131 /* "bgp bestpath as-path confed" configuration. */
1132 DEFUN (bgp_bestpath_aspath_confed
,
1133 bgp_bestpath_aspath_confed_cmd
,
1134 "bgp bestpath as-path confed",
1135 "BGP specific commands\n"
1136 "Change the default bestpath selection\n"
1137 "AS-path attribute\n"
1138 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1143 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_CONFED
);
1147 DEFUN (no_bgp_bestpath_aspath_confed
,
1148 no_bgp_bestpath_aspath_confed_cmd
,
1149 "no bgp bestpath as-path confed",
1151 "BGP specific commands\n"
1152 "Change the default bestpath selection\n"
1153 "AS-path attribute\n"
1154 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1159 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_CONFED
);
1163 /* "bgp bestpath as-path multipath-relax" configuration. */
1164 DEFUN (bgp_bestpath_aspath_multipath_relax
,
1165 bgp_bestpath_aspath_multipath_relax_cmd
,
1166 "bgp bestpath as-path multipath-relax",
1167 "BGP specific commands\n"
1168 "Change the default bestpath selection\n"
1169 "AS-path attribute\n"
1170 "Allow load sharing across routes that have different AS paths (but same length)\n")
1175 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
1179 DEFUN (no_bgp_bestpath_aspath_multipath_relax
,
1180 no_bgp_bestpath_aspath_multipath_relax_cmd
,
1181 "no bgp bestpath as-path multipath-relax",
1183 "BGP specific commands\n"
1184 "Change the default bestpath selection\n"
1185 "AS-path attribute\n"
1186 "Allow load sharing across routes that have different AS paths (but same length)\n")
1191 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
1195 /* "bgp log-neighbor-changes" configuration. */
1196 DEFUN (bgp_log_neighbor_changes
,
1197 bgp_log_neighbor_changes_cmd
,
1198 "bgp log-neighbor-changes",
1199 "BGP specific commands\n"
1200 "Log neighbor up/down and reset reason\n")
1205 bgp_flag_set (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
1209 DEFUN (no_bgp_log_neighbor_changes
,
1210 no_bgp_log_neighbor_changes_cmd
,
1211 "no bgp log-neighbor-changes",
1213 "BGP specific commands\n"
1214 "Log neighbor up/down and reset reason\n")
1219 bgp_flag_unset (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
1223 /* "bgp bestpath med" configuration. */
1224 DEFUN (bgp_bestpath_med
,
1225 bgp_bestpath_med_cmd
,
1226 "bgp bestpath med (confed|missing-as-worst)",
1227 "BGP specific commands\n"
1228 "Change the default bestpath selection\n"
1230 "Compare MED among confederation paths\n"
1231 "Treat missing MED as the least preferred one\n")
1237 if (strncmp (argv
[0], "confed", 1) == 0)
1238 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
1240 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1245 DEFUN (bgp_bestpath_med2
,
1246 bgp_bestpath_med2_cmd
,
1247 "bgp bestpath med confed missing-as-worst",
1248 "BGP specific commands\n"
1249 "Change the default bestpath selection\n"
1251 "Compare MED among confederation paths\n"
1252 "Treat missing MED as the least preferred one\n")
1257 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
1258 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1262 ALIAS (bgp_bestpath_med2
,
1263 bgp_bestpath_med3_cmd
,
1264 "bgp bestpath med missing-as-worst confed",
1265 "BGP specific commands\n"
1266 "Change the default bestpath selection\n"
1268 "Treat missing MED as the least preferred one\n"
1269 "Compare MED among confederation paths\n")
1271 DEFUN (no_bgp_bestpath_med
,
1272 no_bgp_bestpath_med_cmd
,
1273 "no bgp bestpath med (confed|missing-as-worst)",
1275 "BGP specific commands\n"
1276 "Change the default bestpath selection\n"
1278 "Compare MED among confederation paths\n"
1279 "Treat missing MED as the least preferred one\n")
1285 if (strncmp (argv
[0], "confed", 1) == 0)
1286 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
1288 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1293 DEFUN (no_bgp_bestpath_med2
,
1294 no_bgp_bestpath_med2_cmd
,
1295 "no bgp bestpath med confed missing-as-worst",
1297 "BGP specific commands\n"
1298 "Change the default bestpath selection\n"
1300 "Compare MED among confederation paths\n"
1301 "Treat missing MED as the least preferred one\n")
1306 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
1307 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1311 ALIAS (no_bgp_bestpath_med2
,
1312 no_bgp_bestpath_med3_cmd
,
1313 "no bgp bestpath med missing-as-worst confed",
1315 "BGP specific commands\n"
1316 "Change the default bestpath selection\n"
1318 "Treat missing MED as the least preferred one\n"
1319 "Compare MED among confederation paths\n")
1321 /* "no bgp default ipv4-unicast". */
1322 DEFUN (no_bgp_default_ipv4_unicast
,
1323 no_bgp_default_ipv4_unicast_cmd
,
1324 "no bgp default ipv4-unicast",
1326 "BGP specific commands\n"
1327 "Configure BGP defaults\n"
1328 "Activate ipv4-unicast for a peer by default\n")
1333 bgp_flag_set (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1337 DEFUN (bgp_default_ipv4_unicast
,
1338 bgp_default_ipv4_unicast_cmd
,
1339 "bgp default ipv4-unicast",
1340 "BGP specific commands\n"
1341 "Configure BGP defaults\n"
1342 "Activate ipv4-unicast for a peer by default\n")
1347 bgp_flag_unset (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1351 /* "bgp import-check" configuration. */
1352 DEFUN (bgp_network_import_check
,
1353 bgp_network_import_check_cmd
,
1354 "bgp network import-check",
1355 "BGP specific commands\n"
1356 "BGP network command\n"
1357 "Check BGP network route exists in IGP\n")
1362 bgp_flag_set (bgp
, BGP_FLAG_IMPORT_CHECK
);
1366 DEFUN (no_bgp_network_import_check
,
1367 no_bgp_network_import_check_cmd
,
1368 "no bgp network import-check",
1370 "BGP specific commands\n"
1371 "BGP network command\n"
1372 "Check BGP network route exists in IGP\n")
1377 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK
);
1381 DEFUN (bgp_default_local_preference
,
1382 bgp_default_local_preference_cmd
,
1383 "bgp default local-preference <0-4294967295>",
1384 "BGP specific commands\n"
1385 "Configure BGP defaults\n"
1386 "local preference (higher=more preferred)\n"
1387 "Configure default local preference value\n")
1390 u_int32_t local_pref
;
1394 VTY_GET_INTEGER ("local preference", local_pref
, argv
[0]);
1396 bgp_default_local_preference_set (bgp
, local_pref
);
1401 DEFUN (no_bgp_default_local_preference
,
1402 no_bgp_default_local_preference_cmd
,
1403 "no bgp default local-preference",
1405 "BGP specific commands\n"
1406 "Configure BGP defaults\n"
1407 "local preference (higher=more preferred)\n")
1412 bgp_default_local_preference_unset (bgp
);
1416 ALIAS (no_bgp_default_local_preference
,
1417 no_bgp_default_local_preference_val_cmd
,
1418 "no bgp default local-preference <0-4294967295>",
1420 "BGP specific commands\n"
1421 "Configure BGP defaults\n"
1422 "local preference (higher=more preferred)\n"
1423 "Configure default local preference value\n")
1426 peer_remote_as_vty (struct vty
*vty
, const char *peer_str
,
1427 const char *as_str
, afi_t afi
, safi_t safi
)
1436 /* Get AS number. */
1437 VTY_GET_INTEGER_RANGE ("AS", as
, as_str
, 1, BGP_AS4_MAX
);
1439 /* If peer is peer group, call proper function. */
1440 ret
= str2sockunion (peer_str
, &su
);
1443 ret
= peer_group_remote_as (bgp
, peer_str
, &as
);
1446 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1452 if (peer_address_self_check (&su
))
1454 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1459 ret
= peer_remote_as (bgp
, &su
, &as
, afi
, safi
);
1461 /* This peer belongs to peer group. */
1464 case BGP_ERR_PEER_GROUP_MEMBER
:
1465 vty_out (vty
, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as
, VTY_NEWLINE
);
1467 case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
:
1468 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
);
1471 return bgp_vty_return (vty
, ret
);
1474 DEFUN (neighbor_remote_as
,
1475 neighbor_remote_as_cmd
,
1476 NEIGHBOR_CMD2
"remote-as " CMD_AS_RANGE
,
1479 "Specify a BGP neighbor\n"
1482 return peer_remote_as_vty (vty
, argv
[0], argv
[1], AFI_IP
, SAFI_UNICAST
);
1485 DEFUN (neighbor_peer_group
,
1486 neighbor_peer_group_cmd
,
1487 "neighbor WORD peer-group",
1490 "Configure peer-group\n")
1493 struct peer_group
*group
;
1497 group
= peer_group_get (bgp
, argv
[0]);
1513 struct peer_group
*group
;
1516 ret
= str2sockunion (argv
[0], &su
);
1519 group
= peer_group_lookup (vty
->index
, argv
[0]);
1521 peer_group_delete (group
);
1524 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1530 peer
= peer_lookup (vty
->index
, &su
);
1539 no_neighbor_remote_as_cmd
,
1540 NO_NEIGHBOR_CMD
"remote-as " CMD_AS_RANGE
,
1544 "Specify a BGP neighbor\n"
1547 DEFUN (no_neighbor_peer_group
,
1548 no_neighbor_peer_group_cmd
,
1549 "no neighbor WORD peer-group",
1553 "Configure peer-group\n")
1555 struct peer_group
*group
;
1557 group
= peer_group_lookup (vty
->index
, argv
[0]);
1559 peer_group_delete (group
);
1562 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1568 DEFUN (no_neighbor_peer_group_remote_as
,
1569 no_neighbor_peer_group_remote_as_cmd
,
1570 "no neighbor WORD remote-as " CMD_AS_RANGE
,
1574 "Specify a BGP neighbor\n"
1577 struct peer_group
*group
;
1579 group
= peer_group_lookup (vty
->index
, argv
[0]);
1581 peer_group_remote_as_delete (group
);
1584 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1590 DEFUN (neighbor_local_as
,
1591 neighbor_local_as_cmd
,
1592 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
1595 "Specify a local-as number\n"
1596 "AS number used as local AS\n")
1601 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1605 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 0, 0);
1606 return bgp_vty_return (vty
, ret
);
1609 DEFUN (neighbor_local_as_no_prepend
,
1610 neighbor_local_as_no_prepend_cmd
,
1611 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
1614 "Specify a local-as number\n"
1615 "AS number used as local AS\n"
1616 "Do not prepend local-as to updates from ebgp peers\n")
1621 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1625 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1, 0);
1626 return bgp_vty_return (vty
, ret
);
1629 DEFUN (neighbor_local_as_no_prepend_replace_as
,
1630 neighbor_local_as_no_prepend_replace_as_cmd
,
1631 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend replace-as",
1634 "Specify a local-as number\n"
1635 "AS number used as local AS\n"
1636 "Do not prepend local-as to updates from ebgp peers\n"
1637 "Do not prepend local-as to updates from ibgp peers\n")
1642 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1646 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1, 1);
1647 return bgp_vty_return (vty
, ret
);
1651 DEFUN (no_neighbor_local_as
,
1652 no_neighbor_local_as_cmd
,
1653 NO_NEIGHBOR_CMD2
"local-as",
1657 "Specify a local-as number\n")
1662 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1666 ret
= peer_local_as_unset (peer
);
1667 return bgp_vty_return (vty
, ret
);
1670 ALIAS (no_neighbor_local_as
,
1671 no_neighbor_local_as_val_cmd
,
1672 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
1676 "Specify a local-as number\n"
1677 "AS number used as local AS\n")
1679 ALIAS (no_neighbor_local_as
,
1680 no_neighbor_local_as_val2_cmd
,
1681 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
1685 "Specify a local-as number\n"
1686 "AS number used as local AS\n"
1687 "Do not prepend local-as to updates from ebgp peers\n")
1689 ALIAS (no_neighbor_local_as
,
1690 no_neighbor_local_as_val3_cmd
,
1691 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend replace-as",
1695 "Specify a local-as number\n"
1696 "AS number used as local AS\n"
1697 "Do not prepend local-as to updates from ebgp peers\n"
1698 "Do not prepend local-as to updates from ibgp peers\n")
1700 DEFUN (neighbor_password
,
1701 neighbor_password_cmd
,
1702 NEIGHBOR_CMD2
"password LINE",
1711 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1715 ret
= peer_password_set (peer
, argv
[1]);
1716 return bgp_vty_return (vty
, ret
);
1719 DEFUN (no_neighbor_password
,
1720 no_neighbor_password_cmd
,
1721 NO_NEIGHBOR_CMD2
"password",
1730 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1734 ret
= peer_password_unset (peer
);
1735 return bgp_vty_return (vty
, ret
);
1738 DEFUN (neighbor_activate
,
1739 neighbor_activate_cmd
,
1740 NEIGHBOR_CMD2
"activate",
1743 "Enable the Address Family for this Neighbor\n")
1747 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1751 peer_activate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
1756 DEFUN (no_neighbor_activate
,
1757 no_neighbor_activate_cmd
,
1758 NO_NEIGHBOR_CMD2
"activate",
1762 "Enable the Address Family for this Neighbor\n")
1768 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1772 ret
= peer_deactivate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
1774 return bgp_vty_return (vty
, ret
);
1777 DEFUN (neighbor_set_peer_group
,
1778 neighbor_set_peer_group_cmd
,
1779 NEIGHBOR_CMD
"peer-group WORD",
1782 "Member of the peer-group\n"
1783 "peer-group name\n")
1789 struct peer_group
*group
;
1793 ret
= str2sockunion (argv
[0], &su
);
1796 vty_out (vty
, "%% Malformed address: %s%s", argv
[0], VTY_NEWLINE
);
1800 group
= peer_group_lookup (bgp
, argv
[1]);
1803 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
1807 if (peer_address_self_check (&su
))
1809 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1814 ret
= peer_group_bind (bgp
, &su
, group
, bgp_node_afi (vty
),
1815 bgp_node_safi (vty
), &as
);
1817 if (ret
== BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
)
1819 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
);
1823 return bgp_vty_return (vty
, ret
);
1826 DEFUN (no_neighbor_set_peer_group
,
1827 no_neighbor_set_peer_group_cmd
,
1828 NO_NEIGHBOR_CMD
"peer-group WORD",
1832 "Member of the peer-group\n"
1833 "peer-group name\n")
1838 struct peer_group
*group
;
1842 peer
= peer_lookup_vty (vty
, argv
[0]);
1846 group
= peer_group_lookup (bgp
, argv
[1]);
1849 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
1853 ret
= peer_group_unbind (bgp
, peer
, group
, bgp_node_afi (vty
),
1854 bgp_node_safi (vty
));
1856 return bgp_vty_return (vty
, ret
);
1860 peer_flag_modify_vty (struct vty
*vty
, const char *ip_str
,
1861 u_int16_t flag
, int set
)
1866 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
1871 ret
= peer_flag_set (peer
, flag
);
1873 ret
= peer_flag_unset (peer
, flag
);
1875 return bgp_vty_return (vty
, ret
);
1879 peer_flag_set_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
1881 return peer_flag_modify_vty (vty
, ip_str
, flag
, 1);
1885 peer_flag_unset_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
1887 return peer_flag_modify_vty (vty
, ip_str
, flag
, 0);
1890 /* neighbor passive. */
1891 DEFUN (neighbor_passive
,
1892 neighbor_passive_cmd
,
1893 NEIGHBOR_CMD2
"passive",
1896 "Don't send open messages to this neighbor\n")
1898 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
1901 DEFUN (no_neighbor_passive
,
1902 no_neighbor_passive_cmd
,
1903 NO_NEIGHBOR_CMD2
"passive",
1907 "Don't send open messages to this neighbor\n")
1909 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
1912 /* neighbor shutdown. */
1913 DEFUN (neighbor_shutdown
,
1914 neighbor_shutdown_cmd
,
1915 NEIGHBOR_CMD2
"shutdown",
1918 "Administratively shut down this neighbor\n")
1920 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
1923 DEFUN (no_neighbor_shutdown
,
1924 no_neighbor_shutdown_cmd
,
1925 NO_NEIGHBOR_CMD2
"shutdown",
1929 "Administratively shut down this neighbor\n")
1931 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
1934 /* Deprecated neighbor capability route-refresh. */
1935 DEFUN_DEPRECATED (neighbor_capability_route_refresh
,
1936 neighbor_capability_route_refresh_cmd
,
1937 NEIGHBOR_CMD2
"capability route-refresh",
1940 "Advertise capability to the peer\n"
1941 "Advertise route-refresh capability to this neighbor\n")
1946 DEFUN_DEPRECATED (no_neighbor_capability_route_refresh
,
1947 no_neighbor_capability_route_refresh_cmd
,
1948 NO_NEIGHBOR_CMD2
"capability route-refresh",
1952 "Advertise capability to the peer\n"
1953 "Advertise route-refresh capability to this neighbor\n")
1958 /* neighbor capability dynamic. */
1959 DEFUN (neighbor_capability_dynamic
,
1960 neighbor_capability_dynamic_cmd
,
1961 NEIGHBOR_CMD2
"capability dynamic",
1964 "Advertise capability to the peer\n"
1965 "Advertise dynamic capability to this neighbor\n")
1967 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
1970 DEFUN (no_neighbor_capability_dynamic
,
1971 no_neighbor_capability_dynamic_cmd
,
1972 NO_NEIGHBOR_CMD2
"capability dynamic",
1976 "Advertise capability to the peer\n"
1977 "Advertise dynamic capability to this neighbor\n")
1979 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
1982 /* neighbor dont-capability-negotiate */
1983 DEFUN (neighbor_dont_capability_negotiate
,
1984 neighbor_dont_capability_negotiate_cmd
,
1985 NEIGHBOR_CMD2
"dont-capability-negotiate",
1988 "Do not perform capability negotiation\n")
1990 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
1993 DEFUN (no_neighbor_dont_capability_negotiate
,
1994 no_neighbor_dont_capability_negotiate_cmd
,
1995 NO_NEIGHBOR_CMD2
"dont-capability-negotiate",
1999 "Do not perform capability negotiation\n")
2001 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
2005 peer_af_flag_modify_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
2006 safi_t safi
, u_int32_t flag
, int set
)
2011 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2016 ret
= peer_af_flag_set (peer
, afi
, safi
, flag
);
2018 ret
= peer_af_flag_unset (peer
, afi
, safi
, flag
);
2020 return bgp_vty_return (vty
, ret
);
2024 peer_af_flag_set_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
2025 safi_t safi
, u_int32_t flag
)
2027 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 1);
2031 peer_af_flag_unset_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
2032 safi_t safi
, u_int32_t flag
)
2034 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 0);
2037 /* neighbor capability orf prefix-list. */
2038 DEFUN (neighbor_capability_orf_prefix
,
2039 neighbor_capability_orf_prefix_cmd
,
2040 NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
2043 "Advertise capability to the peer\n"
2044 "Advertise ORF capability to the peer\n"
2045 "Advertise prefixlist ORF capability to this neighbor\n"
2046 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
2047 "Capability to RECEIVE the ORF from this neighbor\n"
2048 "Capability to SEND the ORF to this neighbor\n")
2052 if (strncmp (argv
[1], "s", 1) == 0)
2053 flag
= PEER_FLAG_ORF_PREFIX_SM
;
2054 else if (strncmp (argv
[1], "r", 1) == 0)
2055 flag
= PEER_FLAG_ORF_PREFIX_RM
;
2056 else if (strncmp (argv
[1], "b", 1) == 0)
2057 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
2061 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2062 bgp_node_safi (vty
), flag
);
2065 DEFUN (no_neighbor_capability_orf_prefix
,
2066 no_neighbor_capability_orf_prefix_cmd
,
2067 NO_NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
2071 "Advertise capability to the peer\n"
2072 "Advertise ORF capability to the peer\n"
2073 "Advertise prefixlist ORF capability to this neighbor\n"
2074 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
2075 "Capability to RECEIVE the ORF from this neighbor\n"
2076 "Capability to SEND the ORF to this neighbor\n")
2080 if (strncmp (argv
[1], "s", 1) == 0)
2081 flag
= PEER_FLAG_ORF_PREFIX_SM
;
2082 else if (strncmp (argv
[1], "r", 1) == 0)
2083 flag
= PEER_FLAG_ORF_PREFIX_RM
;
2084 else if (strncmp (argv
[1], "b", 1) == 0)
2085 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
2089 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2090 bgp_node_safi (vty
), flag
);
2093 /* neighbor next-hop-self. */
2094 DEFUN (neighbor_nexthop_self
,
2095 neighbor_nexthop_self_cmd
,
2096 NEIGHBOR_CMD2
"next-hop-self",
2099 "Disable the next hop calculation for this neighbor\n")
2101 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2102 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
2105 DEFUN (no_neighbor_nexthop_self
,
2106 no_neighbor_nexthop_self_cmd
,
2107 NO_NEIGHBOR_CMD2
"next-hop-self",
2111 "Disable the next hop calculation for this neighbor\n")
2113 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2114 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
2117 /* neighbor remove-private-AS. */
2118 DEFUN (neighbor_remove_private_as
,
2119 neighbor_remove_private_as_cmd
,
2120 NEIGHBOR_CMD2
"remove-private-AS",
2123 "Remove private AS number from outbound updates\n")
2125 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2126 bgp_node_safi (vty
),
2127 PEER_FLAG_REMOVE_PRIVATE_AS
);
2130 DEFUN (no_neighbor_remove_private_as
,
2131 no_neighbor_remove_private_as_cmd
,
2132 NO_NEIGHBOR_CMD2
"remove-private-AS",
2136 "Remove private AS number from outbound updates\n")
2138 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2139 bgp_node_safi (vty
),
2140 PEER_FLAG_REMOVE_PRIVATE_AS
);
2143 /* neighbor send-community. */
2144 DEFUN (neighbor_send_community
,
2145 neighbor_send_community_cmd
,
2146 NEIGHBOR_CMD2
"send-community",
2149 "Send Community attribute to this neighbor\n")
2151 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2152 bgp_node_safi (vty
),
2153 PEER_FLAG_SEND_COMMUNITY
);
2156 DEFUN (no_neighbor_send_community
,
2157 no_neighbor_send_community_cmd
,
2158 NO_NEIGHBOR_CMD2
"send-community",
2162 "Send Community attribute to this neighbor\n")
2164 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2165 bgp_node_safi (vty
),
2166 PEER_FLAG_SEND_COMMUNITY
);
2169 /* neighbor send-community extended. */
2170 DEFUN (neighbor_send_community_type
,
2171 neighbor_send_community_type_cmd
,
2172 NEIGHBOR_CMD2
"send-community (both|extended|standard)",
2175 "Send Community attribute to this neighbor\n"
2176 "Send Standard and Extended Community attributes\n"
2177 "Send Extended Community attributes\n"
2178 "Send Standard Community attributes\n")
2180 if (strncmp (argv
[1], "s", 1) == 0)
2181 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2182 bgp_node_safi (vty
),
2183 PEER_FLAG_SEND_COMMUNITY
);
2184 if (strncmp (argv
[1], "e", 1) == 0)
2185 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2186 bgp_node_safi (vty
),
2187 PEER_FLAG_SEND_EXT_COMMUNITY
);
2189 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2190 bgp_node_safi (vty
),
2191 (PEER_FLAG_SEND_COMMUNITY
|
2192 PEER_FLAG_SEND_EXT_COMMUNITY
));
2195 DEFUN (no_neighbor_send_community_type
,
2196 no_neighbor_send_community_type_cmd
,
2197 NO_NEIGHBOR_CMD2
"send-community (both|extended|standard)",
2201 "Send Community attribute to this neighbor\n"
2202 "Send Standard and Extended Community attributes\n"
2203 "Send Extended Community attributes\n"
2204 "Send Standard Community attributes\n")
2206 if (strncmp (argv
[1], "s", 1) == 0)
2207 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2208 bgp_node_safi (vty
),
2209 PEER_FLAG_SEND_COMMUNITY
);
2210 if (strncmp (argv
[1], "e", 1) == 0)
2211 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2212 bgp_node_safi (vty
),
2213 PEER_FLAG_SEND_EXT_COMMUNITY
);
2215 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2216 bgp_node_safi (vty
),
2217 (PEER_FLAG_SEND_COMMUNITY
|
2218 PEER_FLAG_SEND_EXT_COMMUNITY
));
2221 /* neighbor soft-reconfig. */
2222 DEFUN (neighbor_soft_reconfiguration
,
2223 neighbor_soft_reconfiguration_cmd
,
2224 NEIGHBOR_CMD2
"soft-reconfiguration inbound",
2227 "Per neighbor soft reconfiguration\n"
2228 "Allow inbound soft reconfiguration for this neighbor\n")
2230 return peer_af_flag_set_vty (vty
, argv
[0],
2231 bgp_node_afi (vty
), bgp_node_safi (vty
),
2232 PEER_FLAG_SOFT_RECONFIG
);
2235 DEFUN (no_neighbor_soft_reconfiguration
,
2236 no_neighbor_soft_reconfiguration_cmd
,
2237 NO_NEIGHBOR_CMD2
"soft-reconfiguration inbound",
2241 "Per neighbor soft reconfiguration\n"
2242 "Allow inbound soft reconfiguration for this neighbor\n")
2244 return peer_af_flag_unset_vty (vty
, argv
[0],
2245 bgp_node_afi (vty
), bgp_node_safi (vty
),
2246 PEER_FLAG_SOFT_RECONFIG
);
2249 DEFUN (neighbor_route_reflector_client
,
2250 neighbor_route_reflector_client_cmd
,
2251 NEIGHBOR_CMD2
"route-reflector-client",
2254 "Configure a neighbor as Route Reflector client\n")
2259 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2263 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2264 bgp_node_safi (vty
),
2265 PEER_FLAG_REFLECTOR_CLIENT
);
2268 DEFUN (no_neighbor_route_reflector_client
,
2269 no_neighbor_route_reflector_client_cmd
,
2270 NO_NEIGHBOR_CMD2
"route-reflector-client",
2274 "Configure a neighbor as Route Reflector client\n")
2276 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2277 bgp_node_safi (vty
),
2278 PEER_FLAG_REFLECTOR_CLIENT
);
2282 peer_rsclient_set_vty (struct vty
*vty
, const char *peer_str
,
2288 struct peer_group
*group
;
2289 struct listnode
*node
, *nnode
;
2290 struct bgp_filter
*pfilter
;
2291 struct bgp_filter
*gfilter
;
2292 int locked_and_added
= 0;
2296 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2300 /* If it is already a RS-Client, don't do anything. */
2301 if ( CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
2304 if ( ! peer_rsclient_active (peer
) )
2306 peer
= peer_lock (peer
); /* rsclient peer list reference */
2307 listnode_add_sort (bgp
->rsclient
, peer
);
2308 locked_and_added
= 1;
2311 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2314 if (locked_and_added
)
2316 listnode_delete (bgp
->rsclient
, peer
);
2317 peer_unlock (peer
); /* rsclient peer list reference */
2320 return bgp_vty_return (vty
, ret
);
2323 peer
->rib
[afi
][safi
] = bgp_table_init (afi
, safi
);
2324 peer
->rib
[afi
][safi
]->type
= BGP_TABLE_RSCLIENT
;
2325 /* RIB peer reference. Released when table is free'd in bgp_table_free. */
2326 peer
->rib
[afi
][safi
]->owner
= peer_lock (peer
);
2328 /* Check for existing 'network' and 'redistribute' routes. */
2329 bgp_check_local_routes_rsclient (peer
, afi
, safi
);
2331 /* Check for routes for peers configured with 'soft-reconfiguration'. */
2332 bgp_soft_reconfig_rsclient (peer
, afi
, safi
);
2334 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
2336 group
= peer
->group
;
2337 gfilter
= &peer
->filter
[afi
][safi
];
2339 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
2341 pfilter
= &peer
->filter
[afi
][safi
];
2343 /* Members of a non-RS-Client group should not be RS-Clients, as that
2344 is checked when the become part of the peer-group */
2345 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2347 return bgp_vty_return (vty
, ret
);
2349 /* Make peer's RIB point to group's RIB. */
2350 peer
->rib
[afi
][safi
] = group
->conf
->rib
[afi
][safi
];
2352 /* Import policy. */
2353 if (pfilter
->map
[RMAP_IMPORT
].name
)
2354 free (pfilter
->map
[RMAP_IMPORT
].name
);
2355 if (gfilter
->map
[RMAP_IMPORT
].name
)
2357 pfilter
->map
[RMAP_IMPORT
].name
= strdup (gfilter
->map
[RMAP_IMPORT
].name
);
2358 pfilter
->map
[RMAP_IMPORT
].map
= gfilter
->map
[RMAP_IMPORT
].map
;
2362 pfilter
->map
[RMAP_IMPORT
].name
= NULL
;
2363 pfilter
->map
[RMAP_IMPORT
].map
=NULL
;
2366 /* Export policy. */
2367 if (gfilter
->map
[RMAP_EXPORT
].name
&& ! pfilter
->map
[RMAP_EXPORT
].name
)
2369 pfilter
->map
[RMAP_EXPORT
].name
= strdup (gfilter
->map
[RMAP_EXPORT
].name
);
2370 pfilter
->map
[RMAP_EXPORT
].map
= gfilter
->map
[RMAP_EXPORT
].map
;
2378 peer_rsclient_unset_vty (struct vty
*vty
, const char *peer_str
,
2384 struct peer_group
*group
;
2385 struct listnode
*node
, *nnode
;
2389 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2393 /* If it is not a RS-Client, don't do anything. */
2394 if ( ! CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
2397 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
2399 group
= peer
->group
;
2401 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
2403 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2405 return bgp_vty_return (vty
, ret
);
2407 peer
->rib
[afi
][safi
] = NULL
;
2413 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2415 return bgp_vty_return (vty
, ret
);
2417 if ( ! peer_rsclient_active (peer
) )
2419 bgp_clear_route (peer
, afi
, safi
, BGP_CLEAR_ROUTE_MY_RSCLIENT
);
2420 listnode_delete (bgp
->rsclient
, peer
);
2421 peer_unlock (peer
); /* peer bgp rsclient reference */
2424 bgp_table_finish (&peer
->rib
[bgp_node_afi(vty
)][bgp_node_safi(vty
)]);
2429 /* neighbor route-server-client. */
2430 DEFUN (neighbor_route_server_client
,
2431 neighbor_route_server_client_cmd
,
2432 NEIGHBOR_CMD2
"route-server-client",
2435 "Configure a neighbor as Route Server client\n")
2437 return peer_rsclient_set_vty (vty
, argv
[0], bgp_node_afi(vty
),
2438 bgp_node_safi(vty
));
2441 DEFUN (no_neighbor_route_server_client
,
2442 no_neighbor_route_server_client_cmd
,
2443 NO_NEIGHBOR_CMD2
"route-server-client",
2447 "Configure a neighbor as Route Server client\n")
2449 return peer_rsclient_unset_vty (vty
, argv
[0], bgp_node_afi(vty
),
2450 bgp_node_safi(vty
));
2453 DEFUN (neighbor_nexthop_local_unchanged
,
2454 neighbor_nexthop_local_unchanged_cmd
,
2455 NEIGHBOR_CMD2
"nexthop-local unchanged",
2458 "Configure treatment of outgoing link-local nexthop attribute\n"
2459 "Leave link-local nexthop unchanged for this peer\n")
2461 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2462 bgp_node_safi (vty
),
2463 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
2466 DEFUN (no_neighbor_nexthop_local_unchanged
,
2467 no_neighbor_nexthop_local_unchanged_cmd
,
2468 NO_NEIGHBOR_CMD2
"nexthop-local unchanged",
2472 "Configure treatment of outgoing link-local-nexthop attribute\n"
2473 "Leave link-local nexthop unchanged for this peer\n")
2475 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2476 bgp_node_safi (vty
),
2477 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
2480 DEFUN (neighbor_attr_unchanged
,
2481 neighbor_attr_unchanged_cmd
,
2482 NEIGHBOR_CMD2
"attribute-unchanged",
2485 "BGP attribute is propagated unchanged to this neighbor\n")
2487 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2488 bgp_node_safi (vty
),
2489 (PEER_FLAG_AS_PATH_UNCHANGED
|
2490 PEER_FLAG_NEXTHOP_UNCHANGED
|
2491 PEER_FLAG_MED_UNCHANGED
));
2494 DEFUN (neighbor_attr_unchanged1
,
2495 neighbor_attr_unchanged1_cmd
,
2496 NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2499 "BGP attribute is propagated unchanged to this neighbor\n"
2500 "As-path attribute\n"
2501 "Nexthop attribute\n"
2504 u_int16_t flags
= 0;
2506 if (strncmp (argv
[1], "as-path", 1) == 0)
2507 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2508 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2509 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2510 else if (strncmp (argv
[1], "med", 1) == 0)
2511 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2513 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2514 bgp_node_safi (vty
), flags
);
2517 DEFUN (neighbor_attr_unchanged2
,
2518 neighbor_attr_unchanged2_cmd
,
2519 NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2522 "BGP attribute is propagated unchanged to this neighbor\n"
2523 "As-path attribute\n"
2524 "Nexthop attribute\n"
2527 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2529 if (strncmp (argv
[1], "next-hop", 1) == 0)
2530 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2531 else if (strncmp (argv
[1], "med", 1) == 0)
2532 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2534 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2535 bgp_node_safi (vty
), flags
);
2539 DEFUN (neighbor_attr_unchanged3
,
2540 neighbor_attr_unchanged3_cmd
,
2541 NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2544 "BGP attribute is propagated unchanged to this neighbor\n"
2545 "Nexthop attribute\n"
2546 "As-path attribute\n"
2549 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2551 if (strncmp (argv
[1], "as-path", 1) == 0)
2552 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2553 else if (strncmp (argv
[1], "med", 1) == 0)
2554 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2556 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2557 bgp_node_safi (vty
), flags
);
2560 DEFUN (neighbor_attr_unchanged4
,
2561 neighbor_attr_unchanged4_cmd
,
2562 NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2565 "BGP attribute is propagated unchanged to this neighbor\n"
2567 "As-path attribute\n"
2568 "Nexthop attribute\n")
2570 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2572 if (strncmp (argv
[1], "as-path", 1) == 0)
2573 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2574 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2575 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2577 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2578 bgp_node_safi (vty
), flags
);
2581 ALIAS (neighbor_attr_unchanged
,
2582 neighbor_attr_unchanged5_cmd
,
2583 NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2586 "BGP attribute is propagated unchanged to this neighbor\n"
2587 "As-path attribute\n"
2588 "Nexthop attribute\n"
2591 ALIAS (neighbor_attr_unchanged
,
2592 neighbor_attr_unchanged6_cmd
,
2593 NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2596 "BGP attribute is propagated unchanged to this neighbor\n"
2597 "As-path attribute\n"
2599 "Nexthop attribute\n")
2601 ALIAS (neighbor_attr_unchanged
,
2602 neighbor_attr_unchanged7_cmd
,
2603 NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2606 "BGP attribute is propagated unchanged to this neighbor\n"
2607 "Nexthop attribute\n"
2609 "As-path attribute\n")
2611 ALIAS (neighbor_attr_unchanged
,
2612 neighbor_attr_unchanged8_cmd
,
2613 NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2616 "BGP attribute is propagated unchanged to this neighbor\n"
2617 "Nexthop attribute\n"
2618 "As-path attribute\n"
2621 ALIAS (neighbor_attr_unchanged
,
2622 neighbor_attr_unchanged9_cmd
,
2623 NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2626 "BGP attribute is propagated unchanged to this neighbor\n"
2628 "Nexthop attribute\n"
2629 "As-path attribute\n")
2631 ALIAS (neighbor_attr_unchanged
,
2632 neighbor_attr_unchanged10_cmd
,
2633 NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2636 "BGP attribute is propagated unchanged to this neighbor\n"
2638 "As-path attribute\n"
2639 "Nexthop attribute\n")
2641 DEFUN (no_neighbor_attr_unchanged
,
2642 no_neighbor_attr_unchanged_cmd
,
2643 NO_NEIGHBOR_CMD2
"attribute-unchanged",
2647 "BGP attribute is propagated unchanged to this neighbor\n")
2649 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2650 bgp_node_safi (vty
),
2651 (PEER_FLAG_AS_PATH_UNCHANGED
|
2652 PEER_FLAG_NEXTHOP_UNCHANGED
|
2653 PEER_FLAG_MED_UNCHANGED
));
2656 DEFUN (no_neighbor_attr_unchanged1
,
2657 no_neighbor_attr_unchanged1_cmd
,
2658 NO_NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2662 "BGP attribute is propagated unchanged to this neighbor\n"
2663 "As-path attribute\n"
2664 "Nexthop attribute\n"
2667 u_int16_t flags
= 0;
2669 if (strncmp (argv
[1], "as-path", 1) == 0)
2670 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2671 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2672 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2673 else if (strncmp (argv
[1], "med", 1) == 0)
2674 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2676 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2677 bgp_node_safi (vty
), flags
);
2680 DEFUN (no_neighbor_attr_unchanged2
,
2681 no_neighbor_attr_unchanged2_cmd
,
2682 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2686 "BGP attribute is propagated unchanged to this neighbor\n"
2687 "As-path attribute\n"
2688 "Nexthop attribute\n"
2691 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2693 if (strncmp (argv
[1], "next-hop", 1) == 0)
2694 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2695 else if (strncmp (argv
[1], "med", 1) == 0)
2696 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2698 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2699 bgp_node_safi (vty
), flags
);
2702 DEFUN (no_neighbor_attr_unchanged3
,
2703 no_neighbor_attr_unchanged3_cmd
,
2704 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2708 "BGP attribute is propagated unchanged to this neighbor\n"
2709 "Nexthop attribute\n"
2710 "As-path attribute\n"
2713 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2715 if (strncmp (argv
[1], "as-path", 1) == 0)
2716 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2717 else if (strncmp (argv
[1], "med", 1) == 0)
2718 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2720 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2721 bgp_node_safi (vty
), flags
);
2724 DEFUN (no_neighbor_attr_unchanged4
,
2725 no_neighbor_attr_unchanged4_cmd
,
2726 NO_NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2730 "BGP attribute is propagated unchanged to this neighbor\n"
2732 "As-path attribute\n"
2733 "Nexthop attribute\n")
2735 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2737 if (strncmp (argv
[1], "as-path", 1) == 0)
2738 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2739 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2740 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2742 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2743 bgp_node_safi (vty
), flags
);
2746 ALIAS (no_neighbor_attr_unchanged
,
2747 no_neighbor_attr_unchanged5_cmd
,
2748 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2752 "BGP attribute is propagated unchanged to this neighbor\n"
2753 "As-path attribute\n"
2754 "Nexthop attribute\n"
2757 ALIAS (no_neighbor_attr_unchanged
,
2758 no_neighbor_attr_unchanged6_cmd
,
2759 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2763 "BGP attribute is propagated unchanged to this neighbor\n"
2764 "As-path attribute\n"
2766 "Nexthop attribute\n")
2768 ALIAS (no_neighbor_attr_unchanged
,
2769 no_neighbor_attr_unchanged7_cmd
,
2770 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2774 "BGP attribute is propagated unchanged to this neighbor\n"
2775 "Nexthop attribute\n"
2777 "As-path attribute\n")
2779 ALIAS (no_neighbor_attr_unchanged
,
2780 no_neighbor_attr_unchanged8_cmd
,
2781 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2785 "BGP attribute is propagated unchanged to this neighbor\n"
2786 "Nexthop attribute\n"
2787 "As-path attribute\n"
2790 ALIAS (no_neighbor_attr_unchanged
,
2791 no_neighbor_attr_unchanged9_cmd
,
2792 NO_NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2796 "BGP attribute is propagated unchanged to this neighbor\n"
2798 "Nexthop attribute\n"
2799 "As-path attribute\n")
2801 ALIAS (no_neighbor_attr_unchanged
,
2802 no_neighbor_attr_unchanged10_cmd
,
2803 NO_NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2807 "BGP attribute is propagated unchanged to this neighbor\n"
2809 "As-path attribute\n"
2810 "Nexthop attribute\n")
2812 /* For old version Zebra compatibility. */
2813 DEFUN_DEPRECATED (neighbor_transparent_as
,
2814 neighbor_transparent_as_cmd
,
2815 NEIGHBOR_CMD
"transparent-as",
2818 "Do not append my AS number even peer is EBGP peer\n")
2820 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2821 bgp_node_safi (vty
),
2822 PEER_FLAG_AS_PATH_UNCHANGED
);
2825 DEFUN_DEPRECATED (neighbor_transparent_nexthop
,
2826 neighbor_transparent_nexthop_cmd
,
2827 NEIGHBOR_CMD
"transparent-nexthop",
2830 "Do not change nexthop even peer is EBGP peer\n")
2832 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2833 bgp_node_safi (vty
),
2834 PEER_FLAG_NEXTHOP_UNCHANGED
);
2837 /* EBGP multihop configuration. */
2839 peer_ebgp_multihop_set_vty (struct vty
*vty
, const char *ip_str
,
2840 const char *ttl_str
)
2845 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2852 VTY_GET_INTEGER_RANGE ("TTL", ttl
, ttl_str
, 1, 255);
2854 return bgp_vty_return (vty
, peer_ebgp_multihop_set (peer
, ttl
));
2858 peer_ebgp_multihop_unset_vty (struct vty
*vty
, const char *ip_str
)
2862 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2866 return bgp_vty_return (vty
, peer_ebgp_multihop_unset (peer
));
2869 /* neighbor ebgp-multihop. */
2870 DEFUN (neighbor_ebgp_multihop
,
2871 neighbor_ebgp_multihop_cmd
,
2872 NEIGHBOR_CMD2
"ebgp-multihop",
2875 "Allow EBGP neighbors not on directly connected networks\n")
2877 return peer_ebgp_multihop_set_vty (vty
, argv
[0], NULL
);
2880 DEFUN (neighbor_ebgp_multihop_ttl
,
2881 neighbor_ebgp_multihop_ttl_cmd
,
2882 NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2885 "Allow EBGP neighbors not on directly connected networks\n"
2886 "maximum hop count\n")
2888 return peer_ebgp_multihop_set_vty (vty
, argv
[0], argv
[1]);
2891 DEFUN (no_neighbor_ebgp_multihop
,
2892 no_neighbor_ebgp_multihop_cmd
,
2893 NO_NEIGHBOR_CMD2
"ebgp-multihop",
2897 "Allow EBGP neighbors not on directly connected networks\n")
2899 return peer_ebgp_multihop_unset_vty (vty
, argv
[0]);
2902 ALIAS (no_neighbor_ebgp_multihop
,
2903 no_neighbor_ebgp_multihop_ttl_cmd
,
2904 NO_NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2908 "Allow EBGP neighbors not on directly connected networks\n"
2909 "maximum hop count\n")
2911 /* disable-connected-check */
2912 DEFUN (neighbor_disable_connected_check
,
2913 neighbor_disable_connected_check_cmd
,
2914 NEIGHBOR_CMD2
"disable-connected-check",
2917 "one-hop away EBGP peer using loopback address\n")
2919 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
2922 DEFUN (no_neighbor_disable_connected_check
,
2923 no_neighbor_disable_connected_check_cmd
,
2924 NO_NEIGHBOR_CMD2
"disable-connected-check",
2928 "one-hop away EBGP peer using loopback address\n")
2930 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
2933 /* Enforce multihop. */
2934 ALIAS (neighbor_disable_connected_check
,
2935 neighbor_enforce_multihop_cmd
,
2936 NEIGHBOR_CMD2
"enforce-multihop",
2939 "Enforce EBGP neighbors perform multihop\n")
2941 /* Enforce multihop. */
2942 ALIAS (no_neighbor_disable_connected_check
,
2943 no_neighbor_enforce_multihop_cmd
,
2944 NO_NEIGHBOR_CMD2
"enforce-multihop",
2948 "Enforce EBGP neighbors perform multihop\n")
2950 DEFUN (neighbor_description
,
2951 neighbor_description_cmd
,
2952 NEIGHBOR_CMD2
"description .LINE",
2955 "Neighbor specific description\n"
2956 "Up to 80 characters describing this neighbor\n")
2961 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2968 str
= argv_concat(argv
, argc
, 1);
2970 peer_description_set (peer
, str
);
2972 XFREE (MTYPE_TMP
, str
);
2977 DEFUN (no_neighbor_description
,
2978 no_neighbor_description_cmd
,
2979 NO_NEIGHBOR_CMD2
"description",
2983 "Neighbor specific description\n")
2987 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2991 peer_description_unset (peer
);
2996 ALIAS (no_neighbor_description
,
2997 no_neighbor_description_val_cmd
,
2998 NO_NEIGHBOR_CMD2
"description .LINE",
3002 "Neighbor specific description\n"
3003 "Up to 80 characters describing this neighbor\n")
3005 /* Neighbor update-source. */
3007 peer_update_source_vty (struct vty
*vty
, const char *peer_str
,
3008 const char *source_str
)
3012 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3019 int ret
= str2sockunion (source_str
, &su
);
3022 peer_update_source_addr_set (peer
, &su
);
3024 peer_update_source_if_set (peer
, source_str
);
3027 peer_update_source_unset (peer
);
3032 #define BGP_UPDATE_SOURCE_STR "(A.B.C.D|X:X::X:X|WORD)"
3033 #define BGP_UPDATE_SOURCE_HELP_STR \
3036 "Interface name (requires zebra to be running)\n"
3038 DEFUN (neighbor_update_source
,
3039 neighbor_update_source_cmd
,
3040 NEIGHBOR_CMD2
"update-source " BGP_UPDATE_SOURCE_STR
,
3043 "Source of routing updates\n"
3044 BGP_UPDATE_SOURCE_HELP_STR
)
3046 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
3049 DEFUN (no_neighbor_update_source
,
3050 no_neighbor_update_source_cmd
,
3051 NO_NEIGHBOR_CMD2
"update-source",
3055 "Source of routing updates\n")
3057 return peer_update_source_vty (vty
, argv
[0], NULL
);
3061 peer_default_originate_set_vty (struct vty
*vty
, const char *peer_str
,
3062 afi_t afi
, safi_t safi
,
3063 const char *rmap
, int set
)
3068 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3073 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
3075 ret
= peer_default_originate_unset (peer
, afi
, safi
);
3077 return bgp_vty_return (vty
, ret
);
3080 /* neighbor default-originate. */
3081 DEFUN (neighbor_default_originate
,
3082 neighbor_default_originate_cmd
,
3083 NEIGHBOR_CMD2
"default-originate",
3086 "Originate default route to this neighbor\n")
3088 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3089 bgp_node_safi (vty
), NULL
, 1);
3092 DEFUN (neighbor_default_originate_rmap
,
3093 neighbor_default_originate_rmap_cmd
,
3094 NEIGHBOR_CMD2
"default-originate route-map WORD",
3097 "Originate default route to this neighbor\n"
3098 "Route-map to specify criteria to originate default\n"
3101 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3102 bgp_node_safi (vty
), argv
[1], 1);
3105 DEFUN (no_neighbor_default_originate
,
3106 no_neighbor_default_originate_cmd
,
3107 NO_NEIGHBOR_CMD2
"default-originate",
3111 "Originate default route to this neighbor\n")
3113 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3114 bgp_node_safi (vty
), NULL
, 0);
3117 ALIAS (no_neighbor_default_originate
,
3118 no_neighbor_default_originate_rmap_cmd
,
3119 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
3123 "Originate default route to this neighbor\n"
3124 "Route-map to specify criteria to originate default\n"
3127 /* Set neighbor's BGP port. */
3129 peer_port_vty (struct vty
*vty
, const char *ip_str
, int afi
,
3130 const char *port_str
)
3136 peer
= peer_lookup_vty (vty
, ip_str
);
3142 sp
= getservbyname ("bgp", "tcp");
3143 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
3147 VTY_GET_INTEGER("port", port
, port_str
);
3150 peer_port_set (peer
, port
);
3155 /* Set specified peer's BGP port. */
3156 DEFUN (neighbor_port
,
3158 NEIGHBOR_CMD
"port <0-65535>",
3161 "Neighbor's BGP port\n"
3162 "TCP port number\n")
3164 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
3167 DEFUN (no_neighbor_port
,
3168 no_neighbor_port_cmd
,
3169 NO_NEIGHBOR_CMD
"port",
3173 "Neighbor's BGP port\n")
3175 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
3178 ALIAS (no_neighbor_port
,
3179 no_neighbor_port_val_cmd
,
3180 NO_NEIGHBOR_CMD
"port <0-65535>",
3184 "Neighbor's BGP port\n"
3185 "TCP port number\n")
3187 /* neighbor weight. */
3189 peer_weight_set_vty (struct vty
*vty
, const char *ip_str
,
3190 const char *weight_str
)
3194 unsigned long weight
;
3196 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3200 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
3202 ret
= peer_weight_set (peer
, weight
);
3208 peer_weight_unset_vty (struct vty
*vty
, const char *ip_str
)
3212 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3216 peer_weight_unset (peer
);
3221 DEFUN (neighbor_weight
,
3222 neighbor_weight_cmd
,
3223 NEIGHBOR_CMD2
"weight <0-65535>",
3226 "Set default weight for routes from this neighbor\n"
3229 return peer_weight_set_vty (vty
, argv
[0], argv
[1]);
3232 DEFUN (no_neighbor_weight
,
3233 no_neighbor_weight_cmd
,
3234 NO_NEIGHBOR_CMD2
"weight",
3238 "Set default weight for routes from this neighbor\n")
3240 return peer_weight_unset_vty (vty
, argv
[0]);
3243 ALIAS (no_neighbor_weight
,
3244 no_neighbor_weight_val_cmd
,
3245 NO_NEIGHBOR_CMD2
"weight <0-65535>",
3249 "Set default weight for routes from this neighbor\n"
3252 /* Override capability negotiation. */
3253 DEFUN (neighbor_override_capability
,
3254 neighbor_override_capability_cmd
,
3255 NEIGHBOR_CMD2
"override-capability",
3258 "Override capability negotiation result\n")
3260 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
3263 DEFUN (no_neighbor_override_capability
,
3264 no_neighbor_override_capability_cmd
,
3265 NO_NEIGHBOR_CMD2
"override-capability",
3269 "Override capability negotiation result\n")
3271 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
3274 DEFUN (neighbor_strict_capability
,
3275 neighbor_strict_capability_cmd
,
3276 NEIGHBOR_CMD
"strict-capability-match",
3279 "Strict capability negotiation match\n")
3281 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
3284 DEFUN (no_neighbor_strict_capability
,
3285 no_neighbor_strict_capability_cmd
,
3286 NO_NEIGHBOR_CMD
"strict-capability-match",
3290 "Strict capability negotiation match\n")
3292 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
3296 peer_timers_set_vty (struct vty
*vty
, const char *ip_str
,
3297 const char *keep_str
, const char *hold_str
)
3301 u_int32_t keepalive
;
3304 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3308 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
3309 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
3311 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
3313 return bgp_vty_return (vty
, ret
);
3317 peer_timers_unset_vty (struct vty
*vty
, const char *ip_str
)
3322 peer
= peer_lookup_vty (vty
, ip_str
);
3326 ret
= peer_timers_unset (peer
);
3328 return bgp_vty_return (vty
, ret
);
3331 DEFUN (neighbor_timers
,
3332 neighbor_timers_cmd
,
3333 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
3336 "BGP per neighbor timers\n"
3337 "Keepalive interval\n"
3340 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
3343 DEFUN (no_neighbor_timers
,
3344 no_neighbor_timers_cmd
,
3345 NO_NEIGHBOR_CMD2
"timers",
3349 "BGP per neighbor timers\n")
3351 return peer_timers_unset_vty (vty
, argv
[0]);
3355 peer_timers_connect_set_vty (struct vty
*vty
, const char *ip_str
,
3356 const char *time_str
)
3362 peer
= peer_lookup_vty (vty
, ip_str
);
3366 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
3368 ret
= peer_timers_connect_set (peer
, connect
);
3374 peer_timers_connect_unset_vty (struct vty
*vty
, const char *ip_str
)
3379 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3383 ret
= peer_timers_connect_unset (peer
);
3388 DEFUN (neighbor_timers_connect
,
3389 neighbor_timers_connect_cmd
,
3390 NEIGHBOR_CMD
"timers connect <0-65535>",
3393 "BGP per neighbor timers\n"
3394 "BGP connect timer\n"
3397 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
3400 DEFUN (no_neighbor_timers_connect
,
3401 no_neighbor_timers_connect_cmd
,
3402 NO_NEIGHBOR_CMD
"timers connect",
3406 "BGP per neighbor timers\n"
3407 "BGP connect timer\n")
3409 return peer_timers_connect_unset_vty (vty
, argv
[0]);
3412 ALIAS (no_neighbor_timers_connect
,
3413 no_neighbor_timers_connect_val_cmd
,
3414 NO_NEIGHBOR_CMD
"timers connect <0-65535>",
3418 "BGP per neighbor timers\n"
3419 "BGP connect timer\n"
3423 peer_advertise_interval_vty (struct vty
*vty
, const char *ip_str
,
3424 const char *time_str
, int set
)
3428 u_int32_t routeadv
= 0;
3430 peer
= peer_lookup_vty (vty
, ip_str
);
3435 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
3438 ret
= peer_advertise_interval_set (peer
, routeadv
);
3440 ret
= peer_advertise_interval_unset (peer
);
3445 DEFUN (neighbor_advertise_interval
,
3446 neighbor_advertise_interval_cmd
,
3447 NEIGHBOR_CMD
"advertisement-interval <0-600>",
3450 "Minimum interval between sending BGP routing updates\n"
3451 "time in seconds\n")
3453 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
3456 DEFUN (no_neighbor_advertise_interval
,
3457 no_neighbor_advertise_interval_cmd
,
3458 NO_NEIGHBOR_CMD
"advertisement-interval",
3462 "Minimum interval between sending BGP routing updates\n")
3464 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
3467 ALIAS (no_neighbor_advertise_interval
,
3468 no_neighbor_advertise_interval_val_cmd
,
3469 NO_NEIGHBOR_CMD
"advertisement-interval <0-600>",
3473 "Minimum interval between sending BGP routing updates\n"
3474 "time in seconds\n")
3476 /* neighbor interface */
3478 peer_interface_vty (struct vty
*vty
, const char *ip_str
, const char *str
)
3483 peer
= peer_lookup_vty (vty
, ip_str
);
3488 ret
= peer_interface_set (peer
, str
);
3490 ret
= peer_interface_unset (peer
);
3495 DEFUN (neighbor_interface
,
3496 neighbor_interface_cmd
,
3497 NEIGHBOR_CMD
"interface WORD",
3503 return peer_interface_vty (vty
, argv
[0], argv
[1]);
3506 DEFUN (no_neighbor_interface
,
3507 no_neighbor_interface_cmd
,
3508 NO_NEIGHBOR_CMD
"interface WORD",
3515 return peer_interface_vty (vty
, argv
[0], NULL
);
3518 /* Set distribute list to the peer. */
3520 peer_distribute_set_vty (struct vty
*vty
, const char *ip_str
,
3521 afi_t afi
, safi_t safi
,
3522 const char *name_str
, const char *direct_str
)
3526 int direct
= FILTER_IN
;
3528 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3532 /* Check filter direction. */
3533 if (strncmp (direct_str
, "i", 1) == 0)
3535 else if (strncmp (direct_str
, "o", 1) == 0)
3536 direct
= FILTER_OUT
;
3538 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
3540 return bgp_vty_return (vty
, ret
);
3544 peer_distribute_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3545 safi_t safi
, const char *direct_str
)
3549 int direct
= FILTER_IN
;
3551 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3555 /* Check filter direction. */
3556 if (strncmp (direct_str
, "i", 1) == 0)
3558 else if (strncmp (direct_str
, "o", 1) == 0)
3559 direct
= FILTER_OUT
;
3561 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
3563 return bgp_vty_return (vty
, ret
);
3566 DEFUN (neighbor_distribute_list
,
3567 neighbor_distribute_list_cmd
,
3568 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3571 "Filter updates to/from this neighbor\n"
3572 "IP access-list number\n"
3573 "IP access-list number (expanded range)\n"
3574 "IP Access-list name\n"
3575 "Filter incoming updates\n"
3576 "Filter outgoing updates\n")
3578 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3579 bgp_node_safi (vty
), argv
[1], argv
[2]);
3582 DEFUN (no_neighbor_distribute_list
,
3583 no_neighbor_distribute_list_cmd
,
3584 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3588 "Filter updates to/from this neighbor\n"
3589 "IP access-list number\n"
3590 "IP access-list number (expanded range)\n"
3591 "IP Access-list name\n"
3592 "Filter incoming updates\n"
3593 "Filter outgoing updates\n")
3595 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3596 bgp_node_safi (vty
), argv
[2]);
3599 /* Set prefix list to the peer. */
3601 peer_prefix_list_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3602 safi_t safi
, const char *name_str
,
3603 const char *direct_str
)
3607 int direct
= FILTER_IN
;
3609 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3613 /* Check filter direction. */
3614 if (strncmp (direct_str
, "i", 1) == 0)
3616 else if (strncmp (direct_str
, "o", 1) == 0)
3617 direct
= FILTER_OUT
;
3619 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
3621 return bgp_vty_return (vty
, ret
);
3625 peer_prefix_list_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3626 safi_t safi
, const char *direct_str
)
3630 int direct
= FILTER_IN
;
3632 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3636 /* Check filter direction. */
3637 if (strncmp (direct_str
, "i", 1) == 0)
3639 else if (strncmp (direct_str
, "o", 1) == 0)
3640 direct
= FILTER_OUT
;
3642 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
3644 return bgp_vty_return (vty
, ret
);
3647 DEFUN (neighbor_prefix_list
,
3648 neighbor_prefix_list_cmd
,
3649 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3652 "Filter updates to/from this neighbor\n"
3653 "Name of a prefix list\n"
3654 "Filter incoming updates\n"
3655 "Filter outgoing updates\n")
3657 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3658 bgp_node_safi (vty
), argv
[1], argv
[2]);
3661 DEFUN (no_neighbor_prefix_list
,
3662 no_neighbor_prefix_list_cmd
,
3663 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3667 "Filter updates to/from this neighbor\n"
3668 "Name of a prefix list\n"
3669 "Filter incoming updates\n"
3670 "Filter outgoing updates\n")
3672 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3673 bgp_node_safi (vty
), argv
[2]);
3677 peer_aslist_set_vty (struct vty
*vty
, const char *ip_str
,
3678 afi_t afi
, safi_t safi
,
3679 const char *name_str
, const char *direct_str
)
3683 int direct
= FILTER_IN
;
3685 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3689 /* Check filter direction. */
3690 if (strncmp (direct_str
, "i", 1) == 0)
3692 else if (strncmp (direct_str
, "o", 1) == 0)
3693 direct
= FILTER_OUT
;
3695 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
3697 return bgp_vty_return (vty
, ret
);
3701 peer_aslist_unset_vty (struct vty
*vty
, const char *ip_str
,
3702 afi_t afi
, safi_t safi
,
3703 const char *direct_str
)
3707 int direct
= FILTER_IN
;
3709 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3713 /* Check filter direction. */
3714 if (strncmp (direct_str
, "i", 1) == 0)
3716 else if (strncmp (direct_str
, "o", 1) == 0)
3717 direct
= FILTER_OUT
;
3719 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
3721 return bgp_vty_return (vty
, ret
);
3724 DEFUN (neighbor_filter_list
,
3725 neighbor_filter_list_cmd
,
3726 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3729 "Establish BGP filters\n"
3730 "AS path access-list name\n"
3731 "Filter incoming routes\n"
3732 "Filter outgoing routes\n")
3734 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3735 bgp_node_safi (vty
), argv
[1], argv
[2]);
3738 DEFUN (no_neighbor_filter_list
,
3739 no_neighbor_filter_list_cmd
,
3740 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3744 "Establish BGP filters\n"
3745 "AS path access-list name\n"
3746 "Filter incoming routes\n"
3747 "Filter outgoing routes\n")
3749 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3750 bgp_node_safi (vty
), argv
[2]);
3753 /* Set route-map to the peer. */
3755 peer_route_map_set_vty (struct vty
*vty
, const char *ip_str
,
3756 afi_t afi
, safi_t safi
,
3757 const char *name_str
, const char *direct_str
)
3761 int direct
= RMAP_IN
;
3763 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3767 /* Check filter direction. */
3768 if (strncmp (direct_str
, "in", 2) == 0)
3770 else if (strncmp (direct_str
, "o", 1) == 0)
3772 else if (strncmp (direct_str
, "im", 2) == 0)
3773 direct
= RMAP_IMPORT
;
3774 else if (strncmp (direct_str
, "e", 1) == 0)
3775 direct
= RMAP_EXPORT
;
3777 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
3779 return bgp_vty_return (vty
, ret
);
3783 peer_route_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3784 safi_t safi
, const char *direct_str
)
3788 int direct
= RMAP_IN
;
3790 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3794 /* Check filter direction. */
3795 if (strncmp (direct_str
, "in", 2) == 0)
3797 else if (strncmp (direct_str
, "o", 1) == 0)
3799 else if (strncmp (direct_str
, "im", 2) == 0)
3800 direct
= RMAP_IMPORT
;
3801 else if (strncmp (direct_str
, "e", 1) == 0)
3802 direct
= RMAP_EXPORT
;
3804 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
3806 return bgp_vty_return (vty
, ret
);
3809 DEFUN (neighbor_route_map
,
3810 neighbor_route_map_cmd
,
3811 NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3814 "Apply route map to neighbor\n"
3815 "Name of route map\n"
3816 "Apply map to incoming routes\n"
3817 "Apply map to outbound routes\n"
3818 "Apply map to routes going into a Route-Server client's table\n"
3819 "Apply map to routes coming from a Route-Server client")
3821 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3822 bgp_node_safi (vty
), argv
[1], argv
[2]);
3825 DEFUN (no_neighbor_route_map
,
3826 no_neighbor_route_map_cmd
,
3827 NO_NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3831 "Apply route map to neighbor\n"
3832 "Name of route map\n"
3833 "Apply map to incoming routes\n"
3834 "Apply map to outbound routes\n"
3835 "Apply map to routes going into a Route-Server client's table\n"
3836 "Apply map to routes coming from a Route-Server client")
3838 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3839 bgp_node_safi (vty
), argv
[2]);
3842 /* Set unsuppress-map to the peer. */
3844 peer_unsuppress_map_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3845 safi_t safi
, const char *name_str
)
3850 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3854 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
3856 return bgp_vty_return (vty
, ret
);
3859 /* Unset route-map from the peer. */
3861 peer_unsuppress_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3867 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3871 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
3873 return bgp_vty_return (vty
, ret
);
3876 DEFUN (neighbor_unsuppress_map
,
3877 neighbor_unsuppress_map_cmd
,
3878 NEIGHBOR_CMD2
"unsuppress-map WORD",
3881 "Route-map to selectively unsuppress suppressed routes\n"
3882 "Name of route map\n")
3884 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3885 bgp_node_safi (vty
), argv
[1]);
3888 DEFUN (no_neighbor_unsuppress_map
,
3889 no_neighbor_unsuppress_map_cmd
,
3890 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
3894 "Route-map to selectively unsuppress suppressed routes\n"
3895 "Name of route map\n")
3897 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3898 bgp_node_safi (vty
));
3902 peer_maximum_prefix_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3903 safi_t safi
, const char *num_str
,
3904 const char *threshold_str
, int warning
,
3905 const char *restart_str
)
3913 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3917 VTY_GET_INTEGER ("maximum number", max
, num_str
);
3919 threshold
= atoi (threshold_str
);
3921 threshold
= MAXIMUM_PREFIX_THRESHOLD_DEFAULT
;
3924 restart
= atoi (restart_str
);
3928 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, threshold
, warning
, restart
);
3930 return bgp_vty_return (vty
, ret
);
3934 peer_maximum_prefix_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3940 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3944 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
3946 return bgp_vty_return (vty
, ret
);
3949 /* Maximum number of prefix configuration. prefix count is different
3950 for each peer configuration. So this configuration can be set for
3951 each peer configuration. */
3952 DEFUN (neighbor_maximum_prefix
,
3953 neighbor_maximum_prefix_cmd
,
3954 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3957 "Maximum number of prefix accept from this peer\n"
3958 "maximum no. of prefix limit\n")
3960 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3961 bgp_node_safi (vty
), argv
[1], NULL
, 0,
3965 DEFUN (neighbor_maximum_prefix_threshold
,
3966 neighbor_maximum_prefix_threshold_cmd
,
3967 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
3970 "Maximum number of prefix accept from this peer\n"
3971 "maximum no. of prefix limit\n"
3972 "Threshold value (%) at which to generate a warning msg\n")
3974 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3975 bgp_node_safi (vty
), argv
[1], argv
[2], 0,
3979 DEFUN (neighbor_maximum_prefix_warning
,
3980 neighbor_maximum_prefix_warning_cmd
,
3981 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3984 "Maximum number of prefix accept from this peer\n"
3985 "maximum no. of prefix limit\n"
3986 "Only give warning message when limit is exceeded\n")
3988 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3989 bgp_node_safi (vty
), argv
[1], NULL
, 1,
3993 DEFUN (neighbor_maximum_prefix_threshold_warning
,
3994 neighbor_maximum_prefix_threshold_warning_cmd
,
3995 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3998 "Maximum number of prefix accept from this peer\n"
3999 "maximum no. of prefix limit\n"
4000 "Threshold value (%) at which to generate a warning msg\n"
4001 "Only give warning message when limit is exceeded\n")
4003 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4004 bgp_node_safi (vty
), argv
[1], argv
[2], 1, NULL
);
4007 DEFUN (neighbor_maximum_prefix_restart
,
4008 neighbor_maximum_prefix_restart_cmd
,
4009 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
4012 "Maximum number of prefix accept from this peer\n"
4013 "maximum no. of prefix limit\n"
4014 "Restart bgp connection after limit is exceeded\n"
4015 "Restart interval in minutes")
4017 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4018 bgp_node_safi (vty
), argv
[1], NULL
, 0, argv
[2]);
4021 DEFUN (neighbor_maximum_prefix_threshold_restart
,
4022 neighbor_maximum_prefix_threshold_restart_cmd
,
4023 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
4026 "Maximum number of prefix accept from this peer\n"
4027 "maximum no. of prefix limit\n"
4028 "Threshold value (%) at which to generate a warning msg\n"
4029 "Restart bgp connection after limit is exceeded\n"
4030 "Restart interval in minutes")
4032 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4033 bgp_node_safi (vty
), argv
[1], argv
[2], 0, argv
[3]);
4036 DEFUN (no_neighbor_maximum_prefix
,
4037 no_neighbor_maximum_prefix_cmd
,
4038 NO_NEIGHBOR_CMD2
"maximum-prefix",
4042 "Maximum number of prefix accept from this peer\n")
4044 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4045 bgp_node_safi (vty
));
4048 ALIAS (no_neighbor_maximum_prefix
,
4049 no_neighbor_maximum_prefix_val_cmd
,
4050 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
4054 "Maximum number of prefix accept from this peer\n"
4055 "maximum no. of prefix limit\n")
4057 ALIAS (no_neighbor_maximum_prefix
,
4058 no_neighbor_maximum_prefix_threshold_cmd
,
4059 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
4063 "Maximum number of prefix accept from this peer\n"
4064 "maximum no. of prefix limit\n"
4065 "Threshold value (%) at which to generate a warning msg\n")
4067 ALIAS (no_neighbor_maximum_prefix
,
4068 no_neighbor_maximum_prefix_warning_cmd
,
4069 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
4073 "Maximum number of prefix accept from this peer\n"
4074 "maximum no. of prefix limit\n"
4075 "Only give warning message when limit is exceeded\n")
4077 ALIAS (no_neighbor_maximum_prefix
,
4078 no_neighbor_maximum_prefix_threshold_warning_cmd
,
4079 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
4083 "Maximum number of prefix accept from this peer\n"
4084 "maximum no. of prefix limit\n"
4085 "Threshold value (%) at which to generate a warning msg\n"
4086 "Only give warning message when limit is exceeded\n")
4088 ALIAS (no_neighbor_maximum_prefix
,
4089 no_neighbor_maximum_prefix_restart_cmd
,
4090 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
4094 "Maximum number of prefix accept from this peer\n"
4095 "maximum no. of prefix limit\n"
4096 "Restart bgp connection after limit is exceeded\n"
4097 "Restart interval in minutes")
4099 ALIAS (no_neighbor_maximum_prefix
,
4100 no_neighbor_maximum_prefix_threshold_restart_cmd
,
4101 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
4105 "Maximum number of prefix accept from this peer\n"
4106 "maximum no. of prefix limit\n"
4107 "Threshold value (%) at which to generate a warning msg\n"
4108 "Restart bgp connection after limit is exceeded\n"
4109 "Restart interval in minutes")
4111 /* "neighbor allowas-in" */
4112 DEFUN (neighbor_allowas_in
,
4113 neighbor_allowas_in_cmd
,
4114 NEIGHBOR_CMD2
"allowas-in",
4117 "Accept as-path with my AS present in it\n")
4121 unsigned int allow_num
;
4123 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4130 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
4132 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
4135 return bgp_vty_return (vty
, ret
);
4138 ALIAS (neighbor_allowas_in
,
4139 neighbor_allowas_in_arg_cmd
,
4140 NEIGHBOR_CMD2
"allowas-in <1-10>",
4143 "Accept as-path with my AS present in it\n"
4144 "Number of occurances of AS number\n")
4146 DEFUN (no_neighbor_allowas_in
,
4147 no_neighbor_allowas_in_cmd
,
4148 NO_NEIGHBOR_CMD2
"allowas-in",
4152 "allow local ASN appears in aspath attribute\n")
4157 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4161 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
4163 return bgp_vty_return (vty
, ret
);
4166 DEFUN (neighbor_ttl_security
,
4167 neighbor_ttl_security_cmd
,
4168 NEIGHBOR_CMD2
"ttl-security hops <1-254>",
4171 "Specify the maximum number of hops to the BGP peer\n")
4176 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4180 VTY_GET_INTEGER_RANGE ("", gtsm_hops
, argv
[1], 1, 254);
4182 return bgp_vty_return (vty
, peer_ttl_security_hops_set (peer
, gtsm_hops
));
4185 DEFUN (no_neighbor_ttl_security
,
4186 no_neighbor_ttl_security_cmd
,
4187 NO_NEIGHBOR_CMD2
"ttl-security hops <1-254>",
4191 "Specify the maximum number of hops to the BGP peer\n")
4195 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4199 return bgp_vty_return (vty
, peer_ttl_security_hops_unset (peer
));
4202 /* Address family configuration. */
4203 DEFUN (address_family_ipv4
,
4204 address_family_ipv4_cmd
,
4205 "address-family ipv4",
4206 "Enter Address Family command mode\n"
4209 vty
->node
= BGP_IPV4_NODE
;
4213 DEFUN (address_family_ipv4_safi
,
4214 address_family_ipv4_safi_cmd
,
4215 "address-family ipv4 (unicast|multicast)",
4216 "Enter Address Family command mode\n"
4218 "Address Family modifier\n"
4219 "Address Family modifier\n")
4221 if (strncmp (argv
[0], "m", 1) == 0)
4222 vty
->node
= BGP_IPV4M_NODE
;
4224 vty
->node
= BGP_IPV4_NODE
;
4229 DEFUN (address_family_ipv6
,
4230 address_family_ipv6_cmd
,
4231 "address-family ipv6",
4232 "Enter Address Family command mode\n"
4235 vty
->node
= BGP_IPV6_NODE
;
4239 DEFUN (address_family_ipv6_safi
,
4240 address_family_ipv6_safi_cmd
,
4241 "address-family ipv6 (unicast|multicast)",
4242 "Enter Address Family command mode\n"
4244 "Address Family modifier\n"
4245 "Address Family modifier\n")
4247 if (strncmp (argv
[0], "m", 1) == 0)
4248 vty
->node
= BGP_IPV6M_NODE
;
4250 vty
->node
= BGP_IPV6_NODE
;
4255 DEFUN (address_family_vpnv4
,
4256 address_family_vpnv4_cmd
,
4257 "address-family vpnv4",
4258 "Enter Address Family command mode\n"
4261 vty
->node
= BGP_VPNV4_NODE
;
4265 ALIAS (address_family_vpnv4
,
4266 address_family_vpnv4_unicast_cmd
,
4267 "address-family vpnv4 unicast",
4268 "Enter Address Family command mode\n"
4270 "Address Family Modifier\n")
4272 DEFUN (exit_address_family
,
4273 exit_address_family_cmd
,
4274 "exit-address-family",
4275 "Exit from Address Family configuration mode\n")
4277 if (vty
->node
== BGP_IPV4_NODE
4278 || vty
->node
== BGP_IPV4M_NODE
4279 || vty
->node
== BGP_VPNV4_NODE
4280 || vty
->node
== BGP_IPV6_NODE
4281 || vty
->node
== BGP_IPV6M_NODE
)
4282 vty
->node
= BGP_NODE
;
4286 /* BGP clear sort. */
4297 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
4298 safi_t safi
, int error
)
4302 case BGP_ERR_AF_UNCONFIGURED
:
4304 "%%BGP: Enable %s %s address family for the neighbor %s%s",
4305 afi
== AFI_IP6
? "IPv6" : safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
4306 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
4307 peer
->host
, VTY_NEWLINE
);
4309 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
4310 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
);
4317 /* `clear ip bgp' functions. */
4319 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
4320 enum clear_sort sort
,enum bgp_clear_type stype
, const char *arg
)
4324 struct listnode
*node
, *nnode
;
4326 /* Clear all neighbors. */
4327 if (sort
== clear_all
)
4329 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4331 if (stype
== BGP_CLEAR_SOFT_NONE
)
4332 ret
= peer_clear (peer
);
4334 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4337 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4342 /* Clear specified neighbors. */
4343 if (sort
== clear_peer
)
4348 /* Make sockunion for lookup. */
4349 ret
= str2sockunion (arg
, &su
);
4352 vty_out (vty
, "Malformed address: %s%s", arg
, VTY_NEWLINE
);
4355 peer
= peer_lookup (bgp
, &su
);
4358 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
4362 if (stype
== BGP_CLEAR_SOFT_NONE
)
4363 ret
= peer_clear (peer
);
4365 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4368 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4373 /* Clear all peer-group members. */
4374 if (sort
== clear_group
)
4376 struct peer_group
*group
;
4378 group
= peer_group_lookup (bgp
, arg
);
4381 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
4385 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
4387 if (stype
== BGP_CLEAR_SOFT_NONE
)
4389 ret
= peer_clear (peer
);
4393 if (! peer
->af_group
[afi
][safi
])
4396 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4399 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4404 if (sort
== clear_external
)
4406 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4408 if (peer
->sort
== BGP_PEER_IBGP
)
4411 if (stype
== BGP_CLEAR_SOFT_NONE
)
4412 ret
= peer_clear (peer
);
4414 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4417 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4422 if (sort
== clear_as
)
4427 VTY_GET_INTEGER_RANGE ("AS", as
, arg
, 1, BGP_AS4_MAX
);
4429 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4435 if (stype
== BGP_CLEAR_SOFT_NONE
)
4436 ret
= peer_clear (peer
);
4438 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4441 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4444 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
4453 bgp_clear_vty (struct vty
*vty
, const char *name
, afi_t afi
, safi_t safi
,
4454 enum clear_sort sort
, enum bgp_clear_type stype
,
4459 /* BGP structure lookup. */
4462 bgp
= bgp_lookup_by_name (name
);
4465 vty_out (vty
, "Can't find BGP view %s%s", name
, VTY_NEWLINE
);
4471 bgp
= bgp_get_default ();
4474 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
4479 return bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
4482 DEFUN (clear_ip_bgp_all
,
4483 clear_ip_bgp_all_cmd
,
4488 "Clear all peers\n")
4491 return bgp_clear_vty (vty
, argv
[0], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4493 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4496 ALIAS (clear_ip_bgp_all
,
4501 "Clear all peers\n")
4503 ALIAS (clear_ip_bgp_all
,
4504 clear_bgp_ipv6_all_cmd
,
4509 "Clear all peers\n")
4511 ALIAS (clear_ip_bgp_all
,
4512 clear_ip_bgp_instance_all_cmd
,
4513 "clear ip bgp view WORD *",
4519 "Clear all peers\n")
4521 ALIAS (clear_ip_bgp_all
,
4522 clear_bgp_instance_all_cmd
,
4523 "clear bgp view WORD *",
4528 "Clear all peers\n")
4530 DEFUN (clear_ip_bgp_peer
,
4531 clear_ip_bgp_peer_cmd
,
4532 "clear ip bgp (A.B.C.D|X:X::X:X)",
4536 "BGP neighbor IP address to clear\n"
4537 "BGP IPv6 neighbor to clear\n")
4539 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4542 ALIAS (clear_ip_bgp_peer
,
4544 "clear bgp (A.B.C.D|X:X::X:X)",
4547 "BGP neighbor address to clear\n"
4548 "BGP IPv6 neighbor to clear\n")
4550 ALIAS (clear_ip_bgp_peer
,
4551 clear_bgp_ipv6_peer_cmd
,
4552 "clear bgp ipv6 (A.B.C.D|X:X::X:X)",
4556 "BGP neighbor address to clear\n"
4557 "BGP IPv6 neighbor to clear\n")
4559 DEFUN (clear_ip_bgp_peer_group
,
4560 clear_ip_bgp_peer_group_cmd
,
4561 "clear ip bgp peer-group WORD",
4565 "Clear all members of peer-group\n"
4566 "BGP peer-group name\n")
4568 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4571 ALIAS (clear_ip_bgp_peer_group
,
4572 clear_bgp_peer_group_cmd
,
4573 "clear bgp peer-group WORD",
4576 "Clear all members of peer-group\n"
4577 "BGP peer-group name\n")
4579 ALIAS (clear_ip_bgp_peer_group
,
4580 clear_bgp_ipv6_peer_group_cmd
,
4581 "clear bgp ipv6 peer-group WORD",
4585 "Clear all members of peer-group\n"
4586 "BGP peer-group name\n")
4588 DEFUN (clear_ip_bgp_external
,
4589 clear_ip_bgp_external_cmd
,
4590 "clear ip bgp external",
4594 "Clear all external peers\n")
4596 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
4599 ALIAS (clear_ip_bgp_external
,
4600 clear_bgp_external_cmd
,
4601 "clear bgp external",
4604 "Clear all external peers\n")
4606 ALIAS (clear_ip_bgp_external
,
4607 clear_bgp_ipv6_external_cmd
,
4608 "clear bgp ipv6 external",
4612 "Clear all external peers\n")
4614 DEFUN (clear_ip_bgp_as
,
4615 clear_ip_bgp_as_cmd
,
4616 "clear ip bgp " CMD_AS_RANGE
,
4620 "Clear peers with the AS number\n")
4622 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4625 ALIAS (clear_ip_bgp_as
,
4627 "clear bgp " CMD_AS_RANGE
,
4630 "Clear peers with the AS number\n")
4632 ALIAS (clear_ip_bgp_as
,
4633 clear_bgp_ipv6_as_cmd
,
4634 "clear bgp ipv6 " CMD_AS_RANGE
,
4638 "Clear peers with the AS number\n")
4640 /* Outbound soft-reconfiguration */
4641 DEFUN (clear_ip_bgp_all_soft_out
,
4642 clear_ip_bgp_all_soft_out_cmd
,
4643 "clear ip bgp * soft out",
4649 "Soft reconfig outbound update\n")
4652 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4653 BGP_CLEAR_SOFT_OUT
, NULL
);
4655 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4656 BGP_CLEAR_SOFT_OUT
, NULL
);
4659 ALIAS (clear_ip_bgp_all_soft_out
,
4660 clear_ip_bgp_all_out_cmd
,
4661 "clear ip bgp * out",
4666 "Soft reconfig outbound update\n")
4668 ALIAS (clear_ip_bgp_all_soft_out
,
4669 clear_ip_bgp_instance_all_soft_out_cmd
,
4670 "clear ip bgp view WORD * soft out",
4678 "Soft reconfig outbound update\n")
4680 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
4681 clear_ip_bgp_all_ipv4_soft_out_cmd
,
4682 "clear ip bgp * ipv4 (unicast|multicast) soft out",
4688 "Address Family modifier\n"
4689 "Address Family modifier\n"
4691 "Soft reconfig outbound update\n")
4693 if (strncmp (argv
[0], "m", 1) == 0)
4694 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4695 BGP_CLEAR_SOFT_OUT
, NULL
);
4697 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4698 BGP_CLEAR_SOFT_OUT
, NULL
);
4701 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
4702 clear_ip_bgp_all_ipv4_out_cmd
,
4703 "clear ip bgp * ipv4 (unicast|multicast) out",
4709 "Address Family modifier\n"
4710 "Address Family modifier\n"
4711 "Soft reconfig outbound update\n")
4713 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
4714 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
4715 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out",
4723 "Address Family modifier\n"
4724 "Address Family modifier\n"
4725 "Soft reconfig outbound update\n")
4727 if (strncmp (argv
[1], "m", 1) == 0)
4728 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4729 BGP_CLEAR_SOFT_OUT
, NULL
);
4731 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4732 BGP_CLEAR_SOFT_OUT
, NULL
);
4735 DEFUN (clear_ip_bgp_all_vpnv4_soft_out
,
4736 clear_ip_bgp_all_vpnv4_soft_out_cmd
,
4737 "clear ip bgp * vpnv4 unicast soft out",
4743 "Address Family Modifier\n"
4745 "Soft reconfig outbound update\n")
4747 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
4748 BGP_CLEAR_SOFT_OUT
, NULL
);
4751 ALIAS (clear_ip_bgp_all_vpnv4_soft_out
,
4752 clear_ip_bgp_all_vpnv4_out_cmd
,
4753 "clear ip bgp * vpnv4 unicast out",
4759 "Address Family Modifier\n"
4760 "Soft reconfig outbound update\n")
4762 DEFUN (clear_bgp_all_soft_out
,
4763 clear_bgp_all_soft_out_cmd
,
4764 "clear bgp * soft out",
4769 "Soft reconfig outbound update\n")
4772 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
4773 BGP_CLEAR_SOFT_OUT
, NULL
);
4775 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
4776 BGP_CLEAR_SOFT_OUT
, NULL
);
4779 ALIAS (clear_bgp_all_soft_out
,
4780 clear_bgp_instance_all_soft_out_cmd
,
4781 "clear bgp view WORD * soft out",
4788 "Soft reconfig outbound update\n")
4790 ALIAS (clear_bgp_all_soft_out
,
4791 clear_bgp_all_out_cmd
,
4796 "Soft reconfig outbound update\n")
4798 ALIAS (clear_bgp_all_soft_out
,
4799 clear_bgp_ipv6_all_soft_out_cmd
,
4800 "clear bgp ipv6 * soft out",
4806 "Soft reconfig outbound update\n")
4808 ALIAS (clear_bgp_all_soft_out
,
4809 clear_bgp_ipv6_all_out_cmd
,
4810 "clear bgp ipv6 * out",
4815 "Soft reconfig outbound update\n")
4817 DEFUN (clear_ip_bgp_peer_soft_out
,
4818 clear_ip_bgp_peer_soft_out_cmd
,
4819 "clear ip bgp A.B.C.D soft out",
4823 "BGP neighbor address to clear\n"
4825 "Soft reconfig outbound update\n")
4827 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4828 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4831 ALIAS (clear_ip_bgp_peer_soft_out
,
4832 clear_ip_bgp_peer_out_cmd
,
4833 "clear ip bgp A.B.C.D out",
4837 "BGP neighbor address to clear\n"
4838 "Soft reconfig outbound update\n")
4840 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
4841 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
4842 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out",
4846 "BGP neighbor address to clear\n"
4848 "Address Family modifier\n"
4849 "Address Family modifier\n"
4851 "Soft reconfig outbound update\n")
4853 if (strncmp (argv
[1], "m", 1) == 0)
4854 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
4855 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4857 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4858 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4861 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
4862 clear_ip_bgp_peer_ipv4_out_cmd
,
4863 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out",
4867 "BGP neighbor address to clear\n"
4869 "Address Family modifier\n"
4870 "Address Family modifier\n"
4871 "Soft reconfig outbound update\n")
4873 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out
,
4874 clear_ip_bgp_peer_vpnv4_soft_out_cmd
,
4875 "clear ip bgp A.B.C.D vpnv4 unicast soft out",
4879 "BGP neighbor address to clear\n"
4881 "Address Family Modifier\n"
4883 "Soft reconfig outbound update\n")
4885 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
4886 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4889 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out
,
4890 clear_ip_bgp_peer_vpnv4_out_cmd
,
4891 "clear ip bgp A.B.C.D vpnv4 unicast out",
4895 "BGP neighbor address to clear\n"
4897 "Address Family Modifier\n"
4898 "Soft reconfig outbound update\n")
4900 DEFUN (clear_bgp_peer_soft_out
,
4901 clear_bgp_peer_soft_out_cmd
,
4902 "clear bgp (A.B.C.D|X:X::X:X) soft out",
4905 "BGP neighbor address to clear\n"
4906 "BGP IPv6 neighbor to clear\n"
4908 "Soft reconfig outbound update\n")
4910 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
4911 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4914 ALIAS (clear_bgp_peer_soft_out
,
4915 clear_bgp_ipv6_peer_soft_out_cmd
,
4916 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out",
4920 "BGP neighbor address to clear\n"
4921 "BGP IPv6 neighbor to clear\n"
4923 "Soft reconfig outbound update\n")
4925 ALIAS (clear_bgp_peer_soft_out
,
4926 clear_bgp_peer_out_cmd
,
4927 "clear bgp (A.B.C.D|X:X::X:X) out",
4930 "BGP neighbor address to clear\n"
4931 "BGP IPv6 neighbor to clear\n"
4932 "Soft reconfig outbound update\n")
4934 ALIAS (clear_bgp_peer_soft_out
,
4935 clear_bgp_ipv6_peer_out_cmd
,
4936 "clear bgp ipv6 (A.B.C.D|X:X::X:X) out",
4940 "BGP neighbor address to clear\n"
4941 "BGP IPv6 neighbor to clear\n"
4942 "Soft reconfig outbound update\n")
4944 DEFUN (clear_ip_bgp_peer_group_soft_out
,
4945 clear_ip_bgp_peer_group_soft_out_cmd
,
4946 "clear ip bgp peer-group WORD soft out",
4950 "Clear all members of peer-group\n"
4951 "BGP peer-group name\n"
4953 "Soft reconfig outbound update\n")
4955 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4956 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4959 ALIAS (clear_ip_bgp_peer_group_soft_out
,
4960 clear_ip_bgp_peer_group_out_cmd
,
4961 "clear ip bgp peer-group WORD out",
4965 "Clear all members of peer-group\n"
4966 "BGP peer-group name\n"
4967 "Soft reconfig outbound update\n")
4969 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
4970 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
4971 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
4975 "Clear all members of peer-group\n"
4976 "BGP peer-group name\n"
4978 "Address Family modifier\n"
4979 "Address Family modifier\n"
4981 "Soft reconfig outbound update\n")
4983 if (strncmp (argv
[1], "m", 1) == 0)
4984 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
4985 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4987 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4988 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4991 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
4992 clear_ip_bgp_peer_group_ipv4_out_cmd
,
4993 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
4997 "Clear all members of peer-group\n"
4998 "BGP peer-group name\n"
5000 "Address Family modifier\n"
5001 "Address Family modifier\n"
5002 "Soft reconfig outbound update\n")
5004 DEFUN (clear_bgp_peer_group_soft_out
,
5005 clear_bgp_peer_group_soft_out_cmd
,
5006 "clear bgp peer-group WORD soft out",
5009 "Clear all members of peer-group\n"
5010 "BGP peer-group name\n"
5012 "Soft reconfig outbound update\n")
5014 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5015 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5018 ALIAS (clear_bgp_peer_group_soft_out
,
5019 clear_bgp_ipv6_peer_group_soft_out_cmd
,
5020 "clear bgp ipv6 peer-group WORD soft out",
5024 "Clear all members of peer-group\n"
5025 "BGP peer-group name\n"
5027 "Soft reconfig outbound update\n")
5029 ALIAS (clear_bgp_peer_group_soft_out
,
5030 clear_bgp_peer_group_out_cmd
,
5031 "clear bgp peer-group WORD out",
5034 "Clear all members of peer-group\n"
5035 "BGP peer-group name\n"
5036 "Soft reconfig outbound update\n")
5038 ALIAS (clear_bgp_peer_group_soft_out
,
5039 clear_bgp_ipv6_peer_group_out_cmd
,
5040 "clear bgp ipv6 peer-group WORD out",
5044 "Clear all members of peer-group\n"
5045 "BGP peer-group name\n"
5046 "Soft reconfig outbound update\n")
5048 DEFUN (clear_ip_bgp_external_soft_out
,
5049 clear_ip_bgp_external_soft_out_cmd
,
5050 "clear ip bgp external soft out",
5054 "Clear all external peers\n"
5056 "Soft reconfig outbound update\n")
5058 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5059 BGP_CLEAR_SOFT_OUT
, NULL
);
5062 ALIAS (clear_ip_bgp_external_soft_out
,
5063 clear_ip_bgp_external_out_cmd
,
5064 "clear ip bgp external out",
5068 "Clear all external peers\n"
5069 "Soft reconfig outbound update\n")
5071 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
5072 clear_ip_bgp_external_ipv4_soft_out_cmd
,
5073 "clear ip bgp external ipv4 (unicast|multicast) soft out",
5077 "Clear all external peers\n"
5079 "Address Family modifier\n"
5080 "Address Family modifier\n"
5082 "Soft reconfig outbound update\n")
5084 if (strncmp (argv
[0], "m", 1) == 0)
5085 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5086 BGP_CLEAR_SOFT_OUT
, NULL
);
5088 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5089 BGP_CLEAR_SOFT_OUT
, NULL
);
5092 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
5093 clear_ip_bgp_external_ipv4_out_cmd
,
5094 "clear ip bgp external ipv4 (unicast|multicast) out",
5098 "Clear all external peers\n"
5100 "Address Family modifier\n"
5101 "Address Family modifier\n"
5102 "Soft reconfig outbound update\n")
5104 DEFUN (clear_bgp_external_soft_out
,
5105 clear_bgp_external_soft_out_cmd
,
5106 "clear bgp external soft out",
5109 "Clear all external peers\n"
5111 "Soft reconfig outbound update\n")
5113 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5114 BGP_CLEAR_SOFT_OUT
, NULL
);
5117 ALIAS (clear_bgp_external_soft_out
,
5118 clear_bgp_ipv6_external_soft_out_cmd
,
5119 "clear bgp ipv6 external soft out",
5123 "Clear all external peers\n"
5125 "Soft reconfig outbound update\n")
5127 ALIAS (clear_bgp_external_soft_out
,
5128 clear_bgp_external_out_cmd
,
5129 "clear bgp external out",
5132 "Clear all external peers\n"
5133 "Soft reconfig outbound update\n")
5135 ALIAS (clear_bgp_external_soft_out
,
5136 clear_bgp_ipv6_external_out_cmd
,
5137 "clear bgp ipv6 external WORD out",
5141 "Clear all external peers\n"
5142 "Soft reconfig outbound update\n")
5144 DEFUN (clear_ip_bgp_as_soft_out
,
5145 clear_ip_bgp_as_soft_out_cmd
,
5146 "clear ip bgp " CMD_AS_RANGE
" soft out",
5150 "Clear peers with the AS number\n"
5152 "Soft reconfig outbound update\n")
5154 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5155 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5158 ALIAS (clear_ip_bgp_as_soft_out
,
5159 clear_ip_bgp_as_out_cmd
,
5160 "clear ip bgp " CMD_AS_RANGE
" out",
5164 "Clear peers with the AS number\n"
5165 "Soft reconfig outbound update\n")
5167 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
5168 clear_ip_bgp_as_ipv4_soft_out_cmd
,
5169 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft out",
5173 "Clear peers with the AS number\n"
5175 "Address Family modifier\n"
5176 "Address Family modifier\n"
5178 "Soft reconfig outbound update\n")
5180 if (strncmp (argv
[1], "m", 1) == 0)
5181 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5182 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5184 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5185 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5188 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
5189 clear_ip_bgp_as_ipv4_out_cmd
,
5190 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) out",
5194 "Clear peers with the AS number\n"
5196 "Address Family modifier\n"
5197 "Address Family modifier\n"
5198 "Soft reconfig outbound update\n")
5200 DEFUN (clear_ip_bgp_as_vpnv4_soft_out
,
5201 clear_ip_bgp_as_vpnv4_soft_out_cmd
,
5202 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft out",
5206 "Clear peers with the AS number\n"
5208 "Address Family modifier\n"
5210 "Soft reconfig outbound update\n")
5212 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
5213 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5216 ALIAS (clear_ip_bgp_as_vpnv4_soft_out
,
5217 clear_ip_bgp_as_vpnv4_out_cmd
,
5218 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast out",
5222 "Clear peers with the AS number\n"
5224 "Address Family modifier\n"
5225 "Soft reconfig outbound update\n")
5227 DEFUN (clear_bgp_as_soft_out
,
5228 clear_bgp_as_soft_out_cmd
,
5229 "clear bgp " CMD_AS_RANGE
" soft out",
5232 "Clear peers with the AS number\n"
5234 "Soft reconfig outbound update\n")
5236 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5237 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5240 ALIAS (clear_bgp_as_soft_out
,
5241 clear_bgp_ipv6_as_soft_out_cmd
,
5242 "clear bgp ipv6 " CMD_AS_RANGE
" soft out",
5246 "Clear peers with the AS number\n"
5248 "Soft reconfig outbound update\n")
5250 ALIAS (clear_bgp_as_soft_out
,
5251 clear_bgp_as_out_cmd
,
5252 "clear bgp " CMD_AS_RANGE
" out",
5255 "Clear peers with the AS number\n"
5256 "Soft reconfig outbound update\n")
5258 ALIAS (clear_bgp_as_soft_out
,
5259 clear_bgp_ipv6_as_out_cmd
,
5260 "clear bgp ipv6 " CMD_AS_RANGE
" out",
5264 "Clear peers with the AS number\n"
5265 "Soft reconfig outbound update\n")
5267 /* Inbound soft-reconfiguration */
5268 DEFUN (clear_ip_bgp_all_soft_in
,
5269 clear_ip_bgp_all_soft_in_cmd
,
5270 "clear ip bgp * soft in",
5276 "Soft reconfig inbound update\n")
5279 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5280 BGP_CLEAR_SOFT_IN
, NULL
);
5282 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5283 BGP_CLEAR_SOFT_IN
, NULL
);
5286 ALIAS (clear_ip_bgp_all_soft_in
,
5287 clear_ip_bgp_instance_all_soft_in_cmd
,
5288 "clear ip bgp view WORD * soft in",
5296 "Soft reconfig inbound update\n")
5298 ALIAS (clear_ip_bgp_all_soft_in
,
5299 clear_ip_bgp_all_in_cmd
,
5300 "clear ip bgp * in",
5305 "Soft reconfig inbound update\n")
5307 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
5308 clear_ip_bgp_all_in_prefix_filter_cmd
,
5309 "clear ip bgp * in prefix-filter",
5314 "Soft reconfig inbound update\n"
5315 "Push out prefix-list ORF and do inbound soft reconfig\n")
5318 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5319 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5321 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5322 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5325 ALIAS (clear_ip_bgp_all_in_prefix_filter
,
5326 clear_ip_bgp_instance_all_in_prefix_filter_cmd
,
5327 "clear ip bgp view WORD * in prefix-filter",
5334 "Soft reconfig inbound update\n"
5335 "Push out prefix-list ORF and do inbound soft reconfig\n")
5338 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
5339 clear_ip_bgp_all_ipv4_soft_in_cmd
,
5340 "clear ip bgp * ipv4 (unicast|multicast) soft in",
5346 "Address Family modifier\n"
5347 "Address Family modifier\n"
5349 "Soft reconfig inbound update\n")
5351 if (strncmp (argv
[0], "m", 1) == 0)
5352 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5353 BGP_CLEAR_SOFT_IN
, NULL
);
5355 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5356 BGP_CLEAR_SOFT_IN
, NULL
);
5359 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
5360 clear_ip_bgp_all_ipv4_in_cmd
,
5361 "clear ip bgp * ipv4 (unicast|multicast) in",
5367 "Address Family modifier\n"
5368 "Address Family modifier\n"
5369 "Soft reconfig inbound update\n")
5371 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
5372 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
5373 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in",
5381 "Address Family modifier\n"
5382 "Address Family modifier\n"
5384 "Soft reconfig inbound update\n")
5386 if (strncmp (argv
[1], "m", 1) == 0)
5387 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5388 BGP_CLEAR_SOFT_IN
, NULL
);
5390 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5391 BGP_CLEAR_SOFT_IN
, NULL
);
5394 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
5395 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
5396 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
5402 "Address Family modifier\n"
5403 "Address Family modifier\n"
5404 "Soft reconfig inbound update\n"
5405 "Push out prefix-list ORF and do inbound soft reconfig\n")
5407 if (strncmp (argv
[0], "m", 1) == 0)
5408 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5409 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5411 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5412 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5415 DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter
,
5416 clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
,
5417 "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter",
5423 "Address Family modifier\n"
5424 "Address Family modifier\n"
5425 "Soft reconfig inbound update\n"
5426 "Push out prefix-list ORF and do inbound soft reconfig\n")
5428 if (strncmp (argv
[1], "m", 1) == 0)
5429 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5430 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5432 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5433 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5436 DEFUN (clear_ip_bgp_all_vpnv4_soft_in
,
5437 clear_ip_bgp_all_vpnv4_soft_in_cmd
,
5438 "clear ip bgp * vpnv4 unicast soft in",
5444 "Address Family Modifier\n"
5446 "Soft reconfig inbound update\n")
5448 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
5449 BGP_CLEAR_SOFT_IN
, NULL
);
5452 ALIAS (clear_ip_bgp_all_vpnv4_soft_in
,
5453 clear_ip_bgp_all_vpnv4_in_cmd
,
5454 "clear ip bgp * vpnv4 unicast in",
5460 "Address Family Modifier\n"
5461 "Soft reconfig inbound update\n")
5463 DEFUN (clear_bgp_all_soft_in
,
5464 clear_bgp_all_soft_in_cmd
,
5465 "clear bgp * soft in",
5470 "Soft reconfig inbound update\n")
5473 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
5474 BGP_CLEAR_SOFT_IN
, NULL
);
5476 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5477 BGP_CLEAR_SOFT_IN
, NULL
);
5480 ALIAS (clear_bgp_all_soft_in
,
5481 clear_bgp_instance_all_soft_in_cmd
,
5482 "clear bgp view WORD * soft in",
5489 "Soft reconfig inbound update\n")
5491 ALIAS (clear_bgp_all_soft_in
,
5492 clear_bgp_ipv6_all_soft_in_cmd
,
5493 "clear bgp ipv6 * soft in",
5499 "Soft reconfig inbound update\n")
5501 ALIAS (clear_bgp_all_soft_in
,
5502 clear_bgp_all_in_cmd
,
5507 "Soft reconfig inbound update\n")
5509 ALIAS (clear_bgp_all_soft_in
,
5510 clear_bgp_ipv6_all_in_cmd
,
5511 "clear bgp ipv6 * in",
5516 "Soft reconfig inbound update\n")
5518 DEFUN (clear_bgp_all_in_prefix_filter
,
5519 clear_bgp_all_in_prefix_filter_cmd
,
5520 "clear bgp * in prefix-filter",
5524 "Soft reconfig inbound update\n"
5525 "Push out prefix-list ORF and do inbound soft reconfig\n")
5527 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5528 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5531 ALIAS (clear_bgp_all_in_prefix_filter
,
5532 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
5533 "clear bgp ipv6 * in prefix-filter",
5538 "Soft reconfig inbound update\n"
5539 "Push out prefix-list ORF and do inbound soft reconfig\n")
5541 DEFUN (clear_ip_bgp_peer_soft_in
,
5542 clear_ip_bgp_peer_soft_in_cmd
,
5543 "clear ip bgp A.B.C.D soft in",
5547 "BGP neighbor address to clear\n"
5549 "Soft reconfig inbound update\n")
5551 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5552 BGP_CLEAR_SOFT_IN
, argv
[0]);
5555 ALIAS (clear_ip_bgp_peer_soft_in
,
5556 clear_ip_bgp_peer_in_cmd
,
5557 "clear ip bgp A.B.C.D in",
5561 "BGP neighbor address to clear\n"
5562 "Soft reconfig inbound update\n")
5564 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
5565 clear_ip_bgp_peer_in_prefix_filter_cmd
,
5566 "clear ip bgp A.B.C.D in prefix-filter",
5570 "BGP neighbor address to clear\n"
5571 "Soft reconfig inbound update\n"
5572 "Push out the existing ORF prefix-list\n")
5574 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5575 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5578 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
5579 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
5580 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in",
5584 "BGP neighbor address to clear\n"
5586 "Address Family modifier\n"
5587 "Address Family modifier\n"
5589 "Soft reconfig inbound update\n")
5591 if (strncmp (argv
[1], "m", 1) == 0)
5592 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5593 BGP_CLEAR_SOFT_IN
, argv
[0]);
5595 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5596 BGP_CLEAR_SOFT_IN
, argv
[0]);
5599 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
5600 clear_ip_bgp_peer_ipv4_in_cmd
,
5601 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in",
5605 "BGP neighbor address to clear\n"
5607 "Address Family modifier\n"
5608 "Address Family modifier\n"
5609 "Soft reconfig inbound update\n")
5611 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
5612 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
5613 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter",
5617 "BGP neighbor address to clear\n"
5619 "Address Family modifier\n"
5620 "Address Family modifier\n"
5621 "Soft reconfig inbound update\n"
5622 "Push out the existing ORF prefix-list\n")
5624 if (strncmp (argv
[1], "m", 1) == 0)
5625 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5626 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5628 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5629 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5632 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in
,
5633 clear_ip_bgp_peer_vpnv4_soft_in_cmd
,
5634 "clear ip bgp A.B.C.D vpnv4 unicast soft in",
5638 "BGP neighbor address to clear\n"
5640 "Address Family Modifier\n"
5642 "Soft reconfig inbound update\n")
5644 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
5645 BGP_CLEAR_SOFT_IN
, argv
[0]);
5648 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in
,
5649 clear_ip_bgp_peer_vpnv4_in_cmd
,
5650 "clear ip bgp A.B.C.D vpnv4 unicast in",
5654 "BGP neighbor address to clear\n"
5656 "Address Family Modifier\n"
5657 "Soft reconfig inbound update\n")
5659 DEFUN (clear_bgp_peer_soft_in
,
5660 clear_bgp_peer_soft_in_cmd
,
5661 "clear bgp (A.B.C.D|X:X::X:X) soft in",
5664 "BGP neighbor address to clear\n"
5665 "BGP IPv6 neighbor to clear\n"
5667 "Soft reconfig inbound update\n")
5669 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5670 BGP_CLEAR_SOFT_IN
, argv
[0]);
5673 ALIAS (clear_bgp_peer_soft_in
,
5674 clear_bgp_ipv6_peer_soft_in_cmd
,
5675 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in",
5679 "BGP neighbor address to clear\n"
5680 "BGP IPv6 neighbor to clear\n"
5682 "Soft reconfig inbound update\n")
5684 ALIAS (clear_bgp_peer_soft_in
,
5685 clear_bgp_peer_in_cmd
,
5686 "clear bgp (A.B.C.D|X:X::X:X) in",
5689 "BGP neighbor address to clear\n"
5690 "BGP IPv6 neighbor to clear\n"
5691 "Soft reconfig inbound update\n")
5693 ALIAS (clear_bgp_peer_soft_in
,
5694 clear_bgp_ipv6_peer_in_cmd
,
5695 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in",
5699 "BGP neighbor address to clear\n"
5700 "BGP IPv6 neighbor to clear\n"
5701 "Soft reconfig inbound update\n")
5703 DEFUN (clear_bgp_peer_in_prefix_filter
,
5704 clear_bgp_peer_in_prefix_filter_cmd
,
5705 "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter",
5708 "BGP neighbor address to clear\n"
5709 "BGP IPv6 neighbor to clear\n"
5710 "Soft reconfig inbound update\n"
5711 "Push out the existing ORF prefix-list\n")
5713 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5714 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5717 ALIAS (clear_bgp_peer_in_prefix_filter
,
5718 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
5719 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter",
5723 "BGP neighbor address to clear\n"
5724 "BGP IPv6 neighbor to clear\n"
5725 "Soft reconfig inbound update\n"
5726 "Push out the existing ORF prefix-list\n")
5728 DEFUN (clear_ip_bgp_peer_group_soft_in
,
5729 clear_ip_bgp_peer_group_soft_in_cmd
,
5730 "clear ip bgp peer-group WORD soft in",
5734 "Clear all members of peer-group\n"
5735 "BGP peer-group name\n"
5737 "Soft reconfig inbound update\n")
5739 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5740 BGP_CLEAR_SOFT_IN
, argv
[0]);
5743 ALIAS (clear_ip_bgp_peer_group_soft_in
,
5744 clear_ip_bgp_peer_group_in_cmd
,
5745 "clear ip bgp peer-group WORD in",
5749 "Clear all members of peer-group\n"
5750 "BGP peer-group name\n"
5751 "Soft reconfig inbound update\n")
5753 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
5754 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
5755 "clear ip bgp peer-group WORD in prefix-filter",
5759 "Clear all members of peer-group\n"
5760 "BGP peer-group name\n"
5761 "Soft reconfig inbound update\n"
5762 "Push out prefix-list ORF and do inbound soft reconfig\n")
5764 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5765 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5768 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
5769 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
5770 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
5774 "Clear all members of peer-group\n"
5775 "BGP peer-group name\n"
5777 "Address Family modifier\n"
5778 "Address Family modifier\n"
5780 "Soft reconfig inbound update\n")
5782 if (strncmp (argv
[1], "m", 1) == 0)
5783 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5784 BGP_CLEAR_SOFT_IN
, argv
[0]);
5786 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5787 BGP_CLEAR_SOFT_IN
, argv
[0]);
5790 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
5791 clear_ip_bgp_peer_group_ipv4_in_cmd
,
5792 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
5796 "Clear all members of peer-group\n"
5797 "BGP peer-group name\n"
5799 "Address Family modifier\n"
5800 "Address Family modifier\n"
5801 "Soft reconfig inbound update\n")
5803 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
5804 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
5805 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
5809 "Clear all members of peer-group\n"
5810 "BGP peer-group name\n"
5812 "Address Family modifier\n"
5813 "Address Family modifier\n"
5814 "Soft reconfig inbound update\n"
5815 "Push out prefix-list ORF and do inbound soft reconfig\n")
5817 if (strncmp (argv
[1], "m", 1) == 0)
5818 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5819 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5821 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5822 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5825 DEFUN (clear_bgp_peer_group_soft_in
,
5826 clear_bgp_peer_group_soft_in_cmd
,
5827 "clear bgp peer-group WORD soft in",
5830 "Clear all members of peer-group\n"
5831 "BGP peer-group name\n"
5833 "Soft reconfig inbound update\n")
5835 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5836 BGP_CLEAR_SOFT_IN
, argv
[0]);
5839 ALIAS (clear_bgp_peer_group_soft_in
,
5840 clear_bgp_ipv6_peer_group_soft_in_cmd
,
5841 "clear bgp ipv6 peer-group WORD soft in",
5845 "Clear all members of peer-group\n"
5846 "BGP peer-group name\n"
5848 "Soft reconfig inbound update\n")
5850 ALIAS (clear_bgp_peer_group_soft_in
,
5851 clear_bgp_peer_group_in_cmd
,
5852 "clear bgp peer-group WORD in",
5855 "Clear all members of peer-group\n"
5856 "BGP peer-group name\n"
5857 "Soft reconfig inbound update\n")
5859 ALIAS (clear_bgp_peer_group_soft_in
,
5860 clear_bgp_ipv6_peer_group_in_cmd
,
5861 "clear bgp ipv6 peer-group WORD in",
5865 "Clear all members of peer-group\n"
5866 "BGP peer-group name\n"
5867 "Soft reconfig inbound update\n")
5869 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
5870 clear_bgp_peer_group_in_prefix_filter_cmd
,
5871 "clear bgp peer-group WORD in prefix-filter",
5874 "Clear all members of peer-group\n"
5875 "BGP peer-group name\n"
5876 "Soft reconfig inbound update\n"
5877 "Push out prefix-list ORF and do inbound soft reconfig\n")
5879 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5880 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5883 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
5884 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
5885 "clear bgp ipv6 peer-group WORD in prefix-filter",
5889 "Clear all members of peer-group\n"
5890 "BGP peer-group name\n"
5891 "Soft reconfig inbound update\n"
5892 "Push out prefix-list ORF and do inbound soft reconfig\n")
5894 DEFUN (clear_ip_bgp_external_soft_in
,
5895 clear_ip_bgp_external_soft_in_cmd
,
5896 "clear ip bgp external soft in",
5900 "Clear all external peers\n"
5902 "Soft reconfig inbound update\n")
5904 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5905 BGP_CLEAR_SOFT_IN
, NULL
);
5908 ALIAS (clear_ip_bgp_external_soft_in
,
5909 clear_ip_bgp_external_in_cmd
,
5910 "clear ip bgp external in",
5914 "Clear all external peers\n"
5915 "Soft reconfig inbound update\n")
5917 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
5918 clear_ip_bgp_external_in_prefix_filter_cmd
,
5919 "clear ip bgp external in prefix-filter",
5923 "Clear all external peers\n"
5924 "Soft reconfig inbound update\n"
5925 "Push out prefix-list ORF and do inbound soft reconfig\n")
5927 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5928 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5931 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
5932 clear_ip_bgp_external_ipv4_soft_in_cmd
,
5933 "clear ip bgp external ipv4 (unicast|multicast) soft in",
5937 "Clear all external peers\n"
5939 "Address Family modifier\n"
5940 "Address Family modifier\n"
5942 "Soft reconfig inbound update\n")
5944 if (strncmp (argv
[0], "m", 1) == 0)
5945 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5946 BGP_CLEAR_SOFT_IN
, NULL
);
5948 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5949 BGP_CLEAR_SOFT_IN
, NULL
);
5952 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
5953 clear_ip_bgp_external_ipv4_in_cmd
,
5954 "clear ip bgp external ipv4 (unicast|multicast) in",
5958 "Clear all external peers\n"
5960 "Address Family modifier\n"
5961 "Address Family modifier\n"
5962 "Soft reconfig inbound update\n")
5964 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
5965 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
5966 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
5970 "Clear all external peers\n"
5972 "Address Family modifier\n"
5973 "Address Family modifier\n"
5974 "Soft reconfig inbound update\n"
5975 "Push out prefix-list ORF and do inbound soft reconfig\n")
5977 if (strncmp (argv
[0], "m", 1) == 0)
5978 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5979 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5981 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5982 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5985 DEFUN (clear_bgp_external_soft_in
,
5986 clear_bgp_external_soft_in_cmd
,
5987 "clear bgp external soft in",
5990 "Clear all external peers\n"
5992 "Soft reconfig inbound update\n")
5994 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5995 BGP_CLEAR_SOFT_IN
, NULL
);
5998 ALIAS (clear_bgp_external_soft_in
,
5999 clear_bgp_ipv6_external_soft_in_cmd
,
6000 "clear bgp ipv6 external soft in",
6004 "Clear all external peers\n"
6006 "Soft reconfig inbound update\n")
6008 ALIAS (clear_bgp_external_soft_in
,
6009 clear_bgp_external_in_cmd
,
6010 "clear bgp external in",
6013 "Clear all external peers\n"
6014 "Soft reconfig inbound update\n")
6016 ALIAS (clear_bgp_external_soft_in
,
6017 clear_bgp_ipv6_external_in_cmd
,
6018 "clear bgp ipv6 external WORD in",
6022 "Clear all external peers\n"
6023 "Soft reconfig inbound update\n")
6025 DEFUN (clear_bgp_external_in_prefix_filter
,
6026 clear_bgp_external_in_prefix_filter_cmd
,
6027 "clear bgp external in prefix-filter",
6030 "Clear all external peers\n"
6031 "Soft reconfig inbound update\n"
6032 "Push out prefix-list ORF and do inbound soft reconfig\n")
6034 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6035 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6038 ALIAS (clear_bgp_external_in_prefix_filter
,
6039 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
6040 "clear bgp ipv6 external in prefix-filter",
6044 "Clear all external peers\n"
6045 "Soft reconfig inbound update\n"
6046 "Push out prefix-list ORF and do inbound soft reconfig\n")
6048 DEFUN (clear_ip_bgp_as_soft_in
,
6049 clear_ip_bgp_as_soft_in_cmd
,
6050 "clear ip bgp " CMD_AS_RANGE
" soft in",
6054 "Clear peers with the AS number\n"
6056 "Soft reconfig inbound update\n")
6058 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6059 BGP_CLEAR_SOFT_IN
, argv
[0]);
6062 ALIAS (clear_ip_bgp_as_soft_in
,
6063 clear_ip_bgp_as_in_cmd
,
6064 "clear ip bgp " CMD_AS_RANGE
" in",
6068 "Clear peers with the AS number\n"
6069 "Soft reconfig inbound update\n")
6071 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
6072 clear_ip_bgp_as_in_prefix_filter_cmd
,
6073 "clear ip bgp " CMD_AS_RANGE
" in prefix-filter",
6077 "Clear peers with the AS number\n"
6078 "Soft reconfig inbound update\n"
6079 "Push out prefix-list ORF and do inbound soft reconfig\n")
6081 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6082 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6085 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
6086 clear_ip_bgp_as_ipv4_soft_in_cmd
,
6087 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft in",
6091 "Clear peers with the AS number\n"
6093 "Address Family modifier\n"
6094 "Address Family modifier\n"
6096 "Soft reconfig inbound update\n")
6098 if (strncmp (argv
[1], "m", 1) == 0)
6099 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
6100 BGP_CLEAR_SOFT_IN
, argv
[0]);
6102 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6103 BGP_CLEAR_SOFT_IN
, argv
[0]);
6106 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
6107 clear_ip_bgp_as_ipv4_in_cmd
,
6108 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in",
6112 "Clear peers with the AS number\n"
6114 "Address Family modifier\n"
6115 "Address Family modifier\n"
6116 "Soft reconfig inbound update\n")
6118 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
6119 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
6120 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in prefix-filter",
6124 "Clear peers with the AS number\n"
6126 "Address Family modifier\n"
6127 "Address Family modifier\n"
6128 "Soft reconfig inbound update\n"
6129 "Push out prefix-list ORF and do inbound soft reconfig\n")
6131 if (strncmp (argv
[1], "m", 1) == 0)
6132 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
6133 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6135 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6136 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6139 DEFUN (clear_ip_bgp_as_vpnv4_soft_in
,
6140 clear_ip_bgp_as_vpnv4_soft_in_cmd
,
6141 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft in",
6145 "Clear peers with the AS number\n"
6147 "Address Family modifier\n"
6149 "Soft reconfig inbound update\n")
6151 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
6152 BGP_CLEAR_SOFT_IN
, argv
[0]);
6155 ALIAS (clear_ip_bgp_as_vpnv4_soft_in
,
6156 clear_ip_bgp_as_vpnv4_in_cmd
,
6157 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast in",
6161 "Clear peers with the AS number\n"
6163 "Address Family modifier\n"
6164 "Soft reconfig inbound update\n")
6166 DEFUN (clear_bgp_as_soft_in
,
6167 clear_bgp_as_soft_in_cmd
,
6168 "clear bgp " CMD_AS_RANGE
" soft in",
6171 "Clear peers with the AS number\n"
6173 "Soft reconfig inbound update\n")
6175 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
6176 BGP_CLEAR_SOFT_IN
, argv
[0]);
6179 ALIAS (clear_bgp_as_soft_in
,
6180 clear_bgp_ipv6_as_soft_in_cmd
,
6181 "clear bgp ipv6 " CMD_AS_RANGE
" soft in",
6185 "Clear peers with the AS number\n"
6187 "Soft reconfig inbound update\n")
6189 ALIAS (clear_bgp_as_soft_in
,
6190 clear_bgp_as_in_cmd
,
6191 "clear bgp " CMD_AS_RANGE
" in",
6194 "Clear peers with the AS number\n"
6195 "Soft reconfig inbound update\n")
6197 ALIAS (clear_bgp_as_soft_in
,
6198 clear_bgp_ipv6_as_in_cmd
,
6199 "clear bgp ipv6 " CMD_AS_RANGE
" in",
6203 "Clear peers with the AS number\n"
6204 "Soft reconfig inbound update\n")
6206 DEFUN (clear_bgp_as_in_prefix_filter
,
6207 clear_bgp_as_in_prefix_filter_cmd
,
6208 "clear bgp " CMD_AS_RANGE
" in prefix-filter",
6211 "Clear peers with the AS number\n"
6212 "Soft reconfig inbound update\n"
6213 "Push out prefix-list ORF and do inbound soft reconfig\n")
6215 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
6216 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6219 ALIAS (clear_bgp_as_in_prefix_filter
,
6220 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
6221 "clear bgp ipv6 " CMD_AS_RANGE
" in prefix-filter",
6225 "Clear peers with the AS number\n"
6226 "Soft reconfig inbound update\n"
6227 "Push out prefix-list ORF and do inbound soft reconfig\n")
6229 /* Both soft-reconfiguration */
6230 DEFUN (clear_ip_bgp_all_soft
,
6231 clear_ip_bgp_all_soft_cmd
,
6232 "clear ip bgp * soft",
6240 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6241 BGP_CLEAR_SOFT_BOTH
, NULL
);
6243 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6244 BGP_CLEAR_SOFT_BOTH
, NULL
);
6247 ALIAS (clear_ip_bgp_all_soft
,
6248 clear_ip_bgp_instance_all_soft_cmd
,
6249 "clear ip bgp view WORD * soft",
6259 DEFUN (clear_ip_bgp_all_ipv4_soft
,
6260 clear_ip_bgp_all_ipv4_soft_cmd
,
6261 "clear ip bgp * ipv4 (unicast|multicast) soft",
6267 "Address Family Modifier\n"
6268 "Address Family Modifier\n"
6271 if (strncmp (argv
[0], "m", 1) == 0)
6272 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6273 BGP_CLEAR_SOFT_BOTH
, NULL
);
6275 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6276 BGP_CLEAR_SOFT_BOTH
, NULL
);
6279 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
6280 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
6281 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft",
6289 "Address Family Modifier\n"
6290 "Address Family Modifier\n"
6293 if (strncmp (argv
[1], "m", 1) == 0)
6294 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6295 BGP_CLEAR_SOFT_BOTH
, NULL
);
6297 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6298 BGP_CLEAR_SOFT_BOTH
, NULL
);
6301 DEFUN (clear_ip_bgp_all_vpnv4_soft
,
6302 clear_ip_bgp_all_vpnv4_soft_cmd
,
6303 "clear ip bgp * vpnv4 unicast soft",
6309 "Address Family Modifier\n"
6312 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
6313 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6316 DEFUN (clear_bgp_all_soft
,
6317 clear_bgp_all_soft_cmd
,
6325 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6326 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6328 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6329 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6332 ALIAS (clear_bgp_all_soft
,
6333 clear_bgp_instance_all_soft_cmd
,
6334 "clear bgp view WORD * soft",
6342 ALIAS (clear_bgp_all_soft
,
6343 clear_bgp_ipv6_all_soft_cmd
,
6344 "clear bgp ipv6 * soft",
6351 DEFUN (clear_ip_bgp_peer_soft
,
6352 clear_ip_bgp_peer_soft_cmd
,
6353 "clear ip bgp A.B.C.D soft",
6357 "BGP neighbor address to clear\n"
6360 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6361 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6364 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
6365 clear_ip_bgp_peer_ipv4_soft_cmd
,
6366 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft",
6370 "BGP neighbor address to clear\n"
6372 "Address Family Modifier\n"
6373 "Address Family Modifier\n"
6376 if (strncmp (argv
[1], "m", 1) == 0)
6377 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
6378 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6380 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6381 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6384 DEFUN (clear_ip_bgp_peer_vpnv4_soft
,
6385 clear_ip_bgp_peer_vpnv4_soft_cmd
,
6386 "clear ip bgp A.B.C.D vpnv4 unicast soft",
6390 "BGP neighbor address to clear\n"
6392 "Address Family Modifier\n"
6395 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
6396 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6399 DEFUN (clear_bgp_peer_soft
,
6400 clear_bgp_peer_soft_cmd
,
6401 "clear bgp (A.B.C.D|X:X::X:X) soft",
6404 "BGP neighbor address to clear\n"
6405 "BGP IPv6 neighbor to clear\n"
6408 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6409 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6412 ALIAS (clear_bgp_peer_soft
,
6413 clear_bgp_ipv6_peer_soft_cmd
,
6414 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft",
6418 "BGP neighbor address to clear\n"
6419 "BGP IPv6 neighbor to clear\n"
6422 DEFUN (clear_ip_bgp_peer_group_soft
,
6423 clear_ip_bgp_peer_group_soft_cmd
,
6424 "clear ip bgp peer-group WORD soft",
6428 "Clear all members of peer-group\n"
6429 "BGP peer-group name\n"
6432 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6433 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6436 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
6437 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
6438 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
6442 "Clear all members of peer-group\n"
6443 "BGP peer-group name\n"
6445 "Address Family modifier\n"
6446 "Address Family modifier\n"
6449 if (strncmp (argv
[1], "m", 1) == 0)
6450 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
6451 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6453 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6454 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6457 DEFUN (clear_bgp_peer_group_soft
,
6458 clear_bgp_peer_group_soft_cmd
,
6459 "clear bgp peer-group WORD soft",
6462 "Clear all members of peer-group\n"
6463 "BGP peer-group name\n"
6466 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
6467 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6470 ALIAS (clear_bgp_peer_group_soft
,
6471 clear_bgp_ipv6_peer_group_soft_cmd
,
6472 "clear bgp ipv6 peer-group WORD soft",
6476 "Clear all members of peer-group\n"
6477 "BGP peer-group name\n"
6480 DEFUN (clear_ip_bgp_external_soft
,
6481 clear_ip_bgp_external_soft_cmd
,
6482 "clear ip bgp external soft",
6486 "Clear all external peers\n"
6489 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6490 BGP_CLEAR_SOFT_BOTH
, NULL
);
6493 DEFUN (clear_ip_bgp_external_ipv4_soft
,
6494 clear_ip_bgp_external_ipv4_soft_cmd
,
6495 "clear ip bgp external ipv4 (unicast|multicast) soft",
6499 "Clear all external peers\n"
6501 "Address Family modifier\n"
6502 "Address Family modifier\n"
6505 if (strncmp (argv
[0], "m", 1) == 0)
6506 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
6507 BGP_CLEAR_SOFT_BOTH
, NULL
);
6509 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6510 BGP_CLEAR_SOFT_BOTH
, NULL
);
6513 DEFUN (clear_bgp_external_soft
,
6514 clear_bgp_external_soft_cmd
,
6515 "clear bgp external soft",
6518 "Clear all external peers\n"
6521 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6522 BGP_CLEAR_SOFT_BOTH
, NULL
);
6525 ALIAS (clear_bgp_external_soft
,
6526 clear_bgp_ipv6_external_soft_cmd
,
6527 "clear bgp ipv6 external soft",
6531 "Clear all external peers\n"
6534 DEFUN (clear_ip_bgp_as_soft
,
6535 clear_ip_bgp_as_soft_cmd
,
6536 "clear ip bgp " CMD_AS_RANGE
" soft",
6540 "Clear peers with the AS number\n"
6543 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6544 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6547 DEFUN (clear_ip_bgp_as_ipv4_soft
,
6548 clear_ip_bgp_as_ipv4_soft_cmd
,
6549 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft",
6553 "Clear peers with the AS number\n"
6555 "Address Family Modifier\n"
6556 "Address Family Modifier\n"
6559 if (strncmp (argv
[1], "m", 1) == 0)
6560 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
6561 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6563 return bgp_clear_vty (vty
, NULL
,AFI_IP
, SAFI_UNICAST
, clear_as
,
6564 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6567 DEFUN (clear_ip_bgp_as_vpnv4_soft
,
6568 clear_ip_bgp_as_vpnv4_soft_cmd
,
6569 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft",
6573 "Clear peers with the AS number\n"
6575 "Address Family Modifier\n"
6578 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
6579 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6582 DEFUN (clear_bgp_as_soft
,
6583 clear_bgp_as_soft_cmd
,
6584 "clear bgp " CMD_AS_RANGE
" soft",
6587 "Clear peers with the AS number\n"
6590 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
6591 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6594 ALIAS (clear_bgp_as_soft
,
6595 clear_bgp_ipv6_as_soft_cmd
,
6596 "clear bgp ipv6 " CMD_AS_RANGE
" soft",
6600 "Clear peers with the AS number\n"
6603 /* RS-client soft reconfiguration. */
6605 DEFUN (clear_bgp_all_rsclient
,
6606 clear_bgp_all_rsclient_cmd
,
6607 "clear bgp * rsclient",
6611 "Soft reconfig for rsclient RIB\n")
6614 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6615 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6617 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6618 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6621 ALIAS (clear_bgp_all_rsclient
,
6622 clear_bgp_ipv6_all_rsclient_cmd
,
6623 "clear bgp ipv6 * rsclient",
6628 "Soft reconfig for rsclient RIB\n")
6630 ALIAS (clear_bgp_all_rsclient
,
6631 clear_bgp_instance_all_rsclient_cmd
,
6632 "clear bgp view WORD * rsclient",
6638 "Soft reconfig for rsclient RIB\n")
6640 ALIAS (clear_bgp_all_rsclient
,
6641 clear_bgp_ipv6_instance_all_rsclient_cmd
,
6642 "clear bgp ipv6 view WORD * rsclient",
6649 "Soft reconfig for rsclient RIB\n")
6650 #endif /* HAVE_IPV6 */
6652 DEFUN (clear_ip_bgp_all_rsclient
,
6653 clear_ip_bgp_all_rsclient_cmd
,
6654 "clear ip bgp * rsclient",
6659 "Soft reconfig for rsclient RIB\n")
6662 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6663 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6665 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6666 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6669 ALIAS (clear_ip_bgp_all_rsclient
,
6670 clear_ip_bgp_instance_all_rsclient_cmd
,
6671 "clear ip bgp view WORD * rsclient",
6678 "Soft reconfig for rsclient RIB\n")
6681 DEFUN (clear_bgp_peer_rsclient
,
6682 clear_bgp_peer_rsclient_cmd
,
6683 "clear bgp (A.B.C.D|X:X::X:X) rsclient",
6686 "BGP neighbor IP address to clear\n"
6687 "BGP IPv6 neighbor to clear\n"
6688 "Soft reconfig for rsclient RIB\n")
6691 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6692 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6694 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6695 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6698 ALIAS (clear_bgp_peer_rsclient
,
6699 clear_bgp_ipv6_peer_rsclient_cmd
,
6700 "clear bgp ipv6 (A.B.C.D|X:X::X:X) rsclient",
6704 "BGP neighbor IP address to clear\n"
6705 "BGP IPv6 neighbor to clear\n"
6706 "Soft reconfig for rsclient RIB\n")
6708 ALIAS (clear_bgp_peer_rsclient
,
6709 clear_bgp_instance_peer_rsclient_cmd
,
6710 "clear bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6715 "BGP neighbor IP address to clear\n"
6716 "BGP IPv6 neighbor to clear\n"
6717 "Soft reconfig for rsclient RIB\n")
6719 ALIAS (clear_bgp_peer_rsclient
,
6720 clear_bgp_ipv6_instance_peer_rsclient_cmd
,
6721 "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X) rsclient",
6727 "BGP neighbor IP address to clear\n"
6728 "BGP IPv6 neighbor to clear\n"
6729 "Soft reconfig for rsclient RIB\n")
6730 #endif /* HAVE_IPV6 */
6732 DEFUN (clear_ip_bgp_peer_rsclient
,
6733 clear_ip_bgp_peer_rsclient_cmd
,
6734 "clear ip bgp (A.B.C.D|X:X::X:X) rsclient",
6738 "BGP neighbor IP address to clear\n"
6739 "BGP IPv6 neighbor to clear\n"
6740 "Soft reconfig for rsclient RIB\n")
6743 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_peer
,
6744 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6746 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6747 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6750 ALIAS (clear_ip_bgp_peer_rsclient
,
6751 clear_ip_bgp_instance_peer_rsclient_cmd
,
6752 "clear ip bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6758 "BGP neighbor IP address to clear\n"
6759 "BGP IPv6 neighbor to clear\n"
6760 "Soft reconfig for rsclient RIB\n")
6762 DEFUN (show_bgp_views
,
6767 "Show the defined BGP views\n")
6769 struct list
*inst
= bm
->bgp
;
6770 struct listnode
*node
;
6773 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE
))
6775 vty_out (vty
, "Multiple BGP views are not defined%s", VTY_NEWLINE
);
6779 vty_out (vty
, "Defined BGP views:%s", VTY_NEWLINE
);
6780 for (ALL_LIST_ELEMENTS_RO(inst
, node
, bgp
))
6781 vty_out (vty
, "\t%s (AS%u)%s",
6782 bgp
->name
? bgp
->name
: "(null)",
6783 bgp
->as
, VTY_NEWLINE
);
6788 DEFUN (show_bgp_memory
,
6789 show_bgp_memory_cmd
,
6793 "Global BGP memory statistics\n")
6795 char memstrbuf
[MTYPE_MEMSTR_LEN
];
6796 unsigned long count
;
6798 /* RIB related usage stats */
6799 count
= mtype_stats_alloc (MTYPE_BGP_NODE
);
6800 vty_out (vty
, "%ld RIB nodes, using %s of memory%s", count
,
6801 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6802 count
* sizeof (struct bgp_node
)),
6805 count
= mtype_stats_alloc (MTYPE_BGP_ROUTE
);
6806 vty_out (vty
, "%ld BGP routes, using %s of memory%s", count
,
6807 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6808 count
* sizeof (struct bgp_info
)),
6810 if ((count
= mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA
)))
6811 vty_out (vty
, "%ld BGP route ancillaries, using %s of memory%s", count
,
6812 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6813 count
* sizeof (struct bgp_info_extra
)),
6816 if ((count
= mtype_stats_alloc (MTYPE_BGP_STATIC
)))
6817 vty_out (vty
, "%ld Static routes, using %s of memory%s", count
,
6818 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6819 count
* sizeof (struct bgp_static
)),
6823 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_IN
)))
6824 vty_out (vty
, "%ld Adj-In entries, using %s of memory%s", count
,
6825 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6826 count
* sizeof (struct bgp_adj_in
)),
6828 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_OUT
)))
6829 vty_out (vty
, "%ld Adj-Out entries, using %s of memory%s", count
,
6830 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6831 count
* sizeof (struct bgp_adj_out
)),
6834 if ((count
= mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE
)))
6835 vty_out (vty
, "%ld Nexthop cache entries, using %s of memory%s", count
,
6836 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6837 count
* sizeof (struct bgp_nexthop_cache
)),
6840 if ((count
= mtype_stats_alloc (MTYPE_BGP_DAMP_INFO
)))
6841 vty_out (vty
, "%ld Dampening entries, using %s of memory%s", count
,
6842 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6843 count
* sizeof (struct bgp_damp_info
)),
6847 count
= attr_count();
6848 vty_out (vty
, "%ld BGP attributes, using %s of memory%s", count
,
6849 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6850 count
* sizeof(struct attr
)),
6852 if ((count
= mtype_stats_alloc (MTYPE_ATTR_EXTRA
)))
6853 vty_out (vty
, "%ld BGP extra attributes, using %s of memory%s", count
,
6854 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6855 count
* sizeof(struct attr_extra
)),
6858 if ((count
= attr_unknown_count()))
6859 vty_out (vty
, "%ld unknown attributes%s", count
, VTY_NEWLINE
);
6861 /* AS_PATH attributes */
6862 count
= aspath_count ();
6863 vty_out (vty
, "%ld BGP AS-PATH entries, using %s of memory%s", count
,
6864 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6865 count
* sizeof (struct aspath
)),
6868 count
= mtype_stats_alloc (MTYPE_AS_SEG
);
6869 vty_out (vty
, "%ld BGP AS-PATH segments, using %s of memory%s", count
,
6870 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6871 count
* sizeof (struct assegment
)),
6874 /* Other attributes */
6875 if ((count
= community_count ()))
6876 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
6877 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6878 count
* sizeof (struct community
)),
6880 if ((count
= mtype_stats_alloc (MTYPE_ECOMMUNITY
)))
6881 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
6882 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6883 count
* sizeof (struct ecommunity
)),
6886 if ((count
= mtype_stats_alloc (MTYPE_CLUSTER
)))
6887 vty_out (vty
, "%ld Cluster lists, using %s of memory%s", count
,
6888 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6889 count
* sizeof (struct cluster_list
)),
6892 /* Peer related usage */
6893 count
= mtype_stats_alloc (MTYPE_BGP_PEER
);
6894 vty_out (vty
, "%ld peers, using %s of memory%s", count
,
6895 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6896 count
* sizeof (struct peer
)),
6899 if ((count
= mtype_stats_alloc (MTYPE_PEER_GROUP
)))
6900 vty_out (vty
, "%ld peer groups, using %s of memory%s", count
,
6901 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6902 count
* sizeof (struct peer_group
)),
6906 if ((count
= mtype_stats_alloc (MTYPE_HASH
)))
6907 vty_out (vty
, "%ld hash tables, using %s of memory%s", count
,
6908 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6909 count
* sizeof (struct hash
)),
6911 if ((count
= mtype_stats_alloc (MTYPE_HASH_BACKET
)))
6912 vty_out (vty
, "%ld hash buckets, using %s of memory%s", count
,
6913 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6914 count
* sizeof (struct hash_backet
)),
6916 if ((count
= mtype_stats_alloc (MTYPE_BGP_REGEXP
)))
6917 vty_out (vty
, "%ld compiled regexes, using %s of memory%s", count
,
6918 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6919 count
* sizeof (regex_t
)),
6924 /* Show BGP peer's summary information. */
6926 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
)
6929 struct listnode
*node
, *nnode
;
6930 unsigned int count
= 0;
6931 char timebuf
[BGP_UPTIME_LEN
];
6934 /* Header string for each address family. */
6935 static char header
[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
6937 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
6939 if (peer
->afc
[afi
][safi
])
6944 char memstrbuf
[MTYPE_MEMSTR_LEN
];
6946 /* Usage summary and header */
6948 "BGP router identifier %s, local AS number %u%s",
6949 inet_ntoa (bgp
->router_id
), bgp
->as
, VTY_NEWLINE
);
6951 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
6952 vty_out (vty
, "RIB entries %ld, using %s of memory%s", ents
,
6953 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6954 ents
* sizeof (struct bgp_node
)),
6957 /* Peer related usage */
6958 ents
= listcount (bgp
->peer
);
6959 vty_out (vty
, "Peers %ld, using %s of memory%s",
6961 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6962 ents
* sizeof (struct peer
)),
6965 if ((ents
= listcount (bgp
->rsclient
)))
6966 vty_out (vty
, "RS-Client peers %ld, using %s of memory%s",
6968 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6969 ents
* sizeof (struct peer
)),
6972 if ((ents
= listcount (bgp
->group
)))
6973 vty_out (vty
, "Peer groups %ld, using %s of memory%s", ents
,
6974 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6975 ents
* sizeof (struct peer_group
)),
6978 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
6979 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
6980 vty_out (vty
, "%s", VTY_NEWLINE
);
6981 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
6986 len
= vty_out (vty
, "%s", peer
->host
);
6989 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
6991 vty_out (vty
, "%*s", len
, " ");
6993 vty_out (vty
, "4 ");
6995 vty_out (vty
, "%5u %7d %7d %8d %4d %4lu ",
6997 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
6998 + peer
->notify_in
+ peer
->refresh_in
+ peer
->dynamic_cap_in
,
6999 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
7000 + peer
->notify_out
+ peer
->refresh_out
7001 + peer
->dynamic_cap_out
,
7002 0, 0, (unsigned long) peer
->obuf
->count
);
7004 vty_out (vty
, "%8s",
7005 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
));
7007 if (peer
->status
== Established
)
7009 vty_out (vty
, " %8ld", peer
->pcount
[afi
][safi
]);
7013 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
7014 vty_out (vty
, " Idle (Admin)");
7015 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
7016 vty_out (vty
, " Idle (PfxCt)");
7018 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, peer
->status
));
7021 vty_out (vty
, "%s", VTY_NEWLINE
);
7026 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
7027 count
, VTY_NEWLINE
);
7029 vty_out (vty
, "No %s neighbor is configured%s",
7030 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
7035 bgp_show_summary_vty (struct vty
*vty
, const char *name
,
7036 afi_t afi
, safi_t safi
)
7042 bgp
= bgp_lookup_by_name (name
);
7046 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
7050 bgp_show_summary (vty
, bgp
, afi
, safi
);
7054 bgp
= bgp_get_default ();
7057 bgp_show_summary (vty
, bgp
, afi
, safi
);
7062 /* `show ip bgp summary' commands. */
7063 DEFUN (show_ip_bgp_summary
,
7064 show_ip_bgp_summary_cmd
,
7065 "show ip bgp summary",
7069 "Summary of BGP neighbor status\n")
7071 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
7074 DEFUN (show_ip_bgp_instance_summary
,
7075 show_ip_bgp_instance_summary_cmd
,
7076 "show ip bgp view WORD summary",
7082 "Summary of BGP neighbor status\n")
7084 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
7087 DEFUN (show_ip_bgp_ipv4_summary
,
7088 show_ip_bgp_ipv4_summary_cmd
,
7089 "show ip bgp ipv4 (unicast|multicast) summary",
7094 "Address Family modifier\n"
7095 "Address Family modifier\n"
7096 "Summary of BGP neighbor status\n")
7098 if (strncmp (argv
[0], "m", 1) == 0)
7099 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
7101 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
7104 ALIAS (show_ip_bgp_ipv4_summary
,
7105 show_bgp_ipv4_safi_summary_cmd
,
7106 "show bgp ipv4 (unicast|multicast) summary",
7110 "Address Family modifier\n"
7111 "Address Family modifier\n"
7112 "Summary of BGP neighbor status\n")
7114 DEFUN (show_ip_bgp_instance_ipv4_summary
,
7115 show_ip_bgp_instance_ipv4_summary_cmd
,
7116 "show ip bgp view WORD ipv4 (unicast|multicast) summary",
7123 "Address Family modifier\n"
7124 "Address Family modifier\n"
7125 "Summary of BGP neighbor status\n")
7127 if (strncmp (argv
[1], "m", 1) == 0)
7128 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
7130 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
7133 ALIAS (show_ip_bgp_instance_ipv4_summary
,
7134 show_bgp_instance_ipv4_safi_summary_cmd
,
7135 "show bgp view WORD ipv4 (unicast|multicast) summary",
7141 "Address Family modifier\n"
7142 "Address Family modifier\n"
7143 "Summary of BGP neighbor status\n")
7145 DEFUN (show_ip_bgp_vpnv4_all_summary
,
7146 show_ip_bgp_vpnv4_all_summary_cmd
,
7147 "show ip bgp vpnv4 all summary",
7151 "Display VPNv4 NLRI specific information\n"
7152 "Display information about all VPNv4 NLRIs\n"
7153 "Summary of BGP neighbor status\n")
7155 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
7158 DEFUN (show_ip_bgp_vpnv4_rd_summary
,
7159 show_ip_bgp_vpnv4_rd_summary_cmd
,
7160 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary",
7164 "Display VPNv4 NLRI specific information\n"
7165 "Display information for a route distinguisher\n"
7166 "VPN Route Distinguisher\n"
7167 "Summary of BGP neighbor status\n")
7170 struct prefix_rd prd
;
7172 ret
= str2prefix_rd (argv
[0], &prd
);
7175 vty_out (vty
, "%% Malformed Route Distinguisher%s", VTY_NEWLINE
);
7179 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
7183 DEFUN (show_bgp_summary
,
7184 show_bgp_summary_cmd
,
7188 "Summary of BGP neighbor status\n")
7190 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
7193 DEFUN (show_bgp_instance_summary
,
7194 show_bgp_instance_summary_cmd
,
7195 "show bgp view WORD summary",
7200 "Summary of BGP neighbor status\n")
7202 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
7205 ALIAS (show_bgp_summary
,
7206 show_bgp_ipv6_summary_cmd
,
7207 "show bgp ipv6 summary",
7211 "Summary of BGP neighbor status\n")
7213 ALIAS (show_bgp_instance_summary
,
7214 show_bgp_instance_ipv6_summary_cmd
,
7215 "show bgp view WORD ipv6 summary",
7221 "Summary of BGP neighbor status\n")
7223 DEFUN (show_bgp_ipv6_safi_summary
,
7224 show_bgp_ipv6_safi_summary_cmd
,
7225 "show bgp ipv6 (unicast|multicast) summary",
7229 "Address Family modifier\n"
7230 "Address Family modifier\n"
7231 "Summary of BGP neighbor status\n")
7233 if (strncmp (argv
[0], "m", 1) == 0)
7234 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
);
7236 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
7239 DEFUN (show_bgp_instance_ipv6_safi_summary
,
7240 show_bgp_instance_ipv6_safi_summary_cmd
,
7241 "show bgp view WORD ipv6 (unicast|multicast) summary",
7247 "Address Family modifier\n"
7248 "Address Family modifier\n"
7249 "Summary of BGP neighbor status\n")
7251 if (strncmp (argv
[1], "m", 1) == 0)
7252 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_MULTICAST
);
7254 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
7258 DEFUN (show_ipv6_bgp_summary
,
7259 show_ipv6_bgp_summary_cmd
,
7260 "show ipv6 bgp summary",
7264 "Summary of BGP neighbor status\n")
7266 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
7270 DEFUN (show_ipv6_mbgp_summary
,
7271 show_ipv6_mbgp_summary_cmd
,
7272 "show ipv6 mbgp summary",
7276 "Summary of BGP neighbor status\n")
7278 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
);
7280 #endif /* HAVE_IPV6 */
7283 afi_safi_print (afi_t afi
, safi_t safi
)
7285 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
7286 return "IPv4 Unicast";
7287 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
7288 return "IPv4 Multicast";
7289 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
7290 return "VPNv4 Unicast";
7291 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
7292 return "IPv6 Unicast";
7293 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
7294 return "IPv6 Multicast";
7299 /* Show BGP peer's information. */
7307 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
,
7308 afi_t afi
, safi_t safi
,
7309 u_int16_t adv_smcap
, u_int16_t adv_rmcap
,
7310 u_int16_t rcv_smcap
, u_int16_t rcv_rmcap
)
7313 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
7314 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
7316 vty_out (vty
, " Send-mode: ");
7317 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
7318 vty_out (vty
, "advertised");
7319 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
7320 vty_out (vty
, "%sreceived",
7321 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
7323 vty_out (vty
, "%s", VTY_NEWLINE
);
7327 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
7328 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
7330 vty_out (vty
, " Receive-mode: ");
7331 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
7332 vty_out (vty
, "advertised");
7333 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
7334 vty_out (vty
, "%sreceived",
7335 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
7337 vty_out (vty
, "%s", VTY_NEWLINE
);
7342 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
)
7344 struct bgp_filter
*filter
;
7345 char orf_pfx_name
[BUFSIZ
];
7348 filter
= &p
->filter
[afi
][safi
];
7350 vty_out (vty
, " For address family: %s%s", afi_safi_print (afi
, safi
),
7353 if (p
->af_group
[afi
][safi
])
7354 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
7356 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7357 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
7358 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
7359 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7360 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
7361 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
7362 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
7364 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7365 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
7366 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7367 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
7369 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
7370 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
7371 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
7372 PEER_CAP_ORF_PREFIX_SM_ADV
,
7373 PEER_CAP_ORF_PREFIX_RM_ADV
,
7374 PEER_CAP_ORF_PREFIX_SM_RCV
,
7375 PEER_CAP_ORF_PREFIX_RM_RCV
);
7377 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7378 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
7379 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7380 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
7382 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
7383 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
7384 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
7385 PEER_CAP_ORF_PREFIX_SM_ADV
,
7386 PEER_CAP_ORF_PREFIX_RM_ADV
,
7387 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
7388 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
);
7391 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
7392 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
);
7394 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
7397 vty_out (vty
, " Outbound Route Filter (ORF):");
7398 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
7399 vty_out (vty
, " sent;");
7401 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
7402 vty_out (vty
, "%s", VTY_NEWLINE
);
7404 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
7405 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
7407 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
7408 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
7409 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
7410 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
7411 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
7412 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
7413 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
7414 vty_out (vty
, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE
);
7415 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
))
7416 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
7417 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
7418 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7419 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
7420 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7421 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
7422 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7423 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
7424 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7426 vty_out (vty
, " Community attribute sent to this neighbor");
7427 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
7428 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7429 vty_out (vty
, "(both)%s", VTY_NEWLINE
);
7430 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7431 vty_out (vty
, "(extended)%s", VTY_NEWLINE
);
7433 vty_out (vty
, "(standard)%s", VTY_NEWLINE
);
7435 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
7437 vty_out (vty
, " Default information originate,");
7439 if (p
->default_rmap
[afi
][safi
].name
)
7440 vty_out (vty
, " default route-map %s%s,",
7441 p
->default_rmap
[afi
][safi
].map
? "*" : "",
7442 p
->default_rmap
[afi
][safi
].name
);
7443 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_DEFAULT_ORIGINATE
))
7444 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
7446 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
7449 if (filter
->plist
[FILTER_IN
].name
7450 || filter
->dlist
[FILTER_IN
].name
7451 || filter
->aslist
[FILTER_IN
].name
7452 || filter
->map
[RMAP_IN
].name
)
7453 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
7454 if (filter
->plist
[FILTER_OUT
].name
7455 || filter
->dlist
[FILTER_OUT
].name
7456 || filter
->aslist
[FILTER_OUT
].name
7457 || filter
->map
[RMAP_OUT
].name
7458 || filter
->usmap
.name
)
7459 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
7460 if (filter
->map
[RMAP_IMPORT
].name
)
7461 vty_out (vty
, " Import policy for this RS-client configured%s", VTY_NEWLINE
);
7462 if (filter
->map
[RMAP_EXPORT
].name
)
7463 vty_out (vty
, " Export policy for this RS-client configured%s", VTY_NEWLINE
);
7466 if (filter
->plist
[FILTER_IN
].name
)
7467 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
7468 filter
->plist
[FILTER_IN
].plist
? "*" : "",
7469 filter
->plist
[FILTER_IN
].name
,
7471 if (filter
->plist
[FILTER_OUT
].name
)
7472 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
7473 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
7474 filter
->plist
[FILTER_OUT
].name
,
7477 /* distribute-list */
7478 if (filter
->dlist
[FILTER_IN
].name
)
7479 vty_out (vty
, " Incoming update network filter list is %s%s%s",
7480 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
7481 filter
->dlist
[FILTER_IN
].name
,
7483 if (filter
->dlist
[FILTER_OUT
].name
)
7484 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
7485 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
7486 filter
->dlist
[FILTER_OUT
].name
,
7490 if (filter
->aslist
[FILTER_IN
].name
)
7491 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
7492 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
7493 filter
->aslist
[FILTER_IN
].name
,
7495 if (filter
->aslist
[FILTER_OUT
].name
)
7496 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
7497 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
7498 filter
->aslist
[FILTER_OUT
].name
,
7502 if (filter
->map
[RMAP_IN
].name
)
7503 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
7504 filter
->map
[RMAP_IN
].map
? "*" : "",
7505 filter
->map
[RMAP_IN
].name
,
7507 if (filter
->map
[RMAP_OUT
].name
)
7508 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
7509 filter
->map
[RMAP_OUT
].map
? "*" : "",
7510 filter
->map
[RMAP_OUT
].name
,
7512 if (filter
->map
[RMAP_IMPORT
].name
)
7513 vty_out (vty
, " Route map for advertisements going into this RS-client's table is %s%s%s",
7514 filter
->map
[RMAP_IMPORT
].map
? "*" : "",
7515 filter
->map
[RMAP_IMPORT
].name
,
7517 if (filter
->map
[RMAP_EXPORT
].name
)
7518 vty_out (vty
, " Route map for advertisements coming from this RS-client is %s%s%s",
7519 filter
->map
[RMAP_EXPORT
].map
? "*" : "",
7520 filter
->map
[RMAP_EXPORT
].name
,
7523 /* unsuppress-map */
7524 if (filter
->usmap
.name
)
7525 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
7526 filter
->usmap
.map
? "*" : "",
7527 filter
->usmap
.name
, VTY_NEWLINE
);
7529 /* Receive prefix count */
7530 vty_out (vty
, " %ld accepted prefixes%s", p
->pcount
[afi
][safi
], VTY_NEWLINE
);
7532 /* Maximum prefix */
7533 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
7535 vty_out (vty
, " Maximum prefixes allowed %ld%s%s", p
->pmax
[afi
][safi
],
7536 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
7537 ? " (warning-only)" : "", VTY_NEWLINE
);
7538 vty_out (vty
, " Threshold for warning message %d%%",
7539 p
->pmax_threshold
[afi
][safi
]);
7540 if (p
->pmax_restart
[afi
][safi
])
7541 vty_out (vty
, ", restart interval %d min", p
->pmax_restart
[afi
][safi
]);
7542 vty_out (vty
, "%s", VTY_NEWLINE
);
7545 vty_out (vty
, "%s", VTY_NEWLINE
);
7549 bgp_show_peer (struct vty
*vty
, struct peer
*p
)
7553 char timebuf
[BGP_UPTIME_LEN
];
7559 /* Configured IP address. */
7560 vty_out (vty
, "BGP neighbor is %s, ", p
->host
);
7561 vty_out (vty
, "remote AS %u, ", p
->as
);
7562 vty_out (vty
, "local AS %u%s%s, ",
7563 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
7564 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
7566 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_REPLACE_AS
) ?
7567 " replace-as" : "");
7568 vty_out (vty
, "%s link%s",
7569 p
->as
== p
->local_as
? "internal" : "external",
7574 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
7578 vty_out (vty
, " Member of peer-group %s for session parameters%s",
7579 p
->group
->name
, VTY_NEWLINE
);
7581 /* Administrative shutdown. */
7582 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
7583 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
7586 vty_out (vty
, " BGP version 4");
7587 vty_out (vty
, ", remote router ID %s%s",
7588 inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
7592 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
)
7593 && bgp_confederation_peers_check (bgp
, p
->as
))
7594 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
7597 vty_out (vty
, " BGP state = %s",
7598 LOOKUP (bgp_status_msg
, p
->status
));
7599 if (p
->status
== Established
)
7600 vty_out (vty
, ", up for %8s",
7601 peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
));
7602 else if (p
->status
== Active
)
7604 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
7605 vty_out (vty
, " (passive)");
7606 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
7607 vty_out (vty
, " (NSF passive)");
7609 vty_out (vty
, "%s", VTY_NEWLINE
);
7612 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
));
7614 /* Configured timer values. */
7615 vty_out (vty
, ", hold time is %d, keepalive interval is %d seconds%s",
7616 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
7617 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
7619 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
7620 vty_out (vty
, ", keepalive interval is %d seconds%s",
7621 p
->keepalive
, VTY_NEWLINE
);
7625 if (p
->status
== Established
)
7628 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
7629 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
7630 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
7631 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
7633 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
7634 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
7635 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
7636 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
7637 #endif /* HAVE_IPV6 */
7638 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
7639 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
7641 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
7644 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
)
7645 || CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
7647 vty_out (vty
, " 4 Byte AS:");
7648 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
7649 vty_out (vty
, " advertised");
7650 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
7651 vty_out (vty
, " %sreceived",
7652 CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
) ? "and " : "");
7653 vty_out (vty
, "%s", VTY_NEWLINE
);
7656 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
7657 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
7659 vty_out (vty
, " Dynamic:");
7660 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
7661 vty_out (vty
, " advertised");
7662 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
7663 vty_out (vty
, " %sreceived",
7664 CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) ? "and " : "");
7665 vty_out (vty
, "%s", VTY_NEWLINE
);
7669 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
7670 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
7671 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
7673 vty_out (vty
, " Route refresh:");
7674 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
7675 vty_out (vty
, " advertised");
7676 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
7677 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
7678 vty_out (vty
, " %sreceived(%s)",
7679 CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) ? "and " : "",
7680 (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
7681 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)) ?
7682 "old & new" : CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) ? "old" : "new");
7684 vty_out (vty
, "%s", VTY_NEWLINE
);
7687 /* Multiprotocol Extensions */
7688 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7689 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7690 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
7692 vty_out (vty
, " Address family %s:", afi_safi_print (afi
, safi
));
7693 if (p
->afc_adv
[afi
][safi
])
7694 vty_out (vty
, " advertised");
7695 if (p
->afc_recv
[afi
][safi
])
7696 vty_out (vty
, " %sreceived", p
->afc_adv
[afi
][safi
] ? "and " : "");
7697 vty_out (vty
, "%s", VTY_NEWLINE
);
7700 /* Gracefull Restart */
7701 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7702 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7704 vty_out (vty
, " Graceful Restart Capabilty:");
7705 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7706 vty_out (vty
, " advertised");
7707 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7708 vty_out (vty
, " %sreceived",
7709 CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) ? "and " : "");
7710 vty_out (vty
, "%s", VTY_NEWLINE
);
7712 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7714 int restart_af_count
= 0;
7716 vty_out (vty
, " Remote Restart timer is %d seconds%s",
7717 p
->v_gr_restart
, VTY_NEWLINE
);
7718 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
7720 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7721 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7722 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
7724 vty_out (vty
, "%s%s(%s)", restart_af_count
? ", " : "",
7725 afi_safi_print (afi
, safi
),
7726 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
) ?
7727 "preserved" : "not preserved");
7730 if (! restart_af_count
)
7731 vty_out (vty
, "none");
7732 vty_out (vty
, "%s", VTY_NEWLINE
);
7738 /* graceful restart information */
7739 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7743 int eor_send_af_count
= 0;
7744 int eor_receive_af_count
= 0;
7746 vty_out (vty
, " Graceful restart informations:%s", VTY_NEWLINE
);
7747 if (p
->status
== Established
)
7749 vty_out (vty
, " End-of-RIB send: ");
7750 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7751 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7752 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
7754 vty_out (vty
, "%s%s", eor_send_af_count
? ", " : "",
7755 afi_safi_print (afi
, safi
));
7756 eor_send_af_count
++;
7758 vty_out (vty
, "%s", VTY_NEWLINE
);
7760 vty_out (vty
, " End-of-RIB received: ");
7761 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7762 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7763 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
7765 vty_out (vty
, "%s%s", eor_receive_af_count
? ", " : "",
7766 afi_safi_print (afi
, safi
));
7767 eor_receive_af_count
++;
7769 vty_out (vty
, "%s", VTY_NEWLINE
);
7772 if (p
->t_gr_restart
)
7773 vty_out (vty
, " The remaining time of restart timer is %ld%s",
7774 thread_timer_remain_second (p
->t_gr_restart
), VTY_NEWLINE
);
7777 vty_out (vty
, " The remaining time of stalepath timer is %ld%s",
7778 thread_timer_remain_second (p
->t_gr_stale
), VTY_NEWLINE
);
7781 /* Packet counts. */
7782 vty_out (vty
, " Message statistics:%s", VTY_NEWLINE
);
7783 vty_out (vty
, " Inq depth is 0%s", VTY_NEWLINE
);
7784 vty_out (vty
, " Outq depth is %lu%s", (unsigned long) p
->obuf
->count
, VTY_NEWLINE
);
7785 vty_out (vty
, " Sent Rcvd%s", VTY_NEWLINE
);
7786 vty_out (vty
, " Opens: %10d %10d%s", p
->open_out
, p
->open_in
, VTY_NEWLINE
);
7787 vty_out (vty
, " Notifications: %10d %10d%s", p
->notify_out
, p
->notify_in
, VTY_NEWLINE
);
7788 vty_out (vty
, " Updates: %10d %10d%s", p
->update_out
, p
->update_in
, VTY_NEWLINE
);
7789 vty_out (vty
, " Keepalives: %10d %10d%s", p
->keepalive_out
, p
->keepalive_in
, VTY_NEWLINE
);
7790 vty_out (vty
, " Route Refresh: %10d %10d%s", p
->refresh_out
, p
->refresh_in
, VTY_NEWLINE
);
7791 vty_out (vty
, " Capability: %10d %10d%s", p
->dynamic_cap_out
, p
->dynamic_cap_in
, VTY_NEWLINE
);
7792 vty_out (vty
, " Total: %10d %10d%s", p
->open_out
+ p
->notify_out
+
7793 p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
+ p
->dynamic_cap_out
,
7794 p
->open_in
+ p
->notify_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
+
7795 p
->dynamic_cap_in
, VTY_NEWLINE
);
7797 /* advertisement-interval */
7798 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
7799 p
->v_routeadv
, VTY_NEWLINE
);
7801 /* Update-source. */
7802 if (p
->update_if
|| p
->update_source
)
7804 vty_out (vty
, " Update source is ");
7806 vty_out (vty
, "%s", p
->update_if
);
7807 else if (p
->update_source
)
7809 sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
7810 vty_out (vty
, "%s", VTY_NEWLINE
);
7813 /* Default weight */
7814 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
7815 vty_out (vty
, " Default weight %d%s", p
->weight
,
7818 vty_out (vty
, "%s", VTY_NEWLINE
);
7820 /* Address Family Information */
7821 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7822 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7823 if (p
->afc
[afi
][safi
])
7824 bgp_show_peer_afi (vty
, p
, afi
, safi
);
7826 vty_out (vty
, " Connections established %d; dropped %d%s",
7827 p
->established
, p
->dropped
,
7831 vty_out (vty
, " Last reset never%s", VTY_NEWLINE
);
7833 vty_out (vty
, " Last reset %s, due to %s%s",
7834 peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
),
7835 peer_down_str
[(int) p
->last_reset
], VTY_NEWLINE
);
7837 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
7839 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
7841 if (p
->t_pmax_restart
)
7842 vty_out (vty
, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
7843 p
->host
, thread_timer_remain_second (p
->t_pmax_restart
),
7846 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
7847 p
->host
, VTY_NEWLINE
);
7850 /* EBGP Multihop and GTSM */
7851 if (p
->sort
!= BGP_PEER_IBGP
)
7853 if (p
->gtsm_hops
> 0)
7854 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
7855 p
->gtsm_hops
, VTY_NEWLINE
);
7856 else if (p
->ttl
> 1)
7857 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
7858 p
->ttl
, VTY_NEWLINE
);
7862 if (p
->gtsm_hops
> 0)
7863 vty_out (vty
, " Internal BGP neighbor may be up to %d hops away.%s",
7864 p
->gtsm_hops
, VTY_NEWLINE
);
7867 /* Local address. */
7870 vty_out (vty
, "Local host: %s, Local port: %d%s",
7871 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
7872 ntohs (p
->su_local
->sin
.sin_port
),
7876 /* Remote address. */
7879 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
7880 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
7881 ntohs (p
->su_remote
->sin
.sin_port
),
7885 /* Nexthop display. */
7888 vty_out (vty
, "Nexthop: %s%s",
7889 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
7892 vty_out (vty
, "Nexthop global: %s%s",
7893 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
7895 vty_out (vty
, "Nexthop local: %s%s",
7896 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
7898 vty_out (vty
, "BGP connection: %s%s",
7899 p
->shared_network
? "shared network" : "non shared network",
7901 #endif /* HAVE_IPV6 */
7904 /* Timer information. */
7906 vty_out (vty
, "Next start timer due in %ld seconds%s",
7907 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
7909 vty_out (vty
, "Next connect timer due in %ld seconds%s",
7910 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
7912 vty_out (vty
, "Read thread: %s Write thread: %s%s",
7913 p
->t_read
? "on" : "off",
7914 p
->t_write
? "on" : "off",
7917 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
7918 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
7919 bgp_capability_vty_out (vty
, p
);
7921 vty_out (vty
, "%s", VTY_NEWLINE
);
7925 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
,
7926 enum show_type type
, union sockunion
*su
)
7928 struct listnode
*node
, *nnode
;
7932 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
7937 bgp_show_peer (vty
, peer
);
7940 if (sockunion_same (&peer
->su
, su
))
7943 bgp_show_peer (vty
, peer
);
7949 if (type
== show_peer
&& ! find
)
7950 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
7956 bgp_show_neighbor_vty (struct vty
*vty
, const char *name
,
7957 enum show_type type
, const char *ip_str
)
7965 ret
= str2sockunion (ip_str
, &su
);
7968 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
7975 bgp
= bgp_lookup_by_name (name
);
7979 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
7983 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7988 bgp
= bgp_get_default ();
7991 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7996 /* "show ip bgp neighbors" commands. */
7997 DEFUN (show_ip_bgp_neighbors
,
7998 show_ip_bgp_neighbors_cmd
,
7999 "show ip bgp neighbors",
8003 "Detailed information on TCP and BGP neighbor connections\n")
8005 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
);
8008 ALIAS (show_ip_bgp_neighbors
,
8009 show_ip_bgp_ipv4_neighbors_cmd
,
8010 "show ip bgp ipv4 (unicast|multicast) neighbors",
8015 "Address Family modifier\n"
8016 "Address Family modifier\n"
8017 "Detailed information on TCP and BGP neighbor connections\n")
8019 ALIAS (show_ip_bgp_neighbors
,
8020 show_ip_bgp_vpnv4_all_neighbors_cmd
,
8021 "show ip bgp vpnv4 all neighbors",
8025 "Display VPNv4 NLRI specific information\n"
8026 "Display information about all VPNv4 NLRIs\n"
8027 "Detailed information on TCP and BGP neighbor connections\n")
8029 ALIAS (show_ip_bgp_neighbors
,
8030 show_ip_bgp_vpnv4_rd_neighbors_cmd
,
8031 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
8035 "Display VPNv4 NLRI specific information\n"
8036 "Display information for a route distinguisher\n"
8037 "VPN Route Distinguisher\n"
8038 "Detailed information on TCP and BGP neighbor connections\n")
8040 ALIAS (show_ip_bgp_neighbors
,
8041 show_bgp_neighbors_cmd
,
8042 "show bgp neighbors",
8045 "Detailed information on TCP and BGP neighbor connections\n")
8047 ALIAS (show_ip_bgp_neighbors
,
8048 show_bgp_ipv6_neighbors_cmd
,
8049 "show bgp ipv6 neighbors",
8053 "Detailed information on TCP and BGP neighbor connections\n")
8055 DEFUN (show_ip_bgp_neighbors_peer
,
8056 show_ip_bgp_neighbors_peer_cmd
,
8057 "show ip bgp neighbors (A.B.C.D|X:X::X:X)",
8061 "Detailed information on TCP and BGP neighbor connections\n"
8062 "Neighbor to display information about\n"
8063 "Neighbor to display information about\n")
8065 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 1]);
8068 ALIAS (show_ip_bgp_neighbors_peer
,
8069 show_ip_bgp_ipv4_neighbors_peer_cmd
,
8070 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)",
8075 "Address Family modifier\n"
8076 "Address Family modifier\n"
8077 "Detailed information on TCP and BGP neighbor connections\n"
8078 "Neighbor to display information about\n"
8079 "Neighbor to display information about\n")
8081 ALIAS (show_ip_bgp_neighbors_peer
,
8082 show_ip_bgp_vpnv4_all_neighbors_peer_cmd
,
8083 "show ip bgp vpnv4 all neighbors A.B.C.D",
8087 "Display VPNv4 NLRI specific information\n"
8088 "Display information about all VPNv4 NLRIs\n"
8089 "Detailed information on TCP and BGP neighbor connections\n"
8090 "Neighbor to display information about\n")
8092 ALIAS (show_ip_bgp_neighbors_peer
,
8093 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
,
8094 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
8098 "Display VPNv4 NLRI specific information\n"
8099 "Display information about all VPNv4 NLRIs\n"
8100 "Detailed information on TCP and BGP neighbor connections\n"
8101 "Neighbor to display information about\n")
8103 ALIAS (show_ip_bgp_neighbors_peer
,
8104 show_bgp_neighbors_peer_cmd
,
8105 "show bgp neighbors (A.B.C.D|X:X::X:X)",
8108 "Detailed information on TCP and BGP neighbor connections\n"
8109 "Neighbor to display information about\n"
8110 "Neighbor to display information about\n")
8112 ALIAS (show_ip_bgp_neighbors_peer
,
8113 show_bgp_ipv6_neighbors_peer_cmd
,
8114 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)",
8118 "Detailed information on TCP and BGP neighbor connections\n"
8119 "Neighbor to display information about\n"
8120 "Neighbor to display information about\n")
8122 DEFUN (show_ip_bgp_instance_neighbors
,
8123 show_ip_bgp_instance_neighbors_cmd
,
8124 "show ip bgp view WORD neighbors",
8130 "Detailed information on TCP and BGP neighbor connections\n")
8132 return bgp_show_neighbor_vty (vty
, argv
[0], show_all
, NULL
);
8135 ALIAS (show_ip_bgp_instance_neighbors
,
8136 show_bgp_instance_neighbors_cmd
,
8137 "show bgp view WORD neighbors",
8142 "Detailed information on TCP and BGP neighbor connections\n")
8144 ALIAS (show_ip_bgp_instance_neighbors
,
8145 show_bgp_instance_ipv6_neighbors_cmd
,
8146 "show bgp view WORD ipv6 neighbors",
8152 "Detailed information on TCP and BGP neighbor connections\n")
8154 DEFUN (show_ip_bgp_instance_neighbors_peer
,
8155 show_ip_bgp_instance_neighbors_peer_cmd
,
8156 "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
8162 "Detailed information on TCP and BGP neighbor connections\n"
8163 "Neighbor to display information about\n"
8164 "Neighbor to display information about\n")
8166 return bgp_show_neighbor_vty (vty
, argv
[0], show_peer
, argv
[1]);
8169 ALIAS (show_ip_bgp_instance_neighbors_peer
,
8170 show_bgp_instance_neighbors_peer_cmd
,
8171 "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
8176 "Detailed information on TCP and BGP neighbor connections\n"
8177 "Neighbor to display information about\n"
8178 "Neighbor to display information about\n")
8180 ALIAS (show_ip_bgp_instance_neighbors_peer
,
8181 show_bgp_instance_ipv6_neighbors_peer_cmd
,
8182 "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)",
8188 "Detailed information on TCP and BGP neighbor connections\n"
8189 "Neighbor to display information about\n"
8190 "Neighbor to display information about\n")
8192 /* Show BGP's AS paths internal data. There are both `show ip bgp
8193 paths' and `show ip mbgp paths'. Those functions results are the
8195 DEFUN (show_ip_bgp_paths
,
8196 show_ip_bgp_paths_cmd
,
8197 "show ip bgp paths",
8201 "Path information\n")
8203 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
8204 aspath_print_all_vty (vty
);
8208 DEFUN (show_ip_bgp_ipv4_paths
,
8209 show_ip_bgp_ipv4_paths_cmd
,
8210 "show ip bgp ipv4 (unicast|multicast) paths",
8215 "Address Family modifier\n"
8216 "Address Family modifier\n"
8217 "Path information\n")
8219 vty_out (vty
, "Address Refcnt Path\r\n");
8220 aspath_print_all_vty (vty
);
8228 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
8230 struct community
*com
;
8232 com
= (struct community
*) backet
->data
;
8233 vty_out (vty
, "[%p] (%ld) %s%s", backet
, com
->refcnt
,
8234 community_str (com
), VTY_NEWLINE
);
8237 /* Show BGP's community internal data. */
8238 DEFUN (show_ip_bgp_community_info
,
8239 show_ip_bgp_community_info_cmd
,
8240 "show ip bgp community-info",
8244 "List all bgp community information\n")
8246 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
8248 hash_iterate (community_hash (),
8249 (void (*) (struct hash_backet
*, void *))
8250 community_show_all_iterator
,
8256 DEFUN (show_ip_bgp_attr_info
,
8257 show_ip_bgp_attr_info_cmd
,
8258 "show ip bgp attribute-info",
8262 "List all bgp attribute information\n")
8264 attr_show_all (vty
);
8269 bgp_write_rsclient_summary (struct vty
*vty
, struct peer
*rsclient
,
8270 afi_t afi
, safi_t safi
)
8272 char timebuf
[BGP_UPTIME_LEN
];
8276 struct listnode
*node
, *nnode
;
8280 if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_GROUP
))
8282 for (ALL_LIST_ELEMENTS (rsclient
->group
->peer
, node
, nnode
, peer
))
8285 bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
8290 len
= vty_out (vty
, "%s", rsclient
->host
);
8294 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
8296 vty_out (vty
, "%*s", len
, " ");
8298 vty_out (vty
, "4 ");
8300 vty_out (vty
, "%11d ", rsclient
->as
);
8302 rmname
= ROUTE_MAP_EXPORT_NAME(&rsclient
->filter
[afi
][safi
]);
8303 if ( rmname
&& strlen (rmname
) > 13 )
8305 sprintf (rmbuf
, "%13s", "...");
8306 rmname
= strncpy (rmbuf
, rmname
, 10);
8310 vty_out (vty
, " %13s ", rmname
);
8312 rmname
= ROUTE_MAP_IMPORT_NAME(&rsclient
->filter
[afi
][safi
]);
8313 if ( rmname
&& strlen (rmname
) > 13 )
8315 sprintf (rmbuf
, "%13s", "...");
8316 rmname
= strncpy (rmbuf
, rmname
, 10);
8320 vty_out (vty
, " %13s ", rmname
);
8322 vty_out (vty
, "%8s", peer_uptime (rsclient
->uptime
, timebuf
, BGP_UPTIME_LEN
));
8324 if (CHECK_FLAG (rsclient
->flags
, PEER_FLAG_SHUTDOWN
))
8325 vty_out (vty
, " Idle (Admin)");
8326 else if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
8327 vty_out (vty
, " Idle (PfxCt)");
8329 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, rsclient
->status
));
8331 vty_out (vty
, "%s", VTY_NEWLINE
);
8337 bgp_show_rsclient_summary (struct vty
*vty
, struct bgp
*bgp
,
8338 afi_t afi
, safi_t safi
)
8341 struct listnode
*node
, *nnode
;
8344 /* Header string for each address family. */
8345 static char header
[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
8347 for (ALL_LIST_ELEMENTS (bgp
->rsclient
, node
, nnode
, peer
))
8349 if (peer
->afc
[afi
][safi
] &&
8350 CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
8355 "Route Server's BGP router identifier %s%s",
8356 inet_ntoa (bgp
->router_id
), VTY_NEWLINE
);
8358 "Route Server's local AS number %u%s", bgp
->as
,
8361 vty_out (vty
, "%s", VTY_NEWLINE
);
8362 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
8365 count
+= bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
8370 vty_out (vty
, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE
,
8371 count
, VTY_NEWLINE
);
8373 vty_out (vty
, "No %s Route Server Client is configured%s",
8374 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
8380 bgp_show_rsclient_summary_vty (struct vty
*vty
, const char *name
,
8381 afi_t afi
, safi_t safi
)
8387 bgp
= bgp_lookup_by_name (name
);
8391 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
8395 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
8399 bgp
= bgp_get_default ();
8402 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
8407 /* 'show bgp rsclient' commands. */
8408 DEFUN (show_ip_bgp_rsclient_summary
,
8409 show_ip_bgp_rsclient_summary_cmd
,
8410 "show ip bgp rsclient summary",
8414 "Information about Route Server Clients\n"
8415 "Summary of all Route Server Clients\n")
8417 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
8420 DEFUN (show_ip_bgp_instance_rsclient_summary
,
8421 show_ip_bgp_instance_rsclient_summary_cmd
,
8422 "show ip bgp view WORD rsclient summary",
8428 "Information about Route Server Clients\n"
8429 "Summary of all Route Server Clients\n")
8431 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
8434 DEFUN (show_ip_bgp_ipv4_rsclient_summary
,
8435 show_ip_bgp_ipv4_rsclient_summary_cmd
,
8436 "show ip bgp ipv4 (unicast|multicast) rsclient summary",
8441 "Address Family modifier\n"
8442 "Address Family modifier\n"
8443 "Information about Route Server Clients\n"
8444 "Summary of all Route Server Clients\n")
8446 if (strncmp (argv
[0], "m", 1) == 0)
8447 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
8449 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
8452 DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary
,
8453 show_ip_bgp_instance_ipv4_rsclient_summary_cmd
,
8454 "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary",
8461 "Address Family modifier\n"
8462 "Address Family modifier\n"
8463 "Information about Route Server Clients\n"
8464 "Summary of all Route Server Clients\n")
8466 if (strncmp (argv
[1], "m", 1) == 0)
8467 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
8469 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
8472 DEFUN (show_bgp_instance_ipv4_safi_rsclient_summary
,
8473 show_bgp_instance_ipv4_safi_rsclient_summary_cmd
,
8474 "show bgp view WORD ipv4 (unicast|multicast) rsclient summary",
8480 "Address Family modifier\n"
8481 "Address Family modifier\n"
8482 "Information about Route Server Clients\n"
8483 "Summary of all Route Server Clients\n")
8488 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
8489 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, safi
);
8491 safi
= (strncmp (argv
[0], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
8492 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, safi
);
8496 ALIAS (show_bgp_instance_ipv4_safi_rsclient_summary
,
8497 show_bgp_ipv4_safi_rsclient_summary_cmd
,
8498 "show bgp ipv4 (unicast|multicast) rsclient summary",
8502 "Address Family modifier\n"
8503 "Address Family modifier\n"
8504 "Information about Route Server Clients\n"
8505 "Summary of all Route Server Clients\n")
8508 DEFUN (show_bgp_rsclient_summary
,
8509 show_bgp_rsclient_summary_cmd
,
8510 "show bgp rsclient summary",
8513 "Information about Route Server Clients\n"
8514 "Summary of all Route Server Clients\n")
8516 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
8519 DEFUN (show_bgp_instance_rsclient_summary
,
8520 show_bgp_instance_rsclient_summary_cmd
,
8521 "show bgp view WORD rsclient summary",
8526 "Information about Route Server Clients\n"
8527 "Summary of all Route Server Clients\n")
8529 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
8532 ALIAS (show_bgp_rsclient_summary
,
8533 show_bgp_ipv6_rsclient_summary_cmd
,
8534 "show bgp ipv6 rsclient summary",
8538 "Information about Route Server Clients\n"
8539 "Summary of all Route Server Clients\n")
8541 ALIAS (show_bgp_instance_rsclient_summary
,
8542 show_bgp_instance_ipv6_rsclient_summary_cmd
,
8543 "show bgp view WORD ipv6 rsclient summary",
8549 "Information about Route Server Clients\n"
8550 "Summary of all Route Server Clients\n")
8552 DEFUN (show_bgp_instance_ipv6_safi_rsclient_summary
,
8553 show_bgp_instance_ipv6_safi_rsclient_summary_cmd
,
8554 "show bgp view WORD ipv6 (unicast|multicast) rsclient summary",
8560 "Address Family modifier\n"
8561 "Address Family modifier\n"
8562 "Information about Route Server Clients\n"
8563 "Summary of all Route Server Clients\n")
8568 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
8569 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, safi
);
8571 safi
= (strncmp (argv
[0], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
8572 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, safi
);
8576 ALIAS (show_bgp_instance_ipv6_safi_rsclient_summary
,
8577 show_bgp_ipv6_safi_rsclient_summary_cmd
,
8578 "show bgp ipv6 (unicast|multicast) rsclient summary",
8582 "Address Family modifier\n"
8583 "Address Family modifier\n"
8584 "Information about Route Server Clients\n"
8585 "Summary of all Route Server Clients\n")
8587 #endif /* HAVE IPV6 */
8589 /* Redistribute VTY commands. */
8591 DEFUN (bgp_redistribute_ipv4
,
8592 bgp_redistribute_ipv4_cmd
,
8593 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
,
8594 "Redistribute information from another routing protocol\n"
8595 QUAGGA_IP_REDIST_HELP_STR_BGPD
)
8599 type
= proto_redistnum (AFI_IP
, argv
[0]);
8600 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8602 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8605 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8608 DEFUN (bgp_redistribute_ipv4_rmap
,
8609 bgp_redistribute_ipv4_rmap_cmd
,
8610 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD",
8611 "Redistribute information from another routing protocol\n"
8612 QUAGGA_IP_REDIST_HELP_STR_BGPD
8613 "Route map reference\n"
8614 "Pointer to route-map entries\n")
8618 type
= proto_redistnum (AFI_IP
, argv
[0]);
8619 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8621 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8625 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
8626 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8629 DEFUN (bgp_redistribute_ipv4_metric
,
8630 bgp_redistribute_ipv4_metric_cmd
,
8631 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295>",
8632 "Redistribute information from another routing protocol\n"
8633 QUAGGA_IP_REDIST_HELP_STR_BGPD
8634 "Metric for redistributed routes\n"
8640 type
= proto_redistnum (AFI_IP
, argv
[0]);
8641 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8643 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8646 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8648 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8649 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8652 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
8653 bgp_redistribute_ipv4_rmap_metric_cmd
,
8654 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
8655 "Redistribute information from another routing protocol\n"
8656 QUAGGA_IP_REDIST_HELP_STR_BGPD
8657 "Route map reference\n"
8658 "Pointer to route-map entries\n"
8659 "Metric for redistributed routes\n"
8665 type
= proto_redistnum (AFI_IP
, argv
[0]);
8666 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8668 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8671 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8673 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
8674 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8675 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8678 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
8679 bgp_redistribute_ipv4_metric_rmap_cmd
,
8680 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
8681 "Redistribute information from another routing protocol\n"
8682 QUAGGA_IP_REDIST_HELP_STR_BGPD
8683 "Metric for redistributed routes\n"
8685 "Route map reference\n"
8686 "Pointer to route-map entries\n")
8691 type
= proto_redistnum (AFI_IP
, argv
[0]);
8692 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8694 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8697 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8699 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8700 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[2]);
8701 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8704 DEFUN (no_bgp_redistribute_ipv4
,
8705 no_bgp_redistribute_ipv4_cmd
,
8706 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
,
8708 "Redistribute information from another routing protocol\n"
8709 QUAGGA_IP_REDIST_HELP_STR_BGPD
)
8713 type
= proto_redistnum (AFI_IP
, argv
[0]);
8714 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8716 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8720 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
);
8723 DEFUN (no_bgp_redistribute_ipv4_rmap
,
8724 no_bgp_redistribute_ipv4_rmap_cmd
,
8725 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD",
8727 "Redistribute information from another routing protocol\n"
8728 QUAGGA_IP_REDIST_HELP_STR_BGPD
8729 "Route map reference\n"
8730 "Pointer to route-map entries\n")
8734 type
= proto_redistnum (AFI_IP
, argv
[0]);
8735 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8737 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8741 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8745 DEFUN (no_bgp_redistribute_ipv4_metric
,
8746 no_bgp_redistribute_ipv4_metric_cmd
,
8747 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295>",
8749 "Redistribute information from another routing protocol\n"
8750 QUAGGA_IP_REDIST_HELP_STR_BGPD
8751 "Metric for redistributed routes\n"
8756 type
= proto_redistnum (AFI_IP
, argv
[0]);
8757 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8759 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8763 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8767 DEFUN (no_bgp_redistribute_ipv4_rmap_metric
,
8768 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
8769 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
8771 "Redistribute information from another routing protocol\n"
8772 QUAGGA_IP_REDIST_HELP_STR_BGPD
8773 "Route map reference\n"
8774 "Pointer to route-map entries\n"
8775 "Metric for redistributed routes\n"
8780 type
= proto_redistnum (AFI_IP
, argv
[0]);
8781 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8783 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8787 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8788 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8792 ALIAS (no_bgp_redistribute_ipv4_rmap_metric
,
8793 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
8794 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
8796 "Redistribute information from another routing protocol\n"
8797 QUAGGA_IP_REDIST_HELP_STR_BGPD
8798 "Metric for redistributed routes\n"
8800 "Route map reference\n"
8801 "Pointer to route-map entries\n")
8804 DEFUN (bgp_redistribute_ipv6
,
8805 bgp_redistribute_ipv6_cmd
,
8806 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
,
8807 "Redistribute information from another routing protocol\n"
8808 QUAGGA_IP6_REDIST_HELP_STR_BGPD
)
8812 type
= proto_redistnum (AFI_IP6
, argv
[0]);
8813 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8815 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8819 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8822 DEFUN (bgp_redistribute_ipv6_rmap
,
8823 bgp_redistribute_ipv6_rmap_cmd
,
8824 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD",
8825 "Redistribute information from another routing protocol\n"
8826 QUAGGA_IP6_REDIST_HELP_STR_BGPD
8827 "Route map reference\n"
8828 "Pointer to route-map entries\n")
8832 type
= proto_redistnum (AFI_IP6
, argv
[0]);
8833 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8835 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8839 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8840 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8843 DEFUN (bgp_redistribute_ipv6_metric
,
8844 bgp_redistribute_ipv6_metric_cmd
,
8845 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295>",
8846 "Redistribute information from another routing protocol\n"
8847 QUAGGA_IP6_REDIST_HELP_STR_BGPD
8848 "Metric for redistributed routes\n"
8854 type
= proto_redistnum (AFI_IP6
, argv
[0]);
8855 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8857 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8860 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8862 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8863 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8866 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
8867 bgp_redistribute_ipv6_rmap_metric_cmd
,
8868 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
8869 "Redistribute information from another routing protocol\n"
8870 QUAGGA_IP6_REDIST_HELP_STR_BGPD
8871 "Route map reference\n"
8872 "Pointer to route-map entries\n"
8873 "Metric for redistributed routes\n"
8879 type
= proto_redistnum (AFI_IP6
, argv
[0]);
8880 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8882 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8885 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8887 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8888 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8889 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8892 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
8893 bgp_redistribute_ipv6_metric_rmap_cmd
,
8894 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
8895 "Redistribute information from another routing protocol\n"
8896 QUAGGA_IP6_REDIST_HELP_STR_BGPD
8897 "Metric for redistributed routes\n"
8899 "Route map reference\n"
8900 "Pointer to route-map entries\n")
8905 type
= proto_redistnum (AFI_IP6
, argv
[0]);
8906 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8908 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8911 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8913 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8914 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[2]);
8915 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8918 DEFUN (no_bgp_redistribute_ipv6
,
8919 no_bgp_redistribute_ipv6_cmd
,
8920 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
,
8922 "Redistribute information from another routing protocol\n"
8923 QUAGGA_IP6_REDIST_HELP_STR_BGPD
)
8927 type
= proto_redistnum (AFI_IP6
, argv
[0]);
8928 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8930 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8934 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
);
8937 DEFUN (no_bgp_redistribute_ipv6_rmap
,
8938 no_bgp_redistribute_ipv6_rmap_cmd
,
8939 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD",
8941 "Redistribute information from another routing protocol\n"
8942 QUAGGA_IP6_REDIST_HELP_STR_BGPD
8943 "Route map reference\n"
8944 "Pointer to route-map entries\n")
8948 type
= proto_redistnum (AFI_IP6
, argv
[0]);
8949 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8951 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8955 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8959 DEFUN (no_bgp_redistribute_ipv6_metric
,
8960 no_bgp_redistribute_ipv6_metric_cmd
,
8961 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295>",
8963 "Redistribute information from another routing protocol\n"
8964 QUAGGA_IP6_REDIST_HELP_STR_BGPD
8965 "Metric for redistributed routes\n"
8970 type
= proto_redistnum (AFI_IP6
, argv
[0]);
8971 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8973 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8977 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8981 DEFUN (no_bgp_redistribute_ipv6_rmap_metric
,
8982 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
8983 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
8985 "Redistribute information from another routing protocol\n"
8986 QUAGGA_IP6_REDIST_HELP_STR_BGPD
8987 "Route map reference\n"
8988 "Pointer to route-map entries\n"
8989 "Metric for redistributed routes\n"
8994 type
= proto_redistnum (AFI_IP6
, argv
[0]);
8995 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
8997 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
9001 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
9002 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
9006 ALIAS (no_bgp_redistribute_ipv6_rmap_metric
,
9007 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
9008 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
9010 "Redistribute information from another routing protocol\n"
9011 QUAGGA_IP6_REDIST_HELP_STR_BGPD
9012 "Metric for redistributed routes\n"
9014 "Route map reference\n"
9015 "Pointer to route-map entries\n")
9016 #endif /* HAVE_IPV6 */
9019 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
9020 safi_t safi
, int *write
)
9024 /* Unicast redistribution only. */
9025 if (safi
!= SAFI_UNICAST
)
9028 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
9030 /* Redistribute BGP does not make sense. */
9031 if (bgp
->redist
[afi
][i
] && i
!= ZEBRA_ROUTE_BGP
)
9033 /* Display "address-family" when it is not yet diplayed. */
9034 bgp_config_write_family_header (vty
, afi
, safi
, write
);
9036 /* "redistribute" configuration. */
9037 vty_out (vty
, " redistribute %s", zebra_route_string(i
));
9039 if (bgp
->redist_metric_flag
[afi
][i
])
9040 vty_out (vty
, " metric %u", bgp
->redist_metric
[afi
][i
]);
9042 if (bgp
->rmap
[afi
][i
].name
)
9043 vty_out (vty
, " route-map %s", bgp
->rmap
[afi
][i
].name
);
9045 vty_out (vty
, "%s", VTY_NEWLINE
);
9051 /* BGP node structure. */
9052 static struct cmd_node bgp_node
=
9055 "%s(config-router)# ",
9059 static struct cmd_node bgp_ipv4_unicast_node
=
9062 "%s(config-router-af)# ",
9066 static struct cmd_node bgp_ipv4_multicast_node
=
9069 "%s(config-router-af)# ",
9073 static struct cmd_node bgp_ipv6_unicast_node
=
9076 "%s(config-router-af)# ",
9080 static struct cmd_node bgp_ipv6_multicast_node
=
9083 "%s(config-router-af)# ",
9087 static struct cmd_node bgp_vpnv4_node
=
9090 "%s(config-router-af)# ",
9094 static void community_list_vty (void);
9099 /* Install bgp top node. */
9100 install_node (&bgp_node
, bgp_config_write
);
9101 install_node (&bgp_ipv4_unicast_node
, NULL
);
9102 install_node (&bgp_ipv4_multicast_node
, NULL
);
9103 install_node (&bgp_ipv6_unicast_node
, NULL
);
9104 install_node (&bgp_ipv6_multicast_node
, NULL
);
9105 install_node (&bgp_vpnv4_node
, NULL
);
9107 /* Install default VTY commands to new nodes. */
9108 install_default (BGP_NODE
);
9109 install_default (BGP_IPV4_NODE
);
9110 install_default (BGP_IPV4M_NODE
);
9111 install_default (BGP_IPV6_NODE
);
9112 install_default (BGP_IPV6M_NODE
);
9113 install_default (BGP_VPNV4_NODE
);
9115 /* "bgp multiple-instance" commands. */
9116 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
9117 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
9119 /* "bgp config-type" commands. */
9120 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
9121 install_element (CONFIG_NODE
, &no_bgp_config_type_cmd
);
9123 /* Dummy commands (Currently not supported) */
9124 install_element (BGP_NODE
, &no_synchronization_cmd
);
9125 install_element (BGP_NODE
, &no_auto_summary_cmd
);
9127 /* "router bgp" commands. */
9128 install_element (CONFIG_NODE
, &router_bgp_cmd
);
9129 install_element (CONFIG_NODE
, &router_bgp_view_cmd
);
9131 /* "no router bgp" commands. */
9132 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
9133 install_element (CONFIG_NODE
, &no_router_bgp_view_cmd
);
9135 /* "bgp router-id" commands. */
9136 install_element (BGP_NODE
, &bgp_router_id_cmd
);
9137 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
9138 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
9140 /* "bgp cluster-id" commands. */
9141 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
9142 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
9143 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
9144 install_element (BGP_NODE
, &no_bgp_cluster_id_arg_cmd
);
9146 /* "bgp confederation" commands. */
9147 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
9148 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
9149 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
9151 /* "bgp confederation peers" commands. */
9152 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
9153 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
9155 /* "maximum-paths" commands. */
9156 install_element (BGP_NODE
, &bgp_maxpaths_cmd
);
9157 install_element (BGP_NODE
, &no_bgp_maxpaths_cmd
);
9158 install_element (BGP_NODE
, &no_bgp_maxpaths_arg_cmd
);
9159 install_element (BGP_IPV4_NODE
, &bgp_maxpaths_cmd
);
9160 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_cmd
);
9161 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_arg_cmd
);
9162 install_element (BGP_NODE
, &bgp_maxpaths_ibgp_cmd
);
9163 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
9164 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
9165 install_element (BGP_IPV4_NODE
, &bgp_maxpaths_ibgp_cmd
);
9166 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
9167 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
9169 /* "timers bgp" commands. */
9170 install_element (BGP_NODE
, &bgp_timers_cmd
);
9171 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
9172 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
9174 /* "bgp client-to-client reflection" commands */
9175 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
9176 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
9178 /* "bgp always-compare-med" commands */
9179 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
9180 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
9182 /* "bgp deterministic-med" commands */
9183 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
9184 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
9186 /* "bgp graceful-restart" commands */
9187 install_element (BGP_NODE
, &bgp_graceful_restart_cmd
);
9188 install_element (BGP_NODE
, &no_bgp_graceful_restart_cmd
);
9189 install_element (BGP_NODE
, &bgp_graceful_restart_stalepath_time_cmd
);
9190 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_cmd
);
9191 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_val_cmd
);
9193 /* "bgp fast-external-failover" commands */
9194 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
9195 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
9197 /* "bgp enforce-first-as" commands */
9198 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
9199 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
9201 /* "bgp bestpath compare-routerid" commands */
9202 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
9203 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
9205 /* "bgp bestpath as-path ignore" commands */
9206 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
9207 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
9209 /* "bgp bestpath as-path confed" commands */
9210 install_element (BGP_NODE
, &bgp_bestpath_aspath_confed_cmd
);
9211 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_confed_cmd
);
9213 /* "bgp bestpath as-path multipath-relax" commands */
9214 install_element (BGP_NODE
, &bgp_bestpath_aspath_multipath_relax_cmd
);
9215 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_multipath_relax_cmd
);
9217 /* "bgp log-neighbor-changes" commands */
9218 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
9219 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
9221 /* "bgp bestpath med" commands */
9222 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
9223 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
9224 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
9225 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
9226 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
9227 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
9229 /* "no bgp default ipv4-unicast" commands. */
9230 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
9231 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
9233 /* "bgp network import-check" commands. */
9234 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
9235 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
9237 /* "bgp default local-preference" commands. */
9238 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
9239 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
9240 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
9242 /* "neighbor remote-as" commands. */
9243 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
9244 install_element (BGP_NODE
, &no_neighbor_cmd
);
9245 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
9247 /* "neighbor peer-group" commands. */
9248 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
9249 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
9250 install_element (BGP_NODE
, &no_neighbor_peer_group_remote_as_cmd
);
9252 /* "neighbor local-as" commands. */
9253 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
9254 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
9255 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_replace_as_cmd
);
9256 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
9257 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
9258 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
9259 install_element (BGP_NODE
, &no_neighbor_local_as_val3_cmd
);
9261 /* "neighbor password" commands. */
9262 install_element (BGP_NODE
, &neighbor_password_cmd
);
9263 install_element (BGP_NODE
, &no_neighbor_password_cmd
);
9265 /* "neighbor activate" commands. */
9266 install_element (BGP_NODE
, &neighbor_activate_cmd
);
9267 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
9268 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
9269 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
9270 install_element (BGP_IPV6M_NODE
, &neighbor_activate_cmd
);
9271 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
9273 /* "no neighbor activate" commands. */
9274 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
9275 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
9276 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
9277 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
9278 install_element (BGP_IPV6M_NODE
, &no_neighbor_activate_cmd
);
9279 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
9281 /* "neighbor peer-group set" commands. */
9282 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
9283 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
9284 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
9285 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
9286 install_element (BGP_IPV6M_NODE
, &neighbor_set_peer_group_cmd
);
9287 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
9289 /* "no neighbor peer-group unset" commands. */
9290 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
9291 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
9292 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
9293 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
9294 install_element (BGP_IPV6M_NODE
, &no_neighbor_set_peer_group_cmd
);
9295 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
9297 /* "neighbor softreconfiguration inbound" commands.*/
9298 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
9299 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9300 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
9301 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9302 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
9303 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9304 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
9305 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9306 install_element (BGP_IPV6M_NODE
, &neighbor_soft_reconfiguration_cmd
);
9307 install_element (BGP_IPV6M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9308 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
9309 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9311 /* "neighbor attribute-unchanged" commands. */
9312 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
9313 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
9314 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
9315 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
9316 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
9317 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
9318 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
9319 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
9320 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
9321 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
9322 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
9323 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
9324 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9325 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9326 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9327 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9328 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9329 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9330 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9331 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9332 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9333 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9334 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
9335 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
9336 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
9337 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
9338 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
9339 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
9340 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
9341 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
9342 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
9343 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
9344 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
9345 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
9346 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9347 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9348 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9349 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9350 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9351 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9352 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9353 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9354 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9355 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9356 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
9357 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
9358 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
9359 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
9360 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
9361 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
9362 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
9363 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
9364 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
9365 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
9366 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
9367 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
9368 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9369 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9370 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9371 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9372 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9373 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9374 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9375 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9376 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9377 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9378 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
9379 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
9380 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
9381 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
9382 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
9383 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
9384 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
9385 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
9386 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
9387 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
9388 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
9389 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
9390 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9391 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9392 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9393 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9394 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9395 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9396 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9397 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9398 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9399 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9400 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged_cmd
);
9401 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged1_cmd
);
9402 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged2_cmd
);
9403 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged3_cmd
);
9404 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged4_cmd
);
9405 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged5_cmd
);
9406 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged6_cmd
);
9407 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged7_cmd
);
9408 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged8_cmd
);
9409 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged9_cmd
);
9410 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged10_cmd
);
9411 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged_cmd
);
9412 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9413 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9414 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9415 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9416 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9417 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9418 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9419 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9420 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9421 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9422 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
9423 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
9424 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
9425 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
9426 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
9427 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
9428 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
9429 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
9430 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
9431 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
9432 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
9433 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
9434 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9435 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9436 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9437 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9438 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9439 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9440 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9441 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9442 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9443 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9445 /* "nexthop-local unchanged" commands */
9446 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_local_unchanged_cmd
);
9447 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_local_unchanged_cmd
);
9449 /* "transparent-as" and "transparent-nexthop" for old version
9451 install_element (BGP_NODE
, &neighbor_transparent_as_cmd
);
9452 install_element (BGP_NODE
, &neighbor_transparent_nexthop_cmd
);
9454 /* "neighbor next-hop-self" commands. */
9455 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
9456 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
9457 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
9458 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
9459 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
9460 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
9461 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
9462 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
9463 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_cmd
);
9464 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_cmd
);
9465 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
9466 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
9468 /* "neighbor remove-private-AS" commands. */
9469 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
9470 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
9471 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
9472 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
9473 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
9474 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
9475 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
9476 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
9477 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_cmd
);
9478 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_cmd
);
9479 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
9480 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
9482 /* "neighbor send-community" commands.*/
9483 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
9484 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
9485 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
9486 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
9487 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
9488 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
9489 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
9490 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
9491 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
9492 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
9493 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
9494 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
9495 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
9496 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
9497 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
9498 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
9499 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_cmd
);
9500 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_type_cmd
);
9501 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_cmd
);
9502 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_type_cmd
);
9503 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
9504 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
9505 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
9506 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
9508 /* "neighbor route-reflector" commands.*/
9509 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
9510 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
9511 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
9512 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
9513 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
9514 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
9515 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
9516 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
9517 install_element (BGP_IPV6M_NODE
, &neighbor_route_reflector_client_cmd
);
9518 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_reflector_client_cmd
);
9519 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
9520 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
9522 /* "neighbor route-server" commands.*/
9523 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
9524 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
9525 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
9526 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
9527 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
9528 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
9529 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
9530 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
9531 install_element (BGP_IPV6M_NODE
, &neighbor_route_server_client_cmd
);
9532 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_server_client_cmd
);
9533 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
9534 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
9536 /* "neighbor passive" commands. */
9537 install_element (BGP_NODE
, &neighbor_passive_cmd
);
9538 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
9540 /* "neighbor shutdown" commands. */
9541 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
9542 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
9544 /* Deprecated "neighbor capability route-refresh" commands.*/
9545 install_element (BGP_NODE
, &neighbor_capability_route_refresh_cmd
);
9546 install_element (BGP_NODE
, &no_neighbor_capability_route_refresh_cmd
);
9548 /* "neighbor capability orf prefix-list" commands.*/
9549 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
9550 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9551 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
9552 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9553 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
9554 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9555 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
9556 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9557 install_element (BGP_IPV6M_NODE
, &neighbor_capability_orf_prefix_cmd
);
9558 install_element (BGP_IPV6M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9560 /* "neighbor capability dynamic" commands.*/
9561 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
9562 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
9564 /* "neighbor dont-capability-negotiate" commands. */
9565 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
9566 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
9568 /* "neighbor ebgp-multihop" commands. */
9569 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
9570 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
9571 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
9572 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
9574 /* "neighbor disable-connected-check" commands. */
9575 install_element (BGP_NODE
, &neighbor_disable_connected_check_cmd
);
9576 install_element (BGP_NODE
, &no_neighbor_disable_connected_check_cmd
);
9577 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
9578 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
9580 /* "neighbor description" commands. */
9581 install_element (BGP_NODE
, &neighbor_description_cmd
);
9582 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
9583 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
9585 /* "neighbor update-source" commands. "*/
9586 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
9587 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
9589 /* "neighbor default-originate" commands. */
9590 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
9591 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
9592 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
9593 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9594 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
9595 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
9596 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
9597 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9598 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
9599 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
9600 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
9601 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9602 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
9603 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
9604 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
9605 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9606 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_cmd
);
9607 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_rmap_cmd
);
9608 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_cmd
);
9609 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9611 /* "neighbor port" commands. */
9612 install_element (BGP_NODE
, &neighbor_port_cmd
);
9613 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
9614 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
9616 /* "neighbor weight" commands. */
9617 install_element (BGP_NODE
, &neighbor_weight_cmd
);
9618 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
9619 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
9621 /* "neighbor override-capability" commands. */
9622 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
9623 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
9625 /* "neighbor strict-capability-match" commands. */
9626 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
9627 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
9629 /* "neighbor timers" commands. */
9630 install_element (BGP_NODE
, &neighbor_timers_cmd
);
9631 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
9633 /* "neighbor timers connect" commands. */
9634 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
9635 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
9636 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
9638 /* "neighbor advertisement-interval" commands. */
9639 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
9640 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
9641 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
9643 /* "neighbor version" commands. */
9644 install_element (BGP_NODE
, &neighbor_version_cmd
);
9646 /* "neighbor interface" commands. */
9647 install_element (BGP_NODE
, &neighbor_interface_cmd
);
9648 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
9650 /* "neighbor distribute" commands. */
9651 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
9652 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
9653 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
9654 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
9655 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
9656 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
9657 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
9658 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
9659 install_element (BGP_IPV6M_NODE
, &neighbor_distribute_list_cmd
);
9660 install_element (BGP_IPV6M_NODE
, &no_neighbor_distribute_list_cmd
);
9661 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
9662 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
9664 /* "neighbor prefix-list" commands. */
9665 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
9666 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
9667 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
9668 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
9669 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
9670 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
9671 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
9672 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
9673 install_element (BGP_IPV6M_NODE
, &neighbor_prefix_list_cmd
);
9674 install_element (BGP_IPV6M_NODE
, &no_neighbor_prefix_list_cmd
);
9675 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
9676 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
9678 /* "neighbor filter-list" commands. */
9679 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
9680 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
9681 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
9682 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
9683 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
9684 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
9685 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
9686 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
9687 install_element (BGP_IPV6M_NODE
, &neighbor_filter_list_cmd
);
9688 install_element (BGP_IPV6M_NODE
, &no_neighbor_filter_list_cmd
);
9689 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
9690 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
9692 /* "neighbor route-map" commands. */
9693 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
9694 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
9695 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
9696 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
9697 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
9698 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
9699 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
9700 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
9701 install_element (BGP_IPV6M_NODE
, &neighbor_route_map_cmd
);
9702 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_map_cmd
);
9703 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
9704 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
9706 /* "neighbor unsuppress-map" commands. */
9707 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
9708 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
9709 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
9710 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
9711 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
9712 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
9713 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
9714 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
9715 install_element (BGP_IPV6M_NODE
, &neighbor_unsuppress_map_cmd
);
9716 install_element (BGP_IPV6M_NODE
, &no_neighbor_unsuppress_map_cmd
);
9717 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
9718 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
9720 /* "neighbor maximum-prefix" commands. */
9721 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
9722 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9723 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9724 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9725 install_element (BGP_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9726 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9727 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
9728 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9729 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9730 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9731 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9732 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9733 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9734 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
9735 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9736 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9737 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9738 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9739 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9740 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
9741 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9742 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9743 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9744 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9745 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9746 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9747 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
9748 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9749 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9750 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9751 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9752 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9753 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
9754 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9755 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9756 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9757 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9758 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9759 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9760 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
9761 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9762 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9763 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9764 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9765 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9766 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
9767 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9768 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9769 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9770 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9771 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9772 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9773 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_cmd
);
9774 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9775 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9776 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9777 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9778 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9779 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_cmd
);
9780 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9781 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9782 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9783 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9784 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9785 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9786 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
9787 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9788 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9789 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9790 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9791 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9792 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
9793 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9794 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9795 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9796 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9797 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9798 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9800 /* "neighbor allowas-in" */
9801 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
9802 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
9803 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
9804 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
9805 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
9806 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
9807 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
9808 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
9809 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
9810 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
9811 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
9812 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
9813 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_cmd
);
9814 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_arg_cmd
);
9815 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_cmd
);
9816 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
9817 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
9818 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
9820 /* address-family commands. */
9821 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
9822 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
9824 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
9825 install_element (BGP_NODE
, &address_family_ipv6_safi_cmd
);
9826 #endif /* HAVE_IPV6 */
9827 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
9828 install_element (BGP_NODE
, &address_family_vpnv4_unicast_cmd
);
9830 /* "exit-address-family" command. */
9831 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
9832 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
9833 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
9834 install_element (BGP_IPV6M_NODE
, &exit_address_family_cmd
);
9835 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
9837 /* "clear ip bgp commands" */
9838 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
9839 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
9840 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
9841 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
9842 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
9843 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
9845 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
9846 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
9847 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
9848 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
9849 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
9850 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
9851 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
9852 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
9853 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
9854 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
9855 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
9856 #endif /* HAVE_IPV6 */
9858 /* "clear ip bgp neighbor soft in" */
9859 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
9860 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
9861 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
9862 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
9863 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_prefix_filter_cmd
);
9864 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
9865 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
9866 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
9867 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
9868 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
9869 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
9870 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
9871 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
9872 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
9873 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
9874 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
9875 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
9876 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
9877 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
9878 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
9879 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
9880 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
);
9881 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
9882 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
9883 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
9884 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
9885 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
9886 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
9887 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
9888 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
9889 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
9890 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
9891 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
9892 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
9893 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_in_cmd
);
9894 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_in_cmd
);
9895 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_in_cmd
);
9896 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_in_cmd
);
9897 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_in_cmd
);
9898 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_in_cmd
);
9900 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
9901 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
9902 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
9903 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
9904 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
9905 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
9906 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
9907 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
9908 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
9909 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
9910 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
9911 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
9912 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
9913 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
9914 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
9915 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
9916 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
9917 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
9918 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
9919 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
9920 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
9921 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
9922 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
9923 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
9924 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
9925 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
9926 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
9927 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
9928 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
9929 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
9930 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
9931 #endif /* HAVE_IPV6 */
9933 /* "clear ip bgp neighbor soft out" */
9934 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
9935 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
9936 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
9937 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
9938 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
9939 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
9940 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
9941 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
9942 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
9943 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
9944 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
9945 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
9946 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
9947 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
9948 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
9949 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
9950 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
9951 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
9952 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
9953 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
9954 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
9955 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
9956 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_out_cmd
);
9957 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_out_cmd
);
9958 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_out_cmd
);
9959 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_out_cmd
);
9960 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_out_cmd
);
9961 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_out_cmd
);
9963 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
9964 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
9965 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
9966 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
9967 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
9968 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
9969 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
9970 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
9971 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
9972 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
9973 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
9974 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
9975 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
9976 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
9977 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
9978 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
9979 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
9980 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
9981 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
9982 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
9983 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
9984 #endif /* HAVE_IPV6 */
9986 /* "clear ip bgp neighbor soft" */
9987 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
9988 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
9989 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
9990 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
9991 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
9992 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
9993 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
9994 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
9995 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
9996 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
9997 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
9998 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
9999 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_cmd
);
10000 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_cmd
);
10001 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_cmd
);
10003 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
10004 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
10005 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
10006 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
10007 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
10008 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
10009 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
10010 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
10011 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
10012 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
10013 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
10014 #endif /* HAVE_IPV6 */
10016 /* "clear ip bgp neighbor rsclient" */
10017 install_element (ENABLE_NODE
, &clear_ip_bgp_all_rsclient_cmd
);
10018 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_rsclient_cmd
);
10019 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_rsclient_cmd
);
10020 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_rsclient_cmd
);
10022 install_element (ENABLE_NODE
, &clear_bgp_all_rsclient_cmd
);
10023 install_element (ENABLE_NODE
, &clear_bgp_instance_all_rsclient_cmd
);
10024 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_rsclient_cmd
);
10025 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_all_rsclient_cmd
);
10026 install_element (ENABLE_NODE
, &clear_bgp_peer_rsclient_cmd
);
10027 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_rsclient_cmd
);
10028 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_rsclient_cmd
);
10029 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_peer_rsclient_cmd
);
10030 #endif /* HAVE_IPV6 */
10032 /* "show ip bgp summary" commands. */
10033 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
10034 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
10035 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
10036 install_element (VIEW_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
10037 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
10038 install_element (VIEW_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
10039 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
10040 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
10042 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
10043 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
10044 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
10045 install_element (VIEW_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
10046 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
10047 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
10048 #endif /* HAVE_IPV6 */
10049 install_element (RESTRICTED_NODE
, &show_ip_bgp_summary_cmd
);
10050 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_summary_cmd
);
10051 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
10052 install_element (RESTRICTED_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
10053 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
10054 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
10055 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
10056 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
10058 install_element (RESTRICTED_NODE
, &show_bgp_summary_cmd
);
10059 install_element (RESTRICTED_NODE
, &show_bgp_instance_summary_cmd
);
10060 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_summary_cmd
);
10061 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
10062 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
10063 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
10064 #endif /* HAVE_IPV6 */
10065 install_element (ENABLE_NODE
, &show_ip_bgp_summary_cmd
);
10066 install_element (ENABLE_NODE
, &show_ip_bgp_instance_summary_cmd
);
10067 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
10068 install_element (ENABLE_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
10069 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
10070 install_element (ENABLE_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
10071 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
10072 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
10074 install_element (ENABLE_NODE
, &show_bgp_summary_cmd
);
10075 install_element (ENABLE_NODE
, &show_bgp_instance_summary_cmd
);
10076 install_element (ENABLE_NODE
, &show_bgp_ipv6_summary_cmd
);
10077 install_element (ENABLE_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
10078 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
10079 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
10080 #endif /* HAVE_IPV6 */
10082 /* "show ip bgp neighbors" commands. */
10083 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
10084 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
10085 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
10086 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
10087 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
10088 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
10089 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
10090 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
10091 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
10092 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
10093 install_element (RESTRICTED_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
10094 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
10095 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
10096 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
10097 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
10098 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_cmd
);
10099 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
10100 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
10101 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
10102 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
10103 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
10104 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
10105 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
10106 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
10107 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
10110 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
10111 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
10112 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
10113 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
10114 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
10115 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
10116 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
10117 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
10118 install_element (RESTRICTED_NODE
, &show_bgp_neighbors_peer_cmd
);
10119 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
10120 install_element (RESTRICTED_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
10121 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
10122 install_element (ENABLE_NODE
, &show_bgp_neighbors_cmd
);
10123 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_cmd
);
10124 install_element (ENABLE_NODE
, &show_bgp_neighbors_peer_cmd
);
10125 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
10126 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_cmd
);
10127 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
10128 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
10129 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
10131 /* Old commands. */
10132 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
10133 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
10134 install_element (ENABLE_NODE
, &show_ipv6_bgp_summary_cmd
);
10135 install_element (ENABLE_NODE
, &show_ipv6_mbgp_summary_cmd
);
10136 #endif /* HAVE_IPV6 */
10138 /* "show ip bgp rsclient" commands. */
10139 install_element (VIEW_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
10140 install_element (VIEW_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
10141 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
10142 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
10143 install_element (VIEW_NODE
, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd
);
10144 install_element (VIEW_NODE
, &show_bgp_ipv4_safi_rsclient_summary_cmd
);
10145 install_element (RESTRICTED_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
10146 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
10147 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
10148 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
10149 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd
);
10150 install_element (RESTRICTED_NODE
, &show_bgp_ipv4_safi_rsclient_summary_cmd
);
10151 install_element (ENABLE_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
10152 install_element (ENABLE_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
10153 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
10154 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
10155 install_element (ENABLE_NODE
, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd
);
10156 install_element (ENABLE_NODE
, &show_bgp_ipv4_safi_rsclient_summary_cmd
);
10159 install_element (VIEW_NODE
, &show_bgp_rsclient_summary_cmd
);
10160 install_element (VIEW_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
10161 install_element (VIEW_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
10162 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
10163 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd
);
10164 install_element (VIEW_NODE
, &show_bgp_ipv6_safi_rsclient_summary_cmd
);
10165 install_element (RESTRICTED_NODE
, &show_bgp_rsclient_summary_cmd
);
10166 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
10167 install_element (RESTRICTED_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
10168 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
10169 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd
);
10170 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_safi_rsclient_summary_cmd
);
10171 install_element (ENABLE_NODE
, &show_bgp_rsclient_summary_cmd
);
10172 install_element (ENABLE_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
10173 install_element (ENABLE_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
10174 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
10175 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd
);
10176 install_element (ENABLE_NODE
, &show_bgp_ipv6_safi_rsclient_summary_cmd
);
10177 #endif /* HAVE_IPV6 */
10179 /* "show ip bgp paths" commands. */
10180 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
10181 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
10182 install_element (ENABLE_NODE
, &show_ip_bgp_paths_cmd
);
10183 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
10185 /* "show ip bgp community" commands. */
10186 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
10187 install_element (ENABLE_NODE
, &show_ip_bgp_community_info_cmd
);
10189 /* "show ip bgp attribute-info" commands. */
10190 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
10191 install_element (ENABLE_NODE
, &show_ip_bgp_attr_info_cmd
);
10193 /* "redistribute" commands. */
10194 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
10195 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
10196 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
10197 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
10198 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
10199 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
10200 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
10201 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
10202 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
10203 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
10205 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
10206 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
10207 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
10208 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
10209 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
10210 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
10211 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
10212 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
10213 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
10214 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
10215 #endif /* HAVE_IPV6 */
10217 /* ttl_security commands */
10218 install_element (BGP_NODE
, &neighbor_ttl_security_cmd
);
10219 install_element (BGP_NODE
, &no_neighbor_ttl_security_cmd
);
10221 /* "show bgp memory" commands. */
10222 install_element (VIEW_NODE
, &show_bgp_memory_cmd
);
10223 install_element (RESTRICTED_NODE
, &show_bgp_memory_cmd
);
10224 install_element (ENABLE_NODE
, &show_bgp_memory_cmd
);
10226 /* "show bgp views" commands. */
10227 install_element (VIEW_NODE
, &show_bgp_views_cmd
);
10228 install_element (RESTRICTED_NODE
, &show_bgp_views_cmd
);
10229 install_element (ENABLE_NODE
, &show_bgp_views_cmd
);
10231 /* Community-list. */
10232 community_list_vty ();
10235 #include "memory.h"
10236 #include "bgp_regex.h"
10237 #include "bgp_clist.h"
10238 #include "bgp_ecommunity.h"
10240 /* VTY functions. */
10242 /* Direction value to string conversion. */
10243 static const char *
10244 community_direct_str (int direct
)
10248 case COMMUNITY_DENY
:
10250 case COMMUNITY_PERMIT
:
10257 /* Display error string. */
10259 community_list_perror (struct vty
*vty
, int ret
)
10263 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
10264 vty_out (vty
, "%% Can't find community-list%s", VTY_NEWLINE
);
10266 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
10267 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
10269 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
10270 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
10272 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
10273 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
10278 /* VTY interface for community_set() function. */
10280 community_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
10281 int style
, int reject_all_digit_name
)
10287 /* Check the list type. */
10288 if (strncmp (argv
[1], "p", 1) == 0)
10289 direct
= COMMUNITY_PERMIT
;
10290 else if (strncmp (argv
[1], "d", 1) == 0)
10291 direct
= COMMUNITY_DENY
;
10294 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10296 return CMD_WARNING
;
10299 /* All digit name check. */
10300 if (reject_all_digit_name
&& all_digit (argv
[0]))
10302 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
10303 return CMD_WARNING
;
10306 /* Concat community string argument. */
10308 str
= argv_concat (argv
, argc
, 2);
10312 /* When community_list_set() return nevetive value, it means
10313 malformed community string. */
10314 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
10316 /* Free temporary community list string allocated by
10319 XFREE (MTYPE_TMP
, str
);
10323 /* Display error string. */
10324 community_list_perror (vty
, ret
);
10325 return CMD_WARNING
;
10328 return CMD_SUCCESS
;
10331 /* Communiyt-list entry delete. */
10333 community_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
10342 /* Check the list direct. */
10343 if (strncmp (argv
[1], "p", 1) == 0)
10344 direct
= COMMUNITY_PERMIT
;
10345 else if (strncmp (argv
[1], "d", 1) == 0)
10346 direct
= COMMUNITY_DENY
;
10349 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10351 return CMD_WARNING
;
10354 /* Concat community string argument. */
10355 str
= argv_concat (argv
, argc
, 2);
10358 /* Unset community list. */
10359 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
10361 /* Free temporary community list string allocated by
10364 XFREE (MTYPE_TMP
, str
);
10368 community_list_perror (vty
, ret
);
10369 return CMD_WARNING
;
10372 return CMD_SUCCESS
;
10375 /* "community-list" keyword help string. */
10376 #define COMMUNITY_LIST_STR "Add a community list entry\n"
10377 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
10379 DEFUN (ip_community_list_standard
,
10380 ip_community_list_standard_cmd
,
10381 "ip community-list <1-99> (deny|permit) .AA:NN",
10384 "Community list number (standard)\n"
10385 "Specify community to reject\n"
10386 "Specify community to accept\n"
10389 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
10392 ALIAS (ip_community_list_standard
,
10393 ip_community_list_standard2_cmd
,
10394 "ip community-list <1-99> (deny|permit)",
10397 "Community list number (standard)\n"
10398 "Specify community to reject\n"
10399 "Specify community to accept\n")
10401 DEFUN (ip_community_list_expanded
,
10402 ip_community_list_expanded_cmd
,
10403 "ip community-list <100-500> (deny|permit) .LINE",
10406 "Community list number (expanded)\n"
10407 "Specify community to reject\n"
10408 "Specify community to accept\n"
10409 "An ordered list as a regular-expression\n")
10411 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
10414 DEFUN (ip_community_list_name_standard
,
10415 ip_community_list_name_standard_cmd
,
10416 "ip community-list standard WORD (deny|permit) .AA:NN",
10419 "Add a standard community-list entry\n"
10420 "Community list name\n"
10421 "Specify community to reject\n"
10422 "Specify community to accept\n"
10425 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
10428 ALIAS (ip_community_list_name_standard
,
10429 ip_community_list_name_standard2_cmd
,
10430 "ip community-list standard WORD (deny|permit)",
10433 "Add a standard community-list entry\n"
10434 "Community list name\n"
10435 "Specify community to reject\n"
10436 "Specify community to accept\n")
10438 DEFUN (ip_community_list_name_expanded
,
10439 ip_community_list_name_expanded_cmd
,
10440 "ip community-list expanded WORD (deny|permit) .LINE",
10443 "Add an expanded community-list entry\n"
10444 "Community list name\n"
10445 "Specify community to reject\n"
10446 "Specify community to accept\n"
10447 "An ordered list as a regular-expression\n")
10449 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
10452 DEFUN (no_ip_community_list_standard_all
,
10453 no_ip_community_list_standard_all_cmd
,
10454 "no ip community-list <1-99>",
10458 "Community list number (standard)\n")
10460 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10463 DEFUN (no_ip_community_list_expanded_all
,
10464 no_ip_community_list_expanded_all_cmd
,
10465 "no ip community-list <100-500>",
10469 "Community list number (expanded)\n")
10471 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10474 DEFUN (no_ip_community_list_name_standard_all
,
10475 no_ip_community_list_name_standard_all_cmd
,
10476 "no ip community-list standard WORD",
10480 "Add a standard community-list entry\n"
10481 "Community list name\n")
10483 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10486 DEFUN (no_ip_community_list_name_expanded_all
,
10487 no_ip_community_list_name_expanded_all_cmd
,
10488 "no ip community-list expanded WORD",
10492 "Add an expanded community-list entry\n"
10493 "Community list name\n")
10495 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10498 DEFUN (no_ip_community_list_standard
,
10499 no_ip_community_list_standard_cmd
,
10500 "no ip community-list <1-99> (deny|permit) .AA:NN",
10504 "Community list number (standard)\n"
10505 "Specify community to reject\n"
10506 "Specify community to accept\n"
10509 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10512 DEFUN (no_ip_community_list_expanded
,
10513 no_ip_community_list_expanded_cmd
,
10514 "no ip community-list <100-500> (deny|permit) .LINE",
10518 "Community list number (expanded)\n"
10519 "Specify community to reject\n"
10520 "Specify community to accept\n"
10521 "An ordered list as a regular-expression\n")
10523 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10526 DEFUN (no_ip_community_list_name_standard
,
10527 no_ip_community_list_name_standard_cmd
,
10528 "no ip community-list standard WORD (deny|permit) .AA:NN",
10532 "Specify a standard community-list\n"
10533 "Community list name\n"
10534 "Specify community to reject\n"
10535 "Specify community to accept\n"
10538 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10541 DEFUN (no_ip_community_list_name_expanded
,
10542 no_ip_community_list_name_expanded_cmd
,
10543 "no ip community-list expanded WORD (deny|permit) .LINE",
10547 "Specify an expanded community-list\n"
10548 "Community list name\n"
10549 "Specify community to reject\n"
10550 "Specify community to accept\n"
10551 "An ordered list as a regular-expression\n")
10553 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10557 community_list_show (struct vty
*vty
, struct community_list
*list
)
10559 struct community_entry
*entry
;
10561 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10563 if (entry
== list
->head
)
10565 if (all_digit (list
->name
))
10566 vty_out (vty
, "Community %s list %s%s",
10567 entry
->style
== COMMUNITY_LIST_STANDARD
?
10568 "standard" : "(expanded) access",
10569 list
->name
, VTY_NEWLINE
);
10571 vty_out (vty
, "Named Community %s list %s%s",
10572 entry
->style
== COMMUNITY_LIST_STANDARD
?
10573 "standard" : "expanded",
10574 list
->name
, VTY_NEWLINE
);
10577 vty_out (vty
, " %s%s",
10578 community_direct_str (entry
->direct
), VTY_NEWLINE
);
10580 vty_out (vty
, " %s %s%s",
10581 community_direct_str (entry
->direct
),
10582 entry
->style
== COMMUNITY_LIST_STANDARD
10583 ? community_str (entry
->u
.com
) : entry
->config
,
10588 DEFUN (show_ip_community_list
,
10589 show_ip_community_list_cmd
,
10590 "show ip community-list",
10593 "List community-list\n")
10595 struct community_list
*list
;
10596 struct community_list_master
*cm
;
10598 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
10600 return CMD_SUCCESS
;
10602 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10603 community_list_show (vty
, list
);
10605 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10606 community_list_show (vty
, list
);
10608 return CMD_SUCCESS
;
10611 DEFUN (show_ip_community_list_arg
,
10612 show_ip_community_list_arg_cmd
,
10613 "show ip community-list (<1-500>|WORD)",
10616 "List community-list\n"
10617 "Community-list number\n"
10618 "Community-list name\n")
10620 struct community_list
*list
;
10622 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_MASTER
);
10625 vty_out (vty
, "%% Can't find community-list%s", VTY_NEWLINE
);
10626 return CMD_WARNING
;
10629 community_list_show (vty
, list
);
10631 return CMD_SUCCESS
;
10635 extcommunity_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
10636 int style
, int reject_all_digit_name
)
10642 /* Check the list type. */
10643 if (strncmp (argv
[1], "p", 1) == 0)
10644 direct
= COMMUNITY_PERMIT
;
10645 else if (strncmp (argv
[1], "d", 1) == 0)
10646 direct
= COMMUNITY_DENY
;
10649 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10651 return CMD_WARNING
;
10654 /* All digit name check. */
10655 if (reject_all_digit_name
&& all_digit (argv
[0]))
10657 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
10658 return CMD_WARNING
;
10661 /* Concat community string argument. */
10663 str
= argv_concat (argv
, argc
, 2);
10667 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
10669 /* Free temporary community list string allocated by
10672 XFREE (MTYPE_TMP
, str
);
10676 community_list_perror (vty
, ret
);
10677 return CMD_WARNING
;
10679 return CMD_SUCCESS
;
10683 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
10692 /* Check the list direct. */
10693 if (strncmp (argv
[1], "p", 1) == 0)
10694 direct
= COMMUNITY_PERMIT
;
10695 else if (strncmp (argv
[1], "d", 1) == 0)
10696 direct
= COMMUNITY_DENY
;
10699 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10701 return CMD_WARNING
;
10704 /* Concat community string argument. */
10705 str
= argv_concat (argv
, argc
, 2);
10708 /* Unset community list. */
10709 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
10711 /* Free temporary community list string allocated by
10714 XFREE (MTYPE_TMP
, str
);
10718 community_list_perror (vty
, ret
);
10719 return CMD_WARNING
;
10722 return CMD_SUCCESS
;
10725 /* "extcommunity-list" keyword help string. */
10726 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
10727 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
10729 DEFUN (ip_extcommunity_list_standard
,
10730 ip_extcommunity_list_standard_cmd
,
10731 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
10733 EXTCOMMUNITY_LIST_STR
10734 "Extended Community list number (standard)\n"
10735 "Specify community to reject\n"
10736 "Specify community to accept\n"
10737 EXTCOMMUNITY_VAL_STR
)
10739 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
10742 ALIAS (ip_extcommunity_list_standard
,
10743 ip_extcommunity_list_standard2_cmd
,
10744 "ip extcommunity-list <1-99> (deny|permit)",
10746 EXTCOMMUNITY_LIST_STR
10747 "Extended Community list number (standard)\n"
10748 "Specify community to reject\n"
10749 "Specify community to accept\n")
10751 DEFUN (ip_extcommunity_list_expanded
,
10752 ip_extcommunity_list_expanded_cmd
,
10753 "ip extcommunity-list <100-500> (deny|permit) .LINE",
10755 EXTCOMMUNITY_LIST_STR
10756 "Extended Community list number (expanded)\n"
10757 "Specify community to reject\n"
10758 "Specify community to accept\n"
10759 "An ordered list as a regular-expression\n")
10761 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
10764 DEFUN (ip_extcommunity_list_name_standard
,
10765 ip_extcommunity_list_name_standard_cmd
,
10766 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
10768 EXTCOMMUNITY_LIST_STR
10769 "Specify standard extcommunity-list\n"
10770 "Extended Community list name\n"
10771 "Specify community to reject\n"
10772 "Specify community to accept\n"
10773 EXTCOMMUNITY_VAL_STR
)
10775 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
10778 ALIAS (ip_extcommunity_list_name_standard
,
10779 ip_extcommunity_list_name_standard2_cmd
,
10780 "ip extcommunity-list standard WORD (deny|permit)",
10782 EXTCOMMUNITY_LIST_STR
10783 "Specify standard extcommunity-list\n"
10784 "Extended Community list name\n"
10785 "Specify community to reject\n"
10786 "Specify community to accept\n")
10788 DEFUN (ip_extcommunity_list_name_expanded
,
10789 ip_extcommunity_list_name_expanded_cmd
,
10790 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
10792 EXTCOMMUNITY_LIST_STR
10793 "Specify expanded extcommunity-list\n"
10794 "Extended Community list name\n"
10795 "Specify community to reject\n"
10796 "Specify community to accept\n"
10797 "An ordered list as a regular-expression\n")
10799 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
10802 DEFUN (no_ip_extcommunity_list_standard_all
,
10803 no_ip_extcommunity_list_standard_all_cmd
,
10804 "no ip extcommunity-list <1-99>",
10807 EXTCOMMUNITY_LIST_STR
10808 "Extended Community list number (standard)\n")
10810 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10813 DEFUN (no_ip_extcommunity_list_expanded_all
,
10814 no_ip_extcommunity_list_expanded_all_cmd
,
10815 "no ip extcommunity-list <100-500>",
10818 EXTCOMMUNITY_LIST_STR
10819 "Extended Community list number (expanded)\n")
10821 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10824 DEFUN (no_ip_extcommunity_list_name_standard_all
,
10825 no_ip_extcommunity_list_name_standard_all_cmd
,
10826 "no ip extcommunity-list standard WORD",
10829 EXTCOMMUNITY_LIST_STR
10830 "Specify standard extcommunity-list\n"
10831 "Extended Community list name\n")
10833 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10836 DEFUN (no_ip_extcommunity_list_name_expanded_all
,
10837 no_ip_extcommunity_list_name_expanded_all_cmd
,
10838 "no ip extcommunity-list expanded WORD",
10841 EXTCOMMUNITY_LIST_STR
10842 "Specify expanded extcommunity-list\n"
10843 "Extended Community list name\n")
10845 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10848 DEFUN (no_ip_extcommunity_list_standard
,
10849 no_ip_extcommunity_list_standard_cmd
,
10850 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
10853 EXTCOMMUNITY_LIST_STR
10854 "Extended Community list number (standard)\n"
10855 "Specify community to reject\n"
10856 "Specify community to accept\n"
10857 EXTCOMMUNITY_VAL_STR
)
10859 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10862 DEFUN (no_ip_extcommunity_list_expanded
,
10863 no_ip_extcommunity_list_expanded_cmd
,
10864 "no ip extcommunity-list <100-500> (deny|permit) .LINE",
10867 EXTCOMMUNITY_LIST_STR
10868 "Extended Community list number (expanded)\n"
10869 "Specify community to reject\n"
10870 "Specify community to accept\n"
10871 "An ordered list as a regular-expression\n")
10873 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10876 DEFUN (no_ip_extcommunity_list_name_standard
,
10877 no_ip_extcommunity_list_name_standard_cmd
,
10878 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
10881 EXTCOMMUNITY_LIST_STR
10882 "Specify standard extcommunity-list\n"
10883 "Extended Community list name\n"
10884 "Specify community to reject\n"
10885 "Specify community to accept\n"
10886 EXTCOMMUNITY_VAL_STR
)
10888 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10891 DEFUN (no_ip_extcommunity_list_name_expanded
,
10892 no_ip_extcommunity_list_name_expanded_cmd
,
10893 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
10896 EXTCOMMUNITY_LIST_STR
10897 "Specify expanded extcommunity-list\n"
10898 "Community list name\n"
10899 "Specify community to reject\n"
10900 "Specify community to accept\n"
10901 "An ordered list as a regular-expression\n")
10903 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10907 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
10909 struct community_entry
*entry
;
10911 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10913 if (entry
== list
->head
)
10915 if (all_digit (list
->name
))
10916 vty_out (vty
, "Extended community %s list %s%s",
10917 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10918 "standard" : "(expanded) access",
10919 list
->name
, VTY_NEWLINE
);
10921 vty_out (vty
, "Named extended community %s list %s%s",
10922 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10923 "standard" : "expanded",
10924 list
->name
, VTY_NEWLINE
);
10927 vty_out (vty
, " %s%s",
10928 community_direct_str (entry
->direct
), VTY_NEWLINE
);
10930 vty_out (vty
, " %s %s%s",
10931 community_direct_str (entry
->direct
),
10932 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10933 entry
->u
.ecom
->str
: entry
->config
,
10938 DEFUN (show_ip_extcommunity_list
,
10939 show_ip_extcommunity_list_cmd
,
10940 "show ip extcommunity-list",
10943 "List extended-community list\n")
10945 struct community_list
*list
;
10946 struct community_list_master
*cm
;
10948 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
10950 return CMD_SUCCESS
;
10952 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10953 extcommunity_list_show (vty
, list
);
10955 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10956 extcommunity_list_show (vty
, list
);
10958 return CMD_SUCCESS
;
10961 DEFUN (show_ip_extcommunity_list_arg
,
10962 show_ip_extcommunity_list_arg_cmd
,
10963 "show ip extcommunity-list (<1-500>|WORD)",
10966 "List extended-community list\n"
10967 "Extcommunity-list number\n"
10968 "Extcommunity-list name\n")
10970 struct community_list
*list
;
10972 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_MASTER
);
10975 vty_out (vty
, "%% Can't find extcommunity-list%s", VTY_NEWLINE
);
10976 return CMD_WARNING
;
10979 extcommunity_list_show (vty
, list
);
10981 return CMD_SUCCESS
;
10984 /* Return configuration string of community-list entry. */
10985 static const char *
10986 community_list_config_str (struct community_entry
*entry
)
10994 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
10995 str
= community_str (entry
->u
.com
);
10997 str
= entry
->config
;
11002 /* Display community-list and extcommunity-list configuration. */
11004 community_list_config_write (struct vty
*vty
)
11006 struct community_list
*list
;
11007 struct community_entry
*entry
;
11008 struct community_list_master
*cm
;
11011 /* Community-list. */
11012 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
11014 for (list
= cm
->num
.head
; list
; list
= list
->next
)
11015 for (entry
= list
->head
; entry
; entry
= entry
->next
)
11017 vty_out (vty
, "ip community-list %s %s %s%s",
11018 list
->name
, community_direct_str (entry
->direct
),
11019 community_list_config_str (entry
),
11023 for (list
= cm
->str
.head
; list
; list
= list
->next
)
11024 for (entry
= list
->head
; entry
; entry
= entry
->next
)
11026 vty_out (vty
, "ip community-list %s %s %s %s%s",
11027 entry
->style
== COMMUNITY_LIST_STANDARD
11028 ? "standard" : "expanded",
11029 list
->name
, community_direct_str (entry
->direct
),
11030 community_list_config_str (entry
),
11035 /* Extcommunity-list. */
11036 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
11038 for (list
= cm
->num
.head
; list
; list
= list
->next
)
11039 for (entry
= list
->head
; entry
; entry
= entry
->next
)
11041 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
11042 list
->name
, community_direct_str (entry
->direct
),
11043 community_list_config_str (entry
), VTY_NEWLINE
);
11046 for (list
= cm
->str
.head
; list
; list
= list
->next
)
11047 for (entry
= list
->head
; entry
; entry
= entry
->next
)
11049 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
11050 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
11051 ? "standard" : "expanded",
11052 list
->name
, community_direct_str (entry
->direct
),
11053 community_list_config_str (entry
), VTY_NEWLINE
);
11059 static struct cmd_node community_list_node
=
11061 COMMUNITY_LIST_NODE
,
11063 1 /* Export to vtysh. */
11067 community_list_vty (void)
11069 install_node (&community_list_node
, community_list_config_write
);
11071 /* Community-list. */
11072 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
11073 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
11074 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
11075 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
11076 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
11077 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
11078 install_element (CONFIG_NODE
, &no_ip_community_list_standard_all_cmd
);
11079 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_all_cmd
);
11080 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_all_cmd
);
11081 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_all_cmd
);
11082 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
11083 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
11084 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
11085 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
11086 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
11087 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
11088 install_element (ENABLE_NODE
, &show_ip_community_list_cmd
);
11089 install_element (ENABLE_NODE
, &show_ip_community_list_arg_cmd
);
11091 /* Extcommunity-list. */
11092 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
11093 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
11094 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
11095 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
11096 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
11097 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
11098 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_all_cmd
);
11099 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_all_cmd
);
11100 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_all_cmd
);
11101 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_all_cmd
);
11102 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
11103 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
11104 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
11105 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
11106 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
11107 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);
11108 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_cmd
);
11109 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_arg_cmd
);