2 Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
4 This file is part of GNU Zebra.
6 GNU Zebra is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 GNU Zebra is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Zebra; see the file COPYING. If not, write to the Free
18 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34 #include "bgpd/bgpd.h"
35 #include "bgpd/bgp_advertise.h"
36 #include "bgpd/bgp_attr.h"
37 #include "bgpd/bgp_aspath.h"
38 #include "bgpd/bgp_community.h"
39 #include "bgpd/bgp_ecommunity.h"
40 #include "bgpd/bgp_damp.h"
41 #include "bgpd/bgp_debug.h"
42 #include "bgpd/bgp_fsm.h"
43 #include "bgpd/bgp_mplsvpn.h"
44 #include "bgpd/bgp_nexthop.h"
45 #include "bgpd/bgp_open.h"
46 #include "bgpd/bgp_regex.h"
47 #include "bgpd/bgp_route.h"
48 #include "bgpd/bgp_zebra.h"
49 #include "bgpd/bgp_table.h"
50 #include "bgpd/bgp_vty.h"
52 extern struct in_addr router_id_zebra
;
54 /* Utility function to get address family from current node. */
56 bgp_node_afi (struct vty
*vty
)
58 if (vty
->node
== BGP_IPV6_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
63 /* Utility function to get subsequent address family from current
66 bgp_node_safi (struct vty
*vty
)
68 if (vty
->node
== BGP_VPNV4_NODE
)
70 if (vty
->node
== BGP_IPV4M_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
71 return SAFI_MULTICAST
;
76 peer_address_self_check (union sockunion
*su
)
78 struct interface
*ifp
= NULL
;
80 if (su
->sa
.sa_family
== AF_INET
)
81 ifp
= if_lookup_by_ipv4_exact (&su
->sin
.sin_addr
);
83 else if (su
->sa
.sa_family
== AF_INET6
)
84 ifp
= if_lookup_by_ipv6_exact (&su
->sin6
.sin6_addr
);
85 #endif /* HAVE IPV6 */
93 /* Utility function for looking up peer from VTY. */
95 peer_lookup_vty (struct vty
*vty
, const char *ip_str
)
104 ret
= str2sockunion (ip_str
, &su
);
107 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
111 peer
= peer_lookup (bgp
, &su
);
114 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s", VTY_NEWLINE
);
120 /* Utility function for looking up peer or peer group. */
122 peer_and_group_lookup_vty (struct vty
*vty
, const char *peer_str
)
128 struct peer_group
*group
;
132 ret
= str2sockunion (peer_str
, &su
);
135 peer
= peer_lookup (bgp
, &su
);
141 group
= peer_group_lookup (bgp
, peer_str
);
146 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
153 bgp_vty_return (struct vty
*vty
, int ret
)
155 const char *str
= NULL
;
159 case BGP_ERR_INVALID_VALUE
:
160 str
= "Invalid value";
162 case BGP_ERR_INVALID_FLAG
:
163 str
= "Invalid flag";
165 case BGP_ERR_PEER_INACTIVE
:
166 str
= "Activate the neighbor for the address family first";
168 case BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER
:
169 str
= "Invalid command for a peer-group member";
171 case BGP_ERR_PEER_GROUP_SHUTDOWN
:
172 str
= "Peer-group has been shutdown. Activate the peer-group first";
174 case BGP_ERR_PEER_GROUP_HAS_THE_FLAG
:
175 str
= "This peer is a peer-group member. Please change peer-group configuration";
177 case BGP_ERR_PEER_FLAG_CONFLICT
:
178 str
= "Can't set override-capability and strict-capability-match at the same time";
180 case BGP_ERR_PEER_GROUP_MEMBER_EXISTS
:
181 str
= "No activate for peergroup can be given only if peer-group has no members";
183 case BGP_ERR_PEER_BELONGS_TO_GROUP
:
184 str
= "No activate for an individual peer-group member is invalid";
186 case BGP_ERR_PEER_GROUP_AF_UNCONFIGURED
:
187 str
= "Activate the peer-group for the address family first";
189 case BGP_ERR_PEER_GROUP_NO_REMOTE_AS
:
190 str
= "Specify remote-as or peer-group remote AS first";
192 case BGP_ERR_PEER_GROUP_CANT_CHANGE
:
193 str
= "Cannot change the peer-group. Deconfigure first";
195 case BGP_ERR_PEER_GROUP_MISMATCH
:
196 str
= "Cannot have different peer-group for the neighbor";
198 case BGP_ERR_PEER_FILTER_CONFLICT
:
199 str
= "Prefix/distribute list can not co-exist";
201 case BGP_ERR_NOT_INTERNAL_PEER
:
202 str
= "Invalid command. Not an internal neighbor";
204 case BGP_ERR_REMOVE_PRIVATE_AS
:
205 str
= "Private AS cannot be removed for IBGP peers";
207 case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP
:
208 str
= "Local-AS allowed only for EBGP peers";
210 case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS
:
211 str
= "Cannot have local-as same as BGP AS number";
213 case BGP_ERR_TCPSIG_FAILED
:
214 str
= "Error while applying TCP-Sig to session(s)";
219 vty_out (vty
, "%% %s%s", str
, VTY_NEWLINE
);
225 /* BGP global configuration. */
227 DEFUN (bgp_multiple_instance_func
,
228 bgp_multiple_instance_cmd
,
229 "bgp multiple-instance",
231 "Enable bgp multiple instance\n")
233 bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE
);
237 DEFUN (no_bgp_multiple_instance
,
238 no_bgp_multiple_instance_cmd
,
239 "no bgp multiple-instance",
242 "BGP multiple instance\n")
246 ret
= bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE
);
249 vty_out (vty
, "%% There are more than two BGP instances%s", VTY_NEWLINE
);
255 DEFUN (bgp_config_type
,
257 "bgp config-type (cisco|zebra)",
259 "Configuration type\n"
263 if (strncmp (argv
[0], "c", 1) == 0)
264 bgp_option_set (BGP_OPT_CONFIG_CISCO
);
266 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
271 DEFUN (no_bgp_config_type
,
272 no_bgp_config_type_cmd
,
273 "no bgp config-type",
276 "Display configuration type\n")
278 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
282 DEFUN (no_synchronization
,
283 no_synchronization_cmd
,
284 "no synchronization",
286 "Perform IGP synchronization\n")
291 DEFUN (no_auto_summary
,
295 "Enable automatic network number summarization\n")
300 DEFUN_DEPRECATED (neighbor_version
,
301 neighbor_version_cmd
,
302 NEIGHBOR_CMD
"version (4|4-)",
305 "Set the BGP version to match a neighbor\n"
306 "Neighbor's BGP version\n")
311 /* "router bgp" commands. */
314 "router bgp " CMD_AS_RANGE
,
322 const char *name
= NULL
;
324 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
329 ret
= bgp_get (&bgp
, &as
, name
);
332 case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET
:
333 vty_out (vty
, "Please specify 'bgp multiple-instance' first%s",
336 case BGP_ERR_AS_MISMATCH
:
337 vty_out (vty
, "BGP is already running; AS is %u%s", as
, VTY_NEWLINE
);
339 case BGP_ERR_INSTANCE_MISMATCH
:
340 vty_out (vty
, "BGP view name and AS number mismatch%s", VTY_NEWLINE
);
341 vty_out (vty
, "BGP instance is already running; AS is %u%s",
346 vty
->node
= BGP_NODE
;
354 "router bgp " CMD_AS_RANGE
" view WORD",
361 /* "no router bgp" commands. */
362 DEFUN (no_router_bgp
,
364 "no router bgp " CMD_AS_RANGE
,
372 const char *name
= NULL
;
374 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
379 /* Lookup bgp structure. */
380 bgp
= bgp_lookup (as
, name
);
383 vty_out (vty
, "%% Can't find BGP instance%s", VTY_NEWLINE
);
392 ALIAS (no_router_bgp
,
393 no_router_bgp_view_cmd
,
394 "no router bgp " CMD_AS_RANGE
" view WORD",
404 DEFUN (bgp_router_id
,
406 "bgp router-id A.B.C.D",
408 "Override configured router identifier\n"
409 "Manually configured router identifier\n")
417 ret
= inet_aton (argv
[0], &id
);
420 vty_out (vty
, "%% Malformed bgp router identifier%s", VTY_NEWLINE
);
424 bgp
->router_id_static
= id
;
425 bgp_router_id_set (bgp
, &id
);
430 DEFUN (no_bgp_router_id
,
431 no_bgp_router_id_cmd
,
435 "Override configured router identifier\n")
445 ret
= inet_aton (argv
[0], &id
);
448 vty_out (vty
, "%% Malformed BGP router identifier%s", VTY_NEWLINE
);
452 if (! IPV4_ADDR_SAME (&bgp
->router_id_static
, &id
))
454 vty_out (vty
, "%% BGP router-id doesn't match%s", VTY_NEWLINE
);
459 bgp
->router_id_static
.s_addr
= 0;
460 bgp_router_id_set (bgp
, &router_id_zebra
);
465 ALIAS (no_bgp_router_id
,
466 no_bgp_router_id_val_cmd
,
467 "no bgp router-id A.B.C.D",
470 "Override configured router identifier\n"
471 "Manually configured router identifier\n")
473 /* BGP Cluster ID. */
475 DEFUN (bgp_cluster_id
,
477 "bgp cluster-id A.B.C.D",
479 "Configure Route-Reflector Cluster-id\n"
480 "Route-Reflector Cluster-id in IP address format\n")
484 struct in_addr cluster
;
488 ret
= inet_aton (argv
[0], &cluster
);
491 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
495 bgp_cluster_id_set (bgp
, &cluster
);
500 ALIAS (bgp_cluster_id
,
501 bgp_cluster_id32_cmd
,
502 "bgp cluster-id <1-4294967295>",
504 "Configure Route-Reflector Cluster-id\n"
505 "Route-Reflector Cluster-id as 32 bit quantity\n")
507 DEFUN (no_bgp_cluster_id
,
508 no_bgp_cluster_id_cmd
,
512 "Configure Route-Reflector Cluster-id\n")
516 struct in_addr cluster
;
522 ret
= inet_aton (argv
[0], &cluster
);
525 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
530 bgp_cluster_id_unset (bgp
);
535 ALIAS (no_bgp_cluster_id
,
536 no_bgp_cluster_id_arg_cmd
,
537 "no bgp cluster-id A.B.C.D",
540 "Configure Route-Reflector Cluster-id\n"
541 "Route-Reflector Cluster-id in IP address format\n")
543 DEFUN (bgp_confederation_identifier
,
544 bgp_confederation_identifier_cmd
,
545 "bgp confederation identifier " CMD_AS_RANGE
,
546 "BGP specific commands\n"
547 "AS confederation parameters\n"
549 "Set routing domain confederation AS\n")
556 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
558 bgp_confederation_id_set (bgp
, as
);
563 DEFUN (no_bgp_confederation_identifier
,
564 no_bgp_confederation_identifier_cmd
,
565 "no bgp confederation identifier",
567 "BGP specific commands\n"
568 "AS confederation parameters\n"
577 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
579 bgp_confederation_id_unset (bgp
);
584 ALIAS (no_bgp_confederation_identifier
,
585 no_bgp_confederation_identifier_arg_cmd
,
586 "no bgp confederation identifier " CMD_AS_RANGE
,
588 "BGP specific commands\n"
589 "AS confederation parameters\n"
591 "Set routing domain confederation AS\n")
593 DEFUN (bgp_confederation_peers
,
594 bgp_confederation_peers_cmd
,
595 "bgp confederation peers ." CMD_AS_RANGE
,
596 "BGP specific commands\n"
597 "AS confederation parameters\n"
598 "Peer ASs in BGP confederation\n"
607 for (i
= 0; i
< argc
; i
++)
609 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
613 vty_out (vty
, "%% Local member-AS not allowed in confed peer list%s",
618 bgp_confederation_peers_add (bgp
, as
);
623 DEFUN (no_bgp_confederation_peers
,
624 no_bgp_confederation_peers_cmd
,
625 "no bgp confederation peers ." CMD_AS_RANGE
,
627 "BGP specific commands\n"
628 "AS confederation parameters\n"
629 "Peer ASs in BGP confederation\n"
638 for (i
= 0; i
< argc
; i
++)
640 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
642 bgp_confederation_peers_remove (bgp
, as
);
651 "timers bgp <0-65535> <0-65535>",
652 "Adjust routing timers\n"
654 "Keepalive interval\n"
658 unsigned long keepalive
= 0;
659 unsigned long holdtime
= 0;
663 VTY_GET_INTEGER ("keepalive", keepalive
, argv
[0]);
664 VTY_GET_INTEGER ("holdtime", holdtime
, argv
[1]);
666 /* Holdtime value check. */
667 if (holdtime
< 3 && holdtime
!= 0)
669 vty_out (vty
, "%% hold time value must be either 0 or greater than 3%s",
674 bgp_timers_set (bgp
, keepalive
, holdtime
);
679 DEFUN (no_bgp_timers
,
683 "Adjust routing timers\n"
689 bgp_timers_unset (bgp
);
694 ALIAS (no_bgp_timers
,
695 no_bgp_timers_arg_cmd
,
696 "no timers bgp <0-65535> <0-65535>",
698 "Adjust routing timers\n"
700 "Keepalive interval\n"
703 DEFUN (bgp_client_to_client_reflection
,
704 bgp_client_to_client_reflection_cmd
,
705 "bgp client-to-client reflection",
706 "BGP specific commands\n"
707 "Configure client to client route reflection\n"
708 "reflection of routes allowed\n")
713 bgp_flag_unset (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
717 DEFUN (no_bgp_client_to_client_reflection
,
718 no_bgp_client_to_client_reflection_cmd
,
719 "no bgp client-to-client reflection",
721 "BGP specific commands\n"
722 "Configure client to client route reflection\n"
723 "reflection of routes allowed\n")
728 bgp_flag_set (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
732 /* "bgp always-compare-med" configuration. */
733 DEFUN (bgp_always_compare_med
,
734 bgp_always_compare_med_cmd
,
735 "bgp always-compare-med",
736 "BGP specific commands\n"
737 "Allow comparing MED from different neighbors\n")
742 bgp_flag_set (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
746 DEFUN (no_bgp_always_compare_med
,
747 no_bgp_always_compare_med_cmd
,
748 "no bgp always-compare-med",
750 "BGP specific commands\n"
751 "Allow comparing MED from different neighbors\n")
756 bgp_flag_unset (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
760 /* "bgp deterministic-med" configuration. */
761 DEFUN (bgp_deterministic_med
,
762 bgp_deterministic_med_cmd
,
763 "bgp deterministic-med",
764 "BGP specific commands\n"
765 "Pick the best-MED path among paths advertised from the neighboring AS\n")
770 bgp_flag_set (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
774 DEFUN (no_bgp_deterministic_med
,
775 no_bgp_deterministic_med_cmd
,
776 "no bgp deterministic-med",
778 "BGP specific commands\n"
779 "Pick the best-MED path among paths advertised from the neighboring AS\n")
784 bgp_flag_unset (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
788 /* "bgp graceful-restart" configuration. */
789 DEFUN (bgp_graceful_restart
,
790 bgp_graceful_restart_cmd
,
791 "bgp graceful-restart",
792 "BGP specific commands\n"
793 "Graceful restart capability parameters\n")
798 bgp_flag_set (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
802 DEFUN (no_bgp_graceful_restart
,
803 no_bgp_graceful_restart_cmd
,
804 "no bgp graceful-restart",
806 "BGP specific commands\n"
807 "Graceful restart capability parameters\n")
812 bgp_flag_unset (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
816 DEFUN (bgp_graceful_restart_stalepath_time
,
817 bgp_graceful_restart_stalepath_time_cmd
,
818 "bgp graceful-restart stalepath-time <1-3600>",
819 "BGP specific commands\n"
820 "Graceful restart capability parameters\n"
821 "Set the max time to hold onto restarting peer's stale paths\n"
822 "Delay value (seconds)\n")
831 VTY_GET_INTEGER_RANGE ("stalepath-time", stalepath
, argv
[0], 1, 3600);
832 bgp
->stalepath_time
= stalepath
;
836 DEFUN (no_bgp_graceful_restart_stalepath_time
,
837 no_bgp_graceful_restart_stalepath_time_cmd
,
838 "no bgp graceful-restart stalepath-time",
840 "BGP specific commands\n"
841 "Graceful restart capability parameters\n"
842 "Set the max time to hold onto restarting peer's stale paths\n")
850 bgp
->stalepath_time
= BGP_DEFAULT_STALEPATH_TIME
;
854 ALIAS (no_bgp_graceful_restart_stalepath_time
,
855 no_bgp_graceful_restart_stalepath_time_val_cmd
,
856 "no bgp graceful-restart stalepath-time <1-3600>",
858 "BGP specific commands\n"
859 "Graceful restart capability parameters\n"
860 "Set the max time to hold onto restarting peer's stale paths\n"
861 "Delay value (seconds)\n")
863 /* "bgp fast-external-failover" configuration. */
864 DEFUN (bgp_fast_external_failover
,
865 bgp_fast_external_failover_cmd
,
866 "bgp fast-external-failover",
868 "Immediately reset session if a link to a directly connected external peer goes down\n")
873 bgp_flag_unset (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
877 DEFUN (no_bgp_fast_external_failover
,
878 no_bgp_fast_external_failover_cmd
,
879 "no bgp fast-external-failover",
882 "Immediately reset session if a link to a directly connected external peer goes down\n")
887 bgp_flag_set (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
891 /* "bgp enforce-first-as" configuration. */
892 DEFUN (bgp_enforce_first_as
,
893 bgp_enforce_first_as_cmd
,
894 "bgp enforce-first-as",
896 "Enforce the first AS for EBGP routes\n")
901 bgp_flag_set (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
905 DEFUN (no_bgp_enforce_first_as
,
906 no_bgp_enforce_first_as_cmd
,
907 "no bgp enforce-first-as",
910 "Enforce the first AS for EBGP routes\n")
915 bgp_flag_unset (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
919 /* "bgp bestpath compare-routerid" configuration. */
920 DEFUN (bgp_bestpath_compare_router_id
,
921 bgp_bestpath_compare_router_id_cmd
,
922 "bgp bestpath compare-routerid",
923 "BGP specific commands\n"
924 "Change the default bestpath selection\n"
925 "Compare router-id for identical EBGP paths\n")
930 bgp_flag_set (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
934 DEFUN (no_bgp_bestpath_compare_router_id
,
935 no_bgp_bestpath_compare_router_id_cmd
,
936 "no bgp bestpath compare-routerid",
938 "BGP specific commands\n"
939 "Change the default bestpath selection\n"
940 "Compare router-id for identical EBGP paths\n")
945 bgp_flag_unset (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
949 /* "bgp bestpath as-path ignore" configuration. */
950 DEFUN (bgp_bestpath_aspath_ignore
,
951 bgp_bestpath_aspath_ignore_cmd
,
952 "bgp bestpath as-path ignore",
953 "BGP specific commands\n"
954 "Change the default bestpath selection\n"
955 "AS-path attribute\n"
956 "Ignore as-path length in selecting a route\n")
961 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_IGNORE
);
965 DEFUN (no_bgp_bestpath_aspath_ignore
,
966 no_bgp_bestpath_aspath_ignore_cmd
,
967 "no bgp bestpath as-path ignore",
969 "BGP specific commands\n"
970 "Change the default bestpath selection\n"
971 "AS-path attribute\n"
972 "Ignore as-path length in selecting a route\n")
977 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_IGNORE
);
981 /* "bgp bestpath as-path confed" configuration. */
982 DEFUN (bgp_bestpath_aspath_confed
,
983 bgp_bestpath_aspath_confed_cmd
,
984 "bgp bestpath as-path confed",
985 "BGP specific commands\n"
986 "Change the default bestpath selection\n"
987 "AS-path attribute\n"
988 "Compare path lengths including confederation sets & sequences in selecting a route\n")
993 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_CONFED
);
997 DEFUN (no_bgp_bestpath_aspath_confed
,
998 no_bgp_bestpath_aspath_confed_cmd
,
999 "no bgp bestpath as-path confed",
1001 "BGP specific commands\n"
1002 "Change the default bestpath selection\n"
1003 "AS-path attribute\n"
1004 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1009 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_CONFED
);
1013 /* "bgp log-neighbor-changes" configuration. */
1014 DEFUN (bgp_log_neighbor_changes
,
1015 bgp_log_neighbor_changes_cmd
,
1016 "bgp log-neighbor-changes",
1017 "BGP specific commands\n"
1018 "Log neighbor up/down and reset reason\n")
1023 bgp_flag_set (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
1027 DEFUN (no_bgp_log_neighbor_changes
,
1028 no_bgp_log_neighbor_changes_cmd
,
1029 "no bgp log-neighbor-changes",
1031 "BGP specific commands\n"
1032 "Log neighbor up/down and reset reason\n")
1037 bgp_flag_unset (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
1041 /* "bgp bestpath med" configuration. */
1042 DEFUN (bgp_bestpath_med
,
1043 bgp_bestpath_med_cmd
,
1044 "bgp bestpath med (confed|missing-as-worst)",
1045 "BGP specific commands\n"
1046 "Change the default bestpath selection\n"
1048 "Compare MED among confederation paths\n"
1049 "Treat missing MED as the least preferred one\n")
1055 if (strncmp (argv
[0], "confed", 1) == 0)
1056 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
1058 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1063 DEFUN (bgp_bestpath_med2
,
1064 bgp_bestpath_med2_cmd
,
1065 "bgp bestpath med confed missing-as-worst",
1066 "BGP specific commands\n"
1067 "Change the default bestpath selection\n"
1069 "Compare MED among confederation paths\n"
1070 "Treat missing MED as the least preferred one\n")
1075 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
1076 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1080 ALIAS (bgp_bestpath_med2
,
1081 bgp_bestpath_med3_cmd
,
1082 "bgp bestpath med missing-as-worst confed",
1083 "BGP specific commands\n"
1084 "Change the default bestpath selection\n"
1086 "Treat missing MED as the least preferred one\n"
1087 "Compare MED among confederation paths\n")
1089 DEFUN (no_bgp_bestpath_med
,
1090 no_bgp_bestpath_med_cmd
,
1091 "no bgp bestpath med (confed|missing-as-worst)",
1093 "BGP specific commands\n"
1094 "Change the default bestpath selection\n"
1096 "Compare MED among confederation paths\n"
1097 "Treat missing MED as the least preferred one\n")
1103 if (strncmp (argv
[0], "confed", 1) == 0)
1104 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
1106 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1111 DEFUN (no_bgp_bestpath_med2
,
1112 no_bgp_bestpath_med2_cmd
,
1113 "no bgp bestpath med confed missing-as-worst",
1115 "BGP specific commands\n"
1116 "Change the default bestpath selection\n"
1118 "Compare MED among confederation paths\n"
1119 "Treat missing MED as the least preferred one\n")
1124 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
1125 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1129 ALIAS (no_bgp_bestpath_med2
,
1130 no_bgp_bestpath_med3_cmd
,
1131 "no bgp bestpath med missing-as-worst confed",
1133 "BGP specific commands\n"
1134 "Change the default bestpath selection\n"
1136 "Treat missing MED as the least preferred one\n"
1137 "Compare MED among confederation paths\n")
1139 /* "no bgp default ipv4-unicast". */
1140 DEFUN (no_bgp_default_ipv4_unicast
,
1141 no_bgp_default_ipv4_unicast_cmd
,
1142 "no bgp default ipv4-unicast",
1144 "BGP specific commands\n"
1145 "Configure BGP defaults\n"
1146 "Activate ipv4-unicast for a peer by default\n")
1151 bgp_flag_set (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1155 DEFUN (bgp_default_ipv4_unicast
,
1156 bgp_default_ipv4_unicast_cmd
,
1157 "bgp default ipv4-unicast",
1158 "BGP specific commands\n"
1159 "Configure BGP defaults\n"
1160 "Activate ipv4-unicast for a peer by default\n")
1165 bgp_flag_unset (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1169 /* "bgp import-check" configuration. */
1170 DEFUN (bgp_network_import_check
,
1171 bgp_network_import_check_cmd
,
1172 "bgp network import-check",
1173 "BGP specific commands\n"
1174 "BGP network command\n"
1175 "Check BGP network route exists in IGP\n")
1180 bgp_flag_set (bgp
, BGP_FLAG_IMPORT_CHECK
);
1184 DEFUN (no_bgp_network_import_check
,
1185 no_bgp_network_import_check_cmd
,
1186 "no bgp network import-check",
1188 "BGP specific commands\n"
1189 "BGP network command\n"
1190 "Check BGP network route exists in IGP\n")
1195 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK
);
1199 DEFUN (bgp_default_local_preference
,
1200 bgp_default_local_preference_cmd
,
1201 "bgp default local-preference <0-4294967295>",
1202 "BGP specific commands\n"
1203 "Configure BGP defaults\n"
1204 "local preference (higher=more preferred)\n"
1205 "Configure default local preference value\n")
1208 u_int32_t local_pref
;
1212 VTY_GET_INTEGER ("local preference", local_pref
, argv
[0]);
1214 bgp_default_local_preference_set (bgp
, local_pref
);
1219 DEFUN (no_bgp_default_local_preference
,
1220 no_bgp_default_local_preference_cmd
,
1221 "no bgp default local-preference",
1223 "BGP specific commands\n"
1224 "Configure BGP defaults\n"
1225 "local preference (higher=more preferred)\n")
1230 bgp_default_local_preference_unset (bgp
);
1234 ALIAS (no_bgp_default_local_preference
,
1235 no_bgp_default_local_preference_val_cmd
,
1236 "no bgp default local-preference <0-4294967295>",
1238 "BGP specific commands\n"
1239 "Configure BGP defaults\n"
1240 "local preference (higher=more preferred)\n"
1241 "Configure default local preference value\n")
1244 peer_remote_as_vty (struct vty
*vty
, const char *peer_str
,
1245 const char *as_str
, afi_t afi
, safi_t safi
)
1254 /* Get AS number. */
1255 VTY_GET_INTEGER_RANGE ("AS", as
, as_str
, 1, BGP_AS4_MAX
);
1257 /* If peer is peer group, call proper function. */
1258 ret
= str2sockunion (peer_str
, &su
);
1261 ret
= peer_group_remote_as (bgp
, peer_str
, &as
);
1264 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1270 if (peer_address_self_check (&su
))
1272 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1277 ret
= peer_remote_as (bgp
, &su
, &as
, afi
, safi
);
1279 /* This peer belongs to peer group. */
1282 case BGP_ERR_PEER_GROUP_MEMBER
:
1283 vty_out (vty
, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as
, VTY_NEWLINE
);
1285 case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
:
1286 vty_out (vty
, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external%s", as
, as_str
, VTY_NEWLINE
);
1289 return bgp_vty_return (vty
, ret
);
1292 DEFUN (neighbor_remote_as
,
1293 neighbor_remote_as_cmd
,
1294 NEIGHBOR_CMD2
"remote-as " CMD_AS_RANGE
,
1297 "Specify a BGP neighbor\n"
1300 return peer_remote_as_vty (vty
, argv
[0], argv
[1], AFI_IP
, SAFI_UNICAST
);
1303 DEFUN (neighbor_peer_group
,
1304 neighbor_peer_group_cmd
,
1305 "neighbor WORD peer-group",
1308 "Configure peer-group\n")
1311 struct peer_group
*group
;
1315 group
= peer_group_get (bgp
, argv
[0]);
1331 struct peer_group
*group
;
1334 ret
= str2sockunion (argv
[0], &su
);
1337 group
= peer_group_lookup (vty
->index
, argv
[0]);
1339 peer_group_delete (group
);
1342 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1348 peer
= peer_lookup (vty
->index
, &su
);
1357 no_neighbor_remote_as_cmd
,
1358 NO_NEIGHBOR_CMD
"remote-as " CMD_AS_RANGE
,
1362 "Specify a BGP neighbor\n"
1365 DEFUN (no_neighbor_peer_group
,
1366 no_neighbor_peer_group_cmd
,
1367 "no neighbor WORD peer-group",
1371 "Configure peer-group\n")
1373 struct peer_group
*group
;
1375 group
= peer_group_lookup (vty
->index
, argv
[0]);
1377 peer_group_delete (group
);
1380 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1386 DEFUN (no_neighbor_peer_group_remote_as
,
1387 no_neighbor_peer_group_remote_as_cmd
,
1388 "no neighbor WORD remote-as " CMD_AS_RANGE
,
1392 "Specify a BGP neighbor\n"
1395 struct peer_group
*group
;
1397 group
= peer_group_lookup (vty
->index
, argv
[0]);
1399 peer_group_remote_as_delete (group
);
1402 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1408 DEFUN (neighbor_local_as
,
1409 neighbor_local_as_cmd
,
1410 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
1413 "Specify a local-as number\n"
1414 "AS number used as local AS\n")
1419 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1423 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 0);
1424 return bgp_vty_return (vty
, ret
);
1427 DEFUN (neighbor_local_as_no_prepend
,
1428 neighbor_local_as_no_prepend_cmd
,
1429 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
1432 "Specify a local-as number\n"
1433 "AS number used as local AS\n"
1434 "Do not prepend local-as to updates from ebgp peers\n")
1439 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1443 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1);
1444 return bgp_vty_return (vty
, ret
);
1447 DEFUN (no_neighbor_local_as
,
1448 no_neighbor_local_as_cmd
,
1449 NO_NEIGHBOR_CMD2
"local-as",
1453 "Specify a local-as number\n")
1458 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1462 ret
= peer_local_as_unset (peer
);
1463 return bgp_vty_return (vty
, ret
);
1466 ALIAS (no_neighbor_local_as
,
1467 no_neighbor_local_as_val_cmd
,
1468 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
1472 "Specify a local-as number\n"
1473 "AS number used as local AS\n")
1475 ALIAS (no_neighbor_local_as
,
1476 no_neighbor_local_as_val2_cmd
,
1477 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
1481 "Specify a local-as number\n"
1482 "AS number used as local AS\n"
1483 "Do not prepend local-as to updates from ebgp peers\n")
1485 DEFUN (neighbor_password
,
1486 neighbor_password_cmd
,
1487 NEIGHBOR_CMD2
"password LINE",
1496 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1500 ret
= peer_password_set (peer
, argv
[1]);
1501 return bgp_vty_return (vty
, ret
);
1504 DEFUN (no_neighbor_password
,
1505 no_neighbor_password_cmd
,
1506 NO_NEIGHBOR_CMD2
"password",
1515 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1519 ret
= peer_password_unset (peer
);
1520 return bgp_vty_return (vty
, ret
);
1523 DEFUN (neighbor_activate
,
1524 neighbor_activate_cmd
,
1525 NEIGHBOR_CMD2
"activate",
1528 "Enable the Address Family for this Neighbor\n")
1532 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1536 peer_activate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
1541 DEFUN (no_neighbor_activate
,
1542 no_neighbor_activate_cmd
,
1543 NO_NEIGHBOR_CMD2
"activate",
1547 "Enable the Address Family for this Neighbor\n")
1553 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1557 ret
= peer_deactivate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
1559 return bgp_vty_return (vty
, ret
);
1562 DEFUN (neighbor_set_peer_group
,
1563 neighbor_set_peer_group_cmd
,
1564 NEIGHBOR_CMD
"peer-group WORD",
1567 "Member of the peer-group\n"
1568 "peer-group name\n")
1574 struct peer_group
*group
;
1578 ret
= str2sockunion (argv
[0], &su
);
1581 vty_out (vty
, "%% Malformed address: %s%s", argv
[0], VTY_NEWLINE
);
1585 group
= peer_group_lookup (bgp
, argv
[1]);
1588 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
1592 if (peer_address_self_check (&su
))
1594 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1599 ret
= peer_group_bind (bgp
, &su
, group
, bgp_node_afi (vty
),
1600 bgp_node_safi (vty
), &as
);
1602 if (ret
== BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
)
1604 vty_out (vty
, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external%s", as
, VTY_NEWLINE
);
1608 return bgp_vty_return (vty
, ret
);
1611 DEFUN (no_neighbor_set_peer_group
,
1612 no_neighbor_set_peer_group_cmd
,
1613 NO_NEIGHBOR_CMD
"peer-group WORD",
1617 "Member of the peer-group\n"
1618 "peer-group name\n")
1623 struct peer_group
*group
;
1627 peer
= peer_lookup_vty (vty
, argv
[0]);
1631 group
= peer_group_lookup (bgp
, argv
[1]);
1634 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
1638 ret
= peer_group_unbind (bgp
, peer
, group
, bgp_node_afi (vty
),
1639 bgp_node_safi (vty
));
1641 return bgp_vty_return (vty
, ret
);
1645 peer_flag_modify_vty (struct vty
*vty
, const char *ip_str
,
1646 u_int16_t flag
, int set
)
1651 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
1656 ret
= peer_flag_set (peer
, flag
);
1658 ret
= peer_flag_unset (peer
, flag
);
1660 return bgp_vty_return (vty
, ret
);
1664 peer_flag_set_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
1666 return peer_flag_modify_vty (vty
, ip_str
, flag
, 1);
1670 peer_flag_unset_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
1672 return peer_flag_modify_vty (vty
, ip_str
, flag
, 0);
1675 /* neighbor passive. */
1676 DEFUN (neighbor_passive
,
1677 neighbor_passive_cmd
,
1678 NEIGHBOR_CMD2
"passive",
1681 "Don't send open messages to this neighbor\n")
1683 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
1686 DEFUN (no_neighbor_passive
,
1687 no_neighbor_passive_cmd
,
1688 NO_NEIGHBOR_CMD2
"passive",
1692 "Don't send open messages to this neighbor\n")
1694 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
1697 /* neighbor shutdown. */
1698 DEFUN (neighbor_shutdown
,
1699 neighbor_shutdown_cmd
,
1700 NEIGHBOR_CMD2
"shutdown",
1703 "Administratively shut down this neighbor\n")
1705 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
1708 DEFUN (no_neighbor_shutdown
,
1709 no_neighbor_shutdown_cmd
,
1710 NO_NEIGHBOR_CMD2
"shutdown",
1714 "Administratively shut down this neighbor\n")
1716 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
1719 /* Deprecated neighbor capability route-refresh. */
1720 DEFUN_DEPRECATED (neighbor_capability_route_refresh
,
1721 neighbor_capability_route_refresh_cmd
,
1722 NEIGHBOR_CMD2
"capability route-refresh",
1725 "Advertise capability to the peer\n"
1726 "Advertise route-refresh capability to this neighbor\n")
1731 DEFUN_DEPRECATED (no_neighbor_capability_route_refresh
,
1732 no_neighbor_capability_route_refresh_cmd
,
1733 NO_NEIGHBOR_CMD2
"capability route-refresh",
1737 "Advertise capability to the peer\n"
1738 "Advertise route-refresh capability to this neighbor\n")
1743 /* neighbor capability dynamic. */
1744 DEFUN (neighbor_capability_dynamic
,
1745 neighbor_capability_dynamic_cmd
,
1746 NEIGHBOR_CMD2
"capability dynamic",
1749 "Advertise capability to the peer\n"
1750 "Advertise dynamic capability to this neighbor\n")
1752 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
1755 DEFUN (no_neighbor_capability_dynamic
,
1756 no_neighbor_capability_dynamic_cmd
,
1757 NO_NEIGHBOR_CMD2
"capability dynamic",
1761 "Advertise capability to the peer\n"
1762 "Advertise dynamic capability to this neighbor\n")
1764 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
1767 /* neighbor dont-capability-negotiate */
1768 DEFUN (neighbor_dont_capability_negotiate
,
1769 neighbor_dont_capability_negotiate_cmd
,
1770 NEIGHBOR_CMD2
"dont-capability-negotiate",
1773 "Do not perform capability negotiation\n")
1775 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
1778 DEFUN (no_neighbor_dont_capability_negotiate
,
1779 no_neighbor_dont_capability_negotiate_cmd
,
1780 NO_NEIGHBOR_CMD2
"dont-capability-negotiate",
1784 "Do not perform capability negotiation\n")
1786 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
1790 peer_af_flag_modify_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
1791 safi_t safi
, u_int32_t flag
, int set
)
1796 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
1801 ret
= peer_af_flag_set (peer
, afi
, safi
, flag
);
1803 ret
= peer_af_flag_unset (peer
, afi
, safi
, flag
);
1805 return bgp_vty_return (vty
, ret
);
1809 peer_af_flag_set_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
1810 safi_t safi
, u_int32_t flag
)
1812 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 1);
1816 peer_af_flag_unset_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
1817 safi_t safi
, u_int32_t flag
)
1819 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 0);
1822 /* neighbor capability orf prefix-list. */
1823 DEFUN (neighbor_capability_orf_prefix
,
1824 neighbor_capability_orf_prefix_cmd
,
1825 NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
1828 "Advertise capability to the peer\n"
1829 "Advertise ORF capability to the peer\n"
1830 "Advertise prefixlist ORF capability to this neighbor\n"
1831 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
1832 "Capability to RECEIVE the ORF from this neighbor\n"
1833 "Capability to SEND the ORF to this neighbor\n")
1837 if (strncmp (argv
[1], "s", 1) == 0)
1838 flag
= PEER_FLAG_ORF_PREFIX_SM
;
1839 else if (strncmp (argv
[1], "r", 1) == 0)
1840 flag
= PEER_FLAG_ORF_PREFIX_RM
;
1841 else if (strncmp (argv
[1], "b", 1) == 0)
1842 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
1846 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1847 bgp_node_safi (vty
), flag
);
1850 DEFUN (no_neighbor_capability_orf_prefix
,
1851 no_neighbor_capability_orf_prefix_cmd
,
1852 NO_NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
1856 "Advertise capability to the peer\n"
1857 "Advertise ORF capability to the peer\n"
1858 "Advertise prefixlist ORF capability to this neighbor\n"
1859 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
1860 "Capability to RECEIVE the ORF from this neighbor\n"
1861 "Capability to SEND the ORF to this neighbor\n")
1865 if (strncmp (argv
[1], "s", 1) == 0)
1866 flag
= PEER_FLAG_ORF_PREFIX_SM
;
1867 else if (strncmp (argv
[1], "r", 1) == 0)
1868 flag
= PEER_FLAG_ORF_PREFIX_RM
;
1869 else if (strncmp (argv
[1], "b", 1) == 0)
1870 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
1874 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1875 bgp_node_safi (vty
), flag
);
1878 /* neighbor next-hop-self. */
1879 DEFUN (neighbor_nexthop_self
,
1880 neighbor_nexthop_self_cmd
,
1881 NEIGHBOR_CMD2
"next-hop-self",
1884 "Disable the next hop calculation for this neighbor\n")
1886 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1887 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
1890 DEFUN (no_neighbor_nexthop_self
,
1891 no_neighbor_nexthop_self_cmd
,
1892 NO_NEIGHBOR_CMD2
"next-hop-self",
1896 "Disable the next hop calculation for this neighbor\n")
1898 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1899 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
1902 /* neighbor remove-private-AS. */
1903 DEFUN (neighbor_remove_private_as
,
1904 neighbor_remove_private_as_cmd
,
1905 NEIGHBOR_CMD2
"remove-private-AS",
1908 "Remove private AS number from outbound updates\n")
1910 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1911 bgp_node_safi (vty
),
1912 PEER_FLAG_REMOVE_PRIVATE_AS
);
1915 DEFUN (no_neighbor_remove_private_as
,
1916 no_neighbor_remove_private_as_cmd
,
1917 NO_NEIGHBOR_CMD2
"remove-private-AS",
1921 "Remove private AS number from outbound updates\n")
1923 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1924 bgp_node_safi (vty
),
1925 PEER_FLAG_REMOVE_PRIVATE_AS
);
1928 /* neighbor send-community. */
1929 DEFUN (neighbor_send_community
,
1930 neighbor_send_community_cmd
,
1931 NEIGHBOR_CMD2
"send-community",
1934 "Send Community attribute to this neighbor\n")
1936 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1937 bgp_node_safi (vty
),
1938 PEER_FLAG_SEND_COMMUNITY
);
1941 DEFUN (no_neighbor_send_community
,
1942 no_neighbor_send_community_cmd
,
1943 NO_NEIGHBOR_CMD2
"send-community",
1947 "Send Community attribute to this neighbor\n")
1949 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1950 bgp_node_safi (vty
),
1951 PEER_FLAG_SEND_COMMUNITY
);
1954 /* neighbor send-community extended. */
1955 DEFUN (neighbor_send_community_type
,
1956 neighbor_send_community_type_cmd
,
1957 NEIGHBOR_CMD2
"send-community (both|extended|standard)",
1960 "Send Community attribute to this neighbor\n"
1961 "Send Standard and Extended Community attributes\n"
1962 "Send Extended Community attributes\n"
1963 "Send Standard Community attributes\n")
1965 if (strncmp (argv
[1], "s", 1) == 0)
1966 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1967 bgp_node_safi (vty
),
1968 PEER_FLAG_SEND_COMMUNITY
);
1969 if (strncmp (argv
[1], "e", 1) == 0)
1970 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1971 bgp_node_safi (vty
),
1972 PEER_FLAG_SEND_EXT_COMMUNITY
);
1974 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1975 bgp_node_safi (vty
),
1976 (PEER_FLAG_SEND_COMMUNITY
|
1977 PEER_FLAG_SEND_EXT_COMMUNITY
));
1980 DEFUN (no_neighbor_send_community_type
,
1981 no_neighbor_send_community_type_cmd
,
1982 NO_NEIGHBOR_CMD2
"send-community (both|extended|standard)",
1986 "Send Community attribute to this neighbor\n"
1987 "Send Standard and Extended Community attributes\n"
1988 "Send Extended Community attributes\n"
1989 "Send Standard Community attributes\n")
1991 if (strncmp (argv
[1], "s", 1) == 0)
1992 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1993 bgp_node_safi (vty
),
1994 PEER_FLAG_SEND_COMMUNITY
);
1995 if (strncmp (argv
[1], "e", 1) == 0)
1996 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1997 bgp_node_safi (vty
),
1998 PEER_FLAG_SEND_EXT_COMMUNITY
);
2000 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2001 bgp_node_safi (vty
),
2002 (PEER_FLAG_SEND_COMMUNITY
|
2003 PEER_FLAG_SEND_EXT_COMMUNITY
));
2006 /* neighbor soft-reconfig. */
2007 DEFUN (neighbor_soft_reconfiguration
,
2008 neighbor_soft_reconfiguration_cmd
,
2009 NEIGHBOR_CMD2
"soft-reconfiguration inbound",
2012 "Per neighbor soft reconfiguration\n"
2013 "Allow inbound soft reconfiguration for this neighbor\n")
2015 return peer_af_flag_set_vty (vty
, argv
[0],
2016 bgp_node_afi (vty
), bgp_node_safi (vty
),
2017 PEER_FLAG_SOFT_RECONFIG
);
2020 DEFUN (no_neighbor_soft_reconfiguration
,
2021 no_neighbor_soft_reconfiguration_cmd
,
2022 NO_NEIGHBOR_CMD2
"soft-reconfiguration inbound",
2026 "Per neighbor soft reconfiguration\n"
2027 "Allow inbound soft reconfiguration for this neighbor\n")
2029 return peer_af_flag_unset_vty (vty
, argv
[0],
2030 bgp_node_afi (vty
), bgp_node_safi (vty
),
2031 PEER_FLAG_SOFT_RECONFIG
);
2034 DEFUN (neighbor_route_reflector_client
,
2035 neighbor_route_reflector_client_cmd
,
2036 NEIGHBOR_CMD2
"route-reflector-client",
2039 "Configure a neighbor as Route Reflector client\n")
2044 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2048 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2049 bgp_node_safi (vty
),
2050 PEER_FLAG_REFLECTOR_CLIENT
);
2053 DEFUN (no_neighbor_route_reflector_client
,
2054 no_neighbor_route_reflector_client_cmd
,
2055 NO_NEIGHBOR_CMD2
"route-reflector-client",
2059 "Configure a neighbor as Route Reflector client\n")
2061 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2062 bgp_node_safi (vty
),
2063 PEER_FLAG_REFLECTOR_CLIENT
);
2067 peer_rsclient_set_vty (struct vty
*vty
, const char *peer_str
,
2073 struct peer_group
*group
;
2074 struct listnode
*node
, *nnode
;
2075 struct bgp_filter
*pfilter
;
2076 struct bgp_filter
*gfilter
;
2077 int locked_and_added
= 0;
2081 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2085 /* If it is already a RS-Client, don't do anything. */
2086 if ( CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
2089 if ( ! peer_rsclient_active (peer
) )
2091 peer
= peer_lock (peer
); /* rsclient peer list reference */
2092 listnode_add_sort (bgp
->rsclient
, peer
);
2093 locked_and_added
= 1;
2096 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2099 if (locked_and_added
)
2101 listnode_delete (bgp
->rsclient
, peer
);
2102 peer_unlock (peer
); /* rsclient peer list reference */
2105 return bgp_vty_return (vty
, ret
);
2108 peer
->rib
[afi
][safi
] = bgp_table_init (afi
, safi
);
2109 peer
->rib
[afi
][safi
]->type
= BGP_TABLE_RSCLIENT
;
2110 /* RIB peer reference. Released when table is free'd in bgp_table_free. */
2111 peer
->rib
[afi
][safi
]->owner
= peer_lock (peer
);
2113 /* Check for existing 'network' and 'redistribute' routes. */
2114 bgp_check_local_routes_rsclient (peer
, afi
, safi
);
2116 /* Check for routes for peers configured with 'soft-reconfiguration'. */
2117 bgp_soft_reconfig_rsclient (peer
, afi
, safi
);
2119 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
2121 group
= peer
->group
;
2122 gfilter
= &peer
->filter
[afi
][safi
];
2124 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
2126 pfilter
= &peer
->filter
[afi
][safi
];
2128 /* Members of a non-RS-Client group should not be RS-Clients, as that
2129 is checked when the become part of the peer-group */
2130 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2132 return bgp_vty_return (vty
, ret
);
2134 /* Make peer's RIB point to group's RIB. */
2135 peer
->rib
[afi
][safi
] = group
->conf
->rib
[afi
][safi
];
2137 /* Import policy. */
2138 if (pfilter
->map
[RMAP_IMPORT
].name
)
2139 free (pfilter
->map
[RMAP_IMPORT
].name
);
2140 if (gfilter
->map
[RMAP_IMPORT
].name
)
2142 pfilter
->map
[RMAP_IMPORT
].name
= strdup (gfilter
->map
[RMAP_IMPORT
].name
);
2143 pfilter
->map
[RMAP_IMPORT
].map
= gfilter
->map
[RMAP_IMPORT
].map
;
2147 pfilter
->map
[RMAP_IMPORT
].name
= NULL
;
2148 pfilter
->map
[RMAP_IMPORT
].map
=NULL
;
2151 /* Export policy. */
2152 if (gfilter
->map
[RMAP_EXPORT
].name
&& ! pfilter
->map
[RMAP_EXPORT
].name
)
2154 pfilter
->map
[RMAP_EXPORT
].name
= strdup (gfilter
->map
[RMAP_EXPORT
].name
);
2155 pfilter
->map
[RMAP_EXPORT
].map
= gfilter
->map
[RMAP_EXPORT
].map
;
2163 peer_rsclient_unset_vty (struct vty
*vty
, const char *peer_str
,
2169 struct peer_group
*group
;
2170 struct listnode
*node
, *nnode
;
2174 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2178 /* If it is not a RS-Client, don't do anything. */
2179 if ( ! CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
2182 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
2184 group
= peer
->group
;
2186 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
2188 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2190 return bgp_vty_return (vty
, ret
);
2192 peer
->rib
[afi
][safi
] = NULL
;
2198 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2200 return bgp_vty_return (vty
, ret
);
2202 if ( ! peer_rsclient_active (peer
) )
2204 bgp_clear_route (peer
, afi
, safi
, BGP_CLEAR_ROUTE_MY_RSCLIENT
);
2205 listnode_delete (bgp
->rsclient
, peer
);
2206 peer_unlock (peer
); /* peer bgp rsclient reference */
2209 bgp_table_finish (&peer
->rib
[bgp_node_afi(vty
)][bgp_node_safi(vty
)]);
2214 /* neighbor route-server-client. */
2215 DEFUN (neighbor_route_server_client
,
2216 neighbor_route_server_client_cmd
,
2217 NEIGHBOR_CMD2
"route-server-client",
2220 "Configure a neighbor as Route Server client\n")
2222 return peer_rsclient_set_vty (vty
, argv
[0], bgp_node_afi(vty
),
2223 bgp_node_safi(vty
));
2226 DEFUN (no_neighbor_route_server_client
,
2227 no_neighbor_route_server_client_cmd
,
2228 NO_NEIGHBOR_CMD2
"route-server-client",
2232 "Configure a neighbor as Route Server client\n")
2234 return peer_rsclient_unset_vty (vty
, argv
[0], bgp_node_afi(vty
),
2235 bgp_node_safi(vty
));
2238 DEFUN (neighbor_nexthop_local_unchanged
,
2239 neighbor_nexthop_local_unchanged_cmd
,
2240 NEIGHBOR_CMD2
"nexthop-local unchanged",
2243 "Configure treatment of outgoing link-local nexthop attribute\n"
2244 "Leave link-local nexthop unchanged for this peer\n")
2246 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2247 bgp_node_safi (vty
),
2248 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
2251 DEFUN (no_neighbor_nexthop_local_unchanged
,
2252 no_neighbor_nexthop_local_unchanged_cmd
,
2253 NO_NEIGHBOR_CMD2
"nexthop-local unchanged",
2257 "Configure treatment of outgoing link-local-nexthop attribute\n"
2258 "Leave link-local nexthop unchanged for this peer\n")
2260 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2261 bgp_node_safi (vty
),
2262 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
2265 DEFUN (neighbor_attr_unchanged
,
2266 neighbor_attr_unchanged_cmd
,
2267 NEIGHBOR_CMD2
"attribute-unchanged",
2270 "BGP attribute is propagated unchanged to this neighbor\n")
2272 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2273 bgp_node_safi (vty
),
2274 (PEER_FLAG_AS_PATH_UNCHANGED
|
2275 PEER_FLAG_NEXTHOP_UNCHANGED
|
2276 PEER_FLAG_MED_UNCHANGED
));
2279 DEFUN (neighbor_attr_unchanged1
,
2280 neighbor_attr_unchanged1_cmd
,
2281 NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2284 "BGP attribute is propagated unchanged to this neighbor\n"
2285 "As-path attribute\n"
2286 "Nexthop attribute\n"
2289 u_int16_t flags
= 0;
2291 if (strncmp (argv
[1], "as-path", 1) == 0)
2292 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2293 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2294 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2295 else if (strncmp (argv
[1], "med", 1) == 0)
2296 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2298 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2299 bgp_node_safi (vty
), flags
);
2302 DEFUN (neighbor_attr_unchanged2
,
2303 neighbor_attr_unchanged2_cmd
,
2304 NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2307 "BGP attribute is propagated unchanged to this neighbor\n"
2308 "As-path attribute\n"
2309 "Nexthop attribute\n"
2312 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2314 if (strncmp (argv
[1], "next-hop", 1) == 0)
2315 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2316 else if (strncmp (argv
[1], "med", 1) == 0)
2317 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2319 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2320 bgp_node_safi (vty
), flags
);
2324 DEFUN (neighbor_attr_unchanged3
,
2325 neighbor_attr_unchanged3_cmd
,
2326 NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2329 "BGP attribute is propagated unchanged to this neighbor\n"
2330 "Nexthop attribute\n"
2331 "As-path attribute\n"
2334 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2336 if (strncmp (argv
[1], "as-path", 1) == 0)
2337 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2338 else if (strncmp (argv
[1], "med", 1) == 0)
2339 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2341 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2342 bgp_node_safi (vty
), flags
);
2345 DEFUN (neighbor_attr_unchanged4
,
2346 neighbor_attr_unchanged4_cmd
,
2347 NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2350 "BGP attribute is propagated unchanged to this neighbor\n"
2352 "As-path attribute\n"
2353 "Nexthop attribute\n")
2355 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2357 if (strncmp (argv
[1], "as-path", 1) == 0)
2358 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2359 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2360 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2362 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2363 bgp_node_safi (vty
), flags
);
2366 ALIAS (neighbor_attr_unchanged
,
2367 neighbor_attr_unchanged5_cmd
,
2368 NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2371 "BGP attribute is propagated unchanged to this neighbor\n"
2372 "As-path attribute\n"
2373 "Nexthop attribute\n"
2376 ALIAS (neighbor_attr_unchanged
,
2377 neighbor_attr_unchanged6_cmd
,
2378 NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2381 "BGP attribute is propagated unchanged to this neighbor\n"
2382 "As-path attribute\n"
2384 "Nexthop attribute\n")
2386 ALIAS (neighbor_attr_unchanged
,
2387 neighbor_attr_unchanged7_cmd
,
2388 NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2391 "BGP attribute is propagated unchanged to this neighbor\n"
2392 "Nexthop attribute\n"
2394 "As-path attribute\n")
2396 ALIAS (neighbor_attr_unchanged
,
2397 neighbor_attr_unchanged8_cmd
,
2398 NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2401 "BGP attribute is propagated unchanged to this neighbor\n"
2402 "Nexthop attribute\n"
2403 "As-path attribute\n"
2406 ALIAS (neighbor_attr_unchanged
,
2407 neighbor_attr_unchanged9_cmd
,
2408 NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2411 "BGP attribute is propagated unchanged to this neighbor\n"
2413 "Nexthop attribute\n"
2414 "As-path attribute\n")
2416 ALIAS (neighbor_attr_unchanged
,
2417 neighbor_attr_unchanged10_cmd
,
2418 NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2421 "BGP attribute is propagated unchanged to this neighbor\n"
2423 "As-path attribute\n"
2424 "Nexthop attribute\n")
2426 DEFUN (no_neighbor_attr_unchanged
,
2427 no_neighbor_attr_unchanged_cmd
,
2428 NO_NEIGHBOR_CMD2
"attribute-unchanged",
2432 "BGP attribute is propagated unchanged to this neighbor\n")
2434 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2435 bgp_node_safi (vty
),
2436 (PEER_FLAG_AS_PATH_UNCHANGED
|
2437 PEER_FLAG_NEXTHOP_UNCHANGED
|
2438 PEER_FLAG_MED_UNCHANGED
));
2441 DEFUN (no_neighbor_attr_unchanged1
,
2442 no_neighbor_attr_unchanged1_cmd
,
2443 NO_NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2447 "BGP attribute is propagated unchanged to this neighbor\n"
2448 "As-path attribute\n"
2449 "Nexthop attribute\n"
2452 u_int16_t flags
= 0;
2454 if (strncmp (argv
[1], "as-path", 1) == 0)
2455 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2456 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2457 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2458 else if (strncmp (argv
[1], "med", 1) == 0)
2459 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2461 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2462 bgp_node_safi (vty
), flags
);
2465 DEFUN (no_neighbor_attr_unchanged2
,
2466 no_neighbor_attr_unchanged2_cmd
,
2467 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2471 "BGP attribute is propagated unchanged to this neighbor\n"
2472 "As-path attribute\n"
2473 "Nexthop attribute\n"
2476 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2478 if (strncmp (argv
[1], "next-hop", 1) == 0)
2479 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2480 else if (strncmp (argv
[1], "med", 1) == 0)
2481 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2483 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2484 bgp_node_safi (vty
), flags
);
2487 DEFUN (no_neighbor_attr_unchanged3
,
2488 no_neighbor_attr_unchanged3_cmd
,
2489 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2493 "BGP attribute is propagated unchanged to this neighbor\n"
2494 "Nexthop attribute\n"
2495 "As-path attribute\n"
2498 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2500 if (strncmp (argv
[1], "as-path", 1) == 0)
2501 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2502 else if (strncmp (argv
[1], "med", 1) == 0)
2503 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2505 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2506 bgp_node_safi (vty
), flags
);
2509 DEFUN (no_neighbor_attr_unchanged4
,
2510 no_neighbor_attr_unchanged4_cmd
,
2511 NO_NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2515 "BGP attribute is propagated unchanged to this neighbor\n"
2517 "As-path attribute\n"
2518 "Nexthop attribute\n")
2520 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2522 if (strncmp (argv
[1], "as-path", 1) == 0)
2523 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2524 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2525 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2527 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2528 bgp_node_safi (vty
), flags
);
2531 ALIAS (no_neighbor_attr_unchanged
,
2532 no_neighbor_attr_unchanged5_cmd
,
2533 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2537 "BGP attribute is propagated unchanged to this neighbor\n"
2538 "As-path attribute\n"
2539 "Nexthop attribute\n"
2542 ALIAS (no_neighbor_attr_unchanged
,
2543 no_neighbor_attr_unchanged6_cmd
,
2544 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2548 "BGP attribute is propagated unchanged to this neighbor\n"
2549 "As-path attribute\n"
2551 "Nexthop attribute\n")
2553 ALIAS (no_neighbor_attr_unchanged
,
2554 no_neighbor_attr_unchanged7_cmd
,
2555 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2559 "BGP attribute is propagated unchanged to this neighbor\n"
2560 "Nexthop attribute\n"
2562 "As-path attribute\n")
2564 ALIAS (no_neighbor_attr_unchanged
,
2565 no_neighbor_attr_unchanged8_cmd
,
2566 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2570 "BGP attribute is propagated unchanged to this neighbor\n"
2571 "Nexthop attribute\n"
2572 "As-path attribute\n"
2575 ALIAS (no_neighbor_attr_unchanged
,
2576 no_neighbor_attr_unchanged9_cmd
,
2577 NO_NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2581 "BGP attribute is propagated unchanged to this neighbor\n"
2583 "Nexthop attribute\n"
2584 "As-path attribute\n")
2586 ALIAS (no_neighbor_attr_unchanged
,
2587 no_neighbor_attr_unchanged10_cmd
,
2588 NO_NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2592 "BGP attribute is propagated unchanged to this neighbor\n"
2594 "As-path attribute\n"
2595 "Nexthop attribute\n")
2597 /* For old version Zebra compatibility. */
2598 DEFUN_DEPRECATED (neighbor_transparent_as
,
2599 neighbor_transparent_as_cmd
,
2600 NEIGHBOR_CMD
"transparent-as",
2603 "Do not append my AS number even peer is EBGP peer\n")
2605 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2606 bgp_node_safi (vty
),
2607 PEER_FLAG_AS_PATH_UNCHANGED
);
2610 DEFUN_DEPRECATED (neighbor_transparent_nexthop
,
2611 neighbor_transparent_nexthop_cmd
,
2612 NEIGHBOR_CMD
"transparent-nexthop",
2615 "Do not change nexthop even peer is EBGP peer\n")
2617 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2618 bgp_node_safi (vty
),
2619 PEER_FLAG_NEXTHOP_UNCHANGED
);
2622 /* EBGP multihop configuration. */
2624 peer_ebgp_multihop_set_vty (struct vty
*vty
, const char *ip_str
,
2625 const char *ttl_str
)
2630 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2637 VTY_GET_INTEGER_RANGE ("TTL", ttl
, ttl_str
, 1, 255);
2639 peer_ebgp_multihop_set (peer
, ttl
);
2645 peer_ebgp_multihop_unset_vty (struct vty
*vty
, const char *ip_str
)
2649 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2653 peer_ebgp_multihop_unset (peer
);
2658 /* neighbor ebgp-multihop. */
2659 DEFUN (neighbor_ebgp_multihop
,
2660 neighbor_ebgp_multihop_cmd
,
2661 NEIGHBOR_CMD2
"ebgp-multihop",
2664 "Allow EBGP neighbors not on directly connected networks\n")
2666 return peer_ebgp_multihop_set_vty (vty
, argv
[0], NULL
);
2669 DEFUN (neighbor_ebgp_multihop_ttl
,
2670 neighbor_ebgp_multihop_ttl_cmd
,
2671 NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2674 "Allow EBGP neighbors not on directly connected networks\n"
2675 "maximum hop count\n")
2677 return peer_ebgp_multihop_set_vty (vty
, argv
[0], argv
[1]);
2680 DEFUN (no_neighbor_ebgp_multihop
,
2681 no_neighbor_ebgp_multihop_cmd
,
2682 NO_NEIGHBOR_CMD2
"ebgp-multihop",
2686 "Allow EBGP neighbors not on directly connected networks\n")
2688 return peer_ebgp_multihop_unset_vty (vty
, argv
[0]);
2691 ALIAS (no_neighbor_ebgp_multihop
,
2692 no_neighbor_ebgp_multihop_ttl_cmd
,
2693 NO_NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2697 "Allow EBGP neighbors not on directly connected networks\n"
2698 "maximum hop count\n")
2700 /* disable-connected-check */
2701 DEFUN (neighbor_disable_connected_check
,
2702 neighbor_disable_connected_check_cmd
,
2703 NEIGHBOR_CMD2
"disable-connected-check",
2706 "one-hop away EBGP peer using loopback address\n")
2708 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
2711 DEFUN (no_neighbor_disable_connected_check
,
2712 no_neighbor_disable_connected_check_cmd
,
2713 NO_NEIGHBOR_CMD2
"disable-connected-check",
2717 "one-hop away EBGP peer using loopback address\n")
2719 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
2722 /* Enforce multihop. */
2723 ALIAS (neighbor_disable_connected_check
,
2724 neighbor_enforce_multihop_cmd
,
2725 NEIGHBOR_CMD2
"enforce-multihop",
2728 "Enforce EBGP neighbors perform multihop\n")
2730 /* Enforce multihop. */
2731 ALIAS (no_neighbor_disable_connected_check
,
2732 no_neighbor_enforce_multihop_cmd
,
2733 NO_NEIGHBOR_CMD2
"enforce-multihop",
2737 "Enforce EBGP neighbors perform multihop\n")
2739 DEFUN (neighbor_description
,
2740 neighbor_description_cmd
,
2741 NEIGHBOR_CMD2
"description .LINE",
2744 "Neighbor specific description\n"
2745 "Up to 80 characters describing this neighbor\n")
2750 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2757 str
= argv_concat(argv
, argc
, 1);
2759 peer_description_set (peer
, str
);
2761 XFREE (MTYPE_TMP
, str
);
2766 DEFUN (no_neighbor_description
,
2767 no_neighbor_description_cmd
,
2768 NO_NEIGHBOR_CMD2
"description",
2772 "Neighbor specific description\n")
2776 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2780 peer_description_unset (peer
);
2785 ALIAS (no_neighbor_description
,
2786 no_neighbor_description_val_cmd
,
2787 NO_NEIGHBOR_CMD2
"description .LINE",
2791 "Neighbor specific description\n"
2792 "Up to 80 characters describing this neighbor\n")
2794 /* Neighbor update-source. */
2796 peer_update_source_vty (struct vty
*vty
, const char *peer_str
,
2797 const char *source_str
)
2800 union sockunion
*su
;
2802 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2808 su
= sockunion_str2su (source_str
);
2811 peer_update_source_addr_set (peer
, su
);
2812 sockunion_free (su
);
2815 peer_update_source_if_set (peer
, source_str
);
2818 peer_update_source_unset (peer
);
2823 #define BGP_UPDATE_SOURCE_STR "(A.B.C.D|X:X::X:X|WORD)"
2824 #define BGP_UPDATE_SOURCE_HELP_STR \
2827 "Interface name (requires zebra to be running)\n"
2829 DEFUN (neighbor_update_source
,
2830 neighbor_update_source_cmd
,
2831 NEIGHBOR_CMD2
"update-source " BGP_UPDATE_SOURCE_STR
,
2834 "Source of routing updates\n"
2835 BGP_UPDATE_SOURCE_HELP_STR
)
2837 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
2840 DEFUN (no_neighbor_update_source
,
2841 no_neighbor_update_source_cmd
,
2842 NO_NEIGHBOR_CMD2
"update-source",
2846 "Source of routing updates\n")
2848 return peer_update_source_vty (vty
, argv
[0], NULL
);
2852 peer_default_originate_set_vty (struct vty
*vty
, const char *peer_str
,
2853 afi_t afi
, safi_t safi
,
2854 const char *rmap
, int set
)
2859 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2864 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
2866 ret
= peer_default_originate_unset (peer
, afi
, safi
);
2868 return bgp_vty_return (vty
, ret
);
2871 /* neighbor default-originate. */
2872 DEFUN (neighbor_default_originate
,
2873 neighbor_default_originate_cmd
,
2874 NEIGHBOR_CMD2
"default-originate",
2877 "Originate default route to this neighbor\n")
2879 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2880 bgp_node_safi (vty
), NULL
, 1);
2883 DEFUN (neighbor_default_originate_rmap
,
2884 neighbor_default_originate_rmap_cmd
,
2885 NEIGHBOR_CMD2
"default-originate route-map WORD",
2888 "Originate default route to this neighbor\n"
2889 "Route-map to specify criteria to originate default\n"
2892 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2893 bgp_node_safi (vty
), argv
[1], 1);
2896 DEFUN (no_neighbor_default_originate
,
2897 no_neighbor_default_originate_cmd
,
2898 NO_NEIGHBOR_CMD2
"default-originate",
2902 "Originate default route to this neighbor\n")
2904 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2905 bgp_node_safi (vty
), NULL
, 0);
2908 ALIAS (no_neighbor_default_originate
,
2909 no_neighbor_default_originate_rmap_cmd
,
2910 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
2914 "Originate default route to this neighbor\n"
2915 "Route-map to specify criteria to originate default\n"
2918 /* Set neighbor's BGP port. */
2920 peer_port_vty (struct vty
*vty
, const char *ip_str
, int afi
,
2921 const char *port_str
)
2927 peer
= peer_lookup_vty (vty
, ip_str
);
2933 sp
= getservbyname ("bgp", "tcp");
2934 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
2938 VTY_GET_INTEGER("port", port
, port_str
);
2941 peer_port_set (peer
, port
);
2946 /* Set specified peer's BGP port. */
2947 DEFUN (neighbor_port
,
2949 NEIGHBOR_CMD
"port <0-65535>",
2952 "Neighbor's BGP port\n"
2953 "TCP port number\n")
2955 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
2958 DEFUN (no_neighbor_port
,
2959 no_neighbor_port_cmd
,
2960 NO_NEIGHBOR_CMD
"port",
2964 "Neighbor's BGP port\n")
2966 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
2969 ALIAS (no_neighbor_port
,
2970 no_neighbor_port_val_cmd
,
2971 NO_NEIGHBOR_CMD
"port <0-65535>",
2975 "Neighbor's BGP port\n"
2976 "TCP port number\n")
2978 /* neighbor weight. */
2980 peer_weight_set_vty (struct vty
*vty
, const char *ip_str
,
2981 const char *weight_str
)
2985 unsigned long weight
;
2987 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2991 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
2993 ret
= peer_weight_set (peer
, weight
);
2999 peer_weight_unset_vty (struct vty
*vty
, const char *ip_str
)
3003 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3007 peer_weight_unset (peer
);
3012 DEFUN (neighbor_weight
,
3013 neighbor_weight_cmd
,
3014 NEIGHBOR_CMD2
"weight <0-65535>",
3017 "Set default weight for routes from this neighbor\n"
3020 return peer_weight_set_vty (vty
, argv
[0], argv
[1]);
3023 DEFUN (no_neighbor_weight
,
3024 no_neighbor_weight_cmd
,
3025 NO_NEIGHBOR_CMD2
"weight",
3029 "Set default weight for routes from this neighbor\n")
3031 return peer_weight_unset_vty (vty
, argv
[0]);
3034 ALIAS (no_neighbor_weight
,
3035 no_neighbor_weight_val_cmd
,
3036 NO_NEIGHBOR_CMD2
"weight <0-65535>",
3040 "Set default weight for routes from this neighbor\n"
3043 /* Override capability negotiation. */
3044 DEFUN (neighbor_override_capability
,
3045 neighbor_override_capability_cmd
,
3046 NEIGHBOR_CMD2
"override-capability",
3049 "Override capability negotiation result\n")
3051 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
3054 DEFUN (no_neighbor_override_capability
,
3055 no_neighbor_override_capability_cmd
,
3056 NO_NEIGHBOR_CMD2
"override-capability",
3060 "Override capability negotiation result\n")
3062 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
3065 DEFUN (neighbor_strict_capability
,
3066 neighbor_strict_capability_cmd
,
3067 NEIGHBOR_CMD
"strict-capability-match",
3070 "Strict capability negotiation match\n")
3072 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
3075 DEFUN (no_neighbor_strict_capability
,
3076 no_neighbor_strict_capability_cmd
,
3077 NO_NEIGHBOR_CMD
"strict-capability-match",
3081 "Strict capability negotiation match\n")
3083 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
3087 peer_timers_set_vty (struct vty
*vty
, const char *ip_str
,
3088 const char *keep_str
, const char *hold_str
)
3092 u_int32_t keepalive
;
3095 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3099 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
3100 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
3102 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
3104 return bgp_vty_return (vty
, ret
);
3108 peer_timers_unset_vty (struct vty
*vty
, const char *ip_str
)
3113 peer
= peer_lookup_vty (vty
, ip_str
);
3117 ret
= peer_timers_unset (peer
);
3119 return bgp_vty_return (vty
, ret
);
3122 DEFUN (neighbor_timers
,
3123 neighbor_timers_cmd
,
3124 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
3127 "BGP per neighbor timers\n"
3128 "Keepalive interval\n"
3131 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
3134 DEFUN (no_neighbor_timers
,
3135 no_neighbor_timers_cmd
,
3136 NO_NEIGHBOR_CMD2
"timers",
3140 "BGP per neighbor timers\n")
3142 return peer_timers_unset_vty (vty
, argv
[0]);
3146 peer_timers_connect_set_vty (struct vty
*vty
, const char *ip_str
,
3147 const char *time_str
)
3153 peer
= peer_lookup_vty (vty
, ip_str
);
3157 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
3159 ret
= peer_timers_connect_set (peer
, connect
);
3165 peer_timers_connect_unset_vty (struct vty
*vty
, const char *ip_str
)
3170 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3174 ret
= peer_timers_connect_unset (peer
);
3179 DEFUN (neighbor_timers_connect
,
3180 neighbor_timers_connect_cmd
,
3181 NEIGHBOR_CMD
"timers connect <0-65535>",
3184 "BGP per neighbor timers\n"
3185 "BGP connect timer\n"
3188 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
3191 DEFUN (no_neighbor_timers_connect
,
3192 no_neighbor_timers_connect_cmd
,
3193 NO_NEIGHBOR_CMD
"timers connect",
3197 "BGP per neighbor timers\n"
3198 "BGP connect timer\n")
3200 return peer_timers_connect_unset_vty (vty
, argv
[0]);
3203 ALIAS (no_neighbor_timers_connect
,
3204 no_neighbor_timers_connect_val_cmd
,
3205 NO_NEIGHBOR_CMD
"timers connect <0-65535>",
3209 "BGP per neighbor timers\n"
3210 "BGP connect timer\n"
3214 peer_advertise_interval_vty (struct vty
*vty
, const char *ip_str
,
3215 const char *time_str
, int set
)
3219 u_int32_t routeadv
= 0;
3221 peer
= peer_lookup_vty (vty
, ip_str
);
3226 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
3229 ret
= peer_advertise_interval_set (peer
, routeadv
);
3231 ret
= peer_advertise_interval_unset (peer
);
3236 DEFUN (neighbor_advertise_interval
,
3237 neighbor_advertise_interval_cmd
,
3238 NEIGHBOR_CMD
"advertisement-interval <0-600>",
3241 "Minimum interval between sending BGP routing updates\n"
3242 "time in seconds\n")
3244 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
3247 DEFUN (no_neighbor_advertise_interval
,
3248 no_neighbor_advertise_interval_cmd
,
3249 NO_NEIGHBOR_CMD
"advertisement-interval",
3253 "Minimum interval between sending BGP routing updates\n")
3255 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
3258 ALIAS (no_neighbor_advertise_interval
,
3259 no_neighbor_advertise_interval_val_cmd
,
3260 NO_NEIGHBOR_CMD
"advertisement-interval <0-600>",
3264 "Minimum interval between sending BGP routing updates\n"
3265 "time in seconds\n")
3267 /* neighbor interface */
3269 peer_interface_vty (struct vty
*vty
, const char *ip_str
, const char *str
)
3274 peer
= peer_lookup_vty (vty
, ip_str
);
3279 ret
= peer_interface_set (peer
, str
);
3281 ret
= peer_interface_unset (peer
);
3286 DEFUN (neighbor_interface
,
3287 neighbor_interface_cmd
,
3288 NEIGHBOR_CMD
"interface WORD",
3294 return peer_interface_vty (vty
, argv
[0], argv
[1]);
3297 DEFUN (no_neighbor_interface
,
3298 no_neighbor_interface_cmd
,
3299 NO_NEIGHBOR_CMD
"interface WORD",
3306 return peer_interface_vty (vty
, argv
[0], NULL
);
3309 /* Set distribute list to the peer. */
3311 peer_distribute_set_vty (struct vty
*vty
, const char *ip_str
,
3312 afi_t afi
, safi_t safi
,
3313 const char *name_str
, const char *direct_str
)
3317 int direct
= FILTER_IN
;
3319 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3323 /* Check filter direction. */
3324 if (strncmp (direct_str
, "i", 1) == 0)
3326 else if (strncmp (direct_str
, "o", 1) == 0)
3327 direct
= FILTER_OUT
;
3329 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
3331 return bgp_vty_return (vty
, ret
);
3335 peer_distribute_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3336 safi_t safi
, const char *direct_str
)
3340 int direct
= FILTER_IN
;
3342 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3346 /* Check filter direction. */
3347 if (strncmp (direct_str
, "i", 1) == 0)
3349 else if (strncmp (direct_str
, "o", 1) == 0)
3350 direct
= FILTER_OUT
;
3352 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
3354 return bgp_vty_return (vty
, ret
);
3357 DEFUN (neighbor_distribute_list
,
3358 neighbor_distribute_list_cmd
,
3359 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3362 "Filter updates to/from this neighbor\n"
3363 "IP access-list number\n"
3364 "IP access-list number (expanded range)\n"
3365 "IP Access-list name\n"
3366 "Filter incoming updates\n"
3367 "Filter outgoing updates\n")
3369 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3370 bgp_node_safi (vty
), argv
[1], argv
[2]);
3373 DEFUN (no_neighbor_distribute_list
,
3374 no_neighbor_distribute_list_cmd
,
3375 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3379 "Filter updates to/from this neighbor\n"
3380 "IP access-list number\n"
3381 "IP access-list number (expanded range)\n"
3382 "IP Access-list name\n"
3383 "Filter incoming updates\n"
3384 "Filter outgoing updates\n")
3386 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3387 bgp_node_safi (vty
), argv
[2]);
3390 /* Set prefix list to the peer. */
3392 peer_prefix_list_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3393 safi_t safi
, const char *name_str
,
3394 const char *direct_str
)
3398 int direct
= FILTER_IN
;
3400 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3404 /* Check filter direction. */
3405 if (strncmp (direct_str
, "i", 1) == 0)
3407 else if (strncmp (direct_str
, "o", 1) == 0)
3408 direct
= FILTER_OUT
;
3410 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
3412 return bgp_vty_return (vty
, ret
);
3416 peer_prefix_list_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3417 safi_t safi
, const char *direct_str
)
3421 int direct
= FILTER_IN
;
3423 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3427 /* Check filter direction. */
3428 if (strncmp (direct_str
, "i", 1) == 0)
3430 else if (strncmp (direct_str
, "o", 1) == 0)
3431 direct
= FILTER_OUT
;
3433 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
3435 return bgp_vty_return (vty
, ret
);
3438 DEFUN (neighbor_prefix_list
,
3439 neighbor_prefix_list_cmd
,
3440 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3443 "Filter updates to/from this neighbor\n"
3444 "Name of a prefix list\n"
3445 "Filter incoming updates\n"
3446 "Filter outgoing updates\n")
3448 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3449 bgp_node_safi (vty
), argv
[1], argv
[2]);
3452 DEFUN (no_neighbor_prefix_list
,
3453 no_neighbor_prefix_list_cmd
,
3454 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3458 "Filter updates to/from this neighbor\n"
3459 "Name of a prefix list\n"
3460 "Filter incoming updates\n"
3461 "Filter outgoing updates\n")
3463 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3464 bgp_node_safi (vty
), argv
[2]);
3468 peer_aslist_set_vty (struct vty
*vty
, const char *ip_str
,
3469 afi_t afi
, safi_t safi
,
3470 const char *name_str
, const char *direct_str
)
3474 int direct
= FILTER_IN
;
3476 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3480 /* Check filter direction. */
3481 if (strncmp (direct_str
, "i", 1) == 0)
3483 else if (strncmp (direct_str
, "o", 1) == 0)
3484 direct
= FILTER_OUT
;
3486 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
3488 return bgp_vty_return (vty
, ret
);
3492 peer_aslist_unset_vty (struct vty
*vty
, const char *ip_str
,
3493 afi_t afi
, safi_t safi
,
3494 const char *direct_str
)
3498 int direct
= FILTER_IN
;
3500 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3504 /* Check filter direction. */
3505 if (strncmp (direct_str
, "i", 1) == 0)
3507 else if (strncmp (direct_str
, "o", 1) == 0)
3508 direct
= FILTER_OUT
;
3510 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
3512 return bgp_vty_return (vty
, ret
);
3515 DEFUN (neighbor_filter_list
,
3516 neighbor_filter_list_cmd
,
3517 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3520 "Establish BGP filters\n"
3521 "AS path access-list name\n"
3522 "Filter incoming routes\n"
3523 "Filter outgoing routes\n")
3525 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3526 bgp_node_safi (vty
), argv
[1], argv
[2]);
3529 DEFUN (no_neighbor_filter_list
,
3530 no_neighbor_filter_list_cmd
,
3531 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3535 "Establish BGP filters\n"
3536 "AS path access-list name\n"
3537 "Filter incoming routes\n"
3538 "Filter outgoing routes\n")
3540 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3541 bgp_node_safi (vty
), argv
[2]);
3544 /* Set route-map to the peer. */
3546 peer_route_map_set_vty (struct vty
*vty
, const char *ip_str
,
3547 afi_t afi
, safi_t safi
,
3548 const char *name_str
, const char *direct_str
)
3552 int direct
= RMAP_IN
;
3554 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3558 /* Check filter direction. */
3559 if (strncmp (direct_str
, "in", 2) == 0)
3561 else if (strncmp (direct_str
, "o", 1) == 0)
3563 else if (strncmp (direct_str
, "im", 2) == 0)
3564 direct
= RMAP_IMPORT
;
3565 else if (strncmp (direct_str
, "e", 1) == 0)
3566 direct
= RMAP_EXPORT
;
3568 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
3570 return bgp_vty_return (vty
, ret
);
3574 peer_route_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3575 safi_t safi
, const char *direct_str
)
3579 int direct
= RMAP_IN
;
3581 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3585 /* Check filter direction. */
3586 if (strncmp (direct_str
, "in", 2) == 0)
3588 else if (strncmp (direct_str
, "o", 1) == 0)
3590 else if (strncmp (direct_str
, "im", 2) == 0)
3591 direct
= RMAP_IMPORT
;
3592 else if (strncmp (direct_str
, "e", 1) == 0)
3593 direct
= RMAP_EXPORT
;
3595 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
3597 return bgp_vty_return (vty
, ret
);
3600 DEFUN (neighbor_route_map
,
3601 neighbor_route_map_cmd
,
3602 NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3605 "Apply route map to neighbor\n"
3606 "Name of route map\n"
3607 "Apply map to incoming routes\n"
3608 "Apply map to outbound routes\n"
3609 "Apply map to routes going into a Route-Server client's table\n"
3610 "Apply map to routes coming from a Route-Server client")
3612 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3613 bgp_node_safi (vty
), argv
[1], argv
[2]);
3616 DEFUN (no_neighbor_route_map
,
3617 no_neighbor_route_map_cmd
,
3618 NO_NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3622 "Apply route map to neighbor\n"
3623 "Name of route map\n"
3624 "Apply map to incoming routes\n"
3625 "Apply map to outbound routes\n"
3626 "Apply map to routes going into a Route-Server client's table\n"
3627 "Apply map to routes coming from a Route-Server client")
3629 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3630 bgp_node_safi (vty
), argv
[2]);
3633 /* Set unsuppress-map to the peer. */
3635 peer_unsuppress_map_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3636 safi_t safi
, const char *name_str
)
3641 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3645 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
3647 return bgp_vty_return (vty
, ret
);
3650 /* Unset route-map from the peer. */
3652 peer_unsuppress_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3658 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3662 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
3664 return bgp_vty_return (vty
, ret
);
3667 DEFUN (neighbor_unsuppress_map
,
3668 neighbor_unsuppress_map_cmd
,
3669 NEIGHBOR_CMD2
"unsuppress-map WORD",
3672 "Route-map to selectively unsuppress suppressed routes\n"
3673 "Name of route map\n")
3675 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3676 bgp_node_safi (vty
), argv
[1]);
3679 DEFUN (no_neighbor_unsuppress_map
,
3680 no_neighbor_unsuppress_map_cmd
,
3681 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
3685 "Route-map to selectively unsuppress suppressed routes\n"
3686 "Name of route map\n")
3688 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3689 bgp_node_safi (vty
));
3693 peer_maximum_prefix_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3694 safi_t safi
, const char *num_str
,
3695 const char *threshold_str
, int warning
,
3696 const char *restart_str
)
3704 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3708 VTY_GET_INTEGER ("maxmum number", max
, num_str
);
3710 threshold
= atoi (threshold_str
);
3712 threshold
= MAXIMUM_PREFIX_THRESHOLD_DEFAULT
;
3715 restart
= atoi (restart_str
);
3719 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, threshold
, warning
, restart
);
3721 return bgp_vty_return (vty
, ret
);
3725 peer_maximum_prefix_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3731 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3735 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
3737 return bgp_vty_return (vty
, ret
);
3740 /* Maximum number of prefix configuration. prefix count is different
3741 for each peer configuration. So this configuration can be set for
3742 each peer configuration. */
3743 DEFUN (neighbor_maximum_prefix
,
3744 neighbor_maximum_prefix_cmd
,
3745 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3748 "Maximum number of prefix accept from this peer\n"
3749 "maximum no. of prefix limit\n")
3751 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3752 bgp_node_safi (vty
), argv
[1], NULL
, 0,
3756 DEFUN (neighbor_maximum_prefix_threshold
,
3757 neighbor_maximum_prefix_threshold_cmd
,
3758 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
3761 "Maximum number of prefix accept from this peer\n"
3762 "maximum no. of prefix limit\n"
3763 "Threshold value (%) at which to generate a warning msg\n")
3765 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3766 bgp_node_safi (vty
), argv
[1], argv
[2], 0,
3770 DEFUN (neighbor_maximum_prefix_warning
,
3771 neighbor_maximum_prefix_warning_cmd
,
3772 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3775 "Maximum number of prefix accept from this peer\n"
3776 "maximum no. of prefix limit\n"
3777 "Only give warning message when limit is exceeded\n")
3779 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3780 bgp_node_safi (vty
), argv
[1], NULL
, 1,
3784 DEFUN (neighbor_maximum_prefix_threshold_warning
,
3785 neighbor_maximum_prefix_threshold_warning_cmd
,
3786 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3789 "Maximum number of prefix accept from this peer\n"
3790 "maximum no. of prefix limit\n"
3791 "Threshold value (%) at which to generate a warning msg\n"
3792 "Only give warning message when limit is exceeded\n")
3794 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3795 bgp_node_safi (vty
), argv
[1], argv
[2], 1, NULL
);
3798 DEFUN (neighbor_maximum_prefix_restart
,
3799 neighbor_maximum_prefix_restart_cmd
,
3800 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
3803 "Maximum number of prefix accept from this peer\n"
3804 "maximum no. of prefix limit\n"
3805 "Restart bgp connection after limit is exceeded\n"
3806 "Restart interval in minutes")
3808 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3809 bgp_node_safi (vty
), argv
[1], NULL
, 0, argv
[2]);
3812 DEFUN (neighbor_maximum_prefix_threshold_restart
,
3813 neighbor_maximum_prefix_threshold_restart_cmd
,
3814 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
3817 "Maximum number of prefix accept from this peer\n"
3818 "maximum no. of prefix limit\n"
3819 "Threshold value (%) at which to generate a warning msg\n"
3820 "Restart bgp connection after limit is exceeded\n"
3821 "Restart interval in minutes")
3823 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3824 bgp_node_safi (vty
), argv
[1], argv
[2], 0, argv
[3]);
3827 DEFUN (no_neighbor_maximum_prefix
,
3828 no_neighbor_maximum_prefix_cmd
,
3829 NO_NEIGHBOR_CMD2
"maximum-prefix",
3833 "Maximum number of prefix accept from this peer\n")
3835 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3836 bgp_node_safi (vty
));
3839 ALIAS (no_neighbor_maximum_prefix
,
3840 no_neighbor_maximum_prefix_val_cmd
,
3841 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3845 "Maximum number of prefix accept from this peer\n"
3846 "maximum no. of prefix limit\n")
3848 ALIAS (no_neighbor_maximum_prefix
,
3849 no_neighbor_maximum_prefix_threshold_cmd
,
3850 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3854 "Maximum number of prefix accept from this peer\n"
3855 "maximum no. of prefix limit\n"
3856 "Threshold value (%) at which to generate a warning msg\n")
3858 ALIAS (no_neighbor_maximum_prefix
,
3859 no_neighbor_maximum_prefix_warning_cmd
,
3860 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3864 "Maximum number of prefix accept from this peer\n"
3865 "maximum no. of prefix limit\n"
3866 "Only give warning message when limit is exceeded\n")
3868 ALIAS (no_neighbor_maximum_prefix
,
3869 no_neighbor_maximum_prefix_threshold_warning_cmd
,
3870 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3874 "Maximum number of prefix accept from this peer\n"
3875 "maximum no. of prefix limit\n"
3876 "Threshold value (%) at which to generate a warning msg\n"
3877 "Only give warning message when limit is exceeded\n")
3879 ALIAS (no_neighbor_maximum_prefix
,
3880 no_neighbor_maximum_prefix_restart_cmd
,
3881 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
3885 "Maximum number of prefix accept from this peer\n"
3886 "maximum no. of prefix limit\n"
3887 "Restart bgp connection after limit is exceeded\n"
3888 "Restart interval in minutes")
3890 ALIAS (no_neighbor_maximum_prefix
,
3891 no_neighbor_maximum_prefix_threshold_restart_cmd
,
3892 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
3896 "Maximum number of prefix accept from this peer\n"
3897 "maximum no. of prefix limit\n"
3898 "Threshold value (%) at which to generate a warning msg\n"
3899 "Restart bgp connection after limit is exceeded\n"
3900 "Restart interval in minutes")
3902 /* "neighbor allowas-in" */
3903 DEFUN (neighbor_allowas_in
,
3904 neighbor_allowas_in_cmd
,
3905 NEIGHBOR_CMD2
"allowas-in",
3908 "Accept as-path with my AS present in it\n")
3912 unsigned int allow_num
;
3914 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3921 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
3923 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
3926 return bgp_vty_return (vty
, ret
);
3929 ALIAS (neighbor_allowas_in
,
3930 neighbor_allowas_in_arg_cmd
,
3931 NEIGHBOR_CMD2
"allowas-in <1-10>",
3934 "Accept as-path with my AS present in it\n"
3935 "Number of occurances of AS number\n")
3937 DEFUN (no_neighbor_allowas_in
,
3938 no_neighbor_allowas_in_cmd
,
3939 NO_NEIGHBOR_CMD2
"allowas-in",
3943 "allow local ASN appears in aspath attribute\n")
3948 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3952 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3954 return bgp_vty_return (vty
, ret
);
3957 /* Address family configuration. */
3958 DEFUN (address_family_ipv4
,
3959 address_family_ipv4_cmd
,
3960 "address-family ipv4",
3961 "Enter Address Family command mode\n"
3964 vty
->node
= BGP_IPV4_NODE
;
3968 DEFUN (address_family_ipv4_safi
,
3969 address_family_ipv4_safi_cmd
,
3970 "address-family ipv4 (unicast|multicast)",
3971 "Enter Address Family command mode\n"
3973 "Address Family modifier\n"
3974 "Address Family modifier\n")
3976 if (strncmp (argv
[0], "m", 1) == 0)
3977 vty
->node
= BGP_IPV4M_NODE
;
3979 vty
->node
= BGP_IPV4_NODE
;
3984 DEFUN (address_family_ipv6
,
3985 address_family_ipv6_cmd
,
3986 "address-family ipv6",
3987 "Enter Address Family command mode\n"
3990 vty
->node
= BGP_IPV6_NODE
;
3994 DEFUN (address_family_ipv6_safi
,
3995 address_family_ipv6_safi_cmd
,
3996 "address-family ipv6 (unicast|multicast)",
3997 "Enter Address Family command mode\n"
3999 "Address Family modifier\n"
4000 "Address Family modifier\n")
4002 if (strncmp (argv
[0], "m", 1) == 0)
4003 vty
->node
= BGP_IPV6M_NODE
;
4005 vty
->node
= BGP_IPV6_NODE
;
4010 DEFUN (address_family_vpnv4
,
4011 address_family_vpnv4_cmd
,
4012 "address-family vpnv4",
4013 "Enter Address Family command mode\n"
4016 vty
->node
= BGP_VPNV4_NODE
;
4020 ALIAS (address_family_vpnv4
,
4021 address_family_vpnv4_unicast_cmd
,
4022 "address-family vpnv4 unicast",
4023 "Enter Address Family command mode\n"
4025 "Address Family Modifier\n")
4027 DEFUN (exit_address_family
,
4028 exit_address_family_cmd
,
4029 "exit-address-family",
4030 "Exit from Address Family configuration mode\n")
4032 if (vty
->node
== BGP_IPV4_NODE
4033 || vty
->node
== BGP_IPV4M_NODE
4034 || vty
->node
== BGP_VPNV4_NODE
4035 || vty
->node
== BGP_IPV6_NODE
4036 || vty
->node
== BGP_IPV6M_NODE
)
4037 vty
->node
= BGP_NODE
;
4041 /* BGP clear sort. */
4052 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
4053 safi_t safi
, int error
)
4057 case BGP_ERR_AF_UNCONFIGURED
:
4059 "%%BGP: Enable %s %s address family for the neighbor %s%s",
4060 afi
== AFI_IP6
? "IPv6" : safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
4061 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
4062 peer
->host
, VTY_NEWLINE
);
4064 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
4065 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
);
4072 /* `clear ip bgp' functions. */
4074 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
4075 enum clear_sort sort
,enum bgp_clear_type stype
, const char *arg
)
4079 struct listnode
*node
, *nnode
;
4081 /* Clear all neighbors. */
4082 if (sort
== clear_all
)
4084 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4086 if (stype
== BGP_CLEAR_SOFT_NONE
)
4087 ret
= peer_clear (peer
);
4089 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4092 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4097 /* Clear specified neighbors. */
4098 if (sort
== clear_peer
)
4103 /* Make sockunion for lookup. */
4104 ret
= str2sockunion (arg
, &su
);
4107 vty_out (vty
, "Malformed address: %s%s", arg
, VTY_NEWLINE
);
4110 peer
= peer_lookup (bgp
, &su
);
4113 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
4117 if (stype
== BGP_CLEAR_SOFT_NONE
)
4118 ret
= peer_clear (peer
);
4120 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4123 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4128 /* Clear all peer-group members. */
4129 if (sort
== clear_group
)
4131 struct peer_group
*group
;
4133 group
= peer_group_lookup (bgp
, arg
);
4136 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
4140 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
4142 if (stype
== BGP_CLEAR_SOFT_NONE
)
4144 ret
= peer_clear (peer
);
4148 if (! peer
->af_group
[afi
][safi
])
4151 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4154 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4159 if (sort
== clear_external
)
4161 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4163 if (peer_sort (peer
) == BGP_PEER_IBGP
)
4166 if (stype
== BGP_CLEAR_SOFT_NONE
)
4167 ret
= peer_clear (peer
);
4169 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4172 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4177 if (sort
== clear_as
)
4180 unsigned long as_ul
;
4183 VTY_GET_LONG ("AS", as_ul
, arg
);
4187 vty_out (vty
, "Invalid AS number%s", VTY_NEWLINE
);
4192 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4198 if (stype
== BGP_CLEAR_SOFT_NONE
)
4199 ret
= peer_clear (peer
);
4201 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4204 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4207 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
4216 bgp_clear_vty (struct vty
*vty
, const char *name
, afi_t afi
, safi_t safi
,
4217 enum clear_sort sort
, enum bgp_clear_type stype
,
4222 /* BGP structure lookup. */
4225 bgp
= bgp_lookup_by_name (name
);
4228 vty_out (vty
, "Can't find BGP view %s%s", name
, VTY_NEWLINE
);
4234 bgp
= bgp_get_default ();
4237 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
4242 return bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
4245 DEFUN (clear_ip_bgp_all
,
4246 clear_ip_bgp_all_cmd
,
4251 "Clear all peers\n")
4254 return bgp_clear_vty (vty
, argv
[0], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4256 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4259 ALIAS (clear_ip_bgp_all
,
4264 "Clear all peers\n")
4266 ALIAS (clear_ip_bgp_all
,
4267 clear_bgp_ipv6_all_cmd
,
4272 "Clear all peers\n")
4274 ALIAS (clear_ip_bgp_all
,
4275 clear_ip_bgp_instance_all_cmd
,
4276 "clear ip bgp view WORD *",
4282 "Clear all peers\n")
4284 ALIAS (clear_ip_bgp_all
,
4285 clear_bgp_instance_all_cmd
,
4286 "clear bgp view WORD *",
4291 "Clear all peers\n")
4293 DEFUN (clear_ip_bgp_peer
,
4294 clear_ip_bgp_peer_cmd
,
4295 "clear ip bgp (A.B.C.D|X:X::X:X)",
4299 "BGP neighbor IP address to clear\n"
4300 "BGP IPv6 neighbor to clear\n")
4302 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4305 ALIAS (clear_ip_bgp_peer
,
4307 "clear bgp (A.B.C.D|X:X::X:X)",
4310 "BGP neighbor address to clear\n"
4311 "BGP IPv6 neighbor to clear\n")
4313 ALIAS (clear_ip_bgp_peer
,
4314 clear_bgp_ipv6_peer_cmd
,
4315 "clear bgp ipv6 (A.B.C.D|X:X::X:X)",
4319 "BGP neighbor address to clear\n"
4320 "BGP IPv6 neighbor to clear\n")
4322 DEFUN (clear_ip_bgp_peer_group
,
4323 clear_ip_bgp_peer_group_cmd
,
4324 "clear ip bgp peer-group WORD",
4328 "Clear all members of peer-group\n"
4329 "BGP peer-group name\n")
4331 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4334 ALIAS (clear_ip_bgp_peer_group
,
4335 clear_bgp_peer_group_cmd
,
4336 "clear bgp peer-group WORD",
4339 "Clear all members of peer-group\n"
4340 "BGP peer-group name\n")
4342 ALIAS (clear_ip_bgp_peer_group
,
4343 clear_bgp_ipv6_peer_group_cmd
,
4344 "clear bgp ipv6 peer-group WORD",
4348 "Clear all members of peer-group\n"
4349 "BGP peer-group name\n")
4351 DEFUN (clear_ip_bgp_external
,
4352 clear_ip_bgp_external_cmd
,
4353 "clear ip bgp external",
4357 "Clear all external peers\n")
4359 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
4362 ALIAS (clear_ip_bgp_external
,
4363 clear_bgp_external_cmd
,
4364 "clear bgp external",
4367 "Clear all external peers\n")
4369 ALIAS (clear_ip_bgp_external
,
4370 clear_bgp_ipv6_external_cmd
,
4371 "clear bgp ipv6 external",
4375 "Clear all external peers\n")
4377 DEFUN (clear_ip_bgp_as
,
4378 clear_ip_bgp_as_cmd
,
4379 "clear ip bgp " CMD_AS_RANGE
,
4383 "Clear peers with the AS number\n")
4385 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4388 ALIAS (clear_ip_bgp_as
,
4390 "clear bgp " CMD_AS_RANGE
,
4393 "Clear peers with the AS number\n")
4395 ALIAS (clear_ip_bgp_as
,
4396 clear_bgp_ipv6_as_cmd
,
4397 "clear bgp ipv6 " CMD_AS_RANGE
,
4401 "Clear peers with the AS number\n")
4403 /* Outbound soft-reconfiguration */
4404 DEFUN (clear_ip_bgp_all_soft_out
,
4405 clear_ip_bgp_all_soft_out_cmd
,
4406 "clear ip bgp * soft out",
4412 "Soft reconfig outbound update\n")
4415 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4416 BGP_CLEAR_SOFT_OUT
, NULL
);
4418 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4419 BGP_CLEAR_SOFT_OUT
, NULL
);
4422 ALIAS (clear_ip_bgp_all_soft_out
,
4423 clear_ip_bgp_all_out_cmd
,
4424 "clear ip bgp * out",
4429 "Soft reconfig outbound update\n")
4431 ALIAS (clear_ip_bgp_all_soft_out
,
4432 clear_ip_bgp_instance_all_soft_out_cmd
,
4433 "clear ip bgp view WORD * soft out",
4441 "Soft reconfig outbound update\n")
4443 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
4444 clear_ip_bgp_all_ipv4_soft_out_cmd
,
4445 "clear ip bgp * ipv4 (unicast|multicast) soft out",
4451 "Address Family modifier\n"
4452 "Address Family modifier\n"
4454 "Soft reconfig outbound update\n")
4456 if (strncmp (argv
[0], "m", 1) == 0)
4457 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4458 BGP_CLEAR_SOFT_OUT
, NULL
);
4460 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4461 BGP_CLEAR_SOFT_OUT
, NULL
);
4464 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
4465 clear_ip_bgp_all_ipv4_out_cmd
,
4466 "clear ip bgp * ipv4 (unicast|multicast) out",
4472 "Address Family modifier\n"
4473 "Address Family modifier\n"
4474 "Soft reconfig outbound update\n")
4476 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
4477 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
4478 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out",
4486 "Address Family modifier\n"
4487 "Address Family modifier\n"
4488 "Soft reconfig outbound update\n")
4490 if (strncmp (argv
[1], "m", 1) == 0)
4491 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4492 BGP_CLEAR_SOFT_OUT
, NULL
);
4494 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4495 BGP_CLEAR_SOFT_OUT
, NULL
);
4498 DEFUN (clear_ip_bgp_all_vpnv4_soft_out
,
4499 clear_ip_bgp_all_vpnv4_soft_out_cmd
,
4500 "clear ip bgp * vpnv4 unicast soft out",
4506 "Address Family Modifier\n"
4508 "Soft reconfig outbound update\n")
4510 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
4511 BGP_CLEAR_SOFT_OUT
, NULL
);
4514 ALIAS (clear_ip_bgp_all_vpnv4_soft_out
,
4515 clear_ip_bgp_all_vpnv4_out_cmd
,
4516 "clear ip bgp * vpnv4 unicast out",
4522 "Address Family Modifier\n"
4523 "Soft reconfig outbound update\n")
4525 DEFUN (clear_bgp_all_soft_out
,
4526 clear_bgp_all_soft_out_cmd
,
4527 "clear bgp * soft out",
4532 "Soft reconfig outbound update\n")
4535 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
4536 BGP_CLEAR_SOFT_OUT
, NULL
);
4538 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
4539 BGP_CLEAR_SOFT_OUT
, NULL
);
4542 ALIAS (clear_bgp_all_soft_out
,
4543 clear_bgp_instance_all_soft_out_cmd
,
4544 "clear bgp view WORD * soft out",
4551 "Soft reconfig outbound update\n")
4553 ALIAS (clear_bgp_all_soft_out
,
4554 clear_bgp_all_out_cmd
,
4559 "Soft reconfig outbound update\n")
4561 ALIAS (clear_bgp_all_soft_out
,
4562 clear_bgp_ipv6_all_soft_out_cmd
,
4563 "clear bgp ipv6 * soft out",
4569 "Soft reconfig outbound update\n")
4571 ALIAS (clear_bgp_all_soft_out
,
4572 clear_bgp_ipv6_all_out_cmd
,
4573 "clear bgp ipv6 * out",
4578 "Soft reconfig outbound update\n")
4580 DEFUN (clear_ip_bgp_peer_soft_out
,
4581 clear_ip_bgp_peer_soft_out_cmd
,
4582 "clear ip bgp A.B.C.D soft out",
4586 "BGP neighbor address to clear\n"
4588 "Soft reconfig outbound update\n")
4590 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4591 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4594 ALIAS (clear_ip_bgp_peer_soft_out
,
4595 clear_ip_bgp_peer_out_cmd
,
4596 "clear ip bgp A.B.C.D out",
4600 "BGP neighbor address to clear\n"
4601 "Soft reconfig outbound update\n")
4603 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
4604 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
4605 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out",
4609 "BGP neighbor address to clear\n"
4611 "Address Family modifier\n"
4612 "Address Family modifier\n"
4614 "Soft reconfig outbound update\n")
4616 if (strncmp (argv
[1], "m", 1) == 0)
4617 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
4618 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4620 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4621 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4624 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
4625 clear_ip_bgp_peer_ipv4_out_cmd
,
4626 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out",
4630 "BGP neighbor address to clear\n"
4632 "Address Family modifier\n"
4633 "Address Family modifier\n"
4634 "Soft reconfig outbound update\n")
4636 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out
,
4637 clear_ip_bgp_peer_vpnv4_soft_out_cmd
,
4638 "clear ip bgp A.B.C.D vpnv4 unicast soft out",
4642 "BGP neighbor address to clear\n"
4644 "Address Family Modifier\n"
4646 "Soft reconfig outbound update\n")
4648 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
4649 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4652 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out
,
4653 clear_ip_bgp_peer_vpnv4_out_cmd
,
4654 "clear ip bgp A.B.C.D vpnv4 unicast out",
4658 "BGP neighbor address to clear\n"
4660 "Address Family Modifier\n"
4661 "Soft reconfig outbound update\n")
4663 DEFUN (clear_bgp_peer_soft_out
,
4664 clear_bgp_peer_soft_out_cmd
,
4665 "clear bgp (A.B.C.D|X:X::X:X) soft out",
4668 "BGP neighbor address to clear\n"
4669 "BGP IPv6 neighbor to clear\n"
4671 "Soft reconfig outbound update\n")
4673 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
4674 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4677 ALIAS (clear_bgp_peer_soft_out
,
4678 clear_bgp_ipv6_peer_soft_out_cmd
,
4679 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out",
4683 "BGP neighbor address to clear\n"
4684 "BGP IPv6 neighbor to clear\n"
4686 "Soft reconfig outbound update\n")
4688 ALIAS (clear_bgp_peer_soft_out
,
4689 clear_bgp_peer_out_cmd
,
4690 "clear bgp (A.B.C.D|X:X::X:X) out",
4693 "BGP neighbor address to clear\n"
4694 "BGP IPv6 neighbor to clear\n"
4695 "Soft reconfig outbound update\n")
4697 ALIAS (clear_bgp_peer_soft_out
,
4698 clear_bgp_ipv6_peer_out_cmd
,
4699 "clear bgp ipv6 (A.B.C.D|X:X::X:X) out",
4703 "BGP neighbor address to clear\n"
4704 "BGP IPv6 neighbor to clear\n"
4705 "Soft reconfig outbound update\n")
4707 DEFUN (clear_ip_bgp_peer_group_soft_out
,
4708 clear_ip_bgp_peer_group_soft_out_cmd
,
4709 "clear ip bgp peer-group WORD soft out",
4713 "Clear all members of peer-group\n"
4714 "BGP peer-group name\n"
4716 "Soft reconfig outbound update\n")
4718 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4719 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4722 ALIAS (clear_ip_bgp_peer_group_soft_out
,
4723 clear_ip_bgp_peer_group_out_cmd
,
4724 "clear ip bgp peer-group WORD out",
4728 "Clear all members of peer-group\n"
4729 "BGP peer-group name\n"
4730 "Soft reconfig outbound update\n")
4732 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
4733 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
4734 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
4738 "Clear all members of peer-group\n"
4739 "BGP peer-group name\n"
4741 "Address Family modifier\n"
4742 "Address Family modifier\n"
4744 "Soft reconfig outbound update\n")
4746 if (strncmp (argv
[1], "m", 1) == 0)
4747 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
4748 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4750 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4751 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4754 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
4755 clear_ip_bgp_peer_group_ipv4_out_cmd
,
4756 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
4760 "Clear all members of peer-group\n"
4761 "BGP peer-group name\n"
4763 "Address Family modifier\n"
4764 "Address Family modifier\n"
4765 "Soft reconfig outbound update\n")
4767 DEFUN (clear_bgp_peer_group_soft_out
,
4768 clear_bgp_peer_group_soft_out_cmd
,
4769 "clear bgp peer-group WORD soft out",
4772 "Clear all members of peer-group\n"
4773 "BGP peer-group name\n"
4775 "Soft reconfig outbound update\n")
4777 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
4778 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4781 ALIAS (clear_bgp_peer_group_soft_out
,
4782 clear_bgp_ipv6_peer_group_soft_out_cmd
,
4783 "clear bgp ipv6 peer-group WORD soft out",
4787 "Clear all members of peer-group\n"
4788 "BGP peer-group name\n"
4790 "Soft reconfig outbound update\n")
4792 ALIAS (clear_bgp_peer_group_soft_out
,
4793 clear_bgp_peer_group_out_cmd
,
4794 "clear bgp peer-group WORD out",
4797 "Clear all members of peer-group\n"
4798 "BGP peer-group name\n"
4799 "Soft reconfig outbound update\n")
4801 ALIAS (clear_bgp_peer_group_soft_out
,
4802 clear_bgp_ipv6_peer_group_out_cmd
,
4803 "clear bgp ipv6 peer-group WORD out",
4807 "Clear all members of peer-group\n"
4808 "BGP peer-group name\n"
4809 "Soft reconfig outbound update\n")
4811 DEFUN (clear_ip_bgp_external_soft_out
,
4812 clear_ip_bgp_external_soft_out_cmd
,
4813 "clear ip bgp external soft out",
4817 "Clear all external peers\n"
4819 "Soft reconfig outbound update\n")
4821 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4822 BGP_CLEAR_SOFT_OUT
, NULL
);
4825 ALIAS (clear_ip_bgp_external_soft_out
,
4826 clear_ip_bgp_external_out_cmd
,
4827 "clear ip bgp external out",
4831 "Clear all external peers\n"
4832 "Soft reconfig outbound update\n")
4834 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
4835 clear_ip_bgp_external_ipv4_soft_out_cmd
,
4836 "clear ip bgp external ipv4 (unicast|multicast) soft out",
4840 "Clear all external peers\n"
4842 "Address Family modifier\n"
4843 "Address Family modifier\n"
4845 "Soft reconfig outbound update\n")
4847 if (strncmp (argv
[0], "m", 1) == 0)
4848 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
4849 BGP_CLEAR_SOFT_OUT
, NULL
);
4851 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4852 BGP_CLEAR_SOFT_OUT
, NULL
);
4855 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
4856 clear_ip_bgp_external_ipv4_out_cmd
,
4857 "clear ip bgp external ipv4 (unicast|multicast) out",
4861 "Clear all external peers\n"
4863 "Address Family modifier\n"
4864 "Address Family modifier\n"
4865 "Soft reconfig outbound update\n")
4867 DEFUN (clear_bgp_external_soft_out
,
4868 clear_bgp_external_soft_out_cmd
,
4869 "clear bgp external soft out",
4872 "Clear all external peers\n"
4874 "Soft reconfig outbound update\n")
4876 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
4877 BGP_CLEAR_SOFT_OUT
, NULL
);
4880 ALIAS (clear_bgp_external_soft_out
,
4881 clear_bgp_ipv6_external_soft_out_cmd
,
4882 "clear bgp ipv6 external soft out",
4886 "Clear all external peers\n"
4888 "Soft reconfig outbound update\n")
4890 ALIAS (clear_bgp_external_soft_out
,
4891 clear_bgp_external_out_cmd
,
4892 "clear bgp external out",
4895 "Clear all external peers\n"
4896 "Soft reconfig outbound update\n")
4898 ALIAS (clear_bgp_external_soft_out
,
4899 clear_bgp_ipv6_external_out_cmd
,
4900 "clear bgp ipv6 external WORD out",
4904 "Clear all external peers\n"
4905 "Soft reconfig outbound update\n")
4907 DEFUN (clear_ip_bgp_as_soft_out
,
4908 clear_ip_bgp_as_soft_out_cmd
,
4909 "clear ip bgp " CMD_AS_RANGE
" soft out",
4913 "Clear peers with the AS number\n"
4915 "Soft reconfig outbound update\n")
4917 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4918 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4921 ALIAS (clear_ip_bgp_as_soft_out
,
4922 clear_ip_bgp_as_out_cmd
,
4923 "clear ip bgp " CMD_AS_RANGE
" out",
4927 "Clear peers with the AS number\n"
4928 "Soft reconfig outbound update\n")
4930 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
4931 clear_ip_bgp_as_ipv4_soft_out_cmd
,
4932 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft out",
4936 "Clear peers with the AS number\n"
4938 "Address Family modifier\n"
4939 "Address Family modifier\n"
4941 "Soft reconfig outbound update\n")
4943 if (strncmp (argv
[1], "m", 1) == 0)
4944 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
4945 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4947 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4948 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4951 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
4952 clear_ip_bgp_as_ipv4_out_cmd
,
4953 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) out",
4957 "Clear peers with the AS number\n"
4959 "Address Family modifier\n"
4960 "Address Family modifier\n"
4961 "Soft reconfig outbound update\n")
4963 DEFUN (clear_ip_bgp_as_vpnv4_soft_out
,
4964 clear_ip_bgp_as_vpnv4_soft_out_cmd
,
4965 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft out",
4969 "Clear peers with the AS number\n"
4971 "Address Family modifier\n"
4973 "Soft reconfig outbound update\n")
4975 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
4976 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4979 ALIAS (clear_ip_bgp_as_vpnv4_soft_out
,
4980 clear_ip_bgp_as_vpnv4_out_cmd
,
4981 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast out",
4985 "Clear peers with the AS number\n"
4987 "Address Family modifier\n"
4988 "Soft reconfig outbound update\n")
4990 DEFUN (clear_bgp_as_soft_out
,
4991 clear_bgp_as_soft_out_cmd
,
4992 "clear bgp " CMD_AS_RANGE
" soft out",
4995 "Clear peers with the AS number\n"
4997 "Soft reconfig outbound update\n")
4999 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5000 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5003 ALIAS (clear_bgp_as_soft_out
,
5004 clear_bgp_ipv6_as_soft_out_cmd
,
5005 "clear bgp ipv6 " CMD_AS_RANGE
" soft out",
5009 "Clear peers with the AS number\n"
5011 "Soft reconfig outbound update\n")
5013 ALIAS (clear_bgp_as_soft_out
,
5014 clear_bgp_as_out_cmd
,
5015 "clear bgp " CMD_AS_RANGE
" out",
5018 "Clear peers with the AS number\n"
5019 "Soft reconfig outbound update\n")
5021 ALIAS (clear_bgp_as_soft_out
,
5022 clear_bgp_ipv6_as_out_cmd
,
5023 "clear bgp ipv6 " CMD_AS_RANGE
" out",
5027 "Clear peers with the AS number\n"
5028 "Soft reconfig outbound update\n")
5030 /* Inbound soft-reconfiguration */
5031 DEFUN (clear_ip_bgp_all_soft_in
,
5032 clear_ip_bgp_all_soft_in_cmd
,
5033 "clear ip bgp * soft in",
5039 "Soft reconfig inbound update\n")
5042 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5043 BGP_CLEAR_SOFT_IN
, NULL
);
5045 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5046 BGP_CLEAR_SOFT_IN
, NULL
);
5049 ALIAS (clear_ip_bgp_all_soft_in
,
5050 clear_ip_bgp_instance_all_soft_in_cmd
,
5051 "clear ip bgp view WORD * soft in",
5059 "Soft reconfig inbound update\n")
5061 ALIAS (clear_ip_bgp_all_soft_in
,
5062 clear_ip_bgp_all_in_cmd
,
5063 "clear ip bgp * in",
5068 "Soft reconfig inbound update\n")
5070 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
5071 clear_ip_bgp_all_in_prefix_filter_cmd
,
5072 "clear ip bgp * in prefix-filter",
5077 "Soft reconfig inbound update\n"
5078 "Push out prefix-list ORF and do inbound soft reconfig\n")
5081 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5082 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5084 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5085 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5088 ALIAS (clear_ip_bgp_all_in_prefix_filter
,
5089 clear_ip_bgp_instance_all_in_prefix_filter_cmd
,
5090 "clear ip bgp view WORD * in prefix-filter",
5097 "Soft reconfig inbound update\n"
5098 "Push out prefix-list ORF and do inbound soft reconfig\n")
5101 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
5102 clear_ip_bgp_all_ipv4_soft_in_cmd
,
5103 "clear ip bgp * ipv4 (unicast|multicast) soft in",
5109 "Address Family modifier\n"
5110 "Address Family modifier\n"
5112 "Soft reconfig inbound update\n")
5114 if (strncmp (argv
[0], "m", 1) == 0)
5115 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5116 BGP_CLEAR_SOFT_IN
, NULL
);
5118 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5119 BGP_CLEAR_SOFT_IN
, NULL
);
5122 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
5123 clear_ip_bgp_all_ipv4_in_cmd
,
5124 "clear ip bgp * ipv4 (unicast|multicast) in",
5130 "Address Family modifier\n"
5131 "Address Family modifier\n"
5132 "Soft reconfig inbound update\n")
5134 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
5135 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
5136 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in",
5144 "Address Family modifier\n"
5145 "Address Family modifier\n"
5147 "Soft reconfig inbound update\n")
5149 if (strncmp (argv
[1], "m", 1) == 0)
5150 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5151 BGP_CLEAR_SOFT_IN
, NULL
);
5153 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5154 BGP_CLEAR_SOFT_IN
, NULL
);
5157 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
5158 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
5159 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
5165 "Address Family modifier\n"
5166 "Address Family modifier\n"
5167 "Soft reconfig inbound update\n"
5168 "Push out prefix-list ORF and do inbound soft reconfig\n")
5170 if (strncmp (argv
[0], "m", 1) == 0)
5171 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5172 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5174 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5175 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5178 DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter
,
5179 clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
,
5180 "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter",
5186 "Address Family modifier\n"
5187 "Address Family modifier\n"
5188 "Soft reconfig inbound update\n"
5189 "Push out prefix-list ORF and do inbound soft reconfig\n")
5191 if (strncmp (argv
[1], "m", 1) == 0)
5192 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5193 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5195 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5196 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5199 DEFUN (clear_ip_bgp_all_vpnv4_soft_in
,
5200 clear_ip_bgp_all_vpnv4_soft_in_cmd
,
5201 "clear ip bgp * vpnv4 unicast soft in",
5207 "Address Family Modifier\n"
5209 "Soft reconfig inbound update\n")
5211 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
5212 BGP_CLEAR_SOFT_IN
, NULL
);
5215 ALIAS (clear_ip_bgp_all_vpnv4_soft_in
,
5216 clear_ip_bgp_all_vpnv4_in_cmd
,
5217 "clear ip bgp * vpnv4 unicast in",
5223 "Address Family Modifier\n"
5224 "Soft reconfig inbound update\n")
5226 DEFUN (clear_bgp_all_soft_in
,
5227 clear_bgp_all_soft_in_cmd
,
5228 "clear bgp * soft in",
5233 "Soft reconfig inbound update\n")
5236 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
5237 BGP_CLEAR_SOFT_IN
, NULL
);
5239 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5240 BGP_CLEAR_SOFT_IN
, NULL
);
5243 ALIAS (clear_bgp_all_soft_in
,
5244 clear_bgp_instance_all_soft_in_cmd
,
5245 "clear bgp view WORD * soft in",
5252 "Soft reconfig inbound update\n")
5254 ALIAS (clear_bgp_all_soft_in
,
5255 clear_bgp_ipv6_all_soft_in_cmd
,
5256 "clear bgp ipv6 * soft in",
5262 "Soft reconfig inbound update\n")
5264 ALIAS (clear_bgp_all_soft_in
,
5265 clear_bgp_all_in_cmd
,
5270 "Soft reconfig inbound update\n")
5272 ALIAS (clear_bgp_all_soft_in
,
5273 clear_bgp_ipv6_all_in_cmd
,
5274 "clear bgp ipv6 * in",
5279 "Soft reconfig inbound update\n")
5281 DEFUN (clear_bgp_all_in_prefix_filter
,
5282 clear_bgp_all_in_prefix_filter_cmd
,
5283 "clear bgp * in prefix-filter",
5287 "Soft reconfig inbound update\n"
5288 "Push out prefix-list ORF and do inbound soft reconfig\n")
5290 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5291 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5294 ALIAS (clear_bgp_all_in_prefix_filter
,
5295 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
5296 "clear bgp ipv6 * in prefix-filter",
5301 "Soft reconfig inbound update\n"
5302 "Push out prefix-list ORF and do inbound soft reconfig\n")
5304 DEFUN (clear_ip_bgp_peer_soft_in
,
5305 clear_ip_bgp_peer_soft_in_cmd
,
5306 "clear ip bgp A.B.C.D soft in",
5310 "BGP neighbor address to clear\n"
5312 "Soft reconfig inbound update\n")
5314 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5315 BGP_CLEAR_SOFT_IN
, argv
[0]);
5318 ALIAS (clear_ip_bgp_peer_soft_in
,
5319 clear_ip_bgp_peer_in_cmd
,
5320 "clear ip bgp A.B.C.D in",
5324 "BGP neighbor address to clear\n"
5325 "Soft reconfig inbound update\n")
5327 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
5328 clear_ip_bgp_peer_in_prefix_filter_cmd
,
5329 "clear ip bgp A.B.C.D in prefix-filter",
5333 "BGP neighbor address to clear\n"
5334 "Soft reconfig inbound update\n"
5335 "Push out the existing ORF prefix-list\n")
5337 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5338 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5341 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
5342 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
5343 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in",
5347 "BGP neighbor address to clear\n"
5349 "Address Family modifier\n"
5350 "Address Family modifier\n"
5352 "Soft reconfig inbound update\n")
5354 if (strncmp (argv
[1], "m", 1) == 0)
5355 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5356 BGP_CLEAR_SOFT_IN
, argv
[0]);
5358 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5359 BGP_CLEAR_SOFT_IN
, argv
[0]);
5362 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
5363 clear_ip_bgp_peer_ipv4_in_cmd
,
5364 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in",
5368 "BGP neighbor address to clear\n"
5370 "Address Family modifier\n"
5371 "Address Family modifier\n"
5372 "Soft reconfig inbound update\n")
5374 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
5375 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
5376 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter",
5380 "BGP neighbor address to clear\n"
5382 "Address Family modifier\n"
5383 "Address Family modifier\n"
5384 "Soft reconfig inbound update\n"
5385 "Push out the existing ORF prefix-list\n")
5387 if (strncmp (argv
[1], "m", 1) == 0)
5388 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5389 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5391 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5392 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5395 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in
,
5396 clear_ip_bgp_peer_vpnv4_soft_in_cmd
,
5397 "clear ip bgp A.B.C.D vpnv4 unicast soft in",
5401 "BGP neighbor address to clear\n"
5403 "Address Family Modifier\n"
5405 "Soft reconfig inbound update\n")
5407 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
5408 BGP_CLEAR_SOFT_IN
, argv
[0]);
5411 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in
,
5412 clear_ip_bgp_peer_vpnv4_in_cmd
,
5413 "clear ip bgp A.B.C.D vpnv4 unicast in",
5417 "BGP neighbor address to clear\n"
5419 "Address Family Modifier\n"
5420 "Soft reconfig inbound update\n")
5422 DEFUN (clear_bgp_peer_soft_in
,
5423 clear_bgp_peer_soft_in_cmd
,
5424 "clear bgp (A.B.C.D|X:X::X:X) soft in",
5427 "BGP neighbor address to clear\n"
5428 "BGP IPv6 neighbor to clear\n"
5430 "Soft reconfig inbound update\n")
5432 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5433 BGP_CLEAR_SOFT_IN
, argv
[0]);
5436 ALIAS (clear_bgp_peer_soft_in
,
5437 clear_bgp_ipv6_peer_soft_in_cmd
,
5438 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in",
5442 "BGP neighbor address to clear\n"
5443 "BGP IPv6 neighbor to clear\n"
5445 "Soft reconfig inbound update\n")
5447 ALIAS (clear_bgp_peer_soft_in
,
5448 clear_bgp_peer_in_cmd
,
5449 "clear bgp (A.B.C.D|X:X::X:X) in",
5452 "BGP neighbor address to clear\n"
5453 "BGP IPv6 neighbor to clear\n"
5454 "Soft reconfig inbound update\n")
5456 ALIAS (clear_bgp_peer_soft_in
,
5457 clear_bgp_ipv6_peer_in_cmd
,
5458 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in",
5462 "BGP neighbor address to clear\n"
5463 "BGP IPv6 neighbor to clear\n"
5464 "Soft reconfig inbound update\n")
5466 DEFUN (clear_bgp_peer_in_prefix_filter
,
5467 clear_bgp_peer_in_prefix_filter_cmd
,
5468 "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter",
5471 "BGP neighbor address to clear\n"
5472 "BGP IPv6 neighbor to clear\n"
5473 "Soft reconfig inbound update\n"
5474 "Push out the existing ORF prefix-list\n")
5476 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5477 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5480 ALIAS (clear_bgp_peer_in_prefix_filter
,
5481 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
5482 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter",
5486 "BGP neighbor address to clear\n"
5487 "BGP IPv6 neighbor to clear\n"
5488 "Soft reconfig inbound update\n"
5489 "Push out the existing ORF prefix-list\n")
5491 DEFUN (clear_ip_bgp_peer_group_soft_in
,
5492 clear_ip_bgp_peer_group_soft_in_cmd
,
5493 "clear ip bgp peer-group WORD soft in",
5497 "Clear all members of peer-group\n"
5498 "BGP peer-group name\n"
5500 "Soft reconfig inbound update\n")
5502 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5503 BGP_CLEAR_SOFT_IN
, argv
[0]);
5506 ALIAS (clear_ip_bgp_peer_group_soft_in
,
5507 clear_ip_bgp_peer_group_in_cmd
,
5508 "clear ip bgp peer-group WORD in",
5512 "Clear all members of peer-group\n"
5513 "BGP peer-group name\n"
5514 "Soft reconfig inbound update\n")
5516 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
5517 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
5518 "clear ip bgp peer-group WORD in prefix-filter",
5522 "Clear all members of peer-group\n"
5523 "BGP peer-group name\n"
5524 "Soft reconfig inbound update\n"
5525 "Push out prefix-list ORF and do inbound soft reconfig\n")
5527 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5528 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5531 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
5532 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
5533 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
5537 "Clear all members of peer-group\n"
5538 "BGP peer-group name\n"
5540 "Address Family modifier\n"
5541 "Address Family modifier\n"
5543 "Soft reconfig inbound update\n")
5545 if (strncmp (argv
[1], "m", 1) == 0)
5546 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5547 BGP_CLEAR_SOFT_IN
, argv
[0]);
5549 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5550 BGP_CLEAR_SOFT_IN
, argv
[0]);
5553 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
5554 clear_ip_bgp_peer_group_ipv4_in_cmd
,
5555 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
5559 "Clear all members of peer-group\n"
5560 "BGP peer-group name\n"
5562 "Address Family modifier\n"
5563 "Address Family modifier\n"
5564 "Soft reconfig inbound update\n")
5566 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
5567 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
5568 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
5572 "Clear all members of peer-group\n"
5573 "BGP peer-group name\n"
5575 "Address Family modifier\n"
5576 "Address Family modifier\n"
5577 "Soft reconfig inbound update\n"
5578 "Push out prefix-list ORF and do inbound soft reconfig\n")
5580 if (strncmp (argv
[1], "m", 1) == 0)
5581 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5582 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5584 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5585 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5588 DEFUN (clear_bgp_peer_group_soft_in
,
5589 clear_bgp_peer_group_soft_in_cmd
,
5590 "clear bgp peer-group WORD soft in",
5593 "Clear all members of peer-group\n"
5594 "BGP peer-group name\n"
5596 "Soft reconfig inbound update\n")
5598 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5599 BGP_CLEAR_SOFT_IN
, argv
[0]);
5602 ALIAS (clear_bgp_peer_group_soft_in
,
5603 clear_bgp_ipv6_peer_group_soft_in_cmd
,
5604 "clear bgp ipv6 peer-group WORD soft in",
5608 "Clear all members of peer-group\n"
5609 "BGP peer-group name\n"
5611 "Soft reconfig inbound update\n")
5613 ALIAS (clear_bgp_peer_group_soft_in
,
5614 clear_bgp_peer_group_in_cmd
,
5615 "clear bgp peer-group WORD in",
5618 "Clear all members of peer-group\n"
5619 "BGP peer-group name\n"
5620 "Soft reconfig inbound update\n")
5622 ALIAS (clear_bgp_peer_group_soft_in
,
5623 clear_bgp_ipv6_peer_group_in_cmd
,
5624 "clear bgp ipv6 peer-group WORD in",
5628 "Clear all members of peer-group\n"
5629 "BGP peer-group name\n"
5630 "Soft reconfig inbound update\n")
5632 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
5633 clear_bgp_peer_group_in_prefix_filter_cmd
,
5634 "clear bgp peer-group WORD in prefix-filter",
5637 "Clear all members of peer-group\n"
5638 "BGP peer-group name\n"
5639 "Soft reconfig inbound update\n"
5640 "Push out prefix-list ORF and do inbound soft reconfig\n")
5642 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5643 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5646 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
5647 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
5648 "clear bgp ipv6 peer-group WORD in prefix-filter",
5652 "Clear all members of peer-group\n"
5653 "BGP peer-group name\n"
5654 "Soft reconfig inbound update\n"
5655 "Push out prefix-list ORF and do inbound soft reconfig\n")
5657 DEFUN (clear_ip_bgp_external_soft_in
,
5658 clear_ip_bgp_external_soft_in_cmd
,
5659 "clear ip bgp external soft in",
5663 "Clear all external peers\n"
5665 "Soft reconfig inbound update\n")
5667 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5668 BGP_CLEAR_SOFT_IN
, NULL
);
5671 ALIAS (clear_ip_bgp_external_soft_in
,
5672 clear_ip_bgp_external_in_cmd
,
5673 "clear ip bgp external in",
5677 "Clear all external peers\n"
5678 "Soft reconfig inbound update\n")
5680 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
5681 clear_ip_bgp_external_in_prefix_filter_cmd
,
5682 "clear ip bgp external in prefix-filter",
5686 "Clear all external peers\n"
5687 "Soft reconfig inbound update\n"
5688 "Push out prefix-list ORF and do inbound soft reconfig\n")
5690 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5691 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5694 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
5695 clear_ip_bgp_external_ipv4_soft_in_cmd
,
5696 "clear ip bgp external ipv4 (unicast|multicast) soft in",
5700 "Clear all external peers\n"
5702 "Address Family modifier\n"
5703 "Address Family modifier\n"
5705 "Soft reconfig inbound update\n")
5707 if (strncmp (argv
[0], "m", 1) == 0)
5708 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5709 BGP_CLEAR_SOFT_IN
, NULL
);
5711 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5712 BGP_CLEAR_SOFT_IN
, NULL
);
5715 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
5716 clear_ip_bgp_external_ipv4_in_cmd
,
5717 "clear ip bgp external ipv4 (unicast|multicast) in",
5721 "Clear all external peers\n"
5723 "Address Family modifier\n"
5724 "Address Family modifier\n"
5725 "Soft reconfig inbound update\n")
5727 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
5728 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
5729 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
5733 "Clear all external peers\n"
5735 "Address Family modifier\n"
5736 "Address Family modifier\n"
5737 "Soft reconfig inbound update\n"
5738 "Push out prefix-list ORF and do inbound soft reconfig\n")
5740 if (strncmp (argv
[0], "m", 1) == 0)
5741 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5742 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5744 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5745 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5748 DEFUN (clear_bgp_external_soft_in
,
5749 clear_bgp_external_soft_in_cmd
,
5750 "clear bgp external soft in",
5753 "Clear all external peers\n"
5755 "Soft reconfig inbound update\n")
5757 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5758 BGP_CLEAR_SOFT_IN
, NULL
);
5761 ALIAS (clear_bgp_external_soft_in
,
5762 clear_bgp_ipv6_external_soft_in_cmd
,
5763 "clear bgp ipv6 external soft in",
5767 "Clear all external peers\n"
5769 "Soft reconfig inbound update\n")
5771 ALIAS (clear_bgp_external_soft_in
,
5772 clear_bgp_external_in_cmd
,
5773 "clear bgp external in",
5776 "Clear all external peers\n"
5777 "Soft reconfig inbound update\n")
5779 ALIAS (clear_bgp_external_soft_in
,
5780 clear_bgp_ipv6_external_in_cmd
,
5781 "clear bgp ipv6 external WORD in",
5785 "Clear all external peers\n"
5786 "Soft reconfig inbound update\n")
5788 DEFUN (clear_bgp_external_in_prefix_filter
,
5789 clear_bgp_external_in_prefix_filter_cmd
,
5790 "clear bgp external in prefix-filter",
5793 "Clear all external peers\n"
5794 "Soft reconfig inbound update\n"
5795 "Push out prefix-list ORF and do inbound soft reconfig\n")
5797 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5798 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5801 ALIAS (clear_bgp_external_in_prefix_filter
,
5802 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
5803 "clear bgp ipv6 external in prefix-filter",
5807 "Clear all external peers\n"
5808 "Soft reconfig inbound update\n"
5809 "Push out prefix-list ORF and do inbound soft reconfig\n")
5811 DEFUN (clear_ip_bgp_as_soft_in
,
5812 clear_ip_bgp_as_soft_in_cmd
,
5813 "clear ip bgp " CMD_AS_RANGE
" soft in",
5817 "Clear peers with the AS number\n"
5819 "Soft reconfig inbound update\n")
5821 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5822 BGP_CLEAR_SOFT_IN
, argv
[0]);
5825 ALIAS (clear_ip_bgp_as_soft_in
,
5826 clear_ip_bgp_as_in_cmd
,
5827 "clear ip bgp " CMD_AS_RANGE
" in",
5831 "Clear peers with the AS number\n"
5832 "Soft reconfig inbound update\n")
5834 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
5835 clear_ip_bgp_as_in_prefix_filter_cmd
,
5836 "clear ip bgp " CMD_AS_RANGE
" in prefix-filter",
5840 "Clear peers with the AS number\n"
5841 "Soft reconfig inbound update\n"
5842 "Push out prefix-list ORF and do inbound soft reconfig\n")
5844 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5845 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5848 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
5849 clear_ip_bgp_as_ipv4_soft_in_cmd
,
5850 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft in",
5854 "Clear peers with the AS number\n"
5856 "Address Family modifier\n"
5857 "Address Family modifier\n"
5859 "Soft reconfig inbound update\n")
5861 if (strncmp (argv
[1], "m", 1) == 0)
5862 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5863 BGP_CLEAR_SOFT_IN
, argv
[0]);
5865 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5866 BGP_CLEAR_SOFT_IN
, argv
[0]);
5869 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
5870 clear_ip_bgp_as_ipv4_in_cmd
,
5871 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in",
5875 "Clear peers with the AS number\n"
5877 "Address Family modifier\n"
5878 "Address Family modifier\n"
5879 "Soft reconfig inbound update\n")
5881 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
5882 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
5883 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in prefix-filter",
5887 "Clear peers with the AS number\n"
5889 "Address Family modifier\n"
5890 "Address Family modifier\n"
5891 "Soft reconfig inbound update\n"
5892 "Push out prefix-list ORF and do inbound soft reconfig\n")
5894 if (strncmp (argv
[1], "m", 1) == 0)
5895 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5896 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5898 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5899 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5902 DEFUN (clear_ip_bgp_as_vpnv4_soft_in
,
5903 clear_ip_bgp_as_vpnv4_soft_in_cmd
,
5904 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft in",
5908 "Clear peers with the AS number\n"
5910 "Address Family modifier\n"
5912 "Soft reconfig inbound update\n")
5914 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
5915 BGP_CLEAR_SOFT_IN
, argv
[0]);
5918 ALIAS (clear_ip_bgp_as_vpnv4_soft_in
,
5919 clear_ip_bgp_as_vpnv4_in_cmd
,
5920 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast in",
5924 "Clear peers with the AS number\n"
5926 "Address Family modifier\n"
5927 "Soft reconfig inbound update\n")
5929 DEFUN (clear_bgp_as_soft_in
,
5930 clear_bgp_as_soft_in_cmd
,
5931 "clear bgp " CMD_AS_RANGE
" soft in",
5934 "Clear peers with the AS number\n"
5936 "Soft reconfig inbound update\n")
5938 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5939 BGP_CLEAR_SOFT_IN
, argv
[0]);
5942 ALIAS (clear_bgp_as_soft_in
,
5943 clear_bgp_ipv6_as_soft_in_cmd
,
5944 "clear bgp ipv6 " CMD_AS_RANGE
" soft in",
5948 "Clear peers with the AS number\n"
5950 "Soft reconfig inbound update\n")
5952 ALIAS (clear_bgp_as_soft_in
,
5953 clear_bgp_as_in_cmd
,
5954 "clear bgp " CMD_AS_RANGE
" in",
5957 "Clear peers with the AS number\n"
5958 "Soft reconfig inbound update\n")
5960 ALIAS (clear_bgp_as_soft_in
,
5961 clear_bgp_ipv6_as_in_cmd
,
5962 "clear bgp ipv6 " CMD_AS_RANGE
" in",
5966 "Clear peers with the AS number\n"
5967 "Soft reconfig inbound update\n")
5969 DEFUN (clear_bgp_as_in_prefix_filter
,
5970 clear_bgp_as_in_prefix_filter_cmd
,
5971 "clear bgp " CMD_AS_RANGE
" in prefix-filter",
5974 "Clear peers with the AS number\n"
5975 "Soft reconfig inbound update\n"
5976 "Push out prefix-list ORF and do inbound soft reconfig\n")
5978 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5979 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5982 ALIAS (clear_bgp_as_in_prefix_filter
,
5983 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
5984 "clear bgp ipv6 " CMD_AS_RANGE
" in prefix-filter",
5988 "Clear peers with the AS number\n"
5989 "Soft reconfig inbound update\n"
5990 "Push out prefix-list ORF and do inbound soft reconfig\n")
5992 /* Both soft-reconfiguration */
5993 DEFUN (clear_ip_bgp_all_soft
,
5994 clear_ip_bgp_all_soft_cmd
,
5995 "clear ip bgp * soft",
6003 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6004 BGP_CLEAR_SOFT_BOTH
, NULL
);
6006 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6007 BGP_CLEAR_SOFT_BOTH
, NULL
);
6010 ALIAS (clear_ip_bgp_all_soft
,
6011 clear_ip_bgp_instance_all_soft_cmd
,
6012 "clear ip bgp view WORD * soft",
6022 DEFUN (clear_ip_bgp_all_ipv4_soft
,
6023 clear_ip_bgp_all_ipv4_soft_cmd
,
6024 "clear ip bgp * ipv4 (unicast|multicast) soft",
6030 "Address Family Modifier\n"
6031 "Address Family Modifier\n"
6034 if (strncmp (argv
[0], "m", 1) == 0)
6035 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6036 BGP_CLEAR_SOFT_BOTH
, NULL
);
6038 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6039 BGP_CLEAR_SOFT_BOTH
, NULL
);
6042 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
6043 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
6044 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft",
6052 "Address Family Modifier\n"
6053 "Address Family Modifier\n"
6056 if (strncmp (argv
[1], "m", 1) == 0)
6057 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6058 BGP_CLEAR_SOFT_BOTH
, NULL
);
6060 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6061 BGP_CLEAR_SOFT_BOTH
, NULL
);
6064 DEFUN (clear_ip_bgp_all_vpnv4_soft
,
6065 clear_ip_bgp_all_vpnv4_soft_cmd
,
6066 "clear ip bgp * vpnv4 unicast soft",
6072 "Address Family Modifier\n"
6075 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
6076 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6079 DEFUN (clear_bgp_all_soft
,
6080 clear_bgp_all_soft_cmd
,
6088 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6089 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6091 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6092 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6095 ALIAS (clear_bgp_all_soft
,
6096 clear_bgp_instance_all_soft_cmd
,
6097 "clear bgp view WORD * soft",
6105 ALIAS (clear_bgp_all_soft
,
6106 clear_bgp_ipv6_all_soft_cmd
,
6107 "clear bgp ipv6 * soft",
6114 DEFUN (clear_ip_bgp_peer_soft
,
6115 clear_ip_bgp_peer_soft_cmd
,
6116 "clear ip bgp A.B.C.D soft",
6120 "BGP neighbor address to clear\n"
6123 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6124 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6127 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
6128 clear_ip_bgp_peer_ipv4_soft_cmd
,
6129 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft",
6133 "BGP neighbor address to clear\n"
6135 "Address Family Modifier\n"
6136 "Address Family Modifier\n"
6139 if (strncmp (argv
[1], "m", 1) == 0)
6140 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
6141 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6143 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6144 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6147 DEFUN (clear_ip_bgp_peer_vpnv4_soft
,
6148 clear_ip_bgp_peer_vpnv4_soft_cmd
,
6149 "clear ip bgp A.B.C.D vpnv4 unicast soft",
6153 "BGP neighbor address to clear\n"
6155 "Address Family Modifier\n"
6158 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
6159 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6162 DEFUN (clear_bgp_peer_soft
,
6163 clear_bgp_peer_soft_cmd
,
6164 "clear bgp (A.B.C.D|X:X::X:X) soft",
6167 "BGP neighbor address to clear\n"
6168 "BGP IPv6 neighbor to clear\n"
6171 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6172 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6175 ALIAS (clear_bgp_peer_soft
,
6176 clear_bgp_ipv6_peer_soft_cmd
,
6177 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft",
6181 "BGP neighbor address to clear\n"
6182 "BGP IPv6 neighbor to clear\n"
6185 DEFUN (clear_ip_bgp_peer_group_soft
,
6186 clear_ip_bgp_peer_group_soft_cmd
,
6187 "clear ip bgp peer-group WORD soft",
6191 "Clear all members of peer-group\n"
6192 "BGP peer-group name\n"
6195 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6196 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6199 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
6200 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
6201 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
6205 "Clear all members of peer-group\n"
6206 "BGP peer-group name\n"
6208 "Address Family modifier\n"
6209 "Address Family modifier\n"
6212 if (strncmp (argv
[1], "m", 1) == 0)
6213 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
6214 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6216 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6217 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6220 DEFUN (clear_bgp_peer_group_soft
,
6221 clear_bgp_peer_group_soft_cmd
,
6222 "clear bgp peer-group WORD soft",
6225 "Clear all members of peer-group\n"
6226 "BGP peer-group name\n"
6229 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
6230 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6233 ALIAS (clear_bgp_peer_group_soft
,
6234 clear_bgp_ipv6_peer_group_soft_cmd
,
6235 "clear bgp ipv6 peer-group WORD soft",
6239 "Clear all members of peer-group\n"
6240 "BGP peer-group name\n"
6243 DEFUN (clear_ip_bgp_external_soft
,
6244 clear_ip_bgp_external_soft_cmd
,
6245 "clear ip bgp external soft",
6249 "Clear all external peers\n"
6252 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6253 BGP_CLEAR_SOFT_BOTH
, NULL
);
6256 DEFUN (clear_ip_bgp_external_ipv4_soft
,
6257 clear_ip_bgp_external_ipv4_soft_cmd
,
6258 "clear ip bgp external ipv4 (unicast|multicast) soft",
6262 "Clear all external peers\n"
6264 "Address Family modifier\n"
6265 "Address Family modifier\n"
6268 if (strncmp (argv
[0], "m", 1) == 0)
6269 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
6270 BGP_CLEAR_SOFT_BOTH
, NULL
);
6272 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6273 BGP_CLEAR_SOFT_BOTH
, NULL
);
6276 DEFUN (clear_bgp_external_soft
,
6277 clear_bgp_external_soft_cmd
,
6278 "clear bgp external soft",
6281 "Clear all external peers\n"
6284 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6285 BGP_CLEAR_SOFT_BOTH
, NULL
);
6288 ALIAS (clear_bgp_external_soft
,
6289 clear_bgp_ipv6_external_soft_cmd
,
6290 "clear bgp ipv6 external soft",
6294 "Clear all external peers\n"
6297 DEFUN (clear_ip_bgp_as_soft
,
6298 clear_ip_bgp_as_soft_cmd
,
6299 "clear ip bgp " CMD_AS_RANGE
" soft",
6303 "Clear peers with the AS number\n"
6306 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6307 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6310 DEFUN (clear_ip_bgp_as_ipv4_soft
,
6311 clear_ip_bgp_as_ipv4_soft_cmd
,
6312 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft",
6316 "Clear peers with the AS number\n"
6318 "Address Family Modifier\n"
6319 "Address Family Modifier\n"
6322 if (strncmp (argv
[1], "m", 1) == 0)
6323 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
6324 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6326 return bgp_clear_vty (vty
, NULL
,AFI_IP
, SAFI_UNICAST
, clear_as
,
6327 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6330 DEFUN (clear_ip_bgp_as_vpnv4_soft
,
6331 clear_ip_bgp_as_vpnv4_soft_cmd
,
6332 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft",
6336 "Clear peers with the AS number\n"
6338 "Address Family Modifier\n"
6341 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
6342 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6345 DEFUN (clear_bgp_as_soft
,
6346 clear_bgp_as_soft_cmd
,
6347 "clear bgp " CMD_AS_RANGE
" soft",
6350 "Clear peers with the AS number\n"
6353 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
6354 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6357 ALIAS (clear_bgp_as_soft
,
6358 clear_bgp_ipv6_as_soft_cmd
,
6359 "clear bgp ipv6 " CMD_AS_RANGE
" soft",
6363 "Clear peers with the AS number\n"
6366 /* RS-client soft reconfiguration. */
6368 DEFUN (clear_bgp_all_rsclient
,
6369 clear_bgp_all_rsclient_cmd
,
6370 "clear bgp * rsclient",
6374 "Soft reconfig for rsclient RIB\n")
6377 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6378 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6380 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6381 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6384 ALIAS (clear_bgp_all_rsclient
,
6385 clear_bgp_ipv6_all_rsclient_cmd
,
6386 "clear bgp ipv6 * rsclient",
6391 "Soft reconfig for rsclient RIB\n")
6393 ALIAS (clear_bgp_all_rsclient
,
6394 clear_bgp_instance_all_rsclient_cmd
,
6395 "clear bgp view WORD * rsclient",
6401 "Soft reconfig for rsclient RIB\n")
6403 ALIAS (clear_bgp_all_rsclient
,
6404 clear_bgp_ipv6_instance_all_rsclient_cmd
,
6405 "clear bgp ipv6 view WORD * rsclient",
6412 "Soft reconfig for rsclient RIB\n")
6413 #endif /* HAVE_IPV6 */
6415 DEFUN (clear_ip_bgp_all_rsclient
,
6416 clear_ip_bgp_all_rsclient_cmd
,
6417 "clear ip bgp * rsclient",
6422 "Soft reconfig for rsclient RIB\n")
6425 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6426 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6428 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6429 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6432 ALIAS (clear_ip_bgp_all_rsclient
,
6433 clear_ip_bgp_instance_all_rsclient_cmd
,
6434 "clear ip bgp view WORD * rsclient",
6441 "Soft reconfig for rsclient RIB\n")
6444 DEFUN (clear_bgp_peer_rsclient
,
6445 clear_bgp_peer_rsclient_cmd
,
6446 "clear bgp (A.B.C.D|X:X::X:X) rsclient",
6449 "BGP neighbor IP address to clear\n"
6450 "BGP IPv6 neighbor to clear\n"
6451 "Soft reconfig for rsclient RIB\n")
6454 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6455 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6457 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6458 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6461 ALIAS (clear_bgp_peer_rsclient
,
6462 clear_bgp_ipv6_peer_rsclient_cmd
,
6463 "clear bgp ipv6 (A.B.C.D|X:X::X:X) rsclient",
6467 "BGP neighbor IP address to clear\n"
6468 "BGP IPv6 neighbor to clear\n"
6469 "Soft reconfig for rsclient RIB\n")
6471 ALIAS (clear_bgp_peer_rsclient
,
6472 clear_bgp_instance_peer_rsclient_cmd
,
6473 "clear bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6478 "BGP neighbor IP address to clear\n"
6479 "BGP IPv6 neighbor to clear\n"
6480 "Soft reconfig for rsclient RIB\n")
6482 ALIAS (clear_bgp_peer_rsclient
,
6483 clear_bgp_ipv6_instance_peer_rsclient_cmd
,
6484 "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X) rsclient",
6490 "BGP neighbor IP address to clear\n"
6491 "BGP IPv6 neighbor to clear\n"
6492 "Soft reconfig for rsclient RIB\n")
6493 #endif /* HAVE_IPV6 */
6495 DEFUN (clear_ip_bgp_peer_rsclient
,
6496 clear_ip_bgp_peer_rsclient_cmd
,
6497 "clear ip bgp (A.B.C.D|X:X::X:X) rsclient",
6501 "BGP neighbor IP address to clear\n"
6502 "BGP IPv6 neighbor to clear\n"
6503 "Soft reconfig for rsclient RIB\n")
6506 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_peer
,
6507 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6509 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6510 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6513 ALIAS (clear_ip_bgp_peer_rsclient
,
6514 clear_ip_bgp_instance_peer_rsclient_cmd
,
6515 "clear ip bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6521 "BGP neighbor IP address to clear\n"
6522 "BGP IPv6 neighbor to clear\n"
6523 "Soft reconfig for rsclient RIB\n")
6525 DEFUN (show_bgp_views
,
6530 "Show the defined BGP views\n")
6532 struct list
*inst
= bm
->bgp
;
6533 struct listnode
*node
;
6536 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE
))
6538 vty_out (vty
, "Multiple BGP views are not defined%s", VTY_NEWLINE
);
6542 vty_out (vty
, "Defined BGP views:%s", VTY_NEWLINE
);
6543 for (ALL_LIST_ELEMENTS_RO(inst
, node
, bgp
))
6544 vty_out (vty
, "\t%s (AS%u)%s",
6545 bgp
->name
? bgp
->name
: "(null)",
6546 bgp
->as
, VTY_NEWLINE
);
6551 DEFUN (show_bgp_memory
,
6552 show_bgp_memory_cmd
,
6556 "Global BGP memory statistics\n")
6558 char memstrbuf
[MTYPE_MEMSTR_LEN
];
6559 unsigned long count
;
6561 /* RIB related usage stats */
6562 count
= mtype_stats_alloc (MTYPE_BGP_NODE
);
6563 vty_out (vty
, "%ld RIB nodes, using %s of memory%s", count
,
6564 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6565 count
* sizeof (struct bgp_node
)),
6568 count
= mtype_stats_alloc (MTYPE_BGP_ROUTE
);
6569 vty_out (vty
, "%ld BGP routes, using %s of memory%s", count
,
6570 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6571 count
* sizeof (struct bgp_info
)),
6573 if ((count
= mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA
)))
6574 vty_out (vty
, "%ld BGP route ancillaries, using %s of memory%s", count
,
6575 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6576 count
* sizeof (struct bgp_info_extra
)),
6579 if ((count
= mtype_stats_alloc (MTYPE_BGP_STATIC
)))
6580 vty_out (vty
, "%ld Static routes, using %s of memory%s", count
,
6581 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6582 count
* sizeof (struct bgp_static
)),
6586 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_IN
)))
6587 vty_out (vty
, "%ld Adj-In entries, using %s of memory%s", count
,
6588 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6589 count
* sizeof (struct bgp_adj_in
)),
6591 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_OUT
)))
6592 vty_out (vty
, "%ld Adj-Out entries, using %s of memory%s", count
,
6593 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6594 count
* sizeof (struct bgp_adj_out
)),
6597 if ((count
= mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE
)))
6598 vty_out (vty
, "%ld Nexthop cache entries, using %s of memory%s", count
,
6599 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6600 count
* sizeof (struct bgp_nexthop_cache
)),
6603 if ((count
= mtype_stats_alloc (MTYPE_BGP_DAMP_INFO
)))
6604 vty_out (vty
, "%ld Dampening entries, using %s of memory%s", count
,
6605 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6606 count
* sizeof (struct bgp_damp_info
)),
6610 count
= attr_count();
6611 vty_out (vty
, "%ld BGP attributes, using %s of memory%s", count
,
6612 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6613 count
* sizeof(struct attr
)),
6615 if ((count
= mtype_stats_alloc (MTYPE_ATTR_EXTRA
)))
6616 vty_out (vty
, "%ld BGP extra attributes, using %s of memory%s", count
,
6617 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6618 count
* sizeof(struct attr_extra
)),
6621 if ((count
= attr_unknown_count()))
6622 vty_out (vty
, "%ld unknown attributes%s", count
, VTY_NEWLINE
);
6624 /* AS_PATH attributes */
6625 count
= aspath_count ();
6626 vty_out (vty
, "%ld BGP AS-PATH entries, using %s of memory%s", count
,
6627 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6628 count
* sizeof (struct aspath
)),
6631 count
= mtype_stats_alloc (MTYPE_AS_SEG
);
6632 vty_out (vty
, "%ld BGP AS-PATH segments, using %s of memory%s", count
,
6633 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6634 count
* sizeof (struct assegment
)),
6637 /* Other attributes */
6638 if ((count
= community_count ()))
6639 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
6640 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6641 count
* sizeof (struct community
)),
6643 if ((count
= mtype_stats_alloc (MTYPE_ECOMMUNITY
)))
6644 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
6645 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6646 count
* sizeof (struct ecommunity
)),
6649 if ((count
= mtype_stats_alloc (MTYPE_CLUSTER
)))
6650 vty_out (vty
, "%ld Cluster lists, using %s of memory%s", count
,
6651 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6652 count
* sizeof (struct cluster_list
)),
6655 /* Peer related usage */
6656 count
= mtype_stats_alloc (MTYPE_BGP_PEER
);
6657 vty_out (vty
, "%ld peers, using %s of memory%s", count
,
6658 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6659 count
* sizeof (struct peer
)),
6662 if ((count
= mtype_stats_alloc (MTYPE_PEER_GROUP
)))
6663 vty_out (vty
, "%ld peer groups, using %s of memory%s", count
,
6664 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6665 count
* sizeof (struct peer_group
)),
6669 if ((count
= mtype_stats_alloc (MTYPE_HASH
)))
6670 vty_out (vty
, "%ld hash tables, using %s of memory%s", count
,
6671 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6672 count
* sizeof (struct hash
)),
6674 if ((count
= mtype_stats_alloc (MTYPE_HASH_BACKET
)))
6675 vty_out (vty
, "%ld hash buckets, using %s of memory%s", count
,
6676 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6677 count
* sizeof (struct hash_backet
)),
6679 if ((count
= mtype_stats_alloc (MTYPE_BGP_REGEXP
)))
6680 vty_out (vty
, "%ld compiled regexes, using %s of memory%s", count
,
6681 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6682 count
* sizeof (regex_t
)),
6687 /* Show BGP peer's summary information. */
6689 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
)
6692 struct listnode
*node
, *nnode
;
6693 unsigned int count
= 0;
6694 char timebuf
[BGP_UPTIME_LEN
];
6697 /* Header string for each address family. */
6698 static char header
[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
6700 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
6702 if (peer
->afc
[afi
][safi
])
6707 char memstrbuf
[MTYPE_MEMSTR_LEN
];
6709 /* Usage summary and header */
6711 "BGP router identifier %s, local AS number %u%s",
6712 inet_ntoa (bgp
->router_id
), bgp
->as
, VTY_NEWLINE
);
6714 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
6715 vty_out (vty
, "RIB entries %ld, using %s of memory%s", ents
,
6716 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6717 ents
* sizeof (struct bgp_node
)),
6720 /* Peer related usage */
6721 ents
= listcount (bgp
->peer
);
6722 vty_out (vty
, "Peers %ld, using %s of memory%s",
6724 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6725 ents
* sizeof (struct peer
)),
6728 if ((ents
= listcount (bgp
->rsclient
)))
6729 vty_out (vty
, "RS-Client peers %ld, using %s of memory%s",
6731 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6732 ents
* sizeof (struct peer
)),
6735 if ((ents
= listcount (bgp
->group
)))
6736 vty_out (vty
, "Peer groups %ld, using %s of memory%s", ents
,
6737 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6738 ents
* sizeof (struct peer_group
)),
6741 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
6742 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
6743 vty_out (vty
, "%s", VTY_NEWLINE
);
6744 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
6749 len
= vty_out (vty
, "%s", peer
->host
);
6752 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
6754 vty_out (vty
, "%*s", len
, " ");
6756 vty_out (vty
, "4 ");
6758 vty_out (vty
, "%5u %7d %7d %8d %4d %4lu ",
6760 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
6761 + peer
->notify_in
+ peer
->refresh_in
+ peer
->dynamic_cap_in
,
6762 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
6763 + peer
->notify_out
+ peer
->refresh_out
6764 + peer
->dynamic_cap_out
,
6765 0, 0, (unsigned long) peer
->obuf
->count
);
6767 vty_out (vty
, "%8s",
6768 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
));
6770 if (peer
->status
== Established
)
6772 vty_out (vty
, " %8ld", peer
->pcount
[afi
][safi
]);
6776 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
6777 vty_out (vty
, " Idle (Admin)");
6778 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
6779 vty_out (vty
, " Idle (PfxCt)");
6781 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, peer
->status
));
6784 vty_out (vty
, "%s", VTY_NEWLINE
);
6789 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
6790 count
, VTY_NEWLINE
);
6792 vty_out (vty
, "No %s neighbor is configured%s",
6793 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
6798 bgp_show_summary_vty (struct vty
*vty
, const char *name
,
6799 afi_t afi
, safi_t safi
)
6805 bgp
= bgp_lookup_by_name (name
);
6809 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
6813 bgp_show_summary (vty
, bgp
, afi
, safi
);
6817 bgp
= bgp_get_default ();
6820 bgp_show_summary (vty
, bgp
, afi
, safi
);
6825 /* `show ip bgp summary' commands. */
6826 DEFUN (show_ip_bgp_summary
,
6827 show_ip_bgp_summary_cmd
,
6828 "show ip bgp summary",
6832 "Summary of BGP neighbor status\n")
6834 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6837 DEFUN (show_ip_bgp_instance_summary
,
6838 show_ip_bgp_instance_summary_cmd
,
6839 "show ip bgp view WORD summary",
6845 "Summary of BGP neighbor status\n")
6847 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6850 DEFUN (show_ip_bgp_ipv4_summary
,
6851 show_ip_bgp_ipv4_summary_cmd
,
6852 "show ip bgp ipv4 (unicast|multicast) summary",
6857 "Address Family modifier\n"
6858 "Address Family modifier\n"
6859 "Summary of BGP neighbor status\n")
6861 if (strncmp (argv
[0], "m", 1) == 0)
6862 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
6864 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6867 DEFUN (show_ip_bgp_instance_ipv4_summary
,
6868 show_ip_bgp_instance_ipv4_summary_cmd
,
6869 "show ip bgp view WORD ipv4 (unicast|multicast) summary",
6876 "Address Family modifier\n"
6877 "Address Family modifier\n"
6878 "Summary of BGP neighbor status\n")
6880 if (strncmp (argv
[1], "m", 1) == 0)
6881 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
6883 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6886 DEFUN (show_ip_bgp_vpnv4_all_summary
,
6887 show_ip_bgp_vpnv4_all_summary_cmd
,
6888 "show ip bgp vpnv4 all summary",
6892 "Display VPNv4 NLRI specific information\n"
6893 "Display information about all VPNv4 NLRIs\n"
6894 "Summary of BGP neighbor status\n")
6896 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6899 DEFUN (show_ip_bgp_vpnv4_rd_summary
,
6900 show_ip_bgp_vpnv4_rd_summary_cmd
,
6901 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary",
6905 "Display VPNv4 NLRI specific information\n"
6906 "Display information for a route distinguisher\n"
6907 "VPN Route Distinguisher\n"
6908 "Summary of BGP neighbor status\n")
6911 struct prefix_rd prd
;
6913 ret
= str2prefix_rd (argv
[0], &prd
);
6916 vty_out (vty
, "%% Malformed Route Distinguisher%s", VTY_NEWLINE
);
6920 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6924 DEFUN (show_bgp_summary
,
6925 show_bgp_summary_cmd
,
6929 "Summary of BGP neighbor status\n")
6931 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6934 DEFUN (show_bgp_instance_summary
,
6935 show_bgp_instance_summary_cmd
,
6936 "show bgp view WORD summary",
6941 "Summary of BGP neighbor status\n")
6943 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
6946 ALIAS (show_bgp_summary
,
6947 show_bgp_ipv6_summary_cmd
,
6948 "show bgp ipv6 summary",
6952 "Summary of BGP neighbor status\n")
6954 ALIAS (show_bgp_instance_summary
,
6955 show_bgp_instance_ipv6_summary_cmd
,
6956 "show bgp view WORD ipv6 summary",
6962 "Summary of BGP neighbor status\n")
6965 DEFUN (show_ipv6_bgp_summary
,
6966 show_ipv6_bgp_summary_cmd
,
6967 "show ipv6 bgp summary",
6971 "Summary of BGP neighbor status\n")
6973 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6977 DEFUN (show_ipv6_mbgp_summary
,
6978 show_ipv6_mbgp_summary_cmd
,
6979 "show ipv6 mbgp summary",
6983 "Summary of BGP neighbor status\n")
6985 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
);
6987 #endif /* HAVE_IPV6 */
6990 afi_safi_print (afi_t afi
, safi_t safi
)
6992 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
6993 return "IPv4 Unicast";
6994 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
6995 return "IPv4 Multicast";
6996 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
6997 return "VPNv4 Unicast";
6998 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
6999 return "IPv6 Unicast";
7000 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
7001 return "IPv6 Multicast";
7006 /* Show BGP peer's information. */
7014 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
,
7015 afi_t afi
, safi_t safi
,
7016 u_int16_t adv_smcap
, u_int16_t adv_rmcap
,
7017 u_int16_t rcv_smcap
, u_int16_t rcv_rmcap
)
7020 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
7021 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
7023 vty_out (vty
, " Send-mode: ");
7024 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
7025 vty_out (vty
, "advertised");
7026 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
7027 vty_out (vty
, "%sreceived",
7028 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
7030 vty_out (vty
, "%s", VTY_NEWLINE
);
7034 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
7035 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
7037 vty_out (vty
, " Receive-mode: ");
7038 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
7039 vty_out (vty
, "advertised");
7040 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
7041 vty_out (vty
, "%sreceived",
7042 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
7044 vty_out (vty
, "%s", VTY_NEWLINE
);
7049 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
)
7051 struct bgp_filter
*filter
;
7052 char orf_pfx_name
[BUFSIZ
];
7055 filter
= &p
->filter
[afi
][safi
];
7057 vty_out (vty
, " For address family: %s%s", afi_safi_print (afi
, safi
),
7060 if (p
->af_group
[afi
][safi
])
7061 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
7063 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7064 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
7065 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
7066 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7067 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
7068 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
7069 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
7071 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7072 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
7073 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7074 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
7076 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
7077 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
7078 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
7079 PEER_CAP_ORF_PREFIX_SM_ADV
,
7080 PEER_CAP_ORF_PREFIX_RM_ADV
,
7081 PEER_CAP_ORF_PREFIX_SM_RCV
,
7082 PEER_CAP_ORF_PREFIX_RM_RCV
);
7084 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7085 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
7086 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7087 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
7089 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
7090 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
7091 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
7092 PEER_CAP_ORF_PREFIX_SM_ADV
,
7093 PEER_CAP_ORF_PREFIX_RM_ADV
,
7094 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
7095 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
);
7098 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
7099 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
);
7101 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
7104 vty_out (vty
, " Outbound Route Filter (ORF):");
7105 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
7106 vty_out (vty
, " sent;");
7108 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
7109 vty_out (vty
, "%s", VTY_NEWLINE
);
7111 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
7112 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
7114 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
7115 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
7116 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
7117 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
7118 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
7119 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
7120 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
7121 vty_out (vty
, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE
);
7122 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
))
7123 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
7124 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
7125 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7126 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
7127 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7128 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
7129 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7130 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
7131 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7133 vty_out (vty
, " Community attribute sent to this neighbor");
7134 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
7135 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7136 vty_out (vty
, "(both)%s", VTY_NEWLINE
);
7137 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7138 vty_out (vty
, "(extended)%s", VTY_NEWLINE
);
7140 vty_out (vty
, "(standard)%s", VTY_NEWLINE
);
7142 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
7144 vty_out (vty
, " Default information originate,");
7146 if (p
->default_rmap
[afi
][safi
].name
)
7147 vty_out (vty
, " default route-map %s%s,",
7148 p
->default_rmap
[afi
][safi
].map
? "*" : "",
7149 p
->default_rmap
[afi
][safi
].name
);
7150 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_DEFAULT_ORIGINATE
))
7151 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
7153 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
7156 if (filter
->plist
[FILTER_IN
].name
7157 || filter
->dlist
[FILTER_IN
].name
7158 || filter
->aslist
[FILTER_IN
].name
7159 || filter
->map
[RMAP_IN
].name
)
7160 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
7161 if (filter
->plist
[FILTER_OUT
].name
7162 || filter
->dlist
[FILTER_OUT
].name
7163 || filter
->aslist
[FILTER_OUT
].name
7164 || filter
->map
[RMAP_OUT
].name
7165 || filter
->usmap
.name
)
7166 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
7167 if (filter
->map
[RMAP_IMPORT
].name
)
7168 vty_out (vty
, " Import policy for this RS-client configured%s", VTY_NEWLINE
);
7169 if (filter
->map
[RMAP_EXPORT
].name
)
7170 vty_out (vty
, " Export policy for this RS-client configured%s", VTY_NEWLINE
);
7173 if (filter
->plist
[FILTER_IN
].name
)
7174 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
7175 filter
->plist
[FILTER_IN
].plist
? "*" : "",
7176 filter
->plist
[FILTER_IN
].name
,
7178 if (filter
->plist
[FILTER_OUT
].name
)
7179 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
7180 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
7181 filter
->plist
[FILTER_OUT
].name
,
7184 /* distribute-list */
7185 if (filter
->dlist
[FILTER_IN
].name
)
7186 vty_out (vty
, " Incoming update network filter list is %s%s%s",
7187 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
7188 filter
->dlist
[FILTER_IN
].name
,
7190 if (filter
->dlist
[FILTER_OUT
].name
)
7191 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
7192 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
7193 filter
->dlist
[FILTER_OUT
].name
,
7197 if (filter
->aslist
[FILTER_IN
].name
)
7198 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
7199 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
7200 filter
->aslist
[FILTER_IN
].name
,
7202 if (filter
->aslist
[FILTER_OUT
].name
)
7203 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
7204 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
7205 filter
->aslist
[FILTER_OUT
].name
,
7209 if (filter
->map
[RMAP_IN
].name
)
7210 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
7211 filter
->map
[RMAP_IN
].map
? "*" : "",
7212 filter
->map
[RMAP_IN
].name
,
7214 if (filter
->map
[RMAP_OUT
].name
)
7215 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
7216 filter
->map
[RMAP_OUT
].map
? "*" : "",
7217 filter
->map
[RMAP_OUT
].name
,
7219 if (filter
->map
[RMAP_IMPORT
].name
)
7220 vty_out (vty
, " Route map for advertisements going into this RS-client's table is %s%s%s",
7221 filter
->map
[RMAP_IMPORT
].map
? "*" : "",
7222 filter
->map
[RMAP_IMPORT
].name
,
7224 if (filter
->map
[RMAP_EXPORT
].name
)
7225 vty_out (vty
, " Route map for advertisements coming from this RS-client is %s%s%s",
7226 filter
->map
[RMAP_EXPORT
].map
? "*" : "",
7227 filter
->map
[RMAP_EXPORT
].name
,
7230 /* unsuppress-map */
7231 if (filter
->usmap
.name
)
7232 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
7233 filter
->usmap
.map
? "*" : "",
7234 filter
->usmap
.name
, VTY_NEWLINE
);
7236 /* Receive prefix count */
7237 vty_out (vty
, " %ld accepted prefixes%s", p
->pcount
[afi
][safi
], VTY_NEWLINE
);
7239 /* Maximum prefix */
7240 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
7242 vty_out (vty
, " Maximum prefixes allowed %ld%s%s", p
->pmax
[afi
][safi
],
7243 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
7244 ? " (warning-only)" : "", VTY_NEWLINE
);
7245 vty_out (vty
, " Threshold for warning message %d%%",
7246 p
->pmax_threshold
[afi
][safi
]);
7247 if (p
->pmax_restart
[afi
][safi
])
7248 vty_out (vty
, ", restart interval %d min", p
->pmax_restart
[afi
][safi
]);
7249 vty_out (vty
, "%s", VTY_NEWLINE
);
7252 vty_out (vty
, "%s", VTY_NEWLINE
);
7256 bgp_show_peer (struct vty
*vty
, struct peer
*p
)
7260 char timebuf
[BGP_UPTIME_LEN
];
7266 /* Configured IP address. */
7267 vty_out (vty
, "BGP neighbor is %s, ", p
->host
);
7268 vty_out (vty
, "remote AS %u, ", p
->as
);
7269 vty_out (vty
, "local AS %u%s, ",
7270 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
7271 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
7272 " no-prepend" : "");
7273 vty_out (vty
, "%s link%s",
7274 p
->as
== p
->local_as
? "internal" : "external",
7279 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
7283 vty_out (vty
, " Member of peer-group %s for session parameters%s",
7284 p
->group
->name
, VTY_NEWLINE
);
7286 /* Administrative shutdown. */
7287 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
7288 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
7291 vty_out (vty
, " BGP version 4");
7292 vty_out (vty
, ", remote router ID %s%s",
7293 inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
7297 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
)
7298 && bgp_confederation_peers_check (bgp
, p
->as
))
7299 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
7302 vty_out (vty
, " BGP state = %s",
7303 LOOKUP (bgp_status_msg
, p
->status
));
7304 if (p
->status
== Established
)
7305 vty_out (vty
, ", up for %8s",
7306 peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
));
7307 else if (p
->status
== Active
)
7309 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
7310 vty_out (vty
, " (passive)");
7311 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
7312 vty_out (vty
, " (NSF passive)");
7314 vty_out (vty
, "%s", VTY_NEWLINE
);
7317 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
));
7319 /* Configured timer values. */
7320 vty_out (vty
, ", hold time is %d, keepalive interval is %d seconds%s",
7321 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
7322 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
7324 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
7325 vty_out (vty
, ", keepalive interval is %d seconds%s",
7326 p
->keepalive
, VTY_NEWLINE
);
7330 if (p
->status
== Established
)
7333 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
7334 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
7335 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
7336 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
7338 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
7339 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
7340 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
7341 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
7342 #endif /* HAVE_IPV6 */
7343 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
7344 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
7346 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
7349 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
)
7350 || CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
7352 vty_out (vty
, " 4 Byte AS:");
7353 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
7354 vty_out (vty
, " advertised");
7355 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
7356 vty_out (vty
, " %sreceived",
7357 CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
) ? "and " : "");
7358 vty_out (vty
, "%s", VTY_NEWLINE
);
7361 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
7362 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
7364 vty_out (vty
, " Dynamic:");
7365 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
7366 vty_out (vty
, " advertised");
7367 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
7368 vty_out (vty
, " %sreceived",
7369 CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) ? "and " : "");
7370 vty_out (vty
, "%s", VTY_NEWLINE
);
7374 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
7375 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
7376 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
7378 vty_out (vty
, " Route refresh:");
7379 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
7380 vty_out (vty
, " advertised");
7381 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
7382 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
7383 vty_out (vty
, " %sreceived(%s)",
7384 CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) ? "and " : "",
7385 (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
7386 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)) ?
7387 "old & new" : CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) ? "old" : "new");
7389 vty_out (vty
, "%s", VTY_NEWLINE
);
7392 /* Multiprotocol Extensions */
7393 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7394 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7395 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
7397 vty_out (vty
, " Address family %s:", afi_safi_print (afi
, safi
));
7398 if (p
->afc_adv
[afi
][safi
])
7399 vty_out (vty
, " advertised");
7400 if (p
->afc_recv
[afi
][safi
])
7401 vty_out (vty
, " %sreceived", p
->afc_adv
[afi
][safi
] ? "and " : "");
7402 vty_out (vty
, "%s", VTY_NEWLINE
);
7405 /* Gracefull Restart */
7406 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7407 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7409 vty_out (vty
, " Graceful Restart Capabilty:");
7410 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7411 vty_out (vty
, " advertised");
7412 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7413 vty_out (vty
, " %sreceived",
7414 CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) ? "and " : "");
7415 vty_out (vty
, "%s", VTY_NEWLINE
);
7417 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7419 int restart_af_count
= 0;
7421 vty_out (vty
, " Remote Restart timer is %d seconds%s",
7422 p
->v_gr_restart
, VTY_NEWLINE
);
7423 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
7425 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7426 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7427 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
7429 vty_out (vty
, "%s%s(%s)", restart_af_count
? ", " : "",
7430 afi_safi_print (afi
, safi
),
7431 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
) ?
7432 "preserved" : "not preserved");
7435 if (! restart_af_count
)
7436 vty_out (vty
, "none");
7437 vty_out (vty
, "%s", VTY_NEWLINE
);
7443 /* graceful restart information */
7444 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7448 int eor_send_af_count
= 0;
7449 int eor_receive_af_count
= 0;
7451 vty_out (vty
, " Graceful restart informations:%s", VTY_NEWLINE
);
7452 if (p
->status
== Established
)
7454 vty_out (vty
, " End-of-RIB send: ");
7455 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7456 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7457 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
7459 vty_out (vty
, "%s%s", eor_send_af_count
? ", " : "",
7460 afi_safi_print (afi
, safi
));
7461 eor_send_af_count
++;
7463 vty_out (vty
, "%s", VTY_NEWLINE
);
7465 vty_out (vty
, " End-of-RIB received: ");
7466 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7467 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7468 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
7470 vty_out (vty
, "%s%s", eor_receive_af_count
? ", " : "",
7471 afi_safi_print (afi
, safi
));
7472 eor_receive_af_count
++;
7474 vty_out (vty
, "%s", VTY_NEWLINE
);
7477 if (p
->t_gr_restart
)
7478 vty_out (vty
, " The remaining time of restart timer is %ld%s",
7479 thread_timer_remain_second (p
->t_gr_restart
), VTY_NEWLINE
);
7482 vty_out (vty
, " The remaining time of stalepath timer is %ld%s",
7483 thread_timer_remain_second (p
->t_gr_stale
), VTY_NEWLINE
);
7486 /* Packet counts. */
7487 vty_out (vty
, " Message statistics:%s", VTY_NEWLINE
);
7488 vty_out (vty
, " Inq depth is 0%s", VTY_NEWLINE
);
7489 vty_out (vty
, " Outq depth is %lu%s", (unsigned long) p
->obuf
->count
, VTY_NEWLINE
);
7490 vty_out (vty
, " Sent Rcvd%s", VTY_NEWLINE
);
7491 vty_out (vty
, " Opens: %10d %10d%s", p
->open_out
, p
->open_in
, VTY_NEWLINE
);
7492 vty_out (vty
, " Notifications: %10d %10d%s", p
->notify_out
, p
->notify_in
, VTY_NEWLINE
);
7493 vty_out (vty
, " Updates: %10d %10d%s", p
->update_out
, p
->update_in
, VTY_NEWLINE
);
7494 vty_out (vty
, " Keepalives: %10d %10d%s", p
->keepalive_out
, p
->keepalive_in
, VTY_NEWLINE
);
7495 vty_out (vty
, " Route Refresh: %10d %10d%s", p
->refresh_out
, p
->refresh_in
, VTY_NEWLINE
);
7496 vty_out (vty
, " Capability: %10d %10d%s", p
->dynamic_cap_out
, p
->dynamic_cap_in
, VTY_NEWLINE
);
7497 vty_out (vty
, " Total: %10d %10d%s", p
->open_out
+ p
->notify_out
+
7498 p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
+ p
->dynamic_cap_out
,
7499 p
->open_in
+ p
->notify_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
+
7500 p
->dynamic_cap_in
, VTY_NEWLINE
);
7502 /* advertisement-interval */
7503 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
7504 p
->v_routeadv
, VTY_NEWLINE
);
7506 /* Update-source. */
7507 if (p
->update_if
|| p
->update_source
)
7509 vty_out (vty
, " Update source is ");
7511 vty_out (vty
, "%s", p
->update_if
);
7512 else if (p
->update_source
)
7514 sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
7515 vty_out (vty
, "%s", VTY_NEWLINE
);
7518 /* Default weight */
7519 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
7520 vty_out (vty
, " Default weight %d%s", p
->weight
,
7523 vty_out (vty
, "%s", VTY_NEWLINE
);
7525 /* Address Family Information */
7526 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7527 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7528 if (p
->afc
[afi
][safi
])
7529 bgp_show_peer_afi (vty
, p
, afi
, safi
);
7531 vty_out (vty
, " Connections established %d; dropped %d%s",
7532 p
->established
, p
->dropped
,
7536 vty_out (vty
, " Last reset never%s", VTY_NEWLINE
);
7538 vty_out (vty
, " Last reset %s, due to %s%s",
7539 peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
),
7540 peer_down_str
[(int) p
->last_reset
], VTY_NEWLINE
);
7542 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
7544 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
7546 if (p
->t_pmax_restart
)
7547 vty_out (vty
, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
7548 p
->host
, thread_timer_remain_second (p
->t_pmax_restart
),
7551 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
7552 p
->host
, VTY_NEWLINE
);
7556 if (peer_sort (p
) != BGP_PEER_IBGP
&& p
->ttl
> 1)
7557 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
7558 p
->ttl
, VTY_NEWLINE
);
7560 /* Local address. */
7563 vty_out (vty
, "Local host: %s, Local port: %d%s",
7564 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
7565 ntohs (p
->su_local
->sin
.sin_port
),
7569 /* Remote address. */
7572 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
7573 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
7574 ntohs (p
->su_remote
->sin
.sin_port
),
7578 /* Nexthop display. */
7581 vty_out (vty
, "Nexthop: %s%s",
7582 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
7585 vty_out (vty
, "Nexthop global: %s%s",
7586 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
7588 vty_out (vty
, "Nexthop local: %s%s",
7589 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
7591 vty_out (vty
, "BGP connection: %s%s",
7592 p
->shared_network
? "shared network" : "non shared network",
7594 #endif /* HAVE_IPV6 */
7597 /* Timer information. */
7599 vty_out (vty
, "Next start timer due in %ld seconds%s",
7600 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
7602 vty_out (vty
, "Next connect timer due in %ld seconds%s",
7603 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
7605 vty_out (vty
, "Read thread: %s Write thread: %s%s",
7606 p
->t_read
? "on" : "off",
7607 p
->t_write
? "on" : "off",
7610 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
7611 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
7612 bgp_capability_vty_out (vty
, p
);
7614 vty_out (vty
, "%s", VTY_NEWLINE
);
7618 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
,
7619 enum show_type type
, union sockunion
*su
)
7621 struct listnode
*node
, *nnode
;
7625 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
7630 bgp_show_peer (vty
, peer
);
7633 if (sockunion_same (&peer
->su
, su
))
7636 bgp_show_peer (vty
, peer
);
7642 if (type
== show_peer
&& ! find
)
7643 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
7649 bgp_show_neighbor_vty (struct vty
*vty
, const char *name
,
7650 enum show_type type
, const char *ip_str
)
7658 ret
= str2sockunion (ip_str
, &su
);
7661 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
7668 bgp
= bgp_lookup_by_name (name
);
7672 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
7676 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7681 bgp
= bgp_get_default ();
7684 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7689 /* "show ip bgp neighbors" commands. */
7690 DEFUN (show_ip_bgp_neighbors
,
7691 show_ip_bgp_neighbors_cmd
,
7692 "show ip bgp neighbors",
7696 "Detailed information on TCP and BGP neighbor connections\n")
7698 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
);
7701 ALIAS (show_ip_bgp_neighbors
,
7702 show_ip_bgp_ipv4_neighbors_cmd
,
7703 "show ip bgp ipv4 (unicast|multicast) neighbors",
7708 "Address Family modifier\n"
7709 "Address Family modifier\n"
7710 "Detailed information on TCP and BGP neighbor connections\n")
7712 ALIAS (show_ip_bgp_neighbors
,
7713 show_ip_bgp_vpnv4_all_neighbors_cmd
,
7714 "show ip bgp vpnv4 all neighbors",
7718 "Display VPNv4 NLRI specific information\n"
7719 "Display information about all VPNv4 NLRIs\n"
7720 "Detailed information on TCP and BGP neighbor connections\n")
7722 ALIAS (show_ip_bgp_neighbors
,
7723 show_ip_bgp_vpnv4_rd_neighbors_cmd
,
7724 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
7728 "Display VPNv4 NLRI specific information\n"
7729 "Display information for a route distinguisher\n"
7730 "VPN Route Distinguisher\n"
7731 "Detailed information on TCP and BGP neighbor connections\n")
7733 ALIAS (show_ip_bgp_neighbors
,
7734 show_bgp_neighbors_cmd
,
7735 "show bgp neighbors",
7738 "Detailed information on TCP and BGP neighbor connections\n")
7740 ALIAS (show_ip_bgp_neighbors
,
7741 show_bgp_ipv6_neighbors_cmd
,
7742 "show bgp ipv6 neighbors",
7746 "Detailed information on TCP and BGP neighbor connections\n")
7748 DEFUN (show_ip_bgp_neighbors_peer
,
7749 show_ip_bgp_neighbors_peer_cmd
,
7750 "show ip bgp neighbors (A.B.C.D|X:X::X:X)",
7754 "Detailed information on TCP and BGP neighbor connections\n"
7755 "Neighbor to display information about\n"
7756 "Neighbor to display information about\n")
7758 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 1]);
7761 ALIAS (show_ip_bgp_neighbors_peer
,
7762 show_ip_bgp_ipv4_neighbors_peer_cmd
,
7763 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)",
7768 "Address Family modifier\n"
7769 "Address Family modifier\n"
7770 "Detailed information on TCP and BGP neighbor connections\n"
7771 "Neighbor to display information about\n"
7772 "Neighbor to display information about\n")
7774 ALIAS (show_ip_bgp_neighbors_peer
,
7775 show_ip_bgp_vpnv4_all_neighbors_peer_cmd
,
7776 "show ip bgp vpnv4 all neighbors A.B.C.D",
7780 "Display VPNv4 NLRI specific information\n"
7781 "Display information about all VPNv4 NLRIs\n"
7782 "Detailed information on TCP and BGP neighbor connections\n"
7783 "Neighbor to display information about\n")
7785 ALIAS (show_ip_bgp_neighbors_peer
,
7786 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
,
7787 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
7791 "Display VPNv4 NLRI specific information\n"
7792 "Display information about all VPNv4 NLRIs\n"
7793 "Detailed information on TCP and BGP neighbor connections\n"
7794 "Neighbor to display information about\n")
7796 ALIAS (show_ip_bgp_neighbors_peer
,
7797 show_bgp_neighbors_peer_cmd
,
7798 "show bgp neighbors (A.B.C.D|X:X::X:X)",
7801 "Detailed information on TCP and BGP neighbor connections\n"
7802 "Neighbor to display information about\n"
7803 "Neighbor to display information about\n")
7805 ALIAS (show_ip_bgp_neighbors_peer
,
7806 show_bgp_ipv6_neighbors_peer_cmd
,
7807 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)",
7811 "Detailed information on TCP and BGP neighbor connections\n"
7812 "Neighbor to display information about\n"
7813 "Neighbor to display information about\n")
7815 DEFUN (show_ip_bgp_instance_neighbors
,
7816 show_ip_bgp_instance_neighbors_cmd
,
7817 "show ip bgp view WORD neighbors",
7823 "Detailed information on TCP and BGP neighbor connections\n")
7825 return bgp_show_neighbor_vty (vty
, argv
[0], show_all
, NULL
);
7828 ALIAS (show_ip_bgp_instance_neighbors
,
7829 show_bgp_instance_neighbors_cmd
,
7830 "show bgp view WORD neighbors",
7835 "Detailed information on TCP and BGP neighbor connections\n")
7837 ALIAS (show_ip_bgp_instance_neighbors
,
7838 show_bgp_instance_ipv6_neighbors_cmd
,
7839 "show bgp view WORD ipv6 neighbors",
7845 "Detailed information on TCP and BGP neighbor connections\n")
7847 DEFUN (show_ip_bgp_instance_neighbors_peer
,
7848 show_ip_bgp_instance_neighbors_peer_cmd
,
7849 "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7855 "Detailed information on TCP and BGP neighbor connections\n"
7856 "Neighbor to display information about\n"
7857 "Neighbor to display information about\n")
7859 return bgp_show_neighbor_vty (vty
, argv
[0], show_peer
, argv
[1]);
7862 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7863 show_bgp_instance_neighbors_peer_cmd
,
7864 "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7869 "Detailed information on TCP and BGP neighbor connections\n"
7870 "Neighbor to display information about\n"
7871 "Neighbor to display information about\n")
7873 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7874 show_bgp_instance_ipv6_neighbors_peer_cmd
,
7875 "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)",
7881 "Detailed information on TCP and BGP neighbor connections\n"
7882 "Neighbor to display information about\n"
7883 "Neighbor to display information about\n")
7885 /* Show BGP's AS paths internal data. There are both `show ip bgp
7886 paths' and `show ip mbgp paths'. Those functions results are the
7888 DEFUN (show_ip_bgp_paths
,
7889 show_ip_bgp_paths_cmd
,
7890 "show ip bgp paths",
7894 "Path information\n")
7896 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
7897 aspath_print_all_vty (vty
);
7901 DEFUN (show_ip_bgp_ipv4_paths
,
7902 show_ip_bgp_ipv4_paths_cmd
,
7903 "show ip bgp ipv4 (unicast|multicast) paths",
7908 "Address Family modifier\n"
7909 "Address Family modifier\n"
7910 "Path information\n")
7912 vty_out (vty
, "Address Refcnt Path\r\n");
7913 aspath_print_all_vty (vty
);
7921 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
7923 struct community
*com
;
7925 com
= (struct community
*) backet
->data
;
7926 vty_out (vty
, "[%p] (%ld) %s%s", backet
, com
->refcnt
,
7927 community_str (com
), VTY_NEWLINE
);
7930 /* Show BGP's community internal data. */
7931 DEFUN (show_ip_bgp_community_info
,
7932 show_ip_bgp_community_info_cmd
,
7933 "show ip bgp community-info",
7937 "List all bgp community information\n")
7939 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
7941 hash_iterate (community_hash (),
7942 (void (*) (struct hash_backet
*, void *))
7943 community_show_all_iterator
,
7949 DEFUN (show_ip_bgp_attr_info
,
7950 show_ip_bgp_attr_info_cmd
,
7951 "show ip bgp attribute-info",
7955 "List all bgp attribute information\n")
7957 attr_show_all (vty
);
7962 bgp_write_rsclient_summary (struct vty
*vty
, struct peer
*rsclient
,
7963 afi_t afi
, safi_t safi
)
7965 char timebuf
[BGP_UPTIME_LEN
];
7969 struct listnode
*node
, *nnode
;
7973 if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_GROUP
))
7975 for (ALL_LIST_ELEMENTS (rsclient
->group
->peer
, node
, nnode
, peer
))
7978 bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
7983 len
= vty_out (vty
, "%s", rsclient
->host
);
7987 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
7989 vty_out (vty
, "%*s", len
, " ");
7991 vty_out (vty
, "4 ");
7993 vty_out (vty
, "%11d ", rsclient
->as
);
7995 rmname
= ROUTE_MAP_EXPORT_NAME(&rsclient
->filter
[afi
][safi
]);
7996 if ( rmname
&& strlen (rmname
) > 13 )
7998 sprintf (rmbuf
, "%13s", "...");
7999 rmname
= strncpy (rmbuf
, rmname
, 10);
8003 vty_out (vty
, " %13s ", rmname
);
8005 rmname
= ROUTE_MAP_IMPORT_NAME(&rsclient
->filter
[afi
][safi
]);
8006 if ( rmname
&& strlen (rmname
) > 13 )
8008 sprintf (rmbuf
, "%13s", "...");
8009 rmname
= strncpy (rmbuf
, rmname
, 10);
8013 vty_out (vty
, " %13s ", rmname
);
8015 vty_out (vty
, "%8s", peer_uptime (rsclient
->uptime
, timebuf
, BGP_UPTIME_LEN
));
8017 if (CHECK_FLAG (rsclient
->flags
, PEER_FLAG_SHUTDOWN
))
8018 vty_out (vty
, " Idle (Admin)");
8019 else if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
8020 vty_out (vty
, " Idle (PfxCt)");
8022 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, rsclient
->status
));
8024 vty_out (vty
, "%s", VTY_NEWLINE
);
8030 bgp_show_rsclient_summary (struct vty
*vty
, struct bgp
*bgp
,
8031 afi_t afi
, safi_t safi
)
8034 struct listnode
*node
, *nnode
;
8037 /* Header string for each address family. */
8038 static char header
[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
8040 for (ALL_LIST_ELEMENTS (bgp
->rsclient
, node
, nnode
, peer
))
8042 if (peer
->afc
[afi
][safi
] &&
8043 CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
8048 "Route Server's BGP router identifier %s%s",
8049 inet_ntoa (bgp
->router_id
), VTY_NEWLINE
);
8051 "Route Server's local AS number %u%s", bgp
->as
,
8054 vty_out (vty
, "%s", VTY_NEWLINE
);
8055 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
8058 count
+= bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
8063 vty_out (vty
, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE
,
8064 count
, VTY_NEWLINE
);
8066 vty_out (vty
, "No %s Route Server Client is configured%s",
8067 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
8073 bgp_show_rsclient_summary_vty (struct vty
*vty
, const char *name
,
8074 afi_t afi
, safi_t safi
)
8080 bgp
= bgp_lookup_by_name (name
);
8084 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
8088 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
8092 bgp
= bgp_get_default ();
8095 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
8100 /* 'show bgp rsclient' commands. */
8101 DEFUN (show_ip_bgp_rsclient_summary
,
8102 show_ip_bgp_rsclient_summary_cmd
,
8103 "show ip bgp rsclient summary",
8107 "Information about Route Server Clients\n"
8108 "Summary of all Route Server Clients\n")
8110 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
8113 DEFUN (show_ip_bgp_instance_rsclient_summary
,
8114 show_ip_bgp_instance_rsclient_summary_cmd
,
8115 "show ip bgp view WORD rsclient summary",
8121 "Information about Route Server Clients\n"
8122 "Summary of all Route Server Clients\n")
8124 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
8127 DEFUN (show_ip_bgp_ipv4_rsclient_summary
,
8128 show_ip_bgp_ipv4_rsclient_summary_cmd
,
8129 "show ip bgp ipv4 (unicast|multicast) rsclient summary",
8134 "Address Family modifier\n"
8135 "Address Family modifier\n"
8136 "Information about Route Server Clients\n"
8137 "Summary of all Route Server Clients\n")
8139 if (strncmp (argv
[0], "m", 1) == 0)
8140 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
8142 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
8145 DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary
,
8146 show_ip_bgp_instance_ipv4_rsclient_summary_cmd
,
8147 "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary",
8154 "Address Family modifier\n"
8155 "Address Family modifier\n"
8156 "Information about Route Server Clients\n"
8157 "Summary of all Route Server Clients\n")
8159 if (strncmp (argv
[1], "m", 1) == 0)
8160 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
8162 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
8166 DEFUN (show_bgp_rsclient_summary
,
8167 show_bgp_rsclient_summary_cmd
,
8168 "show bgp rsclient summary",
8171 "Information about Route Server Clients\n"
8172 "Summary of all Route Server Clients\n")
8174 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
8177 DEFUN (show_bgp_instance_rsclient_summary
,
8178 show_bgp_instance_rsclient_summary_cmd
,
8179 "show bgp view WORD rsclient summary",
8184 "Information about Route Server Clients\n"
8185 "Summary of all Route Server Clients\n")
8187 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
8190 ALIAS (show_bgp_rsclient_summary
,
8191 show_bgp_ipv6_rsclient_summary_cmd
,
8192 "show bgp ipv6 rsclient summary",
8196 "Information about Route Server Clients\n"
8197 "Summary of all Route Server Clients\n")
8199 ALIAS (show_bgp_instance_rsclient_summary
,
8200 show_bgp_instance_ipv6_rsclient_summary_cmd
,
8201 "show bgp view WORD ipv6 rsclient summary",
8207 "Information about Route Server Clients\n"
8208 "Summary of all Route Server Clients\n")
8209 #endif /* HAVE IPV6 */
8211 /* Redistribute VTY commands. */
8213 /* Utility function to convert user input route type string to route
8216 bgp_str2route_type (int afi
, const char *str
)
8223 if (strncmp (str
, "k", 1) == 0)
8224 return ZEBRA_ROUTE_KERNEL
;
8225 else if (strncmp (str
, "c", 1) == 0)
8226 return ZEBRA_ROUTE_CONNECT
;
8227 else if (strncmp (str
, "s", 1) == 0)
8228 return ZEBRA_ROUTE_STATIC
;
8229 else if (strncmp (str
, "r", 1) == 0)
8230 return ZEBRA_ROUTE_RIP
;
8231 else if (strncmp (str
, "o", 1) == 0)
8232 return ZEBRA_ROUTE_OSPF
;
8236 if (strncmp (str
, "k", 1) == 0)
8237 return ZEBRA_ROUTE_KERNEL
;
8238 else if (strncmp (str
, "c", 1) == 0)
8239 return ZEBRA_ROUTE_CONNECT
;
8240 else if (strncmp (str
, "s", 1) == 0)
8241 return ZEBRA_ROUTE_STATIC
;
8242 else if (strncmp (str
, "r", 1) == 0)
8243 return ZEBRA_ROUTE_RIPNG
;
8244 else if (strncmp (str
, "o", 1) == 0)
8245 return ZEBRA_ROUTE_OSPF6
;
8250 DEFUN (bgp_redistribute_ipv4
,
8251 bgp_redistribute_ipv4_cmd
,
8252 "redistribute (connected|kernel|ospf|rip|static)",
8253 "Redistribute information from another routing protocol\n"
8256 "Open Shurtest Path First (OSPF)\n"
8257 "Routing Information Protocol (RIP)\n"
8262 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8265 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8268 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8271 DEFUN (bgp_redistribute_ipv4_rmap
,
8272 bgp_redistribute_ipv4_rmap_cmd
,
8273 "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
8274 "Redistribute information from another routing protocol\n"
8277 "Open Shurtest Path First (OSPF)\n"
8278 "Routing Information Protocol (RIP)\n"
8280 "Route map reference\n"
8281 "Pointer to route-map entries\n")
8285 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8288 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8292 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
8293 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8296 DEFUN (bgp_redistribute_ipv4_metric
,
8297 bgp_redistribute_ipv4_metric_cmd
,
8298 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
8299 "Redistribute information from another routing protocol\n"
8302 "Open Shurtest Path First (OSPF)\n"
8303 "Routing Information Protocol (RIP)\n"
8305 "Metric for redistributed routes\n"
8311 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8314 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8317 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8319 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8320 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8323 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
8324 bgp_redistribute_ipv4_rmap_metric_cmd
,
8325 "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
8326 "Redistribute information from another routing protocol\n"
8329 "Open Shurtest Path First (OSPF)\n"
8330 "Routing Information Protocol (RIP)\n"
8332 "Route map reference\n"
8333 "Pointer to route-map entries\n"
8334 "Metric for redistributed routes\n"
8340 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8343 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8346 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8348 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
8349 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8350 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8353 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
8354 bgp_redistribute_ipv4_metric_rmap_cmd
,
8355 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
8356 "Redistribute information from another routing protocol\n"
8359 "Open Shurtest Path First (OSPF)\n"
8360 "Routing Information Protocol (RIP)\n"
8362 "Metric for redistributed routes\n"
8364 "Route map reference\n"
8365 "Pointer to route-map entries\n")
8370 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8373 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8376 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8378 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8379 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[2]);
8380 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8383 DEFUN (no_bgp_redistribute_ipv4
,
8384 no_bgp_redistribute_ipv4_cmd
,
8385 "no redistribute (connected|kernel|ospf|rip|static)",
8387 "Redistribute information from another routing protocol\n"
8390 "Open Shurtest Path First (OSPF)\n"
8391 "Routing Information Protocol (RIP)\n"
8396 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8399 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8403 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
);
8406 DEFUN (no_bgp_redistribute_ipv4_rmap
,
8407 no_bgp_redistribute_ipv4_rmap_cmd
,
8408 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
8410 "Redistribute information from another routing protocol\n"
8413 "Open Shurtest Path First (OSPF)\n"
8414 "Routing Information Protocol (RIP)\n"
8416 "Route map reference\n"
8417 "Pointer to route-map entries\n")
8421 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8424 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8428 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8432 DEFUN (no_bgp_redistribute_ipv4_metric
,
8433 no_bgp_redistribute_ipv4_metric_cmd
,
8434 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
8436 "Redistribute information from another routing protocol\n"
8439 "Open Shurtest Path First (OSPF)\n"
8440 "Routing Information Protocol (RIP)\n"
8442 "Metric for redistributed routes\n"
8447 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8450 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8454 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8458 DEFUN (no_bgp_redistribute_ipv4_rmap_metric
,
8459 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
8460 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
8462 "Redistribute information from another routing protocol\n"
8465 "Open Shurtest Path First (OSPF)\n"
8466 "Routing Information Protocol (RIP)\n"
8468 "Route map reference\n"
8469 "Pointer to route-map entries\n"
8470 "Metric for redistributed routes\n"
8475 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8478 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8482 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8483 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8487 ALIAS (no_bgp_redistribute_ipv4_rmap_metric
,
8488 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
8489 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
8491 "Redistribute information from another routing protocol\n"
8494 "Open Shurtest Path First (OSPF)\n"
8495 "Routing Information Protocol (RIP)\n"
8497 "Metric for redistributed routes\n"
8499 "Route map reference\n"
8500 "Pointer to route-map entries\n")
8503 DEFUN (bgp_redistribute_ipv6
,
8504 bgp_redistribute_ipv6_cmd
,
8505 "redistribute (connected|kernel|ospf6|ripng|static)",
8506 "Redistribute information from another routing protocol\n"
8509 "Open Shurtest Path First (OSPFv3)\n"
8510 "Routing Information Protocol (RIPng)\n"
8515 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8518 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8522 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8525 DEFUN (bgp_redistribute_ipv6_rmap
,
8526 bgp_redistribute_ipv6_rmap_cmd
,
8527 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
8528 "Redistribute information from another routing protocol\n"
8531 "Open Shurtest Path First (OSPFv3)\n"
8532 "Routing Information Protocol (RIPng)\n"
8534 "Route map reference\n"
8535 "Pointer to route-map entries\n")
8539 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8542 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8546 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8547 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8550 DEFUN (bgp_redistribute_ipv6_metric
,
8551 bgp_redistribute_ipv6_metric_cmd
,
8552 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
8553 "Redistribute information from another routing protocol\n"
8556 "Open Shurtest Path First (OSPFv3)\n"
8557 "Routing Information Protocol (RIPng)\n"
8559 "Metric for redistributed routes\n"
8565 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8568 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8571 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8573 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8574 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8577 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
8578 bgp_redistribute_ipv6_rmap_metric_cmd
,
8579 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
8580 "Redistribute information from another routing protocol\n"
8583 "Open Shurtest Path First (OSPFv3)\n"
8584 "Routing Information Protocol (RIPng)\n"
8586 "Route map reference\n"
8587 "Pointer to route-map entries\n"
8588 "Metric for redistributed routes\n"
8594 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8597 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8600 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8602 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8603 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8604 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8607 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
8608 bgp_redistribute_ipv6_metric_rmap_cmd
,
8609 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
8610 "Redistribute information from another routing protocol\n"
8613 "Open Shurtest Path First (OSPFv3)\n"
8614 "Routing Information Protocol (RIPng)\n"
8616 "Metric for redistributed routes\n"
8618 "Route map reference\n"
8619 "Pointer to route-map entries\n")
8624 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8627 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8630 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8632 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8633 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[2]);
8634 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8637 DEFUN (no_bgp_redistribute_ipv6
,
8638 no_bgp_redistribute_ipv6_cmd
,
8639 "no redistribute (connected|kernel|ospf6|ripng|static)",
8641 "Redistribute information from another routing protocol\n"
8644 "Open Shurtest Path First (OSPFv3)\n"
8645 "Routing Information Protocol (RIPng)\n"
8650 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8653 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8657 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
);
8660 DEFUN (no_bgp_redistribute_ipv6_rmap
,
8661 no_bgp_redistribute_ipv6_rmap_cmd
,
8662 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
8664 "Redistribute information from another routing protocol\n"
8667 "Open Shurtest Path First (OSPFv3)\n"
8668 "Routing Information Protocol (RIPng)\n"
8670 "Route map reference\n"
8671 "Pointer to route-map entries\n")
8675 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8678 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8682 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8686 DEFUN (no_bgp_redistribute_ipv6_metric
,
8687 no_bgp_redistribute_ipv6_metric_cmd
,
8688 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
8690 "Redistribute information from another routing protocol\n"
8693 "Open Shurtest Path First (OSPFv3)\n"
8694 "Routing Information Protocol (RIPng)\n"
8696 "Metric for redistributed routes\n"
8701 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8704 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8708 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8712 DEFUN (no_bgp_redistribute_ipv6_rmap_metric
,
8713 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
8714 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
8716 "Redistribute information from another routing protocol\n"
8719 "Open Shurtest Path First (OSPFv3)\n"
8720 "Routing Information Protocol (RIPng)\n"
8722 "Route map reference\n"
8723 "Pointer to route-map entries\n"
8724 "Metric for redistributed routes\n"
8729 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8732 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8736 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8737 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8741 ALIAS (no_bgp_redistribute_ipv6_rmap_metric
,
8742 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
8743 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
8745 "Redistribute information from another routing protocol\n"
8748 "Open Shurtest Path First (OSPFv3)\n"
8749 "Routing Information Protocol (RIPng)\n"
8751 "Metric for redistributed routes\n"
8753 "Route map reference\n"
8754 "Pointer to route-map entries\n")
8755 #endif /* HAVE_IPV6 */
8758 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
8759 safi_t safi
, int *write
)
8763 /* Unicast redistribution only. */
8764 if (safi
!= SAFI_UNICAST
)
8767 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
8769 /* Redistribute BGP does not make sense. */
8770 if (bgp
->redist
[afi
][i
] && i
!= ZEBRA_ROUTE_BGP
)
8772 /* Display "address-family" when it is not yet diplayed. */
8773 bgp_config_write_family_header (vty
, afi
, safi
, write
);
8775 /* "redistribute" configuration. */
8776 vty_out (vty
, " redistribute %s", zebra_route_string(i
));
8778 if (bgp
->redist_metric_flag
[afi
][i
])
8779 vty_out (vty
, " metric %d", bgp
->redist_metric
[afi
][i
]);
8781 if (bgp
->rmap
[afi
][i
].name
)
8782 vty_out (vty
, " route-map %s", bgp
->rmap
[afi
][i
].name
);
8784 vty_out (vty
, "%s", VTY_NEWLINE
);
8790 /* BGP node structure. */
8791 static struct cmd_node bgp_node
=
8794 "%s(config-router)# ",
8798 static struct cmd_node bgp_ipv4_unicast_node
=
8801 "%s(config-router-af)# ",
8805 static struct cmd_node bgp_ipv4_multicast_node
=
8808 "%s(config-router-af)# ",
8812 static struct cmd_node bgp_ipv6_unicast_node
=
8815 "%s(config-router-af)# ",
8819 static struct cmd_node bgp_ipv6_multicast_node
=
8822 "%s(config-router-af)# ",
8826 static struct cmd_node bgp_vpnv4_node
=
8829 "%s(config-router-af)# ",
8833 static void community_list_vty (void);
8838 /* Install bgp top node. */
8839 install_node (&bgp_node
, bgp_config_write
);
8840 install_node (&bgp_ipv4_unicast_node
, NULL
);
8841 install_node (&bgp_ipv4_multicast_node
, NULL
);
8842 install_node (&bgp_ipv6_unicast_node
, NULL
);
8843 install_node (&bgp_ipv6_multicast_node
, NULL
);
8844 install_node (&bgp_vpnv4_node
, NULL
);
8846 /* Install default VTY commands to new nodes. */
8847 install_default (BGP_NODE
);
8848 install_default (BGP_IPV4_NODE
);
8849 install_default (BGP_IPV4M_NODE
);
8850 install_default (BGP_IPV6_NODE
);
8851 install_default (BGP_IPV6M_NODE
);
8852 install_default (BGP_VPNV4_NODE
);
8854 /* "bgp multiple-instance" commands. */
8855 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
8856 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
8858 /* "bgp config-type" commands. */
8859 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
8860 install_element (CONFIG_NODE
, &no_bgp_config_type_cmd
);
8862 /* Dummy commands (Currently not supported) */
8863 install_element (BGP_NODE
, &no_synchronization_cmd
);
8864 install_element (BGP_NODE
, &no_auto_summary_cmd
);
8866 /* "router bgp" commands. */
8867 install_element (CONFIG_NODE
, &router_bgp_cmd
);
8868 install_element (CONFIG_NODE
, &router_bgp_view_cmd
);
8870 /* "no router bgp" commands. */
8871 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
8872 install_element (CONFIG_NODE
, &no_router_bgp_view_cmd
);
8874 /* "bgp router-id" commands. */
8875 install_element (BGP_NODE
, &bgp_router_id_cmd
);
8876 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
8877 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
8879 /* "bgp cluster-id" commands. */
8880 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
8881 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
8882 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
8883 install_element (BGP_NODE
, &no_bgp_cluster_id_arg_cmd
);
8885 /* "bgp confederation" commands. */
8886 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
8887 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
8888 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
8890 /* "bgp confederation peers" commands. */
8891 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
8892 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
8894 /* "timers bgp" commands. */
8895 install_element (BGP_NODE
, &bgp_timers_cmd
);
8896 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
8897 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
8899 /* "bgp client-to-client reflection" commands */
8900 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
8901 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
8903 /* "bgp always-compare-med" commands */
8904 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
8905 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
8907 /* "bgp deterministic-med" commands */
8908 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
8909 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
8911 /* "bgp graceful-restart" commands */
8912 install_element (BGP_NODE
, &bgp_graceful_restart_cmd
);
8913 install_element (BGP_NODE
, &no_bgp_graceful_restart_cmd
);
8914 install_element (BGP_NODE
, &bgp_graceful_restart_stalepath_time_cmd
);
8915 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_cmd
);
8916 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_val_cmd
);
8918 /* "bgp fast-external-failover" commands */
8919 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
8920 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
8922 /* "bgp enforce-first-as" commands */
8923 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
8924 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
8926 /* "bgp bestpath compare-routerid" commands */
8927 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
8928 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
8930 /* "bgp bestpath as-path ignore" commands */
8931 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
8932 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
8934 /* "bgp bestpath as-path confed" commands */
8935 install_element (BGP_NODE
, &bgp_bestpath_aspath_confed_cmd
);
8936 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_confed_cmd
);
8938 /* "bgp log-neighbor-changes" commands */
8939 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
8940 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
8942 /* "bgp bestpath med" commands */
8943 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
8944 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
8945 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
8946 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
8947 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
8948 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
8950 /* "no bgp default ipv4-unicast" commands. */
8951 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
8952 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
8954 /* "bgp network import-check" commands. */
8955 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
8956 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
8958 /* "bgp default local-preference" commands. */
8959 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
8960 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
8961 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
8963 /* "neighbor remote-as" commands. */
8964 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
8965 install_element (BGP_NODE
, &no_neighbor_cmd
);
8966 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
8968 /* "neighbor peer-group" commands. */
8969 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
8970 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
8971 install_element (BGP_NODE
, &no_neighbor_peer_group_remote_as_cmd
);
8973 /* "neighbor local-as" commands. */
8974 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
8975 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
8976 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
8977 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
8978 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
8980 /* "neighbor password" commands. */
8981 install_element (BGP_NODE
, &neighbor_password_cmd
);
8982 install_element (BGP_NODE
, &no_neighbor_password_cmd
);
8984 /* "neighbor activate" commands. */
8985 install_element (BGP_NODE
, &neighbor_activate_cmd
);
8986 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
8987 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
8988 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
8989 install_element (BGP_IPV6M_NODE
, &neighbor_activate_cmd
);
8990 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
8992 /* "no neighbor activate" commands. */
8993 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
8994 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
8995 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
8996 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
8997 install_element (BGP_IPV6M_NODE
, &no_neighbor_activate_cmd
);
8998 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
9000 /* "neighbor peer-group set" commands. */
9001 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
9002 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
9003 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
9004 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
9005 install_element (BGP_IPV6M_NODE
, &neighbor_set_peer_group_cmd
);
9006 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
9008 /* "no neighbor peer-group unset" commands. */
9009 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
9010 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
9011 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
9012 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
9013 install_element (BGP_IPV6M_NODE
, &no_neighbor_set_peer_group_cmd
);
9014 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
9016 /* "neighbor softreconfiguration inbound" commands.*/
9017 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
9018 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9019 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
9020 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9021 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
9022 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9023 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
9024 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9025 install_element (BGP_IPV6M_NODE
, &neighbor_soft_reconfiguration_cmd
);
9026 install_element (BGP_IPV6M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9027 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
9028 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9030 /* "neighbor attribute-unchanged" commands. */
9031 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
9032 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
9033 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
9034 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
9035 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
9036 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
9037 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
9038 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
9039 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
9040 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
9041 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
9042 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
9043 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9044 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9045 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9046 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9047 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9048 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9049 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9050 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9051 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9052 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9053 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
9054 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
9055 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
9056 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
9057 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
9058 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
9059 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
9060 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
9061 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
9062 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
9063 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
9064 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
9065 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9066 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9067 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9068 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9069 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9070 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9071 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9072 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9073 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9074 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9075 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
9076 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
9077 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
9078 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
9079 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
9080 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
9081 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
9082 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
9083 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
9084 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
9085 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
9086 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
9087 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9088 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9089 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9090 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9091 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9092 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9093 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9094 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9095 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9096 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9097 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
9098 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
9099 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
9100 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
9101 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
9102 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
9103 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
9104 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
9105 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
9106 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
9107 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
9108 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
9109 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9110 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9111 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9112 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9113 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9114 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9115 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9116 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9117 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9118 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9119 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged_cmd
);
9120 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged1_cmd
);
9121 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged2_cmd
);
9122 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged3_cmd
);
9123 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged4_cmd
);
9124 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged5_cmd
);
9125 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged6_cmd
);
9126 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged7_cmd
);
9127 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged8_cmd
);
9128 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged9_cmd
);
9129 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged10_cmd
);
9130 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged_cmd
);
9131 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9132 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9133 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9134 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9135 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9136 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9137 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9138 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9139 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9140 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9141 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
9142 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
9143 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
9144 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
9145 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
9146 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
9147 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
9148 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
9149 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
9150 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
9151 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
9152 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
9153 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9154 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9155 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9156 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9157 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9158 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9159 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9160 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9161 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9162 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9164 /* "nexthop-local unchanged" commands */
9165 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_local_unchanged_cmd
);
9166 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_local_unchanged_cmd
);
9168 /* "transparent-as" and "transparent-nexthop" for old version
9170 install_element (BGP_NODE
, &neighbor_transparent_as_cmd
);
9171 install_element (BGP_NODE
, &neighbor_transparent_nexthop_cmd
);
9173 /* "neighbor next-hop-self" commands. */
9174 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
9175 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
9176 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
9177 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
9178 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
9179 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
9180 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
9181 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
9182 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_cmd
);
9183 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_cmd
);
9184 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
9185 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
9187 /* "neighbor remove-private-AS" commands. */
9188 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
9189 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
9190 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
9191 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
9192 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
9193 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
9194 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
9195 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
9196 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_cmd
);
9197 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_cmd
);
9198 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
9199 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
9201 /* "neighbor send-community" commands.*/
9202 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
9203 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
9204 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
9205 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
9206 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
9207 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
9208 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
9209 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
9210 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
9211 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
9212 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
9213 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
9214 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
9215 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
9216 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
9217 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
9218 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_cmd
);
9219 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_type_cmd
);
9220 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_cmd
);
9221 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_type_cmd
);
9222 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
9223 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
9224 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
9225 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
9227 /* "neighbor route-reflector" commands.*/
9228 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
9229 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
9230 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
9231 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
9232 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
9233 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
9234 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
9235 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
9236 install_element (BGP_IPV6M_NODE
, &neighbor_route_reflector_client_cmd
);
9237 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_reflector_client_cmd
);
9238 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
9239 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
9241 /* "neighbor route-server" commands.*/
9242 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
9243 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
9244 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
9245 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
9246 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
9247 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
9248 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
9249 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
9250 install_element (BGP_IPV6M_NODE
, &neighbor_route_server_client_cmd
);
9251 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_server_client_cmd
);
9252 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
9253 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
9255 /* "neighbor passive" commands. */
9256 install_element (BGP_NODE
, &neighbor_passive_cmd
);
9257 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
9259 /* "neighbor shutdown" commands. */
9260 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
9261 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
9263 /* Deprecated "neighbor capability route-refresh" commands.*/
9264 install_element (BGP_NODE
, &neighbor_capability_route_refresh_cmd
);
9265 install_element (BGP_NODE
, &no_neighbor_capability_route_refresh_cmd
);
9267 /* "neighbor capability orf prefix-list" commands.*/
9268 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
9269 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9270 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
9271 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9272 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
9273 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9274 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
9275 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9276 install_element (BGP_IPV6M_NODE
, &neighbor_capability_orf_prefix_cmd
);
9277 install_element (BGP_IPV6M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9279 /* "neighbor capability dynamic" commands.*/
9280 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
9281 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
9283 /* "neighbor dont-capability-negotiate" commands. */
9284 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
9285 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
9287 /* "neighbor ebgp-multihop" commands. */
9288 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
9289 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
9290 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
9291 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
9293 /* "neighbor disable-connected-check" commands. */
9294 install_element (BGP_NODE
, &neighbor_disable_connected_check_cmd
);
9295 install_element (BGP_NODE
, &no_neighbor_disable_connected_check_cmd
);
9296 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
9297 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
9299 /* "neighbor description" commands. */
9300 install_element (BGP_NODE
, &neighbor_description_cmd
);
9301 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
9302 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
9304 /* "neighbor update-source" commands. "*/
9305 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
9306 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
9308 /* "neighbor default-originate" commands. */
9309 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
9310 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
9311 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
9312 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9313 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
9314 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
9315 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
9316 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9317 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
9318 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
9319 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
9320 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9321 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
9322 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
9323 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
9324 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9325 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_cmd
);
9326 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_rmap_cmd
);
9327 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_cmd
);
9328 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9330 /* "neighbor port" commands. */
9331 install_element (BGP_NODE
, &neighbor_port_cmd
);
9332 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
9333 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
9335 /* "neighbor weight" commands. */
9336 install_element (BGP_NODE
, &neighbor_weight_cmd
);
9337 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
9338 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
9340 /* "neighbor override-capability" commands. */
9341 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
9342 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
9344 /* "neighbor strict-capability-match" commands. */
9345 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
9346 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
9348 /* "neighbor timers" commands. */
9349 install_element (BGP_NODE
, &neighbor_timers_cmd
);
9350 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
9352 /* "neighbor timers connect" commands. */
9353 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
9354 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
9355 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
9357 /* "neighbor advertisement-interval" commands. */
9358 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
9359 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
9360 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
9362 /* "neighbor version" commands. */
9363 install_element (BGP_NODE
, &neighbor_version_cmd
);
9365 /* "neighbor interface" commands. */
9366 install_element (BGP_NODE
, &neighbor_interface_cmd
);
9367 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
9369 /* "neighbor distribute" commands. */
9370 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
9371 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
9372 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
9373 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
9374 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
9375 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
9376 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
9377 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
9378 install_element (BGP_IPV6M_NODE
, &neighbor_distribute_list_cmd
);
9379 install_element (BGP_IPV6M_NODE
, &no_neighbor_distribute_list_cmd
);
9380 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
9381 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
9383 /* "neighbor prefix-list" commands. */
9384 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
9385 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
9386 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
9387 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
9388 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
9389 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
9390 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
9391 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
9392 install_element (BGP_IPV6M_NODE
, &neighbor_prefix_list_cmd
);
9393 install_element (BGP_IPV6M_NODE
, &no_neighbor_prefix_list_cmd
);
9394 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
9395 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
9397 /* "neighbor filter-list" commands. */
9398 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
9399 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
9400 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
9401 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
9402 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
9403 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
9404 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
9405 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
9406 install_element (BGP_IPV6M_NODE
, &neighbor_filter_list_cmd
);
9407 install_element (BGP_IPV6M_NODE
, &no_neighbor_filter_list_cmd
);
9408 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
9409 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
9411 /* "neighbor route-map" commands. */
9412 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
9413 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
9414 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
9415 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
9416 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
9417 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
9418 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
9419 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
9420 install_element (BGP_IPV6M_NODE
, &neighbor_route_map_cmd
);
9421 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_map_cmd
);
9422 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
9423 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
9425 /* "neighbor unsuppress-map" commands. */
9426 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
9427 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
9428 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
9429 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
9430 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
9431 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
9432 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
9433 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
9434 install_element (BGP_IPV6M_NODE
, &neighbor_unsuppress_map_cmd
);
9435 install_element (BGP_IPV6M_NODE
, &no_neighbor_unsuppress_map_cmd
);
9436 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
9437 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
9439 /* "neighbor maximum-prefix" commands. */
9440 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
9441 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9442 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9443 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9444 install_element (BGP_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9445 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9446 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
9447 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9448 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9449 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9450 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9451 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9452 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9453 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
9454 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9455 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9456 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9457 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9458 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9459 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
9460 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9461 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9462 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9463 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9464 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9465 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9466 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
9467 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9468 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9469 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9470 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9471 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9472 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
9473 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9474 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9475 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9476 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9477 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9478 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9479 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
9480 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9481 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9482 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9483 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9484 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9485 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
9486 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9487 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9488 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9489 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9490 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9491 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9492 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_cmd
);
9493 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9494 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9495 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9496 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9497 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9498 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_cmd
);
9499 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9500 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9501 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9502 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9503 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9504 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9505 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
9506 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9507 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9508 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9509 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9510 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9511 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
9512 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9513 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9514 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9515 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9516 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9517 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9519 /* "neighbor allowas-in" */
9520 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
9521 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
9522 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
9523 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
9524 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
9525 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
9526 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
9527 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
9528 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
9529 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
9530 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
9531 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
9532 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_cmd
);
9533 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_arg_cmd
);
9534 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_cmd
);
9535 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
9536 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
9537 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
9539 /* address-family commands. */
9540 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
9541 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
9543 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
9544 install_element (BGP_NODE
, &address_family_ipv6_safi_cmd
);
9545 #endif /* HAVE_IPV6 */
9546 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
9547 install_element (BGP_NODE
, &address_family_vpnv4_unicast_cmd
);
9549 /* "exit-address-family" command. */
9550 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
9551 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
9552 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
9553 install_element (BGP_IPV6M_NODE
, &exit_address_family_cmd
);
9554 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
9556 /* "clear ip bgp commands" */
9557 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
9558 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
9559 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
9560 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
9561 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
9562 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
9564 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
9565 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
9566 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
9567 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
9568 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
9569 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
9570 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
9571 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
9572 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
9573 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
9574 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
9575 #endif /* HAVE_IPV6 */
9577 /* "clear ip bgp neighbor soft in" */
9578 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
9579 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
9580 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
9581 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
9582 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_prefix_filter_cmd
);
9583 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
9584 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
9585 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
9586 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
9587 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
9588 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
9589 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
9590 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
9591 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
9592 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
9593 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
9594 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
9595 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
9596 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
9597 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
9598 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
9599 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
);
9600 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
9601 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
9602 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
9603 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
9604 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
9605 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
9606 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
9607 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
9608 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
9609 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
9610 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
9611 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
9612 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_in_cmd
);
9613 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_in_cmd
);
9614 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_in_cmd
);
9615 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_in_cmd
);
9616 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_in_cmd
);
9617 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_in_cmd
);
9619 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
9620 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
9621 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
9622 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
9623 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
9624 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
9625 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
9626 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
9627 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
9628 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
9629 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
9630 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
9631 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
9632 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
9633 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
9634 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
9635 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
9636 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
9637 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
9638 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
9639 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
9640 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
9641 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
9642 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
9643 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
9644 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
9645 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
9646 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
9647 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
9648 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
9649 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
9650 #endif /* HAVE_IPV6 */
9652 /* "clear ip bgp neighbor soft out" */
9653 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
9654 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
9655 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
9656 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
9657 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
9658 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
9659 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
9660 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
9661 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
9662 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
9663 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
9664 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
9665 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
9666 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
9667 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
9668 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
9669 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
9670 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
9671 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
9672 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
9673 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
9674 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
9675 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_out_cmd
);
9676 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_out_cmd
);
9677 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_out_cmd
);
9678 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_out_cmd
);
9679 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_out_cmd
);
9680 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_out_cmd
);
9682 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
9683 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
9684 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
9685 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
9686 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
9687 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
9688 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
9689 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
9690 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
9691 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
9692 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
9693 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
9694 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
9695 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
9696 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
9697 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
9698 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
9699 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
9700 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
9701 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
9702 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
9703 #endif /* HAVE_IPV6 */
9705 /* "clear ip bgp neighbor soft" */
9706 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
9707 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
9708 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
9709 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
9710 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
9711 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
9712 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
9713 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
9714 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
9715 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
9716 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
9717 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
9718 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_cmd
);
9719 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_cmd
);
9720 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_cmd
);
9722 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
9723 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
9724 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
9725 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
9726 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
9727 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
9728 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
9729 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
9730 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
9731 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
9732 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
9733 #endif /* HAVE_IPV6 */
9735 /* "clear ip bgp neighbor rsclient" */
9736 install_element (ENABLE_NODE
, &clear_ip_bgp_all_rsclient_cmd
);
9737 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_rsclient_cmd
);
9738 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_rsclient_cmd
);
9739 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_rsclient_cmd
);
9741 install_element (ENABLE_NODE
, &clear_bgp_all_rsclient_cmd
);
9742 install_element (ENABLE_NODE
, &clear_bgp_instance_all_rsclient_cmd
);
9743 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_rsclient_cmd
);
9744 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_all_rsclient_cmd
);
9745 install_element (ENABLE_NODE
, &clear_bgp_peer_rsclient_cmd
);
9746 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_rsclient_cmd
);
9747 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_rsclient_cmd
);
9748 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_peer_rsclient_cmd
);
9749 #endif /* HAVE_IPV6 */
9751 /* "show ip bgp summary" commands. */
9752 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
9753 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
9754 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9755 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9756 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9757 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9759 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
9760 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
9761 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
9762 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9763 #endif /* HAVE_IPV6 */
9764 install_element (RESTRICTED_NODE
, &show_ip_bgp_summary_cmd
);
9765 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_summary_cmd
);
9766 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9767 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9768 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9769 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9771 install_element (RESTRICTED_NODE
, &show_bgp_summary_cmd
);
9772 install_element (RESTRICTED_NODE
, &show_bgp_instance_summary_cmd
);
9773 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_summary_cmd
);
9774 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9775 #endif /* HAVE_IPV6 */
9776 install_element (ENABLE_NODE
, &show_ip_bgp_summary_cmd
);
9777 install_element (ENABLE_NODE
, &show_ip_bgp_instance_summary_cmd
);
9778 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9779 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9780 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9781 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9783 install_element (ENABLE_NODE
, &show_bgp_summary_cmd
);
9784 install_element (ENABLE_NODE
, &show_bgp_instance_summary_cmd
);
9785 install_element (ENABLE_NODE
, &show_bgp_ipv6_summary_cmd
);
9786 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9787 #endif /* HAVE_IPV6 */
9789 /* "show ip bgp neighbors" commands. */
9790 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
9791 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
9792 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9793 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9794 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
9795 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
9796 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9797 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9798 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
9799 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9800 install_element (RESTRICTED_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9801 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9802 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9803 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9804 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9805 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_cmd
);
9806 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
9807 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9808 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9809 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
9810 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
9811 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9812 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9813 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
9814 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9817 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
9818 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
9819 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
9820 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9821 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
9822 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
9823 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9824 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9825 install_element (RESTRICTED_NODE
, &show_bgp_neighbors_peer_cmd
);
9826 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9827 install_element (RESTRICTED_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9828 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9829 install_element (ENABLE_NODE
, &show_bgp_neighbors_cmd
);
9830 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_cmd
);
9831 install_element (ENABLE_NODE
, &show_bgp_neighbors_peer_cmd
);
9832 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9833 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_cmd
);
9834 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
9835 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9836 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9839 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
9840 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
9841 install_element (ENABLE_NODE
, &show_ipv6_bgp_summary_cmd
);
9842 install_element (ENABLE_NODE
, &show_ipv6_mbgp_summary_cmd
);
9843 #endif /* HAVE_IPV6 */
9845 /* "show ip bgp rsclient" commands. */
9846 install_element (VIEW_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9847 install_element (VIEW_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9848 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9849 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9850 install_element (RESTRICTED_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9851 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9852 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9853 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9854 install_element (ENABLE_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9855 install_element (ENABLE_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9856 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9857 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9860 install_element (VIEW_NODE
, &show_bgp_rsclient_summary_cmd
);
9861 install_element (VIEW_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9862 install_element (VIEW_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9863 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9864 install_element (RESTRICTED_NODE
, &show_bgp_rsclient_summary_cmd
);
9865 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9866 install_element (RESTRICTED_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9867 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9868 install_element (ENABLE_NODE
, &show_bgp_rsclient_summary_cmd
);
9869 install_element (ENABLE_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9870 install_element (ENABLE_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9871 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9872 #endif /* HAVE_IPV6 */
9874 /* "show ip bgp paths" commands. */
9875 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
9876 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
9877 install_element (ENABLE_NODE
, &show_ip_bgp_paths_cmd
);
9878 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
9880 /* "show ip bgp community" commands. */
9881 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
9882 install_element (ENABLE_NODE
, &show_ip_bgp_community_info_cmd
);
9884 /* "show ip bgp attribute-info" commands. */
9885 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
9886 install_element (ENABLE_NODE
, &show_ip_bgp_attr_info_cmd
);
9888 /* "redistribute" commands. */
9889 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
9890 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
9891 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
9892 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
9893 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
9894 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
9895 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
9896 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
9897 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
9898 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
9900 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
9901 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
9902 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
9903 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
9904 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
9905 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
9906 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
9907 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
9908 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
9909 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
9910 #endif /* HAVE_IPV6 */
9912 /* "show bgp memory" commands. */
9913 install_element (VIEW_NODE
, &show_bgp_memory_cmd
);
9914 install_element (RESTRICTED_NODE
, &show_bgp_memory_cmd
);
9915 install_element (ENABLE_NODE
, &show_bgp_memory_cmd
);
9917 /* "show bgp views" commands. */
9918 install_element (VIEW_NODE
, &show_bgp_views_cmd
);
9919 install_element (RESTRICTED_NODE
, &show_bgp_views_cmd
);
9920 install_element (ENABLE_NODE
, &show_bgp_views_cmd
);
9922 /* Community-list. */
9923 community_list_vty ();
9927 #include "bgp_regex.h"
9928 #include "bgp_clist.h"
9929 #include "bgp_ecommunity.h"
9931 /* VTY functions. */
9933 /* Direction value to string conversion. */
9935 community_direct_str (int direct
)
9939 case COMMUNITY_DENY
:
9941 case COMMUNITY_PERMIT
:
9948 /* Display error string. */
9950 community_list_perror (struct vty
*vty
, int ret
)
9954 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
9955 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
9957 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
9958 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
9960 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
9961 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
9963 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
9964 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
9969 /* VTY interface for community_set() function. */
9971 community_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
9972 int style
, int reject_all_digit_name
)
9978 /* Check the list type. */
9979 if (strncmp (argv
[1], "p", 1) == 0)
9980 direct
= COMMUNITY_PERMIT
;
9981 else if (strncmp (argv
[1], "d", 1) == 0)
9982 direct
= COMMUNITY_DENY
;
9985 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9990 /* All digit name check. */
9991 if (reject_all_digit_name
&& all_digit (argv
[0]))
9993 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
9997 /* Concat community string argument. */
9999 str
= argv_concat (argv
, argc
, 2);
10003 /* When community_list_set() return nevetive value, it means
10004 malformed community string. */
10005 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
10007 /* Free temporary community list string allocated by
10010 XFREE (MTYPE_TMP
, str
);
10014 /* Display error string. */
10015 community_list_perror (vty
, ret
);
10016 return CMD_WARNING
;
10019 return CMD_SUCCESS
;
10022 /* Communiyt-list entry delete. */
10024 community_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
10033 /* Check the list direct. */
10034 if (strncmp (argv
[1], "p", 1) == 0)
10035 direct
= COMMUNITY_PERMIT
;
10036 else if (strncmp (argv
[1], "d", 1) == 0)
10037 direct
= COMMUNITY_DENY
;
10040 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10042 return CMD_WARNING
;
10045 /* Concat community string argument. */
10046 str
= argv_concat (argv
, argc
, 2);
10049 /* Unset community list. */
10050 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
10052 /* Free temporary community list string allocated by
10055 XFREE (MTYPE_TMP
, str
);
10059 community_list_perror (vty
, ret
);
10060 return CMD_WARNING
;
10063 return CMD_SUCCESS
;
10066 /* "community-list" keyword help string. */
10067 #define COMMUNITY_LIST_STR "Add a community list entry\n"
10068 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
10070 DEFUN (ip_community_list_standard
,
10071 ip_community_list_standard_cmd
,
10072 "ip community-list <1-99> (deny|permit) .AA:NN",
10075 "Community list number (standard)\n"
10076 "Specify community to reject\n"
10077 "Specify community to accept\n"
10080 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
10083 ALIAS (ip_community_list_standard
,
10084 ip_community_list_standard2_cmd
,
10085 "ip community-list <1-99> (deny|permit)",
10088 "Community list number (standard)\n"
10089 "Specify community to reject\n"
10090 "Specify community to accept\n")
10092 DEFUN (ip_community_list_expanded
,
10093 ip_community_list_expanded_cmd
,
10094 "ip community-list <100-500> (deny|permit) .LINE",
10097 "Community list number (expanded)\n"
10098 "Specify community to reject\n"
10099 "Specify community to accept\n"
10100 "An ordered list as a regular-expression\n")
10102 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
10105 DEFUN (ip_community_list_name_standard
,
10106 ip_community_list_name_standard_cmd
,
10107 "ip community-list standard WORD (deny|permit) .AA:NN",
10110 "Add a standard community-list entry\n"
10111 "Community list name\n"
10112 "Specify community to reject\n"
10113 "Specify community to accept\n"
10116 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
10119 ALIAS (ip_community_list_name_standard
,
10120 ip_community_list_name_standard2_cmd
,
10121 "ip community-list standard WORD (deny|permit)",
10124 "Add a standard community-list entry\n"
10125 "Community list name\n"
10126 "Specify community to reject\n"
10127 "Specify community to accept\n")
10129 DEFUN (ip_community_list_name_expanded
,
10130 ip_community_list_name_expanded_cmd
,
10131 "ip community-list expanded WORD (deny|permit) .LINE",
10134 "Add an expanded community-list entry\n"
10135 "Community list name\n"
10136 "Specify community to reject\n"
10137 "Specify community to accept\n"
10138 "An ordered list as a regular-expression\n")
10140 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
10143 DEFUN (no_ip_community_list_standard_all
,
10144 no_ip_community_list_standard_all_cmd
,
10145 "no ip community-list <1-99>",
10149 "Community list number (standard)\n")
10151 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10154 DEFUN (no_ip_community_list_expanded_all
,
10155 no_ip_community_list_expanded_all_cmd
,
10156 "no ip community-list <100-500>",
10160 "Community list number (expanded)\n")
10162 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10165 DEFUN (no_ip_community_list_name_standard_all
,
10166 no_ip_community_list_name_standard_all_cmd
,
10167 "no ip community-list standard WORD",
10171 "Add a standard community-list entry\n"
10172 "Community list name\n")
10174 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10177 DEFUN (no_ip_community_list_name_expanded_all
,
10178 no_ip_community_list_name_expanded_all_cmd
,
10179 "no ip community-list expanded WORD",
10183 "Add an expanded community-list entry\n"
10184 "Community list name\n")
10186 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10189 DEFUN (no_ip_community_list_standard
,
10190 no_ip_community_list_standard_cmd
,
10191 "no ip community-list <1-99> (deny|permit) .AA:NN",
10195 "Community list number (standard)\n"
10196 "Specify community to reject\n"
10197 "Specify community to accept\n"
10200 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10203 DEFUN (no_ip_community_list_expanded
,
10204 no_ip_community_list_expanded_cmd
,
10205 "no ip community-list <100-500> (deny|permit) .LINE",
10209 "Community list number (expanded)\n"
10210 "Specify community to reject\n"
10211 "Specify community to accept\n"
10212 "An ordered list as a regular-expression\n")
10214 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10217 DEFUN (no_ip_community_list_name_standard
,
10218 no_ip_community_list_name_standard_cmd
,
10219 "no ip community-list standard WORD (deny|permit) .AA:NN",
10223 "Specify a standard community-list\n"
10224 "Community list name\n"
10225 "Specify community to reject\n"
10226 "Specify community to accept\n"
10229 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10232 DEFUN (no_ip_community_list_name_expanded
,
10233 no_ip_community_list_name_expanded_cmd
,
10234 "no ip community-list expanded WORD (deny|permit) .LINE",
10238 "Specify an expanded community-list\n"
10239 "Community list name\n"
10240 "Specify community to reject\n"
10241 "Specify community to accept\n"
10242 "An ordered list as a regular-expression\n")
10244 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10248 community_list_show (struct vty
*vty
, struct community_list
*list
)
10250 struct community_entry
*entry
;
10252 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10254 if (entry
== list
->head
)
10256 if (all_digit (list
->name
))
10257 vty_out (vty
, "Community %s list %s%s",
10258 entry
->style
== COMMUNITY_LIST_STANDARD
?
10259 "standard" : "(expanded) access",
10260 list
->name
, VTY_NEWLINE
);
10262 vty_out (vty
, "Named Community %s list %s%s",
10263 entry
->style
== COMMUNITY_LIST_STANDARD
?
10264 "standard" : "expanded",
10265 list
->name
, VTY_NEWLINE
);
10268 vty_out (vty
, " %s%s",
10269 community_direct_str (entry
->direct
), VTY_NEWLINE
);
10271 vty_out (vty
, " %s %s%s",
10272 community_direct_str (entry
->direct
),
10273 entry
->style
== COMMUNITY_LIST_STANDARD
10274 ? community_str (entry
->u
.com
) : entry
->config
,
10279 DEFUN (show_ip_community_list
,
10280 show_ip_community_list_cmd
,
10281 "show ip community-list",
10284 "List community-list\n")
10286 struct community_list
*list
;
10287 struct community_list_master
*cm
;
10289 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
10291 return CMD_SUCCESS
;
10293 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10294 community_list_show (vty
, list
);
10296 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10297 community_list_show (vty
, list
);
10299 return CMD_SUCCESS
;
10302 DEFUN (show_ip_community_list_arg
,
10303 show_ip_community_list_arg_cmd
,
10304 "show ip community-list (<1-500>|WORD)",
10307 "List community-list\n"
10308 "Community-list number\n"
10309 "Community-list name\n")
10311 struct community_list
*list
;
10313 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_MASTER
);
10316 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
10317 return CMD_WARNING
;
10320 community_list_show (vty
, list
);
10322 return CMD_SUCCESS
;
10326 extcommunity_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
10327 int style
, int reject_all_digit_name
)
10333 /* Check the list type. */
10334 if (strncmp (argv
[1], "p", 1) == 0)
10335 direct
= COMMUNITY_PERMIT
;
10336 else if (strncmp (argv
[1], "d", 1) == 0)
10337 direct
= COMMUNITY_DENY
;
10340 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10342 return CMD_WARNING
;
10345 /* All digit name check. */
10346 if (reject_all_digit_name
&& all_digit (argv
[0]))
10348 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
10349 return CMD_WARNING
;
10352 /* Concat community string argument. */
10354 str
= argv_concat (argv
, argc
, 2);
10358 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
10360 /* Free temporary community list string allocated by
10363 XFREE (MTYPE_TMP
, str
);
10367 community_list_perror (vty
, ret
);
10368 return CMD_WARNING
;
10370 return CMD_SUCCESS
;
10374 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
10383 /* Check the list direct. */
10384 if (strncmp (argv
[1], "p", 1) == 0)
10385 direct
= COMMUNITY_PERMIT
;
10386 else if (strncmp (argv
[1], "d", 1) == 0)
10387 direct
= COMMUNITY_DENY
;
10390 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10392 return CMD_WARNING
;
10395 /* Concat community string argument. */
10396 str
= argv_concat (argv
, argc
, 2);
10399 /* Unset community list. */
10400 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
10402 /* Free temporary community list string allocated by
10405 XFREE (MTYPE_TMP
, str
);
10409 community_list_perror (vty
, ret
);
10410 return CMD_WARNING
;
10413 return CMD_SUCCESS
;
10416 /* "extcommunity-list" keyword help string. */
10417 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
10418 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
10420 DEFUN (ip_extcommunity_list_standard
,
10421 ip_extcommunity_list_standard_cmd
,
10422 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
10424 EXTCOMMUNITY_LIST_STR
10425 "Extended Community list number (standard)\n"
10426 "Specify community to reject\n"
10427 "Specify community to accept\n"
10428 EXTCOMMUNITY_VAL_STR
)
10430 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
10433 ALIAS (ip_extcommunity_list_standard
,
10434 ip_extcommunity_list_standard2_cmd
,
10435 "ip extcommunity-list <1-99> (deny|permit)",
10437 EXTCOMMUNITY_LIST_STR
10438 "Extended Community list number (standard)\n"
10439 "Specify community to reject\n"
10440 "Specify community to accept\n")
10442 DEFUN (ip_extcommunity_list_expanded
,
10443 ip_extcommunity_list_expanded_cmd
,
10444 "ip extcommunity-list <100-500> (deny|permit) .LINE",
10446 EXTCOMMUNITY_LIST_STR
10447 "Extended Community list number (expanded)\n"
10448 "Specify community to reject\n"
10449 "Specify community to accept\n"
10450 "An ordered list as a regular-expression\n")
10452 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
10455 DEFUN (ip_extcommunity_list_name_standard
,
10456 ip_extcommunity_list_name_standard_cmd
,
10457 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
10459 EXTCOMMUNITY_LIST_STR
10460 "Specify standard extcommunity-list\n"
10461 "Extended Community list name\n"
10462 "Specify community to reject\n"
10463 "Specify community to accept\n"
10464 EXTCOMMUNITY_VAL_STR
)
10466 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
10469 ALIAS (ip_extcommunity_list_name_standard
,
10470 ip_extcommunity_list_name_standard2_cmd
,
10471 "ip extcommunity-list standard WORD (deny|permit)",
10473 EXTCOMMUNITY_LIST_STR
10474 "Specify standard extcommunity-list\n"
10475 "Extended Community list name\n"
10476 "Specify community to reject\n"
10477 "Specify community to accept\n")
10479 DEFUN (ip_extcommunity_list_name_expanded
,
10480 ip_extcommunity_list_name_expanded_cmd
,
10481 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
10483 EXTCOMMUNITY_LIST_STR
10484 "Specify expanded extcommunity-list\n"
10485 "Extended Community list name\n"
10486 "Specify community to reject\n"
10487 "Specify community to accept\n"
10488 "An ordered list as a regular-expression\n")
10490 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
10493 DEFUN (no_ip_extcommunity_list_standard_all
,
10494 no_ip_extcommunity_list_standard_all_cmd
,
10495 "no ip extcommunity-list <1-99>",
10498 EXTCOMMUNITY_LIST_STR
10499 "Extended Community list number (standard)\n")
10501 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10504 DEFUN (no_ip_extcommunity_list_expanded_all
,
10505 no_ip_extcommunity_list_expanded_all_cmd
,
10506 "no ip extcommunity-list <100-500>",
10509 EXTCOMMUNITY_LIST_STR
10510 "Extended Community list number (expanded)\n")
10512 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10515 DEFUN (no_ip_extcommunity_list_name_standard_all
,
10516 no_ip_extcommunity_list_name_standard_all_cmd
,
10517 "no ip extcommunity-list standard WORD",
10520 EXTCOMMUNITY_LIST_STR
10521 "Specify standard extcommunity-list\n"
10522 "Extended Community list name\n")
10524 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10527 DEFUN (no_ip_extcommunity_list_name_expanded_all
,
10528 no_ip_extcommunity_list_name_expanded_all_cmd
,
10529 "no ip extcommunity-list expanded WORD",
10532 EXTCOMMUNITY_LIST_STR
10533 "Specify expanded extcommunity-list\n"
10534 "Extended Community list name\n")
10536 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10539 DEFUN (no_ip_extcommunity_list_standard
,
10540 no_ip_extcommunity_list_standard_cmd
,
10541 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
10544 EXTCOMMUNITY_LIST_STR
10545 "Extended Community list number (standard)\n"
10546 "Specify community to reject\n"
10547 "Specify community to accept\n"
10548 EXTCOMMUNITY_VAL_STR
)
10550 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10553 DEFUN (no_ip_extcommunity_list_expanded
,
10554 no_ip_extcommunity_list_expanded_cmd
,
10555 "no ip extcommunity-list <100-500> (deny|permit) .LINE",
10558 EXTCOMMUNITY_LIST_STR
10559 "Extended Community list number (expanded)\n"
10560 "Specify community to reject\n"
10561 "Specify community to accept\n"
10562 "An ordered list as a regular-expression\n")
10564 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10567 DEFUN (no_ip_extcommunity_list_name_standard
,
10568 no_ip_extcommunity_list_name_standard_cmd
,
10569 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
10572 EXTCOMMUNITY_LIST_STR
10573 "Specify standard extcommunity-list\n"
10574 "Extended Community list name\n"
10575 "Specify community to reject\n"
10576 "Specify community to accept\n"
10577 EXTCOMMUNITY_VAL_STR
)
10579 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10582 DEFUN (no_ip_extcommunity_list_name_expanded
,
10583 no_ip_extcommunity_list_name_expanded_cmd
,
10584 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
10587 EXTCOMMUNITY_LIST_STR
10588 "Specify expanded extcommunity-list\n"
10589 "Community list name\n"
10590 "Specify community to reject\n"
10591 "Specify community to accept\n"
10592 "An ordered list as a regular-expression\n")
10594 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10598 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
10600 struct community_entry
*entry
;
10602 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10604 if (entry
== list
->head
)
10606 if (all_digit (list
->name
))
10607 vty_out (vty
, "Extended community %s list %s%s",
10608 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10609 "standard" : "(expanded) access",
10610 list
->name
, VTY_NEWLINE
);
10612 vty_out (vty
, "Named extended community %s list %s%s",
10613 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10614 "standard" : "expanded",
10615 list
->name
, VTY_NEWLINE
);
10618 vty_out (vty
, " %s%s",
10619 community_direct_str (entry
->direct
), VTY_NEWLINE
);
10621 vty_out (vty
, " %s %s%s",
10622 community_direct_str (entry
->direct
),
10623 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10624 entry
->u
.ecom
->str
: entry
->config
,
10629 DEFUN (show_ip_extcommunity_list
,
10630 show_ip_extcommunity_list_cmd
,
10631 "show ip extcommunity-list",
10634 "List extended-community list\n")
10636 struct community_list
*list
;
10637 struct community_list_master
*cm
;
10639 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
10641 return CMD_SUCCESS
;
10643 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10644 extcommunity_list_show (vty
, list
);
10646 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10647 extcommunity_list_show (vty
, list
);
10649 return CMD_SUCCESS
;
10652 DEFUN (show_ip_extcommunity_list_arg
,
10653 show_ip_extcommunity_list_arg_cmd
,
10654 "show ip extcommunity-list (<1-500>|WORD)",
10657 "List extended-community list\n"
10658 "Extcommunity-list number\n"
10659 "Extcommunity-list name\n")
10661 struct community_list
*list
;
10663 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_MASTER
);
10666 vty_out (vty
, "%% Can't find extcommunit-list%s", VTY_NEWLINE
);
10667 return CMD_WARNING
;
10670 extcommunity_list_show (vty
, list
);
10672 return CMD_SUCCESS
;
10675 /* Return configuration string of community-list entry. */
10676 static const char *
10677 community_list_config_str (struct community_entry
*entry
)
10685 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
10686 str
= community_str (entry
->u
.com
);
10688 str
= entry
->config
;
10693 /* Display community-list and extcommunity-list configuration. */
10695 community_list_config_write (struct vty
*vty
)
10697 struct community_list
*list
;
10698 struct community_entry
*entry
;
10699 struct community_list_master
*cm
;
10702 /* Community-list. */
10703 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
10705 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10706 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10708 vty_out (vty
, "ip community-list %s %s %s%s",
10709 list
->name
, community_direct_str (entry
->direct
),
10710 community_list_config_str (entry
),
10714 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10715 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10717 vty_out (vty
, "ip community-list %s %s %s %s%s",
10718 entry
->style
== COMMUNITY_LIST_STANDARD
10719 ? "standard" : "expanded",
10720 list
->name
, community_direct_str (entry
->direct
),
10721 community_list_config_str (entry
),
10726 /* Extcommunity-list. */
10727 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
10729 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10730 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10732 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
10733 list
->name
, community_direct_str (entry
->direct
),
10734 community_list_config_str (entry
), VTY_NEWLINE
);
10737 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10738 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10740 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
10741 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
10742 ? "standard" : "expanded",
10743 list
->name
, community_direct_str (entry
->direct
),
10744 community_list_config_str (entry
), VTY_NEWLINE
);
10750 static struct cmd_node community_list_node
=
10752 COMMUNITY_LIST_NODE
,
10754 1 /* Export to vtysh. */
10758 community_list_vty (void)
10760 install_node (&community_list_node
, community_list_config_write
);
10762 /* Community-list. */
10763 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
10764 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
10765 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
10766 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
10767 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
10768 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
10769 install_element (CONFIG_NODE
, &no_ip_community_list_standard_all_cmd
);
10770 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_all_cmd
);
10771 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_all_cmd
);
10772 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_all_cmd
);
10773 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
10774 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
10775 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
10776 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
10777 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
10778 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
10779 install_element (ENABLE_NODE
, &show_ip_community_list_cmd
);
10780 install_element (ENABLE_NODE
, &show_ip_community_list_arg_cmd
);
10782 /* Extcommunity-list. */
10783 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
10784 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
10785 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
10786 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
10787 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
10788 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
10789 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_all_cmd
);
10790 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_all_cmd
);
10791 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_all_cmd
);
10792 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_all_cmd
);
10793 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
10794 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
10795 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
10796 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
10797 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
10798 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);
10799 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_cmd
);
10800 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_arg_cmd
);