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 %d%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 %d%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 %d. 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 %d 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 %d 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
;
2080 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2084 /* If it is already a RS-Client, don't do anything. */
2085 if ( CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
2088 if ( ! peer_rsclient_active (peer
) )
2090 peer
= peer_lock (peer
); /* rsclient peer list reference */
2091 listnode_add_sort (bgp
->rsclient
, peer
);
2094 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2096 return bgp_vty_return (vty
, ret
);
2098 peer
->rib
[afi
][safi
] = bgp_table_init (afi
, safi
);
2099 peer
->rib
[afi
][safi
]->type
= BGP_TABLE_RSCLIENT
;
2100 peer
->rib
[afi
][safi
]->owner
= peer
;
2102 /* Check for existing 'network' and 'redistribute' routes. */
2103 bgp_check_local_routes_rsclient (peer
, afi
, safi
);
2105 /* Check for routes for peers configured with 'soft-reconfiguration'. */
2106 bgp_soft_reconfig_rsclient (peer
, afi
, safi
);
2108 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
2110 group
= peer
->group
;
2111 gfilter
= &peer
->filter
[afi
][safi
];
2113 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
2115 pfilter
= &peer
->filter
[afi
][safi
];
2117 /* Members of a non-RS-Client group should not be RS-Clients, as that
2118 is checked when the become part of the peer-group */
2119 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2121 return bgp_vty_return (vty
, ret
);
2123 /* Make peer's RIB point to group's RIB. */
2124 peer
->rib
[afi
][safi
] = group
->conf
->rib
[afi
][safi
];
2126 /* Import policy. */
2127 if (pfilter
->map
[RMAP_IMPORT
].name
)
2128 free (pfilter
->map
[RMAP_IMPORT
].name
);
2129 if (gfilter
->map
[RMAP_IMPORT
].name
)
2131 pfilter
->map
[RMAP_IMPORT
].name
= strdup (gfilter
->map
[RMAP_IMPORT
].name
);
2132 pfilter
->map
[RMAP_IMPORT
].map
= gfilter
->map
[RMAP_IMPORT
].map
;
2136 pfilter
->map
[RMAP_IMPORT
].name
= NULL
;
2137 pfilter
->map
[RMAP_IMPORT
].map
=NULL
;
2140 /* Export policy. */
2141 if (gfilter
->map
[RMAP_EXPORT
].name
&& ! pfilter
->map
[RMAP_EXPORT
].name
)
2143 pfilter
->map
[RMAP_EXPORT
].name
= strdup (gfilter
->map
[RMAP_EXPORT
].name
);
2144 pfilter
->map
[RMAP_EXPORT
].map
= gfilter
->map
[RMAP_EXPORT
].map
;
2152 peer_rsclient_unset_vty (struct vty
*vty
, const char *peer_str
,
2158 struct peer_group
*group
;
2159 struct listnode
*node
, *nnode
;
2163 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2167 /* If it is not a RS-Client, don't do anything. */
2168 if ( ! CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
2171 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
2173 group
= peer
->group
;
2175 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
2177 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2179 return bgp_vty_return (vty
, ret
);
2181 peer
->rib
[afi
][safi
] = NULL
;
2187 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2189 return bgp_vty_return (vty
, ret
);
2191 if ( ! peer_rsclient_active (peer
) )
2193 peer_unlock (peer
); /* peer bgp rsclient reference */
2194 listnode_delete (bgp
->rsclient
, peer
);
2197 bgp_table_finish (&peer
->rib
[bgp_node_afi(vty
)][bgp_node_safi(vty
)]);
2202 /* neighbor route-server-client. */
2203 DEFUN (neighbor_route_server_client
,
2204 neighbor_route_server_client_cmd
,
2205 NEIGHBOR_CMD2
"route-server-client",
2208 "Configure a neighbor as Route Server client\n")
2210 return peer_rsclient_set_vty (vty
, argv
[0], bgp_node_afi(vty
),
2211 bgp_node_safi(vty
));
2214 DEFUN (no_neighbor_route_server_client
,
2215 no_neighbor_route_server_client_cmd
,
2216 NO_NEIGHBOR_CMD2
"route-server-client",
2220 "Configure a neighbor as Route Server client\n")
2222 return peer_rsclient_unset_vty (vty
, argv
[0], bgp_node_afi(vty
),
2223 bgp_node_safi(vty
));
2226 DEFUN (neighbor_nexthop_local_unchanged
,
2227 neighbor_nexthop_local_unchanged_cmd
,
2228 NEIGHBOR_CMD2
"nexthop-local unchanged",
2231 "Configure treatment of outgoing link-local nexthop attribute\n"
2232 "Leave link-local nexthop unchanged for this peer\n")
2234 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2235 bgp_node_safi (vty
),
2236 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
2239 DEFUN (no_neighbor_nexthop_local_unchanged
,
2240 no_neighbor_nexthop_local_unchanged_cmd
,
2241 NO_NEIGHBOR_CMD2
"nexthop-local unchanged",
2245 "Configure treatment of outgoing link-local-nexthop attribute\n"
2246 "Leave link-local nexthop unchanged for this peer\n")
2248 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2249 bgp_node_safi (vty
),
2250 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
2253 DEFUN (neighbor_attr_unchanged
,
2254 neighbor_attr_unchanged_cmd
,
2255 NEIGHBOR_CMD2
"attribute-unchanged",
2258 "BGP attribute is propagated unchanged to this neighbor\n")
2260 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2261 bgp_node_safi (vty
),
2262 (PEER_FLAG_AS_PATH_UNCHANGED
|
2263 PEER_FLAG_NEXTHOP_UNCHANGED
|
2264 PEER_FLAG_MED_UNCHANGED
));
2267 DEFUN (neighbor_attr_unchanged1
,
2268 neighbor_attr_unchanged1_cmd
,
2269 NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2272 "BGP attribute is propagated unchanged to this neighbor\n"
2273 "As-path attribute\n"
2274 "Nexthop attribute\n"
2277 u_int16_t flags
= 0;
2279 if (strncmp (argv
[1], "as-path", 1) == 0)
2280 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2281 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2282 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2283 else if (strncmp (argv
[1], "med", 1) == 0)
2284 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2286 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2287 bgp_node_safi (vty
), flags
);
2290 DEFUN (neighbor_attr_unchanged2
,
2291 neighbor_attr_unchanged2_cmd
,
2292 NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2295 "BGP attribute is propagated unchanged to this neighbor\n"
2296 "As-path attribute\n"
2297 "Nexthop attribute\n"
2300 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2302 if (strncmp (argv
[1], "next-hop", 1) == 0)
2303 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2304 else if (strncmp (argv
[1], "med", 1) == 0)
2305 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2307 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2308 bgp_node_safi (vty
), flags
);
2312 DEFUN (neighbor_attr_unchanged3
,
2313 neighbor_attr_unchanged3_cmd
,
2314 NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2317 "BGP attribute is propagated unchanged to this neighbor\n"
2318 "Nexthop attribute\n"
2319 "As-path attribute\n"
2322 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2324 if (strncmp (argv
[1], "as-path", 1) == 0)
2325 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2326 else if (strncmp (argv
[1], "med", 1) == 0)
2327 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2329 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2330 bgp_node_safi (vty
), flags
);
2333 DEFUN (neighbor_attr_unchanged4
,
2334 neighbor_attr_unchanged4_cmd
,
2335 NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2338 "BGP attribute is propagated unchanged to this neighbor\n"
2340 "As-path attribute\n"
2341 "Nexthop attribute\n")
2343 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2345 if (strncmp (argv
[1], "as-path", 1) == 0)
2346 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2347 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2348 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2350 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2351 bgp_node_safi (vty
), flags
);
2354 ALIAS (neighbor_attr_unchanged
,
2355 neighbor_attr_unchanged5_cmd
,
2356 NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2359 "BGP attribute is propagated unchanged to this neighbor\n"
2360 "As-path attribute\n"
2361 "Nexthop attribute\n"
2364 ALIAS (neighbor_attr_unchanged
,
2365 neighbor_attr_unchanged6_cmd
,
2366 NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2369 "BGP attribute is propagated unchanged to this neighbor\n"
2370 "As-path attribute\n"
2372 "Nexthop attribute\n")
2374 ALIAS (neighbor_attr_unchanged
,
2375 neighbor_attr_unchanged7_cmd
,
2376 NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2379 "BGP attribute is propagated unchanged to this neighbor\n"
2380 "Nexthop attribute\n"
2382 "As-path attribute\n")
2384 ALIAS (neighbor_attr_unchanged
,
2385 neighbor_attr_unchanged8_cmd
,
2386 NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2389 "BGP attribute is propagated unchanged to this neighbor\n"
2390 "Nexthop attribute\n"
2391 "As-path attribute\n"
2394 ALIAS (neighbor_attr_unchanged
,
2395 neighbor_attr_unchanged9_cmd
,
2396 NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2399 "BGP attribute is propagated unchanged to this neighbor\n"
2401 "Nexthop attribute\n"
2402 "As-path attribute\n")
2404 ALIAS (neighbor_attr_unchanged
,
2405 neighbor_attr_unchanged10_cmd
,
2406 NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2409 "BGP attribute is propagated unchanged to this neighbor\n"
2411 "As-path attribute\n"
2412 "Nexthop attribute\n")
2414 DEFUN (no_neighbor_attr_unchanged
,
2415 no_neighbor_attr_unchanged_cmd
,
2416 NO_NEIGHBOR_CMD2
"attribute-unchanged",
2420 "BGP attribute is propagated unchanged to this neighbor\n")
2422 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2423 bgp_node_safi (vty
),
2424 (PEER_FLAG_AS_PATH_UNCHANGED
|
2425 PEER_FLAG_NEXTHOP_UNCHANGED
|
2426 PEER_FLAG_MED_UNCHANGED
));
2429 DEFUN (no_neighbor_attr_unchanged1
,
2430 no_neighbor_attr_unchanged1_cmd
,
2431 NO_NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2435 "BGP attribute is propagated unchanged to this neighbor\n"
2436 "As-path attribute\n"
2437 "Nexthop attribute\n"
2440 u_int16_t flags
= 0;
2442 if (strncmp (argv
[1], "as-path", 1) == 0)
2443 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2444 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2445 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2446 else if (strncmp (argv
[1], "med", 1) == 0)
2447 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2449 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2450 bgp_node_safi (vty
), flags
);
2453 DEFUN (no_neighbor_attr_unchanged2
,
2454 no_neighbor_attr_unchanged2_cmd
,
2455 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2459 "BGP attribute is propagated unchanged to this neighbor\n"
2460 "As-path attribute\n"
2461 "Nexthop attribute\n"
2464 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2466 if (strncmp (argv
[1], "next-hop", 1) == 0)
2467 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2468 else if (strncmp (argv
[1], "med", 1) == 0)
2469 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2471 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2472 bgp_node_safi (vty
), flags
);
2475 DEFUN (no_neighbor_attr_unchanged3
,
2476 no_neighbor_attr_unchanged3_cmd
,
2477 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2481 "BGP attribute is propagated unchanged to this neighbor\n"
2482 "Nexthop attribute\n"
2483 "As-path attribute\n"
2486 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2488 if (strncmp (argv
[1], "as-path", 1) == 0)
2489 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2490 else if (strncmp (argv
[1], "med", 1) == 0)
2491 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2493 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2494 bgp_node_safi (vty
), flags
);
2497 DEFUN (no_neighbor_attr_unchanged4
,
2498 no_neighbor_attr_unchanged4_cmd
,
2499 NO_NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2503 "BGP attribute is propagated unchanged to this neighbor\n"
2505 "As-path attribute\n"
2506 "Nexthop attribute\n")
2508 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2510 if (strncmp (argv
[1], "as-path", 1) == 0)
2511 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2512 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2513 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2515 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2516 bgp_node_safi (vty
), flags
);
2519 ALIAS (no_neighbor_attr_unchanged
,
2520 no_neighbor_attr_unchanged5_cmd
,
2521 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2525 "BGP attribute is propagated unchanged to this neighbor\n"
2526 "As-path attribute\n"
2527 "Nexthop attribute\n"
2530 ALIAS (no_neighbor_attr_unchanged
,
2531 no_neighbor_attr_unchanged6_cmd
,
2532 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2536 "BGP attribute is propagated unchanged to this neighbor\n"
2537 "As-path attribute\n"
2539 "Nexthop attribute\n")
2541 ALIAS (no_neighbor_attr_unchanged
,
2542 no_neighbor_attr_unchanged7_cmd
,
2543 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2547 "BGP attribute is propagated unchanged to this neighbor\n"
2548 "Nexthop attribute\n"
2550 "As-path attribute\n")
2552 ALIAS (no_neighbor_attr_unchanged
,
2553 no_neighbor_attr_unchanged8_cmd
,
2554 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2558 "BGP attribute is propagated unchanged to this neighbor\n"
2559 "Nexthop attribute\n"
2560 "As-path attribute\n"
2563 ALIAS (no_neighbor_attr_unchanged
,
2564 no_neighbor_attr_unchanged9_cmd
,
2565 NO_NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2569 "BGP attribute is propagated unchanged to this neighbor\n"
2571 "Nexthop attribute\n"
2572 "As-path attribute\n")
2574 ALIAS (no_neighbor_attr_unchanged
,
2575 no_neighbor_attr_unchanged10_cmd
,
2576 NO_NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2580 "BGP attribute is propagated unchanged to this neighbor\n"
2582 "As-path attribute\n"
2583 "Nexthop attribute\n")
2585 /* For old version Zebra compatibility. */
2586 DEFUN_DEPRECATED (neighbor_transparent_as
,
2587 neighbor_transparent_as_cmd
,
2588 NEIGHBOR_CMD
"transparent-as",
2591 "Do not append my AS number even peer is EBGP peer\n")
2593 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2594 bgp_node_safi (vty
),
2595 PEER_FLAG_AS_PATH_UNCHANGED
);
2598 DEFUN_DEPRECATED (neighbor_transparent_nexthop
,
2599 neighbor_transparent_nexthop_cmd
,
2600 NEIGHBOR_CMD
"transparent-nexthop",
2603 "Do not change nexthop 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_NEXTHOP_UNCHANGED
);
2610 /* EBGP multihop configuration. */
2612 peer_ebgp_multihop_set_vty (struct vty
*vty
, const char *ip_str
,
2613 const char *ttl_str
)
2618 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2625 VTY_GET_INTEGER_RANGE ("TTL", ttl
, ttl_str
, 1, 255);
2627 peer_ebgp_multihop_set (peer
, ttl
);
2633 peer_ebgp_multihop_unset_vty (struct vty
*vty
, const char *ip_str
)
2637 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2641 peer_ebgp_multihop_unset (peer
);
2646 /* neighbor ebgp-multihop. */
2647 DEFUN (neighbor_ebgp_multihop
,
2648 neighbor_ebgp_multihop_cmd
,
2649 NEIGHBOR_CMD2
"ebgp-multihop",
2652 "Allow EBGP neighbors not on directly connected networks\n")
2654 return peer_ebgp_multihop_set_vty (vty
, argv
[0], NULL
);
2657 DEFUN (neighbor_ebgp_multihop_ttl
,
2658 neighbor_ebgp_multihop_ttl_cmd
,
2659 NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2662 "Allow EBGP neighbors not on directly connected networks\n"
2663 "maximum hop count\n")
2665 return peer_ebgp_multihop_set_vty (vty
, argv
[0], argv
[1]);
2668 DEFUN (no_neighbor_ebgp_multihop
,
2669 no_neighbor_ebgp_multihop_cmd
,
2670 NO_NEIGHBOR_CMD2
"ebgp-multihop",
2674 "Allow EBGP neighbors not on directly connected networks\n")
2676 return peer_ebgp_multihop_unset_vty (vty
, argv
[0]);
2679 ALIAS (no_neighbor_ebgp_multihop
,
2680 no_neighbor_ebgp_multihop_ttl_cmd
,
2681 NO_NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2685 "Allow EBGP neighbors not on directly connected networks\n"
2686 "maximum hop count\n")
2688 /* disable-connected-check */
2689 DEFUN (neighbor_disable_connected_check
,
2690 neighbor_disable_connected_check_cmd
,
2691 NEIGHBOR_CMD2
"disable-connected-check",
2694 "one-hop away EBGP peer using loopback address\n")
2696 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
2699 DEFUN (no_neighbor_disable_connected_check
,
2700 no_neighbor_disable_connected_check_cmd
,
2701 NO_NEIGHBOR_CMD2
"disable-connected-check",
2705 "one-hop away EBGP peer using loopback address\n")
2707 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
2710 /* Enforce multihop. */
2711 ALIAS (neighbor_disable_connected_check
,
2712 neighbor_enforce_multihop_cmd
,
2713 NEIGHBOR_CMD2
"enforce-multihop",
2716 "Enforce EBGP neighbors perform multihop\n")
2718 /* Enforce multihop. */
2719 ALIAS (no_neighbor_disable_connected_check
,
2720 no_neighbor_enforce_multihop_cmd
,
2721 NO_NEIGHBOR_CMD2
"enforce-multihop",
2725 "Enforce EBGP neighbors perform multihop\n")
2727 DEFUN (neighbor_description
,
2728 neighbor_description_cmd
,
2729 NEIGHBOR_CMD2
"description .LINE",
2732 "Neighbor specific description\n"
2733 "Up to 80 characters describing this neighbor\n")
2738 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2745 str
= argv_concat(argv
, argc
, 1);
2747 peer_description_set (peer
, str
);
2749 XFREE (MTYPE_TMP
, str
);
2754 DEFUN (no_neighbor_description
,
2755 no_neighbor_description_cmd
,
2756 NO_NEIGHBOR_CMD2
"description",
2760 "Neighbor specific description\n")
2764 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2768 peer_description_unset (peer
);
2773 ALIAS (no_neighbor_description
,
2774 no_neighbor_description_val_cmd
,
2775 NO_NEIGHBOR_CMD2
"description .LINE",
2779 "Neighbor specific description\n"
2780 "Up to 80 characters describing this neighbor\n")
2782 /* Neighbor update-source. */
2784 peer_update_source_vty (struct vty
*vty
, const char *peer_str
,
2785 const char *source_str
)
2788 union sockunion
*su
;
2790 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2796 su
= sockunion_str2su (source_str
);
2799 peer_update_source_addr_set (peer
, su
);
2800 sockunion_free (su
);
2803 peer_update_source_if_set (peer
, source_str
);
2806 peer_update_source_unset (peer
);
2811 #define BGP_UPDATE_SOURCE_STR "(A.B.C.D|WORD)"
2812 #define BGP_UPDATE_SOURCE_HELP_STR \
2816 DEFUN (neighbor_update_source
,
2817 neighbor_update_source_cmd
,
2818 NEIGHBOR_CMD2
"update-source " BGP_UPDATE_SOURCE_STR
,
2821 "Source of routing updates\n"
2822 BGP_UPDATE_SOURCE_HELP_STR
)
2824 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
2827 DEFUN (no_neighbor_update_source
,
2828 no_neighbor_update_source_cmd
,
2829 NO_NEIGHBOR_CMD2
"update-source",
2833 "Source of routing updates\n")
2835 return peer_update_source_vty (vty
, argv
[0], NULL
);
2839 peer_default_originate_set_vty (struct vty
*vty
, const char *peer_str
,
2840 afi_t afi
, safi_t safi
,
2841 const char *rmap
, int set
)
2846 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2851 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
2853 ret
= peer_default_originate_unset (peer
, afi
, safi
);
2855 return bgp_vty_return (vty
, ret
);
2858 /* neighbor default-originate. */
2859 DEFUN (neighbor_default_originate
,
2860 neighbor_default_originate_cmd
,
2861 NEIGHBOR_CMD2
"default-originate",
2864 "Originate default route to this neighbor\n")
2866 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2867 bgp_node_safi (vty
), NULL
, 1);
2870 DEFUN (neighbor_default_originate_rmap
,
2871 neighbor_default_originate_rmap_cmd
,
2872 NEIGHBOR_CMD2
"default-originate route-map WORD",
2875 "Originate default route to this neighbor\n"
2876 "Route-map to specify criteria to originate default\n"
2879 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2880 bgp_node_safi (vty
), argv
[1], 1);
2883 DEFUN (no_neighbor_default_originate
,
2884 no_neighbor_default_originate_cmd
,
2885 NO_NEIGHBOR_CMD2
"default-originate",
2889 "Originate default route to this neighbor\n")
2891 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2892 bgp_node_safi (vty
), NULL
, 0);
2895 ALIAS (no_neighbor_default_originate
,
2896 no_neighbor_default_originate_rmap_cmd
,
2897 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
2901 "Originate default route to this neighbor\n"
2902 "Route-map to specify criteria to originate default\n"
2905 /* Set neighbor's BGP port. */
2907 peer_port_vty (struct vty
*vty
, const char *ip_str
, int afi
,
2908 const char *port_str
)
2914 peer
= peer_lookup_vty (vty
, ip_str
);
2920 sp
= getservbyname ("bgp", "tcp");
2921 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
2925 VTY_GET_INTEGER("port", port
, port_str
);
2928 peer_port_set (peer
, port
);
2933 /* Set specified peer's BGP port. */
2934 DEFUN (neighbor_port
,
2936 NEIGHBOR_CMD
"port <0-65535>",
2939 "Neighbor's BGP port\n"
2940 "TCP port number\n")
2942 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
2945 DEFUN (no_neighbor_port
,
2946 no_neighbor_port_cmd
,
2947 NO_NEIGHBOR_CMD
"port",
2951 "Neighbor's BGP port\n")
2953 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
2956 ALIAS (no_neighbor_port
,
2957 no_neighbor_port_val_cmd
,
2958 NO_NEIGHBOR_CMD
"port <0-65535>",
2962 "Neighbor's BGP port\n"
2963 "TCP port number\n")
2965 /* neighbor weight. */
2967 peer_weight_set_vty (struct vty
*vty
, const char *ip_str
,
2968 const char *weight_str
)
2972 unsigned long weight
;
2974 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2978 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
2980 ret
= peer_weight_set (peer
, weight
);
2986 peer_weight_unset_vty (struct vty
*vty
, const char *ip_str
)
2990 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2994 peer_weight_unset (peer
);
2999 DEFUN (neighbor_weight
,
3000 neighbor_weight_cmd
,
3001 NEIGHBOR_CMD2
"weight <0-65535>",
3004 "Set default weight for routes from this neighbor\n"
3007 return peer_weight_set_vty (vty
, argv
[0], argv
[1]);
3010 DEFUN (no_neighbor_weight
,
3011 no_neighbor_weight_cmd
,
3012 NO_NEIGHBOR_CMD2
"weight",
3016 "Set default weight for routes from this neighbor\n")
3018 return peer_weight_unset_vty (vty
, argv
[0]);
3021 ALIAS (no_neighbor_weight
,
3022 no_neighbor_weight_val_cmd
,
3023 NO_NEIGHBOR_CMD2
"weight <0-65535>",
3027 "Set default weight for routes from this neighbor\n"
3030 /* Override capability negotiation. */
3031 DEFUN (neighbor_override_capability
,
3032 neighbor_override_capability_cmd
,
3033 NEIGHBOR_CMD2
"override-capability",
3036 "Override capability negotiation result\n")
3038 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
3041 DEFUN (no_neighbor_override_capability
,
3042 no_neighbor_override_capability_cmd
,
3043 NO_NEIGHBOR_CMD2
"override-capability",
3047 "Override capability negotiation result\n")
3049 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
3052 DEFUN (neighbor_strict_capability
,
3053 neighbor_strict_capability_cmd
,
3054 NEIGHBOR_CMD
"strict-capability-match",
3057 "Strict capability negotiation match\n")
3059 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
3062 DEFUN (no_neighbor_strict_capability
,
3063 no_neighbor_strict_capability_cmd
,
3064 NO_NEIGHBOR_CMD
"strict-capability-match",
3068 "Strict capability negotiation match\n")
3070 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
3074 peer_timers_set_vty (struct vty
*vty
, const char *ip_str
,
3075 const char *keep_str
, const char *hold_str
)
3079 u_int32_t keepalive
;
3082 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3086 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
3087 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
3089 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
3091 return bgp_vty_return (vty
, ret
);
3095 peer_timers_unset_vty (struct vty
*vty
, const char *ip_str
)
3100 peer
= peer_lookup_vty (vty
, ip_str
);
3104 ret
= peer_timers_unset (peer
);
3106 return bgp_vty_return (vty
, ret
);
3109 DEFUN (neighbor_timers
,
3110 neighbor_timers_cmd
,
3111 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
3114 "BGP per neighbor timers\n"
3115 "Keepalive interval\n"
3118 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
3121 DEFUN (no_neighbor_timers
,
3122 no_neighbor_timers_cmd
,
3123 NO_NEIGHBOR_CMD2
"timers",
3127 "BGP per neighbor timers\n")
3129 return peer_timers_unset_vty (vty
, argv
[0]);
3133 peer_timers_connect_set_vty (struct vty
*vty
, const char *ip_str
,
3134 const char *time_str
)
3140 peer
= peer_lookup_vty (vty
, ip_str
);
3144 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
3146 ret
= peer_timers_connect_set (peer
, connect
);
3152 peer_timers_connect_unset_vty (struct vty
*vty
, const char *ip_str
)
3157 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3161 ret
= peer_timers_connect_unset (peer
);
3166 DEFUN (neighbor_timers_connect
,
3167 neighbor_timers_connect_cmd
,
3168 NEIGHBOR_CMD
"timers connect <0-65535>",
3171 "BGP per neighbor timers\n"
3172 "BGP connect timer\n"
3175 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
3178 DEFUN (no_neighbor_timers_connect
,
3179 no_neighbor_timers_connect_cmd
,
3180 NO_NEIGHBOR_CMD
"timers connect",
3184 "BGP per neighbor timers\n"
3185 "BGP connect timer\n")
3187 return peer_timers_connect_unset_vty (vty
, argv
[0]);
3190 ALIAS (no_neighbor_timers_connect
,
3191 no_neighbor_timers_connect_val_cmd
,
3192 NO_NEIGHBOR_CMD
"timers connect <0-65535>",
3196 "BGP per neighbor timers\n"
3197 "BGP connect timer\n"
3201 peer_advertise_interval_vty (struct vty
*vty
, const char *ip_str
,
3202 const char *time_str
, int set
)
3206 u_int32_t routeadv
= 0;
3208 peer
= peer_lookup_vty (vty
, ip_str
);
3213 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
3216 ret
= peer_advertise_interval_set (peer
, routeadv
);
3218 ret
= peer_advertise_interval_unset (peer
);
3223 DEFUN (neighbor_advertise_interval
,
3224 neighbor_advertise_interval_cmd
,
3225 NEIGHBOR_CMD
"advertisement-interval <0-600>",
3228 "Minimum interval between sending BGP routing updates\n"
3229 "time in seconds\n")
3231 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
3234 DEFUN (no_neighbor_advertise_interval
,
3235 no_neighbor_advertise_interval_cmd
,
3236 NO_NEIGHBOR_CMD
"advertisement-interval",
3240 "Minimum interval between sending BGP routing updates\n")
3242 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
3245 ALIAS (no_neighbor_advertise_interval
,
3246 no_neighbor_advertise_interval_val_cmd
,
3247 NO_NEIGHBOR_CMD
"advertisement-interval <0-600>",
3251 "Minimum interval between sending BGP routing updates\n"
3252 "time in seconds\n")
3254 /* neighbor interface */
3256 peer_interface_vty (struct vty
*vty
, const char *ip_str
, const char *str
)
3261 peer
= peer_lookup_vty (vty
, ip_str
);
3266 ret
= peer_interface_set (peer
, str
);
3268 ret
= peer_interface_unset (peer
);
3273 DEFUN (neighbor_interface
,
3274 neighbor_interface_cmd
,
3275 NEIGHBOR_CMD
"interface WORD",
3281 return peer_interface_vty (vty
, argv
[0], argv
[1]);
3284 DEFUN (no_neighbor_interface
,
3285 no_neighbor_interface_cmd
,
3286 NO_NEIGHBOR_CMD
"interface WORD",
3293 return peer_interface_vty (vty
, argv
[0], NULL
);
3296 /* Set distribute list to the peer. */
3298 peer_distribute_set_vty (struct vty
*vty
, const char *ip_str
,
3299 afi_t afi
, safi_t safi
,
3300 const char *name_str
, const char *direct_str
)
3304 int direct
= FILTER_IN
;
3306 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3310 /* Check filter direction. */
3311 if (strncmp (direct_str
, "i", 1) == 0)
3313 else if (strncmp (direct_str
, "o", 1) == 0)
3314 direct
= FILTER_OUT
;
3316 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
3318 return bgp_vty_return (vty
, ret
);
3322 peer_distribute_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3323 safi_t safi
, const char *direct_str
)
3327 int direct
= FILTER_IN
;
3329 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3333 /* Check filter direction. */
3334 if (strncmp (direct_str
, "i", 1) == 0)
3336 else if (strncmp (direct_str
, "o", 1) == 0)
3337 direct
= FILTER_OUT
;
3339 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
3341 return bgp_vty_return (vty
, ret
);
3344 DEFUN (neighbor_distribute_list
,
3345 neighbor_distribute_list_cmd
,
3346 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3349 "Filter updates to/from this neighbor\n"
3350 "IP access-list number\n"
3351 "IP access-list number (expanded range)\n"
3352 "IP Access-list name\n"
3353 "Filter incoming updates\n"
3354 "Filter outgoing updates\n")
3356 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3357 bgp_node_safi (vty
), argv
[1], argv
[2]);
3360 DEFUN (no_neighbor_distribute_list
,
3361 no_neighbor_distribute_list_cmd
,
3362 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3366 "Filter updates to/from this neighbor\n"
3367 "IP access-list number\n"
3368 "IP access-list number (expanded range)\n"
3369 "IP Access-list name\n"
3370 "Filter incoming updates\n"
3371 "Filter outgoing updates\n")
3373 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3374 bgp_node_safi (vty
), argv
[2]);
3377 /* Set prefix list to the peer. */
3379 peer_prefix_list_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3380 safi_t safi
, const char *name_str
,
3381 const char *direct_str
)
3385 int direct
= FILTER_IN
;
3387 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3391 /* Check filter direction. */
3392 if (strncmp (direct_str
, "i", 1) == 0)
3394 else if (strncmp (direct_str
, "o", 1) == 0)
3395 direct
= FILTER_OUT
;
3397 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
3399 return bgp_vty_return (vty
, ret
);
3403 peer_prefix_list_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3404 safi_t safi
, const char *direct_str
)
3408 int direct
= FILTER_IN
;
3410 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3414 /* Check filter direction. */
3415 if (strncmp (direct_str
, "i", 1) == 0)
3417 else if (strncmp (direct_str
, "o", 1) == 0)
3418 direct
= FILTER_OUT
;
3420 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
3422 return bgp_vty_return (vty
, ret
);
3425 DEFUN (neighbor_prefix_list
,
3426 neighbor_prefix_list_cmd
,
3427 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3430 "Filter updates to/from this neighbor\n"
3431 "Name of a prefix list\n"
3432 "Filter incoming updates\n"
3433 "Filter outgoing updates\n")
3435 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3436 bgp_node_safi (vty
), argv
[1], argv
[2]);
3439 DEFUN (no_neighbor_prefix_list
,
3440 no_neighbor_prefix_list_cmd
,
3441 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3445 "Filter updates to/from this neighbor\n"
3446 "Name of a prefix list\n"
3447 "Filter incoming updates\n"
3448 "Filter outgoing updates\n")
3450 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3451 bgp_node_safi (vty
), argv
[2]);
3455 peer_aslist_set_vty (struct vty
*vty
, const char *ip_str
,
3456 afi_t afi
, safi_t safi
,
3457 const char *name_str
, const char *direct_str
)
3461 int direct
= FILTER_IN
;
3463 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3467 /* Check filter direction. */
3468 if (strncmp (direct_str
, "i", 1) == 0)
3470 else if (strncmp (direct_str
, "o", 1) == 0)
3471 direct
= FILTER_OUT
;
3473 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
3475 return bgp_vty_return (vty
, ret
);
3479 peer_aslist_unset_vty (struct vty
*vty
, const char *ip_str
,
3480 afi_t afi
, safi_t safi
,
3481 const char *direct_str
)
3485 int direct
= FILTER_IN
;
3487 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3491 /* Check filter direction. */
3492 if (strncmp (direct_str
, "i", 1) == 0)
3494 else if (strncmp (direct_str
, "o", 1) == 0)
3495 direct
= FILTER_OUT
;
3497 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
3499 return bgp_vty_return (vty
, ret
);
3502 DEFUN (neighbor_filter_list
,
3503 neighbor_filter_list_cmd
,
3504 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3507 "Establish BGP filters\n"
3508 "AS path access-list name\n"
3509 "Filter incoming routes\n"
3510 "Filter outgoing routes\n")
3512 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3513 bgp_node_safi (vty
), argv
[1], argv
[2]);
3516 DEFUN (no_neighbor_filter_list
,
3517 no_neighbor_filter_list_cmd
,
3518 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3522 "Establish BGP filters\n"
3523 "AS path access-list name\n"
3524 "Filter incoming routes\n"
3525 "Filter outgoing routes\n")
3527 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3528 bgp_node_safi (vty
), argv
[2]);
3531 /* Set route-map to the peer. */
3533 peer_route_map_set_vty (struct vty
*vty
, const char *ip_str
,
3534 afi_t afi
, safi_t safi
,
3535 const char *name_str
, const char *direct_str
)
3539 int direct
= RMAP_IN
;
3541 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3545 /* Check filter direction. */
3546 if (strncmp (direct_str
, "in", 2) == 0)
3548 else if (strncmp (direct_str
, "o", 1) == 0)
3550 else if (strncmp (direct_str
, "im", 2) == 0)
3551 direct
= RMAP_IMPORT
;
3552 else if (strncmp (direct_str
, "e", 1) == 0)
3553 direct
= RMAP_EXPORT
;
3555 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
3557 return bgp_vty_return (vty
, ret
);
3561 peer_route_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3562 safi_t safi
, const char *direct_str
)
3566 int direct
= RMAP_IN
;
3568 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3572 /* Check filter direction. */
3573 if (strncmp (direct_str
, "in", 2) == 0)
3575 else if (strncmp (direct_str
, "o", 1) == 0)
3577 else if (strncmp (direct_str
, "im", 2) == 0)
3578 direct
= RMAP_IMPORT
;
3579 else if (strncmp (direct_str
, "e", 1) == 0)
3580 direct
= RMAP_EXPORT
;
3582 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
3584 return bgp_vty_return (vty
, ret
);
3587 DEFUN (neighbor_route_map
,
3588 neighbor_route_map_cmd
,
3589 NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3592 "Apply route map to neighbor\n"
3593 "Name of route map\n"
3594 "Apply map to incoming routes\n"
3595 "Apply map to outbound routes\n"
3596 "Apply map to routes going into a Route-Server client's table\n"
3597 "Apply map to routes coming from a Route-Server client")
3599 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3600 bgp_node_safi (vty
), argv
[1], argv
[2]);
3603 DEFUN (no_neighbor_route_map
,
3604 no_neighbor_route_map_cmd
,
3605 NO_NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3609 "Apply route map to neighbor\n"
3610 "Name of route map\n"
3611 "Apply map to incoming routes\n"
3612 "Apply map to outbound routes\n"
3613 "Apply map to routes going into a Route-Server client's table\n"
3614 "Apply map to routes coming from a Route-Server client")
3616 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3617 bgp_node_safi (vty
), argv
[2]);
3620 /* Set unsuppress-map to the peer. */
3622 peer_unsuppress_map_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3623 safi_t safi
, const char *name_str
)
3628 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3632 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
3634 return bgp_vty_return (vty
, ret
);
3637 /* Unset route-map from the peer. */
3639 peer_unsuppress_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3645 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3649 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
3651 return bgp_vty_return (vty
, ret
);
3654 DEFUN (neighbor_unsuppress_map
,
3655 neighbor_unsuppress_map_cmd
,
3656 NEIGHBOR_CMD2
"unsuppress-map WORD",
3659 "Route-map to selectively unsuppress suppressed routes\n"
3660 "Name of route map\n")
3662 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3663 bgp_node_safi (vty
), argv
[1]);
3666 DEFUN (no_neighbor_unsuppress_map
,
3667 no_neighbor_unsuppress_map_cmd
,
3668 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
3672 "Route-map to selectively unsuppress suppressed routes\n"
3673 "Name of route map\n")
3675 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3676 bgp_node_safi (vty
));
3680 peer_maximum_prefix_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3681 safi_t safi
, const char *num_str
,
3682 const char *threshold_str
, int warning
,
3683 const char *restart_str
)
3691 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3695 VTY_GET_INTEGER ("maxmum number", max
, num_str
);
3697 threshold
= atoi (threshold_str
);
3699 threshold
= MAXIMUM_PREFIX_THRESHOLD_DEFAULT
;
3702 restart
= atoi (restart_str
);
3706 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, threshold
, warning
, restart
);
3708 return bgp_vty_return (vty
, ret
);
3712 peer_maximum_prefix_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
3718 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3722 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
3724 return bgp_vty_return (vty
, ret
);
3727 /* Maximum number of prefix configuration. prefix count is different
3728 for each peer configuration. So this configuration can be set for
3729 each peer configuration. */
3730 DEFUN (neighbor_maximum_prefix
,
3731 neighbor_maximum_prefix_cmd
,
3732 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3735 "Maximum number of prefix accept from this peer\n"
3736 "maximum no. of prefix limit\n")
3738 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3739 bgp_node_safi (vty
), argv
[1], NULL
, 0,
3743 DEFUN (neighbor_maximum_prefix_threshold
,
3744 neighbor_maximum_prefix_threshold_cmd
,
3745 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
3748 "Maximum number of prefix accept from this peer\n"
3749 "maximum no. of prefix limit\n"
3750 "Threshold value (%) at which to generate a warning msg\n")
3752 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3753 bgp_node_safi (vty
), argv
[1], argv
[2], 0,
3757 DEFUN (neighbor_maximum_prefix_warning
,
3758 neighbor_maximum_prefix_warning_cmd
,
3759 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3762 "Maximum number of prefix accept from this peer\n"
3763 "maximum no. of prefix limit\n"
3764 "Only give warning message when limit is exceeded\n")
3766 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3767 bgp_node_safi (vty
), argv
[1], NULL
, 1,
3771 DEFUN (neighbor_maximum_prefix_threshold_warning
,
3772 neighbor_maximum_prefix_threshold_warning_cmd
,
3773 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3776 "Maximum number of prefix accept from this peer\n"
3777 "maximum no. of prefix limit\n"
3778 "Threshold value (%) at which to generate a warning msg\n"
3779 "Only give warning message when limit is exceeded\n")
3781 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3782 bgp_node_safi (vty
), argv
[1], argv
[2], 1, NULL
);
3785 DEFUN (neighbor_maximum_prefix_restart
,
3786 neighbor_maximum_prefix_restart_cmd
,
3787 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
3790 "Maximum number of prefix accept from this peer\n"
3791 "maximum no. of prefix limit\n"
3792 "Restart bgp connection after limit is exceeded\n"
3793 "Restart interval in minutes")
3795 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3796 bgp_node_safi (vty
), argv
[1], NULL
, 0, argv
[2]);
3799 DEFUN (neighbor_maximum_prefix_threshold_restart
,
3800 neighbor_maximum_prefix_threshold_restart_cmd
,
3801 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
3804 "Maximum number of prefix accept from this peer\n"
3805 "maximum no. of prefix limit\n"
3806 "Threshold value (%) at which to generate a warning msg\n"
3807 "Restart bgp connection after limit is exceeded\n"
3808 "Restart interval in minutes")
3810 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3811 bgp_node_safi (vty
), argv
[1], argv
[2], 0, argv
[3]);
3814 DEFUN (no_neighbor_maximum_prefix
,
3815 no_neighbor_maximum_prefix_cmd
,
3816 NO_NEIGHBOR_CMD2
"maximum-prefix",
3820 "Maximum number of prefix accept from this peer\n")
3822 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3823 bgp_node_safi (vty
));
3826 ALIAS (no_neighbor_maximum_prefix
,
3827 no_neighbor_maximum_prefix_val_cmd
,
3828 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3832 "Maximum number of prefix accept from this peer\n"
3833 "maximum no. of prefix limit\n")
3835 ALIAS (no_neighbor_maximum_prefix
,
3836 no_neighbor_maximum_prefix_threshold_cmd
,
3837 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3841 "Maximum number of prefix accept from this peer\n"
3842 "maximum no. of prefix limit\n"
3843 "Threshold value (%) at which to generate a warning msg\n")
3845 ALIAS (no_neighbor_maximum_prefix
,
3846 no_neighbor_maximum_prefix_warning_cmd
,
3847 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3851 "Maximum number of prefix accept from this peer\n"
3852 "maximum no. of prefix limit\n"
3853 "Only give warning message when limit is exceeded\n")
3855 ALIAS (no_neighbor_maximum_prefix
,
3856 no_neighbor_maximum_prefix_threshold_warning_cmd
,
3857 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3861 "Maximum number of prefix accept from this peer\n"
3862 "maximum no. of prefix limit\n"
3863 "Threshold value (%) at which to generate a warning msg\n"
3864 "Only give warning message when limit is exceeded\n")
3866 ALIAS (no_neighbor_maximum_prefix
,
3867 no_neighbor_maximum_prefix_restart_cmd
,
3868 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
3872 "Maximum number of prefix accept from this peer\n"
3873 "maximum no. of prefix limit\n"
3874 "Restart bgp connection after limit is exceeded\n"
3875 "Restart interval in minutes")
3877 ALIAS (no_neighbor_maximum_prefix
,
3878 no_neighbor_maximum_prefix_threshold_restart_cmd
,
3879 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
3883 "Maximum number of prefix accept from this peer\n"
3884 "maximum no. of prefix limit\n"
3885 "Threshold value (%) at which to generate a warning msg\n"
3886 "Restart bgp connection after limit is exceeded\n"
3887 "Restart interval in minutes")
3889 /* "neighbor allowas-in" */
3890 DEFUN (neighbor_allowas_in
,
3891 neighbor_allowas_in_cmd
,
3892 NEIGHBOR_CMD2
"allowas-in",
3895 "Accept as-path with my AS present in it\n")
3899 unsigned int allow_num
;
3901 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3908 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
3910 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
3913 return bgp_vty_return (vty
, ret
);
3916 ALIAS (neighbor_allowas_in
,
3917 neighbor_allowas_in_arg_cmd
,
3918 NEIGHBOR_CMD2
"allowas-in <1-10>",
3921 "Accept as-path with my AS present in it\n"
3922 "Number of occurances of AS number\n")
3924 DEFUN (no_neighbor_allowas_in
,
3925 no_neighbor_allowas_in_cmd
,
3926 NO_NEIGHBOR_CMD2
"allowas-in",
3930 "allow local ASN appears in aspath attribute\n")
3935 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3939 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3941 return bgp_vty_return (vty
, ret
);
3944 /* Address family configuration. */
3945 DEFUN (address_family_ipv4
,
3946 address_family_ipv4_cmd
,
3947 "address-family ipv4",
3948 "Enter Address Family command mode\n"
3951 vty
->node
= BGP_IPV4_NODE
;
3955 DEFUN (address_family_ipv4_safi
,
3956 address_family_ipv4_safi_cmd
,
3957 "address-family ipv4 (unicast|multicast)",
3958 "Enter Address Family command mode\n"
3960 "Address Family modifier\n"
3961 "Address Family modifier\n")
3963 if (strncmp (argv
[0], "m", 1) == 0)
3964 vty
->node
= BGP_IPV4M_NODE
;
3966 vty
->node
= BGP_IPV4_NODE
;
3971 DEFUN (address_family_ipv6
,
3972 address_family_ipv6_cmd
,
3973 "address-family ipv6",
3974 "Enter Address Family command mode\n"
3977 vty
->node
= BGP_IPV6_NODE
;
3981 DEFUN (address_family_ipv6_safi
,
3982 address_family_ipv6_safi_cmd
,
3983 "address-family ipv6 (unicast|multicast)",
3984 "Enter Address Family command mode\n"
3986 "Address Family modifier\n"
3987 "Address Family modifier\n")
3989 if (strncmp (argv
[0], "m", 1) == 0)
3990 vty
->node
= BGP_IPV6M_NODE
;
3992 vty
->node
= BGP_IPV6_NODE
;
3997 DEFUN (address_family_vpnv4
,
3998 address_family_vpnv4_cmd
,
3999 "address-family vpnv4",
4000 "Enter Address Family command mode\n"
4003 vty
->node
= BGP_VPNV4_NODE
;
4007 ALIAS (address_family_vpnv4
,
4008 address_family_vpnv4_unicast_cmd
,
4009 "address-family vpnv4 unicast",
4010 "Enter Address Family command mode\n"
4012 "Address Family Modifier\n")
4014 DEFUN (exit_address_family
,
4015 exit_address_family_cmd
,
4016 "exit-address-family",
4017 "Exit from Address Family configuration mode\n")
4019 if (vty
->node
== BGP_IPV4_NODE
4020 || vty
->node
== BGP_IPV4M_NODE
4021 || vty
->node
== BGP_VPNV4_NODE
4022 || vty
->node
== BGP_IPV6_NODE
4023 || vty
->node
== BGP_IPV6M_NODE
)
4024 vty
->node
= BGP_NODE
;
4028 /* BGP clear sort. */
4039 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
4040 safi_t safi
, int error
)
4044 case BGP_ERR_AF_UNCONFIGURED
:
4046 "%%BGP: Enable %s %s address family for the neighbor %s%s",
4047 afi
== AFI_IP6
? "IPv6" : safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
4048 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
4049 peer
->host
, VTY_NEWLINE
);
4051 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
4052 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
);
4059 /* `clear ip bgp' functions. */
4061 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
4062 enum clear_sort sort
,enum bgp_clear_type stype
, const char *arg
)
4066 struct listnode
*node
, *nnode
;
4068 /* Clear all neighbors. */
4069 if (sort
== clear_all
)
4071 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4073 if (stype
== BGP_CLEAR_SOFT_NONE
)
4074 ret
= peer_clear (peer
);
4076 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4079 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4084 /* Clear specified neighbors. */
4085 if (sort
== clear_peer
)
4090 /* Make sockunion for lookup. */
4091 ret
= str2sockunion (arg
, &su
);
4094 vty_out (vty
, "Malformed address: %s%s", arg
, VTY_NEWLINE
);
4097 peer
= peer_lookup (bgp
, &su
);
4100 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
4104 if (stype
== BGP_CLEAR_SOFT_NONE
)
4105 ret
= peer_clear (peer
);
4107 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4110 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4115 /* Clear all peer-group members. */
4116 if (sort
== clear_group
)
4118 struct peer_group
*group
;
4120 group
= peer_group_lookup (bgp
, arg
);
4123 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
4127 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
4129 if (stype
== BGP_CLEAR_SOFT_NONE
)
4131 ret
= peer_clear (peer
);
4135 if (! peer
->af_group
[afi
][safi
])
4138 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4141 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4146 if (sort
== clear_external
)
4148 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4150 if (peer_sort (peer
) == BGP_PEER_IBGP
)
4153 if (stype
== BGP_CLEAR_SOFT_NONE
)
4154 ret
= peer_clear (peer
);
4156 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4159 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4164 if (sort
== clear_as
)
4167 unsigned long as_ul
;
4170 VTY_GET_LONG ("AS", as_ul
, arg
);
4174 vty_out (vty
, "Invalid AS number%s", VTY_NEWLINE
);
4179 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
4185 if (stype
== BGP_CLEAR_SOFT_NONE
)
4186 ret
= peer_clear (peer
);
4188 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
4191 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
4194 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
4203 bgp_clear_vty (struct vty
*vty
, const char *name
, afi_t afi
, safi_t safi
,
4204 enum clear_sort sort
, enum bgp_clear_type stype
,
4209 /* BGP structure lookup. */
4212 bgp
= bgp_lookup_by_name (name
);
4215 vty_out (vty
, "Can't find BGP view %s%s", name
, VTY_NEWLINE
);
4221 bgp
= bgp_get_default ();
4224 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
4229 return bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
4232 DEFUN (clear_ip_bgp_all
,
4233 clear_ip_bgp_all_cmd
,
4238 "Clear all peers\n")
4241 return bgp_clear_vty (vty
, argv
[0], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4243 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4246 ALIAS (clear_ip_bgp_all
,
4251 "Clear all peers\n")
4253 ALIAS (clear_ip_bgp_all
,
4254 clear_bgp_ipv6_all_cmd
,
4259 "Clear all peers\n")
4261 ALIAS (clear_ip_bgp_all
,
4262 clear_ip_bgp_instance_all_cmd
,
4263 "clear ip bgp view WORD *",
4269 "Clear all peers\n")
4271 ALIAS (clear_ip_bgp_all
,
4272 clear_bgp_instance_all_cmd
,
4273 "clear bgp view WORD *",
4278 "Clear all peers\n")
4280 DEFUN (clear_ip_bgp_peer
,
4281 clear_ip_bgp_peer_cmd
,
4282 "clear ip bgp (A.B.C.D|X:X::X:X)",
4286 "BGP neighbor IP address to clear\n"
4287 "BGP IPv6 neighbor to clear\n")
4289 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4292 ALIAS (clear_ip_bgp_peer
,
4294 "clear bgp (A.B.C.D|X:X::X:X)",
4297 "BGP neighbor address to clear\n"
4298 "BGP IPv6 neighbor to clear\n")
4300 ALIAS (clear_ip_bgp_peer
,
4301 clear_bgp_ipv6_peer_cmd
,
4302 "clear bgp ipv6 (A.B.C.D|X:X::X:X)",
4306 "BGP neighbor address to clear\n"
4307 "BGP IPv6 neighbor to clear\n")
4309 DEFUN (clear_ip_bgp_peer_group
,
4310 clear_ip_bgp_peer_group_cmd
,
4311 "clear ip bgp peer-group WORD",
4315 "Clear all members of peer-group\n"
4316 "BGP peer-group name\n")
4318 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4321 ALIAS (clear_ip_bgp_peer_group
,
4322 clear_bgp_peer_group_cmd
,
4323 "clear bgp peer-group WORD",
4326 "Clear all members of peer-group\n"
4327 "BGP peer-group name\n")
4329 ALIAS (clear_ip_bgp_peer_group
,
4330 clear_bgp_ipv6_peer_group_cmd
,
4331 "clear bgp ipv6 peer-group WORD",
4335 "Clear all members of peer-group\n"
4336 "BGP peer-group name\n")
4338 DEFUN (clear_ip_bgp_external
,
4339 clear_ip_bgp_external_cmd
,
4340 "clear ip bgp external",
4344 "Clear all external peers\n")
4346 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
4349 ALIAS (clear_ip_bgp_external
,
4350 clear_bgp_external_cmd
,
4351 "clear bgp external",
4354 "Clear all external peers\n")
4356 ALIAS (clear_ip_bgp_external
,
4357 clear_bgp_ipv6_external_cmd
,
4358 "clear bgp ipv6 external",
4362 "Clear all external peers\n")
4364 DEFUN (clear_ip_bgp_as
,
4365 clear_ip_bgp_as_cmd
,
4366 "clear ip bgp " CMD_AS_RANGE
,
4370 "Clear peers with the AS number\n")
4372 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4375 ALIAS (clear_ip_bgp_as
,
4377 "clear bgp " CMD_AS_RANGE
,
4380 "Clear peers with the AS number\n")
4382 ALIAS (clear_ip_bgp_as
,
4383 clear_bgp_ipv6_as_cmd
,
4384 "clear bgp ipv6 " CMD_AS_RANGE
,
4388 "Clear peers with the AS number\n")
4390 /* Outbound soft-reconfiguration */
4391 DEFUN (clear_ip_bgp_all_soft_out
,
4392 clear_ip_bgp_all_soft_out_cmd
,
4393 "clear ip bgp * soft out",
4399 "Soft reconfig outbound update\n")
4402 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4403 BGP_CLEAR_SOFT_OUT
, NULL
);
4405 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4406 BGP_CLEAR_SOFT_OUT
, NULL
);
4409 ALIAS (clear_ip_bgp_all_soft_out
,
4410 clear_ip_bgp_all_out_cmd
,
4411 "clear ip bgp * out",
4416 "Soft reconfig outbound update\n")
4418 ALIAS (clear_ip_bgp_all_soft_out
,
4419 clear_ip_bgp_instance_all_soft_out_cmd
,
4420 "clear ip bgp view WORD * soft out",
4428 "Soft reconfig outbound update\n")
4430 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
4431 clear_ip_bgp_all_ipv4_soft_out_cmd
,
4432 "clear ip bgp * ipv4 (unicast|multicast) soft out",
4438 "Address Family modifier\n"
4439 "Address Family modifier\n"
4441 "Soft reconfig outbound update\n")
4443 if (strncmp (argv
[0], "m", 1) == 0)
4444 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4445 BGP_CLEAR_SOFT_OUT
, NULL
);
4447 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4448 BGP_CLEAR_SOFT_OUT
, NULL
);
4451 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
4452 clear_ip_bgp_all_ipv4_out_cmd
,
4453 "clear ip bgp * ipv4 (unicast|multicast) out",
4459 "Address Family modifier\n"
4460 "Address Family modifier\n"
4461 "Soft reconfig outbound update\n")
4463 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
4464 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
4465 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out",
4473 "Address Family modifier\n"
4474 "Address Family modifier\n"
4475 "Soft reconfig outbound update\n")
4477 if (strncmp (argv
[1], "m", 1) == 0)
4478 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4479 BGP_CLEAR_SOFT_OUT
, NULL
);
4481 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4482 BGP_CLEAR_SOFT_OUT
, NULL
);
4485 DEFUN (clear_ip_bgp_all_vpnv4_soft_out
,
4486 clear_ip_bgp_all_vpnv4_soft_out_cmd
,
4487 "clear ip bgp * vpnv4 unicast soft out",
4493 "Address Family Modifier\n"
4495 "Soft reconfig outbound update\n")
4497 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
4498 BGP_CLEAR_SOFT_OUT
, NULL
);
4501 ALIAS (clear_ip_bgp_all_vpnv4_soft_out
,
4502 clear_ip_bgp_all_vpnv4_out_cmd
,
4503 "clear ip bgp * vpnv4 unicast out",
4509 "Address Family Modifier\n"
4510 "Soft reconfig outbound update\n")
4512 DEFUN (clear_bgp_all_soft_out
,
4513 clear_bgp_all_soft_out_cmd
,
4514 "clear bgp * soft out",
4519 "Soft reconfig outbound update\n")
4522 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
4523 BGP_CLEAR_SOFT_OUT
, NULL
);
4525 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
4526 BGP_CLEAR_SOFT_OUT
, NULL
);
4529 ALIAS (clear_bgp_all_soft_out
,
4530 clear_bgp_instance_all_soft_out_cmd
,
4531 "clear bgp view WORD * soft out",
4538 "Soft reconfig outbound update\n")
4540 ALIAS (clear_bgp_all_soft_out
,
4541 clear_bgp_all_out_cmd
,
4546 "Soft reconfig outbound update\n")
4548 ALIAS (clear_bgp_all_soft_out
,
4549 clear_bgp_ipv6_all_soft_out_cmd
,
4550 "clear bgp ipv6 * soft out",
4556 "Soft reconfig outbound update\n")
4558 ALIAS (clear_bgp_all_soft_out
,
4559 clear_bgp_ipv6_all_out_cmd
,
4560 "clear bgp ipv6 * out",
4565 "Soft reconfig outbound update\n")
4567 DEFUN (clear_ip_bgp_peer_soft_out
,
4568 clear_ip_bgp_peer_soft_out_cmd
,
4569 "clear ip bgp A.B.C.D soft out",
4573 "BGP neighbor address to clear\n"
4575 "Soft reconfig outbound update\n")
4577 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4578 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4581 ALIAS (clear_ip_bgp_peer_soft_out
,
4582 clear_ip_bgp_peer_out_cmd
,
4583 "clear ip bgp A.B.C.D out",
4587 "BGP neighbor address to clear\n"
4588 "Soft reconfig outbound update\n")
4590 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
4591 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
4592 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out",
4596 "BGP neighbor address to clear\n"
4598 "Address Family modifier\n"
4599 "Address Family modifier\n"
4601 "Soft reconfig outbound update\n")
4603 if (strncmp (argv
[1], "m", 1) == 0)
4604 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
4605 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4607 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4608 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4611 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
4612 clear_ip_bgp_peer_ipv4_out_cmd
,
4613 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out",
4617 "BGP neighbor address to clear\n"
4619 "Address Family modifier\n"
4620 "Address Family modifier\n"
4621 "Soft reconfig outbound update\n")
4623 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out
,
4624 clear_ip_bgp_peer_vpnv4_soft_out_cmd
,
4625 "clear ip bgp A.B.C.D vpnv4 unicast soft out",
4629 "BGP neighbor address to clear\n"
4631 "Address Family Modifier\n"
4633 "Soft reconfig outbound update\n")
4635 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
4636 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4639 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out
,
4640 clear_ip_bgp_peer_vpnv4_out_cmd
,
4641 "clear ip bgp A.B.C.D vpnv4 unicast out",
4645 "BGP neighbor address to clear\n"
4647 "Address Family Modifier\n"
4648 "Soft reconfig outbound update\n")
4650 DEFUN (clear_bgp_peer_soft_out
,
4651 clear_bgp_peer_soft_out_cmd
,
4652 "clear bgp (A.B.C.D|X:X::X:X) soft out",
4655 "BGP neighbor address to clear\n"
4656 "BGP IPv6 neighbor to clear\n"
4658 "Soft reconfig outbound update\n")
4660 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
4661 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4664 ALIAS (clear_bgp_peer_soft_out
,
4665 clear_bgp_ipv6_peer_soft_out_cmd
,
4666 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out",
4670 "BGP neighbor address to clear\n"
4671 "BGP IPv6 neighbor to clear\n"
4673 "Soft reconfig outbound update\n")
4675 ALIAS (clear_bgp_peer_soft_out
,
4676 clear_bgp_peer_out_cmd
,
4677 "clear bgp (A.B.C.D|X:X::X:X) out",
4680 "BGP neighbor address to clear\n"
4681 "BGP IPv6 neighbor to clear\n"
4682 "Soft reconfig outbound update\n")
4684 ALIAS (clear_bgp_peer_soft_out
,
4685 clear_bgp_ipv6_peer_out_cmd
,
4686 "clear bgp ipv6 (A.B.C.D|X:X::X:X) out",
4690 "BGP neighbor address to clear\n"
4691 "BGP IPv6 neighbor to clear\n"
4692 "Soft reconfig outbound update\n")
4694 DEFUN (clear_ip_bgp_peer_group_soft_out
,
4695 clear_ip_bgp_peer_group_soft_out_cmd
,
4696 "clear ip bgp peer-group WORD soft out",
4700 "Clear all members of peer-group\n"
4701 "BGP peer-group name\n"
4703 "Soft reconfig outbound update\n")
4705 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4706 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4709 ALIAS (clear_ip_bgp_peer_group_soft_out
,
4710 clear_ip_bgp_peer_group_out_cmd
,
4711 "clear ip bgp peer-group WORD out",
4715 "Clear all members of peer-group\n"
4716 "BGP peer-group name\n"
4717 "Soft reconfig outbound update\n")
4719 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
4720 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
4721 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
4725 "Clear all members of peer-group\n"
4726 "BGP peer-group name\n"
4728 "Address Family modifier\n"
4729 "Address Family modifier\n"
4731 "Soft reconfig outbound update\n")
4733 if (strncmp (argv
[1], "m", 1) == 0)
4734 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
4735 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4737 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4738 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4741 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
4742 clear_ip_bgp_peer_group_ipv4_out_cmd
,
4743 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
4747 "Clear all members of peer-group\n"
4748 "BGP peer-group name\n"
4750 "Address Family modifier\n"
4751 "Address Family modifier\n"
4752 "Soft reconfig outbound update\n")
4754 DEFUN (clear_bgp_peer_group_soft_out
,
4755 clear_bgp_peer_group_soft_out_cmd
,
4756 "clear bgp peer-group WORD soft out",
4759 "Clear all members of peer-group\n"
4760 "BGP peer-group name\n"
4762 "Soft reconfig outbound update\n")
4764 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
4765 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4768 ALIAS (clear_bgp_peer_group_soft_out
,
4769 clear_bgp_ipv6_peer_group_soft_out_cmd
,
4770 "clear bgp ipv6 peer-group WORD soft out",
4774 "Clear all members of peer-group\n"
4775 "BGP peer-group name\n"
4777 "Soft reconfig outbound update\n")
4779 ALIAS (clear_bgp_peer_group_soft_out
,
4780 clear_bgp_peer_group_out_cmd
,
4781 "clear bgp peer-group WORD out",
4784 "Clear all members of peer-group\n"
4785 "BGP peer-group name\n"
4786 "Soft reconfig outbound update\n")
4788 ALIAS (clear_bgp_peer_group_soft_out
,
4789 clear_bgp_ipv6_peer_group_out_cmd
,
4790 "clear bgp ipv6 peer-group WORD out",
4794 "Clear all members of peer-group\n"
4795 "BGP peer-group name\n"
4796 "Soft reconfig outbound update\n")
4798 DEFUN (clear_ip_bgp_external_soft_out
,
4799 clear_ip_bgp_external_soft_out_cmd
,
4800 "clear ip bgp external soft out",
4804 "Clear all external peers\n"
4806 "Soft reconfig outbound update\n")
4808 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4809 BGP_CLEAR_SOFT_OUT
, NULL
);
4812 ALIAS (clear_ip_bgp_external_soft_out
,
4813 clear_ip_bgp_external_out_cmd
,
4814 "clear ip bgp external out",
4818 "Clear all external peers\n"
4819 "Soft reconfig outbound update\n")
4821 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
4822 clear_ip_bgp_external_ipv4_soft_out_cmd
,
4823 "clear ip bgp external ipv4 (unicast|multicast) soft out",
4827 "Clear all external peers\n"
4829 "Address Family modifier\n"
4830 "Address Family modifier\n"
4832 "Soft reconfig outbound update\n")
4834 if (strncmp (argv
[0], "m", 1) == 0)
4835 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
4836 BGP_CLEAR_SOFT_OUT
, NULL
);
4838 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4839 BGP_CLEAR_SOFT_OUT
, NULL
);
4842 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
4843 clear_ip_bgp_external_ipv4_out_cmd
,
4844 "clear ip bgp external ipv4 (unicast|multicast) out",
4848 "Clear all external peers\n"
4850 "Address Family modifier\n"
4851 "Address Family modifier\n"
4852 "Soft reconfig outbound update\n")
4854 DEFUN (clear_bgp_external_soft_out
,
4855 clear_bgp_external_soft_out_cmd
,
4856 "clear bgp external soft out",
4859 "Clear all external peers\n"
4861 "Soft reconfig outbound update\n")
4863 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
4864 BGP_CLEAR_SOFT_OUT
, NULL
);
4867 ALIAS (clear_bgp_external_soft_out
,
4868 clear_bgp_ipv6_external_soft_out_cmd
,
4869 "clear bgp ipv6 external soft out",
4873 "Clear all external peers\n"
4875 "Soft reconfig outbound update\n")
4877 ALIAS (clear_bgp_external_soft_out
,
4878 clear_bgp_external_out_cmd
,
4879 "clear bgp external out",
4882 "Clear all external peers\n"
4883 "Soft reconfig outbound update\n")
4885 ALIAS (clear_bgp_external_soft_out
,
4886 clear_bgp_ipv6_external_out_cmd
,
4887 "clear bgp ipv6 external WORD out",
4891 "Clear all external peers\n"
4892 "Soft reconfig outbound update\n")
4894 DEFUN (clear_ip_bgp_as_soft_out
,
4895 clear_ip_bgp_as_soft_out_cmd
,
4896 "clear ip bgp " CMD_AS_RANGE
" soft out",
4900 "Clear peers with the AS number\n"
4902 "Soft reconfig outbound update\n")
4904 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4905 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4908 ALIAS (clear_ip_bgp_as_soft_out
,
4909 clear_ip_bgp_as_out_cmd
,
4910 "clear ip bgp " CMD_AS_RANGE
" out",
4914 "Clear peers with the AS number\n"
4915 "Soft reconfig outbound update\n")
4917 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
4918 clear_ip_bgp_as_ipv4_soft_out_cmd
,
4919 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft out",
4923 "Clear peers with the AS number\n"
4925 "Address Family modifier\n"
4926 "Address Family modifier\n"
4928 "Soft reconfig outbound update\n")
4930 if (strncmp (argv
[1], "m", 1) == 0)
4931 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
4932 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4934 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4935 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4938 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
4939 clear_ip_bgp_as_ipv4_out_cmd
,
4940 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) out",
4944 "Clear peers with the AS number\n"
4946 "Address Family modifier\n"
4947 "Address Family modifier\n"
4948 "Soft reconfig outbound update\n")
4950 DEFUN (clear_ip_bgp_as_vpnv4_soft_out
,
4951 clear_ip_bgp_as_vpnv4_soft_out_cmd
,
4952 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft out",
4956 "Clear peers with the AS number\n"
4958 "Address Family modifier\n"
4960 "Soft reconfig outbound update\n")
4962 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
4963 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4966 ALIAS (clear_ip_bgp_as_vpnv4_soft_out
,
4967 clear_ip_bgp_as_vpnv4_out_cmd
,
4968 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast out",
4972 "Clear peers with the AS number\n"
4974 "Address Family modifier\n"
4975 "Soft reconfig outbound update\n")
4977 DEFUN (clear_bgp_as_soft_out
,
4978 clear_bgp_as_soft_out_cmd
,
4979 "clear bgp " CMD_AS_RANGE
" soft out",
4982 "Clear peers with the AS number\n"
4984 "Soft reconfig outbound update\n")
4986 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
4987 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4990 ALIAS (clear_bgp_as_soft_out
,
4991 clear_bgp_ipv6_as_soft_out_cmd
,
4992 "clear bgp ipv6 " CMD_AS_RANGE
" soft out",
4996 "Clear peers with the AS number\n"
4998 "Soft reconfig outbound update\n")
5000 ALIAS (clear_bgp_as_soft_out
,
5001 clear_bgp_as_out_cmd
,
5002 "clear bgp " CMD_AS_RANGE
" out",
5005 "Clear peers with the AS number\n"
5006 "Soft reconfig outbound update\n")
5008 ALIAS (clear_bgp_as_soft_out
,
5009 clear_bgp_ipv6_as_out_cmd
,
5010 "clear bgp ipv6 " CMD_AS_RANGE
" out",
5014 "Clear peers with the AS number\n"
5015 "Soft reconfig outbound update\n")
5017 /* Inbound soft-reconfiguration */
5018 DEFUN (clear_ip_bgp_all_soft_in
,
5019 clear_ip_bgp_all_soft_in_cmd
,
5020 "clear ip bgp * soft in",
5026 "Soft reconfig inbound update\n")
5029 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5030 BGP_CLEAR_SOFT_IN
, NULL
);
5032 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5033 BGP_CLEAR_SOFT_IN
, NULL
);
5036 ALIAS (clear_ip_bgp_all_soft_in
,
5037 clear_ip_bgp_instance_all_soft_in_cmd
,
5038 "clear ip bgp view WORD * soft in",
5046 "Soft reconfig inbound update\n")
5048 ALIAS (clear_ip_bgp_all_soft_in
,
5049 clear_ip_bgp_all_in_cmd
,
5050 "clear ip bgp * in",
5055 "Soft reconfig inbound update\n")
5057 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
5058 clear_ip_bgp_all_in_prefix_filter_cmd
,
5059 "clear ip bgp * in prefix-filter",
5064 "Soft reconfig inbound update\n"
5065 "Push out prefix-list ORF and do inbound soft reconfig\n")
5068 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5069 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5071 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5072 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5075 ALIAS (clear_ip_bgp_all_in_prefix_filter
,
5076 clear_ip_bgp_instance_all_in_prefix_filter_cmd
,
5077 "clear ip bgp view WORD * in prefix-filter",
5084 "Soft reconfig inbound update\n"
5085 "Push out prefix-list ORF and do inbound soft reconfig\n")
5088 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
5089 clear_ip_bgp_all_ipv4_soft_in_cmd
,
5090 "clear ip bgp * ipv4 (unicast|multicast) soft in",
5096 "Address Family modifier\n"
5097 "Address Family modifier\n"
5099 "Soft reconfig inbound update\n")
5101 if (strncmp (argv
[0], "m", 1) == 0)
5102 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5103 BGP_CLEAR_SOFT_IN
, NULL
);
5105 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5106 BGP_CLEAR_SOFT_IN
, NULL
);
5109 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
5110 clear_ip_bgp_all_ipv4_in_cmd
,
5111 "clear ip bgp * ipv4 (unicast|multicast) in",
5117 "Address Family modifier\n"
5118 "Address Family modifier\n"
5119 "Soft reconfig inbound update\n")
5121 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
5122 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
5123 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in",
5131 "Address Family modifier\n"
5132 "Address Family modifier\n"
5134 "Soft reconfig inbound update\n")
5136 if (strncmp (argv
[1], "m", 1) == 0)
5137 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5138 BGP_CLEAR_SOFT_IN
, NULL
);
5140 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5141 BGP_CLEAR_SOFT_IN
, NULL
);
5144 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
5145 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
5146 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
5152 "Address Family modifier\n"
5153 "Address Family modifier\n"
5154 "Soft reconfig inbound update\n"
5155 "Push out prefix-list ORF and do inbound soft reconfig\n")
5157 if (strncmp (argv
[0], "m", 1) == 0)
5158 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5159 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5161 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5162 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5165 DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter
,
5166 clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
,
5167 "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter",
5173 "Address Family modifier\n"
5174 "Address Family modifier\n"
5175 "Soft reconfig inbound update\n"
5176 "Push out prefix-list ORF and do inbound soft reconfig\n")
5178 if (strncmp (argv
[1], "m", 1) == 0)
5179 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5180 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5182 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5183 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5186 DEFUN (clear_ip_bgp_all_vpnv4_soft_in
,
5187 clear_ip_bgp_all_vpnv4_soft_in_cmd
,
5188 "clear ip bgp * vpnv4 unicast soft in",
5194 "Address Family Modifier\n"
5196 "Soft reconfig inbound update\n")
5198 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
5199 BGP_CLEAR_SOFT_IN
, NULL
);
5202 ALIAS (clear_ip_bgp_all_vpnv4_soft_in
,
5203 clear_ip_bgp_all_vpnv4_in_cmd
,
5204 "clear ip bgp * vpnv4 unicast in",
5210 "Address Family Modifier\n"
5211 "Soft reconfig inbound update\n")
5213 DEFUN (clear_bgp_all_soft_in
,
5214 clear_bgp_all_soft_in_cmd
,
5215 "clear bgp * soft in",
5220 "Soft reconfig inbound update\n")
5223 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
5224 BGP_CLEAR_SOFT_IN
, NULL
);
5226 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5227 BGP_CLEAR_SOFT_IN
, NULL
);
5230 ALIAS (clear_bgp_all_soft_in
,
5231 clear_bgp_instance_all_soft_in_cmd
,
5232 "clear bgp view WORD * soft in",
5239 "Soft reconfig inbound update\n")
5241 ALIAS (clear_bgp_all_soft_in
,
5242 clear_bgp_ipv6_all_soft_in_cmd
,
5243 "clear bgp ipv6 * soft in",
5249 "Soft reconfig inbound update\n")
5251 ALIAS (clear_bgp_all_soft_in
,
5252 clear_bgp_all_in_cmd
,
5257 "Soft reconfig inbound update\n")
5259 ALIAS (clear_bgp_all_soft_in
,
5260 clear_bgp_ipv6_all_in_cmd
,
5261 "clear bgp ipv6 * in",
5266 "Soft reconfig inbound update\n")
5268 DEFUN (clear_bgp_all_in_prefix_filter
,
5269 clear_bgp_all_in_prefix_filter_cmd
,
5270 "clear bgp * in prefix-filter",
5274 "Soft reconfig inbound update\n"
5275 "Push out prefix-list ORF and do inbound soft reconfig\n")
5277 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5278 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5281 ALIAS (clear_bgp_all_in_prefix_filter
,
5282 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
5283 "clear bgp ipv6 * in prefix-filter",
5288 "Soft reconfig inbound update\n"
5289 "Push out prefix-list ORF and do inbound soft reconfig\n")
5291 DEFUN (clear_ip_bgp_peer_soft_in
,
5292 clear_ip_bgp_peer_soft_in_cmd
,
5293 "clear ip bgp A.B.C.D soft in",
5297 "BGP neighbor address to clear\n"
5299 "Soft reconfig inbound update\n")
5301 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5302 BGP_CLEAR_SOFT_IN
, argv
[0]);
5305 ALIAS (clear_ip_bgp_peer_soft_in
,
5306 clear_ip_bgp_peer_in_cmd
,
5307 "clear ip bgp A.B.C.D in",
5311 "BGP neighbor address to clear\n"
5312 "Soft reconfig inbound update\n")
5314 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
5315 clear_ip_bgp_peer_in_prefix_filter_cmd
,
5316 "clear ip bgp A.B.C.D in prefix-filter",
5320 "BGP neighbor address to clear\n"
5321 "Soft reconfig inbound update\n"
5322 "Push out the existing ORF prefix-list\n")
5324 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5325 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5328 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
5329 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
5330 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in",
5334 "BGP neighbor address to clear\n"
5336 "Address Family modifier\n"
5337 "Address Family modifier\n"
5339 "Soft reconfig inbound update\n")
5341 if (strncmp (argv
[1], "m", 1) == 0)
5342 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5343 BGP_CLEAR_SOFT_IN
, argv
[0]);
5345 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5346 BGP_CLEAR_SOFT_IN
, argv
[0]);
5349 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
5350 clear_ip_bgp_peer_ipv4_in_cmd
,
5351 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in",
5355 "BGP neighbor address to clear\n"
5357 "Address Family modifier\n"
5358 "Address Family modifier\n"
5359 "Soft reconfig inbound update\n")
5361 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
5362 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
5363 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter",
5367 "BGP neighbor address to clear\n"
5369 "Address Family modifier\n"
5370 "Address Family modifier\n"
5371 "Soft reconfig inbound update\n"
5372 "Push out the existing ORF prefix-list\n")
5374 if (strncmp (argv
[1], "m", 1) == 0)
5375 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5376 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5378 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5379 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5382 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in
,
5383 clear_ip_bgp_peer_vpnv4_soft_in_cmd
,
5384 "clear ip bgp A.B.C.D vpnv4 unicast soft in",
5388 "BGP neighbor address to clear\n"
5390 "Address Family Modifier\n"
5392 "Soft reconfig inbound update\n")
5394 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
5395 BGP_CLEAR_SOFT_IN
, argv
[0]);
5398 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in
,
5399 clear_ip_bgp_peer_vpnv4_in_cmd
,
5400 "clear ip bgp A.B.C.D vpnv4 unicast in",
5404 "BGP neighbor address to clear\n"
5406 "Address Family Modifier\n"
5407 "Soft reconfig inbound update\n")
5409 DEFUN (clear_bgp_peer_soft_in
,
5410 clear_bgp_peer_soft_in_cmd
,
5411 "clear bgp (A.B.C.D|X:X::X:X) soft in",
5414 "BGP neighbor address to clear\n"
5415 "BGP IPv6 neighbor to clear\n"
5417 "Soft reconfig inbound update\n")
5419 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5420 BGP_CLEAR_SOFT_IN
, argv
[0]);
5423 ALIAS (clear_bgp_peer_soft_in
,
5424 clear_bgp_ipv6_peer_soft_in_cmd
,
5425 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in",
5429 "BGP neighbor address to clear\n"
5430 "BGP IPv6 neighbor to clear\n"
5432 "Soft reconfig inbound update\n")
5434 ALIAS (clear_bgp_peer_soft_in
,
5435 clear_bgp_peer_in_cmd
,
5436 "clear bgp (A.B.C.D|X:X::X:X) in",
5439 "BGP neighbor address to clear\n"
5440 "BGP IPv6 neighbor to clear\n"
5441 "Soft reconfig inbound update\n")
5443 ALIAS (clear_bgp_peer_soft_in
,
5444 clear_bgp_ipv6_peer_in_cmd
,
5445 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in",
5449 "BGP neighbor address to clear\n"
5450 "BGP IPv6 neighbor to clear\n"
5451 "Soft reconfig inbound update\n")
5453 DEFUN (clear_bgp_peer_in_prefix_filter
,
5454 clear_bgp_peer_in_prefix_filter_cmd
,
5455 "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter",
5458 "BGP neighbor address to clear\n"
5459 "BGP IPv6 neighbor to clear\n"
5460 "Soft reconfig inbound update\n"
5461 "Push out the existing ORF prefix-list\n")
5463 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5464 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5467 ALIAS (clear_bgp_peer_in_prefix_filter
,
5468 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
5469 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter",
5473 "BGP neighbor address to clear\n"
5474 "BGP IPv6 neighbor to clear\n"
5475 "Soft reconfig inbound update\n"
5476 "Push out the existing ORF prefix-list\n")
5478 DEFUN (clear_ip_bgp_peer_group_soft_in
,
5479 clear_ip_bgp_peer_group_soft_in_cmd
,
5480 "clear ip bgp peer-group WORD soft in",
5484 "Clear all members of peer-group\n"
5485 "BGP peer-group name\n"
5487 "Soft reconfig inbound update\n")
5489 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5490 BGP_CLEAR_SOFT_IN
, argv
[0]);
5493 ALIAS (clear_ip_bgp_peer_group_soft_in
,
5494 clear_ip_bgp_peer_group_in_cmd
,
5495 "clear ip bgp peer-group WORD in",
5499 "Clear all members of peer-group\n"
5500 "BGP peer-group name\n"
5501 "Soft reconfig inbound update\n")
5503 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
5504 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
5505 "clear ip bgp peer-group WORD in prefix-filter",
5509 "Clear all members of peer-group\n"
5510 "BGP peer-group name\n"
5511 "Soft reconfig inbound update\n"
5512 "Push out prefix-list ORF and do inbound soft reconfig\n")
5514 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5515 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5518 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
5519 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
5520 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
5524 "Clear all members of peer-group\n"
5525 "BGP peer-group name\n"
5527 "Address Family modifier\n"
5528 "Address Family modifier\n"
5530 "Soft reconfig inbound update\n")
5532 if (strncmp (argv
[1], "m", 1) == 0)
5533 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5534 BGP_CLEAR_SOFT_IN
, argv
[0]);
5536 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5537 BGP_CLEAR_SOFT_IN
, argv
[0]);
5540 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
5541 clear_ip_bgp_peer_group_ipv4_in_cmd
,
5542 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
5546 "Clear all members of peer-group\n"
5547 "BGP peer-group name\n"
5549 "Address Family modifier\n"
5550 "Address Family modifier\n"
5551 "Soft reconfig inbound update\n")
5553 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
5554 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
5555 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
5559 "Clear all members of peer-group\n"
5560 "BGP peer-group name\n"
5562 "Address Family modifier\n"
5563 "Address Family modifier\n"
5564 "Soft reconfig inbound update\n"
5565 "Push out prefix-list ORF and do inbound soft reconfig\n")
5567 if (strncmp (argv
[1], "m", 1) == 0)
5568 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5569 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5571 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5572 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5575 DEFUN (clear_bgp_peer_group_soft_in
,
5576 clear_bgp_peer_group_soft_in_cmd
,
5577 "clear bgp peer-group WORD soft in",
5580 "Clear all members of peer-group\n"
5581 "BGP peer-group name\n"
5583 "Soft reconfig inbound update\n")
5585 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5586 BGP_CLEAR_SOFT_IN
, argv
[0]);
5589 ALIAS (clear_bgp_peer_group_soft_in
,
5590 clear_bgp_ipv6_peer_group_soft_in_cmd
,
5591 "clear bgp ipv6 peer-group WORD soft in",
5595 "Clear all members of peer-group\n"
5596 "BGP peer-group name\n"
5598 "Soft reconfig inbound update\n")
5600 ALIAS (clear_bgp_peer_group_soft_in
,
5601 clear_bgp_peer_group_in_cmd
,
5602 "clear bgp peer-group WORD in",
5605 "Clear all members of peer-group\n"
5606 "BGP peer-group name\n"
5607 "Soft reconfig inbound update\n")
5609 ALIAS (clear_bgp_peer_group_soft_in
,
5610 clear_bgp_ipv6_peer_group_in_cmd
,
5611 "clear bgp ipv6 peer-group WORD in",
5615 "Clear all members of peer-group\n"
5616 "BGP peer-group name\n"
5617 "Soft reconfig inbound update\n")
5619 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
5620 clear_bgp_peer_group_in_prefix_filter_cmd
,
5621 "clear bgp peer-group WORD in prefix-filter",
5624 "Clear all members of peer-group\n"
5625 "BGP peer-group name\n"
5626 "Soft reconfig inbound update\n"
5627 "Push out prefix-list ORF and do inbound soft reconfig\n")
5629 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5630 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5633 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
5634 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
5635 "clear bgp ipv6 peer-group WORD in prefix-filter",
5639 "Clear all members of peer-group\n"
5640 "BGP peer-group name\n"
5641 "Soft reconfig inbound update\n"
5642 "Push out prefix-list ORF and do inbound soft reconfig\n")
5644 DEFUN (clear_ip_bgp_external_soft_in
,
5645 clear_ip_bgp_external_soft_in_cmd
,
5646 "clear ip bgp external soft in",
5650 "Clear all external peers\n"
5652 "Soft reconfig inbound update\n")
5654 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5655 BGP_CLEAR_SOFT_IN
, NULL
);
5658 ALIAS (clear_ip_bgp_external_soft_in
,
5659 clear_ip_bgp_external_in_cmd
,
5660 "clear ip bgp external in",
5664 "Clear all external peers\n"
5665 "Soft reconfig inbound update\n")
5667 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
5668 clear_ip_bgp_external_in_prefix_filter_cmd
,
5669 "clear ip bgp external in prefix-filter",
5673 "Clear all external peers\n"
5674 "Soft reconfig inbound update\n"
5675 "Push out prefix-list ORF and do inbound soft reconfig\n")
5677 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5678 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5681 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
5682 clear_ip_bgp_external_ipv4_soft_in_cmd
,
5683 "clear ip bgp external ipv4 (unicast|multicast) soft in",
5687 "Clear all external peers\n"
5689 "Address Family modifier\n"
5690 "Address Family modifier\n"
5692 "Soft reconfig inbound update\n")
5694 if (strncmp (argv
[0], "m", 1) == 0)
5695 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5696 BGP_CLEAR_SOFT_IN
, NULL
);
5698 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5699 BGP_CLEAR_SOFT_IN
, NULL
);
5702 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
5703 clear_ip_bgp_external_ipv4_in_cmd
,
5704 "clear ip bgp external ipv4 (unicast|multicast) in",
5708 "Clear all external peers\n"
5710 "Address Family modifier\n"
5711 "Address Family modifier\n"
5712 "Soft reconfig inbound update\n")
5714 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
5715 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
5716 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
5720 "Clear all external peers\n"
5722 "Address Family modifier\n"
5723 "Address Family modifier\n"
5724 "Soft reconfig inbound update\n"
5725 "Push out prefix-list ORF and do inbound soft reconfig\n")
5727 if (strncmp (argv
[0], "m", 1) == 0)
5728 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5729 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5731 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5732 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5735 DEFUN (clear_bgp_external_soft_in
,
5736 clear_bgp_external_soft_in_cmd
,
5737 "clear bgp external soft in",
5740 "Clear all external peers\n"
5742 "Soft reconfig inbound update\n")
5744 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5745 BGP_CLEAR_SOFT_IN
, NULL
);
5748 ALIAS (clear_bgp_external_soft_in
,
5749 clear_bgp_ipv6_external_soft_in_cmd
,
5750 "clear bgp ipv6 external soft in",
5754 "Clear all external peers\n"
5756 "Soft reconfig inbound update\n")
5758 ALIAS (clear_bgp_external_soft_in
,
5759 clear_bgp_external_in_cmd
,
5760 "clear bgp external in",
5763 "Clear all external peers\n"
5764 "Soft reconfig inbound update\n")
5766 ALIAS (clear_bgp_external_soft_in
,
5767 clear_bgp_ipv6_external_in_cmd
,
5768 "clear bgp ipv6 external WORD in",
5772 "Clear all external peers\n"
5773 "Soft reconfig inbound update\n")
5775 DEFUN (clear_bgp_external_in_prefix_filter
,
5776 clear_bgp_external_in_prefix_filter_cmd
,
5777 "clear bgp external in prefix-filter",
5780 "Clear all external peers\n"
5781 "Soft reconfig inbound update\n"
5782 "Push out prefix-list ORF and do inbound soft reconfig\n")
5784 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5785 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5788 ALIAS (clear_bgp_external_in_prefix_filter
,
5789 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
5790 "clear bgp ipv6 external in prefix-filter",
5794 "Clear all external peers\n"
5795 "Soft reconfig inbound update\n"
5796 "Push out prefix-list ORF and do inbound soft reconfig\n")
5798 DEFUN (clear_ip_bgp_as_soft_in
,
5799 clear_ip_bgp_as_soft_in_cmd
,
5800 "clear ip bgp " CMD_AS_RANGE
" soft in",
5804 "Clear peers with the AS number\n"
5806 "Soft reconfig inbound update\n")
5808 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5809 BGP_CLEAR_SOFT_IN
, argv
[0]);
5812 ALIAS (clear_ip_bgp_as_soft_in
,
5813 clear_ip_bgp_as_in_cmd
,
5814 "clear ip bgp " CMD_AS_RANGE
" in",
5818 "Clear peers with the AS number\n"
5819 "Soft reconfig inbound update\n")
5821 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
5822 clear_ip_bgp_as_in_prefix_filter_cmd
,
5823 "clear ip bgp " CMD_AS_RANGE
" in prefix-filter",
5827 "Clear peers with the AS number\n"
5828 "Soft reconfig inbound update\n"
5829 "Push out prefix-list ORF and do inbound soft reconfig\n")
5831 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5832 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5835 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
5836 clear_ip_bgp_as_ipv4_soft_in_cmd
,
5837 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft in",
5841 "Clear peers with the AS number\n"
5843 "Address Family modifier\n"
5844 "Address Family modifier\n"
5846 "Soft reconfig inbound update\n")
5848 if (strncmp (argv
[1], "m", 1) == 0)
5849 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5850 BGP_CLEAR_SOFT_IN
, argv
[0]);
5852 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5853 BGP_CLEAR_SOFT_IN
, argv
[0]);
5856 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
5857 clear_ip_bgp_as_ipv4_in_cmd
,
5858 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in",
5862 "Clear peers with the AS number\n"
5864 "Address Family modifier\n"
5865 "Address Family modifier\n"
5866 "Soft reconfig inbound update\n")
5868 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
5869 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
5870 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in prefix-filter",
5874 "Clear peers with the AS number\n"
5876 "Address Family modifier\n"
5877 "Address Family modifier\n"
5878 "Soft reconfig inbound update\n"
5879 "Push out prefix-list ORF and do inbound soft reconfig\n")
5881 if (strncmp (argv
[1], "m", 1) == 0)
5882 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5883 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5885 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5886 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5889 DEFUN (clear_ip_bgp_as_vpnv4_soft_in
,
5890 clear_ip_bgp_as_vpnv4_soft_in_cmd
,
5891 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft in",
5895 "Clear peers with the AS number\n"
5897 "Address Family modifier\n"
5899 "Soft reconfig inbound update\n")
5901 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
5902 BGP_CLEAR_SOFT_IN
, argv
[0]);
5905 ALIAS (clear_ip_bgp_as_vpnv4_soft_in
,
5906 clear_ip_bgp_as_vpnv4_in_cmd
,
5907 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast in",
5911 "Clear peers with the AS number\n"
5913 "Address Family modifier\n"
5914 "Soft reconfig inbound update\n")
5916 DEFUN (clear_bgp_as_soft_in
,
5917 clear_bgp_as_soft_in_cmd
,
5918 "clear bgp " CMD_AS_RANGE
" soft in",
5921 "Clear peers with the AS number\n"
5923 "Soft reconfig inbound update\n")
5925 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5926 BGP_CLEAR_SOFT_IN
, argv
[0]);
5929 ALIAS (clear_bgp_as_soft_in
,
5930 clear_bgp_ipv6_as_soft_in_cmd
,
5931 "clear bgp ipv6 " CMD_AS_RANGE
" soft in",
5935 "Clear peers with the AS number\n"
5937 "Soft reconfig inbound update\n")
5939 ALIAS (clear_bgp_as_soft_in
,
5940 clear_bgp_as_in_cmd
,
5941 "clear bgp " CMD_AS_RANGE
" in",
5944 "Clear peers with the AS number\n"
5945 "Soft reconfig inbound update\n")
5947 ALIAS (clear_bgp_as_soft_in
,
5948 clear_bgp_ipv6_as_in_cmd
,
5949 "clear bgp ipv6 " CMD_AS_RANGE
" in",
5953 "Clear peers with the AS number\n"
5954 "Soft reconfig inbound update\n")
5956 DEFUN (clear_bgp_as_in_prefix_filter
,
5957 clear_bgp_as_in_prefix_filter_cmd
,
5958 "clear bgp " CMD_AS_RANGE
" in prefix-filter",
5961 "Clear peers with the AS number\n"
5962 "Soft reconfig inbound update\n"
5963 "Push out prefix-list ORF and do inbound soft reconfig\n")
5965 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5966 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5969 ALIAS (clear_bgp_as_in_prefix_filter
,
5970 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
5971 "clear bgp ipv6 " CMD_AS_RANGE
" in prefix-filter",
5975 "Clear peers with the AS number\n"
5976 "Soft reconfig inbound update\n"
5977 "Push out prefix-list ORF and do inbound soft reconfig\n")
5979 /* Both soft-reconfiguration */
5980 DEFUN (clear_ip_bgp_all_soft
,
5981 clear_ip_bgp_all_soft_cmd
,
5982 "clear ip bgp * soft",
5990 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5991 BGP_CLEAR_SOFT_BOTH
, NULL
);
5993 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5994 BGP_CLEAR_SOFT_BOTH
, NULL
);
5997 ALIAS (clear_ip_bgp_all_soft
,
5998 clear_ip_bgp_instance_all_soft_cmd
,
5999 "clear ip bgp view WORD * soft",
6009 DEFUN (clear_ip_bgp_all_ipv4_soft
,
6010 clear_ip_bgp_all_ipv4_soft_cmd
,
6011 "clear ip bgp * ipv4 (unicast|multicast) soft",
6017 "Address Family Modifier\n"
6018 "Address Family Modifier\n"
6021 if (strncmp (argv
[0], "m", 1) == 0)
6022 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6023 BGP_CLEAR_SOFT_BOTH
, NULL
);
6025 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6026 BGP_CLEAR_SOFT_BOTH
, NULL
);
6029 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
6030 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
6031 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft",
6039 "Address Family Modifier\n"
6040 "Address Family Modifier\n"
6043 if (strncmp (argv
[1], "m", 1) == 0)
6044 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6045 BGP_CLEAR_SOFT_BOTH
, NULL
);
6047 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6048 BGP_CLEAR_SOFT_BOTH
, NULL
);
6051 DEFUN (clear_ip_bgp_all_vpnv4_soft
,
6052 clear_ip_bgp_all_vpnv4_soft_cmd
,
6053 "clear ip bgp * vpnv4 unicast soft",
6059 "Address Family Modifier\n"
6062 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
6063 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6066 DEFUN (clear_bgp_all_soft
,
6067 clear_bgp_all_soft_cmd
,
6075 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6076 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6078 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6079 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6082 ALIAS (clear_bgp_all_soft
,
6083 clear_bgp_instance_all_soft_cmd
,
6084 "clear bgp view WORD * soft",
6092 ALIAS (clear_bgp_all_soft
,
6093 clear_bgp_ipv6_all_soft_cmd
,
6094 "clear bgp ipv6 * soft",
6101 DEFUN (clear_ip_bgp_peer_soft
,
6102 clear_ip_bgp_peer_soft_cmd
,
6103 "clear ip bgp A.B.C.D soft",
6107 "BGP neighbor address to clear\n"
6110 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6111 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6114 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
6115 clear_ip_bgp_peer_ipv4_soft_cmd
,
6116 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft",
6120 "BGP neighbor address to clear\n"
6122 "Address Family Modifier\n"
6123 "Address Family Modifier\n"
6126 if (strncmp (argv
[1], "m", 1) == 0)
6127 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
6128 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6130 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6131 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6134 DEFUN (clear_ip_bgp_peer_vpnv4_soft
,
6135 clear_ip_bgp_peer_vpnv4_soft_cmd
,
6136 "clear ip bgp A.B.C.D vpnv4 unicast soft",
6140 "BGP neighbor address to clear\n"
6142 "Address Family Modifier\n"
6145 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
6146 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6149 DEFUN (clear_bgp_peer_soft
,
6150 clear_bgp_peer_soft_cmd
,
6151 "clear bgp (A.B.C.D|X:X::X:X) soft",
6154 "BGP neighbor address to clear\n"
6155 "BGP IPv6 neighbor to clear\n"
6158 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6159 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6162 ALIAS (clear_bgp_peer_soft
,
6163 clear_bgp_ipv6_peer_soft_cmd
,
6164 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft",
6168 "BGP neighbor address to clear\n"
6169 "BGP IPv6 neighbor to clear\n"
6172 DEFUN (clear_ip_bgp_peer_group_soft
,
6173 clear_ip_bgp_peer_group_soft_cmd
,
6174 "clear ip bgp peer-group WORD soft",
6178 "Clear all members of peer-group\n"
6179 "BGP peer-group name\n"
6182 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6183 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6186 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
6187 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
6188 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
6192 "Clear all members of peer-group\n"
6193 "BGP peer-group name\n"
6195 "Address Family modifier\n"
6196 "Address Family modifier\n"
6199 if (strncmp (argv
[1], "m", 1) == 0)
6200 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
6201 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6203 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6204 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6207 DEFUN (clear_bgp_peer_group_soft
,
6208 clear_bgp_peer_group_soft_cmd
,
6209 "clear bgp peer-group WORD soft",
6212 "Clear all members of peer-group\n"
6213 "BGP peer-group name\n"
6216 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
6217 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6220 ALIAS (clear_bgp_peer_group_soft
,
6221 clear_bgp_ipv6_peer_group_soft_cmd
,
6222 "clear bgp ipv6 peer-group WORD soft",
6226 "Clear all members of peer-group\n"
6227 "BGP peer-group name\n"
6230 DEFUN (clear_ip_bgp_external_soft
,
6231 clear_ip_bgp_external_soft_cmd
,
6232 "clear ip bgp external soft",
6236 "Clear all external peers\n"
6239 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6240 BGP_CLEAR_SOFT_BOTH
, NULL
);
6243 DEFUN (clear_ip_bgp_external_ipv4_soft
,
6244 clear_ip_bgp_external_ipv4_soft_cmd
,
6245 "clear ip bgp external ipv4 (unicast|multicast) soft",
6249 "Clear all external peers\n"
6251 "Address Family modifier\n"
6252 "Address Family modifier\n"
6255 if (strncmp (argv
[0], "m", 1) == 0)
6256 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
6257 BGP_CLEAR_SOFT_BOTH
, NULL
);
6259 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6260 BGP_CLEAR_SOFT_BOTH
, NULL
);
6263 DEFUN (clear_bgp_external_soft
,
6264 clear_bgp_external_soft_cmd
,
6265 "clear bgp external soft",
6268 "Clear all external peers\n"
6271 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6272 BGP_CLEAR_SOFT_BOTH
, NULL
);
6275 ALIAS (clear_bgp_external_soft
,
6276 clear_bgp_ipv6_external_soft_cmd
,
6277 "clear bgp ipv6 external soft",
6281 "Clear all external peers\n"
6284 DEFUN (clear_ip_bgp_as_soft
,
6285 clear_ip_bgp_as_soft_cmd
,
6286 "clear ip bgp " CMD_AS_RANGE
" soft",
6290 "Clear peers with the AS number\n"
6293 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6294 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6297 DEFUN (clear_ip_bgp_as_ipv4_soft
,
6298 clear_ip_bgp_as_ipv4_soft_cmd
,
6299 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft",
6303 "Clear peers with the AS number\n"
6305 "Address Family Modifier\n"
6306 "Address Family Modifier\n"
6309 if (strncmp (argv
[1], "m", 1) == 0)
6310 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
6311 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6313 return bgp_clear_vty (vty
, NULL
,AFI_IP
, SAFI_UNICAST
, clear_as
,
6314 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6317 DEFUN (clear_ip_bgp_as_vpnv4_soft
,
6318 clear_ip_bgp_as_vpnv4_soft_cmd
,
6319 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft",
6323 "Clear peers with the AS number\n"
6325 "Address Family Modifier\n"
6328 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
6329 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6332 DEFUN (clear_bgp_as_soft
,
6333 clear_bgp_as_soft_cmd
,
6334 "clear bgp " CMD_AS_RANGE
" soft",
6337 "Clear peers with the AS number\n"
6340 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
6341 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6344 ALIAS (clear_bgp_as_soft
,
6345 clear_bgp_ipv6_as_soft_cmd
,
6346 "clear bgp ipv6 " CMD_AS_RANGE
" soft",
6350 "Clear peers with the AS number\n"
6353 /* RS-client soft reconfiguration. */
6355 DEFUN (clear_bgp_all_rsclient
,
6356 clear_bgp_all_rsclient_cmd
,
6357 "clear bgp * rsclient",
6361 "Soft reconfig for rsclient RIB\n")
6364 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6365 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6367 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6368 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6371 ALIAS (clear_bgp_all_rsclient
,
6372 clear_bgp_ipv6_all_rsclient_cmd
,
6373 "clear bgp ipv6 * rsclient",
6378 "Soft reconfig for rsclient RIB\n")
6380 ALIAS (clear_bgp_all_rsclient
,
6381 clear_bgp_instance_all_rsclient_cmd
,
6382 "clear bgp view WORD * rsclient",
6388 "Soft reconfig for rsclient RIB\n")
6390 ALIAS (clear_bgp_all_rsclient
,
6391 clear_bgp_ipv6_instance_all_rsclient_cmd
,
6392 "clear bgp ipv6 view WORD * rsclient",
6399 "Soft reconfig for rsclient RIB\n")
6400 #endif /* HAVE_IPV6 */
6402 DEFUN (clear_ip_bgp_all_rsclient
,
6403 clear_ip_bgp_all_rsclient_cmd
,
6404 "clear ip bgp * rsclient",
6409 "Soft reconfig for rsclient RIB\n")
6412 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6413 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6415 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6416 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6419 ALIAS (clear_ip_bgp_all_rsclient
,
6420 clear_ip_bgp_instance_all_rsclient_cmd
,
6421 "clear ip bgp view WORD * rsclient",
6428 "Soft reconfig for rsclient RIB\n")
6431 DEFUN (clear_bgp_peer_rsclient
,
6432 clear_bgp_peer_rsclient_cmd
,
6433 "clear bgp (A.B.C.D|X:X::X:X) rsclient",
6436 "BGP neighbor IP address to clear\n"
6437 "BGP IPv6 neighbor to clear\n"
6438 "Soft reconfig for rsclient RIB\n")
6441 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6442 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6444 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6445 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6448 ALIAS (clear_bgp_peer_rsclient
,
6449 clear_bgp_ipv6_peer_rsclient_cmd
,
6450 "clear bgp ipv6 (A.B.C.D|X:X::X:X) rsclient",
6454 "BGP neighbor IP address to clear\n"
6455 "BGP IPv6 neighbor to clear\n"
6456 "Soft reconfig for rsclient RIB\n")
6458 ALIAS (clear_bgp_peer_rsclient
,
6459 clear_bgp_instance_peer_rsclient_cmd
,
6460 "clear bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6465 "BGP neighbor IP address to clear\n"
6466 "BGP IPv6 neighbor to clear\n"
6467 "Soft reconfig for rsclient RIB\n")
6469 ALIAS (clear_bgp_peer_rsclient
,
6470 clear_bgp_ipv6_instance_peer_rsclient_cmd
,
6471 "clear bgp ipv6 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")
6480 #endif /* HAVE_IPV6 */
6482 DEFUN (clear_ip_bgp_peer_rsclient
,
6483 clear_ip_bgp_peer_rsclient_cmd
,
6484 "clear ip bgp (A.B.C.D|X:X::X:X) rsclient",
6488 "BGP neighbor IP address to clear\n"
6489 "BGP IPv6 neighbor to clear\n"
6490 "Soft reconfig for rsclient RIB\n")
6493 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_peer
,
6494 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6496 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6497 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6500 ALIAS (clear_ip_bgp_peer_rsclient
,
6501 clear_ip_bgp_instance_peer_rsclient_cmd
,
6502 "clear ip bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6508 "BGP neighbor IP address to clear\n"
6509 "BGP IPv6 neighbor to clear\n"
6510 "Soft reconfig for rsclient RIB\n")
6512 DEFUN (show_bgp_views
,
6517 "Show the defined BGP views\n")
6519 struct list
*inst
= bm
->bgp
;
6520 struct listnode
*node
;
6523 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE
))
6525 vty_out (vty
, "Multiple BGP views are not defined%s", VTY_NEWLINE
);
6529 vty_out (vty
, "Defined BGP views:%s", VTY_NEWLINE
);
6530 for (ALL_LIST_ELEMENTS_RO(inst
, node
, bgp
))
6531 vty_out (vty
, "\t%s (AS%u)%s",
6532 bgp
->name
? bgp
->name
: "(null)",
6533 bgp
->as
, VTY_NEWLINE
);
6538 DEFUN (show_bgp_memory
,
6539 show_bgp_memory_cmd
,
6543 "Global BGP memory statistics\n")
6545 char memstrbuf
[MTYPE_MEMSTR_LEN
];
6546 unsigned long count
;
6548 /* RIB related usage stats */
6549 count
= mtype_stats_alloc (MTYPE_BGP_NODE
);
6550 vty_out (vty
, "%ld RIB nodes, using %s of memory%s", count
,
6551 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6552 count
* sizeof (struct bgp_node
)),
6555 count
= mtype_stats_alloc (MTYPE_BGP_ROUTE
);
6556 vty_out (vty
, "%ld BGP routes, using %s of memory%s", count
,
6557 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6558 count
* sizeof (struct bgp_info
)),
6560 if ((count
= mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA
)))
6561 vty_out (vty
, "%ld BGP route ancillaries, using %s of memory%s", count
,
6562 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6563 count
* sizeof (struct bgp_info_extra
)),
6566 if ((count
= mtype_stats_alloc (MTYPE_BGP_STATIC
)))
6567 vty_out (vty
, "%ld Static routes, using %s of memory%s", count
,
6568 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6569 count
* sizeof (struct bgp_static
)),
6573 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_IN
)))
6574 vty_out (vty
, "%ld Adj-In entries, using %s of memory%s", count
,
6575 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6576 count
* sizeof (struct bgp_adj_in
)),
6578 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_OUT
)))
6579 vty_out (vty
, "%ld Adj-Out entries, using %s of memory%s", count
,
6580 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6581 count
* sizeof (struct bgp_adj_out
)),
6584 if ((count
= mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE
)))
6585 vty_out (vty
, "%ld Nexthop cache entries, using %s of memory%s", count
,
6586 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6587 count
* sizeof (struct bgp_nexthop_cache
)),
6590 if ((count
= mtype_stats_alloc (MTYPE_BGP_DAMP_INFO
)))
6591 vty_out (vty
, "%ld Dampening entries, using %s of memory%s", count
,
6592 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6593 count
* sizeof (struct bgp_damp_info
)),
6597 count
= attr_count();
6598 vty_out (vty
, "%ld BGP attributes, using %s of memory%s", count
,
6599 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6600 count
* sizeof(struct attr
)),
6602 if ((count
= mtype_stats_alloc (MTYPE_ATTR_EXTRA
)))
6603 vty_out (vty
, "%ld BGP extra attributes, using %s of memory%s", count
,
6604 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6605 count
* sizeof(struct attr_extra
)),
6608 if ((count
= attr_unknown_count()))
6609 vty_out (vty
, "%ld unknown attributes%s", count
, VTY_NEWLINE
);
6611 /* AS_PATH attributes */
6612 count
= aspath_count ();
6613 vty_out (vty
, "%ld BGP AS-PATH entries, using %s of memory%s", count
,
6614 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6615 count
* sizeof (struct aspath
)),
6618 count
= mtype_stats_alloc (MTYPE_AS_SEG
);
6619 vty_out (vty
, "%ld BGP AS-PATH segments, using %s of memory%s", count
,
6620 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6621 count
* sizeof (struct assegment
)),
6624 /* Other attributes */
6625 if ((count
= community_count ()))
6626 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
6627 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6628 count
* sizeof (struct community
)),
6630 if ((count
= mtype_stats_alloc (MTYPE_ECOMMUNITY
)))
6631 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
6632 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6633 count
* sizeof (struct ecommunity
)),
6636 if ((count
= mtype_stats_alloc (MTYPE_CLUSTER
)))
6637 vty_out (vty
, "%ld Cluster lists, using %s of memory%s", count
,
6638 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6639 count
* sizeof (struct cluster_list
)),
6642 /* Peer related usage */
6643 count
= mtype_stats_alloc (MTYPE_BGP_PEER
);
6644 vty_out (vty
, "%ld peers, using %s of memory%s", count
,
6645 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6646 count
* sizeof (struct peer
)),
6649 if ((count
= mtype_stats_alloc (MTYPE_PEER_GROUP
)))
6650 vty_out (vty
, "%ld peer groups, using %s of memory%s", count
,
6651 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6652 count
* sizeof (struct peer_group
)),
6656 if ((count
= mtype_stats_alloc (MTYPE_HASH
)))
6657 vty_out (vty
, "%ld hash tables, using %s of memory%s", count
,
6658 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6659 count
* sizeof (struct hash
)),
6661 if ((count
= mtype_stats_alloc (MTYPE_HASH_BACKET
)))
6662 vty_out (vty
, "%ld hash buckets, using %s of memory%s", count
,
6663 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6664 count
* sizeof (struct hash_backet
)),
6666 if ((count
= mtype_stats_alloc (MTYPE_BGP_REGEXP
)))
6667 vty_out (vty
, "%ld compiled regexes, using %s of memory%s", count
,
6668 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6669 count
* sizeof (regex_t
)),
6674 /* Show BGP peer's summary information. */
6676 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
)
6679 struct listnode
*node
, *nnode
;
6680 unsigned int count
= 0;
6681 char timebuf
[BGP_UPTIME_LEN
];
6684 /* Header string for each address family. */
6685 static char header
[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
6687 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
6689 if (peer
->afc
[afi
][safi
])
6694 char memstrbuf
[MTYPE_MEMSTR_LEN
];
6696 /* Usage summary and header */
6698 "BGP router identifier %s, local AS number %d%s",
6699 inet_ntoa (bgp
->router_id
), bgp
->as
, VTY_NEWLINE
);
6701 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
6702 vty_out (vty
, "RIB entries %ld, using %s of memory%s", ents
,
6703 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6704 ents
* sizeof (struct bgp_node
)),
6707 /* Peer related usage */
6708 ents
= listcount (bgp
->peer
);
6709 vty_out (vty
, "Peers %ld, using %s of memory%s",
6711 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6712 ents
* sizeof (struct peer
)),
6715 if ((ents
= listcount (bgp
->rsclient
)))
6716 vty_out (vty
, "RS-Client peers %ld, using %s of memory%s",
6718 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6719 ents
* sizeof (struct peer
)),
6722 if ((ents
= listcount (bgp
->group
)))
6723 vty_out (vty
, "Peer groups %ld, using %s of memory%s", ents
,
6724 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
6725 ents
* sizeof (struct peer_group
)),
6728 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
6729 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
6730 vty_out (vty
, "%s", VTY_NEWLINE
);
6731 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
6736 len
= vty_out (vty
, "%s", peer
->host
);
6739 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
6741 vty_out (vty
, "%*s", len
, " ");
6743 vty_out (vty
, "4 ");
6745 vty_out (vty
, "%5d %7d %7d %8d %4d %4lu ",
6747 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
6748 + peer
->notify_in
+ peer
->refresh_in
+ peer
->dynamic_cap_in
,
6749 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
6750 + peer
->notify_out
+ peer
->refresh_out
6751 + peer
->dynamic_cap_out
,
6752 0, 0, (unsigned long) peer
->obuf
->count
);
6754 vty_out (vty
, "%8s",
6755 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
));
6757 if (peer
->status
== Established
)
6759 vty_out (vty
, " %8ld", peer
->pcount
[afi
][safi
]);
6763 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
6764 vty_out (vty
, " Idle (Admin)");
6765 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
6766 vty_out (vty
, " Idle (PfxCt)");
6768 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, peer
->status
));
6771 vty_out (vty
, "%s", VTY_NEWLINE
);
6776 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
6777 count
, VTY_NEWLINE
);
6779 vty_out (vty
, "No %s neighbor is configured%s",
6780 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
6785 bgp_show_summary_vty (struct vty
*vty
, const char *name
,
6786 afi_t afi
, safi_t safi
)
6792 bgp
= bgp_lookup_by_name (name
);
6796 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
6800 bgp_show_summary (vty
, bgp
, afi
, safi
);
6804 bgp
= bgp_get_default ();
6807 bgp_show_summary (vty
, bgp
, afi
, safi
);
6812 /* `show ip bgp summary' commands. */
6813 DEFUN (show_ip_bgp_summary
,
6814 show_ip_bgp_summary_cmd
,
6815 "show ip bgp summary",
6819 "Summary of BGP neighbor status\n")
6821 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6824 DEFUN (show_ip_bgp_instance_summary
,
6825 show_ip_bgp_instance_summary_cmd
,
6826 "show ip bgp view WORD summary",
6832 "Summary of BGP neighbor status\n")
6834 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6837 DEFUN (show_ip_bgp_ipv4_summary
,
6838 show_ip_bgp_ipv4_summary_cmd
,
6839 "show ip bgp ipv4 (unicast|multicast) summary",
6844 "Address Family modifier\n"
6845 "Address Family modifier\n"
6846 "Summary of BGP neighbor status\n")
6848 if (strncmp (argv
[0], "m", 1) == 0)
6849 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
6851 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6854 DEFUN (show_ip_bgp_instance_ipv4_summary
,
6855 show_ip_bgp_instance_ipv4_summary_cmd
,
6856 "show ip bgp view WORD ipv4 (unicast|multicast) summary",
6863 "Address Family modifier\n"
6864 "Address Family modifier\n"
6865 "Summary of BGP neighbor status\n")
6867 if (strncmp (argv
[1], "m", 1) == 0)
6868 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
6870 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6873 DEFUN (show_ip_bgp_vpnv4_all_summary
,
6874 show_ip_bgp_vpnv4_all_summary_cmd
,
6875 "show ip bgp vpnv4 all summary",
6879 "Display VPNv4 NLRI specific information\n"
6880 "Display information about all VPNv4 NLRIs\n"
6881 "Summary of BGP neighbor status\n")
6883 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6886 DEFUN (show_ip_bgp_vpnv4_rd_summary
,
6887 show_ip_bgp_vpnv4_rd_summary_cmd
,
6888 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary",
6892 "Display VPNv4 NLRI specific information\n"
6893 "Display information for a route distinguisher\n"
6894 "VPN Route Distinguisher\n"
6895 "Summary of BGP neighbor status\n")
6898 struct prefix_rd prd
;
6900 ret
= str2prefix_rd (argv
[0], &prd
);
6903 vty_out (vty
, "%% Malformed Route Distinguisher%s", VTY_NEWLINE
);
6907 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6911 DEFUN (show_bgp_summary
,
6912 show_bgp_summary_cmd
,
6916 "Summary of BGP neighbor status\n")
6918 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6921 DEFUN (show_bgp_instance_summary
,
6922 show_bgp_instance_summary_cmd
,
6923 "show bgp view WORD summary",
6928 "Summary of BGP neighbor status\n")
6930 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
6933 ALIAS (show_bgp_summary
,
6934 show_bgp_ipv6_summary_cmd
,
6935 "show bgp ipv6 summary",
6939 "Summary of BGP neighbor status\n")
6941 ALIAS (show_bgp_instance_summary
,
6942 show_bgp_instance_ipv6_summary_cmd
,
6943 "show bgp view WORD ipv6 summary",
6949 "Summary of BGP neighbor status\n")
6952 DEFUN (show_ipv6_bgp_summary
,
6953 show_ipv6_bgp_summary_cmd
,
6954 "show ipv6 bgp summary",
6958 "Summary of BGP neighbor status\n")
6960 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6964 DEFUN (show_ipv6_mbgp_summary
,
6965 show_ipv6_mbgp_summary_cmd
,
6966 "show ipv6 mbgp summary",
6970 "Summary of BGP neighbor status\n")
6972 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
);
6974 #endif /* HAVE_IPV6 */
6977 afi_safi_print (afi_t afi
, safi_t safi
)
6979 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
6980 return "IPv4 Unicast";
6981 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
6982 return "IPv4 Multicast";
6983 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
6984 return "VPNv4 Unicast";
6985 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
6986 return "IPv6 Unicast";
6987 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
6988 return "IPv6 Multicast";
6993 /* Show BGP peer's information. */
7001 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
,
7002 afi_t afi
, safi_t safi
,
7003 u_int16_t adv_smcap
, u_int16_t adv_rmcap
,
7004 u_int16_t rcv_smcap
, u_int16_t rcv_rmcap
)
7007 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
7008 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
7010 vty_out (vty
, " Send-mode: ");
7011 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
7012 vty_out (vty
, "advertised");
7013 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
7014 vty_out (vty
, "%sreceived",
7015 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
7017 vty_out (vty
, "%s", VTY_NEWLINE
);
7021 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
7022 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
7024 vty_out (vty
, " Receive-mode: ");
7025 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
7026 vty_out (vty
, "advertised");
7027 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
7028 vty_out (vty
, "%sreceived",
7029 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
7031 vty_out (vty
, "%s", VTY_NEWLINE
);
7036 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
)
7038 struct bgp_filter
*filter
;
7039 char orf_pfx_name
[BUFSIZ
];
7042 filter
= &p
->filter
[afi
][safi
];
7044 vty_out (vty
, " For address family: %s%s", afi_safi_print (afi
, safi
),
7047 if (p
->af_group
[afi
][safi
])
7048 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
7050 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7051 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
7052 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
7053 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7054 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
7055 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
7056 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
7058 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7059 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
7060 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7061 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
7063 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
7064 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
7065 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
7066 PEER_CAP_ORF_PREFIX_SM_ADV
,
7067 PEER_CAP_ORF_PREFIX_RM_ADV
,
7068 PEER_CAP_ORF_PREFIX_SM_RCV
,
7069 PEER_CAP_ORF_PREFIX_RM_RCV
);
7071 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
7072 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
7073 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
7074 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
7076 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
7077 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
7078 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
7079 PEER_CAP_ORF_PREFIX_SM_ADV
,
7080 PEER_CAP_ORF_PREFIX_RM_ADV
,
7081 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
7082 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
);
7085 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
7086 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
);
7088 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
7091 vty_out (vty
, " Outbound Route Filter (ORF):");
7092 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
7093 vty_out (vty
, " sent;");
7095 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
7096 vty_out (vty
, "%s", VTY_NEWLINE
);
7098 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
7099 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
7101 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
7102 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
7103 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
7104 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
7105 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
7106 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
7107 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
7108 vty_out (vty
, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE
);
7109 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
))
7110 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
7111 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
7112 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7113 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
7114 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7115 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
7116 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
7117 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
7118 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7120 vty_out (vty
, " Community attribute sent to this neighbor");
7121 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
7122 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7123 vty_out (vty
, "(both)%s", VTY_NEWLINE
);
7124 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
7125 vty_out (vty
, "(extended)%s", VTY_NEWLINE
);
7127 vty_out (vty
, "(standard)%s", VTY_NEWLINE
);
7129 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
7131 vty_out (vty
, " Default information originate,");
7133 if (p
->default_rmap
[afi
][safi
].name
)
7134 vty_out (vty
, " default route-map %s%s,",
7135 p
->default_rmap
[afi
][safi
].map
? "*" : "",
7136 p
->default_rmap
[afi
][safi
].name
);
7137 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_DEFAULT_ORIGINATE
))
7138 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
7140 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
7143 if (filter
->plist
[FILTER_IN
].name
7144 || filter
->dlist
[FILTER_IN
].name
7145 || filter
->aslist
[FILTER_IN
].name
7146 || filter
->map
[RMAP_IN
].name
)
7147 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
7148 if (filter
->plist
[FILTER_OUT
].name
7149 || filter
->dlist
[FILTER_OUT
].name
7150 || filter
->aslist
[FILTER_OUT
].name
7151 || filter
->map
[RMAP_OUT
].name
7152 || filter
->usmap
.name
)
7153 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
7154 if (filter
->map
[RMAP_IMPORT
].name
)
7155 vty_out (vty
, " Import policy for this RS-client configured%s", VTY_NEWLINE
);
7156 if (filter
->map
[RMAP_EXPORT
].name
)
7157 vty_out (vty
, " Export policy for this RS-client configured%s", VTY_NEWLINE
);
7160 if (filter
->plist
[FILTER_IN
].name
)
7161 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
7162 filter
->plist
[FILTER_IN
].plist
? "*" : "",
7163 filter
->plist
[FILTER_IN
].name
,
7165 if (filter
->plist
[FILTER_OUT
].name
)
7166 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
7167 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
7168 filter
->plist
[FILTER_OUT
].name
,
7171 /* distribute-list */
7172 if (filter
->dlist
[FILTER_IN
].name
)
7173 vty_out (vty
, " Incoming update network filter list is %s%s%s",
7174 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
7175 filter
->dlist
[FILTER_IN
].name
,
7177 if (filter
->dlist
[FILTER_OUT
].name
)
7178 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
7179 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
7180 filter
->dlist
[FILTER_OUT
].name
,
7184 if (filter
->aslist
[FILTER_IN
].name
)
7185 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
7186 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
7187 filter
->aslist
[FILTER_IN
].name
,
7189 if (filter
->aslist
[FILTER_OUT
].name
)
7190 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
7191 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
7192 filter
->aslist
[FILTER_OUT
].name
,
7196 if (filter
->map
[RMAP_IN
].name
)
7197 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
7198 filter
->map
[RMAP_IN
].map
? "*" : "",
7199 filter
->map
[RMAP_IN
].name
,
7201 if (filter
->map
[RMAP_OUT
].name
)
7202 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
7203 filter
->map
[RMAP_OUT
].map
? "*" : "",
7204 filter
->map
[RMAP_OUT
].name
,
7206 if (filter
->map
[RMAP_IMPORT
].name
)
7207 vty_out (vty
, " Route map for advertisements going into this RS-client's table is %s%s%s",
7208 filter
->map
[RMAP_IMPORT
].map
? "*" : "",
7209 filter
->map
[RMAP_IMPORT
].name
,
7211 if (filter
->map
[RMAP_EXPORT
].name
)
7212 vty_out (vty
, " Route map for advertisements coming from this RS-client is %s%s%s",
7213 filter
->map
[RMAP_EXPORT
].map
? "*" : "",
7214 filter
->map
[RMAP_EXPORT
].name
,
7217 /* unsuppress-map */
7218 if (filter
->usmap
.name
)
7219 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
7220 filter
->usmap
.map
? "*" : "",
7221 filter
->usmap
.name
, VTY_NEWLINE
);
7223 /* Receive prefix count */
7224 vty_out (vty
, " %ld accepted prefixes%s", p
->pcount
[afi
][safi
], VTY_NEWLINE
);
7226 /* Maximum prefix */
7227 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
7229 vty_out (vty
, " Maximum prefixes allowed %ld%s%s", p
->pmax
[afi
][safi
],
7230 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
7231 ? " (warning-only)" : "", VTY_NEWLINE
);
7232 vty_out (vty
, " Threshold for warning message %d%%",
7233 p
->pmax_threshold
[afi
][safi
]);
7234 if (p
->pmax_restart
[afi
][safi
])
7235 vty_out (vty
, ", restart interval %d min", p
->pmax_restart
[afi
][safi
]);
7236 vty_out (vty
, "%s", VTY_NEWLINE
);
7239 vty_out (vty
, "%s", VTY_NEWLINE
);
7243 bgp_show_peer (struct vty
*vty
, struct peer
*p
)
7247 char timebuf
[BGP_UPTIME_LEN
];
7253 /* Configured IP address. */
7254 vty_out (vty
, "BGP neighbor is %s, ", p
->host
);
7255 vty_out (vty
, "remote AS %d, ", p
->as
);
7256 vty_out (vty
, "local AS %d%s, ",
7257 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
7258 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
7259 " no-prepend" : "");
7260 vty_out (vty
, "%s link%s",
7261 p
->as
== p
->local_as
? "internal" : "external",
7266 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
7270 vty_out (vty
, " Member of peer-group %s for session parameters%s",
7271 p
->group
->name
, VTY_NEWLINE
);
7273 /* Administrative shutdown. */
7274 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
7275 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
7278 vty_out (vty
, " BGP version 4");
7279 vty_out (vty
, ", remote router ID %s%s",
7280 inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
7284 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
)
7285 && bgp_confederation_peers_check (bgp
, p
->as
))
7286 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
7289 vty_out (vty
, " BGP state = %s",
7290 LOOKUP (bgp_status_msg
, p
->status
));
7291 if (p
->status
== Established
)
7292 vty_out (vty
, ", up for %8s",
7293 peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
));
7294 else if (p
->status
== Active
)
7296 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
7297 vty_out (vty
, " (passive)");
7298 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
7299 vty_out (vty
, " (NSF passive)");
7301 vty_out (vty
, "%s", VTY_NEWLINE
);
7304 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
));
7306 /* Configured timer values. */
7307 vty_out (vty
, ", hold time is %d, keepalive interval is %d seconds%s",
7308 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
7309 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
7311 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
7312 vty_out (vty
, ", keepalive interval is %d seconds%s",
7313 p
->keepalive
, VTY_NEWLINE
);
7317 if (p
->status
== Established
)
7320 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
7321 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
7322 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
7323 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
7325 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
7326 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
7327 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
7328 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
7329 #endif /* HAVE_IPV6 */
7330 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
7331 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
7333 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
7336 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
)
7337 || CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
7339 vty_out (vty
, " 4 Byte AS:");
7340 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
7341 vty_out (vty
, " advertised");
7342 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
7343 vty_out (vty
, " %sreceived",
7344 CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
) ? "and " : "");
7345 vty_out (vty
, "%s", VTY_NEWLINE
);
7348 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
7349 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
7351 vty_out (vty
, " Dynamic:");
7352 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
7353 vty_out (vty
, " advertised");
7354 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
7355 vty_out (vty
, " %sreceived",
7356 CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) ? "and " : "");
7357 vty_out (vty
, "%s", VTY_NEWLINE
);
7361 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
7362 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
7363 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
7365 vty_out (vty
, " Route refresh:");
7366 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
7367 vty_out (vty
, " advertised");
7368 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
7369 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
7370 vty_out (vty
, " %sreceived(%s)",
7371 CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) ? "and " : "",
7372 (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
7373 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)) ?
7374 "old & new" : CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) ? "old" : "new");
7376 vty_out (vty
, "%s", VTY_NEWLINE
);
7379 /* Multiprotocol Extensions */
7380 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7381 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7382 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
7384 vty_out (vty
, " Address family %s:", afi_safi_print (afi
, safi
));
7385 if (p
->afc_adv
[afi
][safi
])
7386 vty_out (vty
, " advertised");
7387 if (p
->afc_recv
[afi
][safi
])
7388 vty_out (vty
, " %sreceived", p
->afc_adv
[afi
][safi
] ? "and " : "");
7389 vty_out (vty
, "%s", VTY_NEWLINE
);
7392 /* Gracefull Restart */
7393 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7394 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7396 vty_out (vty
, " Graceful Restart Capabilty:");
7397 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7398 vty_out (vty
, " advertised");
7399 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7400 vty_out (vty
, " %sreceived",
7401 CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) ? "and " : "");
7402 vty_out (vty
, "%s", VTY_NEWLINE
);
7404 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7406 int restart_af_count
= 0;
7408 vty_out (vty
, " Remote Restart timer is %d seconds%s",
7409 p
->v_gr_restart
, VTY_NEWLINE
);
7410 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
7412 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7413 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7414 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
7416 vty_out (vty
, "%s%s(%s)", restart_af_count
? ", " : "",
7417 afi_safi_print (afi
, safi
),
7418 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
) ?
7419 "preserved" : "not preserved");
7422 if (! restart_af_count
)
7423 vty_out (vty
, "none");
7424 vty_out (vty
, "%s", VTY_NEWLINE
);
7430 /* graceful restart information */
7431 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7435 int eor_send_af_count
= 0;
7436 int eor_receive_af_count
= 0;
7438 vty_out (vty
, " Graceful restart informations:%s", VTY_NEWLINE
);
7439 if (p
->status
== Established
)
7441 vty_out (vty
, " End-of-RIB send: ");
7442 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7443 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7444 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
7446 vty_out (vty
, "%s%s", eor_send_af_count
? ", " : "",
7447 afi_safi_print (afi
, safi
));
7448 eor_send_af_count
++;
7450 vty_out (vty
, "%s", VTY_NEWLINE
);
7452 vty_out (vty
, " End-of-RIB received: ");
7453 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7454 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7455 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
7457 vty_out (vty
, "%s%s", eor_receive_af_count
? ", " : "",
7458 afi_safi_print (afi
, safi
));
7459 eor_receive_af_count
++;
7461 vty_out (vty
, "%s", VTY_NEWLINE
);
7464 if (p
->t_gr_restart
)
7465 vty_out (vty
, " The remaining time of restart timer is %ld%s",
7466 thread_timer_remain_second (p
->t_gr_restart
), VTY_NEWLINE
);
7469 vty_out (vty
, " The remaining time of stalepath timer is %ld%s",
7470 thread_timer_remain_second (p
->t_gr_stale
), VTY_NEWLINE
);
7473 /* Packet counts. */
7474 vty_out (vty
, " Message statistics:%s", VTY_NEWLINE
);
7475 vty_out (vty
, " Inq depth is 0%s", VTY_NEWLINE
);
7476 vty_out (vty
, " Outq depth is %lu%s", (unsigned long) p
->obuf
->count
, VTY_NEWLINE
);
7477 vty_out (vty
, " Sent Rcvd%s", VTY_NEWLINE
);
7478 vty_out (vty
, " Opens: %10d %10d%s", p
->open_out
, p
->open_in
, VTY_NEWLINE
);
7479 vty_out (vty
, " Notifications: %10d %10d%s", p
->notify_out
, p
->notify_in
, VTY_NEWLINE
);
7480 vty_out (vty
, " Updates: %10d %10d%s", p
->update_out
, p
->update_in
, VTY_NEWLINE
);
7481 vty_out (vty
, " Keepalives: %10d %10d%s", p
->keepalive_out
, p
->keepalive_in
, VTY_NEWLINE
);
7482 vty_out (vty
, " Route Refresh: %10d %10d%s", p
->refresh_out
, p
->refresh_in
, VTY_NEWLINE
);
7483 vty_out (vty
, " Capability: %10d %10d%s", p
->dynamic_cap_out
, p
->dynamic_cap_in
, VTY_NEWLINE
);
7484 vty_out (vty
, " Total: %10d %10d%s", p
->open_out
+ p
->notify_out
+
7485 p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
+ p
->dynamic_cap_out
,
7486 p
->open_in
+ p
->notify_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
+
7487 p
->dynamic_cap_in
, VTY_NEWLINE
);
7489 /* advertisement-interval */
7490 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
7491 p
->v_routeadv
, VTY_NEWLINE
);
7493 /* Update-source. */
7494 if (p
->update_if
|| p
->update_source
)
7496 vty_out (vty
, " Update source is ");
7498 vty_out (vty
, "%s", p
->update_if
);
7499 else if (p
->update_source
)
7501 sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
7502 vty_out (vty
, "%s", VTY_NEWLINE
);
7505 /* Default weight */
7506 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
7507 vty_out (vty
, " Default weight %d%s", p
->weight
,
7510 vty_out (vty
, "%s", VTY_NEWLINE
);
7512 /* Address Family Information */
7513 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7514 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7515 if (p
->afc
[afi
][safi
])
7516 bgp_show_peer_afi (vty
, p
, afi
, safi
);
7518 vty_out (vty
, " Connections established %d; dropped %d%s",
7519 p
->established
, p
->dropped
,
7523 vty_out (vty
, " Last reset never%s", VTY_NEWLINE
);
7525 vty_out (vty
, " Last reset %s, due to %s%s",
7526 peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
),
7527 peer_down_str
[(int) p
->last_reset
], VTY_NEWLINE
);
7529 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
7531 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
7533 if (p
->t_pmax_restart
)
7534 vty_out (vty
, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
7535 p
->host
, thread_timer_remain_second (p
->t_pmax_restart
),
7538 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
7539 p
->host
, VTY_NEWLINE
);
7543 if (peer_sort (p
) != BGP_PEER_IBGP
&& p
->ttl
> 1)
7544 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
7545 p
->ttl
, VTY_NEWLINE
);
7547 /* Local address. */
7550 vty_out (vty
, "Local host: %s, Local port: %d%s",
7551 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
7552 ntohs (p
->su_local
->sin
.sin_port
),
7556 /* Remote address. */
7559 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
7560 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
7561 ntohs (p
->su_remote
->sin
.sin_port
),
7565 /* Nexthop display. */
7568 vty_out (vty
, "Nexthop: %s%s",
7569 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
7572 vty_out (vty
, "Nexthop global: %s%s",
7573 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
7575 vty_out (vty
, "Nexthop local: %s%s",
7576 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
7578 vty_out (vty
, "BGP connection: %s%s",
7579 p
->shared_network
? "shared network" : "non shared network",
7581 #endif /* HAVE_IPV6 */
7584 /* Timer information. */
7586 vty_out (vty
, "Next start timer due in %ld seconds%s",
7587 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
7589 vty_out (vty
, "Next connect timer due in %ld seconds%s",
7590 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
7592 vty_out (vty
, "Read thread: %s Write thread: %s%s",
7593 p
->t_read
? "on" : "off",
7594 p
->t_write
? "on" : "off",
7597 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
7598 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
7599 bgp_capability_vty_out (vty
, p
);
7601 vty_out (vty
, "%s", VTY_NEWLINE
);
7605 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
,
7606 enum show_type type
, union sockunion
*su
)
7608 struct listnode
*node
, *nnode
;
7612 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
7617 bgp_show_peer (vty
, peer
);
7620 if (sockunion_same (&peer
->su
, su
))
7623 bgp_show_peer (vty
, peer
);
7629 if (type
== show_peer
&& ! find
)
7630 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
7636 bgp_show_neighbor_vty (struct vty
*vty
, const char *name
,
7637 enum show_type type
, const char *ip_str
)
7645 ret
= str2sockunion (ip_str
, &su
);
7648 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
7655 bgp
= bgp_lookup_by_name (name
);
7659 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
7663 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7668 bgp
= bgp_get_default ();
7671 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7676 /* "show ip bgp neighbors" commands. */
7677 DEFUN (show_ip_bgp_neighbors
,
7678 show_ip_bgp_neighbors_cmd
,
7679 "show ip bgp neighbors",
7683 "Detailed information on TCP and BGP neighbor connections\n")
7685 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
);
7688 ALIAS (show_ip_bgp_neighbors
,
7689 show_ip_bgp_ipv4_neighbors_cmd
,
7690 "show ip bgp ipv4 (unicast|multicast) neighbors",
7695 "Address Family modifier\n"
7696 "Address Family modifier\n"
7697 "Detailed information on TCP and BGP neighbor connections\n")
7699 ALIAS (show_ip_bgp_neighbors
,
7700 show_ip_bgp_vpnv4_all_neighbors_cmd
,
7701 "show ip bgp vpnv4 all neighbors",
7705 "Display VPNv4 NLRI specific information\n"
7706 "Display information about all VPNv4 NLRIs\n"
7707 "Detailed information on TCP and BGP neighbor connections\n")
7709 ALIAS (show_ip_bgp_neighbors
,
7710 show_ip_bgp_vpnv4_rd_neighbors_cmd
,
7711 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
7715 "Display VPNv4 NLRI specific information\n"
7716 "Display information for a route distinguisher\n"
7717 "VPN Route Distinguisher\n"
7718 "Detailed information on TCP and BGP neighbor connections\n")
7720 ALIAS (show_ip_bgp_neighbors
,
7721 show_bgp_neighbors_cmd
,
7722 "show bgp neighbors",
7725 "Detailed information on TCP and BGP neighbor connections\n")
7727 ALIAS (show_ip_bgp_neighbors
,
7728 show_bgp_ipv6_neighbors_cmd
,
7729 "show bgp ipv6 neighbors",
7733 "Detailed information on TCP and BGP neighbor connections\n")
7735 DEFUN (show_ip_bgp_neighbors_peer
,
7736 show_ip_bgp_neighbors_peer_cmd
,
7737 "show ip bgp neighbors (A.B.C.D|X:X::X:X)",
7741 "Detailed information on TCP and BGP neighbor connections\n"
7742 "Neighbor to display information about\n"
7743 "Neighbor to display information about\n")
7745 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 1]);
7748 ALIAS (show_ip_bgp_neighbors_peer
,
7749 show_ip_bgp_ipv4_neighbors_peer_cmd
,
7750 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)",
7755 "Address Family modifier\n"
7756 "Address Family modifier\n"
7757 "Detailed information on TCP and BGP neighbor connections\n"
7758 "Neighbor to display information about\n"
7759 "Neighbor to display information about\n")
7761 ALIAS (show_ip_bgp_neighbors_peer
,
7762 show_ip_bgp_vpnv4_all_neighbors_peer_cmd
,
7763 "show ip bgp vpnv4 all neighbors A.B.C.D",
7767 "Display VPNv4 NLRI specific information\n"
7768 "Display information about all VPNv4 NLRIs\n"
7769 "Detailed information on TCP and BGP neighbor connections\n"
7770 "Neighbor to display information about\n")
7772 ALIAS (show_ip_bgp_neighbors_peer
,
7773 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
,
7774 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
7778 "Display VPNv4 NLRI specific information\n"
7779 "Display information about all VPNv4 NLRIs\n"
7780 "Detailed information on TCP and BGP neighbor connections\n"
7781 "Neighbor to display information about\n")
7783 ALIAS (show_ip_bgp_neighbors_peer
,
7784 show_bgp_neighbors_peer_cmd
,
7785 "show bgp neighbors (A.B.C.D|X:X::X:X)",
7788 "Detailed information on TCP and BGP neighbor connections\n"
7789 "Neighbor to display information about\n"
7790 "Neighbor to display information about\n")
7792 ALIAS (show_ip_bgp_neighbors_peer
,
7793 show_bgp_ipv6_neighbors_peer_cmd
,
7794 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)",
7798 "Detailed information on TCP and BGP neighbor connections\n"
7799 "Neighbor to display information about\n"
7800 "Neighbor to display information about\n")
7802 DEFUN (show_ip_bgp_instance_neighbors
,
7803 show_ip_bgp_instance_neighbors_cmd
,
7804 "show ip bgp view WORD neighbors",
7810 "Detailed information on TCP and BGP neighbor connections\n")
7812 return bgp_show_neighbor_vty (vty
, argv
[0], show_all
, NULL
);
7815 ALIAS (show_ip_bgp_instance_neighbors
,
7816 show_bgp_instance_neighbors_cmd
,
7817 "show bgp view WORD neighbors",
7822 "Detailed information on TCP and BGP neighbor connections\n")
7824 ALIAS (show_ip_bgp_instance_neighbors
,
7825 show_bgp_instance_ipv6_neighbors_cmd
,
7826 "show bgp view WORD ipv6 neighbors",
7832 "Detailed information on TCP and BGP neighbor connections\n")
7834 DEFUN (show_ip_bgp_instance_neighbors_peer
,
7835 show_ip_bgp_instance_neighbors_peer_cmd
,
7836 "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7842 "Detailed information on TCP and BGP neighbor connections\n"
7843 "Neighbor to display information about\n"
7844 "Neighbor to display information about\n")
7846 return bgp_show_neighbor_vty (vty
, argv
[0], show_peer
, argv
[1]);
7849 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7850 show_bgp_instance_neighbors_peer_cmd
,
7851 "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7856 "Detailed information on TCP and BGP neighbor connections\n"
7857 "Neighbor to display information about\n"
7858 "Neighbor to display information about\n")
7860 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7861 show_bgp_instance_ipv6_neighbors_peer_cmd
,
7862 "show bgp view WORD ipv6 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 /* Show BGP's AS paths internal data. There are both `show ip bgp
7873 paths' and `show ip mbgp paths'. Those functions results are the
7875 DEFUN (show_ip_bgp_paths
,
7876 show_ip_bgp_paths_cmd
,
7877 "show ip bgp paths",
7881 "Path information\n")
7883 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
7884 aspath_print_all_vty (vty
);
7888 DEFUN (show_ip_bgp_ipv4_paths
,
7889 show_ip_bgp_ipv4_paths_cmd
,
7890 "show ip bgp ipv4 (unicast|multicast) paths",
7895 "Address Family modifier\n"
7896 "Address Family modifier\n"
7897 "Path information\n")
7899 vty_out (vty
, "Address Refcnt Path\r\n");
7900 aspath_print_all_vty (vty
);
7908 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
7910 struct community
*com
;
7912 com
= (struct community
*) backet
->data
;
7913 vty_out (vty
, "[%p] (%ld) %s%s", backet
, com
->refcnt
,
7914 community_str (com
), VTY_NEWLINE
);
7917 /* Show BGP's community internal data. */
7918 DEFUN (show_ip_bgp_community_info
,
7919 show_ip_bgp_community_info_cmd
,
7920 "show ip bgp community-info",
7924 "List all bgp community information\n")
7926 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
7928 hash_iterate (community_hash (),
7929 (void (*) (struct hash_backet
*, void *))
7930 community_show_all_iterator
,
7936 DEFUN (show_ip_bgp_attr_info
,
7937 show_ip_bgp_attr_info_cmd
,
7938 "show ip bgp attribute-info",
7942 "List all bgp attribute information\n")
7944 attr_show_all (vty
);
7949 bgp_write_rsclient_summary (struct vty
*vty
, struct peer
*rsclient
,
7950 afi_t afi
, safi_t safi
)
7952 char timebuf
[BGP_UPTIME_LEN
];
7956 struct listnode
*node
, *nnode
;
7960 if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_GROUP
))
7962 for (ALL_LIST_ELEMENTS (rsclient
->group
->peer
, node
, nnode
, peer
))
7965 bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
7970 len
= vty_out (vty
, "%s", rsclient
->host
);
7974 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
7976 vty_out (vty
, "%*s", len
, " ");
7978 vty_out (vty
, "4 ");
7980 vty_out (vty
, "%11d ", rsclient
->as
);
7982 rmname
= ROUTE_MAP_EXPORT_NAME(&rsclient
->filter
[afi
][safi
]);
7983 if ( rmname
&& strlen (rmname
) > 13 )
7985 sprintf (rmbuf
, "%13s", "...");
7986 rmname
= strncpy (rmbuf
, rmname
, 10);
7990 vty_out (vty
, " %13s ", rmname
);
7992 rmname
= ROUTE_MAP_IMPORT_NAME(&rsclient
->filter
[afi
][safi
]);
7993 if ( rmname
&& strlen (rmname
) > 13 )
7995 sprintf (rmbuf
, "%13s", "...");
7996 rmname
= strncpy (rmbuf
, rmname
, 10);
8000 vty_out (vty
, " %13s ", rmname
);
8002 vty_out (vty
, "%8s", peer_uptime (rsclient
->uptime
, timebuf
, BGP_UPTIME_LEN
));
8004 if (CHECK_FLAG (rsclient
->flags
, PEER_FLAG_SHUTDOWN
))
8005 vty_out (vty
, " Idle (Admin)");
8006 else if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
8007 vty_out (vty
, " Idle (PfxCt)");
8009 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, rsclient
->status
));
8011 vty_out (vty
, "%s", VTY_NEWLINE
);
8017 bgp_show_rsclient_summary (struct vty
*vty
, struct bgp
*bgp
,
8018 afi_t afi
, safi_t safi
)
8021 struct listnode
*node
, *nnode
;
8024 /* Header string for each address family. */
8025 static char header
[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
8027 for (ALL_LIST_ELEMENTS (bgp
->rsclient
, node
, nnode
, peer
))
8029 if (peer
->afc
[afi
][safi
] &&
8030 CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
8035 "Route Server's BGP router identifier %s%s",
8036 inet_ntoa (bgp
->router_id
), VTY_NEWLINE
);
8038 "Route Server's local AS number %d%s", bgp
->as
,
8041 vty_out (vty
, "%s", VTY_NEWLINE
);
8042 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
8045 count
+= bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
8050 vty_out (vty
, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE
,
8051 count
, VTY_NEWLINE
);
8053 vty_out (vty
, "No %s Route Server Client is configured%s",
8054 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
8060 bgp_show_rsclient_summary_vty (struct vty
*vty
, const char *name
,
8061 afi_t afi
, safi_t safi
)
8067 bgp
= bgp_lookup_by_name (name
);
8071 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
8075 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
8079 bgp
= bgp_get_default ();
8082 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
8087 /* 'show bgp rsclient' commands. */
8088 DEFUN (show_ip_bgp_rsclient_summary
,
8089 show_ip_bgp_rsclient_summary_cmd
,
8090 "show ip bgp rsclient summary",
8094 "Information about Route Server Clients\n"
8095 "Summary of all Route Server Clients\n")
8097 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
8100 DEFUN (show_ip_bgp_instance_rsclient_summary
,
8101 show_ip_bgp_instance_rsclient_summary_cmd
,
8102 "show ip bgp view WORD rsclient summary",
8108 "Information about Route Server Clients\n"
8109 "Summary of all Route Server Clients\n")
8111 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
8114 DEFUN (show_ip_bgp_ipv4_rsclient_summary
,
8115 show_ip_bgp_ipv4_rsclient_summary_cmd
,
8116 "show ip bgp ipv4 (unicast|multicast) rsclient summary",
8121 "Address Family modifier\n"
8122 "Address Family modifier\n"
8123 "Information about Route Server Clients\n"
8124 "Summary of all Route Server Clients\n")
8126 if (strncmp (argv
[0], "m", 1) == 0)
8127 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
8129 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
8132 DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary
,
8133 show_ip_bgp_instance_ipv4_rsclient_summary_cmd
,
8134 "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary",
8141 "Address Family modifier\n"
8142 "Address Family modifier\n"
8143 "Information about Route Server Clients\n"
8144 "Summary of all Route Server Clients\n")
8146 if (strncmp (argv
[1], "m", 1) == 0)
8147 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
8149 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
8153 DEFUN (show_bgp_rsclient_summary
,
8154 show_bgp_rsclient_summary_cmd
,
8155 "show bgp rsclient summary",
8158 "Information about Route Server Clients\n"
8159 "Summary of all Route Server Clients\n")
8161 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
8164 DEFUN (show_bgp_instance_rsclient_summary
,
8165 show_bgp_instance_rsclient_summary_cmd
,
8166 "show bgp view WORD rsclient summary",
8171 "Information about Route Server Clients\n"
8172 "Summary of all Route Server Clients\n")
8174 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
8177 ALIAS (show_bgp_rsclient_summary
,
8178 show_bgp_ipv6_rsclient_summary_cmd
,
8179 "show bgp ipv6 rsclient summary",
8183 "Information about Route Server Clients\n"
8184 "Summary of all Route Server Clients\n")
8186 ALIAS (show_bgp_instance_rsclient_summary
,
8187 show_bgp_instance_ipv6_rsclient_summary_cmd
,
8188 "show bgp view WORD ipv6 rsclient summary",
8194 "Information about Route Server Clients\n"
8195 "Summary of all Route Server Clients\n")
8196 #endif /* HAVE IPV6 */
8198 /* Redistribute VTY commands. */
8200 /* Utility function to convert user input route type string to route
8203 bgp_str2route_type (int afi
, const char *str
)
8210 if (strncmp (str
, "k", 1) == 0)
8211 return ZEBRA_ROUTE_KERNEL
;
8212 else if (strncmp (str
, "c", 1) == 0)
8213 return ZEBRA_ROUTE_CONNECT
;
8214 else if (strncmp (str
, "s", 1) == 0)
8215 return ZEBRA_ROUTE_STATIC
;
8216 else if (strncmp (str
, "r", 1) == 0)
8217 return ZEBRA_ROUTE_RIP
;
8218 else if (strncmp (str
, "o", 1) == 0)
8219 return ZEBRA_ROUTE_OSPF
;
8223 if (strncmp (str
, "k", 1) == 0)
8224 return ZEBRA_ROUTE_KERNEL
;
8225 else if (strncmp (str
, "c", 1) == 0)
8226 return ZEBRA_ROUTE_CONNECT
;
8227 else if (strncmp (str
, "s", 1) == 0)
8228 return ZEBRA_ROUTE_STATIC
;
8229 else if (strncmp (str
, "r", 1) == 0)
8230 return ZEBRA_ROUTE_RIPNG
;
8231 else if (strncmp (str
, "o", 1) == 0)
8232 return ZEBRA_ROUTE_OSPF6
;
8237 DEFUN (bgp_redistribute_ipv4
,
8238 bgp_redistribute_ipv4_cmd
,
8239 "redistribute (connected|kernel|ospf|rip|static)",
8240 "Redistribute information from another routing protocol\n"
8243 "Open Shurtest Path First (OSPF)\n"
8244 "Routing Information Protocol (RIP)\n"
8249 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8252 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8255 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8258 DEFUN (bgp_redistribute_ipv4_rmap
,
8259 bgp_redistribute_ipv4_rmap_cmd
,
8260 "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
8261 "Redistribute information from another routing protocol\n"
8264 "Open Shurtest Path First (OSPF)\n"
8265 "Routing Information Protocol (RIP)\n"
8267 "Route map reference\n"
8268 "Pointer to route-map entries\n")
8272 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8275 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8279 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
8280 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8283 DEFUN (bgp_redistribute_ipv4_metric
,
8284 bgp_redistribute_ipv4_metric_cmd
,
8285 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
8286 "Redistribute information from another routing protocol\n"
8289 "Open Shurtest Path First (OSPF)\n"
8290 "Routing Information Protocol (RIP)\n"
8292 "Metric for redistributed routes\n"
8298 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8301 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8304 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8306 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8307 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8310 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
8311 bgp_redistribute_ipv4_rmap_metric_cmd
,
8312 "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
8313 "Redistribute information from another routing protocol\n"
8316 "Open Shurtest Path First (OSPF)\n"
8317 "Routing Information Protocol (RIP)\n"
8319 "Route map reference\n"
8320 "Pointer to route-map entries\n"
8321 "Metric for redistributed routes\n"
8327 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8330 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8333 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8335 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
8336 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8337 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8340 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
8341 bgp_redistribute_ipv4_metric_rmap_cmd
,
8342 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
8343 "Redistribute information from another routing protocol\n"
8346 "Open Shurtest Path First (OSPF)\n"
8347 "Routing Information Protocol (RIP)\n"
8349 "Metric for redistributed routes\n"
8351 "Route map reference\n"
8352 "Pointer to route-map entries\n")
8357 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8360 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8363 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8365 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
8366 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[2]);
8367 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
8370 DEFUN (no_bgp_redistribute_ipv4
,
8371 no_bgp_redistribute_ipv4_cmd
,
8372 "no redistribute (connected|kernel|ospf|rip|static)",
8374 "Redistribute information from another routing protocol\n"
8377 "Open Shurtest Path First (OSPF)\n"
8378 "Routing Information Protocol (RIP)\n"
8383 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8386 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8390 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
);
8393 DEFUN (no_bgp_redistribute_ipv4_rmap
,
8394 no_bgp_redistribute_ipv4_rmap_cmd
,
8395 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
8397 "Redistribute information from another routing protocol\n"
8400 "Open Shurtest Path First (OSPF)\n"
8401 "Routing Information Protocol (RIP)\n"
8403 "Route map reference\n"
8404 "Pointer to route-map entries\n")
8408 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8411 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8415 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8419 DEFUN (no_bgp_redistribute_ipv4_metric
,
8420 no_bgp_redistribute_ipv4_metric_cmd
,
8421 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
8423 "Redistribute information from another routing protocol\n"
8426 "Open Shurtest Path First (OSPF)\n"
8427 "Routing Information Protocol (RIP)\n"
8429 "Metric for redistributed routes\n"
8434 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8437 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8441 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8445 DEFUN (no_bgp_redistribute_ipv4_rmap_metric
,
8446 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
8447 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
8449 "Redistribute information from another routing protocol\n"
8452 "Open Shurtest Path First (OSPF)\n"
8453 "Routing Information Protocol (RIP)\n"
8455 "Route map reference\n"
8456 "Pointer to route-map entries\n"
8457 "Metric for redistributed routes\n"
8462 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8465 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8469 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8470 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8474 ALIAS (no_bgp_redistribute_ipv4_rmap_metric
,
8475 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
8476 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
8478 "Redistribute information from another routing protocol\n"
8481 "Open Shurtest Path First (OSPF)\n"
8482 "Routing Information Protocol (RIP)\n"
8484 "Metric for redistributed routes\n"
8486 "Route map reference\n"
8487 "Pointer to route-map entries\n")
8490 DEFUN (bgp_redistribute_ipv6
,
8491 bgp_redistribute_ipv6_cmd
,
8492 "redistribute (connected|kernel|ospf6|ripng|static)",
8493 "Redistribute information from another routing protocol\n"
8496 "Open Shurtest Path First (OSPFv3)\n"
8497 "Routing Information Protocol (RIPng)\n"
8502 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8505 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8509 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8512 DEFUN (bgp_redistribute_ipv6_rmap
,
8513 bgp_redistribute_ipv6_rmap_cmd
,
8514 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
8515 "Redistribute information from another routing protocol\n"
8518 "Open Shurtest Path First (OSPFv3)\n"
8519 "Routing Information Protocol (RIPng)\n"
8521 "Route map reference\n"
8522 "Pointer to route-map entries\n")
8526 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8529 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8533 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8534 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8537 DEFUN (bgp_redistribute_ipv6_metric
,
8538 bgp_redistribute_ipv6_metric_cmd
,
8539 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
8540 "Redistribute information from another routing protocol\n"
8543 "Open Shurtest Path First (OSPFv3)\n"
8544 "Routing Information Protocol (RIPng)\n"
8546 "Metric for redistributed routes\n"
8552 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8555 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8558 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8560 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8561 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8564 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
8565 bgp_redistribute_ipv6_rmap_metric_cmd
,
8566 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
8567 "Redistribute information from another routing protocol\n"
8570 "Open Shurtest Path First (OSPFv3)\n"
8571 "Routing Information Protocol (RIPng)\n"
8573 "Route map reference\n"
8574 "Pointer to route-map entries\n"
8575 "Metric for redistributed routes\n"
8581 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8584 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8587 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8589 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8590 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8591 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8594 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
8595 bgp_redistribute_ipv6_metric_rmap_cmd
,
8596 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
8597 "Redistribute information from another routing protocol\n"
8600 "Open Shurtest Path First (OSPFv3)\n"
8601 "Routing Information Protocol (RIPng)\n"
8603 "Metric for redistributed routes\n"
8605 "Route map reference\n"
8606 "Pointer to route-map entries\n")
8611 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8614 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8617 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8619 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8620 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[2]);
8621 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8624 DEFUN (no_bgp_redistribute_ipv6
,
8625 no_bgp_redistribute_ipv6_cmd
,
8626 "no redistribute (connected|kernel|ospf6|ripng|static)",
8628 "Redistribute information from another routing protocol\n"
8631 "Open Shurtest Path First (OSPFv3)\n"
8632 "Routing Information Protocol (RIPng)\n"
8637 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8640 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8644 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
);
8647 DEFUN (no_bgp_redistribute_ipv6_rmap
,
8648 no_bgp_redistribute_ipv6_rmap_cmd
,
8649 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
8651 "Redistribute information from another routing protocol\n"
8654 "Open Shurtest Path First (OSPFv3)\n"
8655 "Routing Information Protocol (RIPng)\n"
8657 "Route map reference\n"
8658 "Pointer to route-map entries\n")
8662 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8665 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8669 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8673 DEFUN (no_bgp_redistribute_ipv6_metric
,
8674 no_bgp_redistribute_ipv6_metric_cmd
,
8675 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
8677 "Redistribute information from another routing protocol\n"
8680 "Open Shurtest Path First (OSPFv3)\n"
8681 "Routing Information Protocol (RIPng)\n"
8683 "Metric for redistributed routes\n"
8688 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8691 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8695 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8699 DEFUN (no_bgp_redistribute_ipv6_rmap_metric
,
8700 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
8701 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
8703 "Redistribute information from another routing protocol\n"
8706 "Open Shurtest Path First (OSPFv3)\n"
8707 "Routing Information Protocol (RIPng)\n"
8709 "Route map reference\n"
8710 "Pointer to route-map entries\n"
8711 "Metric for redistributed routes\n"
8716 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8719 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8723 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8724 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8728 ALIAS (no_bgp_redistribute_ipv6_rmap_metric
,
8729 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
8730 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
8732 "Redistribute information from another routing protocol\n"
8735 "Open Shurtest Path First (OSPFv3)\n"
8736 "Routing Information Protocol (RIPng)\n"
8738 "Metric for redistributed routes\n"
8740 "Route map reference\n"
8741 "Pointer to route-map entries\n")
8742 #endif /* HAVE_IPV6 */
8745 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
8746 safi_t safi
, int *write
)
8750 /* Unicast redistribution only. */
8751 if (safi
!= SAFI_UNICAST
)
8754 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
8756 /* Redistribute BGP does not make sense. */
8757 if (bgp
->redist
[afi
][i
] && i
!= ZEBRA_ROUTE_BGP
)
8759 /* Display "address-family" when it is not yet diplayed. */
8760 bgp_config_write_family_header (vty
, afi
, safi
, write
);
8762 /* "redistribute" configuration. */
8763 vty_out (vty
, " redistribute %s", zebra_route_string(i
));
8765 if (bgp
->redist_metric_flag
[afi
][i
])
8766 vty_out (vty
, " metric %d", bgp
->redist_metric
[afi
][i
]);
8768 if (bgp
->rmap
[afi
][i
].name
)
8769 vty_out (vty
, " route-map %s", bgp
->rmap
[afi
][i
].name
);
8771 vty_out (vty
, "%s", VTY_NEWLINE
);
8777 /* BGP node structure. */
8778 struct cmd_node bgp_node
=
8781 "%s(config-router)# ",
8785 struct cmd_node bgp_ipv4_unicast_node
=
8788 "%s(config-router-af)# ",
8792 struct cmd_node bgp_ipv4_multicast_node
=
8795 "%s(config-router-af)# ",
8799 struct cmd_node bgp_ipv6_unicast_node
=
8802 "%s(config-router-af)# ",
8806 struct cmd_node bgp_ipv6_multicast_node
=
8809 "%s(config-router-af)# ",
8813 struct cmd_node bgp_vpnv4_node
=
8816 "%s(config-router-af)# ",
8820 static void community_list_vty (void);
8825 /* Install bgp top node. */
8826 install_node (&bgp_node
, bgp_config_write
);
8827 install_node (&bgp_ipv4_unicast_node
, NULL
);
8828 install_node (&bgp_ipv4_multicast_node
, NULL
);
8829 install_node (&bgp_ipv6_unicast_node
, NULL
);
8830 install_node (&bgp_ipv6_multicast_node
, NULL
);
8831 install_node (&bgp_vpnv4_node
, NULL
);
8833 /* Install default VTY commands to new nodes. */
8834 install_default (BGP_NODE
);
8835 install_default (BGP_IPV4_NODE
);
8836 install_default (BGP_IPV4M_NODE
);
8837 install_default (BGP_IPV6_NODE
);
8838 install_default (BGP_IPV6M_NODE
);
8839 install_default (BGP_VPNV4_NODE
);
8841 /* "bgp multiple-instance" commands. */
8842 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
8843 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
8845 /* "bgp config-type" commands. */
8846 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
8847 install_element (CONFIG_NODE
, &no_bgp_config_type_cmd
);
8849 /* Dummy commands (Currently not supported) */
8850 install_element (BGP_NODE
, &no_synchronization_cmd
);
8851 install_element (BGP_NODE
, &no_auto_summary_cmd
);
8853 /* "router bgp" commands. */
8854 install_element (CONFIG_NODE
, &router_bgp_cmd
);
8855 install_element (CONFIG_NODE
, &router_bgp_view_cmd
);
8857 /* "no router bgp" commands. */
8858 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
8859 install_element (CONFIG_NODE
, &no_router_bgp_view_cmd
);
8861 /* "bgp router-id" commands. */
8862 install_element (BGP_NODE
, &bgp_router_id_cmd
);
8863 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
8864 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
8866 /* "bgp cluster-id" commands. */
8867 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
8868 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
8869 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
8870 install_element (BGP_NODE
, &no_bgp_cluster_id_arg_cmd
);
8872 /* "bgp confederation" commands. */
8873 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
8874 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
8875 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
8877 /* "bgp confederation peers" commands. */
8878 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
8879 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
8881 /* "timers bgp" commands. */
8882 install_element (BGP_NODE
, &bgp_timers_cmd
);
8883 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
8884 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
8886 /* "bgp client-to-client reflection" commands */
8887 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
8888 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
8890 /* "bgp always-compare-med" commands */
8891 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
8892 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
8894 /* "bgp deterministic-med" commands */
8895 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
8896 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
8898 /* "bgp graceful-restart" commands */
8899 install_element (BGP_NODE
, &bgp_graceful_restart_cmd
);
8900 install_element (BGP_NODE
, &no_bgp_graceful_restart_cmd
);
8901 install_element (BGP_NODE
, &bgp_graceful_restart_stalepath_time_cmd
);
8902 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_cmd
);
8903 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_val_cmd
);
8905 /* "bgp fast-external-failover" commands */
8906 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
8907 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
8909 /* "bgp enforce-first-as" commands */
8910 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
8911 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
8913 /* "bgp bestpath compare-routerid" commands */
8914 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
8915 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
8917 /* "bgp bestpath as-path ignore" commands */
8918 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
8919 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
8921 /* "bgp bestpath as-path confed" commands */
8922 install_element (BGP_NODE
, &bgp_bestpath_aspath_confed_cmd
);
8923 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_confed_cmd
);
8925 /* "bgp log-neighbor-changes" commands */
8926 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
8927 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
8929 /* "bgp bestpath med" commands */
8930 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
8931 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
8932 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
8933 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
8934 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
8935 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
8937 /* "no bgp default ipv4-unicast" commands. */
8938 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
8939 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
8941 /* "bgp network import-check" commands. */
8942 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
8943 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
8945 /* "bgp default local-preference" commands. */
8946 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
8947 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
8948 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
8950 /* "neighbor remote-as" commands. */
8951 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
8952 install_element (BGP_NODE
, &no_neighbor_cmd
);
8953 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
8955 /* "neighbor peer-group" commands. */
8956 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
8957 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
8958 install_element (BGP_NODE
, &no_neighbor_peer_group_remote_as_cmd
);
8960 /* "neighbor local-as" commands. */
8961 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
8962 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
8963 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
8964 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
8965 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
8967 /* "neighbor password" commands. */
8968 install_element (BGP_NODE
, &neighbor_password_cmd
);
8969 install_element (BGP_NODE
, &no_neighbor_password_cmd
);
8971 /* "neighbor activate" commands. */
8972 install_element (BGP_NODE
, &neighbor_activate_cmd
);
8973 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
8974 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
8975 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
8976 install_element (BGP_IPV6M_NODE
, &neighbor_activate_cmd
);
8977 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
8979 /* "no neighbor activate" commands. */
8980 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
8981 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
8982 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
8983 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
8984 install_element (BGP_IPV6M_NODE
, &no_neighbor_activate_cmd
);
8985 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
8987 /* "neighbor peer-group set" commands. */
8988 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
8989 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
8990 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
8991 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
8992 install_element (BGP_IPV6M_NODE
, &neighbor_set_peer_group_cmd
);
8993 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
8995 /* "no neighbor peer-group unset" commands. */
8996 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
8997 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
8998 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
8999 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
9000 install_element (BGP_IPV6M_NODE
, &no_neighbor_set_peer_group_cmd
);
9001 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
9003 /* "neighbor softreconfiguration inbound" commands.*/
9004 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
9005 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9006 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
9007 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9008 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
9009 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9010 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
9011 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9012 install_element (BGP_IPV6M_NODE
, &neighbor_soft_reconfiguration_cmd
);
9013 install_element (BGP_IPV6M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9014 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
9015 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
9017 /* "neighbor attribute-unchanged" commands. */
9018 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
9019 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
9020 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
9021 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
9022 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
9023 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
9024 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
9025 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
9026 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
9027 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
9028 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
9029 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
9030 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9031 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9032 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9033 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9034 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9035 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9036 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9037 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9038 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9039 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9040 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
9041 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
9042 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
9043 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
9044 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
9045 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
9046 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
9047 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
9048 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
9049 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
9050 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
9051 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
9052 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9053 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9054 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9055 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9056 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9057 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9058 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9059 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9060 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9061 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9062 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
9063 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
9064 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
9065 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
9066 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
9067 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
9068 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
9069 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
9070 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
9071 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
9072 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
9073 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
9074 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9075 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9076 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9077 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9078 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9079 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9080 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9081 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9082 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9083 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9084 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
9085 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
9086 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
9087 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
9088 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
9089 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
9090 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
9091 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
9092 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
9093 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
9094 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
9095 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
9096 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9097 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9098 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9099 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9100 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9101 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9102 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9103 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9104 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9105 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9106 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged_cmd
);
9107 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged1_cmd
);
9108 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged2_cmd
);
9109 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged3_cmd
);
9110 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged4_cmd
);
9111 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged5_cmd
);
9112 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged6_cmd
);
9113 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged7_cmd
);
9114 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged8_cmd
);
9115 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged9_cmd
);
9116 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged10_cmd
);
9117 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged_cmd
);
9118 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9119 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9120 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9121 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9122 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9123 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9124 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9125 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9126 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9127 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9128 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
9129 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
9130 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
9131 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
9132 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
9133 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
9134 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
9135 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
9136 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
9137 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
9138 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
9139 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
9140 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
9141 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
9142 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
9143 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
9144 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
9145 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
9146 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
9147 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
9148 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
9149 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
9151 /* "nexthop-local unchanged" commands */
9152 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_local_unchanged_cmd
);
9153 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_local_unchanged_cmd
);
9155 /* "transparent-as" and "transparent-nexthop" for old version
9157 install_element (BGP_NODE
, &neighbor_transparent_as_cmd
);
9158 install_element (BGP_NODE
, &neighbor_transparent_nexthop_cmd
);
9160 /* "neighbor next-hop-self" commands. */
9161 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
9162 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
9163 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
9164 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
9165 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
9166 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
9167 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
9168 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
9169 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_cmd
);
9170 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_cmd
);
9171 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
9172 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
9174 /* "neighbor remove-private-AS" commands. */
9175 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
9176 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
9177 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
9178 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
9179 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
9180 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
9181 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
9182 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
9183 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_cmd
);
9184 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_cmd
);
9185 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
9186 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
9188 /* "neighbor send-community" commands.*/
9189 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
9190 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
9191 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
9192 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
9193 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
9194 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
9195 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
9196 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
9197 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
9198 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
9199 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
9200 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
9201 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
9202 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
9203 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
9204 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
9205 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_cmd
);
9206 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_type_cmd
);
9207 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_cmd
);
9208 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_type_cmd
);
9209 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
9210 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
9211 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
9212 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
9214 /* "neighbor route-reflector" commands.*/
9215 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
9216 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
9217 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
9218 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
9219 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
9220 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
9221 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
9222 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
9223 install_element (BGP_IPV6M_NODE
, &neighbor_route_reflector_client_cmd
);
9224 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_reflector_client_cmd
);
9225 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
9226 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
9228 /* "neighbor route-server" commands.*/
9229 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
9230 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
9231 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
9232 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
9233 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
9234 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
9235 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
9236 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
9237 install_element (BGP_IPV6M_NODE
, &neighbor_route_server_client_cmd
);
9238 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_server_client_cmd
);
9239 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
9240 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
9242 /* "neighbor passive" commands. */
9243 install_element (BGP_NODE
, &neighbor_passive_cmd
);
9244 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
9246 /* "neighbor shutdown" commands. */
9247 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
9248 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
9250 /* Deprecated "neighbor capability route-refresh" commands.*/
9251 install_element (BGP_NODE
, &neighbor_capability_route_refresh_cmd
);
9252 install_element (BGP_NODE
, &no_neighbor_capability_route_refresh_cmd
);
9254 /* "neighbor capability orf prefix-list" commands.*/
9255 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
9256 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9257 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
9258 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9259 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
9260 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9261 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
9262 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9263 install_element (BGP_IPV6M_NODE
, &neighbor_capability_orf_prefix_cmd
);
9264 install_element (BGP_IPV6M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
9266 /* "neighbor capability dynamic" commands.*/
9267 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
9268 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
9270 /* "neighbor dont-capability-negotiate" commands. */
9271 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
9272 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
9274 /* "neighbor ebgp-multihop" commands. */
9275 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
9276 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
9277 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
9278 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
9280 /* "neighbor disable-connected-check" commands. */
9281 install_element (BGP_NODE
, &neighbor_disable_connected_check_cmd
);
9282 install_element (BGP_NODE
, &no_neighbor_disable_connected_check_cmd
);
9283 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
9284 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
9286 /* "neighbor description" commands. */
9287 install_element (BGP_NODE
, &neighbor_description_cmd
);
9288 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
9289 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
9291 /* "neighbor update-source" commands. "*/
9292 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
9293 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
9295 /* "neighbor default-originate" commands. */
9296 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
9297 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
9298 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
9299 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9300 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
9301 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
9302 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
9303 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9304 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
9305 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
9306 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
9307 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9308 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
9309 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
9310 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
9311 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9312 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_cmd
);
9313 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_rmap_cmd
);
9314 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_cmd
);
9315 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
9317 /* "neighbor port" commands. */
9318 install_element (BGP_NODE
, &neighbor_port_cmd
);
9319 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
9320 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
9322 /* "neighbor weight" commands. */
9323 install_element (BGP_NODE
, &neighbor_weight_cmd
);
9324 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
9325 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
9327 /* "neighbor override-capability" commands. */
9328 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
9329 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
9331 /* "neighbor strict-capability-match" commands. */
9332 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
9333 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
9335 /* "neighbor timers" commands. */
9336 install_element (BGP_NODE
, &neighbor_timers_cmd
);
9337 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
9339 /* "neighbor timers connect" commands. */
9340 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
9341 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
9342 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
9344 /* "neighbor advertisement-interval" commands. */
9345 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
9346 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
9347 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
9349 /* "neighbor version" commands. */
9350 install_element (BGP_NODE
, &neighbor_version_cmd
);
9352 /* "neighbor interface" commands. */
9353 install_element (BGP_NODE
, &neighbor_interface_cmd
);
9354 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
9356 /* "neighbor distribute" commands. */
9357 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
9358 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
9359 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
9360 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
9361 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
9362 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
9363 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
9364 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
9365 install_element (BGP_IPV6M_NODE
, &neighbor_distribute_list_cmd
);
9366 install_element (BGP_IPV6M_NODE
, &no_neighbor_distribute_list_cmd
);
9367 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
9368 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
9370 /* "neighbor prefix-list" commands. */
9371 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
9372 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
9373 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
9374 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
9375 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
9376 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
9377 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
9378 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
9379 install_element (BGP_IPV6M_NODE
, &neighbor_prefix_list_cmd
);
9380 install_element (BGP_IPV6M_NODE
, &no_neighbor_prefix_list_cmd
);
9381 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
9382 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
9384 /* "neighbor filter-list" commands. */
9385 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
9386 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
9387 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
9388 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
9389 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
9390 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
9391 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
9392 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
9393 install_element (BGP_IPV6M_NODE
, &neighbor_filter_list_cmd
);
9394 install_element (BGP_IPV6M_NODE
, &no_neighbor_filter_list_cmd
);
9395 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
9396 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
9398 /* "neighbor route-map" commands. */
9399 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
9400 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
9401 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
9402 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
9403 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
9404 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
9405 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
9406 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
9407 install_element (BGP_IPV6M_NODE
, &neighbor_route_map_cmd
);
9408 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_map_cmd
);
9409 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
9410 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
9412 /* "neighbor unsuppress-map" commands. */
9413 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
9414 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
9415 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
9416 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
9417 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
9418 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
9419 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
9420 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
9421 install_element (BGP_IPV6M_NODE
, &neighbor_unsuppress_map_cmd
);
9422 install_element (BGP_IPV6M_NODE
, &no_neighbor_unsuppress_map_cmd
);
9423 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
9424 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
9426 /* "neighbor maximum-prefix" commands. */
9427 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
9428 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9429 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9430 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9431 install_element (BGP_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9432 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9433 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
9434 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9435 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9436 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9437 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9438 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9439 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9440 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
9441 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9442 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9443 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9444 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9445 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9446 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
9447 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9448 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9449 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9450 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9451 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9452 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9453 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
9454 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9455 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9456 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9457 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9458 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9459 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
9460 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9461 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9462 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9463 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9464 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9465 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9466 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
9467 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9468 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9469 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9470 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9471 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9472 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
9473 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9474 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9475 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9476 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9477 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9478 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9479 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_cmd
);
9480 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9481 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9482 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9483 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9484 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9485 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_cmd
);
9486 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9487 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9488 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9489 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9490 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9491 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9492 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
9493 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
9494 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
9495 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
9496 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
9497 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
9498 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
9499 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
9500 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
9501 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
9502 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
9503 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
9504 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
9506 /* "neighbor allowas-in" */
9507 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
9508 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
9509 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
9510 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
9511 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
9512 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
9513 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
9514 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
9515 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
9516 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
9517 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
9518 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
9519 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_cmd
);
9520 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_arg_cmd
);
9521 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_cmd
);
9522 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
9523 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
9524 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
9526 /* address-family commands. */
9527 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
9528 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
9530 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
9531 install_element (BGP_NODE
, &address_family_ipv6_safi_cmd
);
9532 #endif /* HAVE_IPV6 */
9533 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
9534 install_element (BGP_NODE
, &address_family_vpnv4_unicast_cmd
);
9536 /* "exit-address-family" command. */
9537 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
9538 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
9539 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
9540 install_element (BGP_IPV6M_NODE
, &exit_address_family_cmd
);
9541 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
9543 /* "clear ip bgp commands" */
9544 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
9545 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
9546 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
9547 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
9548 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
9549 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
9551 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
9552 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
9553 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
9554 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
9555 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
9556 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
9557 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
9558 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
9559 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
9560 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
9561 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
9562 #endif /* HAVE_IPV6 */
9564 /* "clear ip bgp neighbor soft in" */
9565 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
9566 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
9567 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
9568 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
9569 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_prefix_filter_cmd
);
9570 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
9571 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
9572 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
9573 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
9574 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
9575 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
9576 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
9577 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
9578 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
9579 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
9580 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
9581 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
9582 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
9583 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
9584 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
9585 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
9586 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
);
9587 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
9588 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
9589 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
9590 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
9591 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
9592 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
9593 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
9594 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
9595 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
9596 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
9597 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
9598 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
9599 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_in_cmd
);
9600 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_in_cmd
);
9601 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_in_cmd
);
9602 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_in_cmd
);
9603 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_in_cmd
);
9604 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_in_cmd
);
9606 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
9607 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
9608 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
9609 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
9610 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
9611 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
9612 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
9613 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
9614 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
9615 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
9616 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
9617 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
9618 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
9619 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
9620 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
9621 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
9622 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
9623 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
9624 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
9625 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
9626 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
9627 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
9628 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
9629 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
9630 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
9631 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
9632 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
9633 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
9634 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
9635 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
9636 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
9637 #endif /* HAVE_IPV6 */
9639 /* "clear ip bgp neighbor soft out" */
9640 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
9641 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
9642 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
9643 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
9644 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
9645 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
9646 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
9647 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
9648 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
9649 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
9650 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
9651 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
9652 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
9653 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
9654 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
9655 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
9656 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
9657 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
9658 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
9659 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
9660 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
9661 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
9662 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_out_cmd
);
9663 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_out_cmd
);
9664 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_out_cmd
);
9665 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_out_cmd
);
9666 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_out_cmd
);
9667 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_out_cmd
);
9669 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
9670 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
9671 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
9672 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
9673 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
9674 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
9675 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
9676 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
9677 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
9678 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
9679 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
9680 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
9681 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
9682 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
9683 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
9684 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
9685 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
9686 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
9687 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
9688 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
9689 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
9690 #endif /* HAVE_IPV6 */
9692 /* "clear ip bgp neighbor soft" */
9693 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
9694 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
9695 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
9696 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
9697 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
9698 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
9699 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
9700 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
9701 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
9702 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
9703 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
9704 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
9705 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_cmd
);
9706 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_cmd
);
9707 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_cmd
);
9709 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
9710 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
9711 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
9712 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
9713 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
9714 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
9715 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
9716 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
9717 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
9718 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
9719 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
9720 #endif /* HAVE_IPV6 */
9722 /* "clear ip bgp neighbor rsclient" */
9723 install_element (ENABLE_NODE
, &clear_ip_bgp_all_rsclient_cmd
);
9724 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_rsclient_cmd
);
9725 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_rsclient_cmd
);
9726 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_rsclient_cmd
);
9728 install_element (ENABLE_NODE
, &clear_bgp_all_rsclient_cmd
);
9729 install_element (ENABLE_NODE
, &clear_bgp_instance_all_rsclient_cmd
);
9730 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_rsclient_cmd
);
9731 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_all_rsclient_cmd
);
9732 install_element (ENABLE_NODE
, &clear_bgp_peer_rsclient_cmd
);
9733 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_rsclient_cmd
);
9734 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_rsclient_cmd
);
9735 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_peer_rsclient_cmd
);
9736 #endif /* HAVE_IPV6 */
9738 /* "show ip bgp summary" commands. */
9739 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
9740 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
9741 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9742 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9743 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9744 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9746 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
9747 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
9748 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
9749 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9750 #endif /* HAVE_IPV6 */
9751 install_element (RESTRICTED_NODE
, &show_ip_bgp_summary_cmd
);
9752 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_summary_cmd
);
9753 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9754 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9755 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9756 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9758 install_element (RESTRICTED_NODE
, &show_bgp_summary_cmd
);
9759 install_element (RESTRICTED_NODE
, &show_bgp_instance_summary_cmd
);
9760 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_summary_cmd
);
9761 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9762 #endif /* HAVE_IPV6 */
9763 install_element (ENABLE_NODE
, &show_ip_bgp_summary_cmd
);
9764 install_element (ENABLE_NODE
, &show_ip_bgp_instance_summary_cmd
);
9765 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9766 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9767 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9768 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9770 install_element (ENABLE_NODE
, &show_bgp_summary_cmd
);
9771 install_element (ENABLE_NODE
, &show_bgp_instance_summary_cmd
);
9772 install_element (ENABLE_NODE
, &show_bgp_ipv6_summary_cmd
);
9773 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9774 #endif /* HAVE_IPV6 */
9776 /* "show ip bgp neighbors" commands. */
9777 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
9778 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
9779 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9780 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9781 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
9782 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
9783 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9784 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9785 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
9786 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9787 install_element (RESTRICTED_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9788 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9789 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9790 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9791 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9792 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_cmd
);
9793 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
9794 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9795 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9796 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
9797 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
9798 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9799 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9800 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
9801 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9804 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
9805 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
9806 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
9807 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9808 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
9809 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
9810 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9811 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9812 install_element (RESTRICTED_NODE
, &show_bgp_neighbors_peer_cmd
);
9813 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9814 install_element (RESTRICTED_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9815 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9816 install_element (ENABLE_NODE
, &show_bgp_neighbors_cmd
);
9817 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_cmd
);
9818 install_element (ENABLE_NODE
, &show_bgp_neighbors_peer_cmd
);
9819 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9820 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_cmd
);
9821 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
9822 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9823 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9826 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
9827 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
9828 install_element (ENABLE_NODE
, &show_ipv6_bgp_summary_cmd
);
9829 install_element (ENABLE_NODE
, &show_ipv6_mbgp_summary_cmd
);
9830 #endif /* HAVE_IPV6 */
9832 /* "show ip bgp rsclient" commands. */
9833 install_element (VIEW_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9834 install_element (VIEW_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9835 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9836 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9837 install_element (RESTRICTED_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9838 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9839 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9840 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9841 install_element (ENABLE_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9842 install_element (ENABLE_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9843 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9844 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9847 install_element (VIEW_NODE
, &show_bgp_rsclient_summary_cmd
);
9848 install_element (VIEW_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9849 install_element (VIEW_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9850 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9851 install_element (RESTRICTED_NODE
, &show_bgp_rsclient_summary_cmd
);
9852 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9853 install_element (RESTRICTED_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9854 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9855 install_element (ENABLE_NODE
, &show_bgp_rsclient_summary_cmd
);
9856 install_element (ENABLE_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9857 install_element (ENABLE_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9858 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9859 #endif /* HAVE_IPV6 */
9861 /* "show ip bgp paths" commands. */
9862 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
9863 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
9864 install_element (ENABLE_NODE
, &show_ip_bgp_paths_cmd
);
9865 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
9867 /* "show ip bgp community" commands. */
9868 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
9869 install_element (ENABLE_NODE
, &show_ip_bgp_community_info_cmd
);
9871 /* "show ip bgp attribute-info" commands. */
9872 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
9873 install_element (ENABLE_NODE
, &show_ip_bgp_attr_info_cmd
);
9875 /* "redistribute" commands. */
9876 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
9877 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
9878 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
9879 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
9880 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
9881 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
9882 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
9883 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
9884 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
9885 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
9887 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
9888 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
9889 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
9890 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
9891 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
9892 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
9893 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
9894 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
9895 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
9896 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
9897 #endif /* HAVE_IPV6 */
9899 /* "show bgp memory" commands. */
9900 install_element (VIEW_NODE
, &show_bgp_memory_cmd
);
9901 install_element (RESTRICTED_NODE
, &show_bgp_memory_cmd
);
9902 install_element (ENABLE_NODE
, &show_bgp_memory_cmd
);
9904 /* "show bgp views" commands. */
9905 install_element (VIEW_NODE
, &show_bgp_views_cmd
);
9906 install_element (RESTRICTED_NODE
, &show_bgp_views_cmd
);
9907 install_element (ENABLE_NODE
, &show_bgp_views_cmd
);
9909 /* Community-list. */
9910 community_list_vty ();
9914 #include "bgp_regex.h"
9915 #include "bgp_clist.h"
9916 #include "bgp_ecommunity.h"
9918 /* VTY functions. */
9920 /* Direction value to string conversion. */
9922 community_direct_str (int direct
)
9926 case COMMUNITY_DENY
:
9928 case COMMUNITY_PERMIT
:
9935 /* Display error string. */
9937 community_list_perror (struct vty
*vty
, int ret
)
9941 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
9942 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
9944 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
9945 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
9947 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
9948 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
9950 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
9951 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
9956 /* VTY interface for community_set() function. */
9958 community_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
9959 int style
, int reject_all_digit_name
)
9965 /* Check the list type. */
9966 if (strncmp (argv
[1], "p", 1) == 0)
9967 direct
= COMMUNITY_PERMIT
;
9968 else if (strncmp (argv
[1], "d", 1) == 0)
9969 direct
= COMMUNITY_DENY
;
9972 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9977 /* All digit name check. */
9978 if (reject_all_digit_name
&& all_digit (argv
[0]))
9980 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
9984 /* Concat community string argument. */
9986 str
= argv_concat (argv
, argc
, 2);
9990 /* When community_list_set() return nevetive value, it means
9991 malformed community string. */
9992 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
9994 /* Free temporary community list string allocated by
9997 XFREE (MTYPE_TMP
, str
);
10001 /* Display error string. */
10002 community_list_perror (vty
, ret
);
10003 return CMD_WARNING
;
10006 return CMD_SUCCESS
;
10009 /* Communiyt-list entry delete. */
10011 community_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
10020 /* Check the list direct. */
10021 if (strncmp (argv
[1], "p", 1) == 0)
10022 direct
= COMMUNITY_PERMIT
;
10023 else if (strncmp (argv
[1], "d", 1) == 0)
10024 direct
= COMMUNITY_DENY
;
10027 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10029 return CMD_WARNING
;
10032 /* Concat community string argument. */
10033 str
= argv_concat (argv
, argc
, 2);
10036 /* Unset community list. */
10037 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
10039 /* Free temporary community list string allocated by
10042 XFREE (MTYPE_TMP
, str
);
10046 community_list_perror (vty
, ret
);
10047 return CMD_WARNING
;
10050 return CMD_SUCCESS
;
10053 /* "community-list" keyword help string. */
10054 #define COMMUNITY_LIST_STR "Add a community list entry\n"
10055 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
10057 DEFUN (ip_community_list_standard
,
10058 ip_community_list_standard_cmd
,
10059 "ip community-list <1-99> (deny|permit) .AA:NN",
10062 "Community list number (standard)\n"
10063 "Specify community to reject\n"
10064 "Specify community to accept\n"
10067 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
10070 ALIAS (ip_community_list_standard
,
10071 ip_community_list_standard2_cmd
,
10072 "ip community-list <1-99> (deny|permit)",
10075 "Community list number (standard)\n"
10076 "Specify community to reject\n"
10077 "Specify community to accept\n")
10079 DEFUN (ip_community_list_expanded
,
10080 ip_community_list_expanded_cmd
,
10081 "ip community-list <100-500> (deny|permit) .LINE",
10084 "Community list number (expanded)\n"
10085 "Specify community to reject\n"
10086 "Specify community to accept\n"
10087 "An ordered list as a regular-expression\n")
10089 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
10092 DEFUN (ip_community_list_name_standard
,
10093 ip_community_list_name_standard_cmd
,
10094 "ip community-list standard WORD (deny|permit) .AA:NN",
10097 "Add a standard community-list entry\n"
10098 "Community list name\n"
10099 "Specify community to reject\n"
10100 "Specify community to accept\n"
10103 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
10106 ALIAS (ip_community_list_name_standard
,
10107 ip_community_list_name_standard2_cmd
,
10108 "ip community-list standard WORD (deny|permit)",
10111 "Add a standard community-list entry\n"
10112 "Community list name\n"
10113 "Specify community to reject\n"
10114 "Specify community to accept\n")
10116 DEFUN (ip_community_list_name_expanded
,
10117 ip_community_list_name_expanded_cmd
,
10118 "ip community-list expanded WORD (deny|permit) .LINE",
10121 "Add an expanded community-list entry\n"
10122 "Community list name\n"
10123 "Specify community to reject\n"
10124 "Specify community to accept\n"
10125 "An ordered list as a regular-expression\n")
10127 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
10130 DEFUN (no_ip_community_list_standard_all
,
10131 no_ip_community_list_standard_all_cmd
,
10132 "no ip community-list <1-99>",
10136 "Community list number (standard)\n")
10138 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10141 DEFUN (no_ip_community_list_expanded_all
,
10142 no_ip_community_list_expanded_all_cmd
,
10143 "no ip community-list <100-500>",
10147 "Community list number (expanded)\n")
10149 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10152 DEFUN (no_ip_community_list_name_standard_all
,
10153 no_ip_community_list_name_standard_all_cmd
,
10154 "no ip community-list standard WORD",
10158 "Add a standard community-list entry\n"
10159 "Community list name\n")
10161 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10164 DEFUN (no_ip_community_list_name_expanded_all
,
10165 no_ip_community_list_name_expanded_all_cmd
,
10166 "no ip community-list expanded WORD",
10170 "Add an expanded community-list entry\n"
10171 "Community list name\n")
10173 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10176 DEFUN (no_ip_community_list_standard
,
10177 no_ip_community_list_standard_cmd
,
10178 "no ip community-list <1-99> (deny|permit) .AA:NN",
10182 "Community list number (standard)\n"
10183 "Specify community to reject\n"
10184 "Specify community to accept\n"
10187 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10190 DEFUN (no_ip_community_list_expanded
,
10191 no_ip_community_list_expanded_cmd
,
10192 "no ip community-list <100-500> (deny|permit) .LINE",
10196 "Community list number (expanded)\n"
10197 "Specify community to reject\n"
10198 "Specify community to accept\n"
10199 "An ordered list as a regular-expression\n")
10201 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10204 DEFUN (no_ip_community_list_name_standard
,
10205 no_ip_community_list_name_standard_cmd
,
10206 "no ip community-list standard WORD (deny|permit) .AA:NN",
10210 "Specify a standard community-list\n"
10211 "Community list name\n"
10212 "Specify community to reject\n"
10213 "Specify community to accept\n"
10216 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
10219 DEFUN (no_ip_community_list_name_expanded
,
10220 no_ip_community_list_name_expanded_cmd
,
10221 "no ip community-list expanded WORD (deny|permit) .LINE",
10225 "Specify an expanded community-list\n"
10226 "Community list name\n"
10227 "Specify community to reject\n"
10228 "Specify community to accept\n"
10229 "An ordered list as a regular-expression\n")
10231 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
10235 community_list_show (struct vty
*vty
, struct community_list
*list
)
10237 struct community_entry
*entry
;
10239 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10241 if (entry
== list
->head
)
10243 if (all_digit (list
->name
))
10244 vty_out (vty
, "Community %s list %s%s",
10245 entry
->style
== COMMUNITY_LIST_STANDARD
?
10246 "standard" : "(expanded) access",
10247 list
->name
, VTY_NEWLINE
);
10249 vty_out (vty
, "Named Community %s list %s%s",
10250 entry
->style
== COMMUNITY_LIST_STANDARD
?
10251 "standard" : "expanded",
10252 list
->name
, VTY_NEWLINE
);
10255 vty_out (vty
, " %s%s",
10256 community_direct_str (entry
->direct
), VTY_NEWLINE
);
10258 vty_out (vty
, " %s %s%s",
10259 community_direct_str (entry
->direct
),
10260 entry
->style
== COMMUNITY_LIST_STANDARD
10261 ? community_str (entry
->u
.com
) : entry
->config
,
10266 DEFUN (show_ip_community_list
,
10267 show_ip_community_list_cmd
,
10268 "show ip community-list",
10271 "List community-list\n")
10273 struct community_list
*list
;
10274 struct community_list_master
*cm
;
10276 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
10278 return CMD_SUCCESS
;
10280 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10281 community_list_show (vty
, list
);
10283 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10284 community_list_show (vty
, list
);
10286 return CMD_SUCCESS
;
10289 DEFUN (show_ip_community_list_arg
,
10290 show_ip_community_list_arg_cmd
,
10291 "show ip community-list (<1-500>|WORD)",
10294 "List community-list\n"
10295 "Community-list number\n"
10296 "Community-list name\n")
10298 struct community_list
*list
;
10300 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_MASTER
);
10303 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
10304 return CMD_WARNING
;
10307 community_list_show (vty
, list
);
10309 return CMD_SUCCESS
;
10313 extcommunity_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
10314 int style
, int reject_all_digit_name
)
10320 /* Check the list type. */
10321 if (strncmp (argv
[1], "p", 1) == 0)
10322 direct
= COMMUNITY_PERMIT
;
10323 else if (strncmp (argv
[1], "d", 1) == 0)
10324 direct
= COMMUNITY_DENY
;
10327 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10329 return CMD_WARNING
;
10332 /* All digit name check. */
10333 if (reject_all_digit_name
&& all_digit (argv
[0]))
10335 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
10336 return CMD_WARNING
;
10339 /* Concat community string argument. */
10341 str
= argv_concat (argv
, argc
, 2);
10345 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
10347 /* Free temporary community list string allocated by
10350 XFREE (MTYPE_TMP
, str
);
10354 community_list_perror (vty
, ret
);
10355 return CMD_WARNING
;
10357 return CMD_SUCCESS
;
10361 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
10370 /* Check the list direct. */
10371 if (strncmp (argv
[1], "p", 1) == 0)
10372 direct
= COMMUNITY_PERMIT
;
10373 else if (strncmp (argv
[1], "d", 1) == 0)
10374 direct
= COMMUNITY_DENY
;
10377 vty_out (vty
, "%% Matching condition must be permit or deny%s",
10379 return CMD_WARNING
;
10382 /* Concat community string argument. */
10383 str
= argv_concat (argv
, argc
, 2);
10386 /* Unset community list. */
10387 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
10389 /* Free temporary community list string allocated by
10392 XFREE (MTYPE_TMP
, str
);
10396 community_list_perror (vty
, ret
);
10397 return CMD_WARNING
;
10400 return CMD_SUCCESS
;
10403 /* "extcommunity-list" keyword help string. */
10404 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
10405 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
10407 DEFUN (ip_extcommunity_list_standard
,
10408 ip_extcommunity_list_standard_cmd
,
10409 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
10411 EXTCOMMUNITY_LIST_STR
10412 "Extended Community list number (standard)\n"
10413 "Specify community to reject\n"
10414 "Specify community to accept\n"
10415 EXTCOMMUNITY_VAL_STR
)
10417 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
10420 ALIAS (ip_extcommunity_list_standard
,
10421 ip_extcommunity_list_standard2_cmd
,
10422 "ip extcommunity-list <1-99> (deny|permit)",
10424 EXTCOMMUNITY_LIST_STR
10425 "Extended Community list number (standard)\n"
10426 "Specify community to reject\n"
10427 "Specify community to accept\n")
10429 DEFUN (ip_extcommunity_list_expanded
,
10430 ip_extcommunity_list_expanded_cmd
,
10431 "ip extcommunity-list <100-500> (deny|permit) .LINE",
10433 EXTCOMMUNITY_LIST_STR
10434 "Extended Community list number (expanded)\n"
10435 "Specify community to reject\n"
10436 "Specify community to accept\n"
10437 "An ordered list as a regular-expression\n")
10439 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
10442 DEFUN (ip_extcommunity_list_name_standard
,
10443 ip_extcommunity_list_name_standard_cmd
,
10444 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
10446 EXTCOMMUNITY_LIST_STR
10447 "Specify standard extcommunity-list\n"
10448 "Extended Community list name\n"
10449 "Specify community to reject\n"
10450 "Specify community to accept\n"
10451 EXTCOMMUNITY_VAL_STR
)
10453 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
10456 ALIAS (ip_extcommunity_list_name_standard
,
10457 ip_extcommunity_list_name_standard2_cmd
,
10458 "ip extcommunity-list standard WORD (deny|permit)",
10460 EXTCOMMUNITY_LIST_STR
10461 "Specify standard extcommunity-list\n"
10462 "Extended Community list name\n"
10463 "Specify community to reject\n"
10464 "Specify community to accept\n")
10466 DEFUN (ip_extcommunity_list_name_expanded
,
10467 ip_extcommunity_list_name_expanded_cmd
,
10468 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
10470 EXTCOMMUNITY_LIST_STR
10471 "Specify expanded extcommunity-list\n"
10472 "Extended Community list name\n"
10473 "Specify community to reject\n"
10474 "Specify community to accept\n"
10475 "An ordered list as a regular-expression\n")
10477 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
10480 DEFUN (no_ip_extcommunity_list_standard_all
,
10481 no_ip_extcommunity_list_standard_all_cmd
,
10482 "no ip extcommunity-list <1-99>",
10485 EXTCOMMUNITY_LIST_STR
10486 "Extended Community list number (standard)\n")
10488 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10491 DEFUN (no_ip_extcommunity_list_expanded_all
,
10492 no_ip_extcommunity_list_expanded_all_cmd
,
10493 "no ip extcommunity-list <100-500>",
10496 EXTCOMMUNITY_LIST_STR
10497 "Extended Community list number (expanded)\n")
10499 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10502 DEFUN (no_ip_extcommunity_list_name_standard_all
,
10503 no_ip_extcommunity_list_name_standard_all_cmd
,
10504 "no ip extcommunity-list standard WORD",
10507 EXTCOMMUNITY_LIST_STR
10508 "Specify standard extcommunity-list\n"
10509 "Extended Community list name\n")
10511 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10514 DEFUN (no_ip_extcommunity_list_name_expanded_all
,
10515 no_ip_extcommunity_list_name_expanded_all_cmd
,
10516 "no ip extcommunity-list expanded WORD",
10519 EXTCOMMUNITY_LIST_STR
10520 "Specify expanded extcommunity-list\n"
10521 "Extended Community list name\n")
10523 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10526 DEFUN (no_ip_extcommunity_list_standard
,
10527 no_ip_extcommunity_list_standard_cmd
,
10528 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
10531 EXTCOMMUNITY_LIST_STR
10532 "Extended Community list number (standard)\n"
10533 "Specify community to reject\n"
10534 "Specify community to accept\n"
10535 EXTCOMMUNITY_VAL_STR
)
10537 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10540 DEFUN (no_ip_extcommunity_list_expanded
,
10541 no_ip_extcommunity_list_expanded_cmd
,
10542 "no ip extcommunity-list <100-500> (deny|permit) .LINE",
10545 EXTCOMMUNITY_LIST_STR
10546 "Extended Community list number (expanded)\n"
10547 "Specify community to reject\n"
10548 "Specify community to accept\n"
10549 "An ordered list as a regular-expression\n")
10551 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10554 DEFUN (no_ip_extcommunity_list_name_standard
,
10555 no_ip_extcommunity_list_name_standard_cmd
,
10556 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
10559 EXTCOMMUNITY_LIST_STR
10560 "Specify standard extcommunity-list\n"
10561 "Extended Community list name\n"
10562 "Specify community to reject\n"
10563 "Specify community to accept\n"
10564 EXTCOMMUNITY_VAL_STR
)
10566 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
10569 DEFUN (no_ip_extcommunity_list_name_expanded
,
10570 no_ip_extcommunity_list_name_expanded_cmd
,
10571 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
10574 EXTCOMMUNITY_LIST_STR
10575 "Specify expanded extcommunity-list\n"
10576 "Community list name\n"
10577 "Specify community to reject\n"
10578 "Specify community to accept\n"
10579 "An ordered list as a regular-expression\n")
10581 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10585 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
10587 struct community_entry
*entry
;
10589 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10591 if (entry
== list
->head
)
10593 if (all_digit (list
->name
))
10594 vty_out (vty
, "Extended community %s list %s%s",
10595 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10596 "standard" : "(expanded) access",
10597 list
->name
, VTY_NEWLINE
);
10599 vty_out (vty
, "Named extended community %s list %s%s",
10600 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10601 "standard" : "expanded",
10602 list
->name
, VTY_NEWLINE
);
10605 vty_out (vty
, " %s%s",
10606 community_direct_str (entry
->direct
), VTY_NEWLINE
);
10608 vty_out (vty
, " %s %s%s",
10609 community_direct_str (entry
->direct
),
10610 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10611 entry
->u
.ecom
->str
: entry
->config
,
10616 DEFUN (show_ip_extcommunity_list
,
10617 show_ip_extcommunity_list_cmd
,
10618 "show ip extcommunity-list",
10621 "List extended-community list\n")
10623 struct community_list
*list
;
10624 struct community_list_master
*cm
;
10626 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
10628 return CMD_SUCCESS
;
10630 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10631 extcommunity_list_show (vty
, list
);
10633 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10634 extcommunity_list_show (vty
, list
);
10636 return CMD_SUCCESS
;
10639 DEFUN (show_ip_extcommunity_list_arg
,
10640 show_ip_extcommunity_list_arg_cmd
,
10641 "show ip extcommunity-list (<1-500>|WORD)",
10644 "List extended-community list\n"
10645 "Extcommunity-list number\n"
10646 "Extcommunity-list name\n")
10648 struct community_list
*list
;
10650 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_MASTER
);
10653 vty_out (vty
, "%% Can't find extcommunit-list%s", VTY_NEWLINE
);
10654 return CMD_WARNING
;
10657 extcommunity_list_show (vty
, list
);
10659 return CMD_SUCCESS
;
10662 /* Return configuration string of community-list entry. */
10663 static const char *
10664 community_list_config_str (struct community_entry
*entry
)
10672 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
10673 str
= community_str (entry
->u
.com
);
10675 str
= entry
->config
;
10680 /* Display community-list and extcommunity-list configuration. */
10682 community_list_config_write (struct vty
*vty
)
10684 struct community_list
*list
;
10685 struct community_entry
*entry
;
10686 struct community_list_master
*cm
;
10689 /* Community-list. */
10690 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
10692 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10693 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10695 vty_out (vty
, "ip community-list %s %s %s%s",
10696 list
->name
, community_direct_str (entry
->direct
),
10697 community_list_config_str (entry
),
10701 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10702 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10704 vty_out (vty
, "ip community-list %s %s %s %s%s",
10705 entry
->style
== COMMUNITY_LIST_STANDARD
10706 ? "standard" : "expanded",
10707 list
->name
, community_direct_str (entry
->direct
),
10708 community_list_config_str (entry
),
10713 /* Extcommunity-list. */
10714 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
10716 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10717 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10719 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
10720 list
->name
, community_direct_str (entry
->direct
),
10721 community_list_config_str (entry
), VTY_NEWLINE
);
10724 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10725 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10727 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
10728 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
10729 ? "standard" : "expanded",
10730 list
->name
, community_direct_str (entry
->direct
),
10731 community_list_config_str (entry
), VTY_NEWLINE
);
10737 struct cmd_node community_list_node
=
10739 COMMUNITY_LIST_NODE
,
10741 1 /* Export to vtysh. */
10745 community_list_vty (void)
10747 install_node (&community_list_node
, community_list_config_write
);
10749 /* Community-list. */
10750 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
10751 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
10752 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
10753 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
10754 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
10755 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
10756 install_element (CONFIG_NODE
, &no_ip_community_list_standard_all_cmd
);
10757 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_all_cmd
);
10758 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_all_cmd
);
10759 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_all_cmd
);
10760 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
10761 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
10762 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
10763 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
10764 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
10765 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
10766 install_element (ENABLE_NODE
, &show_ip_community_list_cmd
);
10767 install_element (ENABLE_NODE
, &show_ip_community_list_arg_cmd
);
10769 /* Extcommunity-list. */
10770 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
10771 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
10772 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
10773 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
10774 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
10775 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
10776 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_all_cmd
);
10777 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_all_cmd
);
10778 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_all_cmd
);
10779 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_all_cmd
);
10780 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
10781 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
10782 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
10783 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
10784 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
10785 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);
10786 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_cmd
);
10787 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_arg_cmd
);