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)"
2824 #define BGP_UPDATE_SOURCE_HELP_STR \
2828 DEFUN (neighbor_update_source
,
2829 neighbor_update_source_cmd
,
2830 NEIGHBOR_CMD2
"update-source " BGP_UPDATE_SOURCE_STR
,
2833 "Source of routing updates\n"
2834 BGP_UPDATE_SOURCE_HELP_STR
)
2836 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
2839 DEFUN (no_neighbor_update_source
,
2840 no_neighbor_update_source_cmd
,
2841 NO_NEIGHBOR_CMD2
"update-source",
2845 "Source of routing updates\n")
2847 return peer_update_source_vty (vty
, argv
[0], NULL
);
2851 peer_default_originate_set_vty (struct vty
*vty
, const char *peer_str
,
2852 afi_t afi
, safi_t safi
,
2853 const char *rmap
, int set
)
2858 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2863 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
2865 ret
= peer_default_originate_unset (peer
, afi
, safi
);
2867 return bgp_vty_return (vty
, ret
);
2870 /* neighbor default-originate. */
2871 DEFUN (neighbor_default_originate
,
2872 neighbor_default_originate_cmd
,
2873 NEIGHBOR_CMD2
"default-originate",
2876 "Originate default route to this neighbor\n")
2878 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2879 bgp_node_safi (vty
), NULL
, 1);
2882 DEFUN (neighbor_default_originate_rmap
,
2883 neighbor_default_originate_rmap_cmd
,
2884 NEIGHBOR_CMD2
"default-originate route-map WORD",
2887 "Originate default route to this neighbor\n"
2888 "Route-map to specify criteria to originate default\n"
2891 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2892 bgp_node_safi (vty
), argv
[1], 1);
2895 DEFUN (no_neighbor_default_originate
,
2896 no_neighbor_default_originate_cmd
,
2897 NO_NEIGHBOR_CMD2
"default-originate",
2901 "Originate default route to this neighbor\n")
2903 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2904 bgp_node_safi (vty
), NULL
, 0);
2907 ALIAS (no_neighbor_default_originate
,
2908 no_neighbor_default_originate_rmap_cmd
,
2909 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
2913 "Originate default route to this neighbor\n"
2914 "Route-map to specify criteria to originate default\n"
2917 /* Set neighbor's BGP port. */
2919 peer_port_vty (struct vty
*vty
, const char *ip_str
, int afi
,
2920 const char *port_str
)
2926 peer
= peer_lookup_vty (vty
, ip_str
);
2932 sp
= getservbyname ("bgp", "tcp");
2933 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
2937 VTY_GET_INTEGER("port", port
, port_str
);
2940 peer_port_set (peer
, port
);
2945 /* Set specified peer's BGP port. */
2946 DEFUN (neighbor_port
,
2948 NEIGHBOR_CMD
"port <0-65535>",
2951 "Neighbor's BGP port\n"
2952 "TCP port number\n")
2954 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
2957 DEFUN (no_neighbor_port
,
2958 no_neighbor_port_cmd
,
2959 NO_NEIGHBOR_CMD
"port",
2963 "Neighbor's BGP port\n")
2965 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
2968 ALIAS (no_neighbor_port
,
2969 no_neighbor_port_val_cmd
,
2970 NO_NEIGHBOR_CMD
"port <0-65535>",
2974 "Neighbor's BGP port\n"
2975 "TCP port number\n")
2977 /* neighbor weight. */
2979 peer_weight_set_vty (struct vty
*vty
, const char *ip_str
,
2980 const char *weight_str
)
2984 unsigned long weight
;
2986 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2990 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
2992 ret
= peer_weight_set (peer
, weight
);
2998 peer_weight_unset_vty (struct vty
*vty
, const char *ip_str
)
3002 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3006 peer_weight_unset (peer
);
3011 DEFUN (neighbor_weight
,
3012 neighbor_weight_cmd
,
3013 NEIGHBOR_CMD2
"weight <0-65535>",
3016 "Set default weight for routes from this neighbor\n"
3019 return peer_weight_set_vty (vty
, argv
[0], argv
[1]);
3022 DEFUN (no_neighbor_weight
,
3023 no_neighbor_weight_cmd
,
3024 NO_NEIGHBOR_CMD2
"weight",
3028 "Set default weight for routes from this neighbor\n")
3030 return peer_weight_unset_vty (vty
, argv
[0]);
3033 ALIAS (no_neighbor_weight
,
3034 no_neighbor_weight_val_cmd
,
3035 NO_NEIGHBOR_CMD2
"weight <0-65535>",
3039 "Set default weight for routes from this neighbor\n"
3042 /* Override capability negotiation. */
3043 DEFUN (neighbor_override_capability
,
3044 neighbor_override_capability_cmd
,
3045 NEIGHBOR_CMD2
"override-capability",
3048 "Override capability negotiation result\n")
3050 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
3053 DEFUN (no_neighbor_override_capability
,
3054 no_neighbor_override_capability_cmd
,
3055 NO_NEIGHBOR_CMD2
"override-capability",
3059 "Override capability negotiation result\n")
3061 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
3064 DEFUN (neighbor_strict_capability
,
3065 neighbor_strict_capability_cmd
,
3066 NEIGHBOR_CMD
"strict-capability-match",
3069 "Strict capability negotiation match\n")
3071 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
3074 DEFUN (no_neighbor_strict_capability
,
3075 no_neighbor_strict_capability_cmd
,
3076 NO_NEIGHBOR_CMD
"strict-capability-match",
3080 "Strict capability negotiation match\n")
3082 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
3086 peer_timers_set_vty (struct vty
*vty
, const char *ip_str
,
3087 const char *keep_str
, const char *hold_str
)
3091 u_int32_t keepalive
;
3094 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3098 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
3099 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
3101 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
3103 return bgp_vty_return (vty
, ret
);
3107 peer_timers_unset_vty (struct vty
*vty
, const char *ip_str
)
3112 peer
= peer_lookup_vty (vty
, ip_str
);
3116 ret
= peer_timers_unset (peer
);
3118 return bgp_vty_return (vty
, ret
);
3121 DEFUN (neighbor_timers
,
3122 neighbor_timers_cmd
,
3123 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
3126 "BGP per neighbor timers\n"
3127 "Keepalive interval\n"
3130 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
3133 DEFUN (no_neighbor_timers
,
3134 no_neighbor_timers_cmd
,
3135 NO_NEIGHBOR_CMD2
"timers",
3139 "BGP per neighbor timers\n")
3141 return peer_timers_unset_vty (vty
, argv
[0]);
3145 peer_timers_connect_set_vty (struct vty
*vty
, const char *ip_str
,
3146 const char *time_str
)
3152 peer
= peer_lookup_vty (vty
, ip_str
);
3156 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
3158 ret
= peer_timers_connect_set (peer
, connect
);
3164 peer_timers_connect_unset_vty (struct vty
*vty
, const char *ip_str
)
3169 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3173 ret
= peer_timers_connect_unset (peer
);
3178 DEFUN (neighbor_timers_connect
,
3179 neighbor_timers_connect_cmd
,
3180 NEIGHBOR_CMD
"timers connect <0-65535>",
3183 "BGP per neighbor timers\n"
3184 "BGP connect timer\n"
3187 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
3190 DEFUN (no_neighbor_timers_connect
,
3191 no_neighbor_timers_connect_cmd
,
3192 NO_NEIGHBOR_CMD
"timers connect",
3196 "BGP per neighbor timers\n"
3197 "BGP connect timer\n")
3199 return peer_timers_connect_unset_vty (vty
, argv
[0]);
3202 ALIAS (no_neighbor_timers_connect
,
3203 no_neighbor_timers_connect_val_cmd
,
3204 NO_NEIGHBOR_CMD
"timers connect <0-65535>",
3208 "BGP per neighbor timers\n"
3209 "BGP connect timer\n"
3213 peer_advertise_interval_vty (struct vty
*vty
, const char *ip_str
,
3214 const char *time_str
, int set
)
3218 u_int32_t routeadv
= 0;
3220 peer
= peer_lookup_vty (vty
, ip_str
);
3225 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
3228 ret
= peer_advertise_interval_set (peer
, routeadv
);
3230 ret
= peer_advertise_interval_unset (peer
);
3235 DEFUN (neighbor_advertise_interval
,
3236 neighbor_advertise_interval_cmd
,
3237 NEIGHBOR_CMD
"advertisement-interval <0-600>",
3240 "Minimum interval between sending BGP routing updates\n"
3241 "time in seconds\n")
3243 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
3246 DEFUN (no_neighbor_advertise_interval
,
3247 no_neighbor_advertise_interval_cmd
,
3248 NO_NEIGHBOR_CMD
"advertisement-interval",
3252 "Minimum interval between sending BGP routing updates\n")
3254 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
3257 ALIAS (no_neighbor_advertise_interval
,
3258 no_neighbor_advertise_interval_val_cmd
,
3259 NO_NEIGHBOR_CMD
"advertisement-interval <0-600>",
3263 "Minimum interval between sending BGP routing updates\n"
3264 "time in seconds\n")
3266 /* neighbor interface */
3268 peer_interface_vty (struct vty
*vty
, const char *ip_str
, const char *str
)
3273 peer
= peer_lookup_vty (vty
, ip_str
);
3278 ret
= peer_interface_set (peer
, str
);
3280 ret
= peer_interface_unset (peer
);
3285 DEFUN (neighbor_interface
,
3286 neighbor_interface_cmd
,
3287 NEIGHBOR_CMD
"interface WORD",
3293 return peer_interface_vty (vty
, argv
[0], argv
[1]);
3296 DEFUN (no_neighbor_interface
,
3297 no_neighbor_interface_cmd
,
3298 NO_NEIGHBOR_CMD
"interface WORD",
3305 return peer_interface_vty (vty
, argv
[0], NULL
);
3308 /* Set distribute list to the peer. */
3310 peer_distribute_set_vty (struct vty
*vty
, const char *ip_str
,
3311 afi_t afi
, safi_t safi
,
3312 const char *name_str
, const char *direct_str
)
3316 int direct
= FILTER_IN
;
3318 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3322 /* Check filter direction. */
3323 if (strncmp (direct_str
, "i", 1) == 0)
3325 else if (strncmp (direct_str
, "o", 1) == 0)
3326 direct
= FILTER_OUT
;
3328 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
3330 return bgp_vty_return (vty
, ret
);
3334 peer_distribute_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3335 safi_t safi
, const char *direct_str
)
3339 int direct
= FILTER_IN
;
3341 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3345 /* Check filter direction. */
3346 if (strncmp (direct_str
, "i", 1) == 0)
3348 else if (strncmp (direct_str
, "o", 1) == 0)
3349 direct
= FILTER_OUT
;
3351 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
3353 return bgp_vty_return (vty
, ret
);
3356 DEFUN (neighbor_distribute_list
,
3357 neighbor_distribute_list_cmd
,
3358 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3361 "Filter updates to/from this neighbor\n"
3362 "IP access-list number\n"
3363 "IP access-list number (expanded range)\n"
3364 "IP Access-list name\n"
3365 "Filter incoming updates\n"
3366 "Filter outgoing updates\n")
3368 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3369 bgp_node_safi (vty
), argv
[1], argv
[2]);
3372 DEFUN (no_neighbor_distribute_list
,
3373 no_neighbor_distribute_list_cmd
,
3374 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3378 "Filter updates to/from this neighbor\n"
3379 "IP access-list number\n"
3380 "IP access-list number (expanded range)\n"
3381 "IP Access-list name\n"
3382 "Filter incoming updates\n"
3383 "Filter outgoing updates\n")
3385 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3386 bgp_node_safi (vty
), argv
[2]);
3389 /* Set prefix list to the peer. */
3391 peer_prefix_list_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3392 safi_t safi
, const char *name_str
,
3393 const char *direct_str
)
3397 int direct
= FILTER_IN
;
3399 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3403 /* Check filter direction. */
3404 if (strncmp (direct_str
, "i", 1) == 0)
3406 else if (strncmp (direct_str
, "o", 1) == 0)
3407 direct
= FILTER_OUT
;
3409 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
3411 return bgp_vty_return (vty
, ret
);
3415 peer_prefix_list_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3416 safi_t safi
, const char *direct_str
)
3420 int direct
= FILTER_IN
;
3422 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3426 /* Check filter direction. */
3427 if (strncmp (direct_str
, "i", 1) == 0)
3429 else if (strncmp (direct_str
, "o", 1) == 0)
3430 direct
= FILTER_OUT
;
3432 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
3434 return bgp_vty_return (vty
, ret
);
3437 DEFUN (neighbor_prefix_list
,
3438 neighbor_prefix_list_cmd
,
3439 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3442 "Filter updates to/from this neighbor\n"
3443 "Name of a prefix list\n"
3444 "Filter incoming updates\n"
3445 "Filter outgoing updates\n")
3447 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3448 bgp_node_safi (vty
), argv
[1], argv
[2]);
3451 DEFUN (no_neighbor_prefix_list
,
3452 no_neighbor_prefix_list_cmd
,
3453 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3457 "Filter updates to/from this neighbor\n"
3458 "Name of a prefix list\n"
3459 "Filter incoming updates\n"
3460 "Filter outgoing updates\n")
3462 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3463 bgp_node_safi (vty
), argv
[2]);
3467 peer_aslist_set_vty (struct vty
*vty
, const char *ip_str
,
3468 afi_t afi
, safi_t safi
,
3469 const char *name_str
, const char *direct_str
)
3473 int direct
= FILTER_IN
;
3475 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3479 /* Check filter direction. */
3480 if (strncmp (direct_str
, "i", 1) == 0)
3482 else if (strncmp (direct_str
, "o", 1) == 0)
3483 direct
= FILTER_OUT
;
3485 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
3487 return bgp_vty_return (vty
, ret
);
3491 peer_aslist_unset_vty (struct vty
*vty
, const char *ip_str
,
3492 afi_t afi
, safi_t safi
,
3493 const char *direct_str
)
3497 int direct
= FILTER_IN
;
3499 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3503 /* Check filter direction. */
3504 if (strncmp (direct_str
, "i", 1) == 0)
3506 else if (strncmp (direct_str
, "o", 1) == 0)
3507 direct
= FILTER_OUT
;
3509 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
3511 return bgp_vty_return (vty
, ret
);
3514 DEFUN (neighbor_filter_list
,
3515 neighbor_filter_list_cmd
,
3516 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3519 "Establish BGP filters\n"
3520 "AS path access-list name\n"
3521 "Filter incoming routes\n"
3522 "Filter outgoing routes\n")
3524 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3525 bgp_node_safi (vty
), argv
[1], argv
[2]);
3528 DEFUN (no_neighbor_filter_list
,
3529 no_neighbor_filter_list_cmd
,
3530 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3534 "Establish BGP filters\n"
3535 "AS path access-list name\n"
3536 "Filter incoming routes\n"
3537 "Filter outgoing routes\n")
3539 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3540 bgp_node_safi (vty
), argv
[2]);
3543 /* Set route-map to the peer. */
3545 peer_route_map_set_vty (struct vty
*vty
, const char *ip_str
,
3546 afi_t afi
, safi_t safi
,
3547 const char *name_str
, const char *direct_str
)
3551 int direct
= RMAP_IN
;
3553 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3557 /* Check filter direction. */
3558 if (strncmp (direct_str
, "in", 2) == 0)
3560 else if (strncmp (direct_str
, "o", 1) == 0)
3562 else if (strncmp (direct_str
, "im", 2) == 0)
3563 direct
= RMAP_IMPORT
;
3564 else if (strncmp (direct_str
, "e", 1) == 0)
3565 direct
= RMAP_EXPORT
;
3567 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
3569 return bgp_vty_return (vty
, ret
);
3573 peer_route_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3574 safi_t safi
, const char *direct_str
)
3578 int direct
= RMAP_IN
;
3580 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3584 /* Check filter direction. */
3585 if (strncmp (direct_str
, "in", 2) == 0)
3587 else if (strncmp (direct_str
, "o", 1) == 0)
3589 else if (strncmp (direct_str
, "im", 2) == 0)
3590 direct
= RMAP_IMPORT
;
3591 else if (strncmp (direct_str
, "e", 1) == 0)
3592 direct
= RMAP_EXPORT
;
3594 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
3596 return bgp_vty_return (vty
, ret
);
3599 DEFUN (neighbor_route_map
,
3600 neighbor_route_map_cmd
,
3601 NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3604 "Apply route map to neighbor\n"
3605 "Name of route map\n"
3606 "Apply map to incoming routes\n"
3607 "Apply map to outbound routes\n"
3608 "Apply map to routes going into a Route-Server client's table\n"
3609 "Apply map to routes coming from a Route-Server client")
3611 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3612 bgp_node_safi (vty
), argv
[1], argv
[2]);
3615 DEFUN (no_neighbor_route_map
,
3616 no_neighbor_route_map_cmd
,
3617 NO_NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3621 "Apply route map to neighbor\n"
3622 "Name of route map\n"
3623 "Apply map to incoming routes\n"
3624 "Apply map to outbound routes\n"
3625 "Apply map to routes going into a Route-Server client's table\n"
3626 "Apply map to routes coming from a Route-Server client")
3628 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3629 bgp_node_safi (vty
), argv
[2]);
3632 /* Set unsuppress-map to the peer. */
3634 peer_unsuppress_map_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3635 safi_t safi
, const char *name_str
)
3640 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3644 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
3646 return bgp_vty_return (vty
, ret
);
3649 /* Unset route-map from the peer. */
3651 peer_unsuppress_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3657 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3661 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
3663 return bgp_vty_return (vty
, ret
);
3666 DEFUN (neighbor_unsuppress_map
,
3667 neighbor_unsuppress_map_cmd
,
3668 NEIGHBOR_CMD2
"unsuppress-map WORD",
3671 "Route-map to selectively unsuppress suppressed routes\n"
3672 "Name of route map\n")
3674 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3675 bgp_node_safi (vty
), argv
[1]);
3678 DEFUN (no_neighbor_unsuppress_map
,
3679 no_neighbor_unsuppress_map_cmd
,
3680 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
3684 "Route-map to selectively unsuppress suppressed routes\n"
3685 "Name of route map\n")
3687 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3688 bgp_node_safi (vty
));
3692 peer_maximum_prefix_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3693 safi_t safi
, const char *num_str
,
3694 const char *threshold_str
, int warning
,
3695 const char *restart_str
)
3703 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3707 VTY_GET_INTEGER ("maxmum number", max
, num_str
);
3709 threshold
= atoi (threshold_str
);
3711 threshold
= MAXIMUM_PREFIX_THRESHOLD_DEFAULT
;
3714 restart
= atoi (restart_str
);
3718 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, threshold
, warning
, restart
);
3720 return bgp_vty_return (vty
, ret
);
3724 peer_maximum_prefix_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3730 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3734 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
3736 return bgp_vty_return (vty
, ret
);
3739 /* Maximum number of prefix configuration. prefix count is different
3740 for each peer configuration. So this configuration can be set for
3741 each peer configuration. */
3742 DEFUN (neighbor_maximum_prefix
,
3743 neighbor_maximum_prefix_cmd
,
3744 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3747 "Maximum number of prefix accept from this peer\n"
3748 "maximum no. of prefix limit\n")
3750 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3751 bgp_node_safi (vty
), argv
[1], NULL
, 0,
3755 DEFUN (neighbor_maximum_prefix_threshold
,
3756 neighbor_maximum_prefix_threshold_cmd
,
3757 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
3760 "Maximum number of prefix accept from this peer\n"
3761 "maximum no. of prefix limit\n"
3762 "Threshold value (%) at which to generate a warning msg\n")
3764 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3765 bgp_node_safi (vty
), argv
[1], argv
[2], 0,
3769 DEFUN (neighbor_maximum_prefix_warning
,
3770 neighbor_maximum_prefix_warning_cmd
,
3771 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3774 "Maximum number of prefix accept from this peer\n"
3775 "maximum no. of prefix limit\n"
3776 "Only give warning message when limit is exceeded\n")
3778 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3779 bgp_node_safi (vty
), argv
[1], NULL
, 1,
3783 DEFUN (neighbor_maximum_prefix_threshold_warning
,
3784 neighbor_maximum_prefix_threshold_warning_cmd
,
3785 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3788 "Maximum number of prefix accept from this peer\n"
3789 "maximum no. of prefix limit\n"
3790 "Threshold value (%) at which to generate a warning msg\n"
3791 "Only give warning message when limit is exceeded\n")
3793 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3794 bgp_node_safi (vty
), argv
[1], argv
[2], 1, NULL
);
3797 DEFUN (neighbor_maximum_prefix_restart
,
3798 neighbor_maximum_prefix_restart_cmd
,
3799 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
3802 "Maximum number of prefix accept from this peer\n"
3803 "maximum no. of prefix limit\n"
3804 "Restart bgp connection after limit is exceeded\n"
3805 "Restart interval in minutes")
3807 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3808 bgp_node_safi (vty
), argv
[1], NULL
, 0, argv
[2]);
3811 DEFUN (neighbor_maximum_prefix_threshold_restart
,
3812 neighbor_maximum_prefix_threshold_restart_cmd
,
3813 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
3816 "Maximum number of prefix accept from this peer\n"
3817 "maximum no. of prefix limit\n"
3818 "Threshold value (%) at which to generate a warning msg\n"
3819 "Restart bgp connection after limit is exceeded\n"
3820 "Restart interval in minutes")
3822 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3823 bgp_node_safi (vty
), argv
[1], argv
[2], 0, argv
[3]);
3826 DEFUN (no_neighbor_maximum_prefix
,
3827 no_neighbor_maximum_prefix_cmd
,
3828 NO_NEIGHBOR_CMD2
"maximum-prefix",
3832 "Maximum number of prefix accept from this peer\n")
3834 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3835 bgp_node_safi (vty
));
3838 ALIAS (no_neighbor_maximum_prefix
,
3839 no_neighbor_maximum_prefix_val_cmd
,
3840 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3844 "Maximum number of prefix accept from this peer\n"
3845 "maximum no. of prefix limit\n")
3847 ALIAS (no_neighbor_maximum_prefix
,
3848 no_neighbor_maximum_prefix_threshold_cmd
,
3849 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3853 "Maximum number of prefix accept from this peer\n"
3854 "maximum no. of prefix limit\n"
3855 "Threshold value (%) at which to generate a warning msg\n")
3857 ALIAS (no_neighbor_maximum_prefix
,
3858 no_neighbor_maximum_prefix_warning_cmd
,
3859 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3863 "Maximum number of prefix accept from this peer\n"
3864 "maximum no. of prefix limit\n"
3865 "Only give warning message when limit is exceeded\n")
3867 ALIAS (no_neighbor_maximum_prefix
,
3868 no_neighbor_maximum_prefix_threshold_warning_cmd
,
3869 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3873 "Maximum number of prefix accept from this peer\n"
3874 "maximum no. of prefix limit\n"
3875 "Threshold value (%) at which to generate a warning msg\n"
3876 "Only give warning message when limit is exceeded\n")
3878 ALIAS (no_neighbor_maximum_prefix
,
3879 no_neighbor_maximum_prefix_restart_cmd
,
3880 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
3884 "Maximum number of prefix accept from this peer\n"
3885 "maximum no. of prefix limit\n"
3886 "Restart bgp connection after limit is exceeded\n"
3887 "Restart interval in minutes")
3889 ALIAS (no_neighbor_maximum_prefix
,
3890 no_neighbor_maximum_prefix_threshold_restart_cmd
,
3891 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
3895 "Maximum number of prefix accept from this peer\n"
3896 "maximum no. of prefix limit\n"
3897 "Threshold value (%) at which to generate a warning msg\n"
3898 "Restart bgp connection after limit is exceeded\n"
3899 "Restart interval in minutes")
3901 /* "neighbor allowas-in" */
3902 DEFUN (neighbor_allowas_in
,
3903 neighbor_allowas_in_cmd
,
3904 NEIGHBOR_CMD2
"allowas-in",
3907 "Accept as-path with my AS present in it\n")
3911 unsigned int allow_num
;
3913 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3920 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
3922 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
3925 return bgp_vty_return (vty
, ret
);
3928 ALIAS (neighbor_allowas_in
,
3929 neighbor_allowas_in_arg_cmd
,
3930 NEIGHBOR_CMD2
"allowas-in <1-10>",
3933 "Accept as-path with my AS present in it\n"
3934 "Number of occurances of AS number\n")
3936 DEFUN (no_neighbor_allowas_in
,
3937 no_neighbor_allowas_in_cmd
,
3938 NO_NEIGHBOR_CMD2
"allowas-in",
3942 "allow local ASN appears in aspath attribute\n")
3947 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3951 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3953 return bgp_vty_return (vty
, ret
);
3956 /* Address family configuration. */
3957 DEFUN (address_family_ipv4
,
3958 address_family_ipv4_cmd
,
3959 "address-family ipv4",
3960 "Enter Address Family command mode\n"
3963 vty
->node
= BGP_IPV4_NODE
;
3967 DEFUN (address_family_ipv4_safi
,
3968 address_family_ipv4_safi_cmd
,
3969 "address-family ipv4 (unicast|multicast)",
3970 "Enter Address Family command mode\n"
3972 "Address Family modifier\n"
3973 "Address Family modifier\n")
3975 if (strncmp (argv
[0], "m", 1) == 0)
3976 vty
->node
= BGP_IPV4M_NODE
;
3978 vty
->node
= BGP_IPV4_NODE
;
3983 DEFUN (address_family_ipv6
,
3984 address_family_ipv6_cmd
,
3985 "address-family ipv6",
3986 "Enter Address Family command mode\n"
3989 vty
->node
= BGP_IPV6_NODE
;
3993 DEFUN (address_family_ipv6_safi
,
3994 address_family_ipv6_safi_cmd
,
3995 "address-family ipv6 (unicast|multicast)",
3996 "Enter Address Family command mode\n"
3998 "Address Family modifier\n"
3999 "Address Family modifier\n")
4001 if (strncmp (argv
[0], "m", 1) == 0)
4002 vty
->node
= BGP_IPV6M_NODE
;
4004 vty
->node
= BGP_IPV6_NODE
;
4009 DEFUN (address_family_vpnv4
,
4010 address_family_vpnv4_cmd
,
4011 "address-family vpnv4",
4012 "Enter Address Family command mode\n"
4015 vty
->node
= BGP_VPNV4_NODE
;
4019 ALIAS (address_family_vpnv4
,
4020 address_family_vpnv4_unicast_cmd
,
4021 "address-family vpnv4 unicast",
4022 "Enter Address Family command mode\n"
4024 "Address Family Modifier\n")
4026 DEFUN (exit_address_family
,
4027 exit_address_family_cmd
,
4028 "exit-address-family",
4029 "Exit from Address Family configuration mode\n")
4031 if (vty
->node
== BGP_IPV4_NODE
4032 || vty
->node
== BGP_IPV4M_NODE
4033 || vty
->node
== BGP_VPNV4_NODE
4034 || vty
->node
== BGP_IPV6_NODE
4035 || vty
->node
== BGP_IPV6M_NODE
)
4036 vty
->node
= BGP_NODE
;
4040 /* BGP clear sort. */
4051 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
4052 safi_t safi
, int error
)
4056 case BGP_ERR_AF_UNCONFIGURED
:
4058 "%%BGP: Enable %s %s address family for the neighbor %s%s",
4059 afi
== AFI_IP6
? "IPv6" : safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
4060 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
4061 peer
->host
, VTY_NEWLINE
);
4063 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
4064 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
);
4071 /* `clear ip bgp' functions. */
4073 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
4074 enum clear_sort sort
,enum bgp_clear_type stype
, const char *arg
)
4078 struct listnode
*node
, *nnode
;
4080 /* Clear all neighbors. */
4081 if (sort
== clear_all
)
4083 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4085 if (stype
== BGP_CLEAR_SOFT_NONE
)
4086 ret
= peer_clear (peer
);
4088 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4091 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4096 /* Clear specified neighbors. */
4097 if (sort
== clear_peer
)
4102 /* Make sockunion for lookup. */
4103 ret
= str2sockunion (arg
, &su
);
4106 vty_out (vty
, "Malformed address: %s%s", arg
, VTY_NEWLINE
);
4109 peer
= peer_lookup (bgp
, &su
);
4112 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
4116 if (stype
== BGP_CLEAR_SOFT_NONE
)
4117 ret
= peer_clear (peer
);
4119 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4122 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4127 /* Clear all peer-group members. */
4128 if (sort
== clear_group
)
4130 struct peer_group
*group
;
4132 group
= peer_group_lookup (bgp
, arg
);
4135 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
4139 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
4141 if (stype
== BGP_CLEAR_SOFT_NONE
)
4143 ret
= peer_clear (peer
);
4147 if (! peer
->af_group
[afi
][safi
])
4150 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4153 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4158 if (sort
== clear_external
)
4160 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4162 if (peer_sort (peer
) == BGP_PEER_IBGP
)
4165 if (stype
== BGP_CLEAR_SOFT_NONE
)
4166 ret
= peer_clear (peer
);
4168 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4171 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4176 if (sort
== clear_as
)
4179 unsigned long as_ul
;
4182 VTY_GET_LONG ("AS", as_ul
, arg
);
4186 vty_out (vty
, "Invalid AS number%s", VTY_NEWLINE
);
4191 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4197 if (stype
== BGP_CLEAR_SOFT_NONE
)
4198 ret
= peer_clear (peer
);
4200 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4203 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4206 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
4215 bgp_clear_vty (struct vty
*vty
, const char *name
, afi_t afi
, safi_t safi
,
4216 enum clear_sort sort
, enum bgp_clear_type stype
,
4221 /* BGP structure lookup. */
4224 bgp
= bgp_lookup_by_name (name
);
4227 vty_out (vty
, "Can't find BGP view %s%s", name
, VTY_NEWLINE
);
4233 bgp
= bgp_get_default ();
4236 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
4241 return bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
4244 DEFUN (clear_ip_bgp_all
,
4245 clear_ip_bgp_all_cmd
,
4250 "Clear all peers\n")
4253 return bgp_clear_vty (vty
, argv
[0], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4255 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4258 ALIAS (clear_ip_bgp_all
,
4263 "Clear all peers\n")
4265 ALIAS (clear_ip_bgp_all
,
4266 clear_bgp_ipv6_all_cmd
,
4271 "Clear all peers\n")
4273 ALIAS (clear_ip_bgp_all
,
4274 clear_ip_bgp_instance_all_cmd
,
4275 "clear ip bgp view WORD *",
4281 "Clear all peers\n")
4283 ALIAS (clear_ip_bgp_all
,
4284 clear_bgp_instance_all_cmd
,
4285 "clear bgp view WORD *",
4290 "Clear all peers\n")
4292 DEFUN (clear_ip_bgp_peer
,
4293 clear_ip_bgp_peer_cmd
,
4294 "clear ip bgp (A.B.C.D|X:X::X:X)",
4298 "BGP neighbor IP address to clear\n"
4299 "BGP IPv6 neighbor to clear\n")
4301 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4304 ALIAS (clear_ip_bgp_peer
,
4306 "clear bgp (A.B.C.D|X:X::X:X)",
4309 "BGP neighbor address to clear\n"
4310 "BGP IPv6 neighbor to clear\n")
4312 ALIAS (clear_ip_bgp_peer
,
4313 clear_bgp_ipv6_peer_cmd
,
4314 "clear bgp ipv6 (A.B.C.D|X:X::X:X)",
4318 "BGP neighbor address to clear\n"
4319 "BGP IPv6 neighbor to clear\n")
4321 DEFUN (clear_ip_bgp_peer_group
,
4322 clear_ip_bgp_peer_group_cmd
,
4323 "clear ip bgp peer-group WORD",
4327 "Clear all members of peer-group\n"
4328 "BGP peer-group name\n")
4330 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4333 ALIAS (clear_ip_bgp_peer_group
,
4334 clear_bgp_peer_group_cmd
,
4335 "clear bgp peer-group WORD",
4338 "Clear all members of peer-group\n"
4339 "BGP peer-group name\n")
4341 ALIAS (clear_ip_bgp_peer_group
,
4342 clear_bgp_ipv6_peer_group_cmd
,
4343 "clear bgp ipv6 peer-group WORD",
4347 "Clear all members of peer-group\n"
4348 "BGP peer-group name\n")
4350 DEFUN (clear_ip_bgp_external
,
4351 clear_ip_bgp_external_cmd
,
4352 "clear ip bgp external",
4356 "Clear all external peers\n")
4358 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
4361 ALIAS (clear_ip_bgp_external
,
4362 clear_bgp_external_cmd
,
4363 "clear bgp external",
4366 "Clear all external peers\n")
4368 ALIAS (clear_ip_bgp_external
,
4369 clear_bgp_ipv6_external_cmd
,
4370 "clear bgp ipv6 external",
4374 "Clear all external peers\n")
4376 DEFUN (clear_ip_bgp_as
,
4377 clear_ip_bgp_as_cmd
,
4378 "clear ip bgp " CMD_AS_RANGE
,
4382 "Clear peers with the AS number\n")
4384 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4387 ALIAS (clear_ip_bgp_as
,
4389 "clear bgp " CMD_AS_RANGE
,
4392 "Clear peers with the AS number\n")
4394 ALIAS (clear_ip_bgp_as
,
4395 clear_bgp_ipv6_as_cmd
,
4396 "clear bgp ipv6 " CMD_AS_RANGE
,
4400 "Clear peers with the AS number\n")
4402 /* Outbound soft-reconfiguration */
4403 DEFUN (clear_ip_bgp_all_soft_out
,
4404 clear_ip_bgp_all_soft_out_cmd
,
4405 "clear ip bgp * soft out",
4411 "Soft reconfig outbound update\n")
4414 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4415 BGP_CLEAR_SOFT_OUT
, NULL
);
4417 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4418 BGP_CLEAR_SOFT_OUT
, NULL
);
4421 ALIAS (clear_ip_bgp_all_soft_out
,
4422 clear_ip_bgp_all_out_cmd
,
4423 "clear ip bgp * out",
4428 "Soft reconfig outbound update\n")
4430 ALIAS (clear_ip_bgp_all_soft_out
,
4431 clear_ip_bgp_instance_all_soft_out_cmd
,
4432 "clear ip bgp view WORD * soft out",
4440 "Soft reconfig outbound update\n")
4442 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
4443 clear_ip_bgp_all_ipv4_soft_out_cmd
,
4444 "clear ip bgp * ipv4 (unicast|multicast) soft out",
4450 "Address Family modifier\n"
4451 "Address Family modifier\n"
4453 "Soft reconfig outbound update\n")
4455 if (strncmp (argv
[0], "m", 1) == 0)
4456 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4457 BGP_CLEAR_SOFT_OUT
, NULL
);
4459 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4460 BGP_CLEAR_SOFT_OUT
, NULL
);
4463 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
4464 clear_ip_bgp_all_ipv4_out_cmd
,
4465 "clear ip bgp * ipv4 (unicast|multicast) out",
4471 "Address Family modifier\n"
4472 "Address Family modifier\n"
4473 "Soft reconfig outbound update\n")
4475 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
4476 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
4477 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out",
4485 "Address Family modifier\n"
4486 "Address Family modifier\n"
4487 "Soft reconfig outbound update\n")
4489 if (strncmp (argv
[1], "m", 1) == 0)
4490 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4491 BGP_CLEAR_SOFT_OUT
, NULL
);
4493 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4494 BGP_CLEAR_SOFT_OUT
, NULL
);
4497 DEFUN (clear_ip_bgp_all_vpnv4_soft_out
,
4498 clear_ip_bgp_all_vpnv4_soft_out_cmd
,
4499 "clear ip bgp * vpnv4 unicast soft out",
4505 "Address Family Modifier\n"
4507 "Soft reconfig outbound update\n")
4509 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
4510 BGP_CLEAR_SOFT_OUT
, NULL
);
4513 ALIAS (clear_ip_bgp_all_vpnv4_soft_out
,
4514 clear_ip_bgp_all_vpnv4_out_cmd
,
4515 "clear ip bgp * vpnv4 unicast out",
4521 "Address Family Modifier\n"
4522 "Soft reconfig outbound update\n")
4524 DEFUN (clear_bgp_all_soft_out
,
4525 clear_bgp_all_soft_out_cmd
,
4526 "clear bgp * soft out",
4531 "Soft reconfig outbound update\n")
4534 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
4535 BGP_CLEAR_SOFT_OUT
, NULL
);
4537 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
4538 BGP_CLEAR_SOFT_OUT
, NULL
);
4541 ALIAS (clear_bgp_all_soft_out
,
4542 clear_bgp_instance_all_soft_out_cmd
,
4543 "clear bgp view WORD * soft out",
4550 "Soft reconfig outbound update\n")
4552 ALIAS (clear_bgp_all_soft_out
,
4553 clear_bgp_all_out_cmd
,
4558 "Soft reconfig outbound update\n")
4560 ALIAS (clear_bgp_all_soft_out
,
4561 clear_bgp_ipv6_all_soft_out_cmd
,
4562 "clear bgp ipv6 * soft out",
4568 "Soft reconfig outbound update\n")
4570 ALIAS (clear_bgp_all_soft_out
,
4571 clear_bgp_ipv6_all_out_cmd
,
4572 "clear bgp ipv6 * out",
4577 "Soft reconfig outbound update\n")
4579 DEFUN (clear_ip_bgp_peer_soft_out
,
4580 clear_ip_bgp_peer_soft_out_cmd
,
4581 "clear ip bgp A.B.C.D soft out",
4585 "BGP neighbor address to clear\n"
4587 "Soft reconfig outbound update\n")
4589 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4590 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4593 ALIAS (clear_ip_bgp_peer_soft_out
,
4594 clear_ip_bgp_peer_out_cmd
,
4595 "clear ip bgp A.B.C.D out",
4599 "BGP neighbor address to clear\n"
4600 "Soft reconfig outbound update\n")
4602 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
4603 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
4604 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out",
4608 "BGP neighbor address to clear\n"
4610 "Address Family modifier\n"
4611 "Address Family modifier\n"
4613 "Soft reconfig outbound update\n")
4615 if (strncmp (argv
[1], "m", 1) == 0)
4616 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
4617 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4619 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4620 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4623 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
4624 clear_ip_bgp_peer_ipv4_out_cmd
,
4625 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out",
4629 "BGP neighbor address to clear\n"
4631 "Address Family modifier\n"
4632 "Address Family modifier\n"
4633 "Soft reconfig outbound update\n")
4635 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out
,
4636 clear_ip_bgp_peer_vpnv4_soft_out_cmd
,
4637 "clear ip bgp A.B.C.D vpnv4 unicast soft out",
4641 "BGP neighbor address to clear\n"
4643 "Address Family Modifier\n"
4645 "Soft reconfig outbound update\n")
4647 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
4648 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4651 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out
,
4652 clear_ip_bgp_peer_vpnv4_out_cmd
,
4653 "clear ip bgp A.B.C.D vpnv4 unicast out",
4657 "BGP neighbor address to clear\n"
4659 "Address Family Modifier\n"
4660 "Soft reconfig outbound update\n")
4662 DEFUN (clear_bgp_peer_soft_out
,
4663 clear_bgp_peer_soft_out_cmd
,
4664 "clear bgp (A.B.C.D|X:X::X:X) soft out",
4667 "BGP neighbor address to clear\n"
4668 "BGP IPv6 neighbor to clear\n"
4670 "Soft reconfig outbound update\n")
4672 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
4673 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4676 ALIAS (clear_bgp_peer_soft_out
,
4677 clear_bgp_ipv6_peer_soft_out_cmd
,
4678 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out",
4682 "BGP neighbor address to clear\n"
4683 "BGP IPv6 neighbor to clear\n"
4685 "Soft reconfig outbound update\n")
4687 ALIAS (clear_bgp_peer_soft_out
,
4688 clear_bgp_peer_out_cmd
,
4689 "clear bgp (A.B.C.D|X:X::X:X) out",
4692 "BGP neighbor address to clear\n"
4693 "BGP IPv6 neighbor to clear\n"
4694 "Soft reconfig outbound update\n")
4696 ALIAS (clear_bgp_peer_soft_out
,
4697 clear_bgp_ipv6_peer_out_cmd
,
4698 "clear bgp ipv6 (A.B.C.D|X:X::X:X) out",
4702 "BGP neighbor address to clear\n"
4703 "BGP IPv6 neighbor to clear\n"
4704 "Soft reconfig outbound update\n")
4706 DEFUN (clear_ip_bgp_peer_group_soft_out
,
4707 clear_ip_bgp_peer_group_soft_out_cmd
,
4708 "clear ip bgp peer-group WORD soft out",
4712 "Clear all members of peer-group\n"
4713 "BGP peer-group name\n"
4715 "Soft reconfig outbound update\n")
4717 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4718 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4721 ALIAS (clear_ip_bgp_peer_group_soft_out
,
4722 clear_ip_bgp_peer_group_out_cmd
,
4723 "clear ip bgp peer-group WORD out",
4727 "Clear all members of peer-group\n"
4728 "BGP peer-group name\n"
4729 "Soft reconfig outbound update\n")
4731 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
4732 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
4733 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
4737 "Clear all members of peer-group\n"
4738 "BGP peer-group name\n"
4740 "Address Family modifier\n"
4741 "Address Family modifier\n"
4743 "Soft reconfig outbound update\n")
4745 if (strncmp (argv
[1], "m", 1) == 0)
4746 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
4747 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4749 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4750 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4753 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
4754 clear_ip_bgp_peer_group_ipv4_out_cmd
,
4755 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
4759 "Clear all members of peer-group\n"
4760 "BGP peer-group name\n"
4762 "Address Family modifier\n"
4763 "Address Family modifier\n"
4764 "Soft reconfig outbound update\n")
4766 DEFUN (clear_bgp_peer_group_soft_out
,
4767 clear_bgp_peer_group_soft_out_cmd
,
4768 "clear bgp peer-group WORD soft out",
4771 "Clear all members of peer-group\n"
4772 "BGP peer-group name\n"
4774 "Soft reconfig outbound update\n")
4776 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
4777 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4780 ALIAS (clear_bgp_peer_group_soft_out
,
4781 clear_bgp_ipv6_peer_group_soft_out_cmd
,
4782 "clear bgp ipv6 peer-group WORD soft out",
4786 "Clear all members of peer-group\n"
4787 "BGP peer-group name\n"
4789 "Soft reconfig outbound update\n")
4791 ALIAS (clear_bgp_peer_group_soft_out
,
4792 clear_bgp_peer_group_out_cmd
,
4793 "clear bgp peer-group WORD out",
4796 "Clear all members of peer-group\n"
4797 "BGP peer-group name\n"
4798 "Soft reconfig outbound update\n")
4800 ALIAS (clear_bgp_peer_group_soft_out
,
4801 clear_bgp_ipv6_peer_group_out_cmd
,
4802 "clear bgp ipv6 peer-group WORD out",
4806 "Clear all members of peer-group\n"
4807 "BGP peer-group name\n"
4808 "Soft reconfig outbound update\n")
4810 DEFUN (clear_ip_bgp_external_soft_out
,
4811 clear_ip_bgp_external_soft_out_cmd
,
4812 "clear ip bgp external soft out",
4816 "Clear all external peers\n"
4818 "Soft reconfig outbound update\n")
4820 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4821 BGP_CLEAR_SOFT_OUT
, NULL
);
4824 ALIAS (clear_ip_bgp_external_soft_out
,
4825 clear_ip_bgp_external_out_cmd
,
4826 "clear ip bgp external out",
4830 "Clear all external peers\n"
4831 "Soft reconfig outbound update\n")
4833 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
4834 clear_ip_bgp_external_ipv4_soft_out_cmd
,
4835 "clear ip bgp external ipv4 (unicast|multicast) soft out",
4839 "Clear all external peers\n"
4841 "Address Family modifier\n"
4842 "Address Family modifier\n"
4844 "Soft reconfig outbound update\n")
4846 if (strncmp (argv
[0], "m", 1) == 0)
4847 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
4848 BGP_CLEAR_SOFT_OUT
, NULL
);
4850 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4851 BGP_CLEAR_SOFT_OUT
, NULL
);
4854 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
4855 clear_ip_bgp_external_ipv4_out_cmd
,
4856 "clear ip bgp external ipv4 (unicast|multicast) out",
4860 "Clear all external peers\n"
4862 "Address Family modifier\n"
4863 "Address Family modifier\n"
4864 "Soft reconfig outbound update\n")
4866 DEFUN (clear_bgp_external_soft_out
,
4867 clear_bgp_external_soft_out_cmd
,
4868 "clear bgp external soft out",
4871 "Clear all external peers\n"
4873 "Soft reconfig outbound update\n")
4875 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
4876 BGP_CLEAR_SOFT_OUT
, NULL
);
4879 ALIAS (clear_bgp_external_soft_out
,
4880 clear_bgp_ipv6_external_soft_out_cmd
,
4881 "clear bgp ipv6 external soft out",
4885 "Clear all external peers\n"
4887 "Soft reconfig outbound update\n")
4889 ALIAS (clear_bgp_external_soft_out
,
4890 clear_bgp_external_out_cmd
,
4891 "clear bgp external out",
4894 "Clear all external peers\n"
4895 "Soft reconfig outbound update\n")
4897 ALIAS (clear_bgp_external_soft_out
,
4898 clear_bgp_ipv6_external_out_cmd
,
4899 "clear bgp ipv6 external WORD out",
4903 "Clear all external peers\n"
4904 "Soft reconfig outbound update\n")
4906 DEFUN (clear_ip_bgp_as_soft_out
,
4907 clear_ip_bgp_as_soft_out_cmd
,
4908 "clear ip bgp " CMD_AS_RANGE
" soft out",
4912 "Clear peers with the AS number\n"
4914 "Soft reconfig outbound update\n")
4916 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4917 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4920 ALIAS (clear_ip_bgp_as_soft_out
,
4921 clear_ip_bgp_as_out_cmd
,
4922 "clear ip bgp " CMD_AS_RANGE
" out",
4926 "Clear peers with the AS number\n"
4927 "Soft reconfig outbound update\n")
4929 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
4930 clear_ip_bgp_as_ipv4_soft_out_cmd
,
4931 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft out",
4935 "Clear peers with the AS number\n"
4937 "Address Family modifier\n"
4938 "Address Family modifier\n"
4940 "Soft reconfig outbound update\n")
4942 if (strncmp (argv
[1], "m", 1) == 0)
4943 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
4944 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4946 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4947 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4950 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
4951 clear_ip_bgp_as_ipv4_out_cmd
,
4952 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) out",
4956 "Clear peers with the AS number\n"
4958 "Address Family modifier\n"
4959 "Address Family modifier\n"
4960 "Soft reconfig outbound update\n")
4962 DEFUN (clear_ip_bgp_as_vpnv4_soft_out
,
4963 clear_ip_bgp_as_vpnv4_soft_out_cmd
,
4964 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft out",
4968 "Clear peers with the AS number\n"
4970 "Address Family modifier\n"
4972 "Soft reconfig outbound update\n")
4974 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
4975 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4978 ALIAS (clear_ip_bgp_as_vpnv4_soft_out
,
4979 clear_ip_bgp_as_vpnv4_out_cmd
,
4980 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast out",
4984 "Clear peers with the AS number\n"
4986 "Address Family modifier\n"
4987 "Soft reconfig outbound update\n")
4989 DEFUN (clear_bgp_as_soft_out
,
4990 clear_bgp_as_soft_out_cmd
,
4991 "clear bgp " CMD_AS_RANGE
" soft out",
4994 "Clear peers with the AS number\n"
4996 "Soft reconfig outbound update\n")
4998 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
4999 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5002 ALIAS (clear_bgp_as_soft_out
,
5003 clear_bgp_ipv6_as_soft_out_cmd
,
5004 "clear bgp ipv6 " CMD_AS_RANGE
" soft out",
5008 "Clear peers with the AS number\n"
5010 "Soft reconfig outbound update\n")
5012 ALIAS (clear_bgp_as_soft_out
,
5013 clear_bgp_as_out_cmd
,
5014 "clear bgp " CMD_AS_RANGE
" out",
5017 "Clear peers with the AS number\n"
5018 "Soft reconfig outbound update\n")
5020 ALIAS (clear_bgp_as_soft_out
,
5021 clear_bgp_ipv6_as_out_cmd
,
5022 "clear bgp ipv6 " CMD_AS_RANGE
" out",
5026 "Clear peers with the AS number\n"
5027 "Soft reconfig outbound update\n")
5029 /* Inbound soft-reconfiguration */
5030 DEFUN (clear_ip_bgp_all_soft_in
,
5031 clear_ip_bgp_all_soft_in_cmd
,
5032 "clear ip bgp * soft in",
5038 "Soft reconfig inbound update\n")
5041 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5042 BGP_CLEAR_SOFT_IN
, NULL
);
5044 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5045 BGP_CLEAR_SOFT_IN
, NULL
);
5048 ALIAS (clear_ip_bgp_all_soft_in
,
5049 clear_ip_bgp_instance_all_soft_in_cmd
,
5050 "clear ip bgp view WORD * soft in",
5058 "Soft reconfig inbound update\n")
5060 ALIAS (clear_ip_bgp_all_soft_in
,
5061 clear_ip_bgp_all_in_cmd
,
5062 "clear ip bgp * in",
5067 "Soft reconfig inbound update\n")
5069 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
5070 clear_ip_bgp_all_in_prefix_filter_cmd
,
5071 "clear ip bgp * in prefix-filter",
5076 "Soft reconfig inbound update\n"
5077 "Push out prefix-list ORF and do inbound soft reconfig\n")
5080 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5081 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5083 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5084 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5087 ALIAS (clear_ip_bgp_all_in_prefix_filter
,
5088 clear_ip_bgp_instance_all_in_prefix_filter_cmd
,
5089 "clear ip bgp view WORD * in prefix-filter",
5096 "Soft reconfig inbound update\n"
5097 "Push out prefix-list ORF and do inbound soft reconfig\n")
5100 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
5101 clear_ip_bgp_all_ipv4_soft_in_cmd
,
5102 "clear ip bgp * ipv4 (unicast|multicast) soft in",
5108 "Address Family modifier\n"
5109 "Address Family modifier\n"
5111 "Soft reconfig inbound update\n")
5113 if (strncmp (argv
[0], "m", 1) == 0)
5114 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5115 BGP_CLEAR_SOFT_IN
, NULL
);
5117 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5118 BGP_CLEAR_SOFT_IN
, NULL
);
5121 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
5122 clear_ip_bgp_all_ipv4_in_cmd
,
5123 "clear ip bgp * ipv4 (unicast|multicast) in",
5129 "Address Family modifier\n"
5130 "Address Family modifier\n"
5131 "Soft reconfig inbound update\n")
5133 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
5134 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
5135 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in",
5143 "Address Family modifier\n"
5144 "Address Family modifier\n"
5146 "Soft reconfig inbound update\n")
5148 if (strncmp (argv
[1], "m", 1) == 0)
5149 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5150 BGP_CLEAR_SOFT_IN
, NULL
);
5152 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5153 BGP_CLEAR_SOFT_IN
, NULL
);
5156 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
5157 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
5158 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
5164 "Address Family modifier\n"
5165 "Address Family modifier\n"
5166 "Soft reconfig inbound update\n"
5167 "Push out prefix-list ORF and do inbound soft reconfig\n")
5169 if (strncmp (argv
[0], "m", 1) == 0)
5170 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5171 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5173 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5174 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5177 DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter
,
5178 clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
,
5179 "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter",
5185 "Address Family modifier\n"
5186 "Address Family modifier\n"
5187 "Soft reconfig inbound update\n"
5188 "Push out prefix-list ORF and do inbound soft reconfig\n")
5190 if (strncmp (argv
[1], "m", 1) == 0)
5191 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5192 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5194 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5195 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5198 DEFUN (clear_ip_bgp_all_vpnv4_soft_in
,
5199 clear_ip_bgp_all_vpnv4_soft_in_cmd
,
5200 "clear ip bgp * vpnv4 unicast soft in",
5206 "Address Family Modifier\n"
5208 "Soft reconfig inbound update\n")
5210 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
5211 BGP_CLEAR_SOFT_IN
, NULL
);
5214 ALIAS (clear_ip_bgp_all_vpnv4_soft_in
,
5215 clear_ip_bgp_all_vpnv4_in_cmd
,
5216 "clear ip bgp * vpnv4 unicast in",
5222 "Address Family Modifier\n"
5223 "Soft reconfig inbound update\n")
5225 DEFUN (clear_bgp_all_soft_in
,
5226 clear_bgp_all_soft_in_cmd
,
5227 "clear bgp * soft in",
5232 "Soft reconfig inbound update\n")
5235 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
5236 BGP_CLEAR_SOFT_IN
, NULL
);
5238 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5239 BGP_CLEAR_SOFT_IN
, NULL
);
5242 ALIAS (clear_bgp_all_soft_in
,
5243 clear_bgp_instance_all_soft_in_cmd
,
5244 "clear bgp view WORD * soft in",
5251 "Soft reconfig inbound update\n")
5253 ALIAS (clear_bgp_all_soft_in
,
5254 clear_bgp_ipv6_all_soft_in_cmd
,
5255 "clear bgp ipv6 * soft in",
5261 "Soft reconfig inbound update\n")
5263 ALIAS (clear_bgp_all_soft_in
,
5264 clear_bgp_all_in_cmd
,
5269 "Soft reconfig inbound update\n")
5271 ALIAS (clear_bgp_all_soft_in
,
5272 clear_bgp_ipv6_all_in_cmd
,
5273 "clear bgp ipv6 * in",
5278 "Soft reconfig inbound update\n")
5280 DEFUN (clear_bgp_all_in_prefix_filter
,
5281 clear_bgp_all_in_prefix_filter_cmd
,
5282 "clear bgp * in prefix-filter",
5286 "Soft reconfig inbound update\n"
5287 "Push out prefix-list ORF and do inbound soft reconfig\n")
5289 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5290 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5293 ALIAS (clear_bgp_all_in_prefix_filter
,
5294 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
5295 "clear bgp ipv6 * in prefix-filter",
5300 "Soft reconfig inbound update\n"
5301 "Push out prefix-list ORF and do inbound soft reconfig\n")
5303 DEFUN (clear_ip_bgp_peer_soft_in
,
5304 clear_ip_bgp_peer_soft_in_cmd
,
5305 "clear ip bgp A.B.C.D soft in",
5309 "BGP neighbor address to clear\n"
5311 "Soft reconfig inbound update\n")
5313 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5314 BGP_CLEAR_SOFT_IN
, argv
[0]);
5317 ALIAS (clear_ip_bgp_peer_soft_in
,
5318 clear_ip_bgp_peer_in_cmd
,
5319 "clear ip bgp A.B.C.D in",
5323 "BGP neighbor address to clear\n"
5324 "Soft reconfig inbound update\n")
5326 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
5327 clear_ip_bgp_peer_in_prefix_filter_cmd
,
5328 "clear ip bgp A.B.C.D in prefix-filter",
5332 "BGP neighbor address to clear\n"
5333 "Soft reconfig inbound update\n"
5334 "Push out the existing ORF prefix-list\n")
5336 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5337 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5340 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
5341 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
5342 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in",
5346 "BGP neighbor address to clear\n"
5348 "Address Family modifier\n"
5349 "Address Family modifier\n"
5351 "Soft reconfig inbound update\n")
5353 if (strncmp (argv
[1], "m", 1) == 0)
5354 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5355 BGP_CLEAR_SOFT_IN
, argv
[0]);
5357 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5358 BGP_CLEAR_SOFT_IN
, argv
[0]);
5361 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
5362 clear_ip_bgp_peer_ipv4_in_cmd
,
5363 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in",
5367 "BGP neighbor address to clear\n"
5369 "Address Family modifier\n"
5370 "Address Family modifier\n"
5371 "Soft reconfig inbound update\n")
5373 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
5374 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
5375 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter",
5379 "BGP neighbor address to clear\n"
5381 "Address Family modifier\n"
5382 "Address Family modifier\n"
5383 "Soft reconfig inbound update\n"
5384 "Push out the existing ORF prefix-list\n")
5386 if (strncmp (argv
[1], "m", 1) == 0)
5387 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5388 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5390 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5391 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5394 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in
,
5395 clear_ip_bgp_peer_vpnv4_soft_in_cmd
,
5396 "clear ip bgp A.B.C.D vpnv4 unicast soft in",
5400 "BGP neighbor address to clear\n"
5402 "Address Family Modifier\n"
5404 "Soft reconfig inbound update\n")
5406 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
5407 BGP_CLEAR_SOFT_IN
, argv
[0]);
5410 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in
,
5411 clear_ip_bgp_peer_vpnv4_in_cmd
,
5412 "clear ip bgp A.B.C.D vpnv4 unicast in",
5416 "BGP neighbor address to clear\n"
5418 "Address Family Modifier\n"
5419 "Soft reconfig inbound update\n")
5421 DEFUN (clear_bgp_peer_soft_in
,
5422 clear_bgp_peer_soft_in_cmd
,
5423 "clear bgp (A.B.C.D|X:X::X:X) soft in",
5426 "BGP neighbor address to clear\n"
5427 "BGP IPv6 neighbor to clear\n"
5429 "Soft reconfig inbound update\n")
5431 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5432 BGP_CLEAR_SOFT_IN
, argv
[0]);
5435 ALIAS (clear_bgp_peer_soft_in
,
5436 clear_bgp_ipv6_peer_soft_in_cmd
,
5437 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in",
5441 "BGP neighbor address to clear\n"
5442 "BGP IPv6 neighbor to clear\n"
5444 "Soft reconfig inbound update\n")
5446 ALIAS (clear_bgp_peer_soft_in
,
5447 clear_bgp_peer_in_cmd
,
5448 "clear bgp (A.B.C.D|X:X::X:X) in",
5451 "BGP neighbor address to clear\n"
5452 "BGP IPv6 neighbor to clear\n"
5453 "Soft reconfig inbound update\n")
5455 ALIAS (clear_bgp_peer_soft_in
,
5456 clear_bgp_ipv6_peer_in_cmd
,
5457 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in",
5461 "BGP neighbor address to clear\n"
5462 "BGP IPv6 neighbor to clear\n"
5463 "Soft reconfig inbound update\n")
5465 DEFUN (clear_bgp_peer_in_prefix_filter
,
5466 clear_bgp_peer_in_prefix_filter_cmd
,
5467 "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter",
5470 "BGP neighbor address to clear\n"
5471 "BGP IPv6 neighbor to clear\n"
5472 "Soft reconfig inbound update\n"
5473 "Push out the existing ORF prefix-list\n")
5475 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5476 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5479 ALIAS (clear_bgp_peer_in_prefix_filter
,
5480 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
5481 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter",
5485 "BGP neighbor address to clear\n"
5486 "BGP IPv6 neighbor to clear\n"
5487 "Soft reconfig inbound update\n"
5488 "Push out the existing ORF prefix-list\n")
5490 DEFUN (clear_ip_bgp_peer_group_soft_in
,
5491 clear_ip_bgp_peer_group_soft_in_cmd
,
5492 "clear ip bgp peer-group WORD soft in",
5496 "Clear all members of peer-group\n"
5497 "BGP peer-group name\n"
5499 "Soft reconfig inbound update\n")
5501 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5502 BGP_CLEAR_SOFT_IN
, argv
[0]);
5505 ALIAS (clear_ip_bgp_peer_group_soft_in
,
5506 clear_ip_bgp_peer_group_in_cmd
,
5507 "clear ip bgp peer-group WORD in",
5511 "Clear all members of peer-group\n"
5512 "BGP peer-group name\n"
5513 "Soft reconfig inbound update\n")
5515 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
5516 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
5517 "clear ip bgp peer-group WORD in prefix-filter",
5521 "Clear all members of peer-group\n"
5522 "BGP peer-group name\n"
5523 "Soft reconfig inbound update\n"
5524 "Push out prefix-list ORF and do inbound soft reconfig\n")
5526 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5527 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5530 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
5531 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
5532 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
5536 "Clear all members of peer-group\n"
5537 "BGP peer-group name\n"
5539 "Address Family modifier\n"
5540 "Address Family modifier\n"
5542 "Soft reconfig inbound update\n")
5544 if (strncmp (argv
[1], "m", 1) == 0)
5545 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5546 BGP_CLEAR_SOFT_IN
, argv
[0]);
5548 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5549 BGP_CLEAR_SOFT_IN
, argv
[0]);
5552 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
5553 clear_ip_bgp_peer_group_ipv4_in_cmd
,
5554 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
5558 "Clear all members of peer-group\n"
5559 "BGP peer-group name\n"
5561 "Address Family modifier\n"
5562 "Address Family modifier\n"
5563 "Soft reconfig inbound update\n")
5565 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
5566 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
5567 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
5571 "Clear all members of peer-group\n"
5572 "BGP peer-group name\n"
5574 "Address Family modifier\n"
5575 "Address Family modifier\n"
5576 "Soft reconfig inbound update\n"
5577 "Push out prefix-list ORF and do inbound soft reconfig\n")
5579 if (strncmp (argv
[1], "m", 1) == 0)
5580 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5581 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5583 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5584 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5587 DEFUN (clear_bgp_peer_group_soft_in
,
5588 clear_bgp_peer_group_soft_in_cmd
,
5589 "clear bgp peer-group WORD soft in",
5592 "Clear all members of peer-group\n"
5593 "BGP peer-group name\n"
5595 "Soft reconfig inbound update\n")
5597 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5598 BGP_CLEAR_SOFT_IN
, argv
[0]);
5601 ALIAS (clear_bgp_peer_group_soft_in
,
5602 clear_bgp_ipv6_peer_group_soft_in_cmd
,
5603 "clear bgp ipv6 peer-group WORD soft in",
5607 "Clear all members of peer-group\n"
5608 "BGP peer-group name\n"
5610 "Soft reconfig inbound update\n")
5612 ALIAS (clear_bgp_peer_group_soft_in
,
5613 clear_bgp_peer_group_in_cmd
,
5614 "clear bgp peer-group WORD in",
5617 "Clear all members of peer-group\n"
5618 "BGP peer-group name\n"
5619 "Soft reconfig inbound update\n")
5621 ALIAS (clear_bgp_peer_group_soft_in
,
5622 clear_bgp_ipv6_peer_group_in_cmd
,
5623 "clear bgp ipv6 peer-group WORD in",
5627 "Clear all members of peer-group\n"
5628 "BGP peer-group name\n"
5629 "Soft reconfig inbound update\n")
5631 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
5632 clear_bgp_peer_group_in_prefix_filter_cmd
,
5633 "clear bgp peer-group WORD in prefix-filter",
5636 "Clear all members of peer-group\n"
5637 "BGP peer-group name\n"
5638 "Soft reconfig inbound update\n"
5639 "Push out prefix-list ORF and do inbound soft reconfig\n")
5641 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5642 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5645 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
5646 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
5647 "clear bgp ipv6 peer-group WORD in prefix-filter",
5651 "Clear all members of peer-group\n"
5652 "BGP peer-group name\n"
5653 "Soft reconfig inbound update\n"
5654 "Push out prefix-list ORF and do inbound soft reconfig\n")
5656 DEFUN (clear_ip_bgp_external_soft_in
,
5657 clear_ip_bgp_external_soft_in_cmd
,
5658 "clear ip bgp external soft in",
5662 "Clear all external peers\n"
5664 "Soft reconfig inbound update\n")
5666 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5667 BGP_CLEAR_SOFT_IN
, NULL
);
5670 ALIAS (clear_ip_bgp_external_soft_in
,
5671 clear_ip_bgp_external_in_cmd
,
5672 "clear ip bgp external in",
5676 "Clear all external peers\n"
5677 "Soft reconfig inbound update\n")
5679 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
5680 clear_ip_bgp_external_in_prefix_filter_cmd
,
5681 "clear ip bgp external in prefix-filter",
5685 "Clear all external peers\n"
5686 "Soft reconfig inbound update\n"
5687 "Push out prefix-list ORF and do inbound soft reconfig\n")
5689 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5690 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5693 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
5694 clear_ip_bgp_external_ipv4_soft_in_cmd
,
5695 "clear ip bgp external ipv4 (unicast|multicast) soft in",
5699 "Clear all external peers\n"
5701 "Address Family modifier\n"
5702 "Address Family modifier\n"
5704 "Soft reconfig inbound update\n")
5706 if (strncmp (argv
[0], "m", 1) == 0)
5707 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5708 BGP_CLEAR_SOFT_IN
, NULL
);
5710 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5711 BGP_CLEAR_SOFT_IN
, NULL
);
5714 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
5715 clear_ip_bgp_external_ipv4_in_cmd
,
5716 "clear ip bgp external ipv4 (unicast|multicast) in",
5720 "Clear all external peers\n"
5722 "Address Family modifier\n"
5723 "Address Family modifier\n"
5724 "Soft reconfig inbound update\n")
5726 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
5727 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
5728 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
5732 "Clear all external peers\n"
5734 "Address Family modifier\n"
5735 "Address Family modifier\n"
5736 "Soft reconfig inbound update\n"
5737 "Push out prefix-list ORF and do inbound soft reconfig\n")
5739 if (strncmp (argv
[0], "m", 1) == 0)
5740 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5741 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5743 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5744 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5747 DEFUN (clear_bgp_external_soft_in
,
5748 clear_bgp_external_soft_in_cmd
,
5749 "clear bgp external soft in",
5752 "Clear all external peers\n"
5754 "Soft reconfig inbound update\n")
5756 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5757 BGP_CLEAR_SOFT_IN
, NULL
);
5760 ALIAS (clear_bgp_external_soft_in
,
5761 clear_bgp_ipv6_external_soft_in_cmd
,
5762 "clear bgp ipv6 external soft in",
5766 "Clear all external peers\n"
5768 "Soft reconfig inbound update\n")
5770 ALIAS (clear_bgp_external_soft_in
,
5771 clear_bgp_external_in_cmd
,
5772 "clear bgp external in",
5775 "Clear all external peers\n"
5776 "Soft reconfig inbound update\n")
5778 ALIAS (clear_bgp_external_soft_in
,
5779 clear_bgp_ipv6_external_in_cmd
,
5780 "clear bgp ipv6 external WORD in",
5784 "Clear all external peers\n"
5785 "Soft reconfig inbound update\n")
5787 DEFUN (clear_bgp_external_in_prefix_filter
,
5788 clear_bgp_external_in_prefix_filter_cmd
,
5789 "clear bgp external in prefix-filter",
5792 "Clear all external peers\n"
5793 "Soft reconfig inbound update\n"
5794 "Push out prefix-list ORF and do inbound soft reconfig\n")
5796 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5797 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5800 ALIAS (clear_bgp_external_in_prefix_filter
,
5801 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
5802 "clear bgp ipv6 external in prefix-filter",
5806 "Clear all external peers\n"
5807 "Soft reconfig inbound update\n"
5808 "Push out prefix-list ORF and do inbound soft reconfig\n")
5810 DEFUN (clear_ip_bgp_as_soft_in
,
5811 clear_ip_bgp_as_soft_in_cmd
,
5812 "clear ip bgp " CMD_AS_RANGE
" soft in",
5816 "Clear peers with the AS number\n"
5818 "Soft reconfig inbound update\n")
5820 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5821 BGP_CLEAR_SOFT_IN
, argv
[0]);
5824 ALIAS (clear_ip_bgp_as_soft_in
,
5825 clear_ip_bgp_as_in_cmd
,
5826 "clear ip bgp " CMD_AS_RANGE
" in",
5830 "Clear peers with the AS number\n"
5831 "Soft reconfig inbound update\n")
5833 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
5834 clear_ip_bgp_as_in_prefix_filter_cmd
,
5835 "clear ip bgp " CMD_AS_RANGE
" in prefix-filter",
5839 "Clear peers with the AS number\n"
5840 "Soft reconfig inbound update\n"
5841 "Push out prefix-list ORF and do inbound soft reconfig\n")
5843 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5844 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5847 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
5848 clear_ip_bgp_as_ipv4_soft_in_cmd
,
5849 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft in",
5853 "Clear peers with the AS number\n"
5855 "Address Family modifier\n"
5856 "Address Family modifier\n"
5858 "Soft reconfig inbound update\n")
5860 if (strncmp (argv
[1], "m", 1) == 0)
5861 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5862 BGP_CLEAR_SOFT_IN
, argv
[0]);
5864 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5865 BGP_CLEAR_SOFT_IN
, argv
[0]);
5868 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
5869 clear_ip_bgp_as_ipv4_in_cmd
,
5870 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in",
5874 "Clear peers with the AS number\n"
5876 "Address Family modifier\n"
5877 "Address Family modifier\n"
5878 "Soft reconfig inbound update\n")
5880 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
5881 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
5882 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in prefix-filter",
5886 "Clear peers with the AS number\n"
5888 "Address Family modifier\n"
5889 "Address Family modifier\n"
5890 "Soft reconfig inbound update\n"
5891 "Push out prefix-list ORF and do inbound soft reconfig\n")
5893 if (strncmp (argv
[1], "m", 1) == 0)
5894 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5895 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5897 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5898 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5901 DEFUN (clear_ip_bgp_as_vpnv4_soft_in
,
5902 clear_ip_bgp_as_vpnv4_soft_in_cmd
,
5903 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft in",
5907 "Clear peers with the AS number\n"
5909 "Address Family modifier\n"
5911 "Soft reconfig inbound update\n")
5913 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
5914 BGP_CLEAR_SOFT_IN
, argv
[0]);
5917 ALIAS (clear_ip_bgp_as_vpnv4_soft_in
,
5918 clear_ip_bgp_as_vpnv4_in_cmd
,
5919 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast in",
5923 "Clear peers with the AS number\n"
5925 "Address Family modifier\n"
5926 "Soft reconfig inbound update\n")
5928 DEFUN (clear_bgp_as_soft_in
,
5929 clear_bgp_as_soft_in_cmd
,
5930 "clear bgp " CMD_AS_RANGE
" soft in",
5933 "Clear peers with the AS number\n"
5935 "Soft reconfig inbound update\n")
5937 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5938 BGP_CLEAR_SOFT_IN
, argv
[0]);
5941 ALIAS (clear_bgp_as_soft_in
,
5942 clear_bgp_ipv6_as_soft_in_cmd
,
5943 "clear bgp ipv6 " CMD_AS_RANGE
" soft in",
5947 "Clear peers with the AS number\n"
5949 "Soft reconfig inbound update\n")
5951 ALIAS (clear_bgp_as_soft_in
,
5952 clear_bgp_as_in_cmd
,
5953 "clear bgp " CMD_AS_RANGE
" in",
5956 "Clear peers with the AS number\n"
5957 "Soft reconfig inbound update\n")
5959 ALIAS (clear_bgp_as_soft_in
,
5960 clear_bgp_ipv6_as_in_cmd
,
5961 "clear bgp ipv6 " CMD_AS_RANGE
" in",
5965 "Clear peers with the AS number\n"
5966 "Soft reconfig inbound update\n")
5968 DEFUN (clear_bgp_as_in_prefix_filter
,
5969 clear_bgp_as_in_prefix_filter_cmd
,
5970 "clear bgp " CMD_AS_RANGE
" in prefix-filter",
5973 "Clear peers with the AS number\n"
5974 "Soft reconfig inbound update\n"
5975 "Push out prefix-list ORF and do inbound soft reconfig\n")
5977 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5978 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5981 ALIAS (clear_bgp_as_in_prefix_filter
,
5982 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
5983 "clear bgp ipv6 " CMD_AS_RANGE
" in prefix-filter",
5987 "Clear peers with the AS number\n"
5988 "Soft reconfig inbound update\n"
5989 "Push out prefix-list ORF and do inbound soft reconfig\n")
5991 /* Both soft-reconfiguration */
5992 DEFUN (clear_ip_bgp_all_soft
,
5993 clear_ip_bgp_all_soft_cmd
,
5994 "clear ip bgp * soft",
6002 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6003 BGP_CLEAR_SOFT_BOTH
, NULL
);
6005 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6006 BGP_CLEAR_SOFT_BOTH
, NULL
);
6009 ALIAS (clear_ip_bgp_all_soft
,
6010 clear_ip_bgp_instance_all_soft_cmd
,
6011 "clear ip bgp view WORD * soft",
6021 DEFUN (clear_ip_bgp_all_ipv4_soft
,
6022 clear_ip_bgp_all_ipv4_soft_cmd
,
6023 "clear ip bgp * ipv4 (unicast|multicast) soft",
6029 "Address Family Modifier\n"
6030 "Address Family Modifier\n"
6033 if (strncmp (argv
[0], "m", 1) == 0)
6034 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6035 BGP_CLEAR_SOFT_BOTH
, NULL
);
6037 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6038 BGP_CLEAR_SOFT_BOTH
, NULL
);
6041 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
6042 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
6043 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft",
6051 "Address Family Modifier\n"
6052 "Address Family Modifier\n"
6055 if (strncmp (argv
[1], "m", 1) == 0)
6056 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6057 BGP_CLEAR_SOFT_BOTH
, NULL
);
6059 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6060 BGP_CLEAR_SOFT_BOTH
, NULL
);
6063 DEFUN (clear_ip_bgp_all_vpnv4_soft
,
6064 clear_ip_bgp_all_vpnv4_soft_cmd
,
6065 "clear ip bgp * vpnv4 unicast soft",
6071 "Address Family Modifier\n"
6074 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
6075 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6078 DEFUN (clear_bgp_all_soft
,
6079 clear_bgp_all_soft_cmd
,
6087 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6088 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6090 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6091 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6094 ALIAS (clear_bgp_all_soft
,
6095 clear_bgp_instance_all_soft_cmd
,
6096 "clear bgp view WORD * soft",
6104 ALIAS (clear_bgp_all_soft
,
6105 clear_bgp_ipv6_all_soft_cmd
,
6106 "clear bgp ipv6 * soft",
6113 DEFUN (clear_ip_bgp_peer_soft
,
6114 clear_ip_bgp_peer_soft_cmd
,
6115 "clear ip bgp A.B.C.D soft",
6119 "BGP neighbor address to clear\n"
6122 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6123 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6126 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
6127 clear_ip_bgp_peer_ipv4_soft_cmd
,
6128 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft",
6132 "BGP neighbor address to clear\n"
6134 "Address Family Modifier\n"
6135 "Address Family Modifier\n"
6138 if (strncmp (argv
[1], "m", 1) == 0)
6139 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
6140 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6142 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6143 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6146 DEFUN (clear_ip_bgp_peer_vpnv4_soft
,
6147 clear_ip_bgp_peer_vpnv4_soft_cmd
,
6148 "clear ip bgp A.B.C.D vpnv4 unicast soft",
6152 "BGP neighbor address to clear\n"
6154 "Address Family Modifier\n"
6157 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
6158 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6161 DEFUN (clear_bgp_peer_soft
,
6162 clear_bgp_peer_soft_cmd
,
6163 "clear bgp (A.B.C.D|X:X::X:X) soft",
6166 "BGP neighbor address to clear\n"
6167 "BGP IPv6 neighbor to clear\n"
6170 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6171 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6174 ALIAS (clear_bgp_peer_soft
,
6175 clear_bgp_ipv6_peer_soft_cmd
,
6176 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft",
6180 "BGP neighbor address to clear\n"
6181 "BGP IPv6 neighbor to clear\n"
6184 DEFUN (clear_ip_bgp_peer_group_soft
,
6185 clear_ip_bgp_peer_group_soft_cmd
,
6186 "clear ip bgp peer-group WORD soft",
6190 "Clear all members of peer-group\n"
6191 "BGP peer-group name\n"
6194 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6195 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6198 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
6199 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
6200 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
6204 "Clear all members of peer-group\n"
6205 "BGP peer-group name\n"
6207 "Address Family modifier\n"
6208 "Address Family modifier\n"
6211 if (strncmp (argv
[1], "m", 1) == 0)
6212 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
6213 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6215 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6216 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6219 DEFUN (clear_bgp_peer_group_soft
,
6220 clear_bgp_peer_group_soft_cmd
,
6221 "clear bgp peer-group WORD soft",
6224 "Clear all members of peer-group\n"
6225 "BGP peer-group name\n"
6228 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
6229 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6232 ALIAS (clear_bgp_peer_group_soft
,
6233 clear_bgp_ipv6_peer_group_soft_cmd
,
6234 "clear bgp ipv6 peer-group WORD soft",
6238 "Clear all members of peer-group\n"
6239 "BGP peer-group name\n"
6242 DEFUN (clear_ip_bgp_external_soft
,
6243 clear_ip_bgp_external_soft_cmd
,
6244 "clear ip bgp external soft",
6248 "Clear all external peers\n"
6251 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6252 BGP_CLEAR_SOFT_BOTH
, NULL
);
6255 DEFUN (clear_ip_bgp_external_ipv4_soft
,
6256 clear_ip_bgp_external_ipv4_soft_cmd
,
6257 "clear ip bgp external ipv4 (unicast|multicast) soft",
6261 "Clear all external peers\n"
6263 "Address Family modifier\n"
6264 "Address Family modifier\n"
6267 if (strncmp (argv
[0], "m", 1) == 0)
6268 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
6269 BGP_CLEAR_SOFT_BOTH
, NULL
);
6271 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6272 BGP_CLEAR_SOFT_BOTH
, NULL
);
6275 DEFUN (clear_bgp_external_soft
,
6276 clear_bgp_external_soft_cmd
,
6277 "clear bgp external soft",
6280 "Clear all external peers\n"
6283 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6284 BGP_CLEAR_SOFT_BOTH
, NULL
);
6287 ALIAS (clear_bgp_external_soft
,
6288 clear_bgp_ipv6_external_soft_cmd
,
6289 "clear bgp ipv6 external soft",
6293 "Clear all external peers\n"
6296 DEFUN (clear_ip_bgp_as_soft
,
6297 clear_ip_bgp_as_soft_cmd
,
6298 "clear ip bgp " CMD_AS_RANGE
" soft",
6302 "Clear peers with the AS number\n"
6305 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6306 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6309 DEFUN (clear_ip_bgp_as_ipv4_soft
,
6310 clear_ip_bgp_as_ipv4_soft_cmd
,
6311 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft",
6315 "Clear peers with the AS number\n"
6317 "Address Family Modifier\n"
6318 "Address Family Modifier\n"
6321 if (strncmp (argv
[1], "m", 1) == 0)
6322 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
6323 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6325 return bgp_clear_vty (vty
, NULL
,AFI_IP
, SAFI_UNICAST
, clear_as
,
6326 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6329 DEFUN (clear_ip_bgp_as_vpnv4_soft
,
6330 clear_ip_bgp_as_vpnv4_soft_cmd
,
6331 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft",
6335 "Clear peers with the AS number\n"
6337 "Address Family Modifier\n"
6340 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
6341 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6344 DEFUN (clear_bgp_as_soft
,
6345 clear_bgp_as_soft_cmd
,
6346 "clear bgp " CMD_AS_RANGE
" soft",
6349 "Clear peers with the AS number\n"
6352 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
6353 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6356 ALIAS (clear_bgp_as_soft
,
6357 clear_bgp_ipv6_as_soft_cmd
,
6358 "clear bgp ipv6 " CMD_AS_RANGE
" soft",
6362 "Clear peers with the AS number\n"
6365 /* RS-client soft reconfiguration. */
6367 DEFUN (clear_bgp_all_rsclient
,
6368 clear_bgp_all_rsclient_cmd
,
6369 "clear bgp * rsclient",
6373 "Soft reconfig for rsclient RIB\n")
6376 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6377 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6379 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6380 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6383 ALIAS (clear_bgp_all_rsclient
,
6384 clear_bgp_ipv6_all_rsclient_cmd
,
6385 "clear bgp ipv6 * rsclient",
6390 "Soft reconfig for rsclient RIB\n")
6392 ALIAS (clear_bgp_all_rsclient
,
6393 clear_bgp_instance_all_rsclient_cmd
,
6394 "clear bgp view WORD * rsclient",
6400 "Soft reconfig for rsclient RIB\n")
6402 ALIAS (clear_bgp_all_rsclient
,
6403 clear_bgp_ipv6_instance_all_rsclient_cmd
,
6404 "clear bgp ipv6 view WORD * rsclient",
6411 "Soft reconfig for rsclient RIB\n")
6412 #endif /* HAVE_IPV6 */
6414 DEFUN (clear_ip_bgp_all_rsclient
,
6415 clear_ip_bgp_all_rsclient_cmd
,
6416 "clear ip bgp * rsclient",
6421 "Soft reconfig for rsclient RIB\n")
6424 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6425 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6427 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6428 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6431 ALIAS (clear_ip_bgp_all_rsclient
,
6432 clear_ip_bgp_instance_all_rsclient_cmd
,
6433 "clear ip bgp view WORD * rsclient",
6440 "Soft reconfig for rsclient RIB\n")
6443 DEFUN (clear_bgp_peer_rsclient
,
6444 clear_bgp_peer_rsclient_cmd
,
6445 "clear bgp (A.B.C.D|X:X::X:X) rsclient",
6448 "BGP neighbor IP address to clear\n"
6449 "BGP IPv6 neighbor to clear\n"
6450 "Soft reconfig for rsclient RIB\n")
6453 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6454 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6456 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6457 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6460 ALIAS (clear_bgp_peer_rsclient
,
6461 clear_bgp_ipv6_peer_rsclient_cmd
,
6462 "clear bgp ipv6 (A.B.C.D|X:X::X:X) rsclient",
6466 "BGP neighbor IP address to clear\n"
6467 "BGP IPv6 neighbor to clear\n"
6468 "Soft reconfig for rsclient RIB\n")
6470 ALIAS (clear_bgp_peer_rsclient
,
6471 clear_bgp_instance_peer_rsclient_cmd
,
6472 "clear bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6477 "BGP neighbor IP address to clear\n"
6478 "BGP IPv6 neighbor to clear\n"
6479 "Soft reconfig for rsclient RIB\n")
6481 ALIAS (clear_bgp_peer_rsclient
,
6482 clear_bgp_ipv6_instance_peer_rsclient_cmd
,
6483 "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X) rsclient",
6489 "BGP neighbor IP address to clear\n"
6490 "BGP IPv6 neighbor to clear\n"
6491 "Soft reconfig for rsclient RIB\n")
6492 #endif /* HAVE_IPV6 */
6494 DEFUN (clear_ip_bgp_peer_rsclient
,
6495 clear_ip_bgp_peer_rsclient_cmd
,
6496 "clear ip bgp (A.B.C.D|X:X::X:X) rsclient",
6500 "BGP neighbor IP address to clear\n"
6501 "BGP IPv6 neighbor to clear\n"
6502 "Soft reconfig for rsclient RIB\n")
6505 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_peer
,
6506 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6508 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6509 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6512 ALIAS (clear_ip_bgp_peer_rsclient
,
6513 clear_ip_bgp_instance_peer_rsclient_cmd
,
6514 "clear ip bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6520 "BGP neighbor IP address to clear\n"
6521 "BGP IPv6 neighbor to clear\n"
6522 "Soft reconfig for rsclient RIB\n")
6524 DEFUN (show_bgp_views
,
6529 "Show the defined BGP views\n")
6531 struct list
*inst
= bm
->bgp
;
6532 struct listnode
*node
;
6535 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE
))
6537 vty_out (vty
, "Multiple BGP views are not defined%s", VTY_NEWLINE
);
6541 vty_out (vty
, "Defined BGP views:%s", VTY_NEWLINE
);
6542 for (ALL_LIST_ELEMENTS_RO(inst
, node
, bgp
))
6543 vty_out (vty
, "\t%s (AS%u)%s",
6544 bgp
->name
? bgp
->name
: "(null)",
6545 bgp
->as
, VTY_NEWLINE
);
6550 DEFUN (show_bgp_memory
,
6551 show_bgp_memory_cmd
,
6555 "Global BGP memory statistics\n")
6557 char memstrbuf
[MTYPE_MEMSTR_LEN
];
6558 unsigned long count
;
6560 /* RIB related usage stats */
6561 count
= mtype_stats_alloc (MTYPE_BGP_NODE
);
6562 vty_out (vty
, "%ld RIB nodes, using %s of memory%s", count
,
6563 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6564 count
* sizeof (struct bgp_node
)),
6567 count
= mtype_stats_alloc (MTYPE_BGP_ROUTE
);
6568 vty_out (vty
, "%ld BGP routes, using %s of memory%s", count
,
6569 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6570 count
* sizeof (struct bgp_info
)),
6572 if ((count
= mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA
)))
6573 vty_out (vty
, "%ld BGP route ancillaries, using %s of memory%s", count
,
6574 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6575 count
* sizeof (struct bgp_info_extra
)),
6578 if ((count
= mtype_stats_alloc (MTYPE_BGP_STATIC
)))
6579 vty_out (vty
, "%ld Static routes, using %s of memory%s", count
,
6580 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6581 count
* sizeof (struct bgp_static
)),
6585 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_IN
)))
6586 vty_out (vty
, "%ld Adj-In entries, using %s of memory%s", count
,
6587 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6588 count
* sizeof (struct bgp_adj_in
)),
6590 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_OUT
)))
6591 vty_out (vty
, "%ld Adj-Out entries, using %s of memory%s", count
,
6592 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6593 count
* sizeof (struct bgp_adj_out
)),
6596 if ((count
= mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE
)))
6597 vty_out (vty
, "%ld Nexthop cache entries, using %s of memory%s", count
,
6598 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6599 count
* sizeof (struct bgp_nexthop_cache
)),
6602 if ((count
= mtype_stats_alloc (MTYPE_BGP_DAMP_INFO
)))
6603 vty_out (vty
, "%ld Dampening entries, using %s of memory%s", count
,
6604 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6605 count
* sizeof (struct bgp_damp_info
)),
6609 count
= attr_count();
6610 vty_out (vty
, "%ld BGP attributes, using %s of memory%s", count
,
6611 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6612 count
* sizeof(struct attr
)),
6614 if ((count
= mtype_stats_alloc (MTYPE_ATTR_EXTRA
)))
6615 vty_out (vty
, "%ld BGP extra attributes, using %s of memory%s", count
,
6616 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6617 count
* sizeof(struct attr_extra
)),
6620 if ((count
= attr_unknown_count()))
6621 vty_out (vty
, "%ld unknown attributes%s", count
, VTY_NEWLINE
);
6623 /* AS_PATH attributes */
6624 count
= aspath_count ();
6625 vty_out (vty
, "%ld BGP AS-PATH entries, using %s of memory%s", count
,
6626 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6627 count
* sizeof (struct aspath
)),
6630 count
= mtype_stats_alloc (MTYPE_AS_SEG
);
6631 vty_out (vty
, "%ld BGP AS-PATH segments, using %s of memory%s", count
,
6632 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6633 count
* sizeof (struct assegment
)),
6636 /* Other attributes */
6637 if ((count
= community_count ()))
6638 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
6639 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6640 count
* sizeof (struct community
)),
6642 if ((count
= mtype_stats_alloc (MTYPE_ECOMMUNITY
)))
6643 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
6644 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6645 count
* sizeof (struct ecommunity
)),
6648 if ((count
= mtype_stats_alloc (MTYPE_CLUSTER
)))
6649 vty_out (vty
, "%ld Cluster lists, using %s of memory%s", count
,
6650 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6651 count
* sizeof (struct cluster_list
)),
6654 /* Peer related usage */
6655 count
= mtype_stats_alloc (MTYPE_BGP_PEER
);
6656 vty_out (vty
, "%ld peers, using %s of memory%s", count
,
6657 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6658 count
* sizeof (struct peer
)),
6661 if ((count
= mtype_stats_alloc (MTYPE_PEER_GROUP
)))
6662 vty_out (vty
, "%ld peer groups, using %s of memory%s", count
,
6663 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6664 count
* sizeof (struct peer_group
)),
6668 if ((count
= mtype_stats_alloc (MTYPE_HASH
)))
6669 vty_out (vty
, "%ld hash tables, using %s of memory%s", count
,
6670 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6671 count
* sizeof (struct hash
)),
6673 if ((count
= mtype_stats_alloc (MTYPE_HASH_BACKET
)))
6674 vty_out (vty
, "%ld hash buckets, using %s of memory%s", count
,
6675 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6676 count
* sizeof (struct hash_backet
)),
6678 if ((count
= mtype_stats_alloc (MTYPE_BGP_REGEXP
)))
6679 vty_out (vty
, "%ld compiled regexes, using %s of memory%s", count
,
6680 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6681 count
* sizeof (regex_t
)),
6686 /* Show BGP peer's summary information. */
6688 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
)
6691 struct listnode
*node
, *nnode
;
6692 unsigned int count
= 0;
6693 char timebuf
[BGP_UPTIME_LEN
];
6696 /* Header string for each address family. */
6697 static char header
[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
6699 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
6701 if (peer
->afc
[afi
][safi
])
6706 char memstrbuf
[MTYPE_MEMSTR_LEN
];
6708 /* Usage summary and header */
6710 "BGP router identifier %s, local AS number %u%s",
6711 inet_ntoa (bgp
->router_id
), bgp
->as
, VTY_NEWLINE
);
6713 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
6714 vty_out (vty
, "RIB entries %ld, using %s of memory%s", ents
,
6715 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6716 ents
* sizeof (struct bgp_node
)),
6719 /* Peer related usage */
6720 ents
= listcount (bgp
->peer
);
6721 vty_out (vty
, "Peers %ld, using %s of memory%s",
6723 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6724 ents
* sizeof (struct peer
)),
6727 if ((ents
= listcount (bgp
->rsclient
)))
6728 vty_out (vty
, "RS-Client peers %ld, using %s of memory%s",
6730 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6731 ents
* sizeof (struct peer
)),
6734 if ((ents
= listcount (bgp
->group
)))
6735 vty_out (vty
, "Peer groups %ld, using %s of memory%s", ents
,
6736 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6737 ents
* sizeof (struct peer_group
)),
6740 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
6741 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
6742 vty_out (vty
, "%s", VTY_NEWLINE
);
6743 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
6748 len
= vty_out (vty
, "%s", peer
->host
);
6751 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
6753 vty_out (vty
, "%*s", len
, " ");
6755 vty_out (vty
, "4 ");
6757 vty_out (vty
, "%5u %7d %7d %8d %4d %4lu ",
6759 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
6760 + peer
->notify_in
+ peer
->refresh_in
+ peer
->dynamic_cap_in
,
6761 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
6762 + peer
->notify_out
+ peer
->refresh_out
6763 + peer
->dynamic_cap_out
,
6764 0, 0, (unsigned long) peer
->obuf
->count
);
6766 vty_out (vty
, "%8s",
6767 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
));
6769 if (peer
->status
== Established
)
6771 vty_out (vty
, " %8ld", peer
->pcount
[afi
][safi
]);
6775 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
6776 vty_out (vty
, " Idle (Admin)");
6777 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
6778 vty_out (vty
, " Idle (PfxCt)");
6780 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, peer
->status
));
6783 vty_out (vty
, "%s", VTY_NEWLINE
);
6788 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
6789 count
, VTY_NEWLINE
);
6791 vty_out (vty
, "No %s neighbor is configured%s",
6792 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
6797 bgp_show_summary_vty (struct vty
*vty
, const char *name
,
6798 afi_t afi
, safi_t safi
)
6804 bgp
= bgp_lookup_by_name (name
);
6808 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
6812 bgp_show_summary (vty
, bgp
, afi
, safi
);
6816 bgp
= bgp_get_default ();
6819 bgp_show_summary (vty
, bgp
, afi
, safi
);
6824 /* `show ip bgp summary' commands. */
6825 DEFUN (show_ip_bgp_summary
,
6826 show_ip_bgp_summary_cmd
,
6827 "show ip bgp summary",
6831 "Summary of BGP neighbor status\n")
6833 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6836 DEFUN (show_ip_bgp_instance_summary
,
6837 show_ip_bgp_instance_summary_cmd
,
6838 "show ip bgp view WORD summary",
6844 "Summary of BGP neighbor status\n")
6846 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6849 DEFUN (show_ip_bgp_ipv4_summary
,
6850 show_ip_bgp_ipv4_summary_cmd
,
6851 "show ip bgp ipv4 (unicast|multicast) summary",
6856 "Address Family modifier\n"
6857 "Address Family modifier\n"
6858 "Summary of BGP neighbor status\n")
6860 if (strncmp (argv
[0], "m", 1) == 0)
6861 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
6863 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6866 DEFUN (show_ip_bgp_instance_ipv4_summary
,
6867 show_ip_bgp_instance_ipv4_summary_cmd
,
6868 "show ip bgp view WORD ipv4 (unicast|multicast) summary",
6875 "Address Family modifier\n"
6876 "Address Family modifier\n"
6877 "Summary of BGP neighbor status\n")
6879 if (strncmp (argv
[1], "m", 1) == 0)
6880 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
6882 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6885 DEFUN (show_ip_bgp_vpnv4_all_summary
,
6886 show_ip_bgp_vpnv4_all_summary_cmd
,
6887 "show ip bgp vpnv4 all summary",
6891 "Display VPNv4 NLRI specific information\n"
6892 "Display information about all VPNv4 NLRIs\n"
6893 "Summary of BGP neighbor status\n")
6895 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6898 DEFUN (show_ip_bgp_vpnv4_rd_summary
,
6899 show_ip_bgp_vpnv4_rd_summary_cmd
,
6900 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary",
6904 "Display VPNv4 NLRI specific information\n"
6905 "Display information for a route distinguisher\n"
6906 "VPN Route Distinguisher\n"
6907 "Summary of BGP neighbor status\n")
6910 struct prefix_rd prd
;
6912 ret
= str2prefix_rd (argv
[0], &prd
);
6915 vty_out (vty
, "%% Malformed Route Distinguisher%s", VTY_NEWLINE
);
6919 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6923 DEFUN (show_bgp_summary
,
6924 show_bgp_summary_cmd
,
6928 "Summary of BGP neighbor status\n")
6930 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6933 DEFUN (show_bgp_instance_summary
,
6934 show_bgp_instance_summary_cmd
,
6935 "show bgp view WORD summary",
6940 "Summary of BGP neighbor status\n")
6942 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
6945 ALIAS (show_bgp_summary
,
6946 show_bgp_ipv6_summary_cmd
,
6947 "show bgp ipv6 summary",
6951 "Summary of BGP neighbor status\n")
6953 ALIAS (show_bgp_instance_summary
,
6954 show_bgp_instance_ipv6_summary_cmd
,
6955 "show bgp view WORD ipv6 summary",
6961 "Summary of BGP neighbor status\n")
6964 DEFUN (show_ipv6_bgp_summary
,
6965 show_ipv6_bgp_summary_cmd
,
6966 "show ipv6 bgp summary",
6970 "Summary of BGP neighbor status\n")
6972 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6976 DEFUN (show_ipv6_mbgp_summary
,
6977 show_ipv6_mbgp_summary_cmd
,
6978 "show ipv6 mbgp summary",
6982 "Summary of BGP neighbor status\n")
6984 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
);
6986 #endif /* HAVE_IPV6 */
6989 afi_safi_print (afi_t afi
, safi_t safi
)
6991 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
6992 return "IPv4 Unicast";
6993 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
6994 return "IPv4 Multicast";
6995 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
6996 return "VPNv4 Unicast";
6997 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
6998 return "IPv6 Unicast";
6999 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
7000 return "IPv6 Multicast";
7005 /* Show BGP peer's information. */
7013 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
,
7014 afi_t afi
, safi_t safi
,
7015 u_int16_t adv_smcap
, u_int16_t adv_rmcap
,
7016 u_int16_t rcv_smcap
, u_int16_t rcv_rmcap
)
7019 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
7020 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
7022 vty_out (vty
, " Send-mode: ");
7023 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
7024 vty_out (vty
, "advertised");
7025 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
7026 vty_out (vty
, "%sreceived",
7027 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
7029 vty_out (vty
, "%s", VTY_NEWLINE
);
7033 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
7034 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
7036 vty_out (vty
, " Receive-mode: ");
7037 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
7038 vty_out (vty
, "advertised");
7039 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
7040 vty_out (vty
, "%sreceived",
7041 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
7043 vty_out (vty
, "%s", VTY_NEWLINE
);
7048 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
)
7050 struct bgp_filter
*filter
;
7051 char orf_pfx_name
[BUFSIZ
];
7054 filter
= &p
->filter
[afi
][safi
];
7056 vty_out (vty
, " For address family: %s%s", afi_safi_print (afi
, safi
),
7059 if (p
->af_group
[afi
][safi
])
7060 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
7062 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7063 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
7064 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
7065 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7066 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
7067 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
7068 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
7070 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7071 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
7072 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7073 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
7075 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
7076 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
7077 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
7078 PEER_CAP_ORF_PREFIX_SM_ADV
,
7079 PEER_CAP_ORF_PREFIX_RM_ADV
,
7080 PEER_CAP_ORF_PREFIX_SM_RCV
,
7081 PEER_CAP_ORF_PREFIX_RM_RCV
);
7083 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7084 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
7085 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7086 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
7088 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
7089 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
7090 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
7091 PEER_CAP_ORF_PREFIX_SM_ADV
,
7092 PEER_CAP_ORF_PREFIX_RM_ADV
,
7093 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
7094 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
);
7097 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
7098 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
);
7100 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
7103 vty_out (vty
, " Outbound Route Filter (ORF):");
7104 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
7105 vty_out (vty
, " sent;");
7107 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
7108 vty_out (vty
, "%s", VTY_NEWLINE
);
7110 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
7111 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
7113 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
7114 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
7115 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
7116 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
7117 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
7118 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
7119 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
7120 vty_out (vty
, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE
);
7121 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
))
7122 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
7123 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
7124 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7125 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
7126 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7127 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
7128 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7129 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
7130 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7132 vty_out (vty
, " Community attribute sent to this neighbor");
7133 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
7134 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7135 vty_out (vty
, "(both)%s", VTY_NEWLINE
);
7136 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7137 vty_out (vty
, "(extended)%s", VTY_NEWLINE
);
7139 vty_out (vty
, "(standard)%s", VTY_NEWLINE
);
7141 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
7143 vty_out (vty
, " Default information originate,");
7145 if (p
->default_rmap
[afi
][safi
].name
)
7146 vty_out (vty
, " default route-map %s%s,",
7147 p
->default_rmap
[afi
][safi
].map
? "*" : "",
7148 p
->default_rmap
[afi
][safi
].name
);
7149 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_DEFAULT_ORIGINATE
))
7150 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
7152 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
7155 if (filter
->plist
[FILTER_IN
].name
7156 || filter
->dlist
[FILTER_IN
].name
7157 || filter
->aslist
[FILTER_IN
].name
7158 || filter
->map
[RMAP_IN
].name
)
7159 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
7160 if (filter
->plist
[FILTER_OUT
].name
7161 || filter
->dlist
[FILTER_OUT
].name
7162 || filter
->aslist
[FILTER_OUT
].name
7163 || filter
->map
[RMAP_OUT
].name
7164 || filter
->usmap
.name
)
7165 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
7166 if (filter
->map
[RMAP_IMPORT
].name
)
7167 vty_out (vty
, " Import policy for this RS-client configured%s", VTY_NEWLINE
);
7168 if (filter
->map
[RMAP_EXPORT
].name
)
7169 vty_out (vty
, " Export policy for this RS-client configured%s", VTY_NEWLINE
);
7172 if (filter
->plist
[FILTER_IN
].name
)
7173 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
7174 filter
->plist
[FILTER_IN
].plist
? "*" : "",
7175 filter
->plist
[FILTER_IN
].name
,
7177 if (filter
->plist
[FILTER_OUT
].name
)
7178 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
7179 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
7180 filter
->plist
[FILTER_OUT
].name
,
7183 /* distribute-list */
7184 if (filter
->dlist
[FILTER_IN
].name
)
7185 vty_out (vty
, " Incoming update network filter list is %s%s%s",
7186 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
7187 filter
->dlist
[FILTER_IN
].name
,
7189 if (filter
->dlist
[FILTER_OUT
].name
)
7190 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
7191 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
7192 filter
->dlist
[FILTER_OUT
].name
,
7196 if (filter
->aslist
[FILTER_IN
].name
)
7197 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
7198 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
7199 filter
->aslist
[FILTER_IN
].name
,
7201 if (filter
->aslist
[FILTER_OUT
].name
)
7202 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
7203 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
7204 filter
->aslist
[FILTER_OUT
].name
,
7208 if (filter
->map
[RMAP_IN
].name
)
7209 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
7210 filter
->map
[RMAP_IN
].map
? "*" : "",
7211 filter
->map
[RMAP_IN
].name
,
7213 if (filter
->map
[RMAP_OUT
].name
)
7214 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
7215 filter
->map
[RMAP_OUT
].map
? "*" : "",
7216 filter
->map
[RMAP_OUT
].name
,
7218 if (filter
->map
[RMAP_IMPORT
].name
)
7219 vty_out (vty
, " Route map for advertisements going into this RS-client's table is %s%s%s",
7220 filter
->map
[RMAP_IMPORT
].map
? "*" : "",
7221 filter
->map
[RMAP_IMPORT
].name
,
7223 if (filter
->map
[RMAP_EXPORT
].name
)
7224 vty_out (vty
, " Route map for advertisements coming from this RS-client is %s%s%s",
7225 filter
->map
[RMAP_EXPORT
].map
? "*" : "",
7226 filter
->map
[RMAP_EXPORT
].name
,
7229 /* unsuppress-map */
7230 if (filter
->usmap
.name
)
7231 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
7232 filter
->usmap
.map
? "*" : "",
7233 filter
->usmap
.name
, VTY_NEWLINE
);
7235 /* Receive prefix count */
7236 vty_out (vty
, " %ld accepted prefixes%s", p
->pcount
[afi
][safi
], VTY_NEWLINE
);
7238 /* Maximum prefix */
7239 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
7241 vty_out (vty
, " Maximum prefixes allowed %ld%s%s", p
->pmax
[afi
][safi
],
7242 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
7243 ? " (warning-only)" : "", VTY_NEWLINE
);
7244 vty_out (vty
, " Threshold for warning message %d%%",
7245 p
->pmax_threshold
[afi
][safi
]);
7246 if (p
->pmax_restart
[afi
][safi
])
7247 vty_out (vty
, ", restart interval %d min", p
->pmax_restart
[afi
][safi
]);
7248 vty_out (vty
, "%s", VTY_NEWLINE
);
7251 vty_out (vty
, "%s", VTY_NEWLINE
);
7255 bgp_show_peer (struct vty
*vty
, struct peer
*p
)
7259 char timebuf
[BGP_UPTIME_LEN
];
7265 /* Configured IP address. */
7266 vty_out (vty
, "BGP neighbor is %s, ", p
->host
);
7267 vty_out (vty
, "remote AS %u, ", p
->as
);
7268 vty_out (vty
, "local AS %u%s, ",
7269 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
7270 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
7271 " no-prepend" : "");
7272 vty_out (vty
, "%s link%s",
7273 p
->as
== p
->local_as
? "internal" : "external",
7278 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
7282 vty_out (vty
, " Member of peer-group %s for session parameters%s",
7283 p
->group
->name
, VTY_NEWLINE
);
7285 /* Administrative shutdown. */
7286 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
7287 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
7290 vty_out (vty
, " BGP version 4");
7291 vty_out (vty
, ", remote router ID %s%s",
7292 inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
7296 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
)
7297 && bgp_confederation_peers_check (bgp
, p
->as
))
7298 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
7301 vty_out (vty
, " BGP state = %s",
7302 LOOKUP (bgp_status_msg
, p
->status
));
7303 if (p
->status
== Established
)
7304 vty_out (vty
, ", up for %8s",
7305 peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
));
7306 else if (p
->status
== Active
)
7308 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
7309 vty_out (vty
, " (passive)");
7310 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
7311 vty_out (vty
, " (NSF passive)");
7313 vty_out (vty
, "%s", VTY_NEWLINE
);
7316 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
));
7318 /* Configured timer values. */
7319 vty_out (vty
, ", hold time is %d, keepalive interval is %d seconds%s",
7320 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
7321 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
7323 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
7324 vty_out (vty
, ", keepalive interval is %d seconds%s",
7325 p
->keepalive
, VTY_NEWLINE
);
7329 if (p
->status
== Established
)
7332 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
7333 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
7334 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
7335 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
7337 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
7338 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
7339 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
7340 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
7341 #endif /* HAVE_IPV6 */
7342 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
7343 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
7345 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
7348 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
)
7349 || CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
7351 vty_out (vty
, " 4 Byte AS:");
7352 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
7353 vty_out (vty
, " advertised");
7354 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
7355 vty_out (vty
, " %sreceived",
7356 CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
) ? "and " : "");
7357 vty_out (vty
, "%s", VTY_NEWLINE
);
7360 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
7361 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
7363 vty_out (vty
, " Dynamic:");
7364 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
7365 vty_out (vty
, " advertised");
7366 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
7367 vty_out (vty
, " %sreceived",
7368 CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) ? "and " : "");
7369 vty_out (vty
, "%s", VTY_NEWLINE
);
7373 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
7374 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
7375 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
7377 vty_out (vty
, " Route refresh:");
7378 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
7379 vty_out (vty
, " advertised");
7380 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
7381 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
7382 vty_out (vty
, " %sreceived(%s)",
7383 CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) ? "and " : "",
7384 (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
7385 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)) ?
7386 "old & new" : CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) ? "old" : "new");
7388 vty_out (vty
, "%s", VTY_NEWLINE
);
7391 /* Multiprotocol Extensions */
7392 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7393 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7394 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
7396 vty_out (vty
, " Address family %s:", afi_safi_print (afi
, safi
));
7397 if (p
->afc_adv
[afi
][safi
])
7398 vty_out (vty
, " advertised");
7399 if (p
->afc_recv
[afi
][safi
])
7400 vty_out (vty
, " %sreceived", p
->afc_adv
[afi
][safi
] ? "and " : "");
7401 vty_out (vty
, "%s", VTY_NEWLINE
);
7404 /* Gracefull Restart */
7405 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7406 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7408 vty_out (vty
, " Graceful Restart Capabilty:");
7409 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7410 vty_out (vty
, " advertised");
7411 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7412 vty_out (vty
, " %sreceived",
7413 CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) ? "and " : "");
7414 vty_out (vty
, "%s", VTY_NEWLINE
);
7416 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7418 int restart_af_count
= 0;
7420 vty_out (vty
, " Remote Restart timer is %d seconds%s",
7421 p
->v_gr_restart
, VTY_NEWLINE
);
7422 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
7424 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7425 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7426 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
7428 vty_out (vty
, "%s%s(%s)", restart_af_count
? ", " : "",
7429 afi_safi_print (afi
, safi
),
7430 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
) ?
7431 "preserved" : "not preserved");
7434 if (! restart_af_count
)
7435 vty_out (vty
, "none");
7436 vty_out (vty
, "%s", VTY_NEWLINE
);
7442 /* graceful restart information */
7443 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7447 int eor_send_af_count
= 0;
7448 int eor_receive_af_count
= 0;
7450 vty_out (vty
, " Graceful restart informations:%s", VTY_NEWLINE
);
7451 if (p
->status
== Established
)
7453 vty_out (vty
, " End-of-RIB send: ");
7454 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7455 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7456 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
7458 vty_out (vty
, "%s%s", eor_send_af_count
? ", " : "",
7459 afi_safi_print (afi
, safi
));
7460 eor_send_af_count
++;
7462 vty_out (vty
, "%s", VTY_NEWLINE
);
7464 vty_out (vty
, " End-of-RIB received: ");
7465 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7466 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7467 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
7469 vty_out (vty
, "%s%s", eor_receive_af_count
? ", " : "",
7470 afi_safi_print (afi
, safi
));
7471 eor_receive_af_count
++;
7473 vty_out (vty
, "%s", VTY_NEWLINE
);
7476 if (p
->t_gr_restart
)
7477 vty_out (vty
, " The remaining time of restart timer is %ld%s",
7478 thread_timer_remain_second (p
->t_gr_restart
), VTY_NEWLINE
);
7481 vty_out (vty
, " The remaining time of stalepath timer is %ld%s",
7482 thread_timer_remain_second (p
->t_gr_stale
), VTY_NEWLINE
);
7485 /* Packet counts. */
7486 vty_out (vty
, " Message statistics:%s", VTY_NEWLINE
);
7487 vty_out (vty
, " Inq depth is 0%s", VTY_NEWLINE
);
7488 vty_out (vty
, " Outq depth is %lu%s", (unsigned long) p
->obuf
->count
, VTY_NEWLINE
);
7489 vty_out (vty
, " Sent Rcvd%s", VTY_NEWLINE
);
7490 vty_out (vty
, " Opens: %10d %10d%s", p
->open_out
, p
->open_in
, VTY_NEWLINE
);
7491 vty_out (vty
, " Notifications: %10d %10d%s", p
->notify_out
, p
->notify_in
, VTY_NEWLINE
);
7492 vty_out (vty
, " Updates: %10d %10d%s", p
->update_out
, p
->update_in
, VTY_NEWLINE
);
7493 vty_out (vty
, " Keepalives: %10d %10d%s", p
->keepalive_out
, p
->keepalive_in
, VTY_NEWLINE
);
7494 vty_out (vty
, " Route Refresh: %10d %10d%s", p
->refresh_out
, p
->refresh_in
, VTY_NEWLINE
);
7495 vty_out (vty
, " Capability: %10d %10d%s", p
->dynamic_cap_out
, p
->dynamic_cap_in
, VTY_NEWLINE
);
7496 vty_out (vty
, " Total: %10d %10d%s", p
->open_out
+ p
->notify_out
+
7497 p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
+ p
->dynamic_cap_out
,
7498 p
->open_in
+ p
->notify_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
+
7499 p
->dynamic_cap_in
, VTY_NEWLINE
);
7501 /* advertisement-interval */
7502 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
7503 p
->v_routeadv
, VTY_NEWLINE
);
7505 /* Update-source. */
7506 if (p
->update_if
|| p
->update_source
)
7508 vty_out (vty
, " Update source is ");
7510 vty_out (vty
, "%s", p
->update_if
);
7511 else if (p
->update_source
)
7513 sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
7514 vty_out (vty
, "%s", VTY_NEWLINE
);
7517 /* Default weight */
7518 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
7519 vty_out (vty
, " Default weight %d%s", p
->weight
,
7522 vty_out (vty
, "%s", VTY_NEWLINE
);
7524 /* Address Family Information */
7525 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7526 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7527 if (p
->afc
[afi
][safi
])
7528 bgp_show_peer_afi (vty
, p
, afi
, safi
);
7530 vty_out (vty
, " Connections established %d; dropped %d%s",
7531 p
->established
, p
->dropped
,
7535 vty_out (vty
, " Last reset never%s", VTY_NEWLINE
);
7537 vty_out (vty
, " Last reset %s, due to %s%s",
7538 peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
),
7539 peer_down_str
[(int) p
->last_reset
], VTY_NEWLINE
);
7541 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
7543 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
7545 if (p
->t_pmax_restart
)
7546 vty_out (vty
, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
7547 p
->host
, thread_timer_remain_second (p
->t_pmax_restart
),
7550 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
7551 p
->host
, VTY_NEWLINE
);
7555 if (peer_sort (p
) != BGP_PEER_IBGP
&& p
->ttl
> 1)
7556 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
7557 p
->ttl
, VTY_NEWLINE
);
7559 /* Local address. */
7562 vty_out (vty
, "Local host: %s, Local port: %d%s",
7563 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
7564 ntohs (p
->su_local
->sin
.sin_port
),
7568 /* Remote address. */
7571 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
7572 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
7573 ntohs (p
->su_remote
->sin
.sin_port
),
7577 /* Nexthop display. */
7580 vty_out (vty
, "Nexthop: %s%s",
7581 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
7584 vty_out (vty
, "Nexthop global: %s%s",
7585 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
7587 vty_out (vty
, "Nexthop local: %s%s",
7588 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
7590 vty_out (vty
, "BGP connection: %s%s",
7591 p
->shared_network
? "shared network" : "non shared network",
7593 #endif /* HAVE_IPV6 */
7596 /* Timer information. */
7598 vty_out (vty
, "Next start timer due in %ld seconds%s",
7599 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
7601 vty_out (vty
, "Next connect timer due in %ld seconds%s",
7602 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
7604 vty_out (vty
, "Read thread: %s Write thread: %s%s",
7605 p
->t_read
? "on" : "off",
7606 p
->t_write
? "on" : "off",
7609 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
7610 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
7611 bgp_capability_vty_out (vty
, p
);
7613 vty_out (vty
, "%s", VTY_NEWLINE
);
7617 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
,
7618 enum show_type type
, union sockunion
*su
)
7620 struct listnode
*node
, *nnode
;
7624 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
7629 bgp_show_peer (vty
, peer
);
7632 if (sockunion_same (&peer
->su
, su
))
7635 bgp_show_peer (vty
, peer
);
7641 if (type
== show_peer
&& ! find
)
7642 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
7648 bgp_show_neighbor_vty (struct vty
*vty
, const char *name
,
7649 enum show_type type
, const char *ip_str
)
7657 ret
= str2sockunion (ip_str
, &su
);
7660 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
7667 bgp
= bgp_lookup_by_name (name
);
7671 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
7675 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7680 bgp
= bgp_get_default ();
7683 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7688 /* "show ip bgp neighbors" commands. */
7689 DEFUN (show_ip_bgp_neighbors
,
7690 show_ip_bgp_neighbors_cmd
,
7691 "show ip bgp neighbors",
7695 "Detailed information on TCP and BGP neighbor connections\n")
7697 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
);
7700 ALIAS (show_ip_bgp_neighbors
,
7701 show_ip_bgp_ipv4_neighbors_cmd
,
7702 "show ip bgp ipv4 (unicast|multicast) neighbors",
7707 "Address Family modifier\n"
7708 "Address Family modifier\n"
7709 "Detailed information on TCP and BGP neighbor connections\n")
7711 ALIAS (show_ip_bgp_neighbors
,
7712 show_ip_bgp_vpnv4_all_neighbors_cmd
,
7713 "show ip bgp vpnv4 all neighbors",
7717 "Display VPNv4 NLRI specific information\n"
7718 "Display information about all VPNv4 NLRIs\n"
7719 "Detailed information on TCP and BGP neighbor connections\n")
7721 ALIAS (show_ip_bgp_neighbors
,
7722 show_ip_bgp_vpnv4_rd_neighbors_cmd
,
7723 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
7727 "Display VPNv4 NLRI specific information\n"
7728 "Display information for a route distinguisher\n"
7729 "VPN Route Distinguisher\n"
7730 "Detailed information on TCP and BGP neighbor connections\n")
7732 ALIAS (show_ip_bgp_neighbors
,
7733 show_bgp_neighbors_cmd
,
7734 "show bgp neighbors",
7737 "Detailed information on TCP and BGP neighbor connections\n")
7739 ALIAS (show_ip_bgp_neighbors
,
7740 show_bgp_ipv6_neighbors_cmd
,
7741 "show bgp ipv6 neighbors",
7745 "Detailed information on TCP and BGP neighbor connections\n")
7747 DEFUN (show_ip_bgp_neighbors_peer
,
7748 show_ip_bgp_neighbors_peer_cmd
,
7749 "show ip bgp neighbors (A.B.C.D|X:X::X:X)",
7753 "Detailed information on TCP and BGP neighbor connections\n"
7754 "Neighbor to display information about\n"
7755 "Neighbor to display information about\n")
7757 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 1]);
7760 ALIAS (show_ip_bgp_neighbors_peer
,
7761 show_ip_bgp_ipv4_neighbors_peer_cmd
,
7762 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)",
7767 "Address Family modifier\n"
7768 "Address Family modifier\n"
7769 "Detailed information on TCP and BGP neighbor connections\n"
7770 "Neighbor to display information about\n"
7771 "Neighbor to display information about\n")
7773 ALIAS (show_ip_bgp_neighbors_peer
,
7774 show_ip_bgp_vpnv4_all_neighbors_peer_cmd
,
7775 "show ip bgp vpnv4 all neighbors A.B.C.D",
7779 "Display VPNv4 NLRI specific information\n"
7780 "Display information about all VPNv4 NLRIs\n"
7781 "Detailed information on TCP and BGP neighbor connections\n"
7782 "Neighbor to display information about\n")
7784 ALIAS (show_ip_bgp_neighbors_peer
,
7785 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
,
7786 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
7790 "Display VPNv4 NLRI specific information\n"
7791 "Display information about all VPNv4 NLRIs\n"
7792 "Detailed information on TCP and BGP neighbor connections\n"
7793 "Neighbor to display information about\n")
7795 ALIAS (show_ip_bgp_neighbors_peer
,
7796 show_bgp_neighbors_peer_cmd
,
7797 "show bgp neighbors (A.B.C.D|X:X::X:X)",
7800 "Detailed information on TCP and BGP neighbor connections\n"
7801 "Neighbor to display information about\n"
7802 "Neighbor to display information about\n")
7804 ALIAS (show_ip_bgp_neighbors_peer
,
7805 show_bgp_ipv6_neighbors_peer_cmd
,
7806 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)",
7810 "Detailed information on TCP and BGP neighbor connections\n"
7811 "Neighbor to display information about\n"
7812 "Neighbor to display information about\n")
7814 DEFUN (show_ip_bgp_instance_neighbors
,
7815 show_ip_bgp_instance_neighbors_cmd
,
7816 "show ip bgp view WORD neighbors",
7822 "Detailed information on TCP and BGP neighbor connections\n")
7824 return bgp_show_neighbor_vty (vty
, argv
[0], show_all
, NULL
);
7827 ALIAS (show_ip_bgp_instance_neighbors
,
7828 show_bgp_instance_neighbors_cmd
,
7829 "show bgp view WORD neighbors",
7834 "Detailed information on TCP and BGP neighbor connections\n")
7836 ALIAS (show_ip_bgp_instance_neighbors
,
7837 show_bgp_instance_ipv6_neighbors_cmd
,
7838 "show bgp view WORD ipv6 neighbors",
7844 "Detailed information on TCP and BGP neighbor connections\n")
7846 DEFUN (show_ip_bgp_instance_neighbors_peer
,
7847 show_ip_bgp_instance_neighbors_peer_cmd
,
7848 "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7854 "Detailed information on TCP and BGP neighbor connections\n"
7855 "Neighbor to display information about\n"
7856 "Neighbor to display information about\n")
7858 return bgp_show_neighbor_vty (vty
, argv
[0], show_peer
, argv
[1]);
7861 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7862 show_bgp_instance_neighbors_peer_cmd
,
7863 "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7868 "Detailed information on TCP and BGP neighbor connections\n"
7869 "Neighbor to display information about\n"
7870 "Neighbor to display information about\n")
7872 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7873 show_bgp_instance_ipv6_neighbors_peer_cmd
,
7874 "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)",
7880 "Detailed information on TCP and BGP neighbor connections\n"
7881 "Neighbor to display information about\n"
7882 "Neighbor to display information about\n")
7884 /* Show BGP's AS paths internal data. There are both `show ip bgp
7885 paths' and `show ip mbgp paths'. Those functions results are the
7887 DEFUN (show_ip_bgp_paths
,
7888 show_ip_bgp_paths_cmd
,
7889 "show ip bgp paths",
7893 "Path information\n")
7895 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
7896 aspath_print_all_vty (vty
);
7900 DEFUN (show_ip_bgp_ipv4_paths
,
7901 show_ip_bgp_ipv4_paths_cmd
,
7902 "show ip bgp ipv4 (unicast|multicast) paths",
7907 "Address Family modifier\n"
7908 "Address Family modifier\n"
7909 "Path information\n")
7911 vty_out (vty
, "Address Refcnt Path\r\n");
7912 aspath_print_all_vty (vty
);
7920 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
7922 struct community
*com
;
7924 com
= (struct community
*) backet
->data
;
7925 vty_out (vty
, "[%p] (%ld) %s%s", backet
, com
->refcnt
,
7926 community_str (com
), VTY_NEWLINE
);
7929 /* Show BGP's community internal data. */
7930 DEFUN (show_ip_bgp_community_info
,
7931 show_ip_bgp_community_info_cmd
,
7932 "show ip bgp community-info",
7936 "List all bgp community information\n")
7938 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
7940 hash_iterate (community_hash (),
7941 (void (*) (struct hash_backet
*, void *))
7942 community_show_all_iterator
,
7948 DEFUN (show_ip_bgp_attr_info
,
7949 show_ip_bgp_attr_info_cmd
,
7950 "show ip bgp attribute-info",
7954 "List all bgp attribute information\n")
7956 attr_show_all (vty
);
7961 bgp_write_rsclient_summary (struct vty
*vty
, struct peer
*rsclient
,
7962 afi_t afi
, safi_t safi
)
7964 char timebuf
[BGP_UPTIME_LEN
];
7968 struct listnode
*node
, *nnode
;
7972 if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_GROUP
))
7974 for (ALL_LIST_ELEMENTS (rsclient
->group
->peer
, node
, nnode
, peer
))
7977 bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
7982 len
= vty_out (vty
, "%s", rsclient
->host
);
7986 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
7988 vty_out (vty
, "%*s", len
, " ");
7990 vty_out (vty
, "4 ");
7992 vty_out (vty
, "%11d ", rsclient
->as
);
7994 rmname
= ROUTE_MAP_EXPORT_NAME(&rsclient
->filter
[afi
][safi
]);
7995 if ( rmname
&& strlen (rmname
) > 13 )
7997 sprintf (rmbuf
, "%13s", "...");
7998 rmname
= strncpy (rmbuf
, rmname
, 10);
8002 vty_out (vty
, " %13s ", rmname
);
8004 rmname
= ROUTE_MAP_IMPORT_NAME(&rsclient
->filter
[afi
][safi
]);
8005 if ( rmname
&& strlen (rmname
) > 13 )
8007 sprintf (rmbuf
, "%13s", "...");
8008 rmname
= strncpy (rmbuf
, rmname
, 10);
8012 vty_out (vty
, " %13s ", rmname
);
8014 vty_out (vty
, "%8s", peer_uptime (rsclient
->uptime
, timebuf
, BGP_UPTIME_LEN
));
8016 if (CHECK_FLAG (rsclient
->flags
, PEER_FLAG_SHUTDOWN
))
8017 vty_out (vty
, " Idle (Admin)");
8018 else if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
8019 vty_out (vty
, " Idle (PfxCt)");
8021 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, rsclient
->status
));
8023 vty_out (vty
, "%s", VTY_NEWLINE
);
8029 bgp_show_rsclient_summary (struct vty
*vty
, struct bgp
*bgp
,
8030 afi_t afi
, safi_t safi
)
8033 struct listnode
*node
, *nnode
;
8036 /* Header string for each address family. */
8037 static char header
[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
8039 for (ALL_LIST_ELEMENTS (bgp
->rsclient
, node
, nnode
, peer
))
8041 if (peer
->afc
[afi
][safi
] &&
8042 CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
8047 "Route Server's BGP router identifier %s%s",
8048 inet_ntoa (bgp
->router_id
), VTY_NEWLINE
);
8050 "Route Server's local AS number %u%s", bgp
->as
,
8053 vty_out (vty
, "%s", VTY_NEWLINE
);
8054 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
8057 count
+= bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
8062 vty_out (vty
, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE
,
8063 count
, VTY_NEWLINE
);
8065 vty_out (vty
, "No %s Route Server Client is configured%s",
8066 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
8072 bgp_show_rsclient_summary_vty (struct vty
*vty
, const char *name
,
8073 afi_t afi
, safi_t safi
)
8079 bgp
= bgp_lookup_by_name (name
);
8083 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
8087 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
8091 bgp
= bgp_get_default ();
8094 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
8099 /* 'show bgp rsclient' commands. */
8100 DEFUN (show_ip_bgp_rsclient_summary
,
8101 show_ip_bgp_rsclient_summary_cmd
,
8102 "show ip bgp rsclient summary",
8106 "Information about Route Server Clients\n"
8107 "Summary of all Route Server Clients\n")
8109 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
8112 DEFUN (show_ip_bgp_instance_rsclient_summary
,
8113 show_ip_bgp_instance_rsclient_summary_cmd
,
8114 "show ip bgp view WORD rsclient summary",
8120 "Information about Route Server Clients\n"
8121 "Summary of all Route Server Clients\n")
8123 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
8126 DEFUN (show_ip_bgp_ipv4_rsclient_summary
,
8127 show_ip_bgp_ipv4_rsclient_summary_cmd
,
8128 "show ip bgp ipv4 (unicast|multicast) rsclient summary",
8133 "Address Family modifier\n"
8134 "Address Family modifier\n"
8135 "Information about Route Server Clients\n"
8136 "Summary of all Route Server Clients\n")
8138 if (strncmp (argv
[0], "m", 1) == 0)
8139 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
8141 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
8144 DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary
,
8145 show_ip_bgp_instance_ipv4_rsclient_summary_cmd
,
8146 "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary",
8153 "Address Family modifier\n"
8154 "Address Family modifier\n"
8155 "Information about Route Server Clients\n"
8156 "Summary of all Route Server Clients\n")
8158 if (strncmp (argv
[1], "m", 1) == 0)
8159 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
8161 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
8165 DEFUN (show_bgp_rsclient_summary
,
8166 show_bgp_rsclient_summary_cmd
,
8167 "show bgp rsclient summary",
8170 "Information about Route Server Clients\n"
8171 "Summary of all Route Server Clients\n")
8173 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
8176 DEFUN (show_bgp_instance_rsclient_summary
,
8177 show_bgp_instance_rsclient_summary_cmd
,
8178 "show bgp view WORD rsclient summary",
8183 "Information about Route Server Clients\n"
8184 "Summary of all Route Server Clients\n")
8186 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
8189 ALIAS (show_bgp_rsclient_summary
,
8190 show_bgp_ipv6_rsclient_summary_cmd
,
8191 "show bgp ipv6 rsclient summary",
8195 "Information about Route Server Clients\n"
8196 "Summary of all Route Server Clients\n")
8198 ALIAS (show_bgp_instance_rsclient_summary
,
8199 show_bgp_instance_ipv6_rsclient_summary_cmd
,
8200 "show bgp view WORD ipv6 rsclient summary",
8206 "Information about Route Server Clients\n"
8207 "Summary of all Route Server Clients\n")
8208 #endif /* HAVE IPV6 */
8210 /* Redistribute VTY commands. */
8212 /* Utility function to convert user input route type string to route
8215 bgp_str2route_type (int afi
, const char *str
)
8222 if (strncmp (str
, "k", 1) == 0)
8223 return ZEBRA_ROUTE_KERNEL
;
8224 else if (strncmp (str
, "c", 1) == 0)
8225 return ZEBRA_ROUTE_CONNECT
;
8226 else if (strncmp (str
, "s", 1) == 0)
8227 return ZEBRA_ROUTE_STATIC
;
8228 else if (strncmp (str
, "r", 1) == 0)
8229 return ZEBRA_ROUTE_RIP
;
8230 else if (strncmp (str
, "o", 1) == 0)
8231 return ZEBRA_ROUTE_OSPF
;
8235 if (strncmp (str
, "k", 1) == 0)
8236 return ZEBRA_ROUTE_KERNEL
;
8237 else if (strncmp (str
, "c", 1) == 0)
8238 return ZEBRA_ROUTE_CONNECT
;
8239 else if (strncmp (str
, "s", 1) == 0)
8240 return ZEBRA_ROUTE_STATIC
;
8241 else if (strncmp (str
, "r", 1) == 0)
8242 return ZEBRA_ROUTE_RIPNG
;
8243 else if (strncmp (str
, "o", 1) == 0)
8244 return ZEBRA_ROUTE_OSPF6
;
8249 DEFUN (bgp_redistribute_ipv4
,
8250 bgp_redistribute_ipv4_cmd
,
8251 "redistribute (connected|kernel|ospf|rip|static)",
8252 "Redistribute information from another routing protocol\n"
8255 "Open Shurtest Path First (OSPF)\n"
8256 "Routing Information Protocol (RIP)\n"
8261 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8264 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8267 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8270 DEFUN (bgp_redistribute_ipv4_rmap
,
8271 bgp_redistribute_ipv4_rmap_cmd
,
8272 "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
8273 "Redistribute information from another routing protocol\n"
8276 "Open Shurtest Path First (OSPF)\n"
8277 "Routing Information Protocol (RIP)\n"
8279 "Route map reference\n"
8280 "Pointer to route-map entries\n")
8284 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8287 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8291 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
8292 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8295 DEFUN (bgp_redistribute_ipv4_metric
,
8296 bgp_redistribute_ipv4_metric_cmd
,
8297 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
8298 "Redistribute information from another routing protocol\n"
8301 "Open Shurtest Path First (OSPF)\n"
8302 "Routing Information Protocol (RIP)\n"
8304 "Metric for redistributed routes\n"
8310 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8313 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8316 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8318 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8319 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8322 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
8323 bgp_redistribute_ipv4_rmap_metric_cmd
,
8324 "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
8325 "Redistribute information from another routing protocol\n"
8328 "Open Shurtest Path First (OSPF)\n"
8329 "Routing Information Protocol (RIP)\n"
8331 "Route map reference\n"
8332 "Pointer to route-map entries\n"
8333 "Metric for redistributed routes\n"
8339 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8342 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8345 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8347 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
8348 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8349 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8352 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
8353 bgp_redistribute_ipv4_metric_rmap_cmd
,
8354 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
8355 "Redistribute information from another routing protocol\n"
8358 "Open Shurtest Path First (OSPF)\n"
8359 "Routing Information Protocol (RIP)\n"
8361 "Metric for redistributed routes\n"
8363 "Route map reference\n"
8364 "Pointer to route-map entries\n")
8369 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8372 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8375 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8377 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8378 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[2]);
8379 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8382 DEFUN (no_bgp_redistribute_ipv4
,
8383 no_bgp_redistribute_ipv4_cmd
,
8384 "no redistribute (connected|kernel|ospf|rip|static)",
8386 "Redistribute information from another routing protocol\n"
8389 "Open Shurtest Path First (OSPF)\n"
8390 "Routing Information Protocol (RIP)\n"
8395 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8398 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8402 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
);
8405 DEFUN (no_bgp_redistribute_ipv4_rmap
,
8406 no_bgp_redistribute_ipv4_rmap_cmd
,
8407 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
8409 "Redistribute information from another routing protocol\n"
8412 "Open Shurtest Path First (OSPF)\n"
8413 "Routing Information Protocol (RIP)\n"
8415 "Route map reference\n"
8416 "Pointer to route-map entries\n")
8420 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8423 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8427 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8431 DEFUN (no_bgp_redistribute_ipv4_metric
,
8432 no_bgp_redistribute_ipv4_metric_cmd
,
8433 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
8435 "Redistribute information from another routing protocol\n"
8438 "Open Shurtest Path First (OSPF)\n"
8439 "Routing Information Protocol (RIP)\n"
8441 "Metric for redistributed routes\n"
8446 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8449 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8453 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8457 DEFUN (no_bgp_redistribute_ipv4_rmap_metric
,
8458 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
8459 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
8461 "Redistribute information from another routing protocol\n"
8464 "Open Shurtest Path First (OSPF)\n"
8465 "Routing Information Protocol (RIP)\n"
8467 "Route map reference\n"
8468 "Pointer to route-map entries\n"
8469 "Metric for redistributed routes\n"
8474 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8477 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8481 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8482 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8486 ALIAS (no_bgp_redistribute_ipv4_rmap_metric
,
8487 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
8488 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
8490 "Redistribute information from another routing protocol\n"
8493 "Open Shurtest Path First (OSPF)\n"
8494 "Routing Information Protocol (RIP)\n"
8496 "Metric for redistributed routes\n"
8498 "Route map reference\n"
8499 "Pointer to route-map entries\n")
8502 DEFUN (bgp_redistribute_ipv6
,
8503 bgp_redistribute_ipv6_cmd
,
8504 "redistribute (connected|kernel|ospf6|ripng|static)",
8505 "Redistribute information from another routing protocol\n"
8508 "Open Shurtest Path First (OSPFv3)\n"
8509 "Routing Information Protocol (RIPng)\n"
8514 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8517 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8521 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8524 DEFUN (bgp_redistribute_ipv6_rmap
,
8525 bgp_redistribute_ipv6_rmap_cmd
,
8526 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
8527 "Redistribute information from another routing protocol\n"
8530 "Open Shurtest Path First (OSPFv3)\n"
8531 "Routing Information Protocol (RIPng)\n"
8533 "Route map reference\n"
8534 "Pointer to route-map entries\n")
8538 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8541 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8545 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8546 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8549 DEFUN (bgp_redistribute_ipv6_metric
,
8550 bgp_redistribute_ipv6_metric_cmd
,
8551 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
8552 "Redistribute information from another routing protocol\n"
8555 "Open Shurtest Path First (OSPFv3)\n"
8556 "Routing Information Protocol (RIPng)\n"
8558 "Metric for redistributed routes\n"
8564 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8567 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8570 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8572 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8573 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8576 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
8577 bgp_redistribute_ipv6_rmap_metric_cmd
,
8578 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
8579 "Redistribute information from another routing protocol\n"
8582 "Open Shurtest Path First (OSPFv3)\n"
8583 "Routing Information Protocol (RIPng)\n"
8585 "Route map reference\n"
8586 "Pointer to route-map entries\n"
8587 "Metric for redistributed routes\n"
8593 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8596 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8599 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8601 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8602 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8603 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8606 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
8607 bgp_redistribute_ipv6_metric_rmap_cmd
,
8608 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
8609 "Redistribute information from another routing protocol\n"
8612 "Open Shurtest Path First (OSPFv3)\n"
8613 "Routing Information Protocol (RIPng)\n"
8615 "Metric for redistributed routes\n"
8617 "Route map reference\n"
8618 "Pointer to route-map entries\n")
8623 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8626 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8629 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8631 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8632 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[2]);
8633 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8636 DEFUN (no_bgp_redistribute_ipv6
,
8637 no_bgp_redistribute_ipv6_cmd
,
8638 "no redistribute (connected|kernel|ospf6|ripng|static)",
8640 "Redistribute information from another routing protocol\n"
8643 "Open Shurtest Path First (OSPFv3)\n"
8644 "Routing Information Protocol (RIPng)\n"
8649 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8652 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8656 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
);
8659 DEFUN (no_bgp_redistribute_ipv6_rmap
,
8660 no_bgp_redistribute_ipv6_rmap_cmd
,
8661 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
8663 "Redistribute information from another routing protocol\n"
8666 "Open Shurtest Path First (OSPFv3)\n"
8667 "Routing Information Protocol (RIPng)\n"
8669 "Route map reference\n"
8670 "Pointer to route-map entries\n")
8674 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8677 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8681 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8685 DEFUN (no_bgp_redistribute_ipv6_metric
,
8686 no_bgp_redistribute_ipv6_metric_cmd
,
8687 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
8689 "Redistribute information from another routing protocol\n"
8692 "Open Shurtest Path First (OSPFv3)\n"
8693 "Routing Information Protocol (RIPng)\n"
8695 "Metric for redistributed routes\n"
8700 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8703 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8707 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8711 DEFUN (no_bgp_redistribute_ipv6_rmap_metric
,
8712 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
8713 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
8715 "Redistribute information from another routing protocol\n"
8718 "Open Shurtest Path First (OSPFv3)\n"
8719 "Routing Information Protocol (RIPng)\n"
8721 "Route map reference\n"
8722 "Pointer to route-map entries\n"
8723 "Metric for redistributed routes\n"
8728 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8731 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8735 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8736 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8740 ALIAS (no_bgp_redistribute_ipv6_rmap_metric
,
8741 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
8742 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
8744 "Redistribute information from another routing protocol\n"
8747 "Open Shurtest Path First (OSPFv3)\n"
8748 "Routing Information Protocol (RIPng)\n"
8750 "Metric for redistributed routes\n"
8752 "Route map reference\n"
8753 "Pointer to route-map entries\n")
8754 #endif /* HAVE_IPV6 */
8757 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
8758 safi_t safi
, int *write
)
8762 /* Unicast redistribution only. */
8763 if (safi
!= SAFI_UNICAST
)
8766 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
8768 /* Redistribute BGP does not make sense. */
8769 if (bgp
->redist
[afi
][i
] && i
!= ZEBRA_ROUTE_BGP
)
8771 /* Display "address-family" when it is not yet diplayed. */
8772 bgp_config_write_family_header (vty
, afi
, safi
, write
);
8774 /* "redistribute" configuration. */
8775 vty_out (vty
, " redistribute %s", zebra_route_string(i
));
8777 if (bgp
->redist_metric_flag
[afi
][i
])
8778 vty_out (vty
, " metric %d", bgp
->redist_metric
[afi
][i
]);
8780 if (bgp
->rmap
[afi
][i
].name
)
8781 vty_out (vty
, " route-map %s", bgp
->rmap
[afi
][i
].name
);
8783 vty_out (vty
, "%s", VTY_NEWLINE
);
8789 /* BGP node structure. */
8790 static struct cmd_node bgp_node
=
8793 "%s(config-router)# ",
8797 static struct cmd_node bgp_ipv4_unicast_node
=
8800 "%s(config-router-af)# ",
8804 static struct cmd_node bgp_ipv4_multicast_node
=
8807 "%s(config-router-af)# ",
8811 static struct cmd_node bgp_ipv6_unicast_node
=
8814 "%s(config-router-af)# ",
8818 static struct cmd_node bgp_ipv6_multicast_node
=
8821 "%s(config-router-af)# ",
8825 static struct cmd_node bgp_vpnv4_node
=
8828 "%s(config-router-af)# ",
8832 static void community_list_vty (void);
8837 /* Install bgp top node. */
8838 install_node (&bgp_node
, bgp_config_write
);
8839 install_node (&bgp_ipv4_unicast_node
, NULL
);
8840 install_node (&bgp_ipv4_multicast_node
, NULL
);
8841 install_node (&bgp_ipv6_unicast_node
, NULL
);
8842 install_node (&bgp_ipv6_multicast_node
, NULL
);
8843 install_node (&bgp_vpnv4_node
, NULL
);
8845 /* Install default VTY commands to new nodes. */
8846 install_default (BGP_NODE
);
8847 install_default (BGP_IPV4_NODE
);
8848 install_default (BGP_IPV4M_NODE
);
8849 install_default (BGP_IPV6_NODE
);
8850 install_default (BGP_IPV6M_NODE
);
8851 install_default (BGP_VPNV4_NODE
);
8853 /* "bgp multiple-instance" commands. */
8854 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
8855 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
8857 /* "bgp config-type" commands. */
8858 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
8859 install_element (CONFIG_NODE
, &no_bgp_config_type_cmd
);
8861 /* Dummy commands (Currently not supported) */
8862 install_element (BGP_NODE
, &no_synchronization_cmd
);
8863 install_element (BGP_NODE
, &no_auto_summary_cmd
);
8865 /* "router bgp" commands. */
8866 install_element (CONFIG_NODE
, &router_bgp_cmd
);
8867 install_element (CONFIG_NODE
, &router_bgp_view_cmd
);
8869 /* "no router bgp" commands. */
8870 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
8871 install_element (CONFIG_NODE
, &no_router_bgp_view_cmd
);
8873 /* "bgp router-id" commands. */
8874 install_element (BGP_NODE
, &bgp_router_id_cmd
);
8875 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
8876 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
8878 /* "bgp cluster-id" commands. */
8879 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
8880 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
8881 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
8882 install_element (BGP_NODE
, &no_bgp_cluster_id_arg_cmd
);
8884 /* "bgp confederation" commands. */
8885 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
8886 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
8887 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
8889 /* "bgp confederation peers" commands. */
8890 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
8891 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
8893 /* "timers bgp" commands. */
8894 install_element (BGP_NODE
, &bgp_timers_cmd
);
8895 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
8896 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
8898 /* "bgp client-to-client reflection" commands */
8899 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
8900 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
8902 /* "bgp always-compare-med" commands */
8903 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
8904 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
8906 /* "bgp deterministic-med" commands */
8907 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
8908 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
8910 /* "bgp graceful-restart" commands */
8911 install_element (BGP_NODE
, &bgp_graceful_restart_cmd
);
8912 install_element (BGP_NODE
, &no_bgp_graceful_restart_cmd
);
8913 install_element (BGP_NODE
, &bgp_graceful_restart_stalepath_time_cmd
);
8914 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_cmd
);
8915 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_val_cmd
);
8917 /* "bgp fast-external-failover" commands */
8918 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
8919 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
8921 /* "bgp enforce-first-as" commands */
8922 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
8923 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
8925 /* "bgp bestpath compare-routerid" commands */
8926 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
8927 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
8929 /* "bgp bestpath as-path ignore" commands */
8930 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
8931 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
8933 /* "bgp bestpath as-path confed" commands */
8934 install_element (BGP_NODE
, &bgp_bestpath_aspath_confed_cmd
);
8935 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_confed_cmd
);
8937 /* "bgp log-neighbor-changes" commands */
8938 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
8939 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
8941 /* "bgp bestpath med" commands */
8942 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
8943 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
8944 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
8945 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
8946 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
8947 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
8949 /* "no bgp default ipv4-unicast" commands. */
8950 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
8951 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
8953 /* "bgp network import-check" commands. */
8954 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
8955 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
8957 /* "bgp default local-preference" commands. */
8958 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
8959 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
8960 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
8962 /* "neighbor remote-as" commands. */
8963 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
8964 install_element (BGP_NODE
, &no_neighbor_cmd
);
8965 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
8967 /* "neighbor peer-group" commands. */
8968 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
8969 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
8970 install_element (BGP_NODE
, &no_neighbor_peer_group_remote_as_cmd
);
8972 /* "neighbor local-as" commands. */
8973 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
8974 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
8975 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
8976 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
8977 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
8979 /* "neighbor password" commands. */
8980 install_element (BGP_NODE
, &neighbor_password_cmd
);
8981 install_element (BGP_NODE
, &no_neighbor_password_cmd
);
8983 /* "neighbor activate" commands. */
8984 install_element (BGP_NODE
, &neighbor_activate_cmd
);
8985 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
8986 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
8987 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
8988 install_element (BGP_IPV6M_NODE
, &neighbor_activate_cmd
);
8989 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
8991 /* "no neighbor activate" commands. */
8992 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
8993 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
8994 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
8995 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
8996 install_element (BGP_IPV6M_NODE
, &no_neighbor_activate_cmd
);
8997 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
8999 /* "neighbor peer-group set" commands. */
9000 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
9001 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
9002 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
9003 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
9004 install_element (BGP_IPV6M_NODE
, &neighbor_set_peer_group_cmd
);
9005 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
9007 /* "no neighbor peer-group unset" commands. */
9008 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
9009 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
9010 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
9011 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
9012 install_element (BGP_IPV6M_NODE
, &no_neighbor_set_peer_group_cmd
);
9013 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
9015 /* "neighbor softreconfiguration inbound" commands.*/
9016 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
9017 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9018 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
9019 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9020 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
9021 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9022 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
9023 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9024 install_element (BGP_IPV6M_NODE
, &neighbor_soft_reconfiguration_cmd
);
9025 install_element (BGP_IPV6M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9026 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
9027 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9029 /* "neighbor attribute-unchanged" commands. */
9030 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
9031 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
9032 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
9033 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
9034 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
9035 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
9036 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
9037 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
9038 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
9039 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
9040 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
9041 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
9042 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9043 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9044 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9045 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9046 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9047 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9048 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9049 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9050 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9051 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9052 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
9053 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
9054 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
9055 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
9056 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
9057 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
9058 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
9059 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
9060 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
9061 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
9062 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
9063 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
9064 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9065 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9066 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9067 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9068 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9069 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9070 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9071 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9072 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9073 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9074 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
9075 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
9076 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
9077 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
9078 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
9079 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
9080 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
9081 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
9082 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
9083 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
9084 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
9085 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
9086 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9087 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9088 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9089 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9090 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9091 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9092 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9093 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9094 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9095 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9096 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
9097 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
9098 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
9099 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
9100 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
9101 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
9102 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
9103 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
9104 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
9105 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
9106 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
9107 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
9108 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9109 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9110 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9111 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9112 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9113 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9114 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9115 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9116 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9117 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9118 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged_cmd
);
9119 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged1_cmd
);
9120 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged2_cmd
);
9121 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged3_cmd
);
9122 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged4_cmd
);
9123 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged5_cmd
);
9124 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged6_cmd
);
9125 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged7_cmd
);
9126 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged8_cmd
);
9127 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged9_cmd
);
9128 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged10_cmd
);
9129 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged_cmd
);
9130 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9131 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9132 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9133 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9134 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9135 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9136 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9137 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9138 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9139 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9140 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
9141 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
9142 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
9143 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
9144 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
9145 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
9146 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
9147 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
9148 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
9149 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
9150 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
9151 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
9152 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9153 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9154 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9155 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9156 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9157 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9158 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9159 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9160 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9161 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9163 /* "nexthop-local unchanged" commands */
9164 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_local_unchanged_cmd
);
9165 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_local_unchanged_cmd
);
9167 /* "transparent-as" and "transparent-nexthop" for old version
9169 install_element (BGP_NODE
, &neighbor_transparent_as_cmd
);
9170 install_element (BGP_NODE
, &neighbor_transparent_nexthop_cmd
);
9172 /* "neighbor next-hop-self" commands. */
9173 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
9174 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
9175 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
9176 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
9177 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
9178 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
9179 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
9180 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
9181 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_cmd
);
9182 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_cmd
);
9183 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
9184 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
9186 /* "neighbor remove-private-AS" commands. */
9187 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
9188 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
9189 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
9190 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
9191 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
9192 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
9193 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
9194 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
9195 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_cmd
);
9196 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_cmd
);
9197 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
9198 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
9200 /* "neighbor send-community" commands.*/
9201 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
9202 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
9203 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
9204 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
9205 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
9206 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
9207 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
9208 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
9209 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
9210 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
9211 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
9212 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
9213 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
9214 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
9215 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
9216 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
9217 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_cmd
);
9218 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_type_cmd
);
9219 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_cmd
);
9220 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_type_cmd
);
9221 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
9222 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
9223 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
9224 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
9226 /* "neighbor route-reflector" commands.*/
9227 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
9228 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
9229 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
9230 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
9231 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
9232 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
9233 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
9234 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
9235 install_element (BGP_IPV6M_NODE
, &neighbor_route_reflector_client_cmd
);
9236 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_reflector_client_cmd
);
9237 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
9238 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
9240 /* "neighbor route-server" commands.*/
9241 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
9242 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
9243 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
9244 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
9245 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
9246 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
9247 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
9248 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
9249 install_element (BGP_IPV6M_NODE
, &neighbor_route_server_client_cmd
);
9250 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_server_client_cmd
);
9251 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
9252 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
9254 /* "neighbor passive" commands. */
9255 install_element (BGP_NODE
, &neighbor_passive_cmd
);
9256 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
9258 /* "neighbor shutdown" commands. */
9259 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
9260 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
9262 /* Deprecated "neighbor capability route-refresh" commands.*/
9263 install_element (BGP_NODE
, &neighbor_capability_route_refresh_cmd
);
9264 install_element (BGP_NODE
, &no_neighbor_capability_route_refresh_cmd
);
9266 /* "neighbor capability orf prefix-list" commands.*/
9267 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
9268 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9269 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
9270 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9271 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
9272 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9273 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
9274 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9275 install_element (BGP_IPV6M_NODE
, &neighbor_capability_orf_prefix_cmd
);
9276 install_element (BGP_IPV6M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9278 /* "neighbor capability dynamic" commands.*/
9279 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
9280 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
9282 /* "neighbor dont-capability-negotiate" commands. */
9283 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
9284 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
9286 /* "neighbor ebgp-multihop" commands. */
9287 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
9288 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
9289 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
9290 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
9292 /* "neighbor disable-connected-check" commands. */
9293 install_element (BGP_NODE
, &neighbor_disable_connected_check_cmd
);
9294 install_element (BGP_NODE
, &no_neighbor_disable_connected_check_cmd
);
9295 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
9296 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
9298 /* "neighbor description" commands. */
9299 install_element (BGP_NODE
, &neighbor_description_cmd
);
9300 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
9301 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
9303 /* "neighbor update-source" commands. "*/
9304 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
9305 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
9307 /* "neighbor default-originate" commands. */
9308 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
9309 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
9310 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
9311 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9312 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
9313 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
9314 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
9315 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9316 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
9317 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
9318 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
9319 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9320 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
9321 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
9322 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
9323 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9324 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_cmd
);
9325 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_rmap_cmd
);
9326 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_cmd
);
9327 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9329 /* "neighbor port" commands. */
9330 install_element (BGP_NODE
, &neighbor_port_cmd
);
9331 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
9332 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
9334 /* "neighbor weight" commands. */
9335 install_element (BGP_NODE
, &neighbor_weight_cmd
);
9336 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
9337 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
9339 /* "neighbor override-capability" commands. */
9340 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
9341 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
9343 /* "neighbor strict-capability-match" commands. */
9344 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
9345 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
9347 /* "neighbor timers" commands. */
9348 install_element (BGP_NODE
, &neighbor_timers_cmd
);
9349 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
9351 /* "neighbor timers connect" commands. */
9352 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
9353 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
9354 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
9356 /* "neighbor advertisement-interval" commands. */
9357 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
9358 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
9359 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
9361 /* "neighbor version" commands. */
9362 install_element (BGP_NODE
, &neighbor_version_cmd
);
9364 /* "neighbor interface" commands. */
9365 install_element (BGP_NODE
, &neighbor_interface_cmd
);
9366 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
9368 /* "neighbor distribute" commands. */
9369 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
9370 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
9371 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
9372 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
9373 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
9374 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
9375 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
9376 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
9377 install_element (BGP_IPV6M_NODE
, &neighbor_distribute_list_cmd
);
9378 install_element (BGP_IPV6M_NODE
, &no_neighbor_distribute_list_cmd
);
9379 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
9380 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
9382 /* "neighbor prefix-list" commands. */
9383 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
9384 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
9385 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
9386 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
9387 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
9388 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
9389 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
9390 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
9391 install_element (BGP_IPV6M_NODE
, &neighbor_prefix_list_cmd
);
9392 install_element (BGP_IPV6M_NODE
, &no_neighbor_prefix_list_cmd
);
9393 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
9394 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
9396 /* "neighbor filter-list" commands. */
9397 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
9398 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
9399 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
9400 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
9401 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
9402 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
9403 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
9404 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
9405 install_element (BGP_IPV6M_NODE
, &neighbor_filter_list_cmd
);
9406 install_element (BGP_IPV6M_NODE
, &no_neighbor_filter_list_cmd
);
9407 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
9408 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
9410 /* "neighbor route-map" commands. */
9411 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
9412 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
9413 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
9414 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
9415 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
9416 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
9417 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
9418 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
9419 install_element (BGP_IPV6M_NODE
, &neighbor_route_map_cmd
);
9420 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_map_cmd
);
9421 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
9422 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
9424 /* "neighbor unsuppress-map" commands. */
9425 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
9426 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
9427 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
9428 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
9429 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
9430 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
9431 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
9432 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
9433 install_element (BGP_IPV6M_NODE
, &neighbor_unsuppress_map_cmd
);
9434 install_element (BGP_IPV6M_NODE
, &no_neighbor_unsuppress_map_cmd
);
9435 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
9436 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
9438 /* "neighbor maximum-prefix" commands. */
9439 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
9440 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9441 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9442 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9443 install_element (BGP_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9444 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9445 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
9446 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9447 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9448 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9449 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9450 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9451 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9452 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
9453 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9454 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9455 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9456 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9457 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9458 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
9459 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9460 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9461 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9462 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9463 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9464 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9465 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
9466 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9467 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9468 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9469 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9470 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9471 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
9472 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9473 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9474 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9475 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9476 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9477 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9478 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
9479 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9480 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9481 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9482 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9483 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9484 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
9485 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9486 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9487 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9488 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9489 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9490 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9491 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_cmd
);
9492 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9493 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9494 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9495 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9496 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9497 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_cmd
);
9498 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9499 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9500 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9501 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9502 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9503 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9504 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
9505 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9506 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9507 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9508 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9509 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9510 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
9511 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9512 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9513 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9514 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9515 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9516 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9518 /* "neighbor allowas-in" */
9519 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
9520 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
9521 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
9522 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
9523 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
9524 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
9525 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
9526 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
9527 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
9528 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
9529 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
9530 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
9531 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_cmd
);
9532 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_arg_cmd
);
9533 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_cmd
);
9534 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
9535 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
9536 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
9538 /* address-family commands. */
9539 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
9540 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
9542 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
9543 install_element (BGP_NODE
, &address_family_ipv6_safi_cmd
);
9544 #endif /* HAVE_IPV6 */
9545 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
9546 install_element (BGP_NODE
, &address_family_vpnv4_unicast_cmd
);
9548 /* "exit-address-family" command. */
9549 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
9550 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
9551 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
9552 install_element (BGP_IPV6M_NODE
, &exit_address_family_cmd
);
9553 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
9555 /* "clear ip bgp commands" */
9556 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
9557 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
9558 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
9559 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
9560 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
9561 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
9563 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
9564 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
9565 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
9566 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
9567 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
9568 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
9569 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
9570 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
9571 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
9572 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
9573 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
9574 #endif /* HAVE_IPV6 */
9576 /* "clear ip bgp neighbor soft in" */
9577 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
9578 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
9579 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
9580 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
9581 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_prefix_filter_cmd
);
9582 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
9583 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
9584 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
9585 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
9586 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
9587 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
9588 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
9589 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
9590 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
9591 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
9592 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
9593 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
9594 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
9595 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
9596 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
9597 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
9598 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
);
9599 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
9600 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
9601 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
9602 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
9603 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
9604 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
9605 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
9606 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
9607 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
9608 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
9609 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
9610 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
9611 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_in_cmd
);
9612 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_in_cmd
);
9613 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_in_cmd
);
9614 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_in_cmd
);
9615 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_in_cmd
);
9616 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_in_cmd
);
9618 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
9619 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
9620 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
9621 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
9622 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
9623 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
9624 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
9625 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
9626 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
9627 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
9628 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
9629 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
9630 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
9631 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
9632 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
9633 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
9634 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
9635 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
9636 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
9637 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
9638 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
9639 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
9640 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
9641 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
9642 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
9643 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
9644 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
9645 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
9646 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
9647 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
9648 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
9649 #endif /* HAVE_IPV6 */
9651 /* "clear ip bgp neighbor soft out" */
9652 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
9653 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
9654 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
9655 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
9656 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
9657 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
9658 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
9659 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
9660 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
9661 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
9662 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
9663 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
9664 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
9665 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
9666 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
9667 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
9668 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
9669 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
9670 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
9671 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
9672 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
9673 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
9674 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_out_cmd
);
9675 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_out_cmd
);
9676 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_out_cmd
);
9677 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_out_cmd
);
9678 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_out_cmd
);
9679 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_out_cmd
);
9681 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
9682 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
9683 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
9684 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
9685 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
9686 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
9687 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
9688 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
9689 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
9690 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
9691 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
9692 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
9693 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
9694 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
9695 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
9696 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
9697 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
9698 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
9699 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
9700 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
9701 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
9702 #endif /* HAVE_IPV6 */
9704 /* "clear ip bgp neighbor soft" */
9705 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
9706 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
9707 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
9708 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
9709 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
9710 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
9711 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
9712 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
9713 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
9714 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
9715 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
9716 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
9717 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_cmd
);
9718 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_cmd
);
9719 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_cmd
);
9721 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
9722 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
9723 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
9724 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
9725 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
9726 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
9727 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
9728 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
9729 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
9730 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
9731 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
9732 #endif /* HAVE_IPV6 */
9734 /* "clear ip bgp neighbor rsclient" */
9735 install_element (ENABLE_NODE
, &clear_ip_bgp_all_rsclient_cmd
);
9736 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_rsclient_cmd
);
9737 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_rsclient_cmd
);
9738 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_rsclient_cmd
);
9740 install_element (ENABLE_NODE
, &clear_bgp_all_rsclient_cmd
);
9741 install_element (ENABLE_NODE
, &clear_bgp_instance_all_rsclient_cmd
);
9742 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_rsclient_cmd
);
9743 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_all_rsclient_cmd
);
9744 install_element (ENABLE_NODE
, &clear_bgp_peer_rsclient_cmd
);
9745 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_rsclient_cmd
);
9746 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_rsclient_cmd
);
9747 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_peer_rsclient_cmd
);
9748 #endif /* HAVE_IPV6 */
9750 /* "show ip bgp summary" commands. */
9751 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
9752 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
9753 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9754 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9755 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9756 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9758 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
9759 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
9760 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
9761 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9762 #endif /* HAVE_IPV6 */
9763 install_element (RESTRICTED_NODE
, &show_ip_bgp_summary_cmd
);
9764 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_summary_cmd
);
9765 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9766 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9767 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9768 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9770 install_element (RESTRICTED_NODE
, &show_bgp_summary_cmd
);
9771 install_element (RESTRICTED_NODE
, &show_bgp_instance_summary_cmd
);
9772 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_summary_cmd
);
9773 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9774 #endif /* HAVE_IPV6 */
9775 install_element (ENABLE_NODE
, &show_ip_bgp_summary_cmd
);
9776 install_element (ENABLE_NODE
, &show_ip_bgp_instance_summary_cmd
);
9777 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9778 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9779 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9780 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9782 install_element (ENABLE_NODE
, &show_bgp_summary_cmd
);
9783 install_element (ENABLE_NODE
, &show_bgp_instance_summary_cmd
);
9784 install_element (ENABLE_NODE
, &show_bgp_ipv6_summary_cmd
);
9785 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9786 #endif /* HAVE_IPV6 */
9788 /* "show ip bgp neighbors" commands. */
9789 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
9790 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
9791 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9792 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9793 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
9794 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
9795 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9796 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9797 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
9798 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9799 install_element (RESTRICTED_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9800 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9801 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9802 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9803 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9804 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_cmd
);
9805 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
9806 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9807 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9808 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
9809 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
9810 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9811 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9812 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
9813 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9816 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
9817 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
9818 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
9819 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9820 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
9821 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
9822 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9823 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9824 install_element (RESTRICTED_NODE
, &show_bgp_neighbors_peer_cmd
);
9825 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9826 install_element (RESTRICTED_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9827 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9828 install_element (ENABLE_NODE
, &show_bgp_neighbors_cmd
);
9829 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_cmd
);
9830 install_element (ENABLE_NODE
, &show_bgp_neighbors_peer_cmd
);
9831 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9832 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_cmd
);
9833 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
9834 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9835 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9838 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
9839 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
9840 install_element (ENABLE_NODE
, &show_ipv6_bgp_summary_cmd
);
9841 install_element (ENABLE_NODE
, &show_ipv6_mbgp_summary_cmd
);
9842 #endif /* HAVE_IPV6 */
9844 /* "show ip bgp rsclient" commands. */
9845 install_element (VIEW_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9846 install_element (VIEW_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9847 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9848 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9849 install_element (RESTRICTED_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9850 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9851 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9852 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9853 install_element (ENABLE_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9854 install_element (ENABLE_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9855 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9856 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9859 install_element (VIEW_NODE
, &show_bgp_rsclient_summary_cmd
);
9860 install_element (VIEW_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9861 install_element (VIEW_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9862 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9863 install_element (RESTRICTED_NODE
, &show_bgp_rsclient_summary_cmd
);
9864 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9865 install_element (RESTRICTED_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9866 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9867 install_element (ENABLE_NODE
, &show_bgp_rsclient_summary_cmd
);
9868 install_element (ENABLE_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9869 install_element (ENABLE_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9870 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9871 #endif /* HAVE_IPV6 */
9873 /* "show ip bgp paths" commands. */
9874 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
9875 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
9876 install_element (ENABLE_NODE
, &show_ip_bgp_paths_cmd
);
9877 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
9879 /* "show ip bgp community" commands. */
9880 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
9881 install_element (ENABLE_NODE
, &show_ip_bgp_community_info_cmd
);
9883 /* "show ip bgp attribute-info" commands. */
9884 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
9885 install_element (ENABLE_NODE
, &show_ip_bgp_attr_info_cmd
);
9887 /* "redistribute" commands. */
9888 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
9889 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
9890 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
9891 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
9892 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
9893 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
9894 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
9895 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
9896 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
9897 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
9899 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
9900 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
9901 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
9902 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
9903 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
9904 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
9905 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
9906 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
9907 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
9908 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
9909 #endif /* HAVE_IPV6 */
9911 /* "show bgp memory" commands. */
9912 install_element (VIEW_NODE
, &show_bgp_memory_cmd
);
9913 install_element (RESTRICTED_NODE
, &show_bgp_memory_cmd
);
9914 install_element (ENABLE_NODE
, &show_bgp_memory_cmd
);
9916 /* "show bgp views" commands. */
9917 install_element (VIEW_NODE
, &show_bgp_views_cmd
);
9918 install_element (RESTRICTED_NODE
, &show_bgp_views_cmd
);
9919 install_element (ENABLE_NODE
, &show_bgp_views_cmd
);
9921 /* Community-list. */
9922 community_list_vty ();
9926 #include "bgp_regex.h"
9927 #include "bgp_clist.h"
9928 #include "bgp_ecommunity.h"
9930 /* VTY functions. */
9932 /* Direction value to string conversion. */
9934 community_direct_str (int direct
)
9938 case COMMUNITY_DENY
:
9940 case COMMUNITY_PERMIT
:
9947 /* Display error string. */
9949 community_list_perror (struct vty
*vty
, int ret
)
9953 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
9954 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
9956 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
9957 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
9959 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
9960 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
9962 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
9963 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
9968 /* VTY interface for community_set() function. */
9970 community_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
9971 int style
, int reject_all_digit_name
)
9977 /* Check the list type. */
9978 if (strncmp (argv
[1], "p", 1) == 0)
9979 direct
= COMMUNITY_PERMIT
;
9980 else if (strncmp (argv
[1], "d", 1) == 0)
9981 direct
= COMMUNITY_DENY
;
9984 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9989 /* All digit name check. */
9990 if (reject_all_digit_name
&& all_digit (argv
[0]))
9992 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
9996 /* Concat community string argument. */
9998 str
= argv_concat (argv
, argc
, 2);
10002 /* When community_list_set() return nevetive value, it means
10003 malformed community string. */
10004 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
10006 /* Free temporary community list string allocated by
10009 XFREE (MTYPE_TMP
, str
);
10013 /* Display error string. */
10014 community_list_perror (vty
, ret
);
10015 return CMD_WARNING
;
10018 return CMD_SUCCESS
;
10021 /* Communiyt-list entry delete. */
10023 community_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
10032 /* Check the list direct. */
10033 if (strncmp (argv
[1], "p", 1) == 0)
10034 direct
= COMMUNITY_PERMIT
;
10035 else if (strncmp (argv
[1], "d", 1) == 0)
10036 direct
= COMMUNITY_DENY
;
10039 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10041 return CMD_WARNING
;
10044 /* Concat community string argument. */
10045 str
= argv_concat (argv
, argc
, 2);
10048 /* Unset community list. */
10049 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
10051 /* Free temporary community list string allocated by
10054 XFREE (MTYPE_TMP
, str
);
10058 community_list_perror (vty
, ret
);
10059 return CMD_WARNING
;
10062 return CMD_SUCCESS
;
10065 /* "community-list" keyword help string. */
10066 #define COMMUNITY_LIST_STR "Add a community list entry\n"
10067 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
10069 DEFUN (ip_community_list_standard
,
10070 ip_community_list_standard_cmd
,
10071 "ip community-list <1-99> (deny|permit) .AA:NN",
10074 "Community list number (standard)\n"
10075 "Specify community to reject\n"
10076 "Specify community to accept\n"
10079 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
10082 ALIAS (ip_community_list_standard
,
10083 ip_community_list_standard2_cmd
,
10084 "ip community-list <1-99> (deny|permit)",
10087 "Community list number (standard)\n"
10088 "Specify community to reject\n"
10089 "Specify community to accept\n")
10091 DEFUN (ip_community_list_expanded
,
10092 ip_community_list_expanded_cmd
,
10093 "ip community-list <100-500> (deny|permit) .LINE",
10096 "Community list number (expanded)\n"
10097 "Specify community to reject\n"
10098 "Specify community to accept\n"
10099 "An ordered list as a regular-expression\n")
10101 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
10104 DEFUN (ip_community_list_name_standard
,
10105 ip_community_list_name_standard_cmd
,
10106 "ip community-list standard WORD (deny|permit) .AA:NN",
10109 "Add a standard community-list entry\n"
10110 "Community list name\n"
10111 "Specify community to reject\n"
10112 "Specify community to accept\n"
10115 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
10118 ALIAS (ip_community_list_name_standard
,
10119 ip_community_list_name_standard2_cmd
,
10120 "ip community-list standard WORD (deny|permit)",
10123 "Add a standard community-list entry\n"
10124 "Community list name\n"
10125 "Specify community to reject\n"
10126 "Specify community to accept\n")
10128 DEFUN (ip_community_list_name_expanded
,
10129 ip_community_list_name_expanded_cmd
,
10130 "ip community-list expanded WORD (deny|permit) .LINE",
10133 "Add an expanded community-list entry\n"
10134 "Community list name\n"
10135 "Specify community to reject\n"
10136 "Specify community to accept\n"
10137 "An ordered list as a regular-expression\n")
10139 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
10142 DEFUN (no_ip_community_list_standard_all
,
10143 no_ip_community_list_standard_all_cmd
,
10144 "no ip community-list <1-99>",
10148 "Community list number (standard)\n")
10150 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10153 DEFUN (no_ip_community_list_expanded_all
,
10154 no_ip_community_list_expanded_all_cmd
,
10155 "no ip community-list <100-500>",
10159 "Community list number (expanded)\n")
10161 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10164 DEFUN (no_ip_community_list_name_standard_all
,
10165 no_ip_community_list_name_standard_all_cmd
,
10166 "no ip community-list standard WORD",
10170 "Add a standard community-list entry\n"
10171 "Community list name\n")
10173 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10176 DEFUN (no_ip_community_list_name_expanded_all
,
10177 no_ip_community_list_name_expanded_all_cmd
,
10178 "no ip community-list expanded WORD",
10182 "Add an expanded community-list entry\n"
10183 "Community list name\n")
10185 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10188 DEFUN (no_ip_community_list_standard
,
10189 no_ip_community_list_standard_cmd
,
10190 "no ip community-list <1-99> (deny|permit) .AA:NN",
10194 "Community list number (standard)\n"
10195 "Specify community to reject\n"
10196 "Specify community to accept\n"
10199 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10202 DEFUN (no_ip_community_list_expanded
,
10203 no_ip_community_list_expanded_cmd
,
10204 "no ip community-list <100-500> (deny|permit) .LINE",
10208 "Community list number (expanded)\n"
10209 "Specify community to reject\n"
10210 "Specify community to accept\n"
10211 "An ordered list as a regular-expression\n")
10213 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10216 DEFUN (no_ip_community_list_name_standard
,
10217 no_ip_community_list_name_standard_cmd
,
10218 "no ip community-list standard WORD (deny|permit) .AA:NN",
10222 "Specify a standard community-list\n"
10223 "Community list name\n"
10224 "Specify community to reject\n"
10225 "Specify community to accept\n"
10228 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10231 DEFUN (no_ip_community_list_name_expanded
,
10232 no_ip_community_list_name_expanded_cmd
,
10233 "no ip community-list expanded WORD (deny|permit) .LINE",
10237 "Specify an expanded community-list\n"
10238 "Community list name\n"
10239 "Specify community to reject\n"
10240 "Specify community to accept\n"
10241 "An ordered list as a regular-expression\n")
10243 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10247 community_list_show (struct vty
*vty
, struct community_list
*list
)
10249 struct community_entry
*entry
;
10251 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10253 if (entry
== list
->head
)
10255 if (all_digit (list
->name
))
10256 vty_out (vty
, "Community %s list %s%s",
10257 entry
->style
== COMMUNITY_LIST_STANDARD
?
10258 "standard" : "(expanded) access",
10259 list
->name
, VTY_NEWLINE
);
10261 vty_out (vty
, "Named Community %s list %s%s",
10262 entry
->style
== COMMUNITY_LIST_STANDARD
?
10263 "standard" : "expanded",
10264 list
->name
, VTY_NEWLINE
);
10267 vty_out (vty
, " %s%s",
10268 community_direct_str (entry
->direct
), VTY_NEWLINE
);
10270 vty_out (vty
, " %s %s%s",
10271 community_direct_str (entry
->direct
),
10272 entry
->style
== COMMUNITY_LIST_STANDARD
10273 ? community_str (entry
->u
.com
) : entry
->config
,
10278 DEFUN (show_ip_community_list
,
10279 show_ip_community_list_cmd
,
10280 "show ip community-list",
10283 "List community-list\n")
10285 struct community_list
*list
;
10286 struct community_list_master
*cm
;
10288 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
10290 return CMD_SUCCESS
;
10292 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10293 community_list_show (vty
, list
);
10295 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10296 community_list_show (vty
, list
);
10298 return CMD_SUCCESS
;
10301 DEFUN (show_ip_community_list_arg
,
10302 show_ip_community_list_arg_cmd
,
10303 "show ip community-list (<1-500>|WORD)",
10306 "List community-list\n"
10307 "Community-list number\n"
10308 "Community-list name\n")
10310 struct community_list
*list
;
10312 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_MASTER
);
10315 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
10316 return CMD_WARNING
;
10319 community_list_show (vty
, list
);
10321 return CMD_SUCCESS
;
10325 extcommunity_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
10326 int style
, int reject_all_digit_name
)
10332 /* Check the list type. */
10333 if (strncmp (argv
[1], "p", 1) == 0)
10334 direct
= COMMUNITY_PERMIT
;
10335 else if (strncmp (argv
[1], "d", 1) == 0)
10336 direct
= COMMUNITY_DENY
;
10339 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10341 return CMD_WARNING
;
10344 /* All digit name check. */
10345 if (reject_all_digit_name
&& all_digit (argv
[0]))
10347 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
10348 return CMD_WARNING
;
10351 /* Concat community string argument. */
10353 str
= argv_concat (argv
, argc
, 2);
10357 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
10359 /* Free temporary community list string allocated by
10362 XFREE (MTYPE_TMP
, str
);
10366 community_list_perror (vty
, ret
);
10367 return CMD_WARNING
;
10369 return CMD_SUCCESS
;
10373 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
10382 /* Check the list direct. */
10383 if (strncmp (argv
[1], "p", 1) == 0)
10384 direct
= COMMUNITY_PERMIT
;
10385 else if (strncmp (argv
[1], "d", 1) == 0)
10386 direct
= COMMUNITY_DENY
;
10389 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10391 return CMD_WARNING
;
10394 /* Concat community string argument. */
10395 str
= argv_concat (argv
, argc
, 2);
10398 /* Unset community list. */
10399 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
10401 /* Free temporary community list string allocated by
10404 XFREE (MTYPE_TMP
, str
);
10408 community_list_perror (vty
, ret
);
10409 return CMD_WARNING
;
10412 return CMD_SUCCESS
;
10415 /* "extcommunity-list" keyword help string. */
10416 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
10417 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
10419 DEFUN (ip_extcommunity_list_standard
,
10420 ip_extcommunity_list_standard_cmd
,
10421 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
10423 EXTCOMMUNITY_LIST_STR
10424 "Extended Community list number (standard)\n"
10425 "Specify community to reject\n"
10426 "Specify community to accept\n"
10427 EXTCOMMUNITY_VAL_STR
)
10429 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
10432 ALIAS (ip_extcommunity_list_standard
,
10433 ip_extcommunity_list_standard2_cmd
,
10434 "ip extcommunity-list <1-99> (deny|permit)",
10436 EXTCOMMUNITY_LIST_STR
10437 "Extended Community list number (standard)\n"
10438 "Specify community to reject\n"
10439 "Specify community to accept\n")
10441 DEFUN (ip_extcommunity_list_expanded
,
10442 ip_extcommunity_list_expanded_cmd
,
10443 "ip extcommunity-list <100-500> (deny|permit) .LINE",
10445 EXTCOMMUNITY_LIST_STR
10446 "Extended Community list number (expanded)\n"
10447 "Specify community to reject\n"
10448 "Specify community to accept\n"
10449 "An ordered list as a regular-expression\n")
10451 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
10454 DEFUN (ip_extcommunity_list_name_standard
,
10455 ip_extcommunity_list_name_standard_cmd
,
10456 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
10458 EXTCOMMUNITY_LIST_STR
10459 "Specify standard extcommunity-list\n"
10460 "Extended Community list name\n"
10461 "Specify community to reject\n"
10462 "Specify community to accept\n"
10463 EXTCOMMUNITY_VAL_STR
)
10465 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
10468 ALIAS (ip_extcommunity_list_name_standard
,
10469 ip_extcommunity_list_name_standard2_cmd
,
10470 "ip extcommunity-list standard WORD (deny|permit)",
10472 EXTCOMMUNITY_LIST_STR
10473 "Specify standard extcommunity-list\n"
10474 "Extended Community list name\n"
10475 "Specify community to reject\n"
10476 "Specify community to accept\n")
10478 DEFUN (ip_extcommunity_list_name_expanded
,
10479 ip_extcommunity_list_name_expanded_cmd
,
10480 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
10482 EXTCOMMUNITY_LIST_STR
10483 "Specify expanded extcommunity-list\n"
10484 "Extended Community list name\n"
10485 "Specify community to reject\n"
10486 "Specify community to accept\n"
10487 "An ordered list as a regular-expression\n")
10489 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
10492 DEFUN (no_ip_extcommunity_list_standard_all
,
10493 no_ip_extcommunity_list_standard_all_cmd
,
10494 "no ip extcommunity-list <1-99>",
10497 EXTCOMMUNITY_LIST_STR
10498 "Extended Community list number (standard)\n")
10500 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10503 DEFUN (no_ip_extcommunity_list_expanded_all
,
10504 no_ip_extcommunity_list_expanded_all_cmd
,
10505 "no ip extcommunity-list <100-500>",
10508 EXTCOMMUNITY_LIST_STR
10509 "Extended Community list number (expanded)\n")
10511 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10514 DEFUN (no_ip_extcommunity_list_name_standard_all
,
10515 no_ip_extcommunity_list_name_standard_all_cmd
,
10516 "no ip extcommunity-list standard WORD",
10519 EXTCOMMUNITY_LIST_STR
10520 "Specify standard extcommunity-list\n"
10521 "Extended Community list name\n")
10523 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10526 DEFUN (no_ip_extcommunity_list_name_expanded_all
,
10527 no_ip_extcommunity_list_name_expanded_all_cmd
,
10528 "no ip extcommunity-list expanded WORD",
10531 EXTCOMMUNITY_LIST_STR
10532 "Specify expanded extcommunity-list\n"
10533 "Extended Community list name\n")
10535 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10538 DEFUN (no_ip_extcommunity_list_standard
,
10539 no_ip_extcommunity_list_standard_cmd
,
10540 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
10543 EXTCOMMUNITY_LIST_STR
10544 "Extended Community list number (standard)\n"
10545 "Specify community to reject\n"
10546 "Specify community to accept\n"
10547 EXTCOMMUNITY_VAL_STR
)
10549 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10552 DEFUN (no_ip_extcommunity_list_expanded
,
10553 no_ip_extcommunity_list_expanded_cmd
,
10554 "no ip extcommunity-list <100-500> (deny|permit) .LINE",
10557 EXTCOMMUNITY_LIST_STR
10558 "Extended Community list number (expanded)\n"
10559 "Specify community to reject\n"
10560 "Specify community to accept\n"
10561 "An ordered list as a regular-expression\n")
10563 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10566 DEFUN (no_ip_extcommunity_list_name_standard
,
10567 no_ip_extcommunity_list_name_standard_cmd
,
10568 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
10571 EXTCOMMUNITY_LIST_STR
10572 "Specify standard extcommunity-list\n"
10573 "Extended Community list name\n"
10574 "Specify community to reject\n"
10575 "Specify community to accept\n"
10576 EXTCOMMUNITY_VAL_STR
)
10578 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10581 DEFUN (no_ip_extcommunity_list_name_expanded
,
10582 no_ip_extcommunity_list_name_expanded_cmd
,
10583 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
10586 EXTCOMMUNITY_LIST_STR
10587 "Specify expanded extcommunity-list\n"
10588 "Community list name\n"
10589 "Specify community to reject\n"
10590 "Specify community to accept\n"
10591 "An ordered list as a regular-expression\n")
10593 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10597 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
10599 struct community_entry
*entry
;
10601 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10603 if (entry
== list
->head
)
10605 if (all_digit (list
->name
))
10606 vty_out (vty
, "Extended community %s list %s%s",
10607 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10608 "standard" : "(expanded) access",
10609 list
->name
, VTY_NEWLINE
);
10611 vty_out (vty
, "Named extended community %s list %s%s",
10612 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10613 "standard" : "expanded",
10614 list
->name
, VTY_NEWLINE
);
10617 vty_out (vty
, " %s%s",
10618 community_direct_str (entry
->direct
), VTY_NEWLINE
);
10620 vty_out (vty
, " %s %s%s",
10621 community_direct_str (entry
->direct
),
10622 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10623 entry
->u
.ecom
->str
: entry
->config
,
10628 DEFUN (show_ip_extcommunity_list
,
10629 show_ip_extcommunity_list_cmd
,
10630 "show ip extcommunity-list",
10633 "List extended-community list\n")
10635 struct community_list
*list
;
10636 struct community_list_master
*cm
;
10638 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
10640 return CMD_SUCCESS
;
10642 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10643 extcommunity_list_show (vty
, list
);
10645 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10646 extcommunity_list_show (vty
, list
);
10648 return CMD_SUCCESS
;
10651 DEFUN (show_ip_extcommunity_list_arg
,
10652 show_ip_extcommunity_list_arg_cmd
,
10653 "show ip extcommunity-list (<1-500>|WORD)",
10656 "List extended-community list\n"
10657 "Extcommunity-list number\n"
10658 "Extcommunity-list name\n")
10660 struct community_list
*list
;
10662 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_MASTER
);
10665 vty_out (vty
, "%% Can't find extcommunit-list%s", VTY_NEWLINE
);
10666 return CMD_WARNING
;
10669 extcommunity_list_show (vty
, list
);
10671 return CMD_SUCCESS
;
10674 /* Return configuration string of community-list entry. */
10675 static const char *
10676 community_list_config_str (struct community_entry
*entry
)
10684 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
10685 str
= community_str (entry
->u
.com
);
10687 str
= entry
->config
;
10692 /* Display community-list and extcommunity-list configuration. */
10694 community_list_config_write (struct vty
*vty
)
10696 struct community_list
*list
;
10697 struct community_entry
*entry
;
10698 struct community_list_master
*cm
;
10701 /* Community-list. */
10702 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
10704 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10705 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10707 vty_out (vty
, "ip community-list %s %s %s%s",
10708 list
->name
, community_direct_str (entry
->direct
),
10709 community_list_config_str (entry
),
10713 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10714 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10716 vty_out (vty
, "ip community-list %s %s %s %s%s",
10717 entry
->style
== COMMUNITY_LIST_STANDARD
10718 ? "standard" : "expanded",
10719 list
->name
, community_direct_str (entry
->direct
),
10720 community_list_config_str (entry
),
10725 /* Extcommunity-list. */
10726 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
10728 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10729 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10731 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
10732 list
->name
, community_direct_str (entry
->direct
),
10733 community_list_config_str (entry
), VTY_NEWLINE
);
10736 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10737 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10739 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
10740 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
10741 ? "standard" : "expanded",
10742 list
->name
, community_direct_str (entry
->direct
),
10743 community_list_config_str (entry
), VTY_NEWLINE
);
10749 static struct cmd_node community_list_node
=
10751 COMMUNITY_LIST_NODE
,
10753 1 /* Export to vtysh. */
10757 community_list_vty (void)
10759 install_node (&community_list_node
, community_list_config_write
);
10761 /* Community-list. */
10762 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
10763 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
10764 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
10765 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
10766 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
10767 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
10768 install_element (CONFIG_NODE
, &no_ip_community_list_standard_all_cmd
);
10769 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_all_cmd
);
10770 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_all_cmd
);
10771 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_all_cmd
);
10772 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
10773 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
10774 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
10775 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
10776 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
10777 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
10778 install_element (ENABLE_NODE
, &show_ip_community_list_cmd
);
10779 install_element (ENABLE_NODE
, &show_ip_community_list_arg_cmd
);
10781 /* Extcommunity-list. */
10782 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
10783 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
10784 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
10785 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
10786 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
10787 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
10788 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_all_cmd
);
10789 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_all_cmd
);
10790 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_all_cmd
);
10791 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_all_cmd
);
10792 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
10793 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
10794 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
10795 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
10796 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
10797 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);
10798 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_cmd
);
10799 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_arg_cmd
);