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
33 #include "bgpd/bgpd.h"
34 #include "bgpd/bgp_attr.h"
35 #include "bgpd/bgp_aspath.h"
36 #include "bgpd/bgp_community.h"
37 #include "bgpd/bgp_debug.h"
38 #include "bgpd/bgp_fsm.h"
39 #include "bgpd/bgp_mplsvpn.h"
40 #include "bgpd/bgp_open.h"
41 #include "bgpd/bgp_route.h"
42 #include "bgpd/bgp_zebra.h"
43 #include "bgpd/bgp_table.h"
44 #include "bgpd/bgp_vty.h"
46 extern struct in_addr router_id_zebra
;
48 /* Utility function to get address family from current node. */
50 bgp_node_afi (struct vty
*vty
)
52 if (vty
->node
== BGP_IPV6_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
57 /* Utility function to get subsequent address family from current
60 bgp_node_safi (struct vty
*vty
)
62 if (vty
->node
== BGP_VPNV4_NODE
)
64 if (vty
->node
== BGP_IPV4M_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
65 return SAFI_MULTICAST
;
70 peer_address_self_check (union sockunion
*su
)
72 struct interface
*ifp
= NULL
;
74 if (su
->sa
.sa_family
== AF_INET
)
75 ifp
= if_lookup_by_ipv4_exact (&su
->sin
.sin_addr
);
77 else if (su
->sa
.sa_family
== AF_INET6
)
78 ifp
= if_lookup_by_ipv6_exact (&su
->sin6
.sin6_addr
);
79 #endif /* HAVE IPV6 */
87 /* Utility function for looking up peer from VTY. */
89 peer_lookup_vty (struct vty
*vty
, const char *ip_str
)
98 ret
= str2sockunion (ip_str
, &su
);
101 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
105 peer
= peer_lookup (bgp
, &su
);
108 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s", VTY_NEWLINE
);
114 /* Utility function for looking up peer or peer group. */
116 peer_and_group_lookup_vty (struct vty
*vty
, const char *peer_str
)
122 struct peer_group
*group
;
126 ret
= str2sockunion (peer_str
, &su
);
129 peer
= peer_lookup (bgp
, &su
);
135 group
= peer_group_lookup (bgp
, peer_str
);
140 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
147 bgp_vty_return (struct vty
*vty
, int ret
)
149 const char *str
= NULL
;
153 case BGP_ERR_INVALID_VALUE
:
154 str
= "Invalid value";
156 case BGP_ERR_INVALID_FLAG
:
157 str
= "Invalid flag";
159 case BGP_ERR_PEER_INACTIVE
:
160 str
= "Activate the neighbor for the address family first";
162 case BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER
:
163 str
= "Invalid command for a peer-group member";
165 case BGP_ERR_PEER_GROUP_SHUTDOWN
:
166 str
= "Peer-group has been shutdown. Activate the peer-group first";
168 case BGP_ERR_PEER_GROUP_HAS_THE_FLAG
:
169 str
= "This peer is a peer-group member. Please change peer-group configuration";
171 case BGP_ERR_PEER_FLAG_CONFLICT
:
172 str
= "Can't set override-capability and strict-capability-match at the same time";
174 case BGP_ERR_PEER_GROUP_MEMBER_EXISTS
:
175 str
= "No activate for peergroup can be given only if peer-group has no members";
177 case BGP_ERR_PEER_BELONGS_TO_GROUP
:
178 str
= "No activate for an individual peer-group member is invalid";
180 case BGP_ERR_PEER_GROUP_AF_UNCONFIGURED
:
181 str
= "Activate the peer-group for the address family first";
183 case BGP_ERR_PEER_GROUP_NO_REMOTE_AS
:
184 str
= "Specify remote-as or peer-group remote AS first";
186 case BGP_ERR_PEER_GROUP_CANT_CHANGE
:
187 str
= "Cannot change the peer-group. Deconfigure first";
189 case BGP_ERR_PEER_GROUP_MISMATCH
:
190 str
= "Cannot have different peer-group for the neighbor";
192 case BGP_ERR_PEER_FILTER_CONFLICT
:
193 str
= "Prefix/distribute list can not co-exist";
195 case BGP_ERR_NOT_INTERNAL_PEER
:
196 str
= "Invalid command. Not an internal neighbor";
198 case BGP_ERR_REMOVE_PRIVATE_AS
:
199 str
= "Private AS cannot be removed for IBGP peers";
201 case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP
:
202 str
= "Local-AS allowed only for EBGP peers";
204 case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS
:
205 str
= "Cannot have local-as same as BGP AS number";
210 vty_out (vty
, "%% %s%s", str
, VTY_NEWLINE
);
216 /* BGP global configuration. */
218 DEFUN (bgp_multiple_instance_func
,
219 bgp_multiple_instance_cmd
,
220 "bgp multiple-instance",
222 "Enable bgp multiple instance\n")
224 bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE
);
228 DEFUN (no_bgp_multiple_instance
,
229 no_bgp_multiple_instance_cmd
,
230 "no bgp multiple-instance",
233 "BGP multiple instance\n")
237 ret
= bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE
);
240 vty_out (vty
, "%% There are more than two BGP instances%s", VTY_NEWLINE
);
246 DEFUN (bgp_config_type
,
248 "bgp config-type (cisco|zebra)",
250 "Configuration type\n"
254 if (strncmp (argv
[0], "c", 1) == 0)
255 bgp_option_set (BGP_OPT_CONFIG_CISCO
);
257 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
262 DEFUN (no_bgp_config_type
,
263 no_bgp_config_type_cmd
,
264 "no bgp config-type",
267 "Display configuration type\n")
269 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
273 DEFUN (no_synchronization
,
274 no_synchronization_cmd
,
275 "no synchronization",
277 "Perform IGP synchronization\n")
282 DEFUN (no_auto_summary
,
286 "Enable automatic network number summarization\n")
291 DEFUN_DEPRECATED (neighbor_version
,
292 neighbor_version_cmd
,
293 NEIGHBOR_CMD
"version (4|4-)",
296 "Set the BGP version to match a neighbor\n"
297 "Neighbor's BGP version\n")
302 /* "router bgp" commands. */
305 "router bgp <1-65535>",
313 const char *name
= NULL
;
315 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, 65535);
320 ret
= bgp_get (&bgp
, &as
, name
);
323 case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET
:
324 vty_out (vty
, "Please specify 'bgp multiple-instance' first%s",
328 case BGP_ERR_AS_MISMATCH
:
329 vty_out (vty
, "BGP is already running; AS is %d%s", as
, VTY_NEWLINE
);
332 case BGP_ERR_INSTANCE_MISMATCH
:
333 vty_out (vty
, "BGP view name and AS number mismatch%s", VTY_NEWLINE
);
334 vty_out (vty
, "BGP instance is already running; AS is %d%s",
340 vty
->node
= BGP_NODE
;
348 "router bgp <1-65535> view WORD",
355 /* "no router bgp" commands. */
356 DEFUN (no_router_bgp
,
358 "no router bgp <1-65535>",
366 const char *name
= NULL
;
368 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, 65535);
373 /* Lookup bgp structure. */
374 bgp
= bgp_lookup (as
, name
);
377 vty_out (vty
, "%% Can't find BGP instance%s", VTY_NEWLINE
);
386 ALIAS (no_router_bgp
,
387 no_router_bgp_view_cmd
,
388 "no router bgp <1-65535> view WORD",
398 DEFUN (bgp_router_id
,
400 "bgp router-id A.B.C.D",
402 "Override configured router identifier\n"
403 "Manually configured router identifier\n")
411 ret
= inet_aton (argv
[0], &id
);
414 vty_out (vty
, "%% Malformed bgp router identifier%s", VTY_NEWLINE
);
418 bgp
->router_id_static
= id
;
419 bgp_router_id_set (bgp
, &id
);
424 DEFUN (no_bgp_router_id
,
425 no_bgp_router_id_cmd
,
429 "Override configured router identifier\n")
439 ret
= inet_aton (argv
[0], &id
);
442 vty_out (vty
, "%% Malformed BGP router identifier%s", VTY_NEWLINE
);
446 if (! IPV4_ADDR_SAME (&bgp
->router_id_static
, &id
))
448 vty_out (vty
, "%% BGP router-id doesn't match%s", VTY_NEWLINE
);
453 bgp
->router_id_static
.s_addr
= 0;
454 bgp_router_id_set (bgp
, &router_id_zebra
);
459 ALIAS (no_bgp_router_id
,
460 no_bgp_router_id_val_cmd
,
461 "no bgp router-id A.B.C.D",
464 "Override configured router identifier\n"
465 "Manually configured router identifier\n")
467 /* BGP Cluster ID. */
469 DEFUN (bgp_cluster_id
,
471 "bgp cluster-id A.B.C.D",
473 "Configure Route-Reflector Cluster-id\n"
474 "Route-Reflector Cluster-id in IP address format\n")
478 struct in_addr cluster
;
482 ret
= inet_aton (argv
[0], &cluster
);
485 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
489 bgp_cluster_id_set (bgp
, &cluster
);
494 ALIAS (bgp_cluster_id
,
495 bgp_cluster_id32_cmd
,
496 "bgp cluster-id <1-4294967295>",
498 "Configure Route-Reflector Cluster-id\n"
499 "Route-Reflector Cluster-id as 32 bit quantity\n")
501 DEFUN (no_bgp_cluster_id
,
502 no_bgp_cluster_id_cmd
,
506 "Configure Route-Reflector Cluster-id\n")
510 struct in_addr cluster
;
516 ret
= inet_aton (argv
[0], &cluster
);
519 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
524 bgp_cluster_id_unset (bgp
);
529 ALIAS (no_bgp_cluster_id
,
530 no_bgp_cluster_id_arg_cmd
,
531 "no bgp cluster-id A.B.C.D",
534 "Configure Route-Reflector Cluster-id\n"
535 "Route-Reflector Cluster-id in IP address format\n")
537 DEFUN (bgp_confederation_identifier
,
538 bgp_confederation_identifier_cmd
,
539 "bgp confederation identifier <1-65535>",
540 "BGP specific commands\n"
541 "AS confederation parameters\n"
543 "Set routing domain confederation AS\n")
550 VTY_GET_INTEGER ("AS", as
, argv
[0]);
552 bgp_confederation_id_set (bgp
, as
);
557 DEFUN (no_bgp_confederation_identifier
,
558 no_bgp_confederation_identifier_cmd
,
559 "no bgp confederation identifier",
561 "BGP specific commands\n"
562 "AS confederation parameters\n"
571 VTY_GET_INTEGER ("AS", as
, argv
[0]);
573 bgp_confederation_id_unset (bgp
);
578 ALIAS (no_bgp_confederation_identifier
,
579 no_bgp_confederation_identifier_arg_cmd
,
580 "no bgp confederation identifier <1-65535>",
582 "BGP specific commands\n"
583 "AS confederation parameters\n"
585 "Set routing domain confederation AS\n")
587 DEFUN (bgp_confederation_peers
,
588 bgp_confederation_peers_cmd
,
589 "bgp confederation peers .<1-65535>",
590 "BGP specific commands\n"
591 "AS confederation parameters\n"
592 "Peer ASs in BGP confederation\n"
601 for (i
= 0; i
< argc
; i
++)
603 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, 65535);
607 vty_out (vty
, "%% Local member-AS not allowed in confed peer list%s",
612 bgp_confederation_peers_add (bgp
, as
);
617 DEFUN (no_bgp_confederation_peers
,
618 no_bgp_confederation_peers_cmd
,
619 "no bgp confederation peers .<1-65535>",
621 "BGP specific commands\n"
622 "AS confederation parameters\n"
623 "Peer ASs in BGP confederation\n"
632 for (i
= 0; i
< argc
; i
++)
634 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, 65535);
636 bgp_confederation_peers_remove (bgp
, as
);
645 "timers bgp <0-65535> <0-65535>",
646 "Adjust routing timers\n"
648 "Keepalive interval\n"
652 unsigned long keepalive
= 0;
653 unsigned long holdtime
= 0;
657 VTY_GET_INTEGER ("keepalive", keepalive
, argv
[0]);
658 VTY_GET_INTEGER ("holdtime", holdtime
, argv
[1]);
660 /* Holdtime value check. */
661 if (holdtime
< 3 && holdtime
!= 0)
663 vty_out (vty
, "%% hold time value must be either 0 or greater than 3%s",
668 bgp_timers_set (bgp
, keepalive
, holdtime
);
673 DEFUN (no_bgp_timers
,
677 "Adjust routing timers\n"
683 bgp_timers_unset (bgp
);
688 ALIAS (no_bgp_timers
,
689 no_bgp_timers_arg_cmd
,
690 "no timers bgp <0-65535> <0-65535>",
692 "Adjust routing timers\n"
694 "Keepalive interval\n"
697 DEFUN (bgp_client_to_client_reflection
,
698 bgp_client_to_client_reflection_cmd
,
699 "bgp client-to-client reflection",
700 "BGP specific commands\n"
701 "Configure client to client route reflection\n"
702 "reflection of routes allowed\n")
707 bgp_flag_unset (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
711 DEFUN (no_bgp_client_to_client_reflection
,
712 no_bgp_client_to_client_reflection_cmd
,
713 "no bgp client-to-client reflection",
715 "BGP specific commands\n"
716 "Configure client to client route reflection\n"
717 "reflection of routes allowed\n")
722 bgp_flag_set (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
726 /* "bgp always-compare-med" configuration. */
727 DEFUN (bgp_always_compare_med
,
728 bgp_always_compare_med_cmd
,
729 "bgp always-compare-med",
730 "BGP specific commands\n"
731 "Allow comparing MED from different neighbors\n")
736 bgp_flag_set (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
740 DEFUN (no_bgp_always_compare_med
,
741 no_bgp_always_compare_med_cmd
,
742 "no bgp always-compare-med",
744 "BGP specific commands\n"
745 "Allow comparing MED from different neighbors\n")
750 bgp_flag_unset (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
754 /* "bgp deterministic-med" configuration. */
755 DEFUN (bgp_deterministic_med
,
756 bgp_deterministic_med_cmd
,
757 "bgp deterministic-med",
758 "BGP specific commands\n"
759 "Pick the best-MED path among paths advertised from the neighboring AS\n")
764 bgp_flag_set (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
768 DEFUN (no_bgp_deterministic_med
,
769 no_bgp_deterministic_med_cmd
,
770 "no bgp deterministic-med",
772 "BGP specific commands\n"
773 "Pick the best-MED path among paths advertised from the neighboring AS\n")
778 bgp_flag_unset (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
782 /* "bgp graceful-restart" configuration. */
783 DEFUN (bgp_graceful_restart
,
784 bgp_graceful_restart_cmd
,
785 "bgp graceful-restart",
786 "BGP specific commands\n"
787 "Graceful restart capability parameters\n")
792 bgp_flag_set (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
796 DEFUN (no_bgp_graceful_restart
,
797 no_bgp_graceful_restart_cmd
,
798 "no bgp graceful-restart",
800 "BGP specific commands\n"
801 "Graceful restart capability parameters\n")
806 bgp_flag_unset (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
810 DEFUN (bgp_graceful_restart_stalepath_time
,
811 bgp_graceful_restart_stalepath_time_cmd
,
812 "bgp graceful-restart stalepath-time <1-3600>",
813 "BGP specific commands\n"
814 "Graceful restart capability parameters\n"
815 "Set the max time to hold onto restarting peer's stale paths\n"
816 "Delay value (seconds)\n")
825 VTY_GET_INTEGER_RANGE ("stalepath-time", stalepath
, argv
[0], 1, 3600);
826 bgp
->stalepath_time
= stalepath
;
830 DEFUN (no_bgp_graceful_restart_stalepath_time
,
831 no_bgp_graceful_restart_stalepath_time_cmd
,
832 "no bgp graceful-restart stalepath-time",
834 "BGP specific commands\n"
835 "Graceful restart capability parameters\n"
836 "Set the max time to hold onto restarting peer's stale paths\n")
844 bgp
->stalepath_time
= BGP_DEFAULT_STALEPATH_TIME
;
848 ALIAS (no_bgp_graceful_restart_stalepath_time
,
849 no_bgp_graceful_restart_stalepath_time_val_cmd
,
850 "no bgp graceful-restart stalepath-time <1-3600>",
852 "BGP specific commands\n"
853 "Graceful restart capability parameters\n"
854 "Set the max time to hold onto restarting peer's stale paths\n"
855 "Delay value (seconds)\n")
857 /* "bgp fast-external-failover" configuration. */
858 DEFUN (bgp_fast_external_failover
,
859 bgp_fast_external_failover_cmd
,
860 "bgp fast-external-failover",
862 "Immediately reset session if a link to a directly connected external peer goes down\n")
867 bgp_flag_unset (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
871 DEFUN (no_bgp_fast_external_failover
,
872 no_bgp_fast_external_failover_cmd
,
873 "no bgp fast-external-failover",
876 "Immediately reset session if a link to a directly connected external peer goes down\n")
881 bgp_flag_set (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
885 /* "bgp enforce-first-as" configuration. */
886 DEFUN (bgp_enforce_first_as
,
887 bgp_enforce_first_as_cmd
,
888 "bgp enforce-first-as",
890 "Enforce the first AS for EBGP routes\n")
895 bgp_flag_set (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
899 DEFUN (no_bgp_enforce_first_as
,
900 no_bgp_enforce_first_as_cmd
,
901 "no bgp enforce-first-as",
904 "Enforce the first AS for EBGP routes\n")
909 bgp_flag_unset (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
913 /* "bgp bestpath compare-routerid" configuration. */
914 DEFUN (bgp_bestpath_compare_router_id
,
915 bgp_bestpath_compare_router_id_cmd
,
916 "bgp bestpath compare-routerid",
917 "BGP specific commands\n"
918 "Change the default bestpath selection\n"
919 "Compare router-id for identical EBGP paths\n")
924 bgp_flag_set (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
928 DEFUN (no_bgp_bestpath_compare_router_id
,
929 no_bgp_bestpath_compare_router_id_cmd
,
930 "no bgp bestpath compare-routerid",
932 "BGP specific commands\n"
933 "Change the default bestpath selection\n"
934 "Compare router-id for identical EBGP paths\n")
939 bgp_flag_unset (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
943 /* "bgp bestpath as-path ignore" configuration. */
944 DEFUN (bgp_bestpath_aspath_ignore
,
945 bgp_bestpath_aspath_ignore_cmd
,
946 "bgp bestpath as-path ignore",
947 "BGP specific commands\n"
948 "Change the default bestpath selection\n"
949 "AS-path attribute\n"
950 "Ignore as-path length in selecting a route\n")
955 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_IGNORE
);
959 DEFUN (no_bgp_bestpath_aspath_ignore
,
960 no_bgp_bestpath_aspath_ignore_cmd
,
961 "no bgp bestpath as-path ignore",
963 "BGP specific commands\n"
964 "Change the default bestpath selection\n"
965 "AS-path attribute\n"
966 "Ignore as-path length in selecting a route\n")
971 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_IGNORE
);
975 /* "bgp bestpath as-path confed" configuration. */
976 DEFUN (bgp_bestpath_aspath_confed
,
977 bgp_bestpath_aspath_confed_cmd
,
978 "bgp bestpath as-path confed",
979 "BGP specific commands\n"
980 "Change the default bestpath selection\n"
981 "AS-path attribute\n"
982 "Compare path lengths including confederation sets & sequences in selecting a route\n")
987 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_CONFED
);
991 DEFUN (no_bgp_bestpath_aspath_confed
,
992 no_bgp_bestpath_aspath_confed_cmd
,
993 "no bgp bestpath as-path confed",
995 "BGP specific commands\n"
996 "Change the default bestpath selection\n"
997 "AS-path attribute\n"
998 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1003 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_CONFED
);
1007 /* "bgp log-neighbor-changes" configuration. */
1008 DEFUN (bgp_log_neighbor_changes
,
1009 bgp_log_neighbor_changes_cmd
,
1010 "bgp log-neighbor-changes",
1011 "BGP specific commands\n"
1012 "Log neighbor up/down and reset reason\n")
1017 bgp_flag_set (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
1021 DEFUN (no_bgp_log_neighbor_changes
,
1022 no_bgp_log_neighbor_changes_cmd
,
1023 "no bgp log-neighbor-changes",
1025 "BGP specific commands\n"
1026 "Log neighbor up/down and reset reason\n")
1031 bgp_flag_unset (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
1035 /* "bgp bestpath med" configuration. */
1036 DEFUN (bgp_bestpath_med
,
1037 bgp_bestpath_med_cmd
,
1038 "bgp bestpath med (confed|missing-as-worst)",
1039 "BGP specific commands\n"
1040 "Change the default bestpath selection\n"
1042 "Compare MED among confederation paths\n"
1043 "Treat missing MED as the least preferred one\n")
1049 if (strncmp (argv
[0], "confed", 1) == 0)
1050 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
1052 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1057 DEFUN (bgp_bestpath_med2
,
1058 bgp_bestpath_med2_cmd
,
1059 "bgp bestpath med confed missing-as-worst",
1060 "BGP specific commands\n"
1061 "Change the default bestpath selection\n"
1063 "Compare MED among confederation paths\n"
1064 "Treat missing MED as the least preferred one\n")
1069 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
1070 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1074 ALIAS (bgp_bestpath_med2
,
1075 bgp_bestpath_med3_cmd
,
1076 "bgp bestpath med missing-as-worst confed",
1077 "BGP specific commands\n"
1078 "Change the default bestpath selection\n"
1080 "Treat missing MED as the least preferred one\n"
1081 "Compare MED among confederation paths\n")
1083 DEFUN (no_bgp_bestpath_med
,
1084 no_bgp_bestpath_med_cmd
,
1085 "no bgp bestpath med (confed|missing-as-worst)",
1087 "BGP specific commands\n"
1088 "Change the default bestpath selection\n"
1090 "Compare MED among confederation paths\n"
1091 "Treat missing MED as the least preferred one\n")
1097 if (strncmp (argv
[0], "confed", 1) == 0)
1098 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
1100 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1105 DEFUN (no_bgp_bestpath_med2
,
1106 no_bgp_bestpath_med2_cmd
,
1107 "no bgp bestpath med confed missing-as-worst",
1109 "BGP specific commands\n"
1110 "Change the default bestpath selection\n"
1112 "Compare MED among confederation paths\n"
1113 "Treat missing MED as the least preferred one\n")
1118 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
1119 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1123 ALIAS (no_bgp_bestpath_med2
,
1124 no_bgp_bestpath_med3_cmd
,
1125 "no bgp bestpath med missing-as-worst confed",
1127 "BGP specific commands\n"
1128 "Change the default bestpath selection\n"
1130 "Treat missing MED as the least preferred one\n"
1131 "Compare MED among confederation paths\n")
1133 /* "no bgp default ipv4-unicast". */
1134 DEFUN (no_bgp_default_ipv4_unicast
,
1135 no_bgp_default_ipv4_unicast_cmd
,
1136 "no bgp default ipv4-unicast",
1138 "BGP specific commands\n"
1139 "Configure BGP defaults\n"
1140 "Activate ipv4-unicast for a peer by default\n")
1145 bgp_flag_set (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1149 DEFUN (bgp_default_ipv4_unicast
,
1150 bgp_default_ipv4_unicast_cmd
,
1151 "bgp default ipv4-unicast",
1152 "BGP specific commands\n"
1153 "Configure BGP defaults\n"
1154 "Activate ipv4-unicast for a peer by default\n")
1159 bgp_flag_unset (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1163 /* "bgp import-check" configuration. */
1164 DEFUN (bgp_network_import_check
,
1165 bgp_network_import_check_cmd
,
1166 "bgp network import-check",
1167 "BGP specific commands\n"
1168 "BGP network command\n"
1169 "Check BGP network route exists in IGP\n")
1174 bgp_flag_set (bgp
, BGP_FLAG_IMPORT_CHECK
);
1178 DEFUN (no_bgp_network_import_check
,
1179 no_bgp_network_import_check_cmd
,
1180 "no bgp network import-check",
1182 "BGP specific commands\n"
1183 "BGP network command\n"
1184 "Check BGP network route exists in IGP\n")
1189 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK
);
1193 DEFUN (bgp_default_local_preference
,
1194 bgp_default_local_preference_cmd
,
1195 "bgp default local-preference <0-4294967295>",
1196 "BGP specific commands\n"
1197 "Configure BGP defaults\n"
1198 "local preference (higher=more preferred)\n"
1199 "Configure default local preference value\n")
1202 u_int32_t local_pref
;
1206 VTY_GET_INTEGER ("local preference", local_pref
, argv
[0]);
1208 bgp_default_local_preference_set (bgp
, local_pref
);
1213 DEFUN (no_bgp_default_local_preference
,
1214 no_bgp_default_local_preference_cmd
,
1215 "no bgp default local-preference",
1217 "BGP specific commands\n"
1218 "Configure BGP defaults\n"
1219 "local preference (higher=more preferred)\n")
1224 bgp_default_local_preference_unset (bgp
);
1228 ALIAS (no_bgp_default_local_preference
,
1229 no_bgp_default_local_preference_val_cmd
,
1230 "no bgp default local-preference <0-4294967295>",
1232 "BGP specific commands\n"
1233 "Configure BGP defaults\n"
1234 "local preference (higher=more preferred)\n"
1235 "Configure default local preference value\n")
1238 peer_remote_as_vty (struct vty
*vty
, const char *peer_str
,
1239 const char *as_str
, afi_t afi
, safi_t safi
)
1248 /* Get AS number. */
1249 VTY_GET_INTEGER_RANGE ("AS", as
, as_str
, 1, 65535);
1251 /* If peer is peer group, call proper function. */
1252 ret
= str2sockunion (peer_str
, &su
);
1255 ret
= peer_group_remote_as (bgp
, peer_str
, &as
);
1258 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1264 if (peer_address_self_check (&su
))
1266 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1271 ret
= peer_remote_as (bgp
, &su
, &as
, afi
, safi
);
1273 /* This peer belongs to peer group. */
1276 case BGP_ERR_PEER_GROUP_MEMBER
:
1277 vty_out (vty
, "%% Peer-group AS %d. Cannot configure remote-as for member%s", as
, VTY_NEWLINE
);
1280 case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
:
1281 vty_out (vty
, "%% The AS# can not be changed from %d to %s, peer-group members must be all internal or all external%s", as
, as_str
, VTY_NEWLINE
);
1285 return bgp_vty_return (vty
, ret
);
1288 DEFUN (neighbor_remote_as
,
1289 neighbor_remote_as_cmd
,
1290 NEIGHBOR_CMD2
"remote-as <1-65535>",
1293 "Specify a BGP neighbor\n"
1296 return peer_remote_as_vty (vty
, argv
[0], argv
[1], AFI_IP
, SAFI_UNICAST
);
1299 DEFUN (neighbor_peer_group
,
1300 neighbor_peer_group_cmd
,
1301 "neighbor WORD peer-group",
1304 "Configure peer-group\n")
1307 struct peer_group
*group
;
1311 group
= peer_group_get (bgp
, argv
[0]);
1327 struct peer_group
*group
;
1330 ret
= str2sockunion (argv
[0], &su
);
1333 group
= peer_group_lookup (vty
->index
, argv
[0]);
1335 peer_group_delete (group
);
1338 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1344 peer
= peer_lookup (vty
->index
, &su
);
1353 no_neighbor_remote_as_cmd
,
1354 NO_NEIGHBOR_CMD
"remote-as <1-65535>",
1358 "Specify a BGP neighbor\n"
1361 DEFUN (no_neighbor_peer_group
,
1362 no_neighbor_peer_group_cmd
,
1363 "no neighbor WORD peer-group",
1367 "Configure peer-group\n")
1369 struct peer_group
*group
;
1371 group
= peer_group_lookup (vty
->index
, argv
[0]);
1373 peer_group_delete (group
);
1376 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1382 DEFUN (no_neighbor_peer_group_remote_as
,
1383 no_neighbor_peer_group_remote_as_cmd
,
1384 "no neighbor WORD remote-as <1-65535>",
1388 "Specify a BGP neighbor\n"
1391 struct peer_group
*group
;
1393 group
= peer_group_lookup (vty
->index
, argv
[0]);
1395 peer_group_remote_as_delete (group
);
1398 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1404 DEFUN (neighbor_local_as
,
1405 neighbor_local_as_cmd
,
1406 NEIGHBOR_CMD2
"local-as <1-65535>",
1409 "Specify a local-as number\n"
1410 "AS number used as local AS\n")
1415 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1419 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 0);
1420 return bgp_vty_return (vty
, ret
);
1423 DEFUN (neighbor_local_as_no_prepend
,
1424 neighbor_local_as_no_prepend_cmd
,
1425 NEIGHBOR_CMD2
"local-as <1-65535> no-prepend",
1428 "Specify a local-as number\n"
1429 "AS number used as local AS\n"
1430 "Do not prepend local-as to updates from ebgp peers\n")
1435 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1439 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1);
1440 return bgp_vty_return (vty
, ret
);
1443 DEFUN (no_neighbor_local_as
,
1444 no_neighbor_local_as_cmd
,
1445 NO_NEIGHBOR_CMD2
"local-as",
1449 "Specify a local-as number\n")
1454 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1458 ret
= peer_local_as_unset (peer
);
1459 return bgp_vty_return (vty
, ret
);
1462 ALIAS (no_neighbor_local_as
,
1463 no_neighbor_local_as_val_cmd
,
1464 NO_NEIGHBOR_CMD2
"local-as <1-65535>",
1468 "Specify a local-as number\n"
1469 "AS number used as local AS\n")
1471 ALIAS (no_neighbor_local_as
,
1472 no_neighbor_local_as_val2_cmd
,
1473 NO_NEIGHBOR_CMD2
"local-as <1-65535> no-prepend",
1477 "Specify a local-as number\n"
1478 "AS number used as local AS\n"
1479 "Do not prepend local-as to updates from ebgp peers\n")
1481 DEFUN (neighbor_activate
,
1482 neighbor_activate_cmd
,
1483 NEIGHBOR_CMD2
"activate",
1486 "Enable the Address Family for this Neighbor\n")
1490 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1494 peer_activate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
1499 DEFUN (no_neighbor_activate
,
1500 no_neighbor_activate_cmd
,
1501 NO_NEIGHBOR_CMD2
"activate",
1505 "Enable the Address Family for this Neighbor\n")
1511 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1515 ret
= peer_deactivate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
1517 return bgp_vty_return (vty
, ret
);
1520 DEFUN (neighbor_set_peer_group
,
1521 neighbor_set_peer_group_cmd
,
1522 NEIGHBOR_CMD
"peer-group WORD",
1525 "Member of the peer-group\n"
1526 "peer-group name\n")
1532 struct peer_group
*group
;
1536 ret
= str2sockunion (argv
[0], &su
);
1539 vty_out (vty
, "%% Malformed address: %s%s", argv
[0], VTY_NEWLINE
);
1543 group
= peer_group_lookup (bgp
, argv
[1]);
1546 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
1550 if (peer_address_self_check (&su
))
1552 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1557 ret
= peer_group_bind (bgp
, &su
, group
, bgp_node_afi (vty
),
1558 bgp_node_safi (vty
), &as
);
1560 if (ret
== BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
)
1562 vty_out (vty
, "%% Peer with AS %d cannot be in this peer-group, members must be all internal or all external%s", as
, VTY_NEWLINE
);
1566 return bgp_vty_return (vty
, ret
);
1569 DEFUN (no_neighbor_set_peer_group
,
1570 no_neighbor_set_peer_group_cmd
,
1571 NO_NEIGHBOR_CMD
"peer-group WORD",
1575 "Member of the peer-group\n"
1576 "peer-group name\n")
1581 struct peer_group
*group
;
1585 peer
= peer_lookup_vty (vty
, argv
[0]);
1589 group
= peer_group_lookup (bgp
, argv
[1]);
1592 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
1596 ret
= peer_group_unbind (bgp
, peer
, group
, bgp_node_afi (vty
),
1597 bgp_node_safi (vty
));
1599 return bgp_vty_return (vty
, ret
);
1603 peer_flag_modify_vty (struct vty
*vty
, const char *ip_str
,
1604 u_int16_t flag
, int set
)
1609 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
1614 ret
= peer_flag_set (peer
, flag
);
1616 ret
= peer_flag_unset (peer
, flag
);
1618 return bgp_vty_return (vty
, ret
);
1622 peer_flag_set_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
1624 return peer_flag_modify_vty (vty
, ip_str
, flag
, 1);
1628 peer_flag_unset_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
1630 return peer_flag_modify_vty (vty
, ip_str
, flag
, 0);
1633 /* neighbor passive. */
1634 DEFUN (neighbor_passive
,
1635 neighbor_passive_cmd
,
1636 NEIGHBOR_CMD2
"passive",
1639 "Don't send open messages to this neighbor\n")
1641 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
1644 DEFUN (no_neighbor_passive
,
1645 no_neighbor_passive_cmd
,
1646 NO_NEIGHBOR_CMD2
"passive",
1650 "Don't send open messages to this neighbor\n")
1652 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
1655 /* neighbor shutdown. */
1656 DEFUN (neighbor_shutdown
,
1657 neighbor_shutdown_cmd
,
1658 NEIGHBOR_CMD2
"shutdown",
1661 "Administratively shut down this neighbor\n")
1663 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
1666 DEFUN (no_neighbor_shutdown
,
1667 no_neighbor_shutdown_cmd
,
1668 NO_NEIGHBOR_CMD2
"shutdown",
1672 "Administratively shut down this neighbor\n")
1674 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
1677 /* Deprecated neighbor capability route-refresh. */
1678 DEFUN_DEPRECATED (neighbor_capability_route_refresh
,
1679 neighbor_capability_route_refresh_cmd
,
1680 NEIGHBOR_CMD2
"capability route-refresh",
1683 "Advertise capability to the peer\n"
1684 "Advertise route-refresh capability to this neighbor\n")
1689 DEFUN_DEPRECATED (no_neighbor_capability_route_refresh
,
1690 no_neighbor_capability_route_refresh_cmd
,
1691 NO_NEIGHBOR_CMD2
"capability route-refresh",
1695 "Advertise capability to the peer\n"
1696 "Advertise route-refresh capability to this neighbor\n")
1701 /* neighbor capability dynamic. */
1702 DEFUN (neighbor_capability_dynamic
,
1703 neighbor_capability_dynamic_cmd
,
1704 NEIGHBOR_CMD2
"capability dynamic",
1707 "Advertise capability to the peer\n"
1708 "Advertise dynamic capability to this neighbor\n")
1710 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
1713 DEFUN (no_neighbor_capability_dynamic
,
1714 no_neighbor_capability_dynamic_cmd
,
1715 NO_NEIGHBOR_CMD2
"capability dynamic",
1719 "Advertise capability to the peer\n"
1720 "Advertise dynamic capability to this neighbor\n")
1722 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
1725 /* neighbor dont-capability-negotiate */
1726 DEFUN (neighbor_dont_capability_negotiate
,
1727 neighbor_dont_capability_negotiate_cmd
,
1728 NEIGHBOR_CMD2
"dont-capability-negotiate",
1731 "Do not perform capability negotiation\n")
1733 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
1736 DEFUN (no_neighbor_dont_capability_negotiate
,
1737 no_neighbor_dont_capability_negotiate_cmd
,
1738 NO_NEIGHBOR_CMD2
"dont-capability-negotiate",
1742 "Do not perform capability negotiation\n")
1744 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
1748 peer_af_flag_modify_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
1749 safi_t safi
, u_int32_t flag
, int set
)
1754 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
1759 ret
= peer_af_flag_set (peer
, afi
, safi
, flag
);
1761 ret
= peer_af_flag_unset (peer
, afi
, safi
, flag
);
1763 return bgp_vty_return (vty
, ret
);
1767 peer_af_flag_set_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
1768 safi_t safi
, u_int32_t flag
)
1770 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 1);
1774 peer_af_flag_unset_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
1775 safi_t safi
, u_int32_t flag
)
1777 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 0);
1780 /* neighbor capability orf prefix-list. */
1781 DEFUN (neighbor_capability_orf_prefix
,
1782 neighbor_capability_orf_prefix_cmd
,
1783 NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
1786 "Advertise capability to the peer\n"
1787 "Advertise ORF capability to the peer\n"
1788 "Advertise prefixlist ORF capability to this neighbor\n"
1789 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
1790 "Capability to RECEIVE the ORF from this neighbor\n"
1791 "Capability to SEND the ORF to this neighbor\n")
1795 if (strncmp (argv
[1], "s", 1) == 0)
1796 flag
= PEER_FLAG_ORF_PREFIX_SM
;
1797 else if (strncmp (argv
[1], "r", 1) == 0)
1798 flag
= PEER_FLAG_ORF_PREFIX_RM
;
1799 else if (strncmp (argv
[1], "b", 1) == 0)
1800 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
1804 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1805 bgp_node_safi (vty
), flag
);
1808 DEFUN (no_neighbor_capability_orf_prefix
,
1809 no_neighbor_capability_orf_prefix_cmd
,
1810 NO_NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
1814 "Advertise capability to the peer\n"
1815 "Advertise ORF capability to the peer\n"
1816 "Advertise prefixlist ORF capability to this neighbor\n"
1817 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
1818 "Capability to RECEIVE the ORF from this neighbor\n"
1819 "Capability to SEND the ORF to this neighbor\n")
1823 if (strncmp (argv
[1], "s", 1) == 0)
1824 flag
= PEER_FLAG_ORF_PREFIX_SM
;
1825 else if (strncmp (argv
[1], "r", 1) == 0)
1826 flag
= PEER_FLAG_ORF_PREFIX_RM
;
1827 else if (strncmp (argv
[1], "b", 1) == 0)
1828 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
1832 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1833 bgp_node_safi (vty
), flag
);
1836 /* neighbor next-hop-self. */
1837 DEFUN (neighbor_nexthop_self
,
1838 neighbor_nexthop_self_cmd
,
1839 NEIGHBOR_CMD2
"next-hop-self",
1842 "Disable the next hop calculation for this neighbor\n")
1844 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1845 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
1848 DEFUN (no_neighbor_nexthop_self
,
1849 no_neighbor_nexthop_self_cmd
,
1850 NO_NEIGHBOR_CMD2
"next-hop-self",
1854 "Disable the next hop calculation for this neighbor\n")
1856 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1857 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
1860 /* neighbor remove-private-AS. */
1861 DEFUN (neighbor_remove_private_as
,
1862 neighbor_remove_private_as_cmd
,
1863 NEIGHBOR_CMD2
"remove-private-AS",
1866 "Remove private AS number from outbound updates\n")
1868 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1869 bgp_node_safi (vty
),
1870 PEER_FLAG_REMOVE_PRIVATE_AS
);
1873 DEFUN (no_neighbor_remove_private_as
,
1874 no_neighbor_remove_private_as_cmd
,
1875 NO_NEIGHBOR_CMD2
"remove-private-AS",
1879 "Remove private AS number from outbound updates\n")
1881 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1882 bgp_node_safi (vty
),
1883 PEER_FLAG_REMOVE_PRIVATE_AS
);
1886 /* neighbor send-community. */
1887 DEFUN (neighbor_send_community
,
1888 neighbor_send_community_cmd
,
1889 NEIGHBOR_CMD2
"send-community",
1892 "Send Community attribute to this neighbor\n")
1894 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1895 bgp_node_safi (vty
),
1896 PEER_FLAG_SEND_COMMUNITY
);
1899 DEFUN (no_neighbor_send_community
,
1900 no_neighbor_send_community_cmd
,
1901 NO_NEIGHBOR_CMD2
"send-community",
1905 "Send Community attribute to this neighbor\n")
1907 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1908 bgp_node_safi (vty
),
1909 PEER_FLAG_SEND_COMMUNITY
);
1912 /* neighbor send-community extended. */
1913 DEFUN (neighbor_send_community_type
,
1914 neighbor_send_community_type_cmd
,
1915 NEIGHBOR_CMD2
"send-community (both|extended|standard)",
1918 "Send Community attribute to this neighbor\n"
1919 "Send Standard and Extended Community attributes\n"
1920 "Send Extended Community attributes\n"
1921 "Send Standard Community attributes\n")
1923 if (strncmp (argv
[1], "s", 1) == 0)
1924 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1925 bgp_node_safi (vty
),
1926 PEER_FLAG_SEND_COMMUNITY
);
1927 if (strncmp (argv
[1], "e", 1) == 0)
1928 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1929 bgp_node_safi (vty
),
1930 PEER_FLAG_SEND_EXT_COMMUNITY
);
1932 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1933 bgp_node_safi (vty
),
1934 (PEER_FLAG_SEND_COMMUNITY
|
1935 PEER_FLAG_SEND_EXT_COMMUNITY
));
1938 DEFUN (no_neighbor_send_community_type
,
1939 no_neighbor_send_community_type_cmd
,
1940 NO_NEIGHBOR_CMD2
"send-community (both|extended|standard)",
1944 "Send Community attribute to this neighbor\n"
1945 "Send Standard and Extended Community attributes\n"
1946 "Send Extended Community attributes\n"
1947 "Send Standard Community attributes\n")
1949 if (strncmp (argv
[1], "s", 1) == 0)
1950 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1951 bgp_node_safi (vty
),
1952 PEER_FLAG_SEND_COMMUNITY
);
1953 if (strncmp (argv
[1], "e", 1) == 0)
1954 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1955 bgp_node_safi (vty
),
1956 PEER_FLAG_SEND_EXT_COMMUNITY
);
1958 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1959 bgp_node_safi (vty
),
1960 (PEER_FLAG_SEND_COMMUNITY
|
1961 PEER_FLAG_SEND_EXT_COMMUNITY
));
1964 /* neighbor soft-reconfig. */
1965 DEFUN (neighbor_soft_reconfiguration
,
1966 neighbor_soft_reconfiguration_cmd
,
1967 NEIGHBOR_CMD2
"soft-reconfiguration inbound",
1970 "Per neighbor soft reconfiguration\n"
1971 "Allow inbound soft reconfiguration for this neighbor\n")
1973 return peer_af_flag_set_vty (vty
, argv
[0],
1974 bgp_node_afi (vty
), bgp_node_safi (vty
),
1975 PEER_FLAG_SOFT_RECONFIG
);
1978 DEFUN (no_neighbor_soft_reconfiguration
,
1979 no_neighbor_soft_reconfiguration_cmd
,
1980 NO_NEIGHBOR_CMD2
"soft-reconfiguration inbound",
1984 "Per neighbor soft reconfiguration\n"
1985 "Allow inbound soft reconfiguration for this neighbor\n")
1987 return peer_af_flag_unset_vty (vty
, argv
[0],
1988 bgp_node_afi (vty
), bgp_node_safi (vty
),
1989 PEER_FLAG_SOFT_RECONFIG
);
1992 DEFUN (neighbor_route_reflector_client
,
1993 neighbor_route_reflector_client_cmd
,
1994 NEIGHBOR_CMD2
"route-reflector-client",
1997 "Configure a neighbor as Route Reflector client\n")
2002 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2006 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2007 bgp_node_safi (vty
),
2008 PEER_FLAG_REFLECTOR_CLIENT
);
2011 DEFUN (no_neighbor_route_reflector_client
,
2012 no_neighbor_route_reflector_client_cmd
,
2013 NO_NEIGHBOR_CMD2
"route-reflector-client",
2017 "Configure a neighbor as Route Reflector client\n")
2019 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2020 bgp_node_safi (vty
),
2021 PEER_FLAG_REFLECTOR_CLIENT
);
2025 peer_rsclient_set_vty (struct vty
*vty
, const char *peer_str
,
2031 struct peer_group
*group
;
2032 struct listnode
*node
, *nnode
;
2033 struct bgp_filter
*pfilter
;
2034 struct bgp_filter
*gfilter
;
2038 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2042 /* If it is already a RS-Client, don't do anything. */
2043 if ( CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
2046 if ( ! peer_rsclient_active (peer
) )
2048 peer
= peer_lock (peer
); /* rsclient peer list reference */
2049 listnode_add_sort (bgp
->rsclient
, peer
);
2052 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2054 return bgp_vty_return (vty
, ret
);
2056 peer
->rib
[afi
][safi
] = bgp_table_init ();
2057 peer
->rib
[afi
][safi
]->type
= BGP_TABLE_RSCLIENT
;
2058 peer
->rib
[afi
][safi
]->owner
= peer
;
2060 /* Check for existing 'network' and 'redistribute' routes. */
2061 bgp_check_local_routes_rsclient (peer
, afi
, safi
);
2063 /* Check for routes for peers configured with 'soft-reconfiguration'. */
2064 bgp_soft_reconfig_rsclient (peer
, afi
, safi
);
2066 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
2068 group
= peer
->group
;
2069 gfilter
= &peer
->filter
[afi
][safi
];
2071 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
2073 pfilter
= &peer
->filter
[afi
][safi
];
2075 /* Members of a non-RS-Client group should not be RS-Clients, as that
2076 is checked when the become part of the peer-group */
2077 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2079 return bgp_vty_return (vty
, ret
);
2081 /* Make peer's RIB point to group's RIB. */
2082 peer
->rib
[afi
][safi
] = group
->conf
->rib
[afi
][safi
];
2084 /* Import policy. */
2085 if (pfilter
->map
[RMAP_IMPORT
].name
)
2086 free (pfilter
->map
[RMAP_IMPORT
].name
);
2087 if (gfilter
->map
[RMAP_IMPORT
].name
)
2089 pfilter
->map
[RMAP_IMPORT
].name
= strdup (gfilter
->map
[RMAP_IMPORT
].name
);
2090 pfilter
->map
[RMAP_IMPORT
].map
= gfilter
->map
[RMAP_IMPORT
].map
;
2094 pfilter
->map
[RMAP_IMPORT
].name
= NULL
;
2095 pfilter
->map
[RMAP_IMPORT
].map
=NULL
;
2098 /* Export policy. */
2099 if (gfilter
->map
[RMAP_EXPORT
].name
&& ! pfilter
->map
[RMAP_EXPORT
].name
)
2101 pfilter
->map
[RMAP_EXPORT
].name
= strdup (gfilter
->map
[RMAP_EXPORT
].name
);
2102 pfilter
->map
[RMAP_EXPORT
].map
= gfilter
->map
[RMAP_EXPORT
].map
;
2110 peer_rsclient_unset_vty (struct vty
*vty
, const char *peer_str
,
2116 struct peer_group
*group
;
2117 struct listnode
*node
, *nnode
;
2121 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2125 /* If it is not a RS-Client, don't do anything. */
2126 if ( ! CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
2129 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
2131 group
= peer
->group
;
2133 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
2135 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2137 return bgp_vty_return (vty
, ret
);
2139 peer
->rib
[afi
][safi
] = NULL
;
2145 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2147 return bgp_vty_return (vty
, ret
);
2149 if ( ! peer_rsclient_active (peer
) )
2151 peer_unlock (peer
); /* peer bgp rsclient reference */
2152 listnode_delete (bgp
->rsclient
, peer
);
2155 bgp_table_finish (peer
->rib
[bgp_node_afi(vty
)][bgp_node_safi(vty
)]);
2160 /* neighbor route-server-client. */
2161 DEFUN (neighbor_route_server_client
,
2162 neighbor_route_server_client_cmd
,
2163 NEIGHBOR_CMD2
"route-server-client",
2166 "Configure a neighbor as Route Server client\n")
2168 return peer_rsclient_set_vty (vty
, argv
[0], bgp_node_afi(vty
),
2169 bgp_node_safi(vty
));
2172 DEFUN (no_neighbor_route_server_client
,
2173 no_neighbor_route_server_client_cmd
,
2174 NO_NEIGHBOR_CMD2
"route-server-client",
2178 "Configure a neighbor as Route Server client\n")
2180 return peer_rsclient_unset_vty (vty
, argv
[0], bgp_node_afi(vty
),
2181 bgp_node_safi(vty
));
2184 DEFUN (neighbor_nexthop_local_unchanged
,
2185 neighbor_nexthop_local_unchanged_cmd
,
2186 NEIGHBOR_CMD2
"nexthop-local unchanged",
2189 "Configure treatment of outgoing link-local nexthop attribute\n"
2190 "Leave link-local nexthop unchanged for this peer\n")
2192 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2193 bgp_node_safi (vty
),
2194 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
2197 DEFUN (no_neighbor_nexthop_local_unchanged
,
2198 no_neighbor_nexthop_local_unchanged_cmd
,
2199 NO_NEIGHBOR_CMD2
"nexthop-local unchanged",
2203 "Configure treatment of outgoing link-local-nexthop attribute\n"
2204 "Leave link-local nexthop unchanged for this peer\n")
2206 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2207 bgp_node_safi (vty
),
2208 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
2211 DEFUN (neighbor_attr_unchanged
,
2212 neighbor_attr_unchanged_cmd
,
2213 NEIGHBOR_CMD2
"attribute-unchanged",
2216 "BGP attribute is propagated unchanged to this neighbor\n")
2218 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2219 bgp_node_safi (vty
),
2220 (PEER_FLAG_AS_PATH_UNCHANGED
|
2221 PEER_FLAG_NEXTHOP_UNCHANGED
|
2222 PEER_FLAG_MED_UNCHANGED
));
2225 DEFUN (neighbor_attr_unchanged1
,
2226 neighbor_attr_unchanged1_cmd
,
2227 NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2230 "BGP attribute is propagated unchanged to this neighbor\n"
2231 "As-path attribute\n"
2232 "Nexthop attribute\n"
2235 u_int16_t flags
= 0;
2237 if (strncmp (argv
[1], "as-path", 1) == 0)
2238 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2239 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2240 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2241 else if (strncmp (argv
[1], "med", 1) == 0)
2242 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2244 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2245 bgp_node_safi (vty
), flags
);
2248 DEFUN (neighbor_attr_unchanged2
,
2249 neighbor_attr_unchanged2_cmd
,
2250 NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2253 "BGP attribute is propagated unchanged to this neighbor\n"
2254 "As-path attribute\n"
2255 "Nexthop attribute\n"
2258 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2260 if (strncmp (argv
[1], "next-hop", 1) == 0)
2261 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2262 else if (strncmp (argv
[1], "med", 1) == 0)
2263 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2265 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2266 bgp_node_safi (vty
), flags
);
2270 DEFUN (neighbor_attr_unchanged3
,
2271 neighbor_attr_unchanged3_cmd
,
2272 NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2275 "BGP attribute is propagated unchanged to this neighbor\n"
2276 "Nexthop attribute\n"
2277 "As-path attribute\n"
2280 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2282 if (strncmp (argv
[1], "as-path", 1) == 0)
2283 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2284 else if (strncmp (argv
[1], "med", 1) == 0)
2285 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2287 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2288 bgp_node_safi (vty
), flags
);
2291 DEFUN (neighbor_attr_unchanged4
,
2292 neighbor_attr_unchanged4_cmd
,
2293 NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2296 "BGP attribute is propagated unchanged to this neighbor\n"
2298 "As-path attribute\n"
2299 "Nexthop attribute\n")
2301 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2303 if (strncmp (argv
[1], "as-path", 1) == 0)
2304 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2305 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2306 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2308 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2309 bgp_node_safi (vty
), flags
);
2312 ALIAS (neighbor_attr_unchanged
,
2313 neighbor_attr_unchanged5_cmd
,
2314 NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2317 "BGP attribute is propagated unchanged to this neighbor\n"
2318 "As-path attribute\n"
2319 "Nexthop attribute\n"
2322 ALIAS (neighbor_attr_unchanged
,
2323 neighbor_attr_unchanged6_cmd
,
2324 NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2327 "BGP attribute is propagated unchanged to this neighbor\n"
2328 "As-path attribute\n"
2330 "Nexthop attribute\n")
2332 ALIAS (neighbor_attr_unchanged
,
2333 neighbor_attr_unchanged7_cmd
,
2334 NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2337 "BGP attribute is propagated unchanged to this neighbor\n"
2338 "Nexthop attribute\n"
2340 "As-path attribute\n")
2342 ALIAS (neighbor_attr_unchanged
,
2343 neighbor_attr_unchanged8_cmd
,
2344 NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2347 "BGP attribute is propagated unchanged to this neighbor\n"
2348 "Nexthop attribute\n"
2349 "As-path attribute\n"
2352 ALIAS (neighbor_attr_unchanged
,
2353 neighbor_attr_unchanged9_cmd
,
2354 NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2357 "BGP attribute is propagated unchanged to this neighbor\n"
2359 "Nexthop attribute\n"
2360 "As-path attribute\n")
2362 ALIAS (neighbor_attr_unchanged
,
2363 neighbor_attr_unchanged10_cmd
,
2364 NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2367 "BGP attribute is propagated unchanged to this neighbor\n"
2369 "As-path attribute\n"
2370 "Nexthop attribute\n")
2372 DEFUN (no_neighbor_attr_unchanged
,
2373 no_neighbor_attr_unchanged_cmd
,
2374 NO_NEIGHBOR_CMD2
"attribute-unchanged",
2378 "BGP attribute is propagated unchanged to this neighbor\n")
2380 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2381 bgp_node_safi (vty
),
2382 (PEER_FLAG_AS_PATH_UNCHANGED
|
2383 PEER_FLAG_NEXTHOP_UNCHANGED
|
2384 PEER_FLAG_MED_UNCHANGED
));
2387 DEFUN (no_neighbor_attr_unchanged1
,
2388 no_neighbor_attr_unchanged1_cmd
,
2389 NO_NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2393 "BGP attribute is propagated unchanged to this neighbor\n"
2394 "As-path attribute\n"
2395 "Nexthop attribute\n"
2398 u_int16_t flags
= 0;
2400 if (strncmp (argv
[1], "as-path", 1) == 0)
2401 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2402 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2403 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2404 else if (strncmp (argv
[1], "med", 1) == 0)
2405 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2407 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2408 bgp_node_safi (vty
), flags
);
2411 DEFUN (no_neighbor_attr_unchanged2
,
2412 no_neighbor_attr_unchanged2_cmd
,
2413 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2417 "BGP attribute is propagated unchanged to this neighbor\n"
2418 "As-path attribute\n"
2419 "Nexthop attribute\n"
2422 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2424 if (strncmp (argv
[1], "next-hop", 1) == 0)
2425 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2426 else if (strncmp (argv
[1], "med", 1) == 0)
2427 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2429 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2430 bgp_node_safi (vty
), flags
);
2433 DEFUN (no_neighbor_attr_unchanged3
,
2434 no_neighbor_attr_unchanged3_cmd
,
2435 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2439 "BGP attribute is propagated unchanged to this neighbor\n"
2440 "Nexthop attribute\n"
2441 "As-path attribute\n"
2444 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2446 if (strncmp (argv
[1], "as-path", 1) == 0)
2447 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2448 else if (strncmp (argv
[1], "med", 1) == 0)
2449 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2451 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2452 bgp_node_safi (vty
), flags
);
2455 DEFUN (no_neighbor_attr_unchanged4
,
2456 no_neighbor_attr_unchanged4_cmd
,
2457 NO_NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2461 "BGP attribute is propagated unchanged to this neighbor\n"
2463 "As-path attribute\n"
2464 "Nexthop attribute\n")
2466 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2468 if (strncmp (argv
[1], "as-path", 1) == 0)
2469 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2470 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2471 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2473 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2474 bgp_node_safi (vty
), flags
);
2477 ALIAS (no_neighbor_attr_unchanged
,
2478 no_neighbor_attr_unchanged5_cmd
,
2479 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2483 "BGP attribute is propagated unchanged to this neighbor\n"
2484 "As-path attribute\n"
2485 "Nexthop attribute\n"
2488 ALIAS (no_neighbor_attr_unchanged
,
2489 no_neighbor_attr_unchanged6_cmd
,
2490 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2494 "BGP attribute is propagated unchanged to this neighbor\n"
2495 "As-path attribute\n"
2497 "Nexthop attribute\n")
2499 ALIAS (no_neighbor_attr_unchanged
,
2500 no_neighbor_attr_unchanged7_cmd
,
2501 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2505 "BGP attribute is propagated unchanged to this neighbor\n"
2506 "Nexthop attribute\n"
2508 "As-path attribute\n")
2510 ALIAS (no_neighbor_attr_unchanged
,
2511 no_neighbor_attr_unchanged8_cmd
,
2512 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2516 "BGP attribute is propagated unchanged to this neighbor\n"
2517 "Nexthop attribute\n"
2518 "As-path attribute\n"
2521 ALIAS (no_neighbor_attr_unchanged
,
2522 no_neighbor_attr_unchanged9_cmd
,
2523 NO_NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2527 "BGP attribute is propagated unchanged to this neighbor\n"
2529 "Nexthop attribute\n"
2530 "As-path attribute\n")
2532 ALIAS (no_neighbor_attr_unchanged
,
2533 no_neighbor_attr_unchanged10_cmd
,
2534 NO_NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2538 "BGP attribute is propagated unchanged to this neighbor\n"
2540 "As-path attribute\n"
2541 "Nexthop attribute\n")
2543 /* For old version Zebra compatibility. */
2544 DEFUN_DEPRECATED (neighbor_transparent_as
,
2545 neighbor_transparent_as_cmd
,
2546 NEIGHBOR_CMD
"transparent-as",
2549 "Do not append my AS number even peer is EBGP peer\n")
2551 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2552 bgp_node_safi (vty
),
2553 PEER_FLAG_AS_PATH_UNCHANGED
);
2556 DEFUN_DEPRECATED (neighbor_transparent_nexthop
,
2557 neighbor_transparent_nexthop_cmd
,
2558 NEIGHBOR_CMD
"transparent-nexthop",
2561 "Do not change nexthop even peer is EBGP peer\n")
2563 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2564 bgp_node_safi (vty
),
2565 PEER_FLAG_NEXTHOP_UNCHANGED
);
2568 /* EBGP multihop configuration. */
2570 peer_ebgp_multihop_set_vty (struct vty
*vty
, const char *ip_str
,
2571 const char *ttl_str
)
2576 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2583 VTY_GET_INTEGER_RANGE ("TTL", ttl
, ttl_str
, 1, 255);
2585 peer_ebgp_multihop_set (peer
, ttl
);
2591 peer_ebgp_multihop_unset_vty (struct vty
*vty
, const char *ip_str
)
2595 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2599 peer_ebgp_multihop_unset (peer
);
2604 /* neighbor ebgp-multihop. */
2605 DEFUN (neighbor_ebgp_multihop
,
2606 neighbor_ebgp_multihop_cmd
,
2607 NEIGHBOR_CMD2
"ebgp-multihop",
2610 "Allow EBGP neighbors not on directly connected networks\n")
2612 return peer_ebgp_multihop_set_vty (vty
, argv
[0], NULL
);
2615 DEFUN (neighbor_ebgp_multihop_ttl
,
2616 neighbor_ebgp_multihop_ttl_cmd
,
2617 NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2620 "Allow EBGP neighbors not on directly connected networks\n"
2621 "maximum hop count\n")
2623 return peer_ebgp_multihop_set_vty (vty
, argv
[0], argv
[1]);
2626 DEFUN (no_neighbor_ebgp_multihop
,
2627 no_neighbor_ebgp_multihop_cmd
,
2628 NO_NEIGHBOR_CMD2
"ebgp-multihop",
2632 "Allow EBGP neighbors not on directly connected networks\n")
2634 return peer_ebgp_multihop_unset_vty (vty
, argv
[0]);
2637 ALIAS (no_neighbor_ebgp_multihop
,
2638 no_neighbor_ebgp_multihop_ttl_cmd
,
2639 NO_NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2643 "Allow EBGP neighbors not on directly connected networks\n"
2644 "maximum hop count\n")
2646 /* disable-connected-check */
2647 DEFUN (neighbor_disable_connected_check
,
2648 neighbor_disable_connected_check_cmd
,
2649 NEIGHBOR_CMD2
"disable-connected-check",
2652 "one-hop away EBGP peer using loopback address\n")
2654 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
2657 DEFUN (no_neighbor_disable_connected_check
,
2658 no_neighbor_disable_connected_check_cmd
,
2659 NO_NEIGHBOR_CMD2
"disable-connected-check",
2663 "one-hop away EBGP peer using loopback address\n")
2665 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
2668 /* Enforce multihop. */
2669 ALIAS (neighbor_disable_connected_check
,
2670 neighbor_enforce_multihop_cmd
,
2671 NEIGHBOR_CMD2
"enforce-multihop",
2674 "Enforce EBGP neighbors perform multihop\n");
2676 /* Enforce multihop. */
2677 ALIAS (no_neighbor_disable_connected_check
,
2678 no_neighbor_enforce_multihop_cmd
,
2679 NO_NEIGHBOR_CMD2
"enforce-multihop",
2683 "Enforce EBGP neighbors perform multihop\n");
2685 DEFUN (neighbor_description
,
2686 neighbor_description_cmd
,
2687 NEIGHBOR_CMD2
"description .LINE",
2690 "Neighbor specific description\n"
2691 "Up to 80 characters describing this neighbor\n")
2696 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2703 str
= argv_concat(argv
, argc
, 1);
2705 peer_description_set (peer
, str
);
2707 XFREE (MTYPE_TMP
, str
);
2712 DEFUN (no_neighbor_description
,
2713 no_neighbor_description_cmd
,
2714 NO_NEIGHBOR_CMD2
"description",
2718 "Neighbor specific description\n")
2722 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2726 peer_description_unset (peer
);
2731 ALIAS (no_neighbor_description
,
2732 no_neighbor_description_val_cmd
,
2733 NO_NEIGHBOR_CMD2
"description .LINE",
2737 "Neighbor specific description\n"
2738 "Up to 80 characters describing this neighbor\n")
2740 /* Neighbor update-source. */
2742 peer_update_source_vty (struct vty
*vty
, const char *peer_str
,
2743 const char *source_str
)
2746 union sockunion
*su
;
2748 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2754 su
= sockunion_str2su (source_str
);
2757 peer_update_source_addr_set (peer
, su
);
2758 sockunion_free (su
);
2761 peer_update_source_if_set (peer
, source_str
);
2764 peer_update_source_unset (peer
);
2769 DEFUN (neighbor_update_source
,
2770 neighbor_update_source_cmd
,
2771 NEIGHBOR_CMD2
"update-source WORD",
2774 "Source of routing updates\n"
2777 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
2780 DEFUN (no_neighbor_update_source
,
2781 no_neighbor_update_source_cmd
,
2782 NO_NEIGHBOR_CMD2
"update-source",
2786 "Source of routing updates\n"
2789 return peer_update_source_vty (vty
, argv
[0], NULL
);
2793 peer_default_originate_set_vty (struct vty
*vty
, const char *peer_str
,
2794 afi_t afi
, safi_t safi
,
2795 const char *rmap
, int set
)
2800 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2805 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
2807 ret
= peer_default_originate_unset (peer
, afi
, safi
);
2809 return bgp_vty_return (vty
, ret
);
2812 /* neighbor default-originate. */
2813 DEFUN (neighbor_default_originate
,
2814 neighbor_default_originate_cmd
,
2815 NEIGHBOR_CMD2
"default-originate",
2818 "Originate default route to this neighbor\n")
2820 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2821 bgp_node_safi (vty
), NULL
, 1);
2824 DEFUN (neighbor_default_originate_rmap
,
2825 neighbor_default_originate_rmap_cmd
,
2826 NEIGHBOR_CMD2
"default-originate route-map WORD",
2829 "Originate default route to this neighbor\n"
2830 "Route-map to specify criteria to originate default\n"
2833 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2834 bgp_node_safi (vty
), argv
[1], 1);
2837 DEFUN (no_neighbor_default_originate
,
2838 no_neighbor_default_originate_cmd
,
2839 NO_NEIGHBOR_CMD2
"default-originate",
2843 "Originate default route to this neighbor\n")
2845 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2846 bgp_node_safi (vty
), NULL
, 0);
2849 ALIAS (no_neighbor_default_originate
,
2850 no_neighbor_default_originate_rmap_cmd
,
2851 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
2855 "Originate default route to this neighbor\n"
2856 "Route-map to specify criteria to originate default\n"
2859 /* Set neighbor's BGP port. */
2861 peer_port_vty (struct vty
*vty
, const char *ip_str
, int afi
,
2862 const char *port_str
)
2868 peer
= peer_lookup_vty (vty
, ip_str
);
2874 sp
= getservbyname ("bgp", "tcp");
2875 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
2879 VTY_GET_INTEGER("port", port
, port_str
);
2882 peer_port_set (peer
, port
);
2887 /* Set specified peer's BGP port. */
2888 DEFUN (neighbor_port
,
2890 NEIGHBOR_CMD
"port <0-65535>",
2893 "Neighbor's BGP port\n"
2894 "TCP port number\n")
2896 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
2899 DEFUN (no_neighbor_port
,
2900 no_neighbor_port_cmd
,
2901 NO_NEIGHBOR_CMD
"port",
2905 "Neighbor's BGP port\n")
2907 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
2910 ALIAS (no_neighbor_port
,
2911 no_neighbor_port_val_cmd
,
2912 NO_NEIGHBOR_CMD
"port <0-65535>",
2916 "Neighbor's BGP port\n"
2917 "TCP port number\n")
2919 /* neighbor weight. */
2921 peer_weight_set_vty (struct vty
*vty
, const char *ip_str
,
2922 const char *weight_str
)
2926 unsigned long weight
;
2928 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2932 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
2934 ret
= peer_weight_set (peer
, weight
);
2940 peer_weight_unset_vty (struct vty
*vty
, const char *ip_str
)
2944 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2948 peer_weight_unset (peer
);
2953 DEFUN (neighbor_weight
,
2954 neighbor_weight_cmd
,
2955 NEIGHBOR_CMD2
"weight <0-65535>",
2958 "Set default weight for routes from this neighbor\n"
2961 return peer_weight_set_vty (vty
, argv
[0], argv
[1]);
2964 DEFUN (no_neighbor_weight
,
2965 no_neighbor_weight_cmd
,
2966 NO_NEIGHBOR_CMD2
"weight",
2970 "Set default weight for routes from this neighbor\n")
2972 return peer_weight_unset_vty (vty
, argv
[0]);
2975 ALIAS (no_neighbor_weight
,
2976 no_neighbor_weight_val_cmd
,
2977 NO_NEIGHBOR_CMD2
"weight <0-65535>",
2981 "Set default weight for routes from this neighbor\n"
2984 /* Override capability negotiation. */
2985 DEFUN (neighbor_override_capability
,
2986 neighbor_override_capability_cmd
,
2987 NEIGHBOR_CMD2
"override-capability",
2990 "Override capability negotiation result\n")
2992 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
2995 DEFUN (no_neighbor_override_capability
,
2996 no_neighbor_override_capability_cmd
,
2997 NO_NEIGHBOR_CMD2
"override-capability",
3001 "Override capability negotiation result\n")
3003 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
3006 DEFUN (neighbor_strict_capability
,
3007 neighbor_strict_capability_cmd
,
3008 NEIGHBOR_CMD
"strict-capability-match",
3011 "Strict capability negotiation match\n")
3013 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
3016 DEFUN (no_neighbor_strict_capability
,
3017 no_neighbor_strict_capability_cmd
,
3018 NO_NEIGHBOR_CMD
"strict-capability-match",
3022 "Strict capability negotiation match\n")
3024 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
3028 peer_timers_set_vty (struct vty
*vty
, const char *ip_str
,
3029 const char *keep_str
, const char *hold_str
)
3033 u_int32_t keepalive
;
3036 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3040 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
3041 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
3043 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
3045 return bgp_vty_return (vty
, ret
);
3049 peer_timers_unset_vty (struct vty
*vty
, const char *ip_str
)
3054 peer
= peer_lookup_vty (vty
, ip_str
);
3058 ret
= peer_timers_unset (peer
);
3060 return bgp_vty_return (vty
, ret
);
3063 DEFUN (neighbor_timers
,
3064 neighbor_timers_cmd
,
3065 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
3068 "BGP per neighbor timers\n"
3069 "Keepalive interval\n"
3072 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
3075 DEFUN (no_neighbor_timers
,
3076 no_neighbor_timers_cmd
,
3077 NO_NEIGHBOR_CMD2
"timers",
3081 "BGP per neighbor timers\n")
3083 return peer_timers_unset_vty (vty
, argv
[0]);
3087 peer_timers_connect_set_vty (struct vty
*vty
, const char *ip_str
,
3088 const char *time_str
)
3094 peer
= peer_lookup_vty (vty
, ip_str
);
3098 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
3100 ret
= peer_timers_connect_set (peer
, connect
);
3106 peer_timers_connect_unset_vty (struct vty
*vty
, const char *ip_str
)
3111 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3115 ret
= peer_timers_connect_unset (peer
);
3120 DEFUN (neighbor_timers_connect
,
3121 neighbor_timers_connect_cmd
,
3122 NEIGHBOR_CMD
"timers connect <0-65535>",
3125 "BGP per neighbor timers\n"
3126 "BGP connect timer\n"
3129 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
3132 DEFUN (no_neighbor_timers_connect
,
3133 no_neighbor_timers_connect_cmd
,
3134 NO_NEIGHBOR_CMD
"timers connect",
3138 "BGP per neighbor timers\n"
3139 "BGP connect timer\n")
3141 return peer_timers_connect_unset_vty (vty
, argv
[0]);
3144 ALIAS (no_neighbor_timers_connect
,
3145 no_neighbor_timers_connect_val_cmd
,
3146 NO_NEIGHBOR_CMD
"timers connect <0-65535>",
3150 "BGP per neighbor timers\n"
3151 "BGP connect timer\n"
3155 peer_advertise_interval_vty (struct vty
*vty
, const char *ip_str
,
3156 const char *time_str
, int set
)
3160 u_int32_t routeadv
= 0;
3162 peer
= peer_lookup_vty (vty
, ip_str
);
3167 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
3170 ret
= peer_advertise_interval_set (peer
, routeadv
);
3172 ret
= peer_advertise_interval_unset (peer
);
3177 DEFUN (neighbor_advertise_interval
,
3178 neighbor_advertise_interval_cmd
,
3179 NEIGHBOR_CMD
"advertisement-interval <0-600>",
3182 "Minimum interval between sending BGP routing updates\n"
3183 "time in seconds\n")
3185 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
3188 DEFUN (no_neighbor_advertise_interval
,
3189 no_neighbor_advertise_interval_cmd
,
3190 NO_NEIGHBOR_CMD
"advertisement-interval",
3194 "Minimum interval between sending BGP routing updates\n")
3196 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
3199 ALIAS (no_neighbor_advertise_interval
,
3200 no_neighbor_advertise_interval_val_cmd
,
3201 NO_NEIGHBOR_CMD
"advertisement-interval <0-600>",
3205 "Minimum interval between sending BGP routing updates\n"
3206 "time in seconds\n")
3208 /* neighbor interface */
3210 peer_interface_vty (struct vty
*vty
, const char *ip_str
, const char *str
)
3215 peer
= peer_lookup_vty (vty
, ip_str
);
3220 ret
= peer_interface_set (peer
, str
);
3222 ret
= peer_interface_unset (peer
);
3227 DEFUN (neighbor_interface
,
3228 neighbor_interface_cmd
,
3229 NEIGHBOR_CMD
"interface WORD",
3235 return peer_interface_vty (vty
, argv
[0], argv
[1]);
3238 DEFUN (no_neighbor_interface
,
3239 no_neighbor_interface_cmd
,
3240 NO_NEIGHBOR_CMD
"interface WORD",
3247 return peer_interface_vty (vty
, argv
[0], NULL
);
3250 /* Set distribute list to the peer. */
3252 peer_distribute_set_vty (struct vty
*vty
, const char *ip_str
,
3253 afi_t afi
, safi_t safi
,
3254 const char *name_str
, const char *direct_str
)
3258 int direct
= FILTER_IN
;
3260 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3264 /* Check filter direction. */
3265 if (strncmp (direct_str
, "i", 1) == 0)
3267 else if (strncmp (direct_str
, "o", 1) == 0)
3268 direct
= FILTER_OUT
;
3270 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
3272 return bgp_vty_return (vty
, ret
);
3276 peer_distribute_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3277 safi_t safi
, const char *direct_str
)
3281 int direct
= FILTER_IN
;
3283 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3287 /* Check filter direction. */
3288 if (strncmp (direct_str
, "i", 1) == 0)
3290 else if (strncmp (direct_str
, "o", 1) == 0)
3291 direct
= FILTER_OUT
;
3293 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
3295 return bgp_vty_return (vty
, ret
);
3298 DEFUN (neighbor_distribute_list
,
3299 neighbor_distribute_list_cmd
,
3300 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3303 "Filter updates to/from this neighbor\n"
3304 "IP access-list number\n"
3305 "IP access-list number (expanded range)\n"
3306 "IP Access-list name\n"
3307 "Filter incoming updates\n"
3308 "Filter outgoing updates\n")
3310 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3311 bgp_node_safi (vty
), argv
[1], argv
[2]);
3314 DEFUN (no_neighbor_distribute_list
,
3315 no_neighbor_distribute_list_cmd
,
3316 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3320 "Filter updates to/from this neighbor\n"
3321 "IP access-list number\n"
3322 "IP access-list number (expanded range)\n"
3323 "IP Access-list name\n"
3324 "Filter incoming updates\n"
3325 "Filter outgoing updates\n")
3327 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3328 bgp_node_safi (vty
), argv
[2]);
3331 /* Set prefix list to the peer. */
3333 peer_prefix_list_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3334 safi_t safi
, const char *name_str
,
3335 const char *direct_str
)
3339 int direct
= FILTER_IN
;
3341 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3345 /* Check filter direction. */
3346 if (strncmp (direct_str
, "i", 1) == 0)
3348 else if (strncmp (direct_str
, "o", 1) == 0)
3349 direct
= FILTER_OUT
;
3351 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
3353 return bgp_vty_return (vty
, ret
);
3357 peer_prefix_list_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3358 safi_t safi
, const char *direct_str
)
3362 int direct
= FILTER_IN
;
3364 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3368 /* Check filter direction. */
3369 if (strncmp (direct_str
, "i", 1) == 0)
3371 else if (strncmp (direct_str
, "o", 1) == 0)
3372 direct
= FILTER_OUT
;
3374 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
3376 return bgp_vty_return (vty
, ret
);
3379 DEFUN (neighbor_prefix_list
,
3380 neighbor_prefix_list_cmd
,
3381 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3384 "Filter updates to/from this neighbor\n"
3385 "Name of a prefix list\n"
3386 "Filter incoming updates\n"
3387 "Filter outgoing updates\n")
3389 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3390 bgp_node_safi (vty
), argv
[1], argv
[2]);
3393 DEFUN (no_neighbor_prefix_list
,
3394 no_neighbor_prefix_list_cmd
,
3395 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3399 "Filter updates to/from this neighbor\n"
3400 "Name of a prefix list\n"
3401 "Filter incoming updates\n"
3402 "Filter outgoing updates\n")
3404 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3405 bgp_node_safi (vty
), argv
[2]);
3409 peer_aslist_set_vty (struct vty
*vty
, const char *ip_str
,
3410 afi_t afi
, safi_t safi
,
3411 const char *name_str
, const char *direct_str
)
3415 int direct
= FILTER_IN
;
3417 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3421 /* Check filter direction. */
3422 if (strncmp (direct_str
, "i", 1) == 0)
3424 else if (strncmp (direct_str
, "o", 1) == 0)
3425 direct
= FILTER_OUT
;
3427 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
3429 return bgp_vty_return (vty
, ret
);
3433 peer_aslist_unset_vty (struct vty
*vty
, const char *ip_str
,
3434 afi_t afi
, safi_t safi
,
3435 const char *direct_str
)
3439 int direct
= FILTER_IN
;
3441 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3445 /* Check filter direction. */
3446 if (strncmp (direct_str
, "i", 1) == 0)
3448 else if (strncmp (direct_str
, "o", 1) == 0)
3449 direct
= FILTER_OUT
;
3451 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
3453 return bgp_vty_return (vty
, ret
);
3456 DEFUN (neighbor_filter_list
,
3457 neighbor_filter_list_cmd
,
3458 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3461 "Establish BGP filters\n"
3462 "AS path access-list name\n"
3463 "Filter incoming routes\n"
3464 "Filter outgoing routes\n")
3466 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3467 bgp_node_safi (vty
), argv
[1], argv
[2]);
3470 DEFUN (no_neighbor_filter_list
,
3471 no_neighbor_filter_list_cmd
,
3472 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3476 "Establish BGP filters\n"
3477 "AS path access-list name\n"
3478 "Filter incoming routes\n"
3479 "Filter outgoing routes\n")
3481 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3482 bgp_node_safi (vty
), argv
[2]);
3485 /* Set route-map to the peer. */
3487 peer_route_map_set_vty (struct vty
*vty
, const char *ip_str
,
3488 afi_t afi
, safi_t safi
,
3489 const char *name_str
, const char *direct_str
)
3493 int direct
= RMAP_IN
;
3495 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3499 /* Check filter direction. */
3500 if (strncmp (direct_str
, "in", 2) == 0)
3502 else if (strncmp (direct_str
, "o", 1) == 0)
3504 else if (strncmp (direct_str
, "im", 2) == 0)
3505 direct
= RMAP_IMPORT
;
3506 else if (strncmp (direct_str
, "e", 1) == 0)
3507 direct
= RMAP_EXPORT
;
3509 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
3511 return bgp_vty_return (vty
, ret
);
3515 peer_route_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3516 safi_t safi
, const char *direct_str
)
3520 int direct
= RMAP_IN
;
3522 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3526 /* Check filter direction. */
3527 if (strncmp (direct_str
, "in", 2) == 0)
3529 else if (strncmp (direct_str
, "o", 1) == 0)
3531 else if (strncmp (direct_str
, "im", 2) == 0)
3532 direct
= RMAP_IMPORT
;
3533 else if (strncmp (direct_str
, "e", 1) == 0)
3534 direct
= RMAP_EXPORT
;
3536 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
3538 return bgp_vty_return (vty
, ret
);
3541 DEFUN (neighbor_route_map
,
3542 neighbor_route_map_cmd
,
3543 NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3546 "Apply route map to neighbor\n"
3547 "Name of route map\n"
3548 "Apply map to incoming routes\n"
3549 "Apply map to outbound routes\n"
3550 "Apply map to routes going into a Route-Server client's table\n"
3551 "Apply map to routes coming from a Route-Server client")
3553 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3554 bgp_node_safi (vty
), argv
[1], argv
[2]);
3557 DEFUN (no_neighbor_route_map
,
3558 no_neighbor_route_map_cmd
,
3559 NO_NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3563 "Apply route map to neighbor\n"
3564 "Name of route map\n"
3565 "Apply map to incoming routes\n"
3566 "Apply map to outbound routes\n"
3567 "Apply map to routes going into a Route-Server client's table\n"
3568 "Apply map to routes coming from a Route-Server client")
3570 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3571 bgp_node_safi (vty
), argv
[2]);
3574 /* Set unsuppress-map to the peer. */
3576 peer_unsuppress_map_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3577 safi_t safi
, const char *name_str
)
3582 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3586 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
3588 return bgp_vty_return (vty
, ret
);
3591 /* Unset route-map from the peer. */
3593 peer_unsuppress_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3599 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3603 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
3605 return bgp_vty_return (vty
, ret
);
3608 DEFUN (neighbor_unsuppress_map
,
3609 neighbor_unsuppress_map_cmd
,
3610 NEIGHBOR_CMD2
"unsuppress-map WORD",
3613 "Route-map to selectively unsuppress suppressed routes\n"
3614 "Name of route map\n")
3616 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3617 bgp_node_safi (vty
), argv
[1]);
3620 DEFUN (no_neighbor_unsuppress_map
,
3621 no_neighbor_unsuppress_map_cmd
,
3622 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
3626 "Route-map to selectively unsuppress suppressed routes\n"
3627 "Name of route map\n")
3629 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3630 bgp_node_safi (vty
));
3634 peer_maximum_prefix_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3635 safi_t safi
, const char *num_str
,
3636 const char *threshold_str
, int warning
,
3637 const char *restart_str
)
3645 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3649 VTY_GET_INTEGER ("maxmum number", max
, num_str
);
3651 threshold
= atoi (threshold_str
);
3653 threshold
= MAXIMUM_PREFIX_THRESHOLD_DEFAULT
;
3656 restart
= atoi (restart_str
);
3660 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, threshold
, warning
, restart
);
3662 return bgp_vty_return (vty
, ret
);
3666 peer_maximum_prefix_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3672 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3676 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
3678 return bgp_vty_return (vty
, ret
);
3681 /* Maximum number of prefix configuration. prefix count is different
3682 for each peer configuration. So this configuration can be set for
3683 each peer configuration. */
3684 DEFUN (neighbor_maximum_prefix
,
3685 neighbor_maximum_prefix_cmd
,
3686 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3689 "Maximum number of prefix accept from this peer\n"
3690 "maximum no. of prefix limit\n")
3692 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3693 bgp_node_safi (vty
), argv
[1], NULL
, 0,
3697 DEFUN (neighbor_maximum_prefix_threshold
,
3698 neighbor_maximum_prefix_threshold_cmd
,
3699 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
3702 "Maximum number of prefix accept from this peer\n"
3703 "maximum no. of prefix limit\n"
3704 "Threshold value (%) at which to generate a warning msg\n")
3706 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3707 bgp_node_safi (vty
), argv
[1], argv
[2], 0,
3711 DEFUN (neighbor_maximum_prefix_warning
,
3712 neighbor_maximum_prefix_warning_cmd
,
3713 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3716 "Maximum number of prefix accept from this peer\n"
3717 "maximum no. of prefix limit\n"
3718 "Only give warning message when limit is exceeded\n")
3720 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3721 bgp_node_safi (vty
), argv
[1], NULL
, 1,
3725 DEFUN (neighbor_maximum_prefix_threshold_warning
,
3726 neighbor_maximum_prefix_threshold_warning_cmd
,
3727 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3730 "Maximum number of prefix accept from this peer\n"
3731 "maximum no. of prefix limit\n"
3732 "Threshold value (%) at which to generate a warning msg\n"
3733 "Only give warning message when limit is exceeded\n")
3735 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3736 bgp_node_safi (vty
), argv
[1], argv
[2], 1, NULL
);
3739 DEFUN (neighbor_maximum_prefix_restart
,
3740 neighbor_maximum_prefix_restart_cmd
,
3741 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
3744 "Maximum number of prefix accept from this peer\n"
3745 "maximum no. of prefix limit\n"
3746 "Restart bgp connection after limit is exceeded\n"
3747 "Restart interval in minutes")
3749 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3750 bgp_node_safi (vty
), argv
[1], NULL
, 0, argv
[2]);
3753 DEFUN (neighbor_maximum_prefix_threshold_restart
,
3754 neighbor_maximum_prefix_threshold_restart_cmd
,
3755 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
3758 "Maximum number of prefix accept from this peer\n"
3759 "maximum no. of prefix limit\n"
3760 "Threshold value (%) at which to generate a warning msg\n"
3761 "Restart bgp connection after limit is exceeded\n"
3762 "Restart interval in minutes")
3764 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3765 bgp_node_safi (vty
), argv
[1], argv
[2], 0, argv
[3]);
3768 DEFUN (no_neighbor_maximum_prefix
,
3769 no_neighbor_maximum_prefix_cmd
,
3770 NO_NEIGHBOR_CMD2
"maximum-prefix",
3774 "Maximum number of prefix accept from this peer\n")
3776 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3777 bgp_node_safi (vty
));
3780 ALIAS (no_neighbor_maximum_prefix
,
3781 no_neighbor_maximum_prefix_val_cmd
,
3782 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3786 "Maximum number of prefix accept from this peer\n"
3787 "maximum no. of prefix limit\n")
3789 ALIAS (no_neighbor_maximum_prefix
,
3790 no_neighbor_maximum_prefix_threshold_cmd
,
3791 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3795 "Maximum number of prefix accept from this peer\n"
3796 "maximum no. of prefix limit\n"
3797 "Threshold value (%) at which to generate a warning msg\n")
3799 ALIAS (no_neighbor_maximum_prefix
,
3800 no_neighbor_maximum_prefix_warning_cmd
,
3801 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3805 "Maximum number of prefix accept from this peer\n"
3806 "maximum no. of prefix limit\n"
3807 "Only give warning message when limit is exceeded\n");
3809 ALIAS (no_neighbor_maximum_prefix
,
3810 no_neighbor_maximum_prefix_threshold_warning_cmd
,
3811 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3815 "Maximum number of prefix accept from this peer\n"
3816 "maximum no. of prefix limit\n"
3817 "Threshold value (%) at which to generate a warning msg\n"
3818 "Only give warning message when limit is exceeded\n");
3820 ALIAS (no_neighbor_maximum_prefix
,
3821 no_neighbor_maximum_prefix_restart_cmd
,
3822 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
3826 "Maximum number of prefix accept from this peer\n"
3827 "maximum no. of prefix limit\n"
3828 "Restart bgp connection after limit is exceeded\n"
3829 "Restart interval in minutes")
3831 ALIAS (no_neighbor_maximum_prefix
,
3832 no_neighbor_maximum_prefix_threshold_restart_cmd
,
3833 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
3837 "Maximum number of prefix accept from this peer\n"
3838 "maximum no. of prefix limit\n"
3839 "Threshold value (%) at which to generate a warning msg\n"
3840 "Restart bgp connection after limit is exceeded\n"
3841 "Restart interval in minutes")
3843 /* "neighbor allowas-in" */
3844 DEFUN (neighbor_allowas_in
,
3845 neighbor_allowas_in_cmd
,
3846 NEIGHBOR_CMD2
"allowas-in",
3849 "Accept as-path with my AS present in it\n")
3853 unsigned int allow_num
;
3855 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3862 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
3864 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
3867 return bgp_vty_return (vty
, ret
);
3870 ALIAS (neighbor_allowas_in
,
3871 neighbor_allowas_in_arg_cmd
,
3872 NEIGHBOR_CMD2
"allowas-in <1-10>",
3875 "Accept as-path with my AS present in it\n"
3876 "Number of occurances of AS number\n")
3878 DEFUN (no_neighbor_allowas_in
,
3879 no_neighbor_allowas_in_cmd
,
3880 NO_NEIGHBOR_CMD2
"allowas-in",
3884 "allow local ASN appears in aspath attribute\n")
3889 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3893 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3895 return bgp_vty_return (vty
, ret
);
3898 /* Address family configuration. */
3899 DEFUN (address_family_ipv4
,
3900 address_family_ipv4_cmd
,
3901 "address-family ipv4",
3902 "Enter Address Family command mode\n"
3905 vty
->node
= BGP_IPV4_NODE
;
3909 DEFUN (address_family_ipv4_safi
,
3910 address_family_ipv4_safi_cmd
,
3911 "address-family ipv4 (unicast|multicast)",
3912 "Enter Address Family command mode\n"
3914 "Address Family modifier\n"
3915 "Address Family modifier\n")
3917 if (strncmp (argv
[0], "m", 1) == 0)
3918 vty
->node
= BGP_IPV4M_NODE
;
3920 vty
->node
= BGP_IPV4_NODE
;
3925 DEFUN (address_family_ipv6
,
3926 address_family_ipv6_cmd
,
3927 "address-family ipv6",
3928 "Enter Address Family command mode\n"
3931 vty
->node
= BGP_IPV6_NODE
;
3935 DEFUN (address_family_ipv6_safi
,
3936 address_family_ipv6_safi_cmd
,
3937 "address-family ipv6 (unicast|multicast)",
3938 "Enter Address Family command mode\n"
3940 "Address Family modifier\n"
3941 "Address Family modifier\n")
3943 if (strncmp (argv
[0], "m", 1) == 0)
3944 vty
->node
= BGP_IPV6M_NODE
;
3946 vty
->node
= BGP_IPV6_NODE
;
3951 DEFUN (address_family_vpnv4
,
3952 address_family_vpnv4_cmd
,
3953 "address-family vpnv4",
3954 "Enter Address Family command mode\n"
3957 vty
->node
= BGP_VPNV4_NODE
;
3961 ALIAS (address_family_vpnv4
,
3962 address_family_vpnv4_unicast_cmd
,
3963 "address-family vpnv4 unicast",
3964 "Enter Address Family command mode\n"
3966 "Address Family Modifier\n")
3968 DEFUN (exit_address_family
,
3969 exit_address_family_cmd
,
3970 "exit-address-family",
3971 "Exit from Address Family configuration mode\n")
3973 if (vty
->node
== BGP_IPV4_NODE
3974 || vty
->node
== BGP_IPV4M_NODE
3975 || vty
->node
== BGP_VPNV4_NODE
3976 || vty
->node
== BGP_IPV6_NODE
3977 || vty
->node
== BGP_IPV6M_NODE
)
3978 vty
->node
= BGP_NODE
;
3982 /* BGP clear sort. */
3993 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
3994 safi_t safi
, int error
)
3998 case BGP_ERR_AF_UNCONFIGURED
:
4000 "%%BGP: Enable %s %s address family for the neighbor %s%s",
4001 afi
== AFI_IP6
? "IPv6" : safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
4002 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
4003 peer
->host
, VTY_NEWLINE
);
4005 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
4006 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
);
4013 /* `clear ip bgp' functions. */
4015 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
4016 enum clear_sort sort
,enum bgp_clear_type stype
, const char *arg
)
4020 struct listnode
*node
, *nnode
;
4022 /* Clear all neighbors. */
4023 if (sort
== clear_all
)
4025 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4027 if (stype
== BGP_CLEAR_SOFT_NONE
)
4028 ret
= peer_clear (peer
);
4030 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4033 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4038 /* Clear specified neighbors. */
4039 if (sort
== clear_peer
)
4044 /* Make sockunion for lookup. */
4045 ret
= str2sockunion (arg
, &su
);
4048 vty_out (vty
, "Malformed address: %s%s", arg
, VTY_NEWLINE
);
4051 peer
= peer_lookup (bgp
, &su
);
4054 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
4058 if (stype
== BGP_CLEAR_SOFT_NONE
)
4059 ret
= peer_clear (peer
);
4061 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4064 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4069 /* Clear all peer-group members. */
4070 if (sort
== clear_group
)
4072 struct peer_group
*group
;
4074 group
= peer_group_lookup (bgp
, arg
);
4077 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
4081 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
4083 if (stype
== BGP_CLEAR_SOFT_NONE
)
4085 ret
= peer_clear (peer
);
4089 if (! peer
->af_group
[afi
][safi
])
4092 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4095 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4100 if (sort
== clear_external
)
4102 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4104 if (peer_sort (peer
) == BGP_PEER_IBGP
)
4107 if (stype
== BGP_CLEAR_SOFT_NONE
)
4108 ret
= peer_clear (peer
);
4110 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4113 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4118 if (sort
== clear_as
)
4121 unsigned long as_ul
;
4122 char *endptr
= NULL
;
4125 as_ul
= strtoul(arg
, &endptr
, 10);
4127 if ((as_ul
== ULONG_MAX
) || (*endptr
!= '\0') || (as_ul
> USHRT_MAX
))
4129 vty_out (vty
, "Invalid AS number%s", VTY_NEWLINE
);
4134 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4140 if (stype
== BGP_CLEAR_SOFT_NONE
)
4141 ret
= peer_clear (peer
);
4143 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4146 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4149 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
4158 bgp_clear_vty (struct vty
*vty
, const char *name
, afi_t afi
, safi_t safi
,
4159 enum clear_sort sort
, enum bgp_clear_type stype
,
4165 /* BGP structure lookup. */
4168 bgp
= bgp_lookup_by_name (name
);
4171 vty_out (vty
, "Can't find BGP view %s%s", name
, VTY_NEWLINE
);
4177 bgp
= bgp_get_default ();
4180 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
4185 ret
= bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
4192 DEFUN (clear_ip_bgp_all
,
4193 clear_ip_bgp_all_cmd
,
4198 "Clear all peers\n")
4201 return bgp_clear_vty (vty
, argv
[0], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4203 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4206 ALIAS (clear_ip_bgp_all
,
4211 "Clear all peers\n")
4213 ALIAS (clear_ip_bgp_all
,
4214 clear_bgp_ipv6_all_cmd
,
4219 "Clear all peers\n")
4221 ALIAS (clear_ip_bgp_all
,
4222 clear_ip_bgp_instance_all_cmd
,
4223 "clear ip bgp view WORD *",
4229 "Clear all peers\n")
4231 ALIAS (clear_ip_bgp_all
,
4232 clear_bgp_instance_all_cmd
,
4233 "clear bgp view WORD *",
4238 "Clear all peers\n")
4240 DEFUN (clear_ip_bgp_peer
,
4241 clear_ip_bgp_peer_cmd
,
4242 "clear ip bgp (A.B.C.D|X:X::X:X)",
4246 "BGP neighbor IP address to clear\n"
4247 "BGP IPv6 neighbor to clear\n")
4249 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4252 ALIAS (clear_ip_bgp_peer
,
4254 "clear bgp (A.B.C.D|X:X::X:X)",
4257 "BGP neighbor address to clear\n"
4258 "BGP IPv6 neighbor to clear\n")
4260 ALIAS (clear_ip_bgp_peer
,
4261 clear_bgp_ipv6_peer_cmd
,
4262 "clear bgp ipv6 (A.B.C.D|X:X::X:X)",
4266 "BGP neighbor address to clear\n"
4267 "BGP IPv6 neighbor to clear\n")
4269 DEFUN (clear_ip_bgp_peer_group
,
4270 clear_ip_bgp_peer_group_cmd
,
4271 "clear ip bgp peer-group WORD",
4275 "Clear all members of peer-group\n"
4276 "BGP peer-group name\n")
4278 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4281 ALIAS (clear_ip_bgp_peer_group
,
4282 clear_bgp_peer_group_cmd
,
4283 "clear bgp peer-group WORD",
4286 "Clear all members of peer-group\n"
4287 "BGP peer-group name\n")
4289 ALIAS (clear_ip_bgp_peer_group
,
4290 clear_bgp_ipv6_peer_group_cmd
,
4291 "clear bgp ipv6 peer-group WORD",
4295 "Clear all members of peer-group\n"
4296 "BGP peer-group name\n")
4298 DEFUN (clear_ip_bgp_external
,
4299 clear_ip_bgp_external_cmd
,
4300 "clear ip bgp external",
4304 "Clear all external peers\n")
4306 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
4309 ALIAS (clear_ip_bgp_external
,
4310 clear_bgp_external_cmd
,
4311 "clear bgp external",
4314 "Clear all external peers\n")
4316 ALIAS (clear_ip_bgp_external
,
4317 clear_bgp_ipv6_external_cmd
,
4318 "clear bgp ipv6 external",
4322 "Clear all external peers\n")
4324 DEFUN (clear_ip_bgp_as
,
4325 clear_ip_bgp_as_cmd
,
4326 "clear ip bgp <1-65535>",
4330 "Clear peers with the AS number\n")
4332 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4335 ALIAS (clear_ip_bgp_as
,
4337 "clear bgp <1-65535>",
4340 "Clear peers with the AS number\n")
4342 ALIAS (clear_ip_bgp_as
,
4343 clear_bgp_ipv6_as_cmd
,
4344 "clear bgp ipv6 <1-65535>",
4348 "Clear peers with the AS number\n")
4350 /* Outbound soft-reconfiguration */
4351 DEFUN (clear_ip_bgp_all_soft_out
,
4352 clear_ip_bgp_all_soft_out_cmd
,
4353 "clear ip bgp * soft out",
4359 "Soft reconfig outbound update\n")
4362 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4363 BGP_CLEAR_SOFT_OUT
, NULL
);
4365 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4366 BGP_CLEAR_SOFT_OUT
, NULL
);
4369 ALIAS (clear_ip_bgp_all_soft_out
,
4370 clear_ip_bgp_all_out_cmd
,
4371 "clear ip bgp * out",
4376 "Soft reconfig outbound update\n")
4378 ALIAS (clear_ip_bgp_all_soft_out
,
4379 clear_ip_bgp_instance_all_soft_out_cmd
,
4380 "clear ip bgp view WORD * soft out",
4388 "Soft reconfig outbound update\n")
4390 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
4391 clear_ip_bgp_all_ipv4_soft_out_cmd
,
4392 "clear ip bgp * ipv4 (unicast|multicast) soft out",
4398 "Address Family modifier\n"
4399 "Address Family modifier\n"
4401 "Soft reconfig outbound update\n")
4403 if (strncmp (argv
[0], "m", 1) == 0)
4404 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4405 BGP_CLEAR_SOFT_OUT
, NULL
);
4407 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4408 BGP_CLEAR_SOFT_OUT
, NULL
);
4411 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
4412 clear_ip_bgp_all_ipv4_out_cmd
,
4413 "clear ip bgp * ipv4 (unicast|multicast) out",
4419 "Address Family modifier\n"
4420 "Address Family modifier\n"
4421 "Soft reconfig outbound update\n")
4423 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
4424 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
4425 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out",
4433 "Address Family modifier\n"
4434 "Address Family modifier\n"
4435 "Soft reconfig outbound update\n")
4437 if (strncmp (argv
[1], "m", 1) == 0)
4438 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4439 BGP_CLEAR_SOFT_OUT
, NULL
);
4441 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4442 BGP_CLEAR_SOFT_OUT
, NULL
);
4445 DEFUN (clear_ip_bgp_all_vpnv4_soft_out
,
4446 clear_ip_bgp_all_vpnv4_soft_out_cmd
,
4447 "clear ip bgp * vpnv4 unicast soft out",
4453 "Address Family Modifier\n"
4455 "Soft reconfig outbound update\n")
4457 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
4458 BGP_CLEAR_SOFT_OUT
, NULL
);
4461 ALIAS (clear_ip_bgp_all_vpnv4_soft_out
,
4462 clear_ip_bgp_all_vpnv4_out_cmd
,
4463 "clear ip bgp * vpnv4 unicast out",
4469 "Address Family Modifier\n"
4470 "Soft reconfig outbound update\n")
4472 DEFUN (clear_bgp_all_soft_out
,
4473 clear_bgp_all_soft_out_cmd
,
4474 "clear bgp * soft out",
4479 "Soft reconfig outbound update\n")
4482 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
4483 BGP_CLEAR_SOFT_OUT
, NULL
);
4485 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
4486 BGP_CLEAR_SOFT_OUT
, NULL
);
4489 ALIAS (clear_bgp_all_soft_out
,
4490 clear_bgp_instance_all_soft_out_cmd
,
4491 "clear bgp view WORD * soft out",
4498 "Soft reconfig outbound update\n")
4500 ALIAS (clear_bgp_all_soft_out
,
4501 clear_bgp_all_out_cmd
,
4506 "Soft reconfig outbound update\n")
4508 ALIAS (clear_bgp_all_soft_out
,
4509 clear_bgp_ipv6_all_soft_out_cmd
,
4510 "clear bgp ipv6 * soft out",
4516 "Soft reconfig outbound update\n")
4518 ALIAS (clear_bgp_all_soft_out
,
4519 clear_bgp_ipv6_all_out_cmd
,
4520 "clear bgp ipv6 * out",
4525 "Soft reconfig outbound update\n")
4527 DEFUN (clear_ip_bgp_peer_soft_out
,
4528 clear_ip_bgp_peer_soft_out_cmd
,
4529 "clear ip bgp A.B.C.D soft out",
4533 "BGP neighbor address to clear\n"
4535 "Soft reconfig outbound update\n")
4537 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4538 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4541 ALIAS (clear_ip_bgp_peer_soft_out
,
4542 clear_ip_bgp_peer_out_cmd
,
4543 "clear ip bgp A.B.C.D out",
4547 "BGP neighbor address to clear\n"
4548 "Soft reconfig outbound update\n")
4550 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
4551 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
4552 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out",
4556 "BGP neighbor address to clear\n"
4558 "Address Family modifier\n"
4559 "Address Family modifier\n"
4561 "Soft reconfig outbound update\n")
4563 if (strncmp (argv
[1], "m", 1) == 0)
4564 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
4565 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4567 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4568 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4571 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
4572 clear_ip_bgp_peer_ipv4_out_cmd
,
4573 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out",
4577 "BGP neighbor address to clear\n"
4579 "Address Family modifier\n"
4580 "Address Family modifier\n"
4581 "Soft reconfig outbound update\n")
4583 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out
,
4584 clear_ip_bgp_peer_vpnv4_soft_out_cmd
,
4585 "clear ip bgp A.B.C.D vpnv4 unicast soft out",
4589 "BGP neighbor address to clear\n"
4591 "Address Family Modifier\n"
4593 "Soft reconfig outbound update\n")
4595 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
4596 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4599 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out
,
4600 clear_ip_bgp_peer_vpnv4_out_cmd
,
4601 "clear ip bgp A.B.C.D vpnv4 unicast out",
4605 "BGP neighbor address to clear\n"
4607 "Address Family Modifier\n"
4608 "Soft reconfig outbound update\n")
4610 DEFUN (clear_bgp_peer_soft_out
,
4611 clear_bgp_peer_soft_out_cmd
,
4612 "clear bgp (A.B.C.D|X:X::X:X) soft out",
4615 "BGP neighbor address to clear\n"
4616 "BGP IPv6 neighbor to clear\n"
4618 "Soft reconfig outbound update\n")
4620 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
4621 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4624 ALIAS (clear_bgp_peer_soft_out
,
4625 clear_bgp_ipv6_peer_soft_out_cmd
,
4626 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out",
4630 "BGP neighbor address to clear\n"
4631 "BGP IPv6 neighbor to clear\n"
4633 "Soft reconfig outbound update\n")
4635 ALIAS (clear_bgp_peer_soft_out
,
4636 clear_bgp_peer_out_cmd
,
4637 "clear bgp (A.B.C.D|X:X::X:X) out",
4640 "BGP neighbor address to clear\n"
4641 "BGP IPv6 neighbor to clear\n"
4642 "Soft reconfig outbound update\n")
4644 ALIAS (clear_bgp_peer_soft_out
,
4645 clear_bgp_ipv6_peer_out_cmd
,
4646 "clear bgp ipv6 (A.B.C.D|X:X::X:X) out",
4650 "BGP neighbor address to clear\n"
4651 "BGP IPv6 neighbor to clear\n"
4652 "Soft reconfig outbound update\n")
4654 DEFUN (clear_ip_bgp_peer_group_soft_out
,
4655 clear_ip_bgp_peer_group_soft_out_cmd
,
4656 "clear ip bgp peer-group WORD soft out",
4660 "Clear all members of peer-group\n"
4661 "BGP peer-group name\n"
4663 "Soft reconfig outbound update\n")
4665 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4666 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4669 ALIAS (clear_ip_bgp_peer_group_soft_out
,
4670 clear_ip_bgp_peer_group_out_cmd
,
4671 "clear ip bgp peer-group WORD out",
4675 "Clear all members of peer-group\n"
4676 "BGP peer-group name\n"
4677 "Soft reconfig outbound update\n")
4679 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
4680 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
4681 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
4685 "Clear all members of peer-group\n"
4686 "BGP peer-group name\n"
4688 "Address Family modifier\n"
4689 "Address Family modifier\n"
4691 "Soft reconfig outbound update\n")
4693 if (strncmp (argv
[1], "m", 1) == 0)
4694 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
4695 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4697 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4698 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4701 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
4702 clear_ip_bgp_peer_group_ipv4_out_cmd
,
4703 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
4707 "Clear all members of peer-group\n"
4708 "BGP peer-group name\n"
4710 "Address Family modifier\n"
4711 "Address Family modifier\n"
4712 "Soft reconfig outbound update\n")
4714 DEFUN (clear_bgp_peer_group_soft_out
,
4715 clear_bgp_peer_group_soft_out_cmd
,
4716 "clear bgp peer-group WORD soft out",
4719 "Clear all members of peer-group\n"
4720 "BGP peer-group name\n"
4722 "Soft reconfig outbound update\n")
4724 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
4725 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4728 ALIAS (clear_bgp_peer_group_soft_out
,
4729 clear_bgp_ipv6_peer_group_soft_out_cmd
,
4730 "clear bgp ipv6 peer-group WORD soft out",
4734 "Clear all members of peer-group\n"
4735 "BGP peer-group name\n"
4737 "Soft reconfig outbound update\n")
4739 ALIAS (clear_bgp_peer_group_soft_out
,
4740 clear_bgp_peer_group_out_cmd
,
4741 "clear bgp peer-group WORD out",
4744 "Clear all members of peer-group\n"
4745 "BGP peer-group name\n"
4746 "Soft reconfig outbound update\n")
4748 ALIAS (clear_bgp_peer_group_soft_out
,
4749 clear_bgp_ipv6_peer_group_out_cmd
,
4750 "clear bgp ipv6 peer-group WORD out",
4754 "Clear all members of peer-group\n"
4755 "BGP peer-group name\n"
4756 "Soft reconfig outbound update\n")
4758 DEFUN (clear_ip_bgp_external_soft_out
,
4759 clear_ip_bgp_external_soft_out_cmd
,
4760 "clear ip bgp external soft out",
4764 "Clear all external peers\n"
4766 "Soft reconfig outbound update\n")
4768 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4769 BGP_CLEAR_SOFT_OUT
, NULL
);
4772 ALIAS (clear_ip_bgp_external_soft_out
,
4773 clear_ip_bgp_external_out_cmd
,
4774 "clear ip bgp external out",
4778 "Clear all external peers\n"
4779 "Soft reconfig outbound update\n")
4781 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
4782 clear_ip_bgp_external_ipv4_soft_out_cmd
,
4783 "clear ip bgp external ipv4 (unicast|multicast) soft out",
4787 "Clear all external peers\n"
4789 "Address Family modifier\n"
4790 "Address Family modifier\n"
4792 "Soft reconfig outbound update\n")
4794 if (strncmp (argv
[0], "m", 1) == 0)
4795 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
4796 BGP_CLEAR_SOFT_OUT
, NULL
);
4798 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4799 BGP_CLEAR_SOFT_OUT
, NULL
);
4802 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
4803 clear_ip_bgp_external_ipv4_out_cmd
,
4804 "clear ip bgp external ipv4 (unicast|multicast) out",
4808 "Clear all external peers\n"
4810 "Address Family modifier\n"
4811 "Address Family modifier\n"
4812 "Soft reconfig outbound update\n")
4814 DEFUN (clear_bgp_external_soft_out
,
4815 clear_bgp_external_soft_out_cmd
,
4816 "clear bgp external soft out",
4819 "Clear all external peers\n"
4821 "Soft reconfig outbound update\n")
4823 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
4824 BGP_CLEAR_SOFT_OUT
, NULL
);
4827 ALIAS (clear_bgp_external_soft_out
,
4828 clear_bgp_ipv6_external_soft_out_cmd
,
4829 "clear bgp ipv6 external soft out",
4833 "Clear all external peers\n"
4835 "Soft reconfig outbound update\n")
4837 ALIAS (clear_bgp_external_soft_out
,
4838 clear_bgp_external_out_cmd
,
4839 "clear bgp external out",
4842 "Clear all external peers\n"
4843 "Soft reconfig outbound update\n")
4845 ALIAS (clear_bgp_external_soft_out
,
4846 clear_bgp_ipv6_external_out_cmd
,
4847 "clear bgp ipv6 external WORD out",
4851 "Clear all external peers\n"
4852 "Soft reconfig outbound update\n")
4854 DEFUN (clear_ip_bgp_as_soft_out
,
4855 clear_ip_bgp_as_soft_out_cmd
,
4856 "clear ip bgp <1-65535> soft out",
4860 "Clear peers with the AS number\n"
4862 "Soft reconfig outbound update\n")
4864 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4865 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4868 ALIAS (clear_ip_bgp_as_soft_out
,
4869 clear_ip_bgp_as_out_cmd
,
4870 "clear ip bgp <1-65535> out",
4874 "Clear peers with the AS number\n"
4875 "Soft reconfig outbound update\n")
4877 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
4878 clear_ip_bgp_as_ipv4_soft_out_cmd
,
4879 "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft out",
4883 "Clear peers with the AS number\n"
4885 "Address Family modifier\n"
4886 "Address Family modifier\n"
4888 "Soft reconfig outbound update\n")
4890 if (strncmp (argv
[1], "m", 1) == 0)
4891 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
4892 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4894 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4895 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4898 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
4899 clear_ip_bgp_as_ipv4_out_cmd
,
4900 "clear ip bgp <1-65535> ipv4 (unicast|multicast) out",
4904 "Clear peers with the AS number\n"
4906 "Address Family modifier\n"
4907 "Address Family modifier\n"
4908 "Soft reconfig outbound update\n")
4910 DEFUN (clear_ip_bgp_as_vpnv4_soft_out
,
4911 clear_ip_bgp_as_vpnv4_soft_out_cmd
,
4912 "clear ip bgp <1-65535> vpnv4 unicast soft out",
4916 "Clear peers with the AS number\n"
4918 "Address Family modifier\n"
4920 "Soft reconfig outbound update\n")
4922 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
4923 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4926 ALIAS (clear_ip_bgp_as_vpnv4_soft_out
,
4927 clear_ip_bgp_as_vpnv4_out_cmd
,
4928 "clear ip bgp <1-65535> vpnv4 unicast out",
4932 "Clear peers with the AS number\n"
4934 "Address Family modifier\n"
4935 "Soft reconfig outbound update\n")
4937 DEFUN (clear_bgp_as_soft_out
,
4938 clear_bgp_as_soft_out_cmd
,
4939 "clear bgp <1-65535> soft out",
4942 "Clear peers with the AS number\n"
4944 "Soft reconfig outbound update\n")
4946 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
4947 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4950 ALIAS (clear_bgp_as_soft_out
,
4951 clear_bgp_ipv6_as_soft_out_cmd
,
4952 "clear bgp ipv6 <1-65535> soft out",
4956 "Clear peers with the AS number\n"
4958 "Soft reconfig outbound update\n")
4960 ALIAS (clear_bgp_as_soft_out
,
4961 clear_bgp_as_out_cmd
,
4962 "clear bgp <1-65535> out",
4965 "Clear peers with the AS number\n"
4966 "Soft reconfig outbound update\n")
4968 ALIAS (clear_bgp_as_soft_out
,
4969 clear_bgp_ipv6_as_out_cmd
,
4970 "clear bgp ipv6 <1-65535> out",
4974 "Clear peers with the AS number\n"
4975 "Soft reconfig outbound update\n")
4977 /* Inbound soft-reconfiguration */
4978 DEFUN (clear_ip_bgp_all_soft_in
,
4979 clear_ip_bgp_all_soft_in_cmd
,
4980 "clear ip bgp * soft in",
4986 "Soft reconfig inbound update\n")
4989 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4990 BGP_CLEAR_SOFT_IN
, NULL
);
4992 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4993 BGP_CLEAR_SOFT_IN
, NULL
);
4996 ALIAS (clear_ip_bgp_all_soft_in
,
4997 clear_ip_bgp_instance_all_soft_in_cmd
,
4998 "clear ip bgp view WORD * soft in",
5006 "Soft reconfig inbound update\n")
5008 ALIAS (clear_ip_bgp_all_soft_in
,
5009 clear_ip_bgp_all_in_cmd
,
5010 "clear ip bgp * in",
5015 "Soft reconfig inbound update\n")
5017 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
5018 clear_ip_bgp_all_in_prefix_filter_cmd
,
5019 "clear ip bgp * in prefix-filter",
5024 "Soft reconfig inbound update\n"
5025 "Push out prefix-list ORF and do inbound soft reconfig\n")
5028 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5029 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5031 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5032 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5035 ALIAS (clear_ip_bgp_all_in_prefix_filter
,
5036 clear_ip_bgp_instance_all_in_prefix_filter_cmd
,
5037 "clear ip bgp view WORD * in prefix-filter",
5044 "Soft reconfig inbound update\n"
5045 "Push out prefix-list ORF and do inbound soft reconfig\n")
5048 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
5049 clear_ip_bgp_all_ipv4_soft_in_cmd
,
5050 "clear ip bgp * ipv4 (unicast|multicast) soft in",
5056 "Address Family modifier\n"
5057 "Address Family modifier\n"
5059 "Soft reconfig inbound update\n")
5061 if (strncmp (argv
[0], "m", 1) == 0)
5062 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5063 BGP_CLEAR_SOFT_IN
, NULL
);
5065 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5066 BGP_CLEAR_SOFT_IN
, NULL
);
5069 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
5070 clear_ip_bgp_all_ipv4_in_cmd
,
5071 "clear ip bgp * ipv4 (unicast|multicast) in",
5077 "Address Family modifier\n"
5078 "Address Family modifier\n"
5079 "Soft reconfig inbound update\n")
5081 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
5082 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
5083 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in",
5091 "Address Family modifier\n"
5092 "Address Family modifier\n"
5094 "Soft reconfig inbound update\n")
5096 if (strncmp (argv
[1], "m", 1) == 0)
5097 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5098 BGP_CLEAR_SOFT_IN
, NULL
);
5100 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5101 BGP_CLEAR_SOFT_IN
, NULL
);
5104 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
5105 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
5106 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
5112 "Address Family modifier\n"
5113 "Address Family modifier\n"
5114 "Soft reconfig inbound update\n"
5115 "Push out prefix-list ORF and do inbound soft reconfig\n")
5117 if (strncmp (argv
[0], "m", 1) == 0)
5118 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5119 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5121 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5122 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5125 DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter
,
5126 clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
,
5127 "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter",
5133 "Address Family modifier\n"
5134 "Address Family modifier\n"
5135 "Soft reconfig inbound update\n"
5136 "Push out prefix-list ORF and do inbound soft reconfig\n")
5138 if (strncmp (argv
[1], "m", 1) == 0)
5139 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5140 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5142 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5143 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5146 DEFUN (clear_ip_bgp_all_vpnv4_soft_in
,
5147 clear_ip_bgp_all_vpnv4_soft_in_cmd
,
5148 "clear ip bgp * vpnv4 unicast soft in",
5154 "Address Family Modifier\n"
5156 "Soft reconfig inbound update\n")
5158 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
5159 BGP_CLEAR_SOFT_IN
, NULL
);
5162 ALIAS (clear_ip_bgp_all_vpnv4_soft_in
,
5163 clear_ip_bgp_all_vpnv4_in_cmd
,
5164 "clear ip bgp * vpnv4 unicast in",
5170 "Address Family Modifier\n"
5171 "Soft reconfig inbound update\n")
5173 DEFUN (clear_bgp_all_soft_in
,
5174 clear_bgp_all_soft_in_cmd
,
5175 "clear bgp * soft in",
5180 "Soft reconfig inbound update\n")
5183 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
5184 BGP_CLEAR_SOFT_IN
, NULL
);
5186 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5187 BGP_CLEAR_SOFT_IN
, NULL
);
5190 ALIAS (clear_bgp_all_soft_in
,
5191 clear_bgp_instance_all_soft_in_cmd
,
5192 "clear bgp view WORD * soft in",
5199 "Soft reconfig inbound update\n")
5201 ALIAS (clear_bgp_all_soft_in
,
5202 clear_bgp_ipv6_all_soft_in_cmd
,
5203 "clear bgp ipv6 * soft in",
5209 "Soft reconfig inbound update\n")
5211 ALIAS (clear_bgp_all_soft_in
,
5212 clear_bgp_all_in_cmd
,
5217 "Soft reconfig inbound update\n")
5219 ALIAS (clear_bgp_all_soft_in
,
5220 clear_bgp_ipv6_all_in_cmd
,
5221 "clear bgp ipv6 * in",
5226 "Soft reconfig inbound update\n")
5228 DEFUN (clear_bgp_all_in_prefix_filter
,
5229 clear_bgp_all_in_prefix_filter_cmd
,
5230 "clear bgp * in prefix-filter",
5234 "Soft reconfig inbound update\n"
5235 "Push out prefix-list ORF and do inbound soft reconfig\n")
5237 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5238 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5241 ALIAS (clear_bgp_all_in_prefix_filter
,
5242 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
5243 "clear bgp ipv6 * in prefix-filter",
5248 "Soft reconfig inbound update\n"
5249 "Push out prefix-list ORF and do inbound soft reconfig\n")
5251 DEFUN (clear_ip_bgp_peer_soft_in
,
5252 clear_ip_bgp_peer_soft_in_cmd
,
5253 "clear ip bgp A.B.C.D soft in",
5257 "BGP neighbor address to clear\n"
5259 "Soft reconfig inbound update\n")
5261 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5262 BGP_CLEAR_SOFT_IN
, argv
[0]);
5265 ALIAS (clear_ip_bgp_peer_soft_in
,
5266 clear_ip_bgp_peer_in_cmd
,
5267 "clear ip bgp A.B.C.D in",
5271 "BGP neighbor address to clear\n"
5272 "Soft reconfig inbound update\n")
5274 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
5275 clear_ip_bgp_peer_in_prefix_filter_cmd
,
5276 "clear ip bgp A.B.C.D in prefix-filter",
5280 "BGP neighbor address to clear\n"
5281 "Soft reconfig inbound update\n"
5282 "Push out the existing ORF prefix-list\n")
5284 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5285 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5288 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
5289 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
5290 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in",
5294 "BGP neighbor address to clear\n"
5296 "Address Family modifier\n"
5297 "Address Family modifier\n"
5299 "Soft reconfig inbound update\n")
5301 if (strncmp (argv
[1], "m", 1) == 0)
5302 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5303 BGP_CLEAR_SOFT_IN
, argv
[0]);
5305 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5306 BGP_CLEAR_SOFT_IN
, argv
[0]);
5309 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
5310 clear_ip_bgp_peer_ipv4_in_cmd
,
5311 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in",
5315 "BGP neighbor address to clear\n"
5317 "Address Family modifier\n"
5318 "Address Family modifier\n"
5319 "Soft reconfig inbound update\n")
5321 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
5322 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
5323 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter",
5327 "BGP neighbor address to clear\n"
5329 "Address Family modifier\n"
5330 "Address Family modifier\n"
5331 "Soft reconfig inbound update\n"
5332 "Push out the existing ORF prefix-list\n")
5334 if (strncmp (argv
[1], "m", 1) == 0)
5335 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5336 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5338 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5339 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5342 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in
,
5343 clear_ip_bgp_peer_vpnv4_soft_in_cmd
,
5344 "clear ip bgp A.B.C.D vpnv4 unicast soft in",
5348 "BGP neighbor address to clear\n"
5350 "Address Family Modifier\n"
5352 "Soft reconfig inbound update\n")
5354 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
5355 BGP_CLEAR_SOFT_IN
, argv
[0]);
5358 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in
,
5359 clear_ip_bgp_peer_vpnv4_in_cmd
,
5360 "clear ip bgp A.B.C.D vpnv4 unicast in",
5364 "BGP neighbor address to clear\n"
5366 "Address Family Modifier\n"
5367 "Soft reconfig inbound update\n")
5369 DEFUN (clear_bgp_peer_soft_in
,
5370 clear_bgp_peer_soft_in_cmd
,
5371 "clear bgp (A.B.C.D|X:X::X:X) soft in",
5374 "BGP neighbor address to clear\n"
5375 "BGP IPv6 neighbor to clear\n"
5377 "Soft reconfig inbound update\n")
5379 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5380 BGP_CLEAR_SOFT_IN
, argv
[0]);
5383 ALIAS (clear_bgp_peer_soft_in
,
5384 clear_bgp_ipv6_peer_soft_in_cmd
,
5385 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in",
5389 "BGP neighbor address to clear\n"
5390 "BGP IPv6 neighbor to clear\n"
5392 "Soft reconfig inbound update\n")
5394 ALIAS (clear_bgp_peer_soft_in
,
5395 clear_bgp_peer_in_cmd
,
5396 "clear bgp (A.B.C.D|X:X::X:X) in",
5399 "BGP neighbor address to clear\n"
5400 "BGP IPv6 neighbor to clear\n"
5401 "Soft reconfig inbound update\n")
5403 ALIAS (clear_bgp_peer_soft_in
,
5404 clear_bgp_ipv6_peer_in_cmd
,
5405 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in",
5409 "BGP neighbor address to clear\n"
5410 "BGP IPv6 neighbor to clear\n"
5411 "Soft reconfig inbound update\n")
5413 DEFUN (clear_bgp_peer_in_prefix_filter
,
5414 clear_bgp_peer_in_prefix_filter_cmd
,
5415 "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter",
5418 "BGP neighbor address to clear\n"
5419 "BGP IPv6 neighbor to clear\n"
5420 "Soft reconfig inbound update\n"
5421 "Push out the existing ORF prefix-list\n")
5423 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5424 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5427 ALIAS (clear_bgp_peer_in_prefix_filter
,
5428 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
5429 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter",
5433 "BGP neighbor address to clear\n"
5434 "BGP IPv6 neighbor to clear\n"
5435 "Soft reconfig inbound update\n"
5436 "Push out the existing ORF prefix-list\n")
5438 DEFUN (clear_ip_bgp_peer_group_soft_in
,
5439 clear_ip_bgp_peer_group_soft_in_cmd
,
5440 "clear ip bgp peer-group WORD soft in",
5444 "Clear all members of peer-group\n"
5445 "BGP peer-group name\n"
5447 "Soft reconfig inbound update\n")
5449 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5450 BGP_CLEAR_SOFT_IN
, argv
[0]);
5453 ALIAS (clear_ip_bgp_peer_group_soft_in
,
5454 clear_ip_bgp_peer_group_in_cmd
,
5455 "clear ip bgp peer-group WORD in",
5459 "Clear all members of peer-group\n"
5460 "BGP peer-group name\n"
5461 "Soft reconfig inbound update\n")
5463 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
5464 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
5465 "clear ip bgp peer-group WORD in prefix-filter",
5469 "Clear all members of peer-group\n"
5470 "BGP peer-group name\n"
5471 "Soft reconfig inbound update\n"
5472 "Push out prefix-list ORF and do inbound soft reconfig\n")
5474 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5475 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5478 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
5479 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
5480 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
5484 "Clear all members of peer-group\n"
5485 "BGP peer-group name\n"
5487 "Address Family modifier\n"
5488 "Address Family modifier\n"
5490 "Soft reconfig inbound update\n")
5492 if (strncmp (argv
[1], "m", 1) == 0)
5493 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5494 BGP_CLEAR_SOFT_IN
, argv
[0]);
5496 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5497 BGP_CLEAR_SOFT_IN
, argv
[0]);
5500 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
5501 clear_ip_bgp_peer_group_ipv4_in_cmd
,
5502 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
5506 "Clear all members of peer-group\n"
5507 "BGP peer-group name\n"
5509 "Address Family modifier\n"
5510 "Address Family modifier\n"
5511 "Soft reconfig inbound update\n")
5513 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
5514 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
5515 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
5519 "Clear all members of peer-group\n"
5520 "BGP peer-group name\n"
5522 "Address Family modifier\n"
5523 "Address Family modifier\n"
5524 "Soft reconfig inbound update\n"
5525 "Push out prefix-list ORF and do inbound soft reconfig\n")
5527 if (strncmp (argv
[1], "m", 1) == 0)
5528 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5529 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5531 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5532 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5535 DEFUN (clear_bgp_peer_group_soft_in
,
5536 clear_bgp_peer_group_soft_in_cmd
,
5537 "clear bgp peer-group WORD soft in",
5540 "Clear all members of peer-group\n"
5541 "BGP peer-group name\n"
5543 "Soft reconfig inbound update\n")
5545 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5546 BGP_CLEAR_SOFT_IN
, argv
[0]);
5549 ALIAS (clear_bgp_peer_group_soft_in
,
5550 clear_bgp_ipv6_peer_group_soft_in_cmd
,
5551 "clear bgp ipv6 peer-group WORD soft in",
5555 "Clear all members of peer-group\n"
5556 "BGP peer-group name\n"
5558 "Soft reconfig inbound update\n")
5560 ALIAS (clear_bgp_peer_group_soft_in
,
5561 clear_bgp_peer_group_in_cmd
,
5562 "clear bgp peer-group WORD in",
5565 "Clear all members of peer-group\n"
5566 "BGP peer-group name\n"
5567 "Soft reconfig inbound update\n")
5569 ALIAS (clear_bgp_peer_group_soft_in
,
5570 clear_bgp_ipv6_peer_group_in_cmd
,
5571 "clear bgp ipv6 peer-group WORD in",
5575 "Clear all members of peer-group\n"
5576 "BGP peer-group name\n"
5577 "Soft reconfig inbound update\n")
5579 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
5580 clear_bgp_peer_group_in_prefix_filter_cmd
,
5581 "clear bgp peer-group WORD in prefix-filter",
5584 "Clear all members of peer-group\n"
5585 "BGP peer-group name\n"
5586 "Soft reconfig inbound update\n"
5587 "Push out prefix-list ORF and do inbound soft reconfig\n")
5589 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5590 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5593 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
5594 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
5595 "clear bgp ipv6 peer-group WORD in prefix-filter",
5599 "Clear all members of peer-group\n"
5600 "BGP peer-group name\n"
5601 "Soft reconfig inbound update\n"
5602 "Push out prefix-list ORF and do inbound soft reconfig\n")
5604 DEFUN (clear_ip_bgp_external_soft_in
,
5605 clear_ip_bgp_external_soft_in_cmd
,
5606 "clear ip bgp external soft in",
5610 "Clear all external peers\n"
5612 "Soft reconfig inbound update\n")
5614 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5615 BGP_CLEAR_SOFT_IN
, NULL
);
5618 ALIAS (clear_ip_bgp_external_soft_in
,
5619 clear_ip_bgp_external_in_cmd
,
5620 "clear ip bgp external in",
5624 "Clear all external peers\n"
5625 "Soft reconfig inbound update\n")
5627 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
5628 clear_ip_bgp_external_in_prefix_filter_cmd
,
5629 "clear ip bgp external in prefix-filter",
5633 "Clear all external peers\n"
5634 "Soft reconfig inbound update\n"
5635 "Push out prefix-list ORF and do inbound soft reconfig\n")
5637 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5638 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5641 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
5642 clear_ip_bgp_external_ipv4_soft_in_cmd
,
5643 "clear ip bgp external ipv4 (unicast|multicast) soft in",
5647 "Clear all external peers\n"
5649 "Address Family modifier\n"
5650 "Address Family modifier\n"
5652 "Soft reconfig inbound update\n")
5654 if (strncmp (argv
[0], "m", 1) == 0)
5655 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5656 BGP_CLEAR_SOFT_IN
, NULL
);
5658 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5659 BGP_CLEAR_SOFT_IN
, NULL
);
5662 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
5663 clear_ip_bgp_external_ipv4_in_cmd
,
5664 "clear ip bgp external ipv4 (unicast|multicast) in",
5668 "Clear all external peers\n"
5670 "Address Family modifier\n"
5671 "Address Family modifier\n"
5672 "Soft reconfig inbound update\n")
5674 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
5675 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
5676 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
5680 "Clear all external peers\n"
5682 "Address Family modifier\n"
5683 "Address Family modifier\n"
5684 "Soft reconfig inbound update\n"
5685 "Push out prefix-list ORF and do inbound soft reconfig\n")
5687 if (strncmp (argv
[0], "m", 1) == 0)
5688 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5689 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5691 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5692 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5695 DEFUN (clear_bgp_external_soft_in
,
5696 clear_bgp_external_soft_in_cmd
,
5697 "clear bgp external soft in",
5700 "Clear all external peers\n"
5702 "Soft reconfig inbound update\n")
5704 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5705 BGP_CLEAR_SOFT_IN
, NULL
);
5708 ALIAS (clear_bgp_external_soft_in
,
5709 clear_bgp_ipv6_external_soft_in_cmd
,
5710 "clear bgp ipv6 external soft in",
5714 "Clear all external peers\n"
5716 "Soft reconfig inbound update\n")
5718 ALIAS (clear_bgp_external_soft_in
,
5719 clear_bgp_external_in_cmd
,
5720 "clear bgp external in",
5723 "Clear all external peers\n"
5724 "Soft reconfig inbound update\n")
5726 ALIAS (clear_bgp_external_soft_in
,
5727 clear_bgp_ipv6_external_in_cmd
,
5728 "clear bgp ipv6 external WORD in",
5732 "Clear all external peers\n"
5733 "Soft reconfig inbound update\n")
5735 DEFUN (clear_bgp_external_in_prefix_filter
,
5736 clear_bgp_external_in_prefix_filter_cmd
,
5737 "clear bgp external in prefix-filter",
5740 "Clear all external peers\n"
5741 "Soft reconfig inbound update\n"
5742 "Push out prefix-list ORF and do inbound soft reconfig\n")
5744 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5745 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5748 ALIAS (clear_bgp_external_in_prefix_filter
,
5749 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
5750 "clear bgp ipv6 external in prefix-filter",
5754 "Clear all external peers\n"
5755 "Soft reconfig inbound update\n"
5756 "Push out prefix-list ORF and do inbound soft reconfig\n")
5758 DEFUN (clear_ip_bgp_as_soft_in
,
5759 clear_ip_bgp_as_soft_in_cmd
,
5760 "clear ip bgp <1-65535> soft in",
5764 "Clear peers with the AS number\n"
5766 "Soft reconfig inbound update\n")
5768 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5769 BGP_CLEAR_SOFT_IN
, argv
[0]);
5772 ALIAS (clear_ip_bgp_as_soft_in
,
5773 clear_ip_bgp_as_in_cmd
,
5774 "clear ip bgp <1-65535> in",
5778 "Clear peers with the AS number\n"
5779 "Soft reconfig inbound update\n")
5781 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
5782 clear_ip_bgp_as_in_prefix_filter_cmd
,
5783 "clear ip bgp <1-65535> in prefix-filter",
5787 "Clear peers with the AS number\n"
5788 "Soft reconfig inbound update\n"
5789 "Push out prefix-list ORF and do inbound soft reconfig\n")
5791 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5792 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5795 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
5796 clear_ip_bgp_as_ipv4_soft_in_cmd
,
5797 "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft in",
5801 "Clear peers with the AS number\n"
5803 "Address Family modifier\n"
5804 "Address Family modifier\n"
5806 "Soft reconfig inbound update\n")
5808 if (strncmp (argv
[1], "m", 1) == 0)
5809 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5810 BGP_CLEAR_SOFT_IN
, argv
[0]);
5812 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5813 BGP_CLEAR_SOFT_IN
, argv
[0]);
5816 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
5817 clear_ip_bgp_as_ipv4_in_cmd
,
5818 "clear ip bgp <1-65535> ipv4 (unicast|multicast) in",
5822 "Clear peers with the AS number\n"
5824 "Address Family modifier\n"
5825 "Address Family modifier\n"
5826 "Soft reconfig inbound update\n")
5828 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
5829 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
5830 "clear ip bgp <1-65535> ipv4 (unicast|multicast) in prefix-filter",
5834 "Clear peers with the AS number\n"
5836 "Address Family modifier\n"
5837 "Address Family modifier\n"
5838 "Soft reconfig inbound update\n"
5839 "Push out prefix-list ORF and do inbound soft reconfig\n")
5841 if (strncmp (argv
[1], "m", 1) == 0)
5842 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5843 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5845 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5846 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5849 DEFUN (clear_ip_bgp_as_vpnv4_soft_in
,
5850 clear_ip_bgp_as_vpnv4_soft_in_cmd
,
5851 "clear ip bgp <1-65535> vpnv4 unicast soft in",
5855 "Clear peers with the AS number\n"
5857 "Address Family modifier\n"
5859 "Soft reconfig inbound update\n")
5861 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
5862 BGP_CLEAR_SOFT_IN
, argv
[0]);
5865 ALIAS (clear_ip_bgp_as_vpnv4_soft_in
,
5866 clear_ip_bgp_as_vpnv4_in_cmd
,
5867 "clear ip bgp <1-65535> vpnv4 unicast in",
5871 "Clear peers with the AS number\n"
5873 "Address Family modifier\n"
5874 "Soft reconfig inbound update\n")
5876 DEFUN (clear_bgp_as_soft_in
,
5877 clear_bgp_as_soft_in_cmd
,
5878 "clear bgp <1-65535> soft in",
5881 "Clear peers with the AS number\n"
5883 "Soft reconfig inbound update\n")
5885 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5886 BGP_CLEAR_SOFT_IN
, argv
[0]);
5889 ALIAS (clear_bgp_as_soft_in
,
5890 clear_bgp_ipv6_as_soft_in_cmd
,
5891 "clear bgp ipv6 <1-65535> soft in",
5895 "Clear peers with the AS number\n"
5897 "Soft reconfig inbound update\n")
5899 ALIAS (clear_bgp_as_soft_in
,
5900 clear_bgp_as_in_cmd
,
5901 "clear bgp <1-65535> in",
5904 "Clear peers with the AS number\n"
5905 "Soft reconfig inbound update\n")
5907 ALIAS (clear_bgp_as_soft_in
,
5908 clear_bgp_ipv6_as_in_cmd
,
5909 "clear bgp ipv6 <1-65535> in",
5913 "Clear peers with the AS number\n"
5914 "Soft reconfig inbound update\n")
5916 DEFUN (clear_bgp_as_in_prefix_filter
,
5917 clear_bgp_as_in_prefix_filter_cmd
,
5918 "clear bgp <1-65535> in prefix-filter",
5921 "Clear peers with the AS number\n"
5922 "Soft reconfig inbound update\n"
5923 "Push out prefix-list ORF and do inbound soft reconfig\n")
5925 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5926 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5929 ALIAS (clear_bgp_as_in_prefix_filter
,
5930 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
5931 "clear bgp ipv6 <1-65535> in prefix-filter",
5935 "Clear peers with the AS number\n"
5936 "Soft reconfig inbound update\n"
5937 "Push out prefix-list ORF and do inbound soft reconfig\n")
5939 /* Both soft-reconfiguration */
5940 DEFUN (clear_ip_bgp_all_soft
,
5941 clear_ip_bgp_all_soft_cmd
,
5942 "clear ip bgp * soft",
5950 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5951 BGP_CLEAR_SOFT_BOTH
, NULL
);
5953 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5954 BGP_CLEAR_SOFT_BOTH
, NULL
);
5957 ALIAS (clear_ip_bgp_all_soft
,
5958 clear_ip_bgp_instance_all_soft_cmd
,
5959 "clear ip bgp view WORD * soft",
5969 DEFUN (clear_ip_bgp_all_ipv4_soft
,
5970 clear_ip_bgp_all_ipv4_soft_cmd
,
5971 "clear ip bgp * ipv4 (unicast|multicast) soft",
5977 "Address Family Modifier\n"
5978 "Address Family Modifier\n"
5981 if (strncmp (argv
[0], "m", 1) == 0)
5982 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5983 BGP_CLEAR_SOFT_BOTH
, NULL
);
5985 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5986 BGP_CLEAR_SOFT_BOTH
, NULL
);
5989 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
5990 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
5991 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft",
5999 "Address Family Modifier\n"
6000 "Address Family Modifier\n"
6003 if (strncmp (argv
[1], "m", 1) == 0)
6004 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6005 BGP_CLEAR_SOFT_BOTH
, NULL
);
6007 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6008 BGP_CLEAR_SOFT_BOTH
, NULL
);
6011 DEFUN (clear_ip_bgp_all_vpnv4_soft
,
6012 clear_ip_bgp_all_vpnv4_soft_cmd
,
6013 "clear ip bgp * vpnv4 unicast soft",
6019 "Address Family Modifier\n"
6022 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
6023 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6026 DEFUN (clear_bgp_all_soft
,
6027 clear_bgp_all_soft_cmd
,
6035 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6036 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6038 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6039 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6042 ALIAS (clear_bgp_all_soft
,
6043 clear_bgp_instance_all_soft_cmd
,
6044 "clear bgp view WORD * soft",
6052 ALIAS (clear_bgp_all_soft
,
6053 clear_bgp_ipv6_all_soft_cmd
,
6054 "clear bgp ipv6 * soft",
6061 DEFUN (clear_ip_bgp_peer_soft
,
6062 clear_ip_bgp_peer_soft_cmd
,
6063 "clear ip bgp A.B.C.D soft",
6067 "BGP neighbor address to clear\n"
6070 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6071 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6074 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
6075 clear_ip_bgp_peer_ipv4_soft_cmd
,
6076 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft",
6080 "BGP neighbor address to clear\n"
6082 "Address Family Modifier\n"
6083 "Address Family Modifier\n"
6086 if (strncmp (argv
[1], "m", 1) == 0)
6087 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
6088 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6090 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6091 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6094 DEFUN (clear_ip_bgp_peer_vpnv4_soft
,
6095 clear_ip_bgp_peer_vpnv4_soft_cmd
,
6096 "clear ip bgp A.B.C.D vpnv4 unicast soft",
6100 "BGP neighbor address to clear\n"
6102 "Address Family Modifier\n"
6105 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
6106 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6109 DEFUN (clear_bgp_peer_soft
,
6110 clear_bgp_peer_soft_cmd
,
6111 "clear bgp (A.B.C.D|X:X::X:X) soft",
6114 "BGP neighbor address to clear\n"
6115 "BGP IPv6 neighbor to clear\n"
6118 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6119 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6122 ALIAS (clear_bgp_peer_soft
,
6123 clear_bgp_ipv6_peer_soft_cmd
,
6124 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft",
6128 "BGP neighbor address to clear\n"
6129 "BGP IPv6 neighbor to clear\n"
6132 DEFUN (clear_ip_bgp_peer_group_soft
,
6133 clear_ip_bgp_peer_group_soft_cmd
,
6134 "clear ip bgp peer-group WORD soft",
6138 "Clear all members of peer-group\n"
6139 "BGP peer-group name\n"
6142 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6143 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6146 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
6147 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
6148 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
6152 "Clear all members of peer-group\n"
6153 "BGP peer-group name\n"
6155 "Address Family modifier\n"
6156 "Address Family modifier\n"
6159 if (strncmp (argv
[1], "m", 1) == 0)
6160 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
6161 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6163 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6164 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6167 DEFUN (clear_bgp_peer_group_soft
,
6168 clear_bgp_peer_group_soft_cmd
,
6169 "clear bgp peer-group WORD soft",
6172 "Clear all members of peer-group\n"
6173 "BGP peer-group name\n"
6176 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
6177 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6180 ALIAS (clear_bgp_peer_group_soft
,
6181 clear_bgp_ipv6_peer_group_soft_cmd
,
6182 "clear bgp ipv6 peer-group WORD soft",
6186 "Clear all members of peer-group\n"
6187 "BGP peer-group name\n"
6190 DEFUN (clear_ip_bgp_external_soft
,
6191 clear_ip_bgp_external_soft_cmd
,
6192 "clear ip bgp external soft",
6196 "Clear all external peers\n"
6199 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6200 BGP_CLEAR_SOFT_BOTH
, NULL
);
6203 DEFUN (clear_ip_bgp_external_ipv4_soft
,
6204 clear_ip_bgp_external_ipv4_soft_cmd
,
6205 "clear ip bgp external ipv4 (unicast|multicast) soft",
6209 "Clear all external peers\n"
6211 "Address Family modifier\n"
6212 "Address Family modifier\n"
6215 if (strncmp (argv
[0], "m", 1) == 0)
6216 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
6217 BGP_CLEAR_SOFT_BOTH
, NULL
);
6219 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6220 BGP_CLEAR_SOFT_BOTH
, NULL
);
6223 DEFUN (clear_bgp_external_soft
,
6224 clear_bgp_external_soft_cmd
,
6225 "clear bgp external soft",
6228 "Clear all external peers\n"
6231 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6232 BGP_CLEAR_SOFT_BOTH
, NULL
);
6235 ALIAS (clear_bgp_external_soft
,
6236 clear_bgp_ipv6_external_soft_cmd
,
6237 "clear bgp ipv6 external soft",
6241 "Clear all external peers\n"
6244 DEFUN (clear_ip_bgp_as_soft
,
6245 clear_ip_bgp_as_soft_cmd
,
6246 "clear ip bgp <1-65535> soft",
6250 "Clear peers with the AS number\n"
6253 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6254 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6257 DEFUN (clear_ip_bgp_as_ipv4_soft
,
6258 clear_ip_bgp_as_ipv4_soft_cmd
,
6259 "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft",
6263 "Clear peers with the AS number\n"
6265 "Address Family Modifier\n"
6266 "Address Family Modifier\n"
6269 if (strncmp (argv
[1], "m", 1) == 0)
6270 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
6271 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6273 return bgp_clear_vty (vty
, NULL
,AFI_IP
, SAFI_UNICAST
, clear_as
,
6274 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6277 DEFUN (clear_ip_bgp_as_vpnv4_soft
,
6278 clear_ip_bgp_as_vpnv4_soft_cmd
,
6279 "clear ip bgp <1-65535> vpnv4 unicast soft",
6283 "Clear peers with the AS number\n"
6285 "Address Family Modifier\n"
6288 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
6289 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6292 DEFUN (clear_bgp_as_soft
,
6293 clear_bgp_as_soft_cmd
,
6294 "clear bgp <1-65535> soft",
6297 "Clear peers with the AS number\n"
6300 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
6301 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6304 ALIAS (clear_bgp_as_soft
,
6305 clear_bgp_ipv6_as_soft_cmd
,
6306 "clear bgp ipv6 <1-65535> soft",
6310 "Clear peers with the AS number\n"
6313 /* RS-client soft reconfiguration. */
6315 DEFUN (clear_bgp_all_rsclient
,
6316 clear_bgp_all_rsclient_cmd
,
6317 "clear bgp * rsclient",
6321 "Soft reconfig for rsclient RIB\n")
6324 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6325 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6327 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6328 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6331 ALIAS (clear_bgp_all_rsclient
,
6332 clear_bgp_ipv6_all_rsclient_cmd
,
6333 "clear bgp ipv6 * rsclient",
6338 "Soft reconfig for rsclient RIB\n")
6340 ALIAS (clear_bgp_all_rsclient
,
6341 clear_bgp_instance_all_rsclient_cmd
,
6342 "clear bgp view WORD * rsclient",
6348 "Soft reconfig for rsclient RIB\n")
6350 ALIAS (clear_bgp_all_rsclient
,
6351 clear_bgp_ipv6_instance_all_rsclient_cmd
,
6352 "clear bgp ipv6 view WORD * rsclient",
6359 "Soft reconfig for rsclient RIB\n")
6360 #endif /* HAVE_IPV6 */
6362 DEFUN (clear_ip_bgp_all_rsclient
,
6363 clear_ip_bgp_all_rsclient_cmd
,
6364 "clear ip bgp * rsclient",
6369 "Soft reconfig for rsclient RIB\n")
6372 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6373 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6375 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6376 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6379 ALIAS (clear_ip_bgp_all_rsclient
,
6380 clear_ip_bgp_instance_all_rsclient_cmd
,
6381 "clear ip bgp view WORD * rsclient",
6388 "Soft reconfig for rsclient RIB\n")
6391 DEFUN (clear_bgp_peer_rsclient
,
6392 clear_bgp_peer_rsclient_cmd
,
6393 "clear bgp (A.B.C.D|X:X::X:X) rsclient",
6396 "BGP neighbor IP address to clear\n"
6397 "BGP IPv6 neighbor to clear\n"
6398 "Soft reconfig for rsclient RIB\n")
6401 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6402 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6404 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6405 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6408 ALIAS (clear_bgp_peer_rsclient
,
6409 clear_bgp_ipv6_peer_rsclient_cmd
,
6410 "clear bgp ipv6 (A.B.C.D|X:X::X:X) rsclient",
6414 "BGP neighbor IP address to clear\n"
6415 "BGP IPv6 neighbor to clear\n"
6416 "Soft reconfig for rsclient RIB\n")
6418 ALIAS (clear_bgp_peer_rsclient
,
6419 clear_bgp_instance_peer_rsclient_cmd
,
6420 "clear bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6425 "BGP neighbor IP address to clear\n"
6426 "BGP IPv6 neighbor to clear\n"
6427 "Soft reconfig for rsclient RIB\n")
6429 ALIAS (clear_bgp_peer_rsclient
,
6430 clear_bgp_ipv6_instance_peer_rsclient_cmd
,
6431 "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X) rsclient",
6437 "BGP neighbor IP address to clear\n"
6438 "BGP IPv6 neighbor to clear\n"
6439 "Soft reconfig for rsclient RIB\n")
6440 #endif /* HAVE_IPV6 */
6442 DEFUN (clear_ip_bgp_peer_rsclient
,
6443 clear_ip_bgp_peer_rsclient_cmd
,
6444 "clear ip bgp (A.B.C.D|X:X::X:X) rsclient",
6448 "BGP neighbor IP address to clear\n"
6449 "BGP IPv6 neighbor to clear\n"
6450 "Soft reconfig for rsclient RIB\n")
6453 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_peer
,
6454 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6456 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6457 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6460 ALIAS (clear_ip_bgp_peer_rsclient
,
6461 clear_ip_bgp_instance_peer_rsclient_cmd
,
6462 "clear ip bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6468 "BGP neighbor IP address to clear\n"
6469 "BGP IPv6 neighbor to clear\n"
6470 "Soft reconfig for rsclient RIB\n")
6473 /* Show BGP peer's summary information. */
6475 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
)
6478 struct listnode
*node
, *nnode
;
6480 char timebuf
[BGP_UPTIME_LEN
];
6483 /* Header string for each address family. */
6484 static char header
[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
6486 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
6488 if (peer
->afc
[afi
][safi
])
6493 "BGP router identifier %s, local AS number %d%s",
6494 inet_ntoa (bgp
->router_id
), bgp
->as
, VTY_NEWLINE
);
6496 "%ld BGP AS-PATH entries%s", aspath_count (),
6499 "%ld BGP community entries%s", community_count (),
6502 if (CHECK_FLAG(bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
6503 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
6504 vty_out (vty
, "%s", VTY_NEWLINE
);
6505 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
6509 len
= vty_out (vty
, "%s", peer
->host
);
6512 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
6514 vty_out (vty
, "%*s", len
, " ");
6516 vty_out (vty
, "4 ");
6518 vty_out (vty
, "%5d %7d %7d %8d %4d %4ld ",
6520 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
6521 + peer
->notify_in
+ peer
->refresh_in
+ peer
->dynamic_cap_in
,
6522 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
6523 + peer
->notify_out
+ peer
->refresh_out
6524 + peer
->dynamic_cap_out
,
6525 0, 0, peer
->obuf
->count
);
6527 vty_out (vty
, "%8s",
6528 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
));
6530 if (peer
->status
== Established
)
6532 vty_out (vty
, " %8ld", peer
->pcount
[afi
][safi
]);
6536 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
6537 vty_out (vty
, " Idle (Admin)");
6538 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
6539 vty_out (vty
, " Idle (PfxCt)");
6541 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, peer
->status
));
6544 vty_out (vty
, "%s", VTY_NEWLINE
);
6549 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
6550 count
, VTY_NEWLINE
);
6552 vty_out (vty
, "No %s neighbor is configured%s",
6553 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
6558 bgp_show_summary_vty (struct vty
*vty
, const char *name
,
6559 afi_t afi
, safi_t safi
)
6565 bgp
= bgp_lookup_by_name (name
);
6569 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
6573 bgp_show_summary (vty
, bgp
, afi
, safi
);
6577 bgp
= bgp_get_default ();
6580 bgp_show_summary (vty
, bgp
, afi
, safi
);
6585 /* `show ip bgp summary' commands. */
6586 DEFUN (show_ip_bgp_summary
,
6587 show_ip_bgp_summary_cmd
,
6588 "show ip bgp summary",
6592 "Summary of BGP neighbor status\n")
6594 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6597 DEFUN (show_ip_bgp_instance_summary
,
6598 show_ip_bgp_instance_summary_cmd
,
6599 "show ip bgp view WORD summary",
6605 "Summary of BGP neighbor status\n")
6607 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6610 DEFUN (show_ip_bgp_ipv4_summary
,
6611 show_ip_bgp_ipv4_summary_cmd
,
6612 "show ip bgp ipv4 (unicast|multicast) summary",
6617 "Address Family modifier\n"
6618 "Address Family modifier\n"
6619 "Summary of BGP neighbor status\n")
6621 if (strncmp (argv
[0], "m", 1) == 0)
6622 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
6624 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6627 DEFUN (show_ip_bgp_instance_ipv4_summary
,
6628 show_ip_bgp_instance_ipv4_summary_cmd
,
6629 "show ip bgp view WORD ipv4 (unicast|multicast) summary",
6636 "Address Family modifier\n"
6637 "Address Family modifier\n"
6638 "Summary of BGP neighbor status\n")
6640 if (strncmp (argv
[1], "m", 1) == 0)
6641 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
6643 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6646 DEFUN (show_ip_bgp_vpnv4_all_summary
,
6647 show_ip_bgp_vpnv4_all_summary_cmd
,
6648 "show ip bgp vpnv4 all summary",
6652 "Display VPNv4 NLRI specific information\n"
6653 "Display information about all VPNv4 NLRIs\n"
6654 "Summary of BGP neighbor status\n")
6656 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6659 DEFUN (show_ip_bgp_vpnv4_rd_summary
,
6660 show_ip_bgp_vpnv4_rd_summary_cmd
,
6661 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary",
6665 "Display VPNv4 NLRI specific information\n"
6666 "Display information for a route distinguisher\n"
6667 "VPN Route Distinguisher\n"
6668 "Summary of BGP neighbor status\n")
6671 struct prefix_rd prd
;
6673 ret
= str2prefix_rd (argv
[0], &prd
);
6676 vty_out (vty
, "%% Malformed Route Distinguisher%s", VTY_NEWLINE
);
6680 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6684 DEFUN (show_bgp_summary
,
6685 show_bgp_summary_cmd
,
6689 "Summary of BGP neighbor status\n")
6691 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6694 DEFUN (show_bgp_instance_summary
,
6695 show_bgp_instance_summary_cmd
,
6696 "show bgp view WORD summary",
6701 "Summary of BGP neighbor status\n")
6703 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
6706 ALIAS (show_bgp_summary
,
6707 show_bgp_ipv6_summary_cmd
,
6708 "show bgp ipv6 summary",
6712 "Summary of BGP neighbor status\n")
6714 ALIAS (show_bgp_instance_summary
,
6715 show_bgp_instance_ipv6_summary_cmd
,
6716 "show bgp view WORD ipv6 summary",
6722 "Summary of BGP neighbor status\n")
6725 DEFUN (show_ipv6_bgp_summary
,
6726 show_ipv6_bgp_summary_cmd
,
6727 "show ipv6 bgp summary",
6731 "Summary of BGP neighbor status\n")
6733 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6737 DEFUN (show_ipv6_mbgp_summary
,
6738 show_ipv6_mbgp_summary_cmd
,
6739 "show ipv6 mbgp summary",
6743 "Summary of BGP neighbor status\n")
6745 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
);
6747 #endif /* HAVE_IPV6 */
6750 afi_safi_print (afi_t afi
, safi_t safi
)
6752 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
6753 return "IPv4 Unicast";
6754 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
6755 return "IPv4 Multicast";
6756 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
6757 return "VPNv4 Unicast";
6758 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
6759 return "IPv6 Unicast";
6760 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
6761 return "IPv6 Multicast";
6766 /* Show BGP peer's information. */
6774 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
,
6775 afi_t afi
, safi_t safi
,
6776 u_int16_t adv_smcap
, u_int16_t adv_rmcap
,
6777 u_int16_t rcv_smcap
, u_int16_t rcv_rmcap
)
6780 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
6781 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
6783 vty_out (vty
, " Send-mode: ");
6784 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
6785 vty_out (vty
, "advertised");
6786 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
6787 vty_out (vty
, "%sreceived",
6788 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
6790 vty_out (vty
, "%s", VTY_NEWLINE
);
6794 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
6795 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
6797 vty_out (vty
, " Receive-mode: ");
6798 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
6799 vty_out (vty
, "advertised");
6800 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
6801 vty_out (vty
, "%sreceived",
6802 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
6804 vty_out (vty
, "%s", VTY_NEWLINE
);
6809 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
)
6811 struct bgp_filter
*filter
;
6812 char orf_pfx_name
[BUFSIZ
];
6815 filter
= &p
->filter
[afi
][safi
];
6817 vty_out (vty
, " For address family: %s%s", afi_safi_print (afi
, safi
),
6820 if (p
->af_group
[afi
][safi
])
6821 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
6823 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
6824 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
6825 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
6826 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
6827 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
6828 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
6829 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
6831 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
6832 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
6833 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
6834 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
6836 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
6837 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
6838 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
6839 PEER_CAP_ORF_PREFIX_SM_ADV
,
6840 PEER_CAP_ORF_PREFIX_RM_ADV
,
6841 PEER_CAP_ORF_PREFIX_SM_RCV
,
6842 PEER_CAP_ORF_PREFIX_RM_RCV
);
6844 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
6845 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
6846 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
6847 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
6849 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
6850 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
6851 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
6852 PEER_CAP_ORF_PREFIX_SM_ADV
,
6853 PEER_CAP_ORF_PREFIX_RM_ADV
,
6854 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
6855 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
);
6858 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
6859 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
);
6861 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
6864 vty_out (vty
, " Outbound Route Filter (ORF):");
6865 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
6866 vty_out (vty
, " sent;");
6868 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
6869 vty_out (vty
, "%s", VTY_NEWLINE
);
6871 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
6872 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
6874 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
6875 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
6876 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
6877 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
6878 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
6879 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
6880 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
6881 vty_out (vty
, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE
);
6882 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
))
6883 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
6884 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
6885 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
6886 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
6887 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
6888 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
6889 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
6890 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
6891 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
6893 vty_out (vty
, " Community attribute sent to this neighbor");
6894 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
6895 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
6896 vty_out (vty
, "(both)%s", VTY_NEWLINE
);
6897 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
6898 vty_out (vty
, "(extended)%s", VTY_NEWLINE
);
6900 vty_out (vty
, "(standard)%s", VTY_NEWLINE
);
6902 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
6904 vty_out (vty
, " Default information originate,");
6906 if (p
->default_rmap
[afi
][safi
].name
)
6907 vty_out (vty
, " default route-map %s%s,",
6908 p
->default_rmap
[afi
][safi
].map
? "*" : "",
6909 p
->default_rmap
[afi
][safi
].name
);
6910 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_DEFAULT_ORIGINATE
))
6911 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
6913 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
6916 if (filter
->plist
[FILTER_IN
].name
6917 || filter
->dlist
[FILTER_IN
].name
6918 || filter
->aslist
[FILTER_IN
].name
6919 || filter
->map
[RMAP_IN
].name
)
6920 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
6921 if (filter
->plist
[FILTER_OUT
].name
6922 || filter
->dlist
[FILTER_OUT
].name
6923 || filter
->aslist
[FILTER_OUT
].name
6924 || filter
->map
[RMAP_OUT
].name
6925 || filter
->usmap
.name
)
6926 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
6927 if (filter
->map
[RMAP_IMPORT
].name
)
6928 vty_out (vty
, " Import policy for this RS-client configured%s", VTY_NEWLINE
);
6929 if (filter
->map
[RMAP_EXPORT
].name
)
6930 vty_out (vty
, " Export policy for this RS-client configured%s", VTY_NEWLINE
);
6933 if (filter
->plist
[FILTER_IN
].name
)
6934 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
6935 filter
->plist
[FILTER_IN
].plist
? "*" : "",
6936 filter
->plist
[FILTER_IN
].name
,
6938 if (filter
->plist
[FILTER_OUT
].name
)
6939 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
6940 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
6941 filter
->plist
[FILTER_OUT
].name
,
6944 /* distribute-list */
6945 if (filter
->dlist
[FILTER_IN
].name
)
6946 vty_out (vty
, " Incoming update network filter list is %s%s%s",
6947 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
6948 filter
->dlist
[FILTER_IN
].name
,
6950 if (filter
->dlist
[FILTER_OUT
].name
)
6951 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
6952 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
6953 filter
->dlist
[FILTER_OUT
].name
,
6957 if (filter
->aslist
[FILTER_IN
].name
)
6958 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
6959 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
6960 filter
->aslist
[FILTER_IN
].name
,
6962 if (filter
->aslist
[FILTER_OUT
].name
)
6963 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
6964 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
6965 filter
->aslist
[FILTER_OUT
].name
,
6969 if (filter
->map
[RMAP_IN
].name
)
6970 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
6971 filter
->map
[RMAP_IN
].map
? "*" : "",
6972 filter
->map
[RMAP_IN
].name
,
6974 if (filter
->map
[RMAP_OUT
].name
)
6975 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
6976 filter
->map
[RMAP_OUT
].map
? "*" : "",
6977 filter
->map
[RMAP_OUT
].name
,
6979 if (filter
->map
[RMAP_IMPORT
].name
)
6980 vty_out (vty
, " Route map for advertisements going into this RS-client's table is %s%s%s",
6981 filter
->map
[RMAP_IMPORT
].map
? "*" : "",
6982 filter
->map
[RMAP_IMPORT
].name
,
6984 if (filter
->map
[RMAP_EXPORT
].name
)
6985 vty_out (vty
, " Route map for advertisements coming from this RS-client is %s%s%s",
6986 filter
->map
[RMAP_EXPORT
].map
? "*" : "",
6987 filter
->map
[RMAP_EXPORT
].name
,
6990 /* unsuppress-map */
6991 if (filter
->usmap
.name
)
6992 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
6993 filter
->usmap
.map
? "*" : "",
6994 filter
->usmap
.name
, VTY_NEWLINE
);
6996 /* Receive prefix count */
6997 vty_out (vty
, " %ld accepted prefixes%s", p
->pcount
[afi
][safi
], VTY_NEWLINE
);
6999 /* Maximum prefix */
7000 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
7002 vty_out (vty
, " Maximum prefixes allowed %ld%s%s", p
->pmax
[afi
][safi
],
7003 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
7004 ? " (warning-only)" : "", VTY_NEWLINE
);
7005 vty_out (vty
, " Threshold for warning message %d%%",
7006 p
->pmax_threshold
[afi
][safi
]);
7007 if (p
->pmax_restart
[afi
][safi
])
7008 vty_out (vty
, ", restart interval %d min", p
->pmax_restart
[afi
][safi
]);
7009 vty_out (vty
, "%s", VTY_NEWLINE
);
7012 vty_out (vty
, "%s", VTY_NEWLINE
);
7016 bgp_show_peer (struct vty
*vty
, struct peer
*p
)
7020 char timebuf
[BGP_UPTIME_LEN
];
7026 /* Configured IP address. */
7027 vty_out (vty
, "BGP neighbor is %s, ", p
->host
);
7028 vty_out (vty
, "remote AS %d, ", p
->as
);
7029 vty_out (vty
, "local AS %d%s, ",
7030 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
7031 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
7032 " no-prepend" : "");
7033 vty_out (vty
, "%s link%s",
7034 p
->as
== p
->local_as
? "internal" : "external",
7039 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
7043 vty_out (vty
, " Member of peer-group %s for session parameters%s",
7044 p
->group
->name
, VTY_NEWLINE
);
7046 /* Administrative shutdown. */
7047 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
7048 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
7051 vty_out (vty
, " BGP version 4");
7052 vty_out (vty
, ", remote router ID %s%s",
7053 inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
7057 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
)
7058 && bgp_confederation_peers_check (bgp
, p
->as
))
7059 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
7062 vty_out (vty
, " BGP state = %s",
7063 LOOKUP (bgp_status_msg
, p
->status
));
7064 if (p
->status
== Established
)
7065 vty_out (vty
, ", up for %8s",
7066 peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
));
7067 else if (p
->status
== Active
)
7069 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
7070 vty_out (vty
, " (passive)");
7071 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
7072 vty_out (vty
, " (NSF passive)");
7074 vty_out (vty
, "%s", VTY_NEWLINE
);
7077 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
));
7079 /* Configured timer values. */
7080 vty_out (vty
, ", hold time is %d, keepalive interval is %d seconds%s",
7081 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
7082 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
7084 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
7085 vty_out (vty
, ", keepalive interval is %d seconds%s",
7086 p
->keepalive
, VTY_NEWLINE
);
7090 if (p
->status
== Established
)
7093 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
7094 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
7095 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
7096 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
7098 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
7099 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
7100 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
7101 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
7102 #endif /* HAVE_IPV6 */
7103 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
7104 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
7106 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
7109 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
7110 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
7112 vty_out (vty
, " Dynamic:");
7113 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
7114 vty_out (vty
, " advertised");
7115 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
7116 vty_out (vty
, " %sreceived",
7117 CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) ? "and " : "");
7118 vty_out (vty
, "%s", VTY_NEWLINE
);
7122 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
7123 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
7124 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
7126 vty_out (vty
, " Route refresh:");
7127 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
7128 vty_out (vty
, " advertised");
7129 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
7130 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
7131 vty_out (vty
, " %sreceived(%s)",
7132 CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) ? "and " : "",
7133 (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
7134 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)) ?
7135 "old & new" : CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) ? "old" : "new");
7137 vty_out (vty
, "%s", VTY_NEWLINE
);
7140 /* Multiprotocol Extensions */
7141 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7142 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7143 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
7145 vty_out (vty
, " Address family %s:", afi_safi_print (afi
, safi
));
7146 if (p
->afc_adv
[afi
][safi
])
7147 vty_out (vty
, " advertised");
7148 if (p
->afc_recv
[afi
][safi
])
7149 vty_out (vty
, " %sreceived", p
->afc_adv
[afi
][safi
] ? "and " : "");
7150 vty_out (vty
, "%s", VTY_NEWLINE
);
7153 /* Gracefull Restart */
7154 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7155 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7157 vty_out (vty
, " Graceful Restart Capabilty:");
7158 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7159 vty_out (vty
, " advertised");
7160 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7161 vty_out (vty
, " %sreceived",
7162 CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) ? "and " : "");
7163 vty_out (vty
, "%s", VTY_NEWLINE
);
7165 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7167 int restart_af_count
= 0;
7169 vty_out (vty
, " Remote Restart timer is %d seconds%s",
7170 p
->v_gr_restart
, VTY_NEWLINE
);
7171 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
7173 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7174 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7175 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
7177 vty_out (vty
, "%s%s(%s)", restart_af_count
? ", " : "",
7178 afi_safi_print (afi
, safi
),
7179 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
) ?
7180 "preserved" : "not preserved");
7183 if (! restart_af_count
)
7184 vty_out (vty
, "none");
7185 vty_out (vty
, "%s", VTY_NEWLINE
);
7191 /* graceful restart information */
7192 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7196 int eor_send_af_count
= 0;
7197 int eor_receive_af_count
= 0;
7199 vty_out (vty
, " Graceful restart informations:%s", VTY_NEWLINE
);
7200 if (p
->status
== Established
)
7202 vty_out (vty
, " End-of-RIB send: ");
7203 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7204 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7205 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
7207 vty_out (vty
, "%s%s", eor_send_af_count
? ", " : "",
7208 afi_safi_print (afi
, safi
));
7209 eor_send_af_count
++;
7211 vty_out (vty
, "%s", VTY_NEWLINE
);
7213 vty_out (vty
, " End-of-RIB received: ");
7214 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7215 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7216 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
7218 vty_out (vty
, "%s%s", eor_receive_af_count
? ", " : "",
7219 afi_safi_print (afi
, safi
));
7220 eor_receive_af_count
++;
7222 vty_out (vty
, "%s", VTY_NEWLINE
);
7225 if (p
->t_gr_restart
)
7227 vty_out (vty
, " The remaining time of restart timer is %ld%s",
7228 thread_timer_remain_second (p
->t_gr_restart
), VTY_NEWLINE
);
7232 vty_out (vty
, " The remaining time of stalepath timer is %ld%s",
7233 thread_timer_remain_second (p
->t_gr_stale
), VTY_NEWLINE
);
7237 /* Packet counts. */
7238 vty_out (vty
, " Message statistics:%s", VTY_NEWLINE
);
7239 vty_out (vty
, " Inq depth is 0%s", VTY_NEWLINE
);
7240 vty_out (vty
, " Outq depth is %ld%s", p
->obuf
->count
, VTY_NEWLINE
);
7241 vty_out (vty
, " Sent Rcvd%s", VTY_NEWLINE
);
7242 vty_out (vty
, " Opens: %10d %10d%s", p
->open_out
, p
->open_in
, VTY_NEWLINE
);
7243 vty_out (vty
, " Notifications: %10d %10d%s", p
->notify_out
, p
->notify_in
, VTY_NEWLINE
);
7244 vty_out (vty
, " Updates: %10d %10d%s", p
->update_out
, p
->update_in
, VTY_NEWLINE
);
7245 vty_out (vty
, " Keepalives: %10d %10d%s", p
->keepalive_out
, p
->keepalive_in
, VTY_NEWLINE
);
7246 vty_out (vty
, " Route Refresh: %10d %10d%s", p
->refresh_out
, p
->refresh_in
, VTY_NEWLINE
);
7247 vty_out (vty
, " Capability: %10d %10d%s", p
->dynamic_cap_out
, p
->dynamic_cap_in
, VTY_NEWLINE
);
7248 vty_out (vty
, " Total: %10d %10d%s", p
->open_out
+ p
->notify_out
+
7249 p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
+ p
->dynamic_cap_out
,
7250 p
->open_in
+ p
->notify_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
+
7251 p
->dynamic_cap_in
, VTY_NEWLINE
);
7253 /* advertisement-interval */
7254 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
7255 p
->v_routeadv
, VTY_NEWLINE
);
7257 /* Update-source. */
7258 if (p
->update_if
|| p
->update_source
)
7260 vty_out (vty
, " Update source is ");
7262 vty_out (vty
, "%s", p
->update_if
);
7263 else if (p
->update_source
)
7265 sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
7266 vty_out (vty
, "%s", VTY_NEWLINE
);
7269 /* Default weight */
7270 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
7271 vty_out (vty
, " Default weight %d%s", p
->weight
,
7274 vty_out (vty
, "%s", VTY_NEWLINE
);
7276 /* Address Family Information */
7277 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7278 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7279 if (p
->afc
[afi
][safi
])
7280 bgp_show_peer_afi (vty
, p
, afi
, safi
);
7282 vty_out (vty
, " Connections established %d; dropped %d%s",
7283 p
->established
, p
->dropped
,
7287 vty_out (vty
, " Last reset never%s", VTY_NEWLINE
);
7289 vty_out (vty
, " Last reset %s, due to %s%s",
7290 peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
),
7291 peer_down_str
[(int) p
->last_reset
], VTY_NEWLINE
);
7293 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
7295 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
7297 if (p
->t_pmax_restart
)
7298 vty_out (vty
, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
7299 p
->host
, thread_timer_remain_second (p
->t_pmax_restart
),
7302 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
7303 p
->host
, VTY_NEWLINE
);
7307 if (peer_sort (p
) != BGP_PEER_IBGP
&& p
->ttl
> 1)
7308 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
7309 p
->ttl
, VTY_NEWLINE
);
7311 /* Local address. */
7314 vty_out (vty
, "Local host: %s, Local port: %d%s",
7315 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
7316 ntohs (p
->su_local
->sin
.sin_port
),
7320 /* Remote address. */
7323 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
7324 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
7325 ntohs (p
->su_remote
->sin
.sin_port
),
7329 /* Nexthop display. */
7332 vty_out (vty
, "Nexthop: %s%s",
7333 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
7336 vty_out (vty
, "Nexthop global: %s%s",
7337 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
7339 vty_out (vty
, "Nexthop local: %s%s",
7340 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
7342 vty_out (vty
, "BGP connection: %s%s",
7343 p
->shared_network
? "shared network" : "non shared network",
7345 #endif /* HAVE_IPV6 */
7348 /* Timer information. */
7350 vty_out (vty
, "Next start timer due in %ld seconds%s",
7351 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
7353 vty_out (vty
, "Next connect timer due in %ld seconds%s",
7354 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
7356 vty_out (vty
, "Read thread: %s Write thread: %s%s",
7357 p
->t_read
? "on" : "off",
7358 p
->t_write
? "on" : "off",
7361 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
7362 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
7363 bgp_capability_vty_out (vty
, p
);
7365 vty_out (vty
, "%s", VTY_NEWLINE
);
7369 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
,
7370 enum show_type type
, union sockunion
*su
)
7372 struct listnode
*node
, *nnode
;
7376 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
7381 bgp_show_peer (vty
, peer
);
7384 if (sockunion_same (&peer
->su
, su
))
7387 bgp_show_peer (vty
, peer
);
7393 if (type
== show_peer
&& ! find
)
7394 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
7400 bgp_show_neighbor_vty (struct vty
*vty
, const char *name
,
7401 enum show_type type
, const char *ip_str
)
7409 ret
= str2sockunion (ip_str
, &su
);
7412 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
7419 bgp
= bgp_lookup_by_name (name
);
7423 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
7427 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7432 bgp
= bgp_get_default ();
7435 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7440 /* "show ip bgp neighbors" commands. */
7441 DEFUN (show_ip_bgp_neighbors
,
7442 show_ip_bgp_neighbors_cmd
,
7443 "show ip bgp neighbors",
7447 "Detailed information on TCP and BGP neighbor connections\n")
7449 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
);
7452 ALIAS (show_ip_bgp_neighbors
,
7453 show_ip_bgp_ipv4_neighbors_cmd
,
7454 "show ip bgp ipv4 (unicast|multicast) neighbors",
7459 "Address Family modifier\n"
7460 "Address Family modifier\n"
7461 "Detailed information on TCP and BGP neighbor connections\n")
7463 ALIAS (show_ip_bgp_neighbors
,
7464 show_ip_bgp_vpnv4_all_neighbors_cmd
,
7465 "show ip bgp vpnv4 all neighbors",
7469 "Display VPNv4 NLRI specific information\n"
7470 "Display information about all VPNv4 NLRIs\n"
7471 "Detailed information on TCP and BGP neighbor connections\n")
7473 ALIAS (show_ip_bgp_neighbors
,
7474 show_ip_bgp_vpnv4_rd_neighbors_cmd
,
7475 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
7479 "Display VPNv4 NLRI specific information\n"
7480 "Display information for a route distinguisher\n"
7481 "VPN Route Distinguisher\n"
7482 "Detailed information on TCP and BGP neighbor connections\n")
7484 ALIAS (show_ip_bgp_neighbors
,
7485 show_bgp_neighbors_cmd
,
7486 "show bgp neighbors",
7489 "Detailed information on TCP and BGP neighbor connections\n")
7491 ALIAS (show_ip_bgp_neighbors
,
7492 show_bgp_ipv6_neighbors_cmd
,
7493 "show bgp ipv6 neighbors",
7497 "Detailed information on TCP and BGP neighbor connections\n")
7499 DEFUN (show_ip_bgp_neighbors_peer
,
7500 show_ip_bgp_neighbors_peer_cmd
,
7501 "show ip bgp neighbors (A.B.C.D|X:X::X:X)",
7505 "Detailed information on TCP and BGP neighbor connections\n"
7506 "Neighbor to display information about\n"
7507 "Neighbor to display information about\n")
7509 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 1]);
7512 ALIAS (show_ip_bgp_neighbors_peer
,
7513 show_ip_bgp_ipv4_neighbors_peer_cmd
,
7514 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)",
7519 "Address Family modifier\n"
7520 "Address Family modifier\n"
7521 "Detailed information on TCP and BGP neighbor connections\n"
7522 "Neighbor to display information about\n"
7523 "Neighbor to display information about\n")
7525 ALIAS (show_ip_bgp_neighbors_peer
,
7526 show_ip_bgp_vpnv4_all_neighbors_peer_cmd
,
7527 "show ip bgp vpnv4 all neighbors A.B.C.D",
7531 "Display VPNv4 NLRI specific information\n"
7532 "Display information about all VPNv4 NLRIs\n"
7533 "Detailed information on TCP and BGP neighbor connections\n"
7534 "Neighbor to display information about\n")
7536 ALIAS (show_ip_bgp_neighbors_peer
,
7537 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
,
7538 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
7542 "Display VPNv4 NLRI specific information\n"
7543 "Display information about all VPNv4 NLRIs\n"
7544 "Detailed information on TCP and BGP neighbor connections\n"
7545 "Neighbor to display information about\n")
7547 ALIAS (show_ip_bgp_neighbors_peer
,
7548 show_bgp_neighbors_peer_cmd
,
7549 "show bgp neighbors (A.B.C.D|X:X::X:X)",
7552 "Detailed information on TCP and BGP neighbor connections\n"
7553 "Neighbor to display information about\n"
7554 "Neighbor to display information about\n")
7556 ALIAS (show_ip_bgp_neighbors_peer
,
7557 show_bgp_ipv6_neighbors_peer_cmd
,
7558 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)",
7562 "Detailed information on TCP and BGP neighbor connections\n"
7563 "Neighbor to display information about\n"
7564 "Neighbor to display information about\n")
7566 DEFUN (show_ip_bgp_instance_neighbors
,
7567 show_ip_bgp_instance_neighbors_cmd
,
7568 "show ip bgp view WORD neighbors",
7574 "Detailed information on TCP and BGP neighbor connections\n")
7576 return bgp_show_neighbor_vty (vty
, argv
[0], show_all
, NULL
);
7579 ALIAS (show_ip_bgp_instance_neighbors
,
7580 show_bgp_instance_neighbors_cmd
,
7581 "show bgp view WORD neighbors",
7586 "Detailed information on TCP and BGP neighbor connections\n")
7588 ALIAS (show_ip_bgp_instance_neighbors
,
7589 show_bgp_instance_ipv6_neighbors_cmd
,
7590 "show bgp view WORD ipv6 neighbors",
7596 "Detailed information on TCP and BGP neighbor connections\n")
7598 DEFUN (show_ip_bgp_instance_neighbors_peer
,
7599 show_ip_bgp_instance_neighbors_peer_cmd
,
7600 "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7606 "Detailed information on TCP and BGP neighbor connections\n"
7607 "Neighbor to display information about\n"
7608 "Neighbor to display information about\n")
7610 return bgp_show_neighbor_vty (vty
, argv
[0], show_peer
, argv
[1]);
7613 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7614 show_bgp_instance_neighbors_peer_cmd
,
7615 "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7620 "Detailed information on TCP and BGP neighbor connections\n"
7621 "Neighbor to display information about\n"
7622 "Neighbor to display information about\n")
7624 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7625 show_bgp_instance_ipv6_neighbors_peer_cmd
,
7626 "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)",
7632 "Detailed information on TCP and BGP neighbor connections\n"
7633 "Neighbor to display information about\n"
7634 "Neighbor to display information about\n")
7636 /* Show BGP's AS paths internal data. There are both `show ip bgp
7637 paths' and `show ip mbgp paths'. Those functions results are the
7639 DEFUN (show_ip_bgp_paths
,
7640 show_ip_bgp_paths_cmd
,
7641 "show ip bgp paths",
7645 "Path information\n")
7647 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
7648 aspath_print_all_vty (vty
);
7652 DEFUN (show_ip_bgp_ipv4_paths
,
7653 show_ip_bgp_ipv4_paths_cmd
,
7654 "show ip bgp ipv4 (unicast|multicast) paths",
7659 "Address Family modifier\n"
7660 "Address Family modifier\n"
7661 "Path information\n")
7663 vty_out (vty
, "Address Refcnt Path\r\n");
7664 aspath_print_all_vty (vty
);
7672 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
7674 struct community
*com
;
7676 com
= (struct community
*) backet
->data
;
7677 vty_out (vty
, "[%p] (%ld) %s%s", backet
, com
->refcnt
,
7678 community_str (com
), VTY_NEWLINE
);
7681 /* Show BGP's community internal data. */
7682 DEFUN (show_ip_bgp_community_info
,
7683 show_ip_bgp_community_info_cmd
,
7684 "show ip bgp community-info",
7688 "List all bgp community information\n")
7690 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
7692 hash_iterate (community_hash (),
7693 (void (*) (struct hash_backet
*, void *))
7694 community_show_all_iterator
,
7700 DEFUN (show_ip_bgp_attr_info
,
7701 show_ip_bgp_attr_info_cmd
,
7702 "show ip bgp attribute-info",
7706 "List all bgp attribute information\n")
7708 attr_show_all (vty
);
7713 bgp_write_rsclient_summary (struct vty
*vty
, struct peer
*rsclient
,
7714 afi_t afi
, safi_t safi
)
7716 char timebuf
[BGP_UPTIME_LEN
];
7720 struct listnode
*node
, *nnode
;
7724 if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_GROUP
))
7726 for (ALL_LIST_ELEMENTS (rsclient
->group
->peer
, node
, nnode
, peer
))
7729 bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
7734 len
= vty_out (vty
, "%s", rsclient
->host
);
7738 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
7740 vty_out (vty
, "%*s", len
, " ");
7742 vty_out (vty
, "4 ");
7744 vty_out (vty
, "%5d ", rsclient
->as
);
7746 rmname
= ROUTE_MAP_EXPORT_NAME(&rsclient
->filter
[afi
][safi
]);
7747 if ( rmname
&& strlen (rmname
) > 13 )
7749 sprintf (rmbuf
, "%13s", "...");
7750 rmname
= strncpy (rmbuf
, rmname
, 10);
7754 vty_out (vty
, " %13s ", rmname
);
7756 rmname
= ROUTE_MAP_IMPORT_NAME(&rsclient
->filter
[afi
][safi
]);
7757 if ( rmname
&& strlen (rmname
) > 13 )
7759 sprintf (rmbuf
, "%13s", "...");
7760 rmname
= strncpy (rmbuf
, rmname
, 10);
7764 vty_out (vty
, " %13s ", rmname
);
7766 vty_out (vty
, "%8s", peer_uptime (rsclient
->uptime
, timebuf
, BGP_UPTIME_LEN
));
7768 if (CHECK_FLAG (rsclient
->flags
, PEER_FLAG_SHUTDOWN
))
7769 vty_out (vty
, " Idle (Admin)");
7770 else if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
7771 vty_out (vty
, " Idle (PfxCt)");
7773 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, rsclient
->status
));
7775 vty_out (vty
, "%s", VTY_NEWLINE
);
7781 bgp_show_rsclient_summary (struct vty
*vty
, struct bgp
*bgp
,
7782 afi_t afi
, safi_t safi
)
7785 struct listnode
*node
, *nnode
;
7788 /* Header string for each address family. */
7789 static char header
[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
7791 for (ALL_LIST_ELEMENTS (bgp
->rsclient
, node
, nnode
, peer
))
7793 if (peer
->afc
[afi
][safi
] &&
7794 CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
7799 "Route Server's BGP router identifier %s%s",
7800 inet_ntoa (bgp
->router_id
), VTY_NEWLINE
);
7802 "Route Server's local AS number %d%s", bgp
->as
,
7805 vty_out (vty
, "%s", VTY_NEWLINE
);
7806 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
7809 count
+= bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
7814 vty_out (vty
, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE
,
7815 count
, VTY_NEWLINE
);
7817 vty_out (vty
, "No %s Route Server Client is configured%s",
7818 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
7824 bgp_show_rsclient_summary_vty (struct vty
*vty
, const char *name
,
7825 afi_t afi
, safi_t safi
)
7831 bgp
= bgp_lookup_by_name (name
);
7835 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
7839 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
7843 bgp
= bgp_get_default ();
7846 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
7851 /* 'show bgp rsclient' commands. */
7852 DEFUN (show_ip_bgp_rsclient_summary
,
7853 show_ip_bgp_rsclient_summary_cmd
,
7854 "show ip bgp rsclient summary",
7858 "Information about Route Server Clients\n"
7859 "Summary of all Route Server Clients\n")
7861 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
7864 DEFUN (show_ip_bgp_instance_rsclient_summary
,
7865 show_ip_bgp_instance_rsclient_summary_cmd
,
7866 "show ip bgp view WORD rsclient summary",
7872 "Information about Route Server Clients\n"
7873 "Summary of all Route Server Clients\n")
7875 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
7878 DEFUN (show_ip_bgp_ipv4_rsclient_summary
,
7879 show_ip_bgp_ipv4_rsclient_summary_cmd
,
7880 "show ip bgp ipv4 (unicast|multicast) rsclient summary",
7885 "Address Family modifier\n"
7886 "Address Family modifier\n"
7887 "Information about Route Server Clients\n"
7888 "Summary of all Route Server Clients\n")
7890 if (strncmp (argv
[0], "m", 1) == 0)
7891 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
7893 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
7896 DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary
,
7897 show_ip_bgp_instance_ipv4_rsclient_summary_cmd
,
7898 "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary",
7905 "Address Family modifier\n"
7906 "Address Family modifier\n"
7907 "Information about Route Server Clients\n"
7908 "Summary of all Route Server Clients\n")
7910 if (strncmp (argv
[1], "m", 1) == 0)
7911 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
7913 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
7917 DEFUN (show_bgp_rsclient_summary
,
7918 show_bgp_rsclient_summary_cmd
,
7919 "show bgp rsclient summary",
7922 "Information about Route Server Clients\n"
7923 "Summary of all Route Server Clients\n")
7925 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
7928 DEFUN (show_bgp_instance_rsclient_summary
,
7929 show_bgp_instance_rsclient_summary_cmd
,
7930 "show bgp view WORD rsclient summary",
7935 "Information about Route Server Clients\n"
7936 "Summary of all Route Server Clients\n")
7938 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
7941 ALIAS (show_bgp_rsclient_summary
,
7942 show_bgp_ipv6_rsclient_summary_cmd
,
7943 "show bgp ipv6 rsclient summary",
7947 "Information about Route Server Clients\n"
7948 "Summary of all Route Server Clients\n")
7950 ALIAS (show_bgp_instance_rsclient_summary
,
7951 show_bgp_instance_ipv6_rsclient_summary_cmd
,
7952 "show bgp view WORD ipv6 rsclient summary",
7958 "Information about Route Server Clients\n"
7959 "Summary of all Route Server Clients\n")
7960 #endif /* HAVE IPV6 */
7962 /* Redistribute VTY commands. */
7964 /* Utility function to convert user input route type string to route
7967 bgp_str2route_type (int afi
, const char *str
)
7974 if (strncmp (str
, "k", 1) == 0)
7975 return ZEBRA_ROUTE_KERNEL
;
7976 else if (strncmp (str
, "c", 1) == 0)
7977 return ZEBRA_ROUTE_CONNECT
;
7978 else if (strncmp (str
, "s", 1) == 0)
7979 return ZEBRA_ROUTE_STATIC
;
7980 else if (strncmp (str
, "r", 1) == 0)
7981 return ZEBRA_ROUTE_RIP
;
7982 else if (strncmp (str
, "o", 1) == 0)
7983 return ZEBRA_ROUTE_OSPF
;
7987 if (strncmp (str
, "k", 1) == 0)
7988 return ZEBRA_ROUTE_KERNEL
;
7989 else if (strncmp (str
, "c", 1) == 0)
7990 return ZEBRA_ROUTE_CONNECT
;
7991 else if (strncmp (str
, "s", 1) == 0)
7992 return ZEBRA_ROUTE_STATIC
;
7993 else if (strncmp (str
, "r", 1) == 0)
7994 return ZEBRA_ROUTE_RIPNG
;
7995 else if (strncmp (str
, "o", 1) == 0)
7996 return ZEBRA_ROUTE_OSPF6
;
8001 DEFUN (bgp_redistribute_ipv4
,
8002 bgp_redistribute_ipv4_cmd
,
8003 "redistribute (connected|kernel|ospf|rip|static)",
8004 "Redistribute information from another routing protocol\n"
8007 "Open Shurtest Path First (OSPF)\n"
8008 "Routing Information Protocol (RIP)\n"
8013 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8016 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8019 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8022 DEFUN (bgp_redistribute_ipv4_rmap
,
8023 bgp_redistribute_ipv4_rmap_cmd
,
8024 "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
8025 "Redistribute information from another routing protocol\n"
8028 "Open Shurtest Path First (OSPF)\n"
8029 "Routing Information Protocol (RIP)\n"
8031 "Route map reference\n"
8032 "Pointer to route-map entries\n")
8036 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8039 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8043 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
8044 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8047 DEFUN (bgp_redistribute_ipv4_metric
,
8048 bgp_redistribute_ipv4_metric_cmd
,
8049 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
8050 "Redistribute information from another routing protocol\n"
8053 "Open Shurtest Path First (OSPF)\n"
8054 "Routing Information Protocol (RIP)\n"
8056 "Metric for redistributed routes\n"
8062 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8065 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8068 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8070 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8071 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8074 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
8075 bgp_redistribute_ipv4_rmap_metric_cmd
,
8076 "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
8077 "Redistribute information from another routing protocol\n"
8080 "Open Shurtest Path First (OSPF)\n"
8081 "Routing Information Protocol (RIP)\n"
8083 "Route map reference\n"
8084 "Pointer to route-map entries\n"
8085 "Metric for redistributed routes\n"
8091 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8094 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8097 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8099 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
8100 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8101 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8104 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
8105 bgp_redistribute_ipv4_metric_rmap_cmd
,
8106 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
8107 "Redistribute information from another routing protocol\n"
8110 "Open Shurtest Path First (OSPF)\n"
8111 "Routing Information Protocol (RIP)\n"
8113 "Metric for redistributed routes\n"
8115 "Route map reference\n"
8116 "Pointer to route-map entries\n")
8121 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8124 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8127 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8129 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8130 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[2]);
8131 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8134 DEFUN (no_bgp_redistribute_ipv4
,
8135 no_bgp_redistribute_ipv4_cmd
,
8136 "no redistribute (connected|kernel|ospf|rip|static)",
8138 "Redistribute information from another routing protocol\n"
8141 "Open Shurtest Path First (OSPF)\n"
8142 "Routing Information Protocol (RIP)\n"
8147 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8150 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8154 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
);
8157 DEFUN (no_bgp_redistribute_ipv4_rmap
,
8158 no_bgp_redistribute_ipv4_rmap_cmd
,
8159 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
8161 "Redistribute information from another routing protocol\n"
8164 "Open Shurtest Path First (OSPF)\n"
8165 "Routing Information Protocol (RIP)\n"
8167 "Route map reference\n"
8168 "Pointer to route-map entries\n")
8172 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8175 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8179 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8183 DEFUN (no_bgp_redistribute_ipv4_metric
,
8184 no_bgp_redistribute_ipv4_metric_cmd
,
8185 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
8187 "Redistribute information from another routing protocol\n"
8190 "Open Shurtest Path First (OSPF)\n"
8191 "Routing Information Protocol (RIP)\n"
8193 "Metric for redistributed routes\n"
8198 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8201 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8205 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8209 DEFUN (no_bgp_redistribute_ipv4_rmap_metric
,
8210 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
8211 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
8213 "Redistribute information from another routing protocol\n"
8216 "Open Shurtest Path First (OSPF)\n"
8217 "Routing Information Protocol (RIP)\n"
8219 "Route map reference\n"
8220 "Pointer to route-map entries\n"
8221 "Metric for redistributed routes\n"
8226 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8229 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8233 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8234 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8238 ALIAS (no_bgp_redistribute_ipv4_rmap_metric
,
8239 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
8240 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
8242 "Redistribute information from another routing protocol\n"
8245 "Open Shurtest Path First (OSPF)\n"
8246 "Routing Information Protocol (RIP)\n"
8248 "Metric for redistributed routes\n"
8250 "Route map reference\n"
8251 "Pointer to route-map entries\n")
8254 DEFUN (bgp_redistribute_ipv6
,
8255 bgp_redistribute_ipv6_cmd
,
8256 "redistribute (connected|kernel|ospf6|ripng|static)",
8257 "Redistribute information from another routing protocol\n"
8260 "Open Shurtest Path First (OSPFv3)\n"
8261 "Routing Information Protocol (RIPng)\n"
8266 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8269 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8273 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8276 DEFUN (bgp_redistribute_ipv6_rmap
,
8277 bgp_redistribute_ipv6_rmap_cmd
,
8278 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
8279 "Redistribute information from another routing protocol\n"
8282 "Open Shurtest Path First (OSPFv3)\n"
8283 "Routing Information Protocol (RIPng)\n"
8285 "Route map reference\n"
8286 "Pointer to route-map entries\n")
8290 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8293 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8297 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8298 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8301 DEFUN (bgp_redistribute_ipv6_metric
,
8302 bgp_redistribute_ipv6_metric_cmd
,
8303 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
8304 "Redistribute information from another routing protocol\n"
8307 "Open Shurtest Path First (OSPFv3)\n"
8308 "Routing Information Protocol (RIPng)\n"
8310 "Metric for redistributed routes\n"
8316 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8319 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8322 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8324 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8325 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8328 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
8329 bgp_redistribute_ipv6_rmap_metric_cmd
,
8330 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
8331 "Redistribute information from another routing protocol\n"
8334 "Open Shurtest Path First (OSPFv3)\n"
8335 "Routing Information Protocol (RIPng)\n"
8337 "Route map reference\n"
8338 "Pointer to route-map entries\n"
8339 "Metric for redistributed routes\n"
8345 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8348 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8351 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8353 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8354 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8355 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8358 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
8359 bgp_redistribute_ipv6_metric_rmap_cmd
,
8360 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
8361 "Redistribute information from another routing protocol\n"
8364 "Open Shurtest Path First (OSPFv3)\n"
8365 "Routing Information Protocol (RIPng)\n"
8367 "Metric for redistributed routes\n"
8369 "Route map reference\n"
8370 "Pointer to route-map entries\n")
8375 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8378 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8381 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8383 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8384 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[2]);
8385 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8388 DEFUN (no_bgp_redistribute_ipv6
,
8389 no_bgp_redistribute_ipv6_cmd
,
8390 "no redistribute (connected|kernel|ospf6|ripng|static)",
8392 "Redistribute information from another routing protocol\n"
8395 "Open Shurtest Path First (OSPFv3)\n"
8396 "Routing Information Protocol (RIPng)\n"
8401 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8404 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8408 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
);
8411 DEFUN (no_bgp_redistribute_ipv6_rmap
,
8412 no_bgp_redistribute_ipv6_rmap_cmd
,
8413 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
8415 "Redistribute information from another routing protocol\n"
8418 "Open Shurtest Path First (OSPFv3)\n"
8419 "Routing Information Protocol (RIPng)\n"
8421 "Route map reference\n"
8422 "Pointer to route-map entries\n")
8426 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8429 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8433 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8437 DEFUN (no_bgp_redistribute_ipv6_metric
,
8438 no_bgp_redistribute_ipv6_metric_cmd
,
8439 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
8441 "Redistribute information from another routing protocol\n"
8444 "Open Shurtest Path First (OSPFv3)\n"
8445 "Routing Information Protocol (RIPng)\n"
8447 "Metric for redistributed routes\n"
8452 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8455 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8459 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8463 DEFUN (no_bgp_redistribute_ipv6_rmap_metric
,
8464 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
8465 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
8467 "Redistribute information from another routing protocol\n"
8470 "Open Shurtest Path First (OSPFv3)\n"
8471 "Routing Information Protocol (RIPng)\n"
8473 "Route map reference\n"
8474 "Pointer to route-map entries\n"
8475 "Metric for redistributed routes\n"
8480 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8483 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8487 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8488 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8492 ALIAS (no_bgp_redistribute_ipv6_rmap_metric
,
8493 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
8494 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
8496 "Redistribute information from another routing protocol\n"
8499 "Open Shurtest Path First (OSPFv3)\n"
8500 "Routing Information Protocol (RIPng)\n"
8502 "Metric for redistributed routes\n"
8504 "Route map reference\n"
8505 "Pointer to route-map entries\n")
8506 #endif /* HAVE_IPV6 */
8509 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
8510 safi_t safi
, int *write
)
8514 /* Unicast redistribution only. */
8515 if (safi
!= SAFI_UNICAST
)
8518 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
8520 /* Redistribute BGP does not make sense. */
8521 if (bgp
->redist
[afi
][i
] && i
!= ZEBRA_ROUTE_BGP
)
8523 /* Display "address-family" when it is not yet diplayed. */
8524 bgp_config_write_family_header (vty
, afi
, safi
, write
);
8526 /* "redistribute" configuration. */
8527 vty_out (vty
, " redistribute %s", zebra_route_string(i
));
8529 if (bgp
->redist_metric_flag
[afi
][i
])
8530 vty_out (vty
, " metric %d", bgp
->redist_metric
[afi
][i
]);
8532 if (bgp
->rmap
[afi
][i
].name
)
8533 vty_out (vty
, " route-map %s", bgp
->rmap
[afi
][i
].name
);
8535 vty_out (vty
, "%s", VTY_NEWLINE
);
8541 /* BGP node structure. */
8542 struct cmd_node bgp_node
=
8545 "%s(config-router)# ",
8549 struct cmd_node bgp_ipv4_unicast_node
=
8552 "%s(config-router-af)# ",
8556 struct cmd_node bgp_ipv4_multicast_node
=
8559 "%s(config-router-af)# ",
8563 struct cmd_node bgp_ipv6_unicast_node
=
8566 "%s(config-router-af)# ",
8570 struct cmd_node bgp_ipv6_multicast_node
=
8573 "%s(config-router-af)# ",
8577 struct cmd_node bgp_vpnv4_node
=
8580 "%s(config-router-af)# ",
8584 static void community_list_vty (void);
8589 /* Install bgp top node. */
8590 install_node (&bgp_node
, bgp_config_write
);
8591 install_node (&bgp_ipv4_unicast_node
, NULL
);
8592 install_node (&bgp_ipv4_multicast_node
, NULL
);
8593 install_node (&bgp_ipv6_unicast_node
, NULL
);
8594 install_node (&bgp_ipv6_multicast_node
, NULL
);
8595 install_node (&bgp_vpnv4_node
, NULL
);
8597 /* Install default VTY commands to new nodes. */
8598 install_default (BGP_NODE
);
8599 install_default (BGP_IPV4_NODE
);
8600 install_default (BGP_IPV4M_NODE
);
8601 install_default (BGP_IPV6_NODE
);
8602 install_default (BGP_IPV6M_NODE
);
8603 install_default (BGP_VPNV4_NODE
);
8605 /* "bgp multiple-instance" commands. */
8606 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
8607 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
8609 /* "bgp config-type" commands. */
8610 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
8611 install_element (CONFIG_NODE
, &no_bgp_config_type_cmd
);
8613 /* Dummy commands (Currently not supported) */
8614 install_element (BGP_NODE
, &no_synchronization_cmd
);
8615 install_element (BGP_NODE
, &no_auto_summary_cmd
);
8617 /* "router bgp" commands. */
8618 install_element (CONFIG_NODE
, &router_bgp_cmd
);
8619 install_element (CONFIG_NODE
, &router_bgp_view_cmd
);
8621 /* "no router bgp" commands. */
8622 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
8623 install_element (CONFIG_NODE
, &no_router_bgp_view_cmd
);
8625 /* "bgp router-id" commands. */
8626 install_element (BGP_NODE
, &bgp_router_id_cmd
);
8627 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
8628 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
8630 /* "bgp cluster-id" commands. */
8631 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
8632 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
8633 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
8634 install_element (BGP_NODE
, &no_bgp_cluster_id_arg_cmd
);
8636 /* "bgp confederation" commands. */
8637 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
8638 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
8639 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
8641 /* "bgp confederation peers" commands. */
8642 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
8643 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
8645 /* "timers bgp" commands. */
8646 install_element (BGP_NODE
, &bgp_timers_cmd
);
8647 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
8648 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
8650 /* "bgp client-to-client reflection" commands */
8651 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
8652 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
8654 /* "bgp always-compare-med" commands */
8655 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
8656 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
8658 /* "bgp deterministic-med" commands */
8659 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
8660 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
8662 /* "bgp graceful-restart" commands */
8663 install_element (BGP_NODE
, &bgp_graceful_restart_cmd
);
8664 install_element (BGP_NODE
, &no_bgp_graceful_restart_cmd
);
8665 install_element (BGP_NODE
, &bgp_graceful_restart_stalepath_time_cmd
);
8666 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_cmd
);
8667 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_val_cmd
);
8669 /* "bgp fast-external-failover" commands */
8670 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
8671 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
8673 /* "bgp enforce-first-as" commands */
8674 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
8675 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
8677 /* "bgp bestpath compare-routerid" commands */
8678 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
8679 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
8681 /* "bgp bestpath as-path ignore" commands */
8682 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
8683 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
8685 /* "bgp bestpath as-path confed" commands */
8686 install_element (BGP_NODE
, &bgp_bestpath_aspath_confed_cmd
);
8687 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_confed_cmd
);
8689 /* "bgp log-neighbor-changes" commands */
8690 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
8691 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
8693 /* "bgp bestpath med" commands */
8694 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
8695 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
8696 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
8697 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
8698 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
8699 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
8701 /* "no bgp default ipv4-unicast" commands. */
8702 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
8703 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
8705 /* "bgp network import-check" commands. */
8706 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
8707 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
8709 /* "bgp default local-preference" commands. */
8710 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
8711 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
8712 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
8714 /* "neighbor remote-as" commands. */
8715 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
8716 install_element (BGP_NODE
, &no_neighbor_cmd
);
8717 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
8719 /* "neighbor peer-group" commands. */
8720 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
8721 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
8722 install_element (BGP_NODE
, &no_neighbor_peer_group_remote_as_cmd
);
8724 /* "neighbor local-as" commands. */
8725 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
8726 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
8727 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
8728 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
8729 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
8731 /* "neighbor activate" commands. */
8732 install_element (BGP_NODE
, &neighbor_activate_cmd
);
8733 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
8734 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
8735 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
8736 install_element (BGP_IPV6M_NODE
, &neighbor_activate_cmd
);
8737 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
8739 /* "no neighbor activate" commands. */
8740 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
8741 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
8742 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
8743 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
8744 install_element (BGP_IPV6M_NODE
, &no_neighbor_activate_cmd
);
8745 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
8747 /* "neighbor peer-group set" commands. */
8748 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
8749 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
8750 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
8751 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
8752 install_element (BGP_IPV6M_NODE
, &neighbor_set_peer_group_cmd
);
8753 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
8755 /* "no neighbor peer-group unset" commands. */
8756 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
8757 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
8758 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
8759 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
8760 install_element (BGP_IPV6M_NODE
, &no_neighbor_set_peer_group_cmd
);
8761 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
8763 /* "neighbor softreconfiguration inbound" commands.*/
8764 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
8765 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8766 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
8767 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8768 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
8769 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8770 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
8771 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8772 install_element (BGP_IPV6M_NODE
, &neighbor_soft_reconfiguration_cmd
);
8773 install_element (BGP_IPV6M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8774 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
8775 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8777 /* "neighbor attribute-unchanged" commands. */
8778 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
8779 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
8780 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
8781 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
8782 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
8783 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
8784 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
8785 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
8786 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
8787 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
8788 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
8789 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
8790 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8791 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8792 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8793 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8794 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8795 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8796 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8797 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8798 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8799 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8800 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
8801 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
8802 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
8803 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
8804 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
8805 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
8806 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
8807 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
8808 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
8809 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
8810 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
8811 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
8812 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8813 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8814 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8815 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8816 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8817 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8818 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8819 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8820 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8821 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8822 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
8823 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
8824 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
8825 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
8826 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
8827 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
8828 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
8829 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
8830 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
8831 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
8832 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
8833 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
8834 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8835 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8836 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8837 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8838 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8839 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8840 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8841 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8842 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8843 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8844 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
8845 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
8846 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
8847 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
8848 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
8849 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
8850 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
8851 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
8852 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
8853 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
8854 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
8855 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
8856 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8857 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8858 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8859 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8860 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8861 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8862 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8863 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8864 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8865 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8866 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged_cmd
);
8867 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged1_cmd
);
8868 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged2_cmd
);
8869 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged3_cmd
);
8870 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged4_cmd
);
8871 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged5_cmd
);
8872 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged6_cmd
);
8873 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged7_cmd
);
8874 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged8_cmd
);
8875 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged9_cmd
);
8876 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged10_cmd
);
8877 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged_cmd
);
8878 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8879 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8880 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8881 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8882 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8883 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8884 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8885 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8886 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8887 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8888 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
8889 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
8890 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
8891 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
8892 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
8893 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
8894 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
8895 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
8896 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
8897 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
8898 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
8899 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
8900 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8901 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8902 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8903 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8904 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8905 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8906 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8907 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8908 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8909 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8911 /* "nexthop-local unchanged" commands */
8912 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_local_unchanged_cmd
);
8913 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_local_unchanged_cmd
);
8915 /* "transparent-as" and "transparent-nexthop" for old version
8917 install_element (BGP_NODE
, &neighbor_transparent_as_cmd
);
8918 install_element (BGP_NODE
, &neighbor_transparent_nexthop_cmd
);
8920 /* "neighbor next-hop-self" commands. */
8921 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
8922 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
8923 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
8924 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
8925 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
8926 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
8927 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
8928 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
8929 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_cmd
);
8930 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_cmd
);
8931 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
8932 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
8934 /* "neighbor remove-private-AS" commands. */
8935 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
8936 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
8937 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
8938 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
8939 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
8940 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
8941 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
8942 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
8943 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_cmd
);
8944 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_cmd
);
8945 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
8946 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
8948 /* "neighbor send-community" commands.*/
8949 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
8950 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
8951 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
8952 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
8953 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
8954 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
8955 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
8956 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
8957 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
8958 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
8959 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
8960 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
8961 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
8962 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
8963 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
8964 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
8965 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_cmd
);
8966 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_type_cmd
);
8967 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_cmd
);
8968 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_type_cmd
);
8969 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
8970 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
8971 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
8972 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
8974 /* "neighbor route-reflector" commands.*/
8975 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
8976 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
8977 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
8978 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
8979 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
8980 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
8981 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
8982 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
8983 install_element (BGP_IPV6M_NODE
, &neighbor_route_reflector_client_cmd
);
8984 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_reflector_client_cmd
);
8985 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
8986 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
8988 /* "neighbor route-server" commands.*/
8989 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
8990 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
8991 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
8992 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
8993 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
8994 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
8995 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
8996 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
8997 install_element (BGP_IPV6M_NODE
, &neighbor_route_server_client_cmd
);
8998 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_server_client_cmd
);
8999 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
9000 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
9002 /* "neighbor passive" commands. */
9003 install_element (BGP_NODE
, &neighbor_passive_cmd
);
9004 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
9006 /* "neighbor shutdown" commands. */
9007 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
9008 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
9010 /* Deprecated "neighbor capability route-refresh" commands.*/
9011 install_element (BGP_NODE
, &neighbor_capability_route_refresh_cmd
);
9012 install_element (BGP_NODE
, &no_neighbor_capability_route_refresh_cmd
);
9014 /* "neighbor capability orf prefix-list" commands.*/
9015 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
9016 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9017 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
9018 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9019 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
9020 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9021 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
9022 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9023 install_element (BGP_IPV6M_NODE
, &neighbor_capability_orf_prefix_cmd
);
9024 install_element (BGP_IPV6M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9026 /* "neighbor capability dynamic" commands.*/
9027 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
9028 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
9030 /* "neighbor dont-capability-negotiate" commands. */
9031 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
9032 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
9034 /* "neighbor ebgp-multihop" commands. */
9035 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
9036 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
9037 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
9038 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
9040 /* "neighbor disable-connected-check" commands. */
9041 install_element (BGP_NODE
, &neighbor_disable_connected_check_cmd
);
9042 install_element (BGP_NODE
, &no_neighbor_disable_connected_check_cmd
);
9043 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
9044 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
9046 /* "neighbor description" commands. */
9047 install_element (BGP_NODE
, &neighbor_description_cmd
);
9048 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
9049 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
9051 /* "neighbor update-source" commands. "*/
9052 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
9053 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
9055 /* "neighbor default-originate" commands. */
9056 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
9057 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
9058 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
9059 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9060 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
9061 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
9062 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
9063 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9064 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
9065 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
9066 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
9067 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9068 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
9069 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
9070 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
9071 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9072 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_cmd
);
9073 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_rmap_cmd
);
9074 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_cmd
);
9075 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9077 /* "neighbor port" commands. */
9078 install_element (BGP_NODE
, &neighbor_port_cmd
);
9079 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
9080 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
9082 /* "neighbor weight" commands. */
9083 install_element (BGP_NODE
, &neighbor_weight_cmd
);
9084 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
9085 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
9087 /* "neighbor override-capability" commands. */
9088 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
9089 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
9091 /* "neighbor strict-capability-match" commands. */
9092 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
9093 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
9095 /* "neighbor timers" commands. */
9096 install_element (BGP_NODE
, &neighbor_timers_cmd
);
9097 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
9099 /* "neighbor timers connect" commands. */
9100 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
9101 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
9102 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
9104 /* "neighbor advertisement-interval" commands. */
9105 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
9106 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
9107 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
9109 /* "neighbor version" commands. */
9110 install_element (BGP_NODE
, &neighbor_version_cmd
);
9112 /* "neighbor interface" commands. */
9113 install_element (BGP_NODE
, &neighbor_interface_cmd
);
9114 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
9116 /* "neighbor distribute" commands. */
9117 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
9118 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
9119 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
9120 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
9121 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
9122 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
9123 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
9124 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
9125 install_element (BGP_IPV6M_NODE
, &neighbor_distribute_list_cmd
);
9126 install_element (BGP_IPV6M_NODE
, &no_neighbor_distribute_list_cmd
);
9127 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
9128 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
9130 /* "neighbor prefix-list" commands. */
9131 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
9132 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
9133 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
9134 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
9135 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
9136 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
9137 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
9138 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
9139 install_element (BGP_IPV6M_NODE
, &neighbor_prefix_list_cmd
);
9140 install_element (BGP_IPV6M_NODE
, &no_neighbor_prefix_list_cmd
);
9141 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
9142 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
9144 /* "neighbor filter-list" commands. */
9145 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
9146 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
9147 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
9148 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
9149 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
9150 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
9151 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
9152 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
9153 install_element (BGP_IPV6M_NODE
, &neighbor_filter_list_cmd
);
9154 install_element (BGP_IPV6M_NODE
, &no_neighbor_filter_list_cmd
);
9155 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
9156 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
9158 /* "neighbor route-map" commands. */
9159 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
9160 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
9161 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
9162 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
9163 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
9164 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
9165 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
9166 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
9167 install_element (BGP_IPV6M_NODE
, &neighbor_route_map_cmd
);
9168 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_map_cmd
);
9169 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
9170 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
9172 /* "neighbor unsuppress-map" commands. */
9173 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
9174 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
9175 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
9176 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
9177 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
9178 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
9179 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
9180 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
9181 install_element (BGP_IPV6M_NODE
, &neighbor_unsuppress_map_cmd
);
9182 install_element (BGP_IPV6M_NODE
, &no_neighbor_unsuppress_map_cmd
);
9183 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
9184 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
9186 /* "neighbor maximum-prefix" commands. */
9187 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
9188 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9189 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9190 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9191 install_element (BGP_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9192 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9193 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
9194 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9195 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9196 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9197 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9198 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9199 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9200 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
9201 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9202 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9203 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9204 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9205 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9206 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
9207 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9208 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9209 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9210 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9211 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9212 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9213 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
9214 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9215 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9216 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9217 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9218 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9219 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
9220 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9221 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9222 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9223 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9224 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9225 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9226 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
9227 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9228 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9229 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9230 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9231 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9232 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
9233 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9234 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9235 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9236 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9237 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9238 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9239 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_cmd
);
9240 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9241 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9242 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9243 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9244 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9245 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_cmd
);
9246 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9247 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9248 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9249 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9250 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9251 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9252 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
9253 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9254 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9255 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9256 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9257 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9258 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
9259 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9260 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9261 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9262 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9263 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9264 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9266 /* "neighbor allowas-in" */
9267 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
9268 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
9269 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
9270 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
9271 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
9272 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
9273 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
9274 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
9275 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
9276 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
9277 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
9278 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
9279 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_cmd
);
9280 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_arg_cmd
);
9281 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_cmd
);
9282 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
9283 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
9284 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
9286 /* address-family commands. */
9287 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
9288 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
9290 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
9291 install_element (BGP_NODE
, &address_family_ipv6_safi_cmd
);
9292 #endif /* HAVE_IPV6 */
9293 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
9294 install_element (BGP_NODE
, &address_family_vpnv4_unicast_cmd
);
9296 /* "exit-address-family" command. */
9297 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
9298 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
9299 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
9300 install_element (BGP_IPV6M_NODE
, &exit_address_family_cmd
);
9301 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
9303 /* "clear ip bgp commands" */
9304 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
9305 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
9306 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
9307 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
9308 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
9309 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
9311 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
9312 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
9313 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
9314 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
9315 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
9316 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
9317 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
9318 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
9319 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
9320 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
9321 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
9322 #endif /* HAVE_IPV6 */
9324 /* "clear ip bgp neighbor soft in" */
9325 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
9326 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
9327 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
9328 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
9329 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_prefix_filter_cmd
);
9330 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
9331 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
9332 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
9333 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
9334 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
9335 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
9336 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
9337 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
9338 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
9339 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
9340 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
9341 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
9342 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
9343 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
9344 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
9345 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
9346 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
);
9347 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
9348 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
9349 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
9350 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
9351 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
9352 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
9353 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
9354 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
9355 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
9356 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
9357 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
9358 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
9359 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_in_cmd
);
9360 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_in_cmd
);
9361 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_in_cmd
);
9362 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_in_cmd
);
9363 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_in_cmd
);
9364 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_in_cmd
);
9366 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
9367 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
9368 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
9369 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
9370 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
9371 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
9372 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
9373 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
9374 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
9375 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
9376 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
9377 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
9378 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
9379 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
9380 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
9381 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
9382 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
9383 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
9384 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
9385 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
9386 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
9387 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
9388 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
9389 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
9390 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
9391 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
9392 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
9393 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
9394 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
9395 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
9396 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
9397 #endif /* HAVE_IPV6 */
9399 /* "clear ip bgp neighbor soft out" */
9400 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
9401 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
9402 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
9403 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
9404 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
9405 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
9406 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
9407 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
9408 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
9409 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
9410 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
9411 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
9412 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
9413 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
9414 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
9415 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
9416 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
9417 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
9418 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
9419 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
9420 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
9421 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
9422 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_out_cmd
);
9423 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_out_cmd
);
9424 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_out_cmd
);
9425 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_out_cmd
);
9426 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_out_cmd
);
9427 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_out_cmd
);
9429 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
9430 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
9431 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
9432 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
9433 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
9434 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
9435 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
9436 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
9437 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
9438 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
9439 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
9440 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
9441 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
9442 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
9443 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
9444 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
9445 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
9446 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
9447 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
9448 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
9449 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
9450 #endif /* HAVE_IPV6 */
9452 /* "clear ip bgp neighbor soft" */
9453 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
9454 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
9455 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
9456 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
9457 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
9458 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
9459 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
9460 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
9461 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
9462 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
9463 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
9464 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
9465 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_cmd
);
9466 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_cmd
);
9467 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_cmd
);
9469 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
9470 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
9471 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
9472 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
9473 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
9474 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
9475 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
9476 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
9477 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
9478 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
9479 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
9480 #endif /* HAVE_IPV6 */
9482 /* "clear ip bgp neighbor rsclient" */
9483 install_element (ENABLE_NODE
, &clear_ip_bgp_all_rsclient_cmd
);
9484 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_rsclient_cmd
);
9485 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_rsclient_cmd
);
9486 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_rsclient_cmd
);
9488 install_element (ENABLE_NODE
, &clear_bgp_all_rsclient_cmd
);
9489 install_element (ENABLE_NODE
, &clear_bgp_instance_all_rsclient_cmd
);
9490 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_rsclient_cmd
);
9491 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_all_rsclient_cmd
);
9492 install_element (ENABLE_NODE
, &clear_bgp_peer_rsclient_cmd
);
9493 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_rsclient_cmd
);
9494 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_rsclient_cmd
);
9495 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_peer_rsclient_cmd
);
9496 #endif /* HAVE_IPV6 */
9498 /* "show ip bgp summary" commands. */
9499 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
9500 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
9501 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9502 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9503 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9504 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9506 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
9507 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
9508 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
9509 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9510 #endif /* HAVE_IPV6 */
9511 install_element (ENABLE_NODE
, &show_ip_bgp_summary_cmd
);
9512 install_element (ENABLE_NODE
, &show_ip_bgp_instance_summary_cmd
);
9513 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9514 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9515 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9516 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9518 install_element (ENABLE_NODE
, &show_bgp_summary_cmd
);
9519 install_element (ENABLE_NODE
, &show_bgp_instance_summary_cmd
);
9520 install_element (ENABLE_NODE
, &show_bgp_ipv6_summary_cmd
);
9521 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9522 #endif /* HAVE_IPV6 */
9524 /* "show ip bgp neighbors" commands. */
9525 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
9526 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
9527 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9528 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9529 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
9530 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
9531 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9532 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9533 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
9534 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9535 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_cmd
);
9536 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
9537 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9538 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9539 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
9540 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
9541 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9542 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9543 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
9544 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9547 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
9548 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
9549 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
9550 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9551 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
9552 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
9553 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9554 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9555 install_element (ENABLE_NODE
, &show_bgp_neighbors_cmd
);
9556 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_cmd
);
9557 install_element (ENABLE_NODE
, &show_bgp_neighbors_peer_cmd
);
9558 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9559 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_cmd
);
9560 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
9561 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9562 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9565 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
9566 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
9567 install_element (ENABLE_NODE
, &show_ipv6_bgp_summary_cmd
);
9568 install_element (ENABLE_NODE
, &show_ipv6_mbgp_summary_cmd
);
9569 #endif /* HAVE_IPV6 */
9571 /* "show ip bgp rsclient" commands. */
9572 install_element (VIEW_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9573 install_element (VIEW_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9574 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9575 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9576 install_element (ENABLE_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9577 install_element (ENABLE_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9578 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9579 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9582 install_element (VIEW_NODE
, &show_bgp_rsclient_summary_cmd
);
9583 install_element (VIEW_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9584 install_element (VIEW_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9585 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9586 install_element (ENABLE_NODE
, &show_bgp_rsclient_summary_cmd
);
9587 install_element (ENABLE_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9588 install_element (ENABLE_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9589 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9590 #endif /* HAVE_IPV6 */
9592 /* "show ip bgp paths" commands. */
9593 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
9594 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
9595 install_element (ENABLE_NODE
, &show_ip_bgp_paths_cmd
);
9596 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
9598 /* "show ip bgp community" commands. */
9599 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
9600 install_element (ENABLE_NODE
, &show_ip_bgp_community_info_cmd
);
9602 /* "show ip bgp attribute-info" commands. */
9603 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
9604 install_element (ENABLE_NODE
, &show_ip_bgp_attr_info_cmd
);
9606 /* "redistribute" commands. */
9607 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
9608 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
9609 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
9610 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
9611 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
9612 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
9613 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
9614 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
9615 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
9616 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
9618 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
9619 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
9620 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
9621 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
9622 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
9623 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
9624 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
9625 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
9626 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
9627 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
9628 #endif /* HAVE_IPV6 */
9630 /* Community-list. */
9631 community_list_vty ();
9635 #include "bgp_regex.h"
9636 #include "bgp_clist.h"
9637 #include "bgp_ecommunity.h"
9639 /* VTY functions. */
9641 /* Direction value to string conversion. */
9643 community_direct_str (int direct
)
9647 case COMMUNITY_DENY
:
9650 case COMMUNITY_PERMIT
:
9659 /* Display error string. */
9661 community_list_perror (struct vty
*vty
, int ret
)
9665 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
9666 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
9668 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
9669 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
9671 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
9672 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
9674 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
9675 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
9680 /* VTY interface for community_set() function. */
9682 community_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
9683 int style
, int reject_all_digit_name
)
9689 /* Check the list type. */
9690 if (strncmp (argv
[1], "p", 1) == 0)
9691 direct
= COMMUNITY_PERMIT
;
9692 else if (strncmp (argv
[1], "d", 1) == 0)
9693 direct
= COMMUNITY_DENY
;
9696 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9701 /* All digit name check. */
9702 if (reject_all_digit_name
&& all_digit (argv
[0]))
9704 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
9708 /* Concat community string argument. */
9710 str
= argv_concat (argv
, argc
, 2);
9714 /* When community_list_set() return nevetive value, it means
9715 malformed community string. */
9716 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
9718 /* Free temporary community list string allocated by
9721 XFREE (MTYPE_TMP
, str
);
9725 /* Display error string. */
9726 community_list_perror (vty
, ret
);
9733 /* Communiyt-list entry delete. */
9735 community_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
9744 /* Check the list direct. */
9745 if (strncmp (argv
[1], "p", 1) == 0)
9746 direct
= COMMUNITY_PERMIT
;
9747 else if (strncmp (argv
[1], "d", 1) == 0)
9748 direct
= COMMUNITY_DENY
;
9751 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9756 /* Concat community string argument. */
9757 str
= argv_concat (argv
, argc
, 2);
9760 /* Unset community list. */
9761 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
9763 /* Free temporary community list string allocated by
9766 XFREE (MTYPE_TMP
, str
);
9770 community_list_perror (vty
, ret
);
9777 /* "community-list" keyword help string. */
9778 #define COMMUNITY_LIST_STR "Add a community list entry\n"
9779 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
9781 DEFUN (ip_community_list_standard
,
9782 ip_community_list_standard_cmd
,
9783 "ip community-list <1-99> (deny|permit) .AA:NN",
9786 "Community list number (standard)\n"
9787 "Specify community to reject\n"
9788 "Specify community to accept\n"
9791 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
9794 ALIAS (ip_community_list_standard
,
9795 ip_community_list_standard2_cmd
,
9796 "ip community-list <1-99> (deny|permit)",
9799 "Community list number (standard)\n"
9800 "Specify community to reject\n"
9801 "Specify community to accept\n")
9803 DEFUN (ip_community_list_expanded
,
9804 ip_community_list_expanded_cmd
,
9805 "ip community-list <100-500> (deny|permit) .LINE",
9808 "Community list number (expanded)\n"
9809 "Specify community to reject\n"
9810 "Specify community to accept\n"
9811 "An ordered list as a regular-expression\n")
9813 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
9816 DEFUN (ip_community_list_name_standard
,
9817 ip_community_list_name_standard_cmd
,
9818 "ip community-list standard WORD (deny|permit) .AA:NN",
9821 "Add a standard community-list entry\n"
9822 "Community list name\n"
9823 "Specify community to reject\n"
9824 "Specify community to accept\n"
9827 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
9830 ALIAS (ip_community_list_name_standard
,
9831 ip_community_list_name_standard2_cmd
,
9832 "ip community-list standard WORD (deny|permit)",
9835 "Add a standard community-list entry\n"
9836 "Community list name\n"
9837 "Specify community to reject\n"
9838 "Specify community to accept\n")
9840 DEFUN (ip_community_list_name_expanded
,
9841 ip_community_list_name_expanded_cmd
,
9842 "ip community-list expanded WORD (deny|permit) .LINE",
9845 "Add an expanded community-list entry\n"
9846 "Community list name\n"
9847 "Specify community to reject\n"
9848 "Specify community to accept\n"
9849 "An ordered list as a regular-expression\n")
9851 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
9854 DEFUN (no_ip_community_list_standard_all
,
9855 no_ip_community_list_standard_all_cmd
,
9856 "no ip community-list <1-99>",
9860 "Community list number (standard)\n")
9862 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
9865 DEFUN (no_ip_community_list_expanded_all
,
9866 no_ip_community_list_expanded_all_cmd
,
9867 "no ip community-list <100-500>",
9871 "Community list number (expanded)\n")
9873 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
9876 DEFUN (no_ip_community_list_name_standard_all
,
9877 no_ip_community_list_name_standard_all_cmd
,
9878 "no ip community-list standard WORD",
9882 "Add a standard community-list entry\n"
9883 "Community list name\n")
9885 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
9888 DEFUN (no_ip_community_list_name_expanded_all
,
9889 no_ip_community_list_name_expanded_all_cmd
,
9890 "no ip community-list expanded WORD",
9894 "Add an expanded community-list entry\n"
9895 "Community list name\n")
9897 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
9900 DEFUN (no_ip_community_list_standard
,
9901 no_ip_community_list_standard_cmd
,
9902 "no ip community-list <1-99> (deny|permit) .AA:NN",
9906 "Community list number (standard)\n"
9907 "Specify community to reject\n"
9908 "Specify community to accept\n"
9911 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
9914 DEFUN (no_ip_community_list_expanded
,
9915 no_ip_community_list_expanded_cmd
,
9916 "no ip community-list <100-500> (deny|permit) .LINE",
9920 "Community list number (expanded)\n"
9921 "Specify community to reject\n"
9922 "Specify community to accept\n"
9923 "An ordered list as a regular-expression\n")
9925 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
9928 DEFUN (no_ip_community_list_name_standard
,
9929 no_ip_community_list_name_standard_cmd
,
9930 "no ip community-list standard WORD (deny|permit) .AA:NN",
9934 "Specify a standard community-list\n"
9935 "Community list name\n"
9936 "Specify community to reject\n"
9937 "Specify community to accept\n"
9940 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
9943 DEFUN (no_ip_community_list_name_expanded
,
9944 no_ip_community_list_name_expanded_cmd
,
9945 "no ip community-list expanded WORD (deny|permit) .LINE",
9949 "Specify an expanded community-list\n"
9950 "Community list name\n"
9951 "Specify community to reject\n"
9952 "Specify community to accept\n"
9953 "An ordered list as a regular-expression\n")
9955 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
9959 community_list_show (struct vty
*vty
, struct community_list
*list
)
9961 struct community_entry
*entry
;
9963 for (entry
= list
->head
; entry
; entry
= entry
->next
)
9965 if (entry
== list
->head
)
9967 if (all_digit (list
->name
))
9968 vty_out (vty
, "Community %s list %s%s",
9969 entry
->style
== COMMUNITY_LIST_STANDARD
?
9970 "standard" : "(expanded) access",
9971 list
->name
, VTY_NEWLINE
);
9973 vty_out (vty
, "Named Community %s list %s%s",
9974 entry
->style
== COMMUNITY_LIST_STANDARD
?
9975 "standard" : "expanded",
9976 list
->name
, VTY_NEWLINE
);
9979 vty_out (vty
, " %s%s",
9980 community_direct_str (entry
->direct
), VTY_NEWLINE
);
9982 vty_out (vty
, " %s %s%s",
9983 community_direct_str (entry
->direct
),
9984 entry
->style
== COMMUNITY_LIST_STANDARD
9985 ? community_str (entry
->u
.com
) : entry
->config
,
9990 DEFUN (show_ip_community_list
,
9991 show_ip_community_list_cmd
,
9992 "show ip community-list",
9995 "List community-list\n")
9997 struct community_list
*list
;
9998 struct community_list_master
*cm
;
10000 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
10002 return CMD_SUCCESS
;
10004 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10005 community_list_show (vty
, list
);
10007 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10008 community_list_show (vty
, list
);
10010 return CMD_SUCCESS
;
10013 DEFUN (show_ip_community_list_arg
,
10014 show_ip_community_list_arg_cmd
,
10015 "show ip community-list (<1-500>|WORD)",
10018 "List community-list\n"
10019 "Community-list number\n"
10020 "Community-list name\n")
10022 struct community_list
*list
;
10024 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_MASTER
);
10027 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
10028 return CMD_WARNING
;
10031 community_list_show (vty
, list
);
10033 return CMD_SUCCESS
;
10037 extcommunity_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
10038 int style
, int reject_all_digit_name
)
10044 /* Check the list type. */
10045 if (strncmp (argv
[1], "p", 1) == 0)
10046 direct
= COMMUNITY_PERMIT
;
10047 else if (strncmp (argv
[1], "d", 1) == 0)
10048 direct
= COMMUNITY_DENY
;
10051 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10053 return CMD_WARNING
;
10056 /* All digit name check. */
10057 if (reject_all_digit_name
&& all_digit (argv
[0]))
10059 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
10060 return CMD_WARNING
;
10063 /* Concat community string argument. */
10065 str
= argv_concat (argv
, argc
, 2);
10069 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
10071 /* Free temporary community list string allocated by
10074 XFREE (MTYPE_TMP
, str
);
10078 community_list_perror (vty
, ret
);
10079 return CMD_WARNING
;
10081 return CMD_SUCCESS
;
10085 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
10094 /* Check the list direct. */
10095 if (strncmp (argv
[1], "p", 1) == 0)
10096 direct
= COMMUNITY_PERMIT
;
10097 else if (strncmp (argv
[1], "d", 1) == 0)
10098 direct
= COMMUNITY_DENY
;
10101 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10103 return CMD_WARNING
;
10106 /* Concat community string argument. */
10107 str
= argv_concat (argv
, argc
, 2);
10110 /* Unset community list. */
10111 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
10113 /* Free temporary community list string allocated by
10116 XFREE (MTYPE_TMP
, str
);
10120 community_list_perror (vty
, ret
);
10121 return CMD_WARNING
;
10124 return CMD_SUCCESS
;
10127 /* "extcommunity-list" keyword help string. */
10128 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
10129 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
10131 DEFUN (ip_extcommunity_list_standard
,
10132 ip_extcommunity_list_standard_cmd
,
10133 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
10135 EXTCOMMUNITY_LIST_STR
10136 "Extended Community list number (standard)\n"
10137 "Specify community to reject\n"
10138 "Specify community to accept\n"
10139 EXTCOMMUNITY_VAL_STR
)
10141 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
10144 ALIAS (ip_extcommunity_list_standard
,
10145 ip_extcommunity_list_standard2_cmd
,
10146 "ip extcommunity-list <1-99> (deny|permit)",
10148 EXTCOMMUNITY_LIST_STR
10149 "Extended Community list number (standard)\n"
10150 "Specify community to reject\n"
10151 "Specify community to accept\n")
10153 DEFUN (ip_extcommunity_list_expanded
,
10154 ip_extcommunity_list_expanded_cmd
,
10155 "ip extcommunity-list <100-500> (deny|permit) .LINE",
10157 EXTCOMMUNITY_LIST_STR
10158 "Extended Community list number (expanded)\n"
10159 "Specify community to reject\n"
10160 "Specify community to accept\n"
10161 "An ordered list as a regular-expression\n")
10163 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
10166 DEFUN (ip_extcommunity_list_name_standard
,
10167 ip_extcommunity_list_name_standard_cmd
,
10168 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
10170 EXTCOMMUNITY_LIST_STR
10171 "Specify standard extcommunity-list\n"
10172 "Extended Community list name\n"
10173 "Specify community to reject\n"
10174 "Specify community to accept\n"
10175 EXTCOMMUNITY_VAL_STR
)
10177 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
10180 ALIAS (ip_extcommunity_list_name_standard
,
10181 ip_extcommunity_list_name_standard2_cmd
,
10182 "ip extcommunity-list standard WORD (deny|permit)",
10184 EXTCOMMUNITY_LIST_STR
10185 "Specify standard extcommunity-list\n"
10186 "Extended Community list name\n"
10187 "Specify community to reject\n"
10188 "Specify community to accept\n")
10190 DEFUN (ip_extcommunity_list_name_expanded
,
10191 ip_extcommunity_list_name_expanded_cmd
,
10192 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
10194 EXTCOMMUNITY_LIST_STR
10195 "Specify expanded extcommunity-list\n"
10196 "Extended Community list name\n"
10197 "Specify community to reject\n"
10198 "Specify community to accept\n"
10199 "An ordered list as a regular-expression\n")
10201 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
10204 DEFUN (no_ip_extcommunity_list_standard_all
,
10205 no_ip_extcommunity_list_standard_all_cmd
,
10206 "no ip extcommunity-list <1-99>",
10209 EXTCOMMUNITY_LIST_STR
10210 "Extended Community list number (standard)\n")
10212 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10215 DEFUN (no_ip_extcommunity_list_expanded_all
,
10216 no_ip_extcommunity_list_expanded_all_cmd
,
10217 "no ip extcommunity-list <100-500>",
10220 EXTCOMMUNITY_LIST_STR
10221 "Extended Community list number (expanded)\n")
10223 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10226 DEFUN (no_ip_extcommunity_list_name_standard_all
,
10227 no_ip_extcommunity_list_name_standard_all_cmd
,
10228 "no ip extcommunity-list standard WORD",
10231 EXTCOMMUNITY_LIST_STR
10232 "Specify standard extcommunity-list\n"
10233 "Extended Community list name\n")
10235 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10238 DEFUN (no_ip_extcommunity_list_name_expanded_all
,
10239 no_ip_extcommunity_list_name_expanded_all_cmd
,
10240 "no ip extcommunity-list expanded WORD",
10243 EXTCOMMUNITY_LIST_STR
10244 "Specify expanded extcommunity-list\n"
10245 "Extended Community list name\n")
10247 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10250 DEFUN (no_ip_extcommunity_list_standard
,
10251 no_ip_extcommunity_list_standard_cmd
,
10252 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
10255 EXTCOMMUNITY_LIST_STR
10256 "Extended Community list number (standard)\n"
10257 "Specify community to reject\n"
10258 "Specify community to accept\n"
10259 EXTCOMMUNITY_VAL_STR
)
10261 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10264 DEFUN (no_ip_extcommunity_list_expanded
,
10265 no_ip_extcommunity_list_expanded_cmd
,
10266 "no ip extcommunity-list <100-500> (deny|permit) .LINE",
10269 EXTCOMMUNITY_LIST_STR
10270 "Extended Community list number (expanded)\n"
10271 "Specify community to reject\n"
10272 "Specify community to accept\n"
10273 "An ordered list as a regular-expression\n")
10275 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10278 DEFUN (no_ip_extcommunity_list_name_standard
,
10279 no_ip_extcommunity_list_name_standard_cmd
,
10280 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
10283 EXTCOMMUNITY_LIST_STR
10284 "Specify standard extcommunity-list\n"
10285 "Extended Community list name\n"
10286 "Specify community to reject\n"
10287 "Specify community to accept\n"
10288 EXTCOMMUNITY_VAL_STR
)
10290 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10293 DEFUN (no_ip_extcommunity_list_name_expanded
,
10294 no_ip_extcommunity_list_name_expanded_cmd
,
10295 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
10298 EXTCOMMUNITY_LIST_STR
10299 "Specify expanded extcommunity-list\n"
10300 "Community list name\n"
10301 "Specify community to reject\n"
10302 "Specify community to accept\n"
10303 "An ordered list as a regular-expression\n")
10305 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10309 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
10311 struct community_entry
*entry
;
10313 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10315 if (entry
== list
->head
)
10317 if (all_digit (list
->name
))
10318 vty_out (vty
, "Extended community %s list %s%s",
10319 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10320 "standard" : "(expanded) access",
10321 list
->name
, VTY_NEWLINE
);
10323 vty_out (vty
, "Named extended community %s list %s%s",
10324 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10325 "standard" : "expanded",
10326 list
->name
, VTY_NEWLINE
);
10329 vty_out (vty
, " %s%s",
10330 community_direct_str (entry
->direct
), VTY_NEWLINE
);
10332 vty_out (vty
, " %s %s%s",
10333 community_direct_str (entry
->direct
),
10334 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10335 entry
->u
.ecom
->str
: entry
->config
,
10340 DEFUN (show_ip_extcommunity_list
,
10341 show_ip_extcommunity_list_cmd
,
10342 "show ip extcommunity-list",
10345 "List extended-community list\n")
10347 struct community_list
*list
;
10348 struct community_list_master
*cm
;
10350 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
10352 return CMD_SUCCESS
;
10354 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10355 extcommunity_list_show (vty
, list
);
10357 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10358 extcommunity_list_show (vty
, list
);
10360 return CMD_SUCCESS
;
10363 DEFUN (show_ip_extcommunity_list_arg
,
10364 show_ip_extcommunity_list_arg_cmd
,
10365 "show ip extcommunity-list (<1-500>|WORD)",
10368 "List extended-community list\n"
10369 "Extcommunity-list number\n"
10370 "Extcommunity-list name\n")
10372 struct community_list
*list
;
10374 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_MASTER
);
10377 vty_out (vty
, "%% Can't find extcommunit-list%s", VTY_NEWLINE
);
10378 return CMD_WARNING
;
10381 extcommunity_list_show (vty
, list
);
10383 return CMD_SUCCESS
;
10386 /* Return configuration string of community-list entry. */
10387 static const char *
10388 community_list_config_str (struct community_entry
*entry
)
10396 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
10397 str
= community_str (entry
->u
.com
);
10399 str
= entry
->config
;
10404 /* Display community-list and extcommunity-list configuration. */
10406 community_list_config_write (struct vty
*vty
)
10408 struct community_list
*list
;
10409 struct community_entry
*entry
;
10410 struct community_list_master
*cm
;
10413 /* Community-list. */
10414 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
10416 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10417 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10419 vty_out (vty
, "ip community-list %s %s %s%s",
10420 list
->name
, community_direct_str (entry
->direct
),
10421 community_list_config_str (entry
),
10425 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10426 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10428 vty_out (vty
, "ip community-list %s %s %s %s%s",
10429 entry
->style
== COMMUNITY_LIST_STANDARD
10430 ? "standard" : "expanded",
10431 list
->name
, community_direct_str (entry
->direct
),
10432 community_list_config_str (entry
),
10437 /* Extcommunity-list. */
10438 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
10440 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10441 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10443 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
10444 list
->name
, community_direct_str (entry
->direct
),
10445 community_list_config_str (entry
), VTY_NEWLINE
);
10448 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10449 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10451 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
10452 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
10453 ? "standard" : "expanded",
10454 list
->name
, community_direct_str (entry
->direct
),
10455 community_list_config_str (entry
), VTY_NEWLINE
);
10461 struct cmd_node community_list_node
=
10463 COMMUNITY_LIST_NODE
,
10465 1 /* Export to vtysh. */
10469 community_list_vty (void)
10471 install_node (&community_list_node
, community_list_config_write
);
10473 /* Community-list. */
10474 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
10475 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
10476 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
10477 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
10478 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
10479 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
10480 install_element (CONFIG_NODE
, &no_ip_community_list_standard_all_cmd
);
10481 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_all_cmd
);
10482 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_all_cmd
);
10483 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_all_cmd
);
10484 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
10485 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
10486 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
10487 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
10488 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
10489 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
10490 install_element (ENABLE_NODE
, &show_ip_community_list_cmd
);
10491 install_element (ENABLE_NODE
, &show_ip_community_list_arg_cmd
);
10493 /* Extcommunity-list. */
10494 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
10495 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
10496 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
10497 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
10498 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
10499 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
10500 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_all_cmd
);
10501 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_all_cmd
);
10502 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_all_cmd
);
10503 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_all_cmd
);
10504 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
10505 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
10506 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
10507 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
10508 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
10509 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);
10510 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_cmd
);
10511 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_arg_cmd
);