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
35 #include "bgpd/bgpd.h"
36 #include "bgpd/bgp_advertise.h"
37 #include "bgpd/bgp_attr.h"
38 #include "bgpd/bgp_aspath.h"
39 #include "bgpd/bgp_community.h"
40 #include "bgpd/bgp_ecommunity.h"
41 #include "bgpd/bgp_damp.h"
42 #include "bgpd/bgp_debug.h"
43 #include "bgpd/bgp_fsm.h"
44 #include "bgpd/bgp_mplsvpn.h"
45 #include "bgpd/bgp_nexthop.h"
46 #include "bgpd/bgp_open.h"
47 #include "bgpd/bgp_regex.h"
48 #include "bgpd/bgp_route.h"
49 #include "bgpd/bgp_zebra.h"
50 #include "bgpd/bgp_table.h"
51 #include "bgpd/bgp_vty.h"
52 #include "bgpd/bgp_mpath.h"
53 #include "bgpd/bgp_packet.h"
54 #include "bgpd/bgp_updgrp.h"
56 extern struct in_addr router_id_zebra
;
58 /* Utility function to get address family from current node. */
60 bgp_node_afi (struct vty
*vty
)
62 if (vty
->node
== BGP_IPV6_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
67 /* Utility function to get subsequent address family from current
70 bgp_node_safi (struct vty
*vty
)
72 if (vty
->node
== BGP_VPNV4_NODE
)
74 if (vty
->node
== BGP_IPV4M_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
75 return SAFI_MULTICAST
;
80 peer_address_self_check (union sockunion
*su
)
82 struct interface
*ifp
= NULL
;
84 if (su
->sa
.sa_family
== AF_INET
)
85 ifp
= if_lookup_by_ipv4_exact (&su
->sin
.sin_addr
);
87 else if (su
->sa
.sa_family
== AF_INET6
)
88 ifp
= if_lookup_by_ipv6_exact (&su
->sin6
.sin6_addr
);
89 #endif /* HAVE IPV6 */
97 /* Utility function for looking up peer from VTY. */
99 peer_lookup_vty (struct vty
*vty
, const char *ip_str
)
108 ret
= str2sockunion (ip_str
, &su
);
111 peer
= peer_lookup_by_conf_if (bgp
, ip_str
);
114 vty_out (vty
, "%% Malformed address or name: %s%s", ip_str
, VTY_NEWLINE
);
120 peer
= peer_lookup (bgp
, &su
);
123 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
131 /* Utility function for looking up peer or peer group. */
133 peer_and_group_lookup_vty (struct vty
*vty
, const char *peer_str
)
139 struct peer_group
*group
;
143 ret
= str2sockunion (peer_str
, &su
);
146 peer
= peer_lookup (bgp
, &su
);
152 peer
= peer_lookup_by_conf_if (bgp
, peer_str
);
156 group
= peer_group_lookup (bgp
, peer_str
);
161 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
168 bgp_vty_return (struct vty
*vty
, int ret
)
170 const char *str
= NULL
;
174 case BGP_ERR_INVALID_VALUE
:
175 str
= "Invalid value";
177 case BGP_ERR_INVALID_FLAG
:
178 str
= "Invalid flag";
180 case BGP_ERR_PEER_INACTIVE
:
181 str
= "Activate the neighbor for the address family first";
183 case BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER
:
184 str
= "Invalid command for a peer-group member";
186 case BGP_ERR_PEER_GROUP_SHUTDOWN
:
187 str
= "Peer-group has been shutdown. Activate the peer-group first";
189 case BGP_ERR_PEER_GROUP_HAS_THE_FLAG
:
190 str
= "This peer is a peer-group member. Please change peer-group configuration";
192 case BGP_ERR_PEER_FLAG_CONFLICT
:
193 str
= "Can't set override-capability and strict-capability-match at the same time";
195 case BGP_ERR_PEER_GROUP_MEMBER_EXISTS
:
196 str
= "No activate for peergroup can be given only if peer-group has no members";
198 case BGP_ERR_PEER_BELONGS_TO_GROUP
:
199 str
= "No activate for an individual peer-group member is invalid";
201 case BGP_ERR_PEER_GROUP_AF_UNCONFIGURED
:
202 str
= "Activate the peer-group for the address family first";
204 case BGP_ERR_PEER_GROUP_NO_REMOTE_AS
:
205 str
= "Specify remote-as or peer-group remote AS first";
207 case BGP_ERR_PEER_GROUP_CANT_CHANGE
:
208 str
= "Cannot change the peer-group. Deconfigure first";
210 case BGP_ERR_PEER_GROUP_MISMATCH
:
211 str
= "Cannot have different peer-group for the neighbor";
213 case BGP_ERR_PEER_FILTER_CONFLICT
:
214 str
= "Prefix/distribute list can not co-exist";
216 case BGP_ERR_NOT_INTERNAL_PEER
:
217 str
= "Invalid command. Not an internal neighbor";
219 case BGP_ERR_REMOVE_PRIVATE_AS
:
220 str
= "remove-private-AS cannot be configured for IBGP peers";
222 case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP
:
223 str
= "Local-AS allowed only for EBGP peers";
225 case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS
:
226 str
= "Cannot have local-as same as BGP AS number";
228 case BGP_ERR_TCPSIG_FAILED
:
229 str
= "Error while applying TCP-Sig to session(s)";
231 case BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK
:
232 str
= "ebgp-multihop and ttl-security cannot be configured together";
234 case BGP_ERR_NO_IBGP_WITH_TTLHACK
:
235 str
= "ttl-security only allowed for EBGP peers";
237 case BGP_ERR_AS_OVERRIDE
:
238 str
= "as-override cannot be configured for IBGP peers";
243 vty_out (vty
, "%% %s%s", str
, VTY_NEWLINE
);
249 /* BGP global configuration. */
251 DEFUN (bgp_multiple_instance_func
,
252 bgp_multiple_instance_cmd
,
253 "bgp multiple-instance",
255 "Enable bgp multiple instance\n")
257 bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE
);
261 DEFUN (no_bgp_multiple_instance
,
262 no_bgp_multiple_instance_cmd
,
263 "no bgp multiple-instance",
266 "BGP multiple instance\n")
270 ret
= bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE
);
273 vty_out (vty
, "%% There are more than two BGP instances%s", VTY_NEWLINE
);
279 DEFUN (bgp_config_type
,
281 "bgp config-type (cisco|zebra)",
283 "Configuration type\n"
287 if (strncmp (argv
[0], "c", 1) == 0)
288 bgp_option_set (BGP_OPT_CONFIG_CISCO
);
290 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
295 DEFUN (no_bgp_config_type
,
296 no_bgp_config_type_cmd
,
297 "no bgp config-type",
300 "Display configuration type\n")
302 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
306 DEFUN (no_synchronization
,
307 no_synchronization_cmd
,
308 "no synchronization",
310 "Perform IGP synchronization\n")
315 DEFUN (no_auto_summary
,
319 "Enable automatic network number summarization\n")
324 DEFUN_DEPRECATED (neighbor_version
,
325 neighbor_version_cmd
,
326 NEIGHBOR_CMD
"version (4|4-)",
329 "Set the BGP version to match a neighbor\n"
330 "Neighbor's BGP version\n")
335 /* "router bgp" commands. */
338 "router bgp " CMD_AS_RANGE
,
346 const char *name
= NULL
;
348 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
353 ret
= bgp_get (&bgp
, &as
, name
);
356 case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET
:
357 vty_out (vty
, "Please specify 'bgp multiple-instance' first%s",
360 case BGP_ERR_AS_MISMATCH
:
361 vty_out (vty
, "BGP is already running; AS is %u%s", as
, VTY_NEWLINE
);
363 case BGP_ERR_INSTANCE_MISMATCH
:
364 vty_out (vty
, "BGP view name and AS number mismatch%s", VTY_NEWLINE
);
365 vty_out (vty
, "BGP instance is already running; AS is %u%s",
370 vty
->node
= BGP_NODE
;
378 "router bgp " CMD_AS_RANGE
" view WORD",
385 /* "no router bgp" commands. */
386 DEFUN (no_router_bgp
,
388 "no router bgp " CMD_AS_RANGE
,
396 const char *name
= NULL
;
398 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
403 /* Lookup bgp structure. */
404 bgp
= bgp_lookup (as
, name
);
407 vty_out (vty
, "%% Can't find BGP instance%s", VTY_NEWLINE
);
416 ALIAS (no_router_bgp
,
417 no_router_bgp_view_cmd
,
418 "no router bgp " CMD_AS_RANGE
" view WORD",
428 DEFUN (bgp_router_id
,
430 "bgp router-id A.B.C.D",
432 "Override configured router identifier\n"
433 "Manually configured router identifier\n")
441 ret
= inet_aton (argv
[0], &id
);
444 vty_out (vty
, "%% Malformed bgp router identifier%s", VTY_NEWLINE
);
448 bgp
->router_id_static
= id
;
449 bgp_router_id_set (bgp
, &id
);
454 DEFUN (no_bgp_router_id
,
455 no_bgp_router_id_cmd
,
459 "Override configured router identifier\n")
469 ret
= inet_aton (argv
[0], &id
);
472 vty_out (vty
, "%% Malformed BGP router identifier%s", VTY_NEWLINE
);
476 if (! IPV4_ADDR_SAME (&bgp
->router_id_static
, &id
))
478 vty_out (vty
, "%% BGP router-id doesn't match%s", VTY_NEWLINE
);
483 bgp
->router_id_static
.s_addr
= 0;
484 bgp_router_id_set (bgp
, &router_id_zebra
);
489 ALIAS (no_bgp_router_id
,
490 no_bgp_router_id_val_cmd
,
491 "no bgp router-id A.B.C.D",
494 "Override configured router identifier\n"
495 "Manually configured router identifier\n")
497 /* BGP Cluster ID. */
499 DEFUN (bgp_cluster_id
,
501 "bgp cluster-id A.B.C.D",
503 "Configure Route-Reflector Cluster-id\n"
504 "Route-Reflector Cluster-id in IP address format\n")
508 struct in_addr cluster
;
512 ret
= inet_aton (argv
[0], &cluster
);
515 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
519 bgp_cluster_id_set (bgp
, &cluster
);
524 ALIAS (bgp_cluster_id
,
525 bgp_cluster_id32_cmd
,
526 "bgp cluster-id <1-4294967295>",
528 "Configure Route-Reflector Cluster-id\n"
529 "Route-Reflector Cluster-id as 32 bit quantity\n")
531 DEFUN (no_bgp_cluster_id
,
532 no_bgp_cluster_id_cmd
,
536 "Configure Route-Reflector Cluster-id\n")
540 struct in_addr cluster
;
546 ret
= inet_aton (argv
[0], &cluster
);
549 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
554 bgp_cluster_id_unset (bgp
);
559 ALIAS (no_bgp_cluster_id
,
560 no_bgp_cluster_id_arg_cmd
,
561 "no bgp cluster-id A.B.C.D",
564 "Configure Route-Reflector Cluster-id\n"
565 "Route-Reflector Cluster-id in IP address format\n")
567 DEFUN (bgp_confederation_identifier
,
568 bgp_confederation_identifier_cmd
,
569 "bgp confederation identifier " CMD_AS_RANGE
,
570 "BGP specific commands\n"
571 "AS confederation parameters\n"
573 "Set routing domain confederation AS\n")
580 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
582 bgp_confederation_id_set (bgp
, as
);
587 DEFUN (no_bgp_confederation_identifier
,
588 no_bgp_confederation_identifier_cmd
,
589 "no bgp confederation identifier",
591 "BGP specific commands\n"
592 "AS confederation parameters\n"
601 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
603 bgp_confederation_id_unset (bgp
);
608 ALIAS (no_bgp_confederation_identifier
,
609 no_bgp_confederation_identifier_arg_cmd
,
610 "no bgp confederation identifier " CMD_AS_RANGE
,
612 "BGP specific commands\n"
613 "AS confederation parameters\n"
615 "Set routing domain confederation AS\n")
617 DEFUN (bgp_confederation_peers
,
618 bgp_confederation_peers_cmd
,
619 "bgp confederation peers ." CMD_AS_RANGE
,
620 "BGP specific commands\n"
621 "AS confederation parameters\n"
622 "Peer ASs in BGP confederation\n"
631 for (i
= 0; i
< argc
; i
++)
633 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
637 vty_out (vty
, "%% Local member-AS not allowed in confed peer list%s",
642 bgp_confederation_peers_add (bgp
, as
);
647 DEFUN (no_bgp_confederation_peers
,
648 no_bgp_confederation_peers_cmd
,
649 "no bgp confederation peers ." CMD_AS_RANGE
,
651 "BGP specific commands\n"
652 "AS confederation parameters\n"
653 "Peer ASs in BGP confederation\n"
662 for (i
= 0; i
< argc
; i
++)
664 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
666 bgp_confederation_peers_remove (bgp
, as
);
672 * Central routine for maximum-paths configuration.
673 * @peer_type: BGP_PEER_EBGP or BGP_PEER_IBGP
674 * @set: 1 for setting values, 0 for removing the max-paths config.
677 bgp_maxpaths_config_vty (struct vty
*vty
, int peer_type
, char *mpaths
,
678 u_int16_t options
, int set
)
687 afi
= bgp_node_afi (vty
);
688 safi
= bgp_node_safi (vty
);
692 VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths
, mpaths
, 1,
693 BGP_MAXIMUM_MAXPATHS
);
694 ret
= bgp_maximum_paths_set (bgp
, afi
, safi
, peer_type
, maxpaths
,
698 ret
= bgp_maximum_paths_unset (bgp
, afi
, safi
, peer_type
);
703 "%% Failed to %sset maximum-paths %s %u for afi %u, safi %u%s",
704 (set
== 1) ? "" : "un",
705 (peer_type
== BGP_PEER_EBGP
) ? "ebgp" : "ibgp",
706 maxpaths
, afi
, safi
, VTY_NEWLINE
);
713 DEFUN (bgp_maxmed_admin
,
714 bgp_maxmed_admin_cmd
,
715 "bgp max-med administrative ",
717 "Advertise routes with max-med\n"
718 "Administratively applied, for an indefinite period\n")
724 bgp
->v_maxmed_admin
= 1;
725 bgp
->maxmed_admin_value
= BGP_MAXMED_VALUE_DEFAULT
;
727 bgp_maxmed_update(bgp
);
732 DEFUN (bgp_maxmed_admin_medv
,
733 bgp_maxmed_admin_medv_cmd
,
734 "bgp max-med administrative <0-4294967294>",
736 "Advertise routes with max-med\n"
737 "Administratively applied, for an indefinite period\n"
738 "Max MED value to be used\n")
744 bgp
->v_maxmed_admin
= 1;
745 VTY_GET_INTEGER ("max-med admin med-value", bgp
->maxmed_admin_value
, argv
[0]);
747 bgp_maxmed_update(bgp
);
752 DEFUN (no_bgp_maxmed_admin
,
753 no_bgp_maxmed_admin_cmd
,
754 "no bgp max-med administrative",
757 "Advertise routes with max-med\n"
758 "Administratively applied, for an indefinite period\n")
764 bgp
->v_maxmed_admin
= BGP_MAXMED_ADMIN_UNCONFIGURED
;
765 bgp
->maxmed_admin_value
= BGP_MAXMED_VALUE_DEFAULT
;
767 bgp_maxmed_update(bgp
);
772 ALIAS (no_bgp_maxmed_admin
,
773 no_bgp_maxmed_admin_medv_cmd
,
774 "no bgp max-med administrative <0-4294967294>",
777 "Advertise routes with max-med\n"
778 "Administratively applied, for an indefinite period\n"
779 "Max MED value to be used\n")
782 DEFUN (bgp_maxmed_onstartup
,
783 bgp_maxmed_onstartup_cmd
,
784 "bgp max-med on-startup <5-86400>",
786 "Advertise routes with max-med\n"
787 "Effective on a startup\n"
788 "Time (seconds) period for max-med\n")
796 vty_out (vty
, "%% Must supply max-med on-startup period");
800 VTY_GET_INTEGER ("max-med on-startup period", bgp
->v_maxmed_onstartup
, argv
[0]);
801 bgp
->maxmed_onstartup_value
= BGP_MAXMED_VALUE_DEFAULT
;
803 bgp_maxmed_update(bgp
);
808 DEFUN (bgp_maxmed_onstartup_medv
,
809 bgp_maxmed_onstartup_medv_cmd
,
810 "bgp max-med on-startup <5-86400> <0-4294967294>",
812 "Advertise routes with max-med\n"
813 "Effective on a startup\n"
814 "Time (seconds) period for max-med\n"
815 "Max MED value to be used\n")
823 vty_out (vty
, "%% Must supply max-med on-startup period and med value");
827 VTY_GET_INTEGER ("max-med on-startup period", bgp
->v_maxmed_onstartup
, argv
[0]);
828 VTY_GET_INTEGER ("max-med on-startup med-value", bgp
->maxmed_onstartup_value
, argv
[1]);
830 bgp_maxmed_update(bgp
);
835 DEFUN (no_bgp_maxmed_onstartup
,
836 no_bgp_maxmed_onstartup_cmd
,
837 "no bgp max-med on-startup",
840 "Advertise routes with max-med\n"
841 "Effective on a startup\n")
847 /* Cancel max-med onstartup if its on */
848 if (bgp
->t_maxmed_onstartup
)
850 THREAD_TIMER_OFF (bgp
->t_maxmed_onstartup
);
851 bgp
->maxmed_onstartup_over
= 1;
854 bgp
->v_maxmed_onstartup
= BGP_MAXMED_ONSTARTUP_UNCONFIGURED
;
855 bgp
->maxmed_onstartup_value
= BGP_MAXMED_VALUE_DEFAULT
;
857 bgp_maxmed_update(bgp
);
862 ALIAS (no_bgp_maxmed_onstartup
,
863 no_bgp_maxmed_onstartup_period_cmd
,
864 "no bgp max-med on-startup <5-86400>",
867 "Advertise routes with max-med\n"
868 "Effective on a startup\n"
869 "Time (seconds) period for max-med\n")
871 ALIAS (no_bgp_maxmed_onstartup
,
872 no_bgp_maxmed_onstartup_period_medv_cmd
,
873 "no bgp max-med on-startup <5-86400> <0-4294967294>",
876 "Advertise routes with max-med\n"
877 "Effective on a startup\n"
878 "Time (seconds) period for max-med\n"
879 "Max MED value to be used\n")
882 bgp_update_delay_config_vty (struct vty
*vty
, const char *delay
,
886 u_int16_t update_delay
;
887 u_int16_t establish_wait
;
892 VTY_GET_INTEGER_RANGE ("update-delay", update_delay
, delay
,
893 BGP_UPDATE_DELAY_MIN
, BGP_UPDATE_DELAY_MAX
);
895 if (!wait
) /* update-delay <delay> */
897 bgp
->v_update_delay
= update_delay
;
898 bgp
->v_establish_wait
= bgp
->v_update_delay
;
902 /* update-delay <delay> <establish-wait> */
903 establish_wait
= atoi (wait
);
904 if (update_delay
< establish_wait
)
906 vty_out (vty
, "%%Failed: update-delay less than the establish-wait!%s",
911 bgp
->v_update_delay
= update_delay
;
912 bgp
->v_establish_wait
= establish_wait
;
918 bgp_update_delay_deconfig_vty (struct vty
*vty
)
924 bgp
->v_update_delay
= BGP_UPDATE_DELAY_DEF
;
925 bgp
->v_establish_wait
= bgp
->v_update_delay
;
931 bgp_config_write_update_delay (struct vty
*vty
, struct bgp
*bgp
)
933 if (bgp
->v_update_delay
!= BGP_UPDATE_DELAY_DEF
)
935 vty_out (vty
, " update-delay %d", bgp
->v_update_delay
);
936 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
937 vty_out (vty
, " %d", bgp
->v_establish_wait
);
938 vty_out (vty
, "%s", VTY_NEWLINE
);
945 /* Update-delay configuration */
946 DEFUN (bgp_update_delay
,
947 bgp_update_delay_cmd
,
948 "update-delay <0-3600>",
949 "Force initial delay for best-path and updates\n"
952 return bgp_update_delay_config_vty(vty
, argv
[0], NULL
);
955 DEFUN (bgp_update_delay_establish_wait
,
956 bgp_update_delay_establish_wait_cmd
,
957 "update-delay <0-3600> <1-3600>",
958 "Force initial delay for best-path and updates\n"
960 "Wait for peers to be established\n"
963 return bgp_update_delay_config_vty(vty
, argv
[0], argv
[1]);
966 /* Update-delay deconfiguration */
967 DEFUN (no_bgp_update_delay
,
968 no_bgp_update_delay_cmd
,
969 "no update-delay <0-3600>",
970 "Force initial delay for best-path and updates\n"
973 return bgp_update_delay_deconfig_vty(vty
);
976 ALIAS (no_bgp_update_delay
,
977 no_bgp_update_delay_establish_wait_cmd
,
978 "no update-delay <0-3600> <1-3600>",
979 "Force initial delay for best-path and updates\n"
981 "Wait for peers to be established\n"
985 bgp_wpkt_quanta_config_vty (struct vty
*vty
, char *num
, char set
)
988 u_int16_t update_delay
;
993 VTY_GET_INTEGER_RANGE ("write-quanta", bgp
->wpkt_quanta
, num
,
996 bgp
->wpkt_quanta
= BGP_WRITE_PACKET_MAX
;
1002 bgp_config_write_wpkt_quanta (struct vty
*vty
, struct bgp
*bgp
)
1004 if (bgp
->wpkt_quanta
!= BGP_WRITE_PACKET_MAX
)
1005 vty_out (vty
, " write-quanta %d%s",
1006 bgp
->wpkt_quanta
, VTY_NEWLINE
);
1012 /* Update-delay configuration */
1013 DEFUN (bgp_wpkt_quanta
,
1014 bgp_wpkt_quanta_cmd
,
1015 "write-quanta <1-4294967295>",
1016 "How many packets to write to peer socket per run\n"
1017 "Number of packets\n")
1019 return bgp_wpkt_quanta_config_vty(vty
, argv
[0], 1);
1022 /* Update-delay deconfiguration */
1023 DEFUN (no_bgp_wpkt_quanta
,
1024 no_bgp_wpkt_quanta_cmd
,
1025 "no write-quanta <1-4294967295>",
1026 "How many packets to write to peer socket per run\n"
1027 "Number of packets\n")
1029 return bgp_wpkt_quanta_config_vty(vty
, argv
[0], 0);
1033 bgp_coalesce_config_vty (struct vty
*vty
, const char *num
, char set
)
1040 VTY_GET_INTEGER_RANGE ("coalesce-time", bgp
->coalesce_time
, num
,
1043 bgp
->coalesce_time
= BGP_DEFAULT_SUBGROUP_COALESCE_TIME
;
1049 bgp_config_write_coalesce_time (struct vty
*vty
, struct bgp
*bgp
)
1051 if (bgp
->coalesce_time
!= BGP_DEFAULT_SUBGROUP_COALESCE_TIME
)
1052 vty_out (vty
, " coalesce-time %d%s",
1053 bgp
->coalesce_time
, VTY_NEWLINE
);
1059 DEFUN (bgp_coalesce_time
,
1060 bgp_coalesce_time_cmd
,
1061 "coalesce-time <0-4294967295>",
1062 "Subgroup coalesce timer\n"
1063 "Subgroup coalesce timer value (in ms)\n")
1065 return bgp_coalesce_config_vty(vty
, argv
[0], 1);
1068 DEFUN (no_bgp_coalesce_time
,
1069 no_bgp_coalesce_time_cmd
,
1070 "no coalesce-time <0-4294967295>",
1071 "Subgroup coalesce timer\n"
1072 "Subgroup coalesce timer value (in ms)\n")
1074 return bgp_coalesce_config_vty(vty
, argv
[0], 0);
1077 /* Maximum-paths configuration */
1078 DEFUN (bgp_maxpaths
,
1080 "maximum-paths <1-255>",
1081 "Forward packets over multiple paths\n"
1082 "Number of paths\n")
1084 return bgp_maxpaths_config_vty(vty
, BGP_PEER_EBGP
, argv
[0], 0, 1);
1087 DEFUN (bgp_maxpaths_ibgp
,
1088 bgp_maxpaths_ibgp_cmd
,
1089 "maximum-paths ibgp <1-255>",
1090 "Forward packets over multiple paths\n"
1092 "Number of paths\n")
1094 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, argv
[0], 0, 1);
1097 DEFUN (bgp_maxpaths_ibgp_cluster
,
1098 bgp_maxpaths_ibgp_cluster_cmd
,
1099 "maximum-paths ibgp <1-255> equal-cluster-length",
1100 "Forward packets over multiple paths\n"
1103 "Match the cluster length\n")
1105 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, argv
[0],
1106 BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN
, 1);
1109 DEFUN (no_bgp_maxpaths
,
1110 no_bgp_maxpaths_cmd
,
1113 "Forward packets over multiple paths\n"
1114 "Number of paths\n")
1116 return bgp_maxpaths_config_vty(vty
, BGP_PEER_EBGP
, NULL
, 0, 0);
1119 ALIAS (no_bgp_maxpaths
,
1120 no_bgp_maxpaths_arg_cmd
,
1121 "no maximum-paths <1-255>",
1123 "Forward packets over multiple paths\n"
1124 "Number of paths\n")
1126 DEFUN (no_bgp_maxpaths_ibgp
,
1127 no_bgp_maxpaths_ibgp_cmd
,
1128 "no maximum-paths ibgp",
1130 "Forward packets over multiple paths\n"
1132 "Number of paths\n")
1134 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, NULL
, 0, 0);
1137 ALIAS (no_bgp_maxpaths_ibgp
,
1138 no_bgp_maxpaths_ibgp_arg_cmd
,
1139 "no maximum-paths ibgp <1-255>",
1141 "Forward packets over multiple paths\n"
1143 "Number of paths\n")
1145 ALIAS (no_bgp_maxpaths_ibgp
,
1146 no_bgp_maxpaths_ibgp_cluster_cmd
,
1147 "no maximum-paths ibgp <1-255> equal-cluster-length",
1149 "Forward packets over multiple paths\n"
1152 "Match the cluster length\n")
1155 bgp_config_write_maxpaths (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
1156 safi_t safi
, int *write
)
1158 if (bgp
->maxpaths
[afi
][safi
].maxpaths_ebgp
!= BGP_DEFAULT_MAXPATHS
)
1160 bgp_config_write_family_header (vty
, afi
, safi
, write
);
1161 vty_out (vty
, " maximum-paths %d%s",
1162 bgp
->maxpaths
[afi
][safi
].maxpaths_ebgp
, VTY_NEWLINE
);
1165 if (bgp
->maxpaths
[afi
][safi
].maxpaths_ibgp
!= BGP_DEFAULT_MAXPATHS
)
1167 bgp_config_write_family_header (vty
, afi
, safi
, write
);
1168 vty_out (vty
, " maximum-paths ibgp %d",
1169 bgp
->maxpaths
[afi
][safi
].maxpaths_ibgp
);
1170 if (CHECK_FLAG (bgp
->maxpaths
[afi
][safi
].ibgp_flags
,
1171 BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN
))
1172 vty_out (vty
, " equal-cluster-length");
1173 vty_out (vty
, "%s", VTY_NEWLINE
);
1183 "timers bgp <0-65535> <0-65535>",
1184 "Adjust routing timers\n"
1186 "Keepalive interval\n"
1190 unsigned long keepalive
= 0;
1191 unsigned long holdtime
= 0;
1195 VTY_GET_INTEGER ("keepalive", keepalive
, argv
[0]);
1196 VTY_GET_INTEGER ("holdtime", holdtime
, argv
[1]);
1198 /* Holdtime value check. */
1199 if (holdtime
< 3 && holdtime
!= 0)
1201 vty_out (vty
, "%% hold time value must be either 0 or greater than 3%s",
1206 bgp_timers_set (bgp
, keepalive
, holdtime
);
1211 DEFUN (no_bgp_timers
,
1215 "Adjust routing timers\n"
1221 bgp_timers_unset (bgp
);
1226 ALIAS (no_bgp_timers
,
1227 no_bgp_timers_arg_cmd
,
1228 "no timers bgp <0-65535> <0-65535>",
1230 "Adjust routing timers\n"
1232 "Keepalive interval\n"
1235 DEFUN (bgp_client_to_client_reflection
,
1236 bgp_client_to_client_reflection_cmd
,
1237 "bgp client-to-client reflection",
1238 "BGP specific commands\n"
1239 "Configure client to client route reflection\n"
1240 "reflection of routes allowed\n")
1245 bgp_flag_unset (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
1249 DEFUN (no_bgp_client_to_client_reflection
,
1250 no_bgp_client_to_client_reflection_cmd
,
1251 "no bgp client-to-client reflection",
1253 "BGP specific commands\n"
1254 "Configure client to client route reflection\n"
1255 "reflection of routes allowed\n")
1260 bgp_flag_set (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
1264 /* "bgp always-compare-med" configuration. */
1265 DEFUN (bgp_always_compare_med
,
1266 bgp_always_compare_med_cmd
,
1267 "bgp always-compare-med",
1268 "BGP specific commands\n"
1269 "Allow comparing MED from different neighbors\n")
1274 bgp_flag_set (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
1278 DEFUN (no_bgp_always_compare_med
,
1279 no_bgp_always_compare_med_cmd
,
1280 "no bgp always-compare-med",
1282 "BGP specific commands\n"
1283 "Allow comparing MED from different neighbors\n")
1288 bgp_flag_unset (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
1292 /* "bgp deterministic-med" configuration. */
1293 DEFUN (bgp_deterministic_med
,
1294 bgp_deterministic_med_cmd
,
1295 "bgp deterministic-med",
1296 "BGP specific commands\n"
1297 "Pick the best-MED path among paths advertised from the neighboring AS\n")
1302 bgp_flag_set (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
1306 DEFUN (no_bgp_deterministic_med
,
1307 no_bgp_deterministic_med_cmd
,
1308 "no bgp deterministic-med",
1310 "BGP specific commands\n"
1311 "Pick the best-MED path among paths advertised from the neighboring AS\n")
1316 bgp_flag_unset (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
1320 /* "bgp graceful-restart" configuration. */
1321 DEFUN (bgp_graceful_restart
,
1322 bgp_graceful_restart_cmd
,
1323 "bgp graceful-restart",
1324 "BGP specific commands\n"
1325 "Graceful restart capability parameters\n")
1330 bgp_flag_set (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
1334 DEFUN (no_bgp_graceful_restart
,
1335 no_bgp_graceful_restart_cmd
,
1336 "no bgp graceful-restart",
1338 "BGP specific commands\n"
1339 "Graceful restart capability parameters\n")
1344 bgp_flag_unset (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
1348 DEFUN (bgp_graceful_restart_stalepath_time
,
1349 bgp_graceful_restart_stalepath_time_cmd
,
1350 "bgp graceful-restart stalepath-time <1-3600>",
1351 "BGP specific commands\n"
1352 "Graceful restart capability parameters\n"
1353 "Set the max time to hold onto restarting peer's stale paths\n"
1354 "Delay value (seconds)\n")
1357 u_int32_t stalepath
;
1363 VTY_GET_INTEGER_RANGE ("stalepath-time", stalepath
, argv
[0], 1, 3600);
1364 bgp
->stalepath_time
= stalepath
;
1368 DEFUN (no_bgp_graceful_restart_stalepath_time
,
1369 no_bgp_graceful_restart_stalepath_time_cmd
,
1370 "no bgp graceful-restart stalepath-time",
1372 "BGP specific commands\n"
1373 "Graceful restart capability parameters\n"
1374 "Set the max time to hold onto restarting peer's stale paths\n")
1382 bgp
->stalepath_time
= BGP_DEFAULT_STALEPATH_TIME
;
1386 ALIAS (no_bgp_graceful_restart_stalepath_time
,
1387 no_bgp_graceful_restart_stalepath_time_val_cmd
,
1388 "no bgp graceful-restart stalepath-time <1-3600>",
1390 "BGP specific commands\n"
1391 "Graceful restart capability parameters\n"
1392 "Set the max time to hold onto restarting peer's stale paths\n"
1393 "Delay value (seconds)\n")
1395 /* "bgp fast-external-failover" configuration. */
1396 DEFUN (bgp_fast_external_failover
,
1397 bgp_fast_external_failover_cmd
,
1398 "bgp fast-external-failover",
1400 "Immediately reset session if a link to a directly connected external peer goes down\n")
1405 bgp_flag_unset (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
1409 DEFUN (no_bgp_fast_external_failover
,
1410 no_bgp_fast_external_failover_cmd
,
1411 "no bgp fast-external-failover",
1414 "Immediately reset session if a link to a directly connected external peer goes down\n")
1419 bgp_flag_set (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
1423 /* "bgp enforce-first-as" configuration. */
1424 DEFUN (bgp_enforce_first_as
,
1425 bgp_enforce_first_as_cmd
,
1426 "bgp enforce-first-as",
1428 "Enforce the first AS for EBGP routes\n")
1433 bgp_flag_set (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
1437 DEFUN (no_bgp_enforce_first_as
,
1438 no_bgp_enforce_first_as_cmd
,
1439 "no bgp enforce-first-as",
1442 "Enforce the first AS for EBGP routes\n")
1447 bgp_flag_unset (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
1451 /* "bgp bestpath compare-routerid" configuration. */
1452 DEFUN (bgp_bestpath_compare_router_id
,
1453 bgp_bestpath_compare_router_id_cmd
,
1454 "bgp bestpath compare-routerid",
1455 "BGP specific commands\n"
1456 "Change the default bestpath selection\n"
1457 "Compare router-id for identical EBGP paths\n")
1462 bgp_flag_set (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
1466 DEFUN (no_bgp_bestpath_compare_router_id
,
1467 no_bgp_bestpath_compare_router_id_cmd
,
1468 "no bgp bestpath compare-routerid",
1470 "BGP specific commands\n"
1471 "Change the default bestpath selection\n"
1472 "Compare router-id for identical EBGP paths\n")
1477 bgp_flag_unset (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
1481 /* "bgp bestpath as-path ignore" configuration. */
1482 DEFUN (bgp_bestpath_aspath_ignore
,
1483 bgp_bestpath_aspath_ignore_cmd
,
1484 "bgp bestpath as-path ignore",
1485 "BGP specific commands\n"
1486 "Change the default bestpath selection\n"
1487 "AS-path attribute\n"
1488 "Ignore as-path length in selecting a route\n")
1493 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_IGNORE
);
1497 DEFUN (no_bgp_bestpath_aspath_ignore
,
1498 no_bgp_bestpath_aspath_ignore_cmd
,
1499 "no bgp bestpath as-path ignore",
1501 "BGP specific commands\n"
1502 "Change the default bestpath selection\n"
1503 "AS-path attribute\n"
1504 "Ignore as-path length in selecting a route\n")
1509 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_IGNORE
);
1513 /* "bgp bestpath as-path confed" configuration. */
1514 DEFUN (bgp_bestpath_aspath_confed
,
1515 bgp_bestpath_aspath_confed_cmd
,
1516 "bgp bestpath as-path confed",
1517 "BGP specific commands\n"
1518 "Change the default bestpath selection\n"
1519 "AS-path attribute\n"
1520 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1525 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_CONFED
);
1529 DEFUN (no_bgp_bestpath_aspath_confed
,
1530 no_bgp_bestpath_aspath_confed_cmd
,
1531 "no bgp bestpath as-path confed",
1533 "BGP specific commands\n"
1534 "Change the default bestpath selection\n"
1535 "AS-path attribute\n"
1536 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1541 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_CONFED
);
1545 /* "bgp bestpath as-path multipath-relax" configuration. */
1546 DEFUN (bgp_bestpath_aspath_multipath_relax
,
1547 bgp_bestpath_aspath_multipath_relax_cmd
,
1548 "bgp bestpath as-path multipath-relax",
1549 "BGP specific commands\n"
1550 "Change the default bestpath selection\n"
1551 "AS-path attribute\n"
1552 "Allow load sharing across routes that have different AS paths (but same length)\n")
1557 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
1561 DEFUN (no_bgp_bestpath_aspath_multipath_relax
,
1562 no_bgp_bestpath_aspath_multipath_relax_cmd
,
1563 "no bgp bestpath as-path multipath-relax",
1565 "BGP specific commands\n"
1566 "Change the default bestpath selection\n"
1567 "AS-path attribute\n"
1568 "Allow load sharing across routes that have different AS paths (but same length)\n")
1573 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
1577 /* "bgp log-neighbor-changes" configuration. */
1578 DEFUN (bgp_log_neighbor_changes
,
1579 bgp_log_neighbor_changes_cmd
,
1580 "bgp log-neighbor-changes",
1581 "BGP specific commands\n"
1582 "Log neighbor up/down and reset reason\n")
1587 bgp_flag_set (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
1591 DEFUN (no_bgp_log_neighbor_changes
,
1592 no_bgp_log_neighbor_changes_cmd
,
1593 "no bgp log-neighbor-changes",
1595 "BGP specific commands\n"
1596 "Log neighbor up/down and reset reason\n")
1601 bgp_flag_unset (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
1605 /* "bgp bestpath med" configuration. */
1606 DEFUN (bgp_bestpath_med
,
1607 bgp_bestpath_med_cmd
,
1608 "bgp bestpath med (confed|missing-as-worst)",
1609 "BGP specific commands\n"
1610 "Change the default bestpath selection\n"
1612 "Compare MED among confederation paths\n"
1613 "Treat missing MED as the least preferred one\n")
1619 if (strncmp (argv
[0], "confed", 1) == 0)
1620 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
1622 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1627 DEFUN (bgp_bestpath_med2
,
1628 bgp_bestpath_med2_cmd
,
1629 "bgp bestpath med confed missing-as-worst",
1630 "BGP specific commands\n"
1631 "Change the default bestpath selection\n"
1633 "Compare MED among confederation paths\n"
1634 "Treat missing MED as the least preferred one\n")
1639 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
1640 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1644 ALIAS (bgp_bestpath_med2
,
1645 bgp_bestpath_med3_cmd
,
1646 "bgp bestpath med missing-as-worst confed",
1647 "BGP specific commands\n"
1648 "Change the default bestpath selection\n"
1650 "Treat missing MED as the least preferred one\n"
1651 "Compare MED among confederation paths\n")
1653 DEFUN (no_bgp_bestpath_med
,
1654 no_bgp_bestpath_med_cmd
,
1655 "no bgp bestpath med (confed|missing-as-worst)",
1657 "BGP specific commands\n"
1658 "Change the default bestpath selection\n"
1660 "Compare MED among confederation paths\n"
1661 "Treat missing MED as the least preferred one\n")
1667 if (strncmp (argv
[0], "confed", 1) == 0)
1668 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
1670 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1675 DEFUN (no_bgp_bestpath_med2
,
1676 no_bgp_bestpath_med2_cmd
,
1677 "no bgp bestpath med confed missing-as-worst",
1679 "BGP specific commands\n"
1680 "Change the default bestpath selection\n"
1682 "Compare MED among confederation paths\n"
1683 "Treat missing MED as the least preferred one\n")
1688 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
1689 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1693 ALIAS (no_bgp_bestpath_med2
,
1694 no_bgp_bestpath_med3_cmd
,
1695 "no bgp bestpath med missing-as-worst confed",
1697 "BGP specific commands\n"
1698 "Change the default bestpath selection\n"
1700 "Treat missing MED as the least preferred one\n"
1701 "Compare MED among confederation paths\n")
1703 /* "no bgp default ipv4-unicast". */
1704 DEFUN (no_bgp_default_ipv4_unicast
,
1705 no_bgp_default_ipv4_unicast_cmd
,
1706 "no bgp default ipv4-unicast",
1708 "BGP specific commands\n"
1709 "Configure BGP defaults\n"
1710 "Activate ipv4-unicast for a peer by default\n")
1715 bgp_flag_set (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1719 DEFUN (bgp_default_ipv4_unicast
,
1720 bgp_default_ipv4_unicast_cmd
,
1721 "bgp default ipv4-unicast",
1722 "BGP specific commands\n"
1723 "Configure BGP defaults\n"
1724 "Activate ipv4-unicast for a peer by default\n")
1729 bgp_flag_unset (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1733 /* "bgp import-check" configuration. */
1734 DEFUN (bgp_network_import_check
,
1735 bgp_network_import_check_cmd
,
1736 "bgp network import-check",
1737 "BGP specific commands\n"
1738 "BGP network command\n"
1739 "Check BGP network route exists in IGP\n")
1744 bgp_flag_set (bgp
, BGP_FLAG_IMPORT_CHECK
);
1748 DEFUN (no_bgp_network_import_check
,
1749 no_bgp_network_import_check_cmd
,
1750 "no bgp network import-check",
1752 "BGP specific commands\n"
1753 "BGP network command\n"
1754 "Check BGP network route exists in IGP\n")
1759 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK
);
1763 DEFUN (bgp_default_local_preference
,
1764 bgp_default_local_preference_cmd
,
1765 "bgp default local-preference <0-4294967295>",
1766 "BGP specific commands\n"
1767 "Configure BGP defaults\n"
1768 "local preference (higher=more preferred)\n"
1769 "Configure default local preference value\n")
1772 u_int32_t local_pref
;
1776 VTY_GET_INTEGER ("local preference", local_pref
, argv
[0]);
1778 bgp_default_local_preference_set (bgp
, local_pref
);
1783 DEFUN (no_bgp_default_local_preference
,
1784 no_bgp_default_local_preference_cmd
,
1785 "no bgp default local-preference",
1787 "BGP specific commands\n"
1788 "Configure BGP defaults\n"
1789 "local preference (higher=more preferred)\n")
1794 bgp_default_local_preference_unset (bgp
);
1798 ALIAS (no_bgp_default_local_preference
,
1799 no_bgp_default_local_preference_val_cmd
,
1800 "no bgp default local-preference <0-4294967295>",
1802 "BGP specific commands\n"
1803 "Configure BGP defaults\n"
1804 "local preference (higher=more preferred)\n"
1805 "Configure default local preference value\n")
1807 DEFUN (bgp_default_subgroup_pkt_queue_max
,
1808 bgp_default_subgroup_pkt_queue_max_cmd
,
1809 "bgp default subgroup-pkt-queue-max <20-100>",
1810 "BGP specific commands\n"
1811 "Configure BGP defaults\n"
1812 "subgroup-pkt-queue-max\n"
1813 "Configure subgroup packet queue max\n")
1820 VTY_GET_INTEGER ("subgroup packet queue max", max_size
, argv
[0]);
1822 bgp_default_subgroup_pkt_queue_max_set (bgp
, max_size
);
1827 DEFUN (no_bgp_default_subgroup_pkt_queue_max
,
1828 no_bgp_default_subgroup_pkt_queue_max_cmd
,
1829 "no bgp default subgroup-pkt-queue-max",
1831 "BGP specific commands\n"
1832 "Configure BGP defaults\n"
1833 "subgroup-pkt-queue-max\n")
1838 bgp_default_subgroup_pkt_queue_max_unset (bgp
);
1842 DEFUN (bgp_rr_allow_outbound_policy
,
1843 bgp_rr_allow_outbound_policy_cmd
,
1844 "bgp route-reflector allow-outbound-policy",
1845 "BGP specific commands\n"
1846 "Allow modifications made by out route-map\n"
1847 "on ibgp neighbors\n")
1850 u_int32_t local_pref
;
1855 if (!bgp_flag_check(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
))
1857 bgp_flag_set(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
);
1858 update_group_announce_rrclients(bgp
);
1864 DEFUN (no_bgp_rr_allow_outbound_policy
,
1865 no_bgp_rr_allow_outbound_policy_cmd
,
1866 "no bgp route-reflector allow-outbound-policy",
1868 "BGP specific commands\n"
1869 "Allow modifications made by out route-map\n"
1870 "on ibgp neighbors\n")
1873 u_int32_t local_pref
;
1877 if (bgp_flag_check(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
))
1879 bgp_flag_unset(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
);
1880 update_group_announce_rrclients(bgp
);
1887 peer_remote_as_vty (struct vty
*vty
, const char *peer_str
,
1888 const char *as_str
, afi_t afi
, safi_t safi
)
1897 /* Get AS number. */
1898 VTY_GET_INTEGER_RANGE ("AS", as
, as_str
, 1, BGP_AS4_MAX
);
1900 /* If peer is peer group, call proper function. */
1901 ret
= str2sockunion (peer_str
, &su
);
1904 /* Check for peer by interface */
1905 ret
= peer_remote_as (bgp
, NULL
, peer_str
, &as
, afi
, safi
);
1908 ret
= peer_group_remote_as (bgp
, peer_str
, &as
);
1911 vty_out (vty
, "%% Create the peer-group or interface first%s",
1920 if (peer_address_self_check (&su
))
1922 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1926 ret
= peer_remote_as (bgp
, &su
, NULL
, &as
, afi
, safi
);
1929 /* This peer belongs to peer group. */
1932 case BGP_ERR_PEER_GROUP_MEMBER
:
1933 vty_out (vty
, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as
, VTY_NEWLINE
);
1935 case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
:
1936 vty_out (vty
, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external%s", as
, as_str
, VTY_NEWLINE
);
1939 return bgp_vty_return (vty
, ret
);
1942 DEFUN (neighbor_remote_as
,
1943 neighbor_remote_as_cmd
,
1944 NEIGHBOR_CMD2
"remote-as " CMD_AS_RANGE
,
1947 "Specify a BGP neighbor\n"
1950 return peer_remote_as_vty (vty
, argv
[0], argv
[1], AFI_IP
, SAFI_UNICAST
);
1953 DEFUN (neighbor_interface_config
,
1954 neighbor_interface_config_cmd
,
1955 "neighbor WORD interface",
1957 "Interface name or neighbor tag\n"
1958 "Enable BGP on interface\n")
1962 struct peer_group
*group
;
1965 group
= peer_group_lookup (bgp
, argv
[0]);
1968 vty_out (vty
, "%% Name conflict with peer-group %s", VTY_NEWLINE
);
1972 peer
= peer_conf_interface_get (bgp
, argv
[0], AFI_IP
, SAFI_UNICAST
);
1980 DEFUN (neighbor_peer_group
,
1981 neighbor_peer_group_cmd
,
1982 "neighbor WORD peer-group",
1984 "Interface name or neighbor tag\n"
1985 "Configure peer-group\n")
1989 struct peer_group
*group
;
1992 peer
= peer_lookup_by_conf_if (bgp
, argv
[0]);
1995 vty_out (vty
, "%% Name conflict with interface: %s", VTY_NEWLINE
);
1999 group
= peer_group_get (bgp
, argv
[0]);
2015 struct peer_group
*group
;
2019 ret
= str2sockunion (argv
[0], &su
);
2022 /* look up for neighbor by interface name config. */
2023 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
2030 group
= peer_group_lookup (vty
->index
, argv
[0]);
2032 peer_group_delete (group
);
2035 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
2041 peer
= peer_lookup (vty
->index
, &su
);
2044 other
= peer
->doppelganger
;
2046 if (other
&& other
->status
!= Deleted
)
2055 no_neighbor_remote_as_cmd
,
2056 NO_NEIGHBOR_CMD
"remote-as " CMD_AS_RANGE
,
2060 "Specify a BGP neighbor\n"
2063 DEFUN (no_neighbor_interface_config
,
2064 no_neighbor_interface_config_cmd
,
2065 "no neighbor WORD interface",
2069 "Configure BGP on interface\n")
2073 /* look up for neighbor by interface name config. */
2074 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
2081 vty_out (vty
, "%% Create the bgp interface first%s", VTY_NEWLINE
);
2087 DEFUN (no_neighbor_peer_group
,
2088 no_neighbor_peer_group_cmd
,
2089 "no neighbor WORD peer-group",
2093 "Configure peer-group\n")
2095 struct peer_group
*group
;
2097 group
= peer_group_lookup (vty
->index
, argv
[0]);
2099 peer_group_delete (group
);
2102 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
2108 DEFUN (no_neighbor_interface_peer_group_remote_as
,
2109 no_neighbor_interface_peer_group_remote_as_cmd
,
2110 "no neighbor WORD remote-as " CMD_AS_RANGE
,
2113 "Interface name or neighbor tag\n"
2114 "Specify a BGP neighbor\n"
2117 struct peer_group
*group
;
2120 /* look up for neighbor by interface name config. */
2121 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
2124 peer_as_change (peer
, 0);
2128 group
= peer_group_lookup (vty
->index
, argv
[0]);
2130 peer_group_remote_as_delete (group
);
2133 vty_out (vty
, "%% Create the peer-group or interface first%s", VTY_NEWLINE
);
2139 DEFUN (neighbor_local_as
,
2140 neighbor_local_as_cmd
,
2141 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
2144 "Specify a local-as number\n"
2145 "AS number used as local AS\n")
2150 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2154 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 0, 0);
2155 return bgp_vty_return (vty
, ret
);
2158 DEFUN (neighbor_local_as_no_prepend
,
2159 neighbor_local_as_no_prepend_cmd
,
2160 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
2163 "Specify a local-as number\n"
2164 "AS number used as local AS\n"
2165 "Do not prepend local-as to updates from ebgp peers\n")
2170 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2174 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1, 0);
2175 return bgp_vty_return (vty
, ret
);
2178 DEFUN (neighbor_local_as_no_prepend_replace_as
,
2179 neighbor_local_as_no_prepend_replace_as_cmd
,
2180 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend replace-as",
2183 "Specify a local-as number\n"
2184 "AS number used as local AS\n"
2185 "Do not prepend local-as to updates from ebgp peers\n"
2186 "Do not prepend local-as to updates from ibgp peers\n")
2191 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2195 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1, 1);
2196 return bgp_vty_return (vty
, ret
);
2200 DEFUN (no_neighbor_local_as
,
2201 no_neighbor_local_as_cmd
,
2202 NO_NEIGHBOR_CMD2
"local-as",
2206 "Specify a local-as number\n")
2211 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2215 ret
= peer_local_as_unset (peer
);
2216 return bgp_vty_return (vty
, ret
);
2219 ALIAS (no_neighbor_local_as
,
2220 no_neighbor_local_as_val_cmd
,
2221 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
2225 "Specify a local-as number\n"
2226 "AS number used as local AS\n")
2228 ALIAS (no_neighbor_local_as
,
2229 no_neighbor_local_as_val2_cmd
,
2230 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
2234 "Specify a local-as number\n"
2235 "AS number used as local AS\n"
2236 "Do not prepend local-as to updates from ebgp peers\n")
2238 ALIAS (no_neighbor_local_as
,
2239 no_neighbor_local_as_val3_cmd
,
2240 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend replace-as",
2244 "Specify a local-as number\n"
2245 "AS number used as local AS\n"
2246 "Do not prepend local-as to updates from ebgp peers\n"
2247 "Do not prepend local-as to updates from ibgp peers\n")
2249 DEFUN (neighbor_solo
,
2251 NEIGHBOR_CMD2
"solo",
2254 "Solo peer - part of its own update group\n")
2259 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2263 ret
= update_group_adjust_soloness(peer
, 1);
2264 return bgp_vty_return (vty
, ret
);
2267 DEFUN (no_neighbor_solo
,
2268 no_neighbor_solo_cmd
,
2269 NO_NEIGHBOR_CMD2
"solo",
2273 "Solo peer - part of its own update group\n")
2278 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2282 ret
= update_group_adjust_soloness(peer
, 0);
2283 return bgp_vty_return (vty
, ret
);
2286 DEFUN (neighbor_password
,
2287 neighbor_password_cmd
,
2288 NEIGHBOR_CMD2
"password LINE",
2297 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2301 ret
= peer_password_set (peer
, argv
[1]);
2302 return bgp_vty_return (vty
, ret
);
2305 DEFUN (no_neighbor_password
,
2306 no_neighbor_password_cmd
,
2307 NO_NEIGHBOR_CMD2
"password",
2316 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2320 ret
= peer_password_unset (peer
);
2321 return bgp_vty_return (vty
, ret
);
2324 DEFUN (neighbor_activate
,
2325 neighbor_activate_cmd
,
2326 NEIGHBOR_CMD2
"activate",
2329 "Enable the Address Family for this Neighbor\n")
2333 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2337 peer_activate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
2342 DEFUN (no_neighbor_activate
,
2343 no_neighbor_activate_cmd
,
2344 NO_NEIGHBOR_CMD2
"activate",
2348 "Enable the Address Family for this Neighbor\n")
2354 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2358 ret
= peer_deactivate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
2360 return bgp_vty_return (vty
, ret
);
2363 DEFUN (neighbor_set_peer_group
,
2364 neighbor_set_peer_group_cmd
,
2365 NEIGHBOR_CMD2
"peer-group WORD",
2368 "Member of the peer-group\n"
2369 "peer-group name\n")
2376 struct peer_group
*group
;
2381 ret
= str2sockunion (argv
[0], &su
);
2384 peer
= peer_lookup_by_conf_if (bgp
, argv
[0]);
2387 vty_out (vty
, "%% Malformed address or name: %s%s", argv
[0], VTY_NEWLINE
);
2393 if (peer_address_self_check (&su
))
2395 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
2401 group
= peer_group_lookup (bgp
, argv
[1]);
2404 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
2408 ret
= peer_group_bind (bgp
, &su
, peer
, group
, bgp_node_afi (vty
),
2409 bgp_node_safi (vty
), &as
);
2411 if (ret
== BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
)
2413 vty_out (vty
, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external%s", as
, VTY_NEWLINE
);
2417 return bgp_vty_return (vty
, ret
);
2420 DEFUN (no_neighbor_set_peer_group
,
2421 no_neighbor_set_peer_group_cmd
,
2422 NO_NEIGHBOR_CMD2
"peer-group WORD",
2426 "Member of the peer-group\n"
2427 "peer-group name\n")
2432 struct peer_group
*group
;
2436 peer
= peer_lookup_vty (vty
, argv
[0]);
2440 group
= peer_group_lookup (bgp
, argv
[1]);
2443 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
2447 ret
= peer_group_unbind (bgp
, peer
, group
, bgp_node_afi (vty
),
2448 bgp_node_safi (vty
));
2450 return bgp_vty_return (vty
, ret
);
2454 peer_flag_modify_vty (struct vty
*vty
, const char *ip_str
,
2455 u_int16_t flag
, int set
)
2460 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2465 ret
= peer_flag_set (peer
, flag
);
2467 ret
= peer_flag_unset (peer
, flag
);
2469 return bgp_vty_return (vty
, ret
);
2473 peer_flag_set_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
2475 return peer_flag_modify_vty (vty
, ip_str
, flag
, 1);
2479 peer_flag_unset_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
2481 return peer_flag_modify_vty (vty
, ip_str
, flag
, 0);
2484 /* neighbor passive. */
2485 DEFUN (neighbor_passive
,
2486 neighbor_passive_cmd
,
2487 NEIGHBOR_CMD2
"passive",
2490 "Don't send open messages to this neighbor\n")
2492 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
2495 DEFUN (no_neighbor_passive
,
2496 no_neighbor_passive_cmd
,
2497 NO_NEIGHBOR_CMD2
"passive",
2501 "Don't send open messages to this neighbor\n")
2503 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
2506 /* neighbor shutdown. */
2507 DEFUN (neighbor_shutdown
,
2508 neighbor_shutdown_cmd
,
2509 NEIGHBOR_CMD2
"shutdown",
2512 "Administratively shut down this neighbor\n")
2514 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
2517 DEFUN (no_neighbor_shutdown
,
2518 no_neighbor_shutdown_cmd
,
2519 NO_NEIGHBOR_CMD2
"shutdown",
2523 "Administratively shut down this neighbor\n")
2525 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
2529 DEFUN (neighbor_bfd
,
2531 NEIGHBOR_CMD2
"bfd",
2534 "Respond to BFD session event\n")
2536 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_BFD
);
2539 DEFUN (no_neighbor_bfd
,
2540 no_neighbor_bfd_cmd
,
2541 NO_NEIGHBOR_CMD2
"bfd",
2545 "Respond to BFD session event\n")
2547 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_BFD
);
2550 /* Deprecated neighbor capability route-refresh. */
2551 DEFUN_DEPRECATED (neighbor_capability_route_refresh
,
2552 neighbor_capability_route_refresh_cmd
,
2553 NEIGHBOR_CMD2
"capability route-refresh",
2556 "Advertise capability to the peer\n"
2557 "Advertise route-refresh capability to this neighbor\n")
2562 DEFUN_DEPRECATED (no_neighbor_capability_route_refresh
,
2563 no_neighbor_capability_route_refresh_cmd
,
2564 NO_NEIGHBOR_CMD2
"capability route-refresh",
2568 "Advertise capability to the peer\n"
2569 "Advertise route-refresh capability to this neighbor\n")
2574 /* neighbor capability dynamic. */
2575 DEFUN (neighbor_capability_dynamic
,
2576 neighbor_capability_dynamic_cmd
,
2577 NEIGHBOR_CMD2
"capability dynamic",
2580 "Advertise capability to the peer\n"
2581 "Advertise dynamic capability to this neighbor\n")
2583 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
2586 DEFUN (no_neighbor_capability_dynamic
,
2587 no_neighbor_capability_dynamic_cmd
,
2588 NO_NEIGHBOR_CMD2
"capability dynamic",
2592 "Advertise capability to the peer\n"
2593 "Advertise dynamic capability to this neighbor\n")
2595 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
2598 /* neighbor dont-capability-negotiate */
2599 DEFUN (neighbor_dont_capability_negotiate
,
2600 neighbor_dont_capability_negotiate_cmd
,
2601 NEIGHBOR_CMD2
"dont-capability-negotiate",
2604 "Do not perform capability negotiation\n")
2606 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
2609 DEFUN (no_neighbor_dont_capability_negotiate
,
2610 no_neighbor_dont_capability_negotiate_cmd
,
2611 NO_NEIGHBOR_CMD2
"dont-capability-negotiate",
2615 "Do not perform capability negotiation\n")
2617 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
2621 peer_af_flag_modify_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
2622 safi_t safi
, u_int32_t flag
, int set
)
2627 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2632 ret
= peer_af_flag_set (peer
, afi
, safi
, flag
);
2634 ret
= peer_af_flag_unset (peer
, afi
, safi
, flag
);
2636 return bgp_vty_return (vty
, ret
);
2640 peer_af_flag_set_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
2641 safi_t safi
, u_int32_t flag
)
2643 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 1);
2647 peer_af_flag_unset_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
2648 safi_t safi
, u_int32_t flag
)
2650 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 0);
2653 /* neighbor capability orf prefix-list. */
2654 DEFUN (neighbor_capability_orf_prefix
,
2655 neighbor_capability_orf_prefix_cmd
,
2656 NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
2659 "Advertise capability to the peer\n"
2660 "Advertise ORF capability to the peer\n"
2661 "Advertise prefixlist ORF capability to this neighbor\n"
2662 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
2663 "Capability to RECEIVE the ORF from this neighbor\n"
2664 "Capability to SEND the ORF to this neighbor\n")
2668 if (strncmp (argv
[1], "s", 1) == 0)
2669 flag
= PEER_FLAG_ORF_PREFIX_SM
;
2670 else if (strncmp (argv
[1], "r", 1) == 0)
2671 flag
= PEER_FLAG_ORF_PREFIX_RM
;
2672 else if (strncmp (argv
[1], "b", 1) == 0)
2673 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
2677 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2678 bgp_node_safi (vty
), flag
);
2681 DEFUN (no_neighbor_capability_orf_prefix
,
2682 no_neighbor_capability_orf_prefix_cmd
,
2683 NO_NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
2687 "Advertise capability to the peer\n"
2688 "Advertise ORF capability to the peer\n"
2689 "Advertise prefixlist ORF capability to this neighbor\n"
2690 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
2691 "Capability to RECEIVE the ORF from this neighbor\n"
2692 "Capability to SEND the ORF to this neighbor\n")
2696 if (strncmp (argv
[1], "s", 1) == 0)
2697 flag
= PEER_FLAG_ORF_PREFIX_SM
;
2698 else if (strncmp (argv
[1], "r", 1) == 0)
2699 flag
= PEER_FLAG_ORF_PREFIX_RM
;
2700 else if (strncmp (argv
[1], "b", 1) == 0)
2701 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
2705 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2706 bgp_node_safi (vty
), flag
);
2709 /* neighbor next-hop-self. */
2710 DEFUN (neighbor_nexthop_self
,
2711 neighbor_nexthop_self_cmd
,
2712 NEIGHBOR_CMD2
"next-hop-self {all}",
2715 "Disable the next hop calculation for this neighbor\n"
2716 "Apply also to ibgp-learned routes when acting as a route reflector\n")
2718 u_int32_t flags
= PEER_FLAG_NEXTHOP_SELF
, unset
= 0;
2721 /* Check if "all" is specified */
2722 if (argv
[1] != NULL
)
2723 flags
|= PEER_FLAG_NEXTHOP_SELF_ALL
;
2725 unset
|= PEER_FLAG_NEXTHOP_SELF_ALL
;
2727 rc
= peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2728 bgp_node_safi (vty
), flags
);
2729 if ( rc
== CMD_SUCCESS
&& unset
)
2730 rc
= peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2731 bgp_node_safi (vty
), unset
);
2735 DEFUN (no_neighbor_nexthop_self
,
2736 no_neighbor_nexthop_self_cmd
,
2737 NO_NEIGHBOR_CMD2
"next-hop-self {all}",
2741 "Disable the next hop calculation for this neighbor\n"
2742 "Apply also to ibgp-learned routes when acting as a route reflector\n")
2744 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2745 bgp_node_safi (vty
),
2746 PEER_FLAG_NEXTHOP_SELF
|PEER_FLAG_NEXTHOP_SELF_ALL
);
2749 /* neighbor as-override */
2750 DEFUN (neighbor_as_override
,
2751 neighbor_as_override_cmd
,
2752 NEIGHBOR_CMD2
"as-override",
2755 "Override ASNs in outbound updates if aspath equals remote-as\n")
2757 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2758 bgp_node_safi (vty
),
2759 PEER_FLAG_AS_OVERRIDE
);
2762 DEFUN (no_neighbor_as_override
,
2763 no_neighbor_as_override_cmd
,
2764 NO_NEIGHBOR_CMD2
"as-override",
2768 "Override ASNs in outbound updates if aspath equals remote-as\n")
2770 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2771 bgp_node_safi (vty
),
2772 PEER_FLAG_AS_OVERRIDE
);
2775 /* neighbor remove-private-AS. */
2776 DEFUN (neighbor_remove_private_as
,
2777 neighbor_remove_private_as_cmd
,
2778 NEIGHBOR_CMD2
"remove-private-AS",
2781 "Remove private ASNs in outbound updates\n")
2783 peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2784 bgp_node_safi (vty
),
2785 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
|
2786 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
2787 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2788 bgp_node_safi (vty
),
2789 PEER_FLAG_REMOVE_PRIVATE_AS
);
2792 DEFUN (neighbor_remove_private_as_all
,
2793 neighbor_remove_private_as_all_cmd
,
2794 NEIGHBOR_CMD2
"remove-private-AS all",
2797 "Remove private ASNs in outbound updates\n"
2798 "Apply to all AS numbers")
2800 peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2801 bgp_node_safi (vty
),
2802 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
2803 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2804 bgp_node_safi (vty
),
2805 PEER_FLAG_REMOVE_PRIVATE_AS
|
2806 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
);
2809 DEFUN (neighbor_remove_private_as_replace_as
,
2810 neighbor_remove_private_as_replace_as_cmd
,
2811 NEIGHBOR_CMD2
"remove-private-AS replace-AS",
2814 "Remove private ASNs in outbound updates\n"
2815 "Replace private ASNs with our ASN in outbound updates\n")
2817 peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2818 bgp_node_safi (vty
),
2819 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
);
2820 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2821 bgp_node_safi (vty
),
2822 PEER_FLAG_REMOVE_PRIVATE_AS
|
2823 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
2826 DEFUN (neighbor_remove_private_as_all_replace_as
,
2827 neighbor_remove_private_as_all_replace_as_cmd
,
2828 NEIGHBOR_CMD2
"remove-private-AS all replace-AS",
2831 "Remove private ASNs in outbound updates\n"
2832 "Apply to all AS numbers"
2833 "Replace private ASNs with our ASN in outbound updates\n")
2835 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2836 bgp_node_safi (vty
),
2837 PEER_FLAG_REMOVE_PRIVATE_AS
|
2838 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
|
2839 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
2842 DEFUN (no_neighbor_remove_private_as
,
2843 no_neighbor_remove_private_as_cmd
,
2844 NO_NEIGHBOR_CMD2
"remove-private-AS",
2848 "Remove private ASNs in outbound updates\n")
2850 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2851 bgp_node_safi (vty
),
2852 PEER_FLAG_REMOVE_PRIVATE_AS
|
2853 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
|
2854 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
2857 ALIAS (no_neighbor_remove_private_as
,
2858 no_neighbor_remove_private_as_all_cmd
,
2859 NO_NEIGHBOR_CMD2
"remove-private-AS all",
2863 "Remove private ASNs in outbound updates\n"
2864 "Apply to all AS numbers")
2866 ALIAS (no_neighbor_remove_private_as
,
2867 no_neighbor_remove_private_as_replace_as_cmd
,
2868 NO_NEIGHBOR_CMD2
"remove-private-AS replace-AS",
2872 "Remove private ASNs in outbound updates\n"
2873 "Replace private ASNs with our ASN in outbound updates\n")
2875 ALIAS (no_neighbor_remove_private_as
,
2876 no_neighbor_remove_private_as_all_replace_as_cmd
,
2877 NO_NEIGHBOR_CMD2
"remove-private-AS all replace-AS",
2881 "Remove private ASNs in outbound updates\n"
2882 "Apply to all AS numbers"
2883 "Replace private ASNs with our ASN in outbound updates\n")
2886 /* neighbor send-community. */
2887 DEFUN (neighbor_send_community
,
2888 neighbor_send_community_cmd
,
2889 NEIGHBOR_CMD2
"send-community",
2892 "Send Community attribute to this neighbor\n")
2894 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2895 bgp_node_safi (vty
),
2896 PEER_FLAG_SEND_COMMUNITY
);
2899 DEFUN (no_neighbor_send_community
,
2900 no_neighbor_send_community_cmd
,
2901 NO_NEIGHBOR_CMD2
"send-community",
2905 "Send Community attribute to this neighbor\n")
2907 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2908 bgp_node_safi (vty
),
2909 PEER_FLAG_SEND_COMMUNITY
);
2912 /* neighbor send-community extended. */
2913 DEFUN (neighbor_send_community_type
,
2914 neighbor_send_community_type_cmd
,
2915 NEIGHBOR_CMD2
"send-community (both|extended|standard)",
2918 "Send Community attribute to this neighbor\n"
2919 "Send Standard and Extended Community attributes\n"
2920 "Send Extended Community attributes\n"
2921 "Send Standard Community attributes\n")
2923 if (strncmp (argv
[1], "s", 1) == 0)
2924 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2925 bgp_node_safi (vty
),
2926 PEER_FLAG_SEND_COMMUNITY
);
2927 if (strncmp (argv
[1], "e", 1) == 0)
2928 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2929 bgp_node_safi (vty
),
2930 PEER_FLAG_SEND_EXT_COMMUNITY
);
2932 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2933 bgp_node_safi (vty
),
2934 (PEER_FLAG_SEND_COMMUNITY
|
2935 PEER_FLAG_SEND_EXT_COMMUNITY
));
2938 DEFUN (no_neighbor_send_community_type
,
2939 no_neighbor_send_community_type_cmd
,
2940 NO_NEIGHBOR_CMD2
"send-community (both|extended|standard)",
2944 "Send Community attribute to this neighbor\n"
2945 "Send Standard and Extended Community attributes\n"
2946 "Send Extended Community attributes\n"
2947 "Send Standard Community attributes\n")
2949 if (strncmp (argv
[1], "s", 1) == 0)
2950 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2951 bgp_node_safi (vty
),
2952 PEER_FLAG_SEND_COMMUNITY
);
2953 if (strncmp (argv
[1], "e", 1) == 0)
2954 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2955 bgp_node_safi (vty
),
2956 PEER_FLAG_SEND_EXT_COMMUNITY
);
2958 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2959 bgp_node_safi (vty
),
2960 (PEER_FLAG_SEND_COMMUNITY
|
2961 PEER_FLAG_SEND_EXT_COMMUNITY
));
2964 /* neighbor soft-reconfig. */
2965 DEFUN (neighbor_soft_reconfiguration
,
2966 neighbor_soft_reconfiguration_cmd
,
2967 NEIGHBOR_CMD2
"soft-reconfiguration inbound",
2970 "Per neighbor soft reconfiguration\n"
2971 "Allow inbound soft reconfiguration for this neighbor\n")
2973 return peer_af_flag_set_vty (vty
, argv
[0],
2974 bgp_node_afi (vty
), bgp_node_safi (vty
),
2975 PEER_FLAG_SOFT_RECONFIG
);
2978 DEFUN (no_neighbor_soft_reconfiguration
,
2979 no_neighbor_soft_reconfiguration_cmd
,
2980 NO_NEIGHBOR_CMD2
"soft-reconfiguration inbound",
2984 "Per neighbor soft reconfiguration\n"
2985 "Allow inbound soft reconfiguration for this neighbor\n")
2987 return peer_af_flag_unset_vty (vty
, argv
[0],
2988 bgp_node_afi (vty
), bgp_node_safi (vty
),
2989 PEER_FLAG_SOFT_RECONFIG
);
2992 DEFUN (neighbor_route_reflector_client
,
2993 neighbor_route_reflector_client_cmd
,
2994 NEIGHBOR_CMD2
"route-reflector-client",
2997 "Configure a neighbor as Route Reflector client\n")
3002 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3006 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3007 bgp_node_safi (vty
),
3008 PEER_FLAG_REFLECTOR_CLIENT
);
3011 DEFUN (no_neighbor_route_reflector_client
,
3012 no_neighbor_route_reflector_client_cmd
,
3013 NO_NEIGHBOR_CMD2
"route-reflector-client",
3017 "Configure a neighbor as Route Reflector client\n")
3019 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3020 bgp_node_safi (vty
),
3021 PEER_FLAG_REFLECTOR_CLIENT
);
3025 peer_rsclient_set_vty (struct vty
*vty
, const char *peer_str
,
3031 struct peer_group
*group
;
3032 struct listnode
*node
, *nnode
;
3033 struct bgp_filter
*pfilter
;
3034 struct bgp_filter
*gfilter
;
3035 int locked_and_added
= 0;
3039 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3043 /* If it is already a RS-Client, don't do anything. */
3044 if ( CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
3047 if ( ! peer_rsclient_active (peer
) )
3049 peer
= peer_lock (peer
); /* rsclient peer list reference */
3050 listnode_add_sort (bgp
->rsclient
, peer
);
3051 locked_and_added
= 1;
3054 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
3057 if (locked_and_added
)
3059 listnode_delete (bgp
->rsclient
, peer
);
3060 peer_unlock (peer
); /* rsclient peer list reference */
3063 return bgp_vty_return (vty
, ret
);
3066 peer
->rib
[afi
][safi
] = bgp_table_init (afi
, safi
);
3067 peer
->rib
[afi
][safi
]->type
= BGP_TABLE_RSCLIENT
;
3068 /* RIB peer reference. Released when table is free'd in bgp_table_free. */
3069 peer
->rib
[afi
][safi
]->owner
= peer_lock (peer
);
3071 /* Check for existing 'network' and 'redistribute' routes. */
3072 bgp_check_local_routes_rsclient (peer
, afi
, safi
);
3074 /* Check for routes for peers configured with 'soft-reconfiguration'. */
3075 bgp_soft_reconfig_rsclient (peer
, afi
, safi
);
3077 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
3079 group
= peer
->group
;
3080 gfilter
= &peer
->filter
[afi
][safi
];
3082 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
3084 pfilter
= &peer
->filter
[afi
][safi
];
3086 /* Members of a non-RS-Client group should not be RS-Clients, as that
3087 is checked when the become part of the peer-group */
3088 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
3090 return bgp_vty_return (vty
, ret
);
3092 /* Make peer's RIB point to group's RIB. */
3093 peer
->rib
[afi
][safi
] = group
->conf
->rib
[afi
][safi
];
3095 /* Import policy. */
3096 if (pfilter
->map
[RMAP_IMPORT
].name
)
3097 free (pfilter
->map
[RMAP_IMPORT
].name
);
3098 if (gfilter
->map
[RMAP_IMPORT
].name
)
3100 pfilter
->map
[RMAP_IMPORT
].name
= strdup (gfilter
->map
[RMAP_IMPORT
].name
);
3101 pfilter
->map
[RMAP_IMPORT
].map
= gfilter
->map
[RMAP_IMPORT
].map
;
3105 pfilter
->map
[RMAP_IMPORT
].name
= NULL
;
3106 pfilter
->map
[RMAP_IMPORT
].map
=NULL
;
3109 /* Export policy. */
3110 if (gfilter
->map
[RMAP_EXPORT
].name
&& ! pfilter
->map
[RMAP_EXPORT
].name
)
3112 pfilter
->map
[RMAP_EXPORT
].name
= strdup (gfilter
->map
[RMAP_EXPORT
].name
);
3113 pfilter
->map
[RMAP_EXPORT
].map
= gfilter
->map
[RMAP_EXPORT
].map
;
3121 peer_rsclient_unset_vty (struct vty
*vty
, const char *peer_str
,
3127 struct peer_group
*group
;
3128 struct listnode
*node
, *nnode
;
3132 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3136 /* If it is not a RS-Client, don't do anything. */
3137 if ( ! CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
3140 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
3142 group
= peer
->group
;
3144 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
3146 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
3148 return bgp_vty_return (vty
, ret
);
3150 peer
->rib
[afi
][safi
] = NULL
;
3156 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
3158 return bgp_vty_return (vty
, ret
);
3160 if ( ! peer_rsclient_active (peer
) )
3162 bgp_clear_route (peer
, afi
, safi
, BGP_CLEAR_ROUTE_MY_RSCLIENT
);
3163 listnode_delete (bgp
->rsclient
, peer
);
3164 peer_unlock (peer
); /* peer bgp rsclient reference */
3167 bgp_table_finish (&peer
->rib
[bgp_node_afi(vty
)][bgp_node_safi(vty
)]);
3172 /* neighbor route-server-client. */
3173 DEFUN (neighbor_route_server_client
,
3174 neighbor_route_server_client_cmd
,
3175 NEIGHBOR_CMD2
"route-server-client",
3178 "Configure a neighbor as Route Server client\n")
3180 return peer_rsclient_set_vty (vty
, argv
[0], bgp_node_afi(vty
),
3181 bgp_node_safi(vty
));
3184 DEFUN (no_neighbor_route_server_client
,
3185 no_neighbor_route_server_client_cmd
,
3186 NO_NEIGHBOR_CMD2
"route-server-client",
3190 "Configure a neighbor as Route Server client\n")
3192 return peer_rsclient_unset_vty (vty
, argv
[0], bgp_node_afi(vty
),
3193 bgp_node_safi(vty
));
3196 DEFUN (neighbor_nexthop_local_unchanged
,
3197 neighbor_nexthop_local_unchanged_cmd
,
3198 NEIGHBOR_CMD2
"nexthop-local unchanged",
3201 "Configure treatment of outgoing link-local nexthop attribute\n"
3202 "Leave link-local nexthop unchanged for this peer\n")
3204 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3205 bgp_node_safi (vty
),
3206 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
3209 DEFUN (no_neighbor_nexthop_local_unchanged
,
3210 no_neighbor_nexthop_local_unchanged_cmd
,
3211 NO_NEIGHBOR_CMD2
"nexthop-local unchanged",
3215 "Configure treatment of outgoing link-local-nexthop attribute\n"
3216 "Leave link-local nexthop unchanged for this peer\n")
3218 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3219 bgp_node_safi (vty
),
3220 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
3223 DEFUN (neighbor_attr_unchanged
,
3224 neighbor_attr_unchanged_cmd
,
3225 NEIGHBOR_CMD2
"attribute-unchanged",
3228 "BGP attribute is propagated unchanged to this neighbor\n")
3230 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3231 bgp_node_safi (vty
),
3232 (PEER_FLAG_AS_PATH_UNCHANGED
|
3233 PEER_FLAG_NEXTHOP_UNCHANGED
|
3234 PEER_FLAG_MED_UNCHANGED
));
3237 DEFUN (neighbor_attr_unchanged1
,
3238 neighbor_attr_unchanged1_cmd
,
3239 NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
3242 "BGP attribute is propagated unchanged to this neighbor\n"
3243 "As-path attribute\n"
3244 "Nexthop attribute\n"
3247 u_int16_t flags
= 0;
3249 if (strncmp (argv
[1], "as-path", 1) == 0)
3250 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
3251 else if (strncmp (argv
[1], "next-hop", 1) == 0)
3252 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
3253 else if (strncmp (argv
[1], "med", 1) == 0)
3254 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
3256 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3257 bgp_node_safi (vty
), flags
);
3260 DEFUN (neighbor_attr_unchanged2
,
3261 neighbor_attr_unchanged2_cmd
,
3262 NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
3265 "BGP attribute is propagated unchanged to this neighbor\n"
3266 "As-path attribute\n"
3267 "Nexthop attribute\n"
3270 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
3272 if (strncmp (argv
[1], "next-hop", 1) == 0)
3273 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
3274 else if (strncmp (argv
[1], "med", 1) == 0)
3275 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
3277 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3278 bgp_node_safi (vty
), flags
);
3282 DEFUN (neighbor_attr_unchanged3
,
3283 neighbor_attr_unchanged3_cmd
,
3284 NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
3287 "BGP attribute is propagated unchanged to this neighbor\n"
3288 "Nexthop attribute\n"
3289 "As-path attribute\n"
3292 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
3294 if (strncmp (argv
[1], "as-path", 1) == 0)
3295 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
3296 else if (strncmp (argv
[1], "med", 1) == 0)
3297 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
3299 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3300 bgp_node_safi (vty
), flags
);
3303 DEFUN (neighbor_attr_unchanged4
,
3304 neighbor_attr_unchanged4_cmd
,
3305 NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
3308 "BGP attribute is propagated unchanged to this neighbor\n"
3310 "As-path attribute\n"
3311 "Nexthop attribute\n")
3313 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
3315 if (strncmp (argv
[1], "as-path", 1) == 0)
3316 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
3317 else if (strncmp (argv
[1], "next-hop", 1) == 0)
3318 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
3320 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3321 bgp_node_safi (vty
), flags
);
3324 ALIAS (neighbor_attr_unchanged
,
3325 neighbor_attr_unchanged5_cmd
,
3326 NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
3329 "BGP attribute is propagated unchanged to this neighbor\n"
3330 "As-path attribute\n"
3331 "Nexthop attribute\n"
3334 ALIAS (neighbor_attr_unchanged
,
3335 neighbor_attr_unchanged6_cmd
,
3336 NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
3339 "BGP attribute is propagated unchanged to this neighbor\n"
3340 "As-path attribute\n"
3342 "Nexthop attribute\n")
3344 ALIAS (neighbor_attr_unchanged
,
3345 neighbor_attr_unchanged7_cmd
,
3346 NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
3349 "BGP attribute is propagated unchanged to this neighbor\n"
3350 "Nexthop attribute\n"
3352 "As-path attribute\n")
3354 ALIAS (neighbor_attr_unchanged
,
3355 neighbor_attr_unchanged8_cmd
,
3356 NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
3359 "BGP attribute is propagated unchanged to this neighbor\n"
3360 "Nexthop attribute\n"
3361 "As-path attribute\n"
3364 ALIAS (neighbor_attr_unchanged
,
3365 neighbor_attr_unchanged9_cmd
,
3366 NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
3369 "BGP attribute is propagated unchanged to this neighbor\n"
3371 "Nexthop attribute\n"
3372 "As-path attribute\n")
3374 ALIAS (neighbor_attr_unchanged
,
3375 neighbor_attr_unchanged10_cmd
,
3376 NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
3379 "BGP attribute is propagated unchanged to this neighbor\n"
3381 "As-path attribute\n"
3382 "Nexthop attribute\n")
3384 DEFUN (no_neighbor_attr_unchanged
,
3385 no_neighbor_attr_unchanged_cmd
,
3386 NO_NEIGHBOR_CMD2
"attribute-unchanged",
3390 "BGP attribute is propagated unchanged to this neighbor\n")
3392 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3393 bgp_node_safi (vty
),
3394 (PEER_FLAG_AS_PATH_UNCHANGED
|
3395 PEER_FLAG_NEXTHOP_UNCHANGED
|
3396 PEER_FLAG_MED_UNCHANGED
));
3399 DEFUN (no_neighbor_attr_unchanged1
,
3400 no_neighbor_attr_unchanged1_cmd
,
3401 NO_NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
3405 "BGP attribute is propagated unchanged to this neighbor\n"
3406 "As-path attribute\n"
3407 "Nexthop attribute\n"
3410 u_int16_t flags
= 0;
3412 if (strncmp (argv
[1], "as-path", 1) == 0)
3413 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
3414 else if (strncmp (argv
[1], "next-hop", 1) == 0)
3415 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
3416 else if (strncmp (argv
[1], "med", 1) == 0)
3417 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
3419 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3420 bgp_node_safi (vty
), flags
);
3423 DEFUN (no_neighbor_attr_unchanged2
,
3424 no_neighbor_attr_unchanged2_cmd
,
3425 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
3429 "BGP attribute is propagated unchanged to this neighbor\n"
3430 "As-path attribute\n"
3431 "Nexthop attribute\n"
3434 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
3436 if (strncmp (argv
[1], "next-hop", 1) == 0)
3437 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
3438 else if (strncmp (argv
[1], "med", 1) == 0)
3439 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
3441 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3442 bgp_node_safi (vty
), flags
);
3445 DEFUN (no_neighbor_attr_unchanged3
,
3446 no_neighbor_attr_unchanged3_cmd
,
3447 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
3451 "BGP attribute is propagated unchanged to this neighbor\n"
3452 "Nexthop attribute\n"
3453 "As-path attribute\n"
3456 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
3458 if (strncmp (argv
[1], "as-path", 1) == 0)
3459 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
3460 else if (strncmp (argv
[1], "med", 1) == 0)
3461 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
3463 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3464 bgp_node_safi (vty
), flags
);
3467 DEFUN (no_neighbor_attr_unchanged4
,
3468 no_neighbor_attr_unchanged4_cmd
,
3469 NO_NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
3473 "BGP attribute is propagated unchanged to this neighbor\n"
3475 "As-path attribute\n"
3476 "Nexthop attribute\n")
3478 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
3480 if (strncmp (argv
[1], "as-path", 1) == 0)
3481 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
3482 else if (strncmp (argv
[1], "next-hop", 1) == 0)
3483 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
3485 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3486 bgp_node_safi (vty
), flags
);
3489 ALIAS (no_neighbor_attr_unchanged
,
3490 no_neighbor_attr_unchanged5_cmd
,
3491 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
3495 "BGP attribute is propagated unchanged to this neighbor\n"
3496 "As-path attribute\n"
3497 "Nexthop attribute\n"
3500 ALIAS (no_neighbor_attr_unchanged
,
3501 no_neighbor_attr_unchanged6_cmd
,
3502 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
3506 "BGP attribute is propagated unchanged to this neighbor\n"
3507 "As-path attribute\n"
3509 "Nexthop attribute\n")
3511 ALIAS (no_neighbor_attr_unchanged
,
3512 no_neighbor_attr_unchanged7_cmd
,
3513 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
3517 "BGP attribute is propagated unchanged to this neighbor\n"
3518 "Nexthop attribute\n"
3520 "As-path attribute\n")
3522 ALIAS (no_neighbor_attr_unchanged
,
3523 no_neighbor_attr_unchanged8_cmd
,
3524 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
3528 "BGP attribute is propagated unchanged to this neighbor\n"
3529 "Nexthop attribute\n"
3530 "As-path attribute\n"
3533 ALIAS (no_neighbor_attr_unchanged
,
3534 no_neighbor_attr_unchanged9_cmd
,
3535 NO_NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
3539 "BGP attribute is propagated unchanged to this neighbor\n"
3541 "Nexthop attribute\n"
3542 "As-path attribute\n")
3544 ALIAS (no_neighbor_attr_unchanged
,
3545 no_neighbor_attr_unchanged10_cmd
,
3546 NO_NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
3550 "BGP attribute is propagated unchanged to this neighbor\n"
3552 "As-path attribute\n"
3553 "Nexthop attribute\n")
3555 /* For old version Zebra compatibility. */
3556 DEFUN_DEPRECATED (neighbor_transparent_as
,
3557 neighbor_transparent_as_cmd
,
3558 NEIGHBOR_CMD
"transparent-as",
3561 "Do not append my AS number even peer is EBGP peer\n")
3563 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3564 bgp_node_safi (vty
),
3565 PEER_FLAG_AS_PATH_UNCHANGED
);
3568 DEFUN_DEPRECATED (neighbor_transparent_nexthop
,
3569 neighbor_transparent_nexthop_cmd
,
3570 NEIGHBOR_CMD
"transparent-nexthop",
3573 "Do not change nexthop even peer is EBGP peer\n")
3575 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3576 bgp_node_safi (vty
),
3577 PEER_FLAG_NEXTHOP_UNCHANGED
);
3580 /* EBGP multihop configuration. */
3582 peer_ebgp_multihop_set_vty (struct vty
*vty
, const char *ip_str
,
3583 const char *ttl_str
)
3588 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3595 VTY_GET_INTEGER_RANGE ("TTL", ttl
, ttl_str
, 1, 255);
3597 return bgp_vty_return (vty
, peer_ebgp_multihop_set (peer
, ttl
));
3601 peer_ebgp_multihop_unset_vty (struct vty
*vty
, const char *ip_str
)
3605 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3609 return bgp_vty_return (vty
, peer_ebgp_multihop_unset (peer
));
3612 /* neighbor ebgp-multihop. */
3613 DEFUN (neighbor_ebgp_multihop
,
3614 neighbor_ebgp_multihop_cmd
,
3615 NEIGHBOR_CMD2
"ebgp-multihop",
3618 "Allow EBGP neighbors not on directly connected networks\n")
3620 return peer_ebgp_multihop_set_vty (vty
, argv
[0], NULL
);
3623 DEFUN (neighbor_ebgp_multihop_ttl
,
3624 neighbor_ebgp_multihop_ttl_cmd
,
3625 NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
3628 "Allow EBGP neighbors not on directly connected networks\n"
3629 "maximum hop count\n")
3631 return peer_ebgp_multihop_set_vty (vty
, argv
[0], argv
[1]);
3634 DEFUN (no_neighbor_ebgp_multihop
,
3635 no_neighbor_ebgp_multihop_cmd
,
3636 NO_NEIGHBOR_CMD2
"ebgp-multihop",
3640 "Allow EBGP neighbors not on directly connected networks\n")
3642 return peer_ebgp_multihop_unset_vty (vty
, argv
[0]);
3645 ALIAS (no_neighbor_ebgp_multihop
,
3646 no_neighbor_ebgp_multihop_ttl_cmd
,
3647 NO_NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
3651 "Allow EBGP neighbors not on directly connected networks\n"
3652 "maximum hop count\n")
3654 /* disable-connected-check */
3655 DEFUN (neighbor_disable_connected_check
,
3656 neighbor_disable_connected_check_cmd
,
3657 NEIGHBOR_CMD2
"disable-connected-check",
3660 "one-hop away EBGP peer using loopback address\n")
3662 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
3665 DEFUN (no_neighbor_disable_connected_check
,
3666 no_neighbor_disable_connected_check_cmd
,
3667 NO_NEIGHBOR_CMD2
"disable-connected-check",
3671 "one-hop away EBGP peer using loopback address\n")
3673 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
3676 /* Enforce multihop. */
3677 ALIAS (neighbor_disable_connected_check
,
3678 neighbor_enforce_multihop_cmd
,
3679 NEIGHBOR_CMD2
"enforce-multihop",
3682 "Enforce EBGP neighbors perform multihop\n")
3684 /* Enforce multihop. */
3685 ALIAS (no_neighbor_disable_connected_check
,
3686 no_neighbor_enforce_multihop_cmd
,
3687 NO_NEIGHBOR_CMD2
"enforce-multihop",
3691 "Enforce EBGP neighbors perform multihop\n")
3693 DEFUN (neighbor_description
,
3694 neighbor_description_cmd
,
3695 NEIGHBOR_CMD2
"description .LINE",
3698 "Neighbor specific description\n"
3699 "Up to 80 characters describing this neighbor\n")
3704 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3711 str
= argv_concat(argv
, argc
, 1);
3713 peer_description_set (peer
, str
);
3715 XFREE (MTYPE_TMP
, str
);
3720 DEFUN (no_neighbor_description
,
3721 no_neighbor_description_cmd
,
3722 NO_NEIGHBOR_CMD2
"description",
3726 "Neighbor specific description\n")
3730 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3734 peer_description_unset (peer
);
3739 ALIAS (no_neighbor_description
,
3740 no_neighbor_description_val_cmd
,
3741 NO_NEIGHBOR_CMD2
"description .LINE",
3745 "Neighbor specific description\n"
3746 "Up to 80 characters describing this neighbor\n")
3748 /* Neighbor update-source. */
3750 peer_update_source_vty (struct vty
*vty
, const char *peer_str
,
3751 const char *source_str
)
3755 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3765 int ret
= str2sockunion (source_str
, &su
);
3768 peer_update_source_addr_set (peer
, &su
);
3770 peer_update_source_if_set (peer
, source_str
);
3773 peer_update_source_unset (peer
);
3778 #define BGP_UPDATE_SOURCE_STR "(A.B.C.D|X:X::X:X|WORD)"
3779 #define BGP_UPDATE_SOURCE_HELP_STR \
3782 "Interface name (requires zebra to be running)\n"
3784 DEFUN (neighbor_update_source
,
3785 neighbor_update_source_cmd
,
3786 NEIGHBOR_CMD2
"update-source " BGP_UPDATE_SOURCE_STR
,
3789 "Source of routing updates\n"
3790 BGP_UPDATE_SOURCE_HELP_STR
)
3792 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
3795 DEFUN (no_neighbor_update_source
,
3796 no_neighbor_update_source_cmd
,
3797 NO_NEIGHBOR_CMD2
"update-source",
3801 "Source of routing updates\n")
3803 return peer_update_source_vty (vty
, argv
[0], NULL
);
3807 peer_default_originate_set_vty (struct vty
*vty
, const char *peer_str
,
3808 afi_t afi
, safi_t safi
,
3809 const char *rmap
, int set
)
3814 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3819 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
3821 ret
= peer_default_originate_unset (peer
, afi
, safi
);
3823 return bgp_vty_return (vty
, ret
);
3826 /* neighbor default-originate. */
3827 DEFUN (neighbor_default_originate
,
3828 neighbor_default_originate_cmd
,
3829 NEIGHBOR_CMD2
"default-originate",
3832 "Originate default route to this neighbor\n")
3834 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3835 bgp_node_safi (vty
), NULL
, 1);
3838 DEFUN (neighbor_default_originate_rmap
,
3839 neighbor_default_originate_rmap_cmd
,
3840 NEIGHBOR_CMD2
"default-originate route-map WORD",
3843 "Originate default route to this neighbor\n"
3844 "Route-map to specify criteria to originate default\n"
3847 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3848 bgp_node_safi (vty
), argv
[1], 1);
3851 DEFUN (no_neighbor_default_originate
,
3852 no_neighbor_default_originate_cmd
,
3853 NO_NEIGHBOR_CMD2
"default-originate",
3857 "Originate default route to this neighbor\n")
3859 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3860 bgp_node_safi (vty
), NULL
, 0);
3863 ALIAS (no_neighbor_default_originate
,
3864 no_neighbor_default_originate_rmap_cmd
,
3865 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
3869 "Originate default route to this neighbor\n"
3870 "Route-map to specify criteria to originate default\n"
3873 /* Set neighbor's BGP port. */
3875 peer_port_vty (struct vty
*vty
, const char *ip_str
, int afi
,
3876 const char *port_str
)
3882 peer
= peer_lookup_vty (vty
, ip_str
);
3888 sp
= getservbyname ("bgp", "tcp");
3889 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
3893 VTY_GET_INTEGER("port", port
, port_str
);
3896 peer_port_set (peer
, port
);
3901 /* Set specified peer's BGP port. */
3902 DEFUN (neighbor_port
,
3904 NEIGHBOR_CMD
"port <0-65535>",
3907 "Neighbor's BGP port\n"
3908 "TCP port number\n")
3910 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
3913 DEFUN (no_neighbor_port
,
3914 no_neighbor_port_cmd
,
3915 NO_NEIGHBOR_CMD
"port",
3919 "Neighbor's BGP port\n")
3921 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
3924 ALIAS (no_neighbor_port
,
3925 no_neighbor_port_val_cmd
,
3926 NO_NEIGHBOR_CMD
"port <0-65535>",
3930 "Neighbor's BGP port\n"
3931 "TCP port number\n")
3933 /* neighbor weight. */
3935 peer_weight_set_vty (struct vty
*vty
, const char *ip_str
,
3936 const char *weight_str
)
3940 unsigned long weight
;
3942 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3946 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
3948 ret
= peer_weight_set (peer
, weight
);
3954 peer_weight_unset_vty (struct vty
*vty
, const char *ip_str
)
3958 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3962 peer_weight_unset (peer
);
3967 DEFUN (neighbor_weight
,
3968 neighbor_weight_cmd
,
3969 NEIGHBOR_CMD2
"weight <0-65535>",
3972 "Set default weight for routes from this neighbor\n"
3975 return peer_weight_set_vty (vty
, argv
[0], argv
[1]);
3978 DEFUN (no_neighbor_weight
,
3979 no_neighbor_weight_cmd
,
3980 NO_NEIGHBOR_CMD2
"weight",
3984 "Set default weight for routes from this neighbor\n")
3986 return peer_weight_unset_vty (vty
, argv
[0]);
3989 ALIAS (no_neighbor_weight
,
3990 no_neighbor_weight_val_cmd
,
3991 NO_NEIGHBOR_CMD2
"weight <0-65535>",
3995 "Set default weight for routes from this neighbor\n"
3998 /* Override capability negotiation. */
3999 DEFUN (neighbor_override_capability
,
4000 neighbor_override_capability_cmd
,
4001 NEIGHBOR_CMD2
"override-capability",
4004 "Override capability negotiation result\n")
4006 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
4009 DEFUN (no_neighbor_override_capability
,
4010 no_neighbor_override_capability_cmd
,
4011 NO_NEIGHBOR_CMD2
"override-capability",
4015 "Override capability negotiation result\n")
4017 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
4020 DEFUN (neighbor_strict_capability
,
4021 neighbor_strict_capability_cmd
,
4022 NEIGHBOR_CMD
"strict-capability-match",
4025 "Strict capability negotiation match\n")
4027 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
4030 DEFUN (no_neighbor_strict_capability
,
4031 no_neighbor_strict_capability_cmd
,
4032 NO_NEIGHBOR_CMD
"strict-capability-match",
4036 "Strict capability negotiation match\n")
4038 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
4042 peer_timers_set_vty (struct vty
*vty
, const char *ip_str
,
4043 const char *keep_str
, const char *hold_str
)
4047 u_int32_t keepalive
;
4050 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4054 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
4055 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
4057 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
4059 return bgp_vty_return (vty
, ret
);
4063 peer_timers_unset_vty (struct vty
*vty
, const char *ip_str
)
4068 peer
= peer_lookup_vty (vty
, ip_str
);
4072 ret
= peer_timers_unset (peer
);
4074 return bgp_vty_return (vty
, ret
);
4077 DEFUN (neighbor_timers
,
4078 neighbor_timers_cmd
,
4079 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
4082 "BGP per neighbor timers\n"
4083 "Keepalive interval\n"
4086 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
4089 DEFUN (no_neighbor_timers
,
4090 no_neighbor_timers_cmd
,
4091 NO_NEIGHBOR_CMD2
"timers",
4095 "BGP per neighbor timers\n")
4097 return peer_timers_unset_vty (vty
, argv
[0]);
4101 peer_timers_connect_set_vty (struct vty
*vty
, const char *ip_str
,
4102 const char *time_str
)
4108 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4112 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
4114 ret
= peer_timers_connect_set (peer
, connect
);
4116 return bgp_vty_return (vty
, ret
);
4120 peer_timers_connect_unset_vty (struct vty
*vty
, const char *ip_str
)
4125 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4129 ret
= peer_timers_connect_unset (peer
);
4131 return bgp_vty_return (vty
, ret
);
4134 DEFUN (neighbor_timers_connect
,
4135 neighbor_timers_connect_cmd
,
4136 NEIGHBOR_CMD2
"timers connect <0-65535>",
4139 "BGP per neighbor timers\n"
4140 "BGP connect timer\n"
4143 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
4146 DEFUN (no_neighbor_timers_connect
,
4147 no_neighbor_timers_connect_cmd
,
4148 NO_NEIGHBOR_CMD2
"timers connect",
4152 "BGP per neighbor timers\n"
4153 "BGP connect timer\n")
4155 return peer_timers_connect_unset_vty (vty
, argv
[0]);
4158 ALIAS (no_neighbor_timers_connect
,
4159 no_neighbor_timers_connect_val_cmd
,
4160 NO_NEIGHBOR_CMD2
"timers connect <0-65535>",
4164 "BGP per neighbor timers\n"
4165 "BGP connect timer\n"
4169 peer_advertise_interval_vty (struct vty
*vty
, const char *ip_str
,
4170 const char *time_str
, int set
)
4174 u_int32_t routeadv
= 0;
4176 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4181 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
4184 ret
= peer_advertise_interval_set (peer
, routeadv
);
4186 ret
= peer_advertise_interval_unset (peer
);
4188 return bgp_vty_return (vty
, ret
);
4191 DEFUN (neighbor_advertise_interval
,
4192 neighbor_advertise_interval_cmd
,
4193 NEIGHBOR_CMD2
"advertisement-interval <0-600>",
4196 "Minimum interval between sending BGP routing updates\n"
4197 "time in seconds\n")
4199 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
4202 DEFUN (no_neighbor_advertise_interval
,
4203 no_neighbor_advertise_interval_cmd
,
4204 NO_NEIGHBOR_CMD2
"advertisement-interval",
4208 "Minimum interval between sending BGP routing updates\n")
4210 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
4213 ALIAS (no_neighbor_advertise_interval
,
4214 no_neighbor_advertise_interval_val_cmd
,
4215 NO_NEIGHBOR_CMD2
"advertisement-interval <0-600>",
4219 "Minimum interval between sending BGP routing updates\n"
4220 "time in seconds\n")
4222 /* Time to wait before processing route-map updates */
4223 DEFUN (bgp_set_route_map_delay_timer
,
4224 bgp_set_route_map_delay_timer_cmd
,
4225 "bgp route-map delay-timer <0-600>",
4227 "BGP route-map delay timer\n"
4228 "Time in secs to wait before processing route-map changes\n"
4229 "0 disables the timer and no route updates happen when\n"
4230 "route-maps change")
4232 u_int32_t rmap_delay_timer
;
4238 VTY_GET_INTEGER_RANGE ("delay-timer", rmap_delay_timer
, argv
[0], 0, 600);
4239 bgp
->rmap_update_timer
= rmap_delay_timer
;
4241 /* if the dynamic update handling is being disabled, and a timer is
4242 * running, stop the timer and act as if the timer has already fired.
4244 if (!rmap_delay_timer
&& bgp
->t_rmap_update
)
4246 BGP_TIMER_OFF(bgp
->t_rmap_update
);
4247 thread_execute (bm
->master
, bgp_route_map_update_timer
, &bgp
, 0);
4255 DEFUN (no_bgp_set_route_map_delay_timer
,
4256 no_bgp_set_route_map_delay_timer_cmd
,
4257 "no bgp route-map delay-timer",
4259 "Default BGP route-map delay timer\n"
4260 "Reset to default time to wait for processing route-map changes")
4262 u_int32_t rmap_delay_timer
;
4266 bgp
->rmap_update_timer
= RMAP_DEFAULT_UPDATE_TIMER
;
4271 /* neighbor interface */
4273 peer_interface_vty (struct vty
*vty
, const char *ip_str
, const char *str
)
4278 peer
= peer_lookup_vty (vty
, ip_str
);
4279 if (! peer
|| peer
->conf_if
)
4283 ret
= peer_interface_set (peer
, str
);
4285 ret
= peer_interface_unset (peer
);
4290 DEFUN (neighbor_interface
,
4291 neighbor_interface_cmd
,
4292 NEIGHBOR_CMD
"interface WORD",
4298 return peer_interface_vty (vty
, argv
[0], argv
[1]);
4301 DEFUN (no_neighbor_interface
,
4302 no_neighbor_interface_cmd
,
4303 NO_NEIGHBOR_CMD
"interface WORD",
4310 return peer_interface_vty (vty
, argv
[0], NULL
);
4313 /* Set distribute list to the peer. */
4315 peer_distribute_set_vty (struct vty
*vty
, const char *ip_str
,
4316 afi_t afi
, safi_t safi
,
4317 const char *name_str
, const char *direct_str
)
4321 int direct
= FILTER_IN
;
4323 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4327 /* Check filter direction. */
4328 if (strncmp (direct_str
, "i", 1) == 0)
4330 else if (strncmp (direct_str
, "o", 1) == 0)
4331 direct
= FILTER_OUT
;
4333 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
4335 return bgp_vty_return (vty
, ret
);
4339 peer_distribute_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
4340 safi_t safi
, const char *direct_str
)
4344 int direct
= FILTER_IN
;
4346 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4350 /* Check filter direction. */
4351 if (strncmp (direct_str
, "i", 1) == 0)
4353 else if (strncmp (direct_str
, "o", 1) == 0)
4354 direct
= FILTER_OUT
;
4356 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
4358 return bgp_vty_return (vty
, ret
);
4361 DEFUN (neighbor_distribute_list
,
4362 neighbor_distribute_list_cmd
,
4363 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
4366 "Filter updates to/from this neighbor\n"
4367 "IP access-list number\n"
4368 "IP access-list number (expanded range)\n"
4369 "IP Access-list name\n"
4370 "Filter incoming updates\n"
4371 "Filter outgoing updates\n")
4373 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4374 bgp_node_safi (vty
), argv
[1], argv
[2]);
4377 DEFUN (no_neighbor_distribute_list
,
4378 no_neighbor_distribute_list_cmd
,
4379 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
4383 "Filter updates to/from this neighbor\n"
4384 "IP access-list number\n"
4385 "IP access-list number (expanded range)\n"
4386 "IP Access-list name\n"
4387 "Filter incoming updates\n"
4388 "Filter outgoing updates\n")
4390 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4391 bgp_node_safi (vty
), argv
[2]);
4394 /* Set prefix list to the peer. */
4396 peer_prefix_list_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
4397 safi_t safi
, const char *name_str
,
4398 const char *direct_str
)
4402 int direct
= FILTER_IN
;
4404 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4408 /* Check filter direction. */
4409 if (strncmp (direct_str
, "i", 1) == 0)
4411 else if (strncmp (direct_str
, "o", 1) == 0)
4412 direct
= FILTER_OUT
;
4414 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
4416 return bgp_vty_return (vty
, ret
);
4420 peer_prefix_list_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
4421 safi_t safi
, const char *direct_str
)
4425 int direct
= FILTER_IN
;
4427 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4431 /* Check filter direction. */
4432 if (strncmp (direct_str
, "i", 1) == 0)
4434 else if (strncmp (direct_str
, "o", 1) == 0)
4435 direct
= FILTER_OUT
;
4437 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
4439 return bgp_vty_return (vty
, ret
);
4442 DEFUN (neighbor_prefix_list
,
4443 neighbor_prefix_list_cmd
,
4444 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
4447 "Filter updates to/from this neighbor\n"
4448 "Name of a prefix list\n"
4449 "Filter incoming updates\n"
4450 "Filter outgoing updates\n")
4452 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4453 bgp_node_safi (vty
), argv
[1], argv
[2]);
4456 DEFUN (no_neighbor_prefix_list
,
4457 no_neighbor_prefix_list_cmd
,
4458 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
4462 "Filter updates to/from this neighbor\n"
4463 "Name of a prefix list\n"
4464 "Filter incoming updates\n"
4465 "Filter outgoing updates\n")
4467 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4468 bgp_node_safi (vty
), argv
[2]);
4472 peer_aslist_set_vty (struct vty
*vty
, const char *ip_str
,
4473 afi_t afi
, safi_t safi
,
4474 const char *name_str
, const char *direct_str
)
4478 int direct
= FILTER_IN
;
4480 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4484 /* Check filter direction. */
4485 if (strncmp (direct_str
, "i", 1) == 0)
4487 else if (strncmp (direct_str
, "o", 1) == 0)
4488 direct
= FILTER_OUT
;
4490 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
4492 return bgp_vty_return (vty
, ret
);
4496 peer_aslist_unset_vty (struct vty
*vty
, const char *ip_str
,
4497 afi_t afi
, safi_t safi
,
4498 const char *direct_str
)
4502 int direct
= FILTER_IN
;
4504 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4508 /* Check filter direction. */
4509 if (strncmp (direct_str
, "i", 1) == 0)
4511 else if (strncmp (direct_str
, "o", 1) == 0)
4512 direct
= FILTER_OUT
;
4514 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
4516 return bgp_vty_return (vty
, ret
);
4519 DEFUN (neighbor_filter_list
,
4520 neighbor_filter_list_cmd
,
4521 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
4524 "Establish BGP filters\n"
4525 "AS path access-list name\n"
4526 "Filter incoming routes\n"
4527 "Filter outgoing routes\n")
4529 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4530 bgp_node_safi (vty
), argv
[1], argv
[2]);
4533 DEFUN (no_neighbor_filter_list
,
4534 no_neighbor_filter_list_cmd
,
4535 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
4539 "Establish BGP filters\n"
4540 "AS path access-list name\n"
4541 "Filter incoming routes\n"
4542 "Filter outgoing routes\n")
4544 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4545 bgp_node_safi (vty
), argv
[2]);
4548 /* Set route-map to the peer. */
4550 peer_route_map_set_vty (struct vty
*vty
, const char *ip_str
,
4551 afi_t afi
, safi_t safi
,
4552 const char *name_str
, const char *direct_str
)
4556 int direct
= RMAP_IN
;
4558 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4562 /* Check filter direction. */
4563 if (strncmp (direct_str
, "in", 2) == 0)
4565 else if (strncmp (direct_str
, "o", 1) == 0)
4567 else if (strncmp (direct_str
, "im", 2) == 0)
4568 direct
= RMAP_IMPORT
;
4569 else if (strncmp (direct_str
, "e", 1) == 0)
4570 direct
= RMAP_EXPORT
;
4572 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
4574 return bgp_vty_return (vty
, ret
);
4578 peer_route_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
4579 safi_t safi
, const char *direct_str
)
4583 int direct
= RMAP_IN
;
4585 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4589 /* Check filter direction. */
4590 if (strncmp (direct_str
, "in", 2) == 0)
4592 else if (strncmp (direct_str
, "o", 1) == 0)
4594 else if (strncmp (direct_str
, "im", 2) == 0)
4595 direct
= RMAP_IMPORT
;
4596 else if (strncmp (direct_str
, "e", 1) == 0)
4597 direct
= RMAP_EXPORT
;
4599 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
4601 return bgp_vty_return (vty
, ret
);
4604 DEFUN (neighbor_route_map
,
4605 neighbor_route_map_cmd
,
4606 NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
4609 "Apply route map to neighbor\n"
4610 "Name of route map\n"
4611 "Apply map to incoming routes\n"
4612 "Apply map to outbound routes\n"
4613 "Apply map to routes going into a Route-Server client's table\n"
4614 "Apply map to routes coming from a Route-Server client")
4616 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4617 bgp_node_safi (vty
), argv
[1], argv
[2]);
4620 DEFUN (no_neighbor_route_map
,
4621 no_neighbor_route_map_cmd
,
4622 NO_NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
4626 "Apply route map to neighbor\n"
4627 "Name of route map\n"
4628 "Apply map to incoming routes\n"
4629 "Apply map to outbound routes\n"
4630 "Apply map to routes going into a Route-Server client's table\n"
4631 "Apply map to routes coming from a Route-Server client")
4633 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4634 bgp_node_safi (vty
), argv
[2]);
4637 /* Set unsuppress-map to the peer. */
4639 peer_unsuppress_map_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
4640 safi_t safi
, const char *name_str
)
4645 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4649 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
4651 return bgp_vty_return (vty
, ret
);
4654 /* Unset route-map from the peer. */
4656 peer_unsuppress_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
4662 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4666 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
4668 return bgp_vty_return (vty
, ret
);
4671 DEFUN (neighbor_unsuppress_map
,
4672 neighbor_unsuppress_map_cmd
,
4673 NEIGHBOR_CMD2
"unsuppress-map WORD",
4676 "Route-map to selectively unsuppress suppressed routes\n"
4677 "Name of route map\n")
4679 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4680 bgp_node_safi (vty
), argv
[1]);
4683 DEFUN (no_neighbor_unsuppress_map
,
4684 no_neighbor_unsuppress_map_cmd
,
4685 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
4689 "Route-map to selectively unsuppress suppressed routes\n"
4690 "Name of route map\n")
4692 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4693 bgp_node_safi (vty
));
4697 peer_maximum_prefix_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
4698 safi_t safi
, const char *num_str
,
4699 const char *threshold_str
, int warning
,
4700 const char *restart_str
)
4708 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4712 VTY_GET_INTEGER ("maximum number", max
, num_str
);
4714 threshold
= atoi (threshold_str
);
4716 threshold
= MAXIMUM_PREFIX_THRESHOLD_DEFAULT
;
4719 restart
= atoi (restart_str
);
4723 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, threshold
, warning
, restart
);
4725 return bgp_vty_return (vty
, ret
);
4729 peer_maximum_prefix_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
4735 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4739 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
4741 return bgp_vty_return (vty
, ret
);
4744 /* Maximum number of prefix configuration. prefix count is different
4745 for each peer configuration. So this configuration can be set for
4746 each peer configuration. */
4747 DEFUN (neighbor_maximum_prefix
,
4748 neighbor_maximum_prefix_cmd
,
4749 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
4752 "Maximum number of prefix accept from this peer\n"
4753 "maximum no. of prefix limit\n")
4755 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4756 bgp_node_safi (vty
), argv
[1], NULL
, 0,
4760 DEFUN (neighbor_maximum_prefix_threshold
,
4761 neighbor_maximum_prefix_threshold_cmd
,
4762 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
4765 "Maximum number of prefix accept from this peer\n"
4766 "maximum no. of prefix limit\n"
4767 "Threshold value (%) at which to generate a warning msg\n")
4769 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4770 bgp_node_safi (vty
), argv
[1], argv
[2], 0,
4774 DEFUN (neighbor_maximum_prefix_warning
,
4775 neighbor_maximum_prefix_warning_cmd
,
4776 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
4779 "Maximum number of prefix accept from this peer\n"
4780 "maximum no. of prefix limit\n"
4781 "Only give warning message when limit is exceeded\n")
4783 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4784 bgp_node_safi (vty
), argv
[1], NULL
, 1,
4788 DEFUN (neighbor_maximum_prefix_threshold_warning
,
4789 neighbor_maximum_prefix_threshold_warning_cmd
,
4790 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
4793 "Maximum number of prefix accept from this peer\n"
4794 "maximum no. of prefix limit\n"
4795 "Threshold value (%) at which to generate a warning msg\n"
4796 "Only give warning message when limit is exceeded\n")
4798 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4799 bgp_node_safi (vty
), argv
[1], argv
[2], 1, NULL
);
4802 DEFUN (neighbor_maximum_prefix_restart
,
4803 neighbor_maximum_prefix_restart_cmd
,
4804 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
4807 "Maximum number of prefix accept from this peer\n"
4808 "maximum no. of prefix limit\n"
4809 "Restart bgp connection after limit is exceeded\n"
4810 "Restart interval in minutes")
4812 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4813 bgp_node_safi (vty
), argv
[1], NULL
, 0, argv
[2]);
4816 DEFUN (neighbor_maximum_prefix_threshold_restart
,
4817 neighbor_maximum_prefix_threshold_restart_cmd
,
4818 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
4821 "Maximum number of prefix accept from this peer\n"
4822 "maximum no. of prefix limit\n"
4823 "Threshold value (%) at which to generate a warning msg\n"
4824 "Restart bgp connection after limit is exceeded\n"
4825 "Restart interval in minutes")
4827 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4828 bgp_node_safi (vty
), argv
[1], argv
[2], 0, argv
[3]);
4831 DEFUN (no_neighbor_maximum_prefix
,
4832 no_neighbor_maximum_prefix_cmd
,
4833 NO_NEIGHBOR_CMD2
"maximum-prefix",
4837 "Maximum number of prefix accept from this peer\n")
4839 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4840 bgp_node_safi (vty
));
4843 ALIAS (no_neighbor_maximum_prefix
,
4844 no_neighbor_maximum_prefix_val_cmd
,
4845 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
4849 "Maximum number of prefix accept from this peer\n"
4850 "maximum no. of prefix limit\n")
4852 ALIAS (no_neighbor_maximum_prefix
,
4853 no_neighbor_maximum_prefix_threshold_cmd
,
4854 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
4858 "Maximum number of prefix accept from this peer\n"
4859 "maximum no. of prefix limit\n"
4860 "Threshold value (%) at which to generate a warning msg\n")
4862 ALIAS (no_neighbor_maximum_prefix
,
4863 no_neighbor_maximum_prefix_warning_cmd
,
4864 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
4868 "Maximum number of prefix accept from this peer\n"
4869 "maximum no. of prefix limit\n"
4870 "Only give warning message when limit is exceeded\n")
4872 ALIAS (no_neighbor_maximum_prefix
,
4873 no_neighbor_maximum_prefix_threshold_warning_cmd
,
4874 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
4878 "Maximum number of prefix accept from this peer\n"
4879 "maximum no. of prefix limit\n"
4880 "Threshold value (%) at which to generate a warning msg\n"
4881 "Only give warning message when limit is exceeded\n")
4883 ALIAS (no_neighbor_maximum_prefix
,
4884 no_neighbor_maximum_prefix_restart_cmd
,
4885 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
4889 "Maximum number of prefix accept from this peer\n"
4890 "maximum no. of prefix limit\n"
4891 "Restart bgp connection after limit is exceeded\n"
4892 "Restart interval in minutes")
4894 ALIAS (no_neighbor_maximum_prefix
,
4895 no_neighbor_maximum_prefix_threshold_restart_cmd
,
4896 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
4900 "Maximum number of prefix accept from this peer\n"
4901 "maximum no. of prefix limit\n"
4902 "Threshold value (%) at which to generate a warning msg\n"
4903 "Restart bgp connection after limit is exceeded\n"
4904 "Restart interval in minutes")
4906 /* "neighbor allowas-in" */
4907 DEFUN (neighbor_allowas_in
,
4908 neighbor_allowas_in_cmd
,
4909 NEIGHBOR_CMD2
"allowas-in",
4912 "Accept as-path with my AS present in it\n")
4916 unsigned int allow_num
;
4918 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4925 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
4927 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
4930 return bgp_vty_return (vty
, ret
);
4933 ALIAS (neighbor_allowas_in
,
4934 neighbor_allowas_in_arg_cmd
,
4935 NEIGHBOR_CMD2
"allowas-in <1-10>",
4938 "Accept as-path with my AS present in it\n"
4939 "Number of occurances of AS number\n")
4941 DEFUN (no_neighbor_allowas_in
,
4942 no_neighbor_allowas_in_cmd
,
4943 NO_NEIGHBOR_CMD2
"allowas-in",
4947 "allow local ASN appears in aspath attribute\n")
4952 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4956 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
4958 return bgp_vty_return (vty
, ret
);
4961 DEFUN (neighbor_ttl_security
,
4962 neighbor_ttl_security_cmd
,
4963 NEIGHBOR_CMD2
"ttl-security hops <1-254>",
4966 "Specify the maximum number of hops to the BGP peer\n")
4971 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4975 VTY_GET_INTEGER_RANGE ("", gtsm_hops
, argv
[1], 1, 254);
4977 return bgp_vty_return (vty
, peer_ttl_security_hops_set (peer
, gtsm_hops
));
4980 DEFUN (no_neighbor_ttl_security
,
4981 no_neighbor_ttl_security_cmd
,
4982 NO_NEIGHBOR_CMD2
"ttl-security hops <1-254>",
4986 "Specify the maximum number of hops to the BGP peer\n")
4990 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4994 return bgp_vty_return (vty
, peer_ttl_security_hops_unset (peer
));
4997 /* Address family configuration. */
4998 DEFUN (address_family_ipv4
,
4999 address_family_ipv4_cmd
,
5000 "address-family ipv4",
5001 "Enter Address Family command mode\n"
5004 vty
->node
= BGP_IPV4_NODE
;
5008 DEFUN (address_family_ipv4_safi
,
5009 address_family_ipv4_safi_cmd
,
5010 "address-family ipv4 (unicast|multicast)",
5011 "Enter Address Family command mode\n"
5013 "Address Family modifier\n"
5014 "Address Family modifier\n")
5016 if (strncmp (argv
[0], "m", 1) == 0)
5017 vty
->node
= BGP_IPV4M_NODE
;
5019 vty
->node
= BGP_IPV4_NODE
;
5024 DEFUN (address_family_ipv6
,
5025 address_family_ipv6_cmd
,
5026 "address-family ipv6",
5027 "Enter Address Family command mode\n"
5030 vty
->node
= BGP_IPV6_NODE
;
5034 DEFUN (address_family_ipv6_safi
,
5035 address_family_ipv6_safi_cmd
,
5036 "address-family ipv6 (unicast|multicast)",
5037 "Enter Address Family command mode\n"
5039 "Address Family modifier\n"
5040 "Address Family modifier\n")
5042 if (strncmp (argv
[0], "m", 1) == 0)
5043 vty
->node
= BGP_IPV6M_NODE
;
5045 vty
->node
= BGP_IPV6_NODE
;
5050 DEFUN (address_family_vpnv4
,
5051 address_family_vpnv4_cmd
,
5052 "address-family vpnv4",
5053 "Enter Address Family command mode\n"
5056 vty
->node
= BGP_VPNV4_NODE
;
5060 ALIAS (address_family_vpnv4
,
5061 address_family_vpnv4_unicast_cmd
,
5062 "address-family vpnv4 unicast",
5063 "Enter Address Family command mode\n"
5065 "Address Family Modifier\n")
5067 DEFUN (exit_address_family
,
5068 exit_address_family_cmd
,
5069 "exit-address-family",
5070 "Exit from Address Family configuration mode\n")
5072 if (vty
->node
== BGP_IPV4_NODE
5073 || vty
->node
== BGP_IPV4M_NODE
5074 || vty
->node
== BGP_VPNV4_NODE
5075 || vty
->node
== BGP_IPV6_NODE
5076 || vty
->node
== BGP_IPV6M_NODE
)
5077 vty
->node
= BGP_NODE
;
5081 /* BGP clear sort. */
5092 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
5093 safi_t safi
, int error
)
5097 case BGP_ERR_AF_UNCONFIGURED
:
5099 "%%BGP: Enable %s %s address family for the neighbor %s%s",
5100 afi
== AFI_IP6
? "IPv6" : safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
5101 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
5102 peer
->host
, VTY_NEWLINE
);
5104 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
5105 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
);
5112 /* `clear ip bgp' functions. */
5114 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
5115 enum clear_sort sort
,enum bgp_clear_type stype
, const char *arg
)
5119 struct listnode
*node
, *nnode
;
5121 /* Clear all neighbors. */
5123 * Pass along pointer to next node to peer_clear() when walking all nodes
5124 * on the BGP instance as that may get freed if it is a doppelganger
5126 if (sort
== clear_all
)
5128 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
5130 if (stype
== BGP_CLEAR_SOFT_NONE
)
5131 ret
= peer_clear (peer
, &nnode
);
5133 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
5136 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
5139 /* This is to apply read-only mode on this clear. */
5140 if (stype
== BGP_CLEAR_SOFT_NONE
)
5141 bgp
->update_delay_over
= 0;
5146 /* Clear specified neighbors. */
5147 if (sort
== clear_peer
)
5152 /* Make sockunion for lookup. */
5153 ret
= str2sockunion (arg
, &su
);
5156 peer
= peer_lookup_by_conf_if (bgp
, arg
);
5159 vty_out (vty
, "Malformed address or name: %s%s", arg
, VTY_NEWLINE
);
5165 peer
= peer_lookup (bgp
, &su
);
5168 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
5173 if (stype
== BGP_CLEAR_SOFT_NONE
)
5174 ret
= peer_clear (peer
, NULL
);
5176 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
5179 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
5184 /* Clear all peer-group members. */
5185 if (sort
== clear_group
)
5187 struct peer_group
*group
;
5189 group
= peer_group_lookup (bgp
, arg
);
5192 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
5196 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
5198 if (stype
== BGP_CLEAR_SOFT_NONE
)
5200 ret
= peer_clear (peer
, NULL
);
5204 if (! peer
->af_group
[afi
][safi
])
5207 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
5210 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
5215 if (sort
== clear_external
)
5217 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
5219 if (peer
->sort
== BGP_PEER_IBGP
)
5222 if (stype
== BGP_CLEAR_SOFT_NONE
)
5223 ret
= peer_clear (peer
, &nnode
);
5225 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
5228 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
5233 if (sort
== clear_as
)
5238 VTY_GET_INTEGER_RANGE ("AS", as
, arg
, 1, BGP_AS4_MAX
);
5240 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
5246 if (stype
== BGP_CLEAR_SOFT_NONE
)
5247 ret
= peer_clear (peer
, &nnode
);
5249 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
5252 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
5255 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
5263 /* Recalculate bestpath and re-advertise a prefix */
5265 bgp_clear_prefix (struct vty
*vty
, char *view_name
, const char *ip_str
,
5266 afi_t afi
, safi_t safi
, struct prefix_rd
*prd
)
5269 struct prefix match
;
5270 struct bgp_node
*rn
;
5271 struct bgp_node
*rm
;
5272 struct bgp_info
*ri
;
5273 struct bgp_info
*ri_temp
;
5275 struct bgp_table
*table
;
5276 struct bgp_table
*rib
;
5278 /* BGP structure lookup. */
5281 bgp
= bgp_lookup_by_name (view_name
);
5284 vty_out (vty
, "%% Can't find BGP view %s%s", view_name
, VTY_NEWLINE
);
5290 bgp
= bgp_get_default ();
5293 vty_out (vty
, "%% No BGP process is configured%s", VTY_NEWLINE
);
5298 /* Check IP address argument. */
5299 ret
= str2prefix (ip_str
, &match
);
5302 vty_out (vty
, "%% address is malformed%s", VTY_NEWLINE
);
5306 match
.family
= afi2family (afi
);
5307 rib
= bgp
->rib
[afi
][safi
];
5309 if (safi
== SAFI_MPLS_VPN
)
5311 for (rn
= bgp_table_top (rib
); rn
; rn
= bgp_route_next (rn
))
5313 if (prd
&& memcmp (rn
->p
.u
.val
, prd
->val
, 8) != 0)
5316 if ((table
= rn
->info
) != NULL
)
5318 if ((rm
= bgp_node_match (table
, &match
)) != NULL
)
5320 if (rm
->p
.prefixlen
== match
.prefixlen
)
5322 SET_FLAG (rn
->flags
, BGP_NODE_USER_CLEAR
);
5323 bgp_process (bgp
, rm
, afi
, safi
);
5325 bgp_unlock_node (rm
);
5332 if ((rn
= bgp_node_match (rib
, &match
)) != NULL
)
5334 if (rn
->p
.prefixlen
== match
.prefixlen
)
5336 SET_FLAG (rn
->flags
, BGP_NODE_USER_CLEAR
);
5337 bgp_process (bgp
, rn
, afi
, safi
);
5339 bgp_unlock_node (rn
);
5347 bgp_clear_vty (struct vty
*vty
, const char *name
, afi_t afi
, safi_t safi
,
5348 enum clear_sort sort
, enum bgp_clear_type stype
,
5353 /* BGP structure lookup. */
5356 bgp
= bgp_lookup_by_name (name
);
5359 vty_out (vty
, "Can't find BGP view %s%s", name
, VTY_NEWLINE
);
5365 bgp
= bgp_get_default ();
5368 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
5373 return bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
5376 DEFUN (clear_ip_bgp_all
,
5377 clear_ip_bgp_all_cmd
,
5382 "Clear all peers\n")
5385 return bgp_clear_vty (vty
, argv
[0], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
5387 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
5390 ALIAS (clear_ip_bgp_all
,
5395 "Clear all peers\n")
5397 ALIAS (clear_ip_bgp_all
,
5398 clear_bgp_ipv6_all_cmd
,
5403 "Clear all peers\n")
5405 ALIAS (clear_ip_bgp_all
,
5406 clear_ip_bgp_instance_all_cmd
,
5407 "clear ip bgp view WORD *",
5413 "Clear all peers\n")
5415 ALIAS (clear_ip_bgp_all
,
5416 clear_bgp_instance_all_cmd
,
5417 "clear bgp view WORD *",
5422 "Clear all peers\n")
5424 DEFUN (clear_ip_bgp_peer
,
5425 clear_ip_bgp_peer_cmd
,
5426 "clear ip bgp (A.B.C.D|X:X::X:X|WORD)",
5430 "BGP neighbor IP address to clear\n"
5431 "BGP IPv6 neighbor to clear\n"
5432 "BGP neighbor on interface to clear\n")
5434 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
5437 ALIAS (clear_ip_bgp_peer
,
5439 "clear bgp (A.B.C.D|X:X::X:X|WORD)",
5442 "BGP neighbor address to clear\n"
5443 "BGP IPv6 neighbor to clear\n"
5444 "BGP neighbor on interface to clear\n")
5446 ALIAS (clear_ip_bgp_peer
,
5447 clear_bgp_ipv6_peer_cmd
,
5448 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD)",
5452 "BGP neighbor address to clear\n"
5453 "BGP IPv6 neighbor to clear\n"
5454 "BGP neighbor on interface to clear\n")
5456 DEFUN (clear_ip_bgp_peer_group
,
5457 clear_ip_bgp_peer_group_cmd
,
5458 "clear ip bgp peer-group WORD",
5462 "Clear all members of peer-group\n"
5463 "BGP peer-group name\n")
5465 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
5468 ALIAS (clear_ip_bgp_peer_group
,
5469 clear_bgp_peer_group_cmd
,
5470 "clear bgp peer-group WORD",
5473 "Clear all members of peer-group\n"
5474 "BGP peer-group name\n")
5476 ALIAS (clear_ip_bgp_peer_group
,
5477 clear_bgp_ipv6_peer_group_cmd
,
5478 "clear bgp ipv6 peer-group WORD",
5482 "Clear all members of peer-group\n"
5483 "BGP peer-group name\n")
5485 DEFUN (clear_ip_bgp_external
,
5486 clear_ip_bgp_external_cmd
,
5487 "clear ip bgp external",
5491 "Clear all external peers\n")
5493 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
5496 ALIAS (clear_ip_bgp_external
,
5497 clear_bgp_external_cmd
,
5498 "clear bgp external",
5501 "Clear all external peers\n")
5503 ALIAS (clear_ip_bgp_external
,
5504 clear_bgp_ipv6_external_cmd
,
5505 "clear bgp ipv6 external",
5509 "Clear all external peers\n")
5511 DEFUN (clear_ip_bgp_prefix
,
5512 clear_ip_bgp_prefix_cmd
,
5513 "clear ip bgp prefix A.B.C.D/M",
5517 "Clear bestpath and re-advertise\n"
5518 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
5520 return bgp_clear_prefix (vty
, NULL
, argv
[0], AFI_IP
, SAFI_UNICAST
, NULL
);
5523 ALIAS (clear_ip_bgp_prefix
,
5524 clear_bgp_prefix_cmd
,
5525 "clear bgp prefix A.B.C.D/M",
5528 "Clear bestpath and re-advertise\n"
5529 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
5532 DEFUN (clear_ip_bgp_as
,
5533 clear_ip_bgp_as_cmd
,
5534 "clear ip bgp " CMD_AS_RANGE
,
5538 "Clear peers with the AS number\n")
5540 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
5543 ALIAS (clear_ip_bgp_as
,
5545 "clear bgp " CMD_AS_RANGE
,
5548 "Clear peers with the AS number\n")
5550 ALIAS (clear_ip_bgp_as
,
5551 clear_bgp_ipv6_as_cmd
,
5552 "clear bgp ipv6 " CMD_AS_RANGE
,
5556 "Clear peers with the AS number\n")
5558 /* Outbound soft-reconfiguration */
5559 DEFUN (clear_ip_bgp_all_soft_out
,
5560 clear_ip_bgp_all_soft_out_cmd
,
5561 "clear ip bgp * soft out",
5570 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5571 BGP_CLEAR_SOFT_OUT
, NULL
);
5573 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5574 BGP_CLEAR_SOFT_OUT
, NULL
);
5577 ALIAS (clear_ip_bgp_all_soft_out
,
5578 clear_ip_bgp_all_out_cmd
,
5579 "clear ip bgp * out",
5586 ALIAS (clear_ip_bgp_all_soft_out
,
5587 clear_ip_bgp_instance_all_soft_out_cmd
,
5588 "clear ip bgp view WORD * soft out",
5598 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
5599 clear_ip_bgp_all_ipv4_soft_out_cmd
,
5600 "clear ip bgp * ipv4 (unicast|multicast) soft out",
5606 "Address Family modifier\n"
5607 "Address Family modifier\n"
5611 if (strncmp (argv
[0], "m", 1) == 0)
5612 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5613 BGP_CLEAR_SOFT_OUT
, NULL
);
5615 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5616 BGP_CLEAR_SOFT_OUT
, NULL
);
5619 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
5620 clear_ip_bgp_all_ipv4_out_cmd
,
5621 "clear ip bgp * ipv4 (unicast|multicast) out",
5627 "Address Family modifier\n"
5628 "Address Family modifier\n"
5631 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
5632 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
5633 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out",
5641 "Address Family modifier\n"
5642 "Address Family modifier\n"
5645 if (strncmp (argv
[1], "m", 1) == 0)
5646 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
5647 BGP_CLEAR_SOFT_OUT
, NULL
);
5649 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5650 BGP_CLEAR_SOFT_OUT
, NULL
);
5653 DEFUN (clear_ip_bgp_all_vpnv4_soft_out
,
5654 clear_ip_bgp_all_vpnv4_soft_out_cmd
,
5655 "clear ip bgp * vpnv4 unicast soft out",
5661 "Address Family Modifier\n"
5665 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
5666 BGP_CLEAR_SOFT_OUT
, NULL
);
5669 ALIAS (clear_ip_bgp_all_vpnv4_soft_out
,
5670 clear_ip_bgp_all_vpnv4_out_cmd
,
5671 "clear ip bgp * vpnv4 unicast out",
5677 "Address Family Modifier\n"
5680 DEFUN (clear_bgp_all_soft_out
,
5681 clear_bgp_all_soft_out_cmd
,
5682 "clear bgp * soft out",
5690 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
5691 BGP_CLEAR_SOFT_OUT
, NULL
);
5693 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5694 BGP_CLEAR_SOFT_OUT
, NULL
);
5697 ALIAS (clear_bgp_all_soft_out
,
5698 clear_bgp_instance_all_soft_out_cmd
,
5699 "clear bgp view WORD * soft out",
5708 ALIAS (clear_bgp_all_soft_out
,
5709 clear_bgp_all_out_cmd
,
5716 ALIAS (clear_bgp_all_soft_out
,
5717 clear_bgp_ipv6_all_soft_out_cmd
,
5718 "clear bgp ipv6 * soft out",
5726 ALIAS (clear_bgp_all_soft_out
,
5727 clear_bgp_ipv6_all_out_cmd
,
5728 "clear bgp ipv6 * out",
5735 DEFUN (clear_bgp_ipv6_safi_prefix
,
5736 clear_bgp_ipv6_safi_prefix_cmd
,
5737 "clear bgp ipv6 (unicast|multicast) prefix X:X::X:X/M",
5741 "Address Family Modifier\n"
5742 "Clear bestpath and re-advertise\n"
5743 "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
5745 if (strncmp (argv
[0], "m", 1) == 0)
5746 return bgp_clear_prefix (vty
, NULL
, argv
[1], AFI_IP6
, SAFI_MULTICAST
, NULL
);
5748 return bgp_clear_prefix (vty
, NULL
, argv
[1], AFI_IP6
, SAFI_UNICAST
, NULL
);
5751 DEFUN (clear_ip_bgp_peer_soft_out
,
5752 clear_ip_bgp_peer_soft_out_cmd
,
5753 "clear ip bgp A.B.C.D soft out",
5757 "BGP neighbor address to clear\n"
5761 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5762 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5765 ALIAS (clear_ip_bgp_peer_soft_out
,
5766 clear_ip_bgp_peer_out_cmd
,
5767 "clear ip bgp A.B.C.D out",
5771 "BGP neighbor address to clear\n"
5774 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
5775 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
5776 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out",
5780 "BGP neighbor address to clear\n"
5782 "Address Family modifier\n"
5783 "Address Family modifier\n"
5787 if (strncmp (argv
[1], "m", 1) == 0)
5788 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5789 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5791 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5792 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5795 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
5796 clear_ip_bgp_peer_ipv4_out_cmd
,
5797 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out",
5801 "BGP neighbor address to clear\n"
5803 "Address Family modifier\n"
5804 "Address Family modifier\n"
5807 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out
,
5808 clear_ip_bgp_peer_vpnv4_soft_out_cmd
,
5809 "clear ip bgp A.B.C.D vpnv4 unicast soft out",
5813 "BGP neighbor address to clear\n"
5815 "Address Family Modifier\n"
5819 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
5820 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5823 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out
,
5824 clear_ip_bgp_peer_vpnv4_out_cmd
,
5825 "clear ip bgp A.B.C.D vpnv4 unicast out",
5829 "BGP neighbor address to clear\n"
5831 "Address Family Modifier\n"
5834 DEFUN (clear_bgp_peer_soft_out
,
5835 clear_bgp_peer_soft_out_cmd
,
5836 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft out",
5839 "BGP neighbor address to clear\n"
5840 "BGP IPv6 neighbor to clear\n"
5841 "BGP neighbor on interface to clear\n"
5845 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5846 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5849 ALIAS (clear_bgp_peer_soft_out
,
5850 clear_bgp_ipv6_peer_soft_out_cmd
,
5851 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft out",
5855 "BGP neighbor address to clear\n"
5856 "BGP IPv6 neighbor to clear\n"
5857 "BGP neighbor on interface to clear\n"
5861 ALIAS (clear_bgp_peer_soft_out
,
5862 clear_bgp_peer_out_cmd
,
5863 "clear bgp (A.B.C.D|X:X::X:X|WORD) out",
5866 "BGP neighbor address to clear\n"
5867 "BGP IPv6 neighbor to clear\n"
5868 "BGP neighbor on interface to clear\n"
5871 ALIAS (clear_bgp_peer_soft_out
,
5872 clear_bgp_ipv6_peer_out_cmd
,
5873 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) out",
5877 "BGP neighbor address to clear\n"
5878 "BGP IPv6 neighbor to clear\n"
5879 "BGP neighbor on interface to clear\n"
5882 DEFUN (clear_ip_bgp_peer_group_soft_out
,
5883 clear_ip_bgp_peer_group_soft_out_cmd
,
5884 "clear ip bgp peer-group WORD soft out",
5888 "Clear all members of peer-group\n"
5889 "BGP peer-group name\n"
5893 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5894 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5897 ALIAS (clear_ip_bgp_peer_group_soft_out
,
5898 clear_ip_bgp_peer_group_out_cmd
,
5899 "clear ip bgp peer-group WORD out",
5903 "Clear all members of peer-group\n"
5904 "BGP peer-group name\n"
5907 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
5908 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
5909 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
5913 "Clear all members of peer-group\n"
5914 "BGP peer-group name\n"
5916 "Address Family modifier\n"
5917 "Address Family modifier\n"
5921 if (strncmp (argv
[1], "m", 1) == 0)
5922 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5923 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5925 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5926 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5929 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
5930 clear_ip_bgp_peer_group_ipv4_out_cmd
,
5931 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
5935 "Clear all members of peer-group\n"
5936 "BGP peer-group name\n"
5938 "Address Family modifier\n"
5939 "Address Family modifier\n"
5942 DEFUN (clear_bgp_peer_group_soft_out
,
5943 clear_bgp_peer_group_soft_out_cmd
,
5944 "clear bgp peer-group WORD soft out",
5947 "Clear all members of peer-group\n"
5948 "BGP peer-group name\n"
5952 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5953 BGP_CLEAR_SOFT_OUT
, argv
[0]);
5956 ALIAS (clear_bgp_peer_group_soft_out
,
5957 clear_bgp_ipv6_peer_group_soft_out_cmd
,
5958 "clear bgp ipv6 peer-group WORD soft out",
5962 "Clear all members of peer-group\n"
5963 "BGP peer-group name\n"
5967 ALIAS (clear_bgp_peer_group_soft_out
,
5968 clear_bgp_peer_group_out_cmd
,
5969 "clear bgp peer-group WORD out",
5972 "Clear all members of peer-group\n"
5973 "BGP peer-group name\n"
5976 ALIAS (clear_bgp_peer_group_soft_out
,
5977 clear_bgp_ipv6_peer_group_out_cmd
,
5978 "clear bgp ipv6 peer-group WORD out",
5982 "Clear all members of peer-group\n"
5983 "BGP peer-group name\n"
5986 DEFUN (clear_ip_bgp_external_soft_out
,
5987 clear_ip_bgp_external_soft_out_cmd
,
5988 "clear ip bgp external soft out",
5992 "Clear all external peers\n"
5996 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5997 BGP_CLEAR_SOFT_OUT
, NULL
);
6000 ALIAS (clear_ip_bgp_external_soft_out
,
6001 clear_ip_bgp_external_out_cmd
,
6002 "clear ip bgp external out",
6006 "Clear all external peers\n"
6009 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
6010 clear_ip_bgp_external_ipv4_soft_out_cmd
,
6011 "clear ip bgp external ipv4 (unicast|multicast) soft out",
6015 "Clear all external peers\n"
6017 "Address Family modifier\n"
6018 "Address Family modifier\n"
6022 if (strncmp (argv
[0], "m", 1) == 0)
6023 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
6024 BGP_CLEAR_SOFT_OUT
, NULL
);
6026 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6027 BGP_CLEAR_SOFT_OUT
, NULL
);
6030 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
6031 clear_ip_bgp_external_ipv4_out_cmd
,
6032 "clear ip bgp external ipv4 (unicast|multicast) out",
6036 "Clear all external peers\n"
6038 "Address Family modifier\n"
6039 "Address Family modifier\n"
6042 DEFUN (clear_bgp_external_soft_out
,
6043 clear_bgp_external_soft_out_cmd
,
6044 "clear bgp external soft out",
6047 "Clear all external peers\n"
6051 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6052 BGP_CLEAR_SOFT_OUT
, NULL
);
6055 ALIAS (clear_bgp_external_soft_out
,
6056 clear_bgp_ipv6_external_soft_out_cmd
,
6057 "clear bgp ipv6 external soft out",
6061 "Clear all external peers\n"
6065 ALIAS (clear_bgp_external_soft_out
,
6066 clear_bgp_external_out_cmd
,
6067 "clear bgp external out",
6070 "Clear all external peers\n"
6073 ALIAS (clear_bgp_external_soft_out
,
6074 clear_bgp_ipv6_external_out_cmd
,
6075 "clear bgp ipv6 external WORD out",
6079 "Clear all external peers\n"
6082 DEFUN (clear_ip_bgp_as_soft_out
,
6083 clear_ip_bgp_as_soft_out_cmd
,
6084 "clear ip bgp " CMD_AS_RANGE
" soft out",
6088 "Clear peers with the AS number\n"
6092 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6093 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6096 ALIAS (clear_ip_bgp_as_soft_out
,
6097 clear_ip_bgp_as_out_cmd
,
6098 "clear ip bgp " CMD_AS_RANGE
" out",
6102 "Clear peers with the AS number\n"
6105 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
6106 clear_ip_bgp_as_ipv4_soft_out_cmd
,
6107 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft out",
6111 "Clear peers with the AS number\n"
6113 "Address Family modifier\n"
6114 "Address Family modifier\n"
6118 if (strncmp (argv
[1], "m", 1) == 0)
6119 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
6120 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6122 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6123 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6126 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
6127 clear_ip_bgp_as_ipv4_out_cmd
,
6128 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) out",
6132 "Clear peers with the AS number\n"
6134 "Address Family modifier\n"
6135 "Address Family modifier\n"
6138 DEFUN (clear_ip_bgp_as_vpnv4_soft_out
,
6139 clear_ip_bgp_as_vpnv4_soft_out_cmd
,
6140 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft out",
6144 "Clear peers with the AS number\n"
6146 "Address Family modifier\n"
6150 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
6151 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6154 ALIAS (clear_ip_bgp_as_vpnv4_soft_out
,
6155 clear_ip_bgp_as_vpnv4_out_cmd
,
6156 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast out",
6160 "Clear peers with the AS number\n"
6162 "Address Family modifier\n"
6165 DEFUN (clear_bgp_as_soft_out
,
6166 clear_bgp_as_soft_out_cmd
,
6167 "clear bgp " CMD_AS_RANGE
" soft out",
6170 "Clear peers with the AS number\n"
6174 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
6175 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6178 ALIAS (clear_bgp_as_soft_out
,
6179 clear_bgp_ipv6_as_soft_out_cmd
,
6180 "clear bgp ipv6 " CMD_AS_RANGE
" soft out",
6184 "Clear peers with the AS number\n"
6188 ALIAS (clear_bgp_as_soft_out
,
6189 clear_bgp_as_out_cmd
,
6190 "clear bgp " CMD_AS_RANGE
" out",
6193 "Clear peers with the AS number\n"
6196 ALIAS (clear_bgp_as_soft_out
,
6197 clear_bgp_ipv6_as_out_cmd
,
6198 "clear bgp ipv6 " CMD_AS_RANGE
" out",
6202 "Clear peers with the AS number\n"
6205 /* Inbound soft-reconfiguration */
6206 DEFUN (clear_ip_bgp_all_soft_in
,
6207 clear_ip_bgp_all_soft_in_cmd
,
6208 "clear ip bgp * soft in",
6217 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6218 BGP_CLEAR_SOFT_IN
, NULL
);
6220 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6221 BGP_CLEAR_SOFT_IN
, NULL
);
6224 ALIAS (clear_ip_bgp_all_soft_in
,
6225 clear_ip_bgp_instance_all_soft_in_cmd
,
6226 "clear ip bgp view WORD * soft in",
6236 ALIAS (clear_ip_bgp_all_soft_in
,
6237 clear_ip_bgp_all_in_cmd
,
6238 "clear ip bgp * in",
6245 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
6246 clear_ip_bgp_all_in_prefix_filter_cmd
,
6247 "clear ip bgp * in prefix-filter",
6253 "Push out prefix-list ORF and do inbound soft reconfig\n")
6256 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6257 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6259 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6260 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6263 ALIAS (clear_ip_bgp_all_in_prefix_filter
,
6264 clear_ip_bgp_instance_all_in_prefix_filter_cmd
,
6265 "clear ip bgp view WORD * in prefix-filter",
6273 "Push out prefix-list ORF and do inbound soft reconfig\n")
6276 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
6277 clear_ip_bgp_all_ipv4_soft_in_cmd
,
6278 "clear ip bgp * ipv4 (unicast|multicast) soft in",
6284 "Address Family modifier\n"
6285 "Address Family modifier\n"
6289 if (strncmp (argv
[0], "m", 1) == 0)
6290 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6291 BGP_CLEAR_SOFT_IN
, NULL
);
6293 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6294 BGP_CLEAR_SOFT_IN
, NULL
);
6297 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
6298 clear_ip_bgp_all_ipv4_in_cmd
,
6299 "clear ip bgp * ipv4 (unicast|multicast) in",
6305 "Address Family modifier\n"
6306 "Address Family modifier\n"
6309 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
6310 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
6311 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in",
6319 "Address Family modifier\n"
6320 "Address Family modifier\n"
6324 if (strncmp (argv
[1], "m", 1) == 0)
6325 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
6326 BGP_CLEAR_SOFT_IN
, NULL
);
6328 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6329 BGP_CLEAR_SOFT_IN
, NULL
);
6332 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
6333 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
6334 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
6340 "Address Family modifier\n"
6341 "Address Family modifier\n"
6343 "Push out prefix-list ORF and do inbound soft reconfig\n")
6345 if (strncmp (argv
[0], "m", 1) == 0)
6346 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6347 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6349 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6350 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6353 DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter
,
6354 clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
,
6355 "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter",
6361 "Address Family modifier\n"
6362 "Address Family modifier\n"
6364 "Push out prefix-list ORF and do inbound soft reconfig\n")
6366 if (strncmp (argv
[1], "m", 1) == 0)
6367 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
6368 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6370 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6371 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6374 DEFUN (clear_ip_bgp_all_vpnv4_soft_in
,
6375 clear_ip_bgp_all_vpnv4_soft_in_cmd
,
6376 "clear ip bgp * vpnv4 unicast soft in",
6382 "Address Family Modifier\n"
6386 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
6387 BGP_CLEAR_SOFT_IN
, NULL
);
6390 ALIAS (clear_ip_bgp_all_vpnv4_soft_in
,
6391 clear_ip_bgp_all_vpnv4_in_cmd
,
6392 "clear ip bgp * vpnv4 unicast in",
6398 "Address Family Modifier\n"
6401 DEFUN (clear_bgp_all_soft_in
,
6402 clear_bgp_all_soft_in_cmd
,
6403 "clear bgp * soft in",
6411 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6412 BGP_CLEAR_SOFT_IN
, NULL
);
6414 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6415 BGP_CLEAR_SOFT_IN
, NULL
);
6418 ALIAS (clear_bgp_all_soft_in
,
6419 clear_bgp_instance_all_soft_in_cmd
,
6420 "clear bgp view WORD * soft in",
6429 ALIAS (clear_bgp_all_soft_in
,
6430 clear_bgp_ipv6_all_soft_in_cmd
,
6431 "clear bgp ipv6 * soft in",
6439 ALIAS (clear_bgp_all_soft_in
,
6440 clear_bgp_all_in_cmd
,
6447 ALIAS (clear_bgp_all_soft_in
,
6448 clear_bgp_ipv6_all_in_cmd
,
6449 "clear bgp ipv6 * in",
6456 DEFUN (clear_bgp_all_in_prefix_filter
,
6457 clear_bgp_all_in_prefix_filter_cmd
,
6458 "clear bgp * in prefix-filter",
6463 "Push out prefix-list ORF and do inbound soft reconfig\n")
6465 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6466 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6469 ALIAS (clear_bgp_all_in_prefix_filter
,
6470 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
6471 "clear bgp ipv6 * in prefix-filter",
6477 "Push out prefix-list ORF and do inbound soft reconfig\n")
6479 DEFUN (clear_ip_bgp_peer_soft_in
,
6480 clear_ip_bgp_peer_soft_in_cmd
,
6481 "clear ip bgp A.B.C.D soft in",
6485 "BGP neighbor address to clear\n"
6489 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6490 BGP_CLEAR_SOFT_IN
, argv
[0]);
6493 ALIAS (clear_ip_bgp_peer_soft_in
,
6494 clear_ip_bgp_peer_in_cmd
,
6495 "clear ip bgp A.B.C.D in",
6499 "BGP neighbor address to clear\n"
6502 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
6503 clear_ip_bgp_peer_in_prefix_filter_cmd
,
6504 "clear ip bgp A.B.C.D in prefix-filter",
6508 "BGP neighbor address to clear\n"
6510 "Push out the existing ORF prefix-list\n")
6512 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6513 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6516 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
6517 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
6518 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in",
6522 "BGP neighbor address to clear\n"
6524 "Address Family modifier\n"
6525 "Address Family modifier\n"
6529 if (strncmp (argv
[1], "m", 1) == 0)
6530 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
6531 BGP_CLEAR_SOFT_IN
, argv
[0]);
6533 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6534 BGP_CLEAR_SOFT_IN
, argv
[0]);
6537 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
6538 clear_ip_bgp_peer_ipv4_in_cmd
,
6539 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in",
6543 "BGP neighbor address to clear\n"
6545 "Address Family modifier\n"
6546 "Address Family modifier\n"
6549 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
6550 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
6551 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter",
6555 "BGP neighbor address to clear\n"
6557 "Address Family modifier\n"
6558 "Address Family modifier\n"
6560 "Push out the existing ORF prefix-list\n")
6562 if (strncmp (argv
[1], "m", 1) == 0)
6563 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
6564 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6566 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6567 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6570 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in
,
6571 clear_ip_bgp_peer_vpnv4_soft_in_cmd
,
6572 "clear ip bgp A.B.C.D vpnv4 unicast soft in",
6576 "BGP neighbor address to clear\n"
6578 "Address Family Modifier\n"
6582 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
6583 BGP_CLEAR_SOFT_IN
, argv
[0]);
6586 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in
,
6587 clear_ip_bgp_peer_vpnv4_in_cmd
,
6588 "clear ip bgp A.B.C.D vpnv4 unicast in",
6592 "BGP neighbor address to clear\n"
6594 "Address Family Modifier\n"
6597 DEFUN (clear_bgp_peer_soft_in
,
6598 clear_bgp_peer_soft_in_cmd
,
6599 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft in",
6602 "BGP neighbor address to clear\n"
6603 "BGP IPv6 neighbor to clear\n"
6604 "BGP neighbor on interface to clear\n"
6608 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6609 BGP_CLEAR_SOFT_IN
, argv
[0]);
6612 ALIAS (clear_bgp_peer_soft_in
,
6613 clear_bgp_ipv6_peer_soft_in_cmd
,
6614 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft in",
6618 "BGP neighbor address to clear\n"
6619 "BGP IPv6 neighbor to clear\n"
6620 "BGP neighbor on interface to clear\n"
6624 ALIAS (clear_bgp_peer_soft_in
,
6625 clear_bgp_peer_in_cmd
,
6626 "clear bgp (A.B.C.D|X:X::X:X|WORD) in",
6629 "BGP neighbor address to clear\n"
6630 "BGP IPv6 neighbor to clear\n"
6631 "BGP neighbor on interface to clear\n"
6634 ALIAS (clear_bgp_peer_soft_in
,
6635 clear_bgp_ipv6_peer_in_cmd
,
6636 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) in",
6640 "BGP neighbor address to clear\n"
6641 "BGP IPv6 neighbor to clear\n"
6642 "BGP neighbor on interface to clear\n"
6645 DEFUN (clear_bgp_peer_in_prefix_filter
,
6646 clear_bgp_peer_in_prefix_filter_cmd
,
6647 "clear bgp (A.B.C.D|X:X::X:X|WORD) in prefix-filter",
6650 "BGP neighbor address to clear\n"
6651 "BGP IPv6 neighbor to clear\n"
6652 "BGP neighbor on interface to clear\n"
6654 "Push out the existing ORF prefix-list\n")
6656 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6657 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6660 ALIAS (clear_bgp_peer_in_prefix_filter
,
6661 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
6662 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) in prefix-filter",
6666 "BGP neighbor address to clear\n"
6667 "BGP IPv6 neighbor to clear\n"
6668 "BGP neighbor on interface to clear\n"
6670 "Push out the existing ORF prefix-list\n")
6672 DEFUN (clear_ip_bgp_peer_group_soft_in
,
6673 clear_ip_bgp_peer_group_soft_in_cmd
,
6674 "clear ip bgp peer-group WORD soft in",
6678 "Clear all members of peer-group\n"
6679 "BGP peer-group name\n"
6683 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6684 BGP_CLEAR_SOFT_IN
, argv
[0]);
6687 ALIAS (clear_ip_bgp_peer_group_soft_in
,
6688 clear_ip_bgp_peer_group_in_cmd
,
6689 "clear ip bgp peer-group WORD in",
6693 "Clear all members of peer-group\n"
6694 "BGP peer-group name\n"
6697 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
6698 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
6699 "clear ip bgp peer-group WORD in prefix-filter",
6703 "Clear all members of peer-group\n"
6704 "BGP peer-group name\n"
6706 "Push out prefix-list ORF and do inbound soft reconfig\n")
6708 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6709 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6712 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
6713 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
6714 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
6718 "Clear all members of peer-group\n"
6719 "BGP peer-group name\n"
6721 "Address Family modifier\n"
6722 "Address Family modifier\n"
6726 if (strncmp (argv
[1], "m", 1) == 0)
6727 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
6728 BGP_CLEAR_SOFT_IN
, argv
[0]);
6730 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6731 BGP_CLEAR_SOFT_IN
, argv
[0]);
6734 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
6735 clear_ip_bgp_peer_group_ipv4_in_cmd
,
6736 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
6740 "Clear all members of peer-group\n"
6741 "BGP peer-group name\n"
6743 "Address Family modifier\n"
6744 "Address Family modifier\n"
6747 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
6748 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
6749 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
6753 "Clear all members of peer-group\n"
6754 "BGP peer-group name\n"
6756 "Address Family modifier\n"
6757 "Address Family modifier\n"
6759 "Push out prefix-list ORF and do inbound soft reconfig\n")
6761 if (strncmp (argv
[1], "m", 1) == 0)
6762 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
6763 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6765 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6766 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6769 DEFUN (clear_bgp_peer_group_soft_in
,
6770 clear_bgp_peer_group_soft_in_cmd
,
6771 "clear bgp peer-group WORD soft in",
6774 "Clear all members of peer-group\n"
6775 "BGP peer-group name\n"
6779 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
6780 BGP_CLEAR_SOFT_IN
, argv
[0]);
6783 ALIAS (clear_bgp_peer_group_soft_in
,
6784 clear_bgp_ipv6_peer_group_soft_in_cmd
,
6785 "clear bgp ipv6 peer-group WORD soft in",
6789 "Clear all members of peer-group\n"
6790 "BGP peer-group name\n"
6794 ALIAS (clear_bgp_peer_group_soft_in
,
6795 clear_bgp_peer_group_in_cmd
,
6796 "clear bgp peer-group WORD in",
6799 "Clear all members of peer-group\n"
6800 "BGP peer-group name\n"
6803 ALIAS (clear_bgp_peer_group_soft_in
,
6804 clear_bgp_ipv6_peer_group_in_cmd
,
6805 "clear bgp ipv6 peer-group WORD in",
6809 "Clear all members of peer-group\n"
6810 "BGP peer-group name\n"
6813 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
6814 clear_bgp_peer_group_in_prefix_filter_cmd
,
6815 "clear bgp peer-group WORD in prefix-filter",
6818 "Clear all members of peer-group\n"
6819 "BGP peer-group name\n"
6821 "Push out prefix-list ORF and do inbound soft reconfig\n")
6823 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
6824 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
6827 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
6828 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
6829 "clear bgp ipv6 peer-group WORD in prefix-filter",
6833 "Clear all members of peer-group\n"
6834 "BGP peer-group name\n"
6836 "Push out prefix-list ORF and do inbound soft reconfig\n")
6838 DEFUN (clear_ip_bgp_external_soft_in
,
6839 clear_ip_bgp_external_soft_in_cmd
,
6840 "clear ip bgp external soft in",
6844 "Clear all external peers\n"
6848 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6849 BGP_CLEAR_SOFT_IN
, NULL
);
6852 ALIAS (clear_ip_bgp_external_soft_in
,
6853 clear_ip_bgp_external_in_cmd
,
6854 "clear ip bgp external in",
6858 "Clear all external peers\n"
6861 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
6862 clear_ip_bgp_external_in_prefix_filter_cmd
,
6863 "clear ip bgp external in prefix-filter",
6867 "Clear all external peers\n"
6869 "Push out prefix-list ORF and do inbound soft reconfig\n")
6871 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6872 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6875 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
6876 clear_ip_bgp_external_ipv4_soft_in_cmd
,
6877 "clear ip bgp external ipv4 (unicast|multicast) soft in",
6881 "Clear all external peers\n"
6883 "Address Family modifier\n"
6884 "Address Family modifier\n"
6888 if (strncmp (argv
[0], "m", 1) == 0)
6889 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
6890 BGP_CLEAR_SOFT_IN
, NULL
);
6892 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6893 BGP_CLEAR_SOFT_IN
, NULL
);
6896 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
6897 clear_ip_bgp_external_ipv4_in_cmd
,
6898 "clear ip bgp external ipv4 (unicast|multicast) in",
6902 "Clear all external peers\n"
6904 "Address Family modifier\n"
6905 "Address Family modifier\n"
6908 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
6909 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
6910 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
6914 "Clear all external peers\n"
6916 "Address Family modifier\n"
6917 "Address Family modifier\n"
6919 "Push out prefix-list ORF and do inbound soft reconfig\n")
6921 if (strncmp (argv
[0], "m", 1) == 0)
6922 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
6923 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6925 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6926 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6929 DEFUN (clear_bgp_external_soft_in
,
6930 clear_bgp_external_soft_in_cmd
,
6931 "clear bgp external soft in",
6934 "Clear all external peers\n"
6938 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6939 BGP_CLEAR_SOFT_IN
, NULL
);
6942 ALIAS (clear_bgp_external_soft_in
,
6943 clear_bgp_ipv6_external_soft_in_cmd
,
6944 "clear bgp ipv6 external soft in",
6948 "Clear all external peers\n"
6952 ALIAS (clear_bgp_external_soft_in
,
6953 clear_bgp_external_in_cmd
,
6954 "clear bgp external in",
6957 "Clear all external peers\n"
6960 ALIAS (clear_bgp_external_soft_in
,
6961 clear_bgp_ipv6_external_in_cmd
,
6962 "clear bgp ipv6 external WORD in",
6966 "Clear all external peers\n"
6969 DEFUN (clear_bgp_external_in_prefix_filter
,
6970 clear_bgp_external_in_prefix_filter_cmd
,
6971 "clear bgp external in prefix-filter",
6974 "Clear all external peers\n"
6976 "Push out prefix-list ORF and do inbound soft reconfig\n")
6978 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6979 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6982 ALIAS (clear_bgp_external_in_prefix_filter
,
6983 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
6984 "clear bgp ipv6 external in prefix-filter",
6988 "Clear all external peers\n"
6990 "Push out prefix-list ORF and do inbound soft reconfig\n")
6992 DEFUN (clear_ip_bgp_as_soft_in
,
6993 clear_ip_bgp_as_soft_in_cmd
,
6994 "clear ip bgp " CMD_AS_RANGE
" soft in",
6998 "Clear peers with the AS number\n"
7002 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7003 BGP_CLEAR_SOFT_IN
, argv
[0]);
7006 ALIAS (clear_ip_bgp_as_soft_in
,
7007 clear_ip_bgp_as_in_cmd
,
7008 "clear ip bgp " CMD_AS_RANGE
" in",
7012 "Clear peers with the AS number\n"
7015 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
7016 clear_ip_bgp_as_in_prefix_filter_cmd
,
7017 "clear ip bgp " CMD_AS_RANGE
" in prefix-filter",
7021 "Clear peers with the AS number\n"
7023 "Push out prefix-list ORF and do inbound soft reconfig\n")
7025 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7026 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7029 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
7030 clear_ip_bgp_as_ipv4_soft_in_cmd
,
7031 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft in",
7035 "Clear peers with the AS number\n"
7037 "Address Family modifier\n"
7038 "Address Family modifier\n"
7042 if (strncmp (argv
[1], "m", 1) == 0)
7043 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
7044 BGP_CLEAR_SOFT_IN
, argv
[0]);
7046 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7047 BGP_CLEAR_SOFT_IN
, argv
[0]);
7050 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
7051 clear_ip_bgp_as_ipv4_in_cmd
,
7052 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in",
7056 "Clear peers with the AS number\n"
7058 "Address Family modifier\n"
7059 "Address Family modifier\n"
7062 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
7063 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
7064 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in prefix-filter",
7068 "Clear peers with the AS number\n"
7070 "Address Family modifier\n"
7071 "Address Family modifier\n"
7073 "Push out prefix-list ORF and do inbound soft reconfig\n")
7075 if (strncmp (argv
[1], "m", 1) == 0)
7076 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
7077 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7079 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7080 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7083 DEFUN (clear_ip_bgp_as_vpnv4_soft_in
,
7084 clear_ip_bgp_as_vpnv4_soft_in_cmd
,
7085 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft in",
7089 "Clear peers with the AS number\n"
7091 "Address Family modifier\n"
7095 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
7096 BGP_CLEAR_SOFT_IN
, argv
[0]);
7099 ALIAS (clear_ip_bgp_as_vpnv4_soft_in
,
7100 clear_ip_bgp_as_vpnv4_in_cmd
,
7101 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast in",
7105 "Clear peers with the AS number\n"
7107 "Address Family modifier\n"
7110 DEFUN (clear_bgp_as_soft_in
,
7111 clear_bgp_as_soft_in_cmd
,
7112 "clear bgp " CMD_AS_RANGE
" soft in",
7115 "Clear peers with the AS number\n"
7119 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
7120 BGP_CLEAR_SOFT_IN
, argv
[0]);
7123 ALIAS (clear_bgp_as_soft_in
,
7124 clear_bgp_ipv6_as_soft_in_cmd
,
7125 "clear bgp ipv6 " CMD_AS_RANGE
" soft in",
7129 "Clear peers with the AS number\n"
7133 ALIAS (clear_bgp_as_soft_in
,
7134 clear_bgp_as_in_cmd
,
7135 "clear bgp " CMD_AS_RANGE
" in",
7138 "Clear peers with the AS number\n"
7141 ALIAS (clear_bgp_as_soft_in
,
7142 clear_bgp_ipv6_as_in_cmd
,
7143 "clear bgp ipv6 " CMD_AS_RANGE
" in",
7147 "Clear peers with the AS number\n"
7150 DEFUN (clear_bgp_as_in_prefix_filter
,
7151 clear_bgp_as_in_prefix_filter_cmd
,
7152 "clear bgp " CMD_AS_RANGE
" in prefix-filter",
7155 "Clear peers with the AS number\n"
7157 "Push out prefix-list ORF and do inbound soft reconfig\n")
7159 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
7160 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7163 ALIAS (clear_bgp_as_in_prefix_filter
,
7164 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
7165 "clear bgp ipv6 " CMD_AS_RANGE
" in prefix-filter",
7169 "Clear peers with the AS number\n"
7171 "Push out prefix-list ORF and do inbound soft reconfig\n")
7173 /* Both soft-reconfiguration */
7174 DEFUN (clear_ip_bgp_all_soft
,
7175 clear_ip_bgp_all_soft_cmd
,
7176 "clear ip bgp * soft",
7184 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
7185 BGP_CLEAR_SOFT_BOTH
, NULL
);
7187 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7188 BGP_CLEAR_SOFT_BOTH
, NULL
);
7191 ALIAS (clear_ip_bgp_all_soft
,
7192 clear_ip_bgp_instance_all_soft_cmd
,
7193 "clear ip bgp view WORD * soft",
7203 DEFUN (clear_ip_bgp_all_ipv4_soft
,
7204 clear_ip_bgp_all_ipv4_soft_cmd
,
7205 "clear ip bgp * ipv4 (unicast|multicast) soft",
7211 "Address Family Modifier\n"
7212 "Address Family Modifier\n"
7215 if (strncmp (argv
[0], "m", 1) == 0)
7216 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
7217 BGP_CLEAR_SOFT_BOTH
, NULL
);
7219 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7220 BGP_CLEAR_SOFT_BOTH
, NULL
);
7223 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
7224 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
7225 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft",
7233 "Address Family Modifier\n"
7234 "Address Family Modifier\n"
7237 if (strncmp (argv
[1], "m", 1) == 0)
7238 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
7239 BGP_CLEAR_SOFT_BOTH
, NULL
);
7241 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7242 BGP_CLEAR_SOFT_BOTH
, NULL
);
7245 DEFUN (clear_ip_bgp_all_vpnv4_soft
,
7246 clear_ip_bgp_all_vpnv4_soft_cmd
,
7247 "clear ip bgp * vpnv4 unicast soft",
7253 "Address Family Modifier\n"
7256 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
7257 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7260 DEFUN (clear_bgp_all_soft
,
7261 clear_bgp_all_soft_cmd
,
7269 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
7270 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7272 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
7273 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7276 ALIAS (clear_bgp_all_soft
,
7277 clear_bgp_instance_all_soft_cmd
,
7278 "clear bgp view WORD * soft",
7286 ALIAS (clear_bgp_all_soft
,
7287 clear_bgp_ipv6_all_soft_cmd
,
7288 "clear bgp ipv6 * soft",
7295 DEFUN (clear_ip_bgp_peer_soft
,
7296 clear_ip_bgp_peer_soft_cmd
,
7297 "clear ip bgp A.B.C.D soft",
7301 "BGP neighbor address to clear\n"
7304 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7305 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7308 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
7309 clear_ip_bgp_peer_ipv4_soft_cmd
,
7310 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft",
7314 "BGP neighbor address to clear\n"
7316 "Address Family Modifier\n"
7317 "Address Family Modifier\n"
7320 if (strncmp (argv
[1], "m", 1) == 0)
7321 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
7322 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7324 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7325 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7328 DEFUN (clear_ip_bgp_peer_vpnv4_soft
,
7329 clear_ip_bgp_peer_vpnv4_soft_cmd
,
7330 "clear ip bgp A.B.C.D vpnv4 unicast soft",
7334 "BGP neighbor address to clear\n"
7336 "Address Family Modifier\n"
7339 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
7340 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7343 DEFUN (clear_bgp_peer_soft
,
7344 clear_bgp_peer_soft_cmd
,
7345 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft",
7348 "BGP neighbor address to clear\n"
7349 "BGP IPv6 neighbor to clear\n"
7350 "BGP neighbor on interface to clear\n"
7353 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
7354 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7357 ALIAS (clear_bgp_peer_soft
,
7358 clear_bgp_ipv6_peer_soft_cmd
,
7359 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft",
7363 "BGP neighbor address to clear\n"
7364 "BGP IPv6 neighbor to clear\n"
7365 "BGP neighbor on interface to clear\n"
7368 DEFUN (clear_ip_bgp_peer_group_soft
,
7369 clear_ip_bgp_peer_group_soft_cmd
,
7370 "clear ip bgp peer-group WORD soft",
7374 "Clear all members of peer-group\n"
7375 "BGP peer-group name\n"
7378 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
7379 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7382 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
7383 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
7384 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
7388 "Clear all members of peer-group\n"
7389 "BGP peer-group name\n"
7391 "Address Family modifier\n"
7392 "Address Family modifier\n"
7395 if (strncmp (argv
[1], "m", 1) == 0)
7396 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
7397 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7399 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
7400 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7403 DEFUN (clear_bgp_peer_group_soft
,
7404 clear_bgp_peer_group_soft_cmd
,
7405 "clear bgp peer-group WORD soft",
7408 "Clear all members of peer-group\n"
7409 "BGP peer-group name\n"
7412 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
7413 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7416 ALIAS (clear_bgp_peer_group_soft
,
7417 clear_bgp_ipv6_peer_group_soft_cmd
,
7418 "clear bgp ipv6 peer-group WORD soft",
7422 "Clear all members of peer-group\n"
7423 "BGP peer-group name\n"
7426 DEFUN (clear_ip_bgp_external_soft
,
7427 clear_ip_bgp_external_soft_cmd
,
7428 "clear ip bgp external soft",
7432 "Clear all external peers\n"
7435 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7436 BGP_CLEAR_SOFT_BOTH
, NULL
);
7439 DEFUN (clear_ip_bgp_external_ipv4_soft
,
7440 clear_ip_bgp_external_ipv4_soft_cmd
,
7441 "clear ip bgp external ipv4 (unicast|multicast) soft",
7445 "Clear all external peers\n"
7447 "Address Family modifier\n"
7448 "Address Family modifier\n"
7451 if (strncmp (argv
[0], "m", 1) == 0)
7452 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
7453 BGP_CLEAR_SOFT_BOTH
, NULL
);
7455 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7456 BGP_CLEAR_SOFT_BOTH
, NULL
);
7459 DEFUN (clear_bgp_external_soft
,
7460 clear_bgp_external_soft_cmd
,
7461 "clear bgp external soft",
7464 "Clear all external peers\n"
7467 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
7468 BGP_CLEAR_SOFT_BOTH
, NULL
);
7471 ALIAS (clear_bgp_external_soft
,
7472 clear_bgp_ipv6_external_soft_cmd
,
7473 "clear bgp ipv6 external soft",
7477 "Clear all external peers\n"
7480 DEFUN (clear_ip_bgp_as_soft
,
7481 clear_ip_bgp_as_soft_cmd
,
7482 "clear ip bgp " CMD_AS_RANGE
" soft",
7486 "Clear peers with the AS number\n"
7489 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7490 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7493 DEFUN (clear_ip_bgp_as_ipv4_soft
,
7494 clear_ip_bgp_as_ipv4_soft_cmd
,
7495 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft",
7499 "Clear peers with the AS number\n"
7501 "Address Family Modifier\n"
7502 "Address Family Modifier\n"
7505 if (strncmp (argv
[1], "m", 1) == 0)
7506 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
7507 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7509 return bgp_clear_vty (vty
, NULL
,AFI_IP
, SAFI_UNICAST
, clear_as
,
7510 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7513 DEFUN (clear_ip_bgp_as_vpnv4_soft
,
7514 clear_ip_bgp_as_vpnv4_soft_cmd
,
7515 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft",
7519 "Clear peers with the AS number\n"
7521 "Address Family Modifier\n"
7524 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
7525 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7528 DEFUN (clear_bgp_as_soft
,
7529 clear_bgp_as_soft_cmd
,
7530 "clear bgp " CMD_AS_RANGE
" soft",
7533 "Clear peers with the AS number\n"
7536 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
7537 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7540 ALIAS (clear_bgp_as_soft
,
7541 clear_bgp_ipv6_as_soft_cmd
,
7542 "clear bgp ipv6 " CMD_AS_RANGE
" soft",
7546 "Clear peers with the AS number\n"
7549 /* RS-client soft reconfiguration. */
7551 DEFUN (clear_bgp_all_rsclient
,
7552 clear_bgp_all_rsclient_cmd
,
7553 "clear bgp * rsclient",
7557 BGP_SOFT_RSCLIENT_RIB_STR
)
7560 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
7561 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
7563 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
7564 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
7567 ALIAS (clear_bgp_all_rsclient
,
7568 clear_bgp_ipv6_all_rsclient_cmd
,
7569 "clear bgp ipv6 * rsclient",
7574 BGP_SOFT_RSCLIENT_RIB_STR
)
7576 ALIAS (clear_bgp_all_rsclient
,
7577 clear_bgp_instance_all_rsclient_cmd
,
7578 "clear bgp view WORD * rsclient",
7584 BGP_SOFT_RSCLIENT_RIB_STR
)
7586 ALIAS (clear_bgp_all_rsclient
,
7587 clear_bgp_ipv6_instance_all_rsclient_cmd
,
7588 "clear bgp ipv6 view WORD * rsclient",
7595 BGP_SOFT_RSCLIENT_RIB_STR
)
7596 #endif /* HAVE_IPV6 */
7598 DEFUN (clear_ip_bgp_all_rsclient
,
7599 clear_ip_bgp_all_rsclient_cmd
,
7600 "clear ip bgp * rsclient",
7605 BGP_SOFT_RSCLIENT_RIB_STR
)
7608 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
7609 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
7611 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7612 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
7615 ALIAS (clear_ip_bgp_all_rsclient
,
7616 clear_ip_bgp_instance_all_rsclient_cmd
,
7617 "clear ip bgp view WORD * rsclient",
7624 BGP_SOFT_RSCLIENT_RIB_STR
)
7627 DEFUN (clear_bgp_peer_rsclient
,
7628 clear_bgp_peer_rsclient_cmd
,
7629 "clear bgp (A.B.C.D|X:X::X:X|WORD) rsclient",
7632 "BGP neighbor IP address to clear\n"
7633 "BGP IPv6 neighbor to clear\n"
7634 "BGP neighbor on interface to clear\n"
7635 BGP_SOFT_RSCLIENT_RIB_STR
)
7638 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
7639 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
7641 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
7642 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
7645 ALIAS (clear_bgp_peer_rsclient
,
7646 clear_bgp_ipv6_peer_rsclient_cmd
,
7647 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) rsclient",
7651 "BGP neighbor IP address to clear\n"
7652 "BGP IPv6 neighbor to clear\n"
7653 "BGP neighbor on interface to clear\n"
7654 BGP_SOFT_RSCLIENT_RIB_STR
)
7656 ALIAS (clear_bgp_peer_rsclient
,
7657 clear_bgp_instance_peer_rsclient_cmd
,
7658 "clear bgp view WORD (A.B.C.D|X:X::X:X|WORD) rsclient",
7663 "BGP neighbor IP address to clear\n"
7664 "BGP IPv6 neighbor to clear\n"
7665 "BGP neighbor on interface to clear\n"
7666 BGP_SOFT_RSCLIENT_RIB_STR
)
7668 ALIAS (clear_bgp_peer_rsclient
,
7669 clear_bgp_ipv6_instance_peer_rsclient_cmd
,
7670 "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X|WORD) rsclient",
7676 "BGP neighbor IP address to clear\n"
7677 "BGP IPv6 neighbor to clear\n"
7678 "BGP neighbor on interface to clear\n"
7679 BGP_SOFT_RSCLIENT_RIB_STR
)
7680 #endif /* HAVE_IPV6 */
7682 DEFUN (clear_ip_bgp_peer_rsclient
,
7683 clear_ip_bgp_peer_rsclient_cmd
,
7684 "clear ip bgp (A.B.C.D|X:X::X:X|WORD) rsclient",
7688 "BGP neighbor IP address to clear\n"
7689 "BGP IPv6 neighbor to clear\n"
7690 "BGP neighbor on interface to clear\n"
7691 BGP_SOFT_RSCLIENT_RIB_STR
)
7694 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_peer
,
7695 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
7697 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7698 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
7701 ALIAS (clear_ip_bgp_peer_rsclient
,
7702 clear_ip_bgp_instance_peer_rsclient_cmd
,
7703 "clear ip bgp view WORD (A.B.C.D|X:X::X:X|WORD) rsclient",
7709 "BGP neighbor IP address to clear\n"
7710 "BGP IPv6 neighbor to clear\n"
7711 "BGP neighbor on interface to clear\n"
7712 BGP_SOFT_RSCLIENT_RIB_STR
)
7714 DEFUN (show_bgp_views
,
7719 "Show the defined BGP views\n")
7721 struct list
*inst
= bm
->bgp
;
7722 struct listnode
*node
;
7725 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE
))
7727 vty_out (vty
, "Multiple BGP views are not defined%s", VTY_NEWLINE
);
7731 vty_out (vty
, "Defined BGP views:%s", VTY_NEWLINE
);
7732 for (ALL_LIST_ELEMENTS_RO(inst
, node
, bgp
))
7733 vty_out (vty
, "\t%s (AS%u)%s",
7734 bgp
->name
? bgp
->name
: "(null)",
7735 bgp
->as
, VTY_NEWLINE
);
7740 DEFUN (show_bgp_memory
,
7741 show_bgp_memory_cmd
,
7745 "Global BGP memory statistics\n")
7747 char memstrbuf
[MTYPE_MEMSTR_LEN
];
7748 unsigned long count
;
7750 /* RIB related usage stats */
7751 count
= mtype_stats_alloc (MTYPE_BGP_NODE
);
7752 vty_out (vty
, "%ld RIB nodes, using %s of memory%s", count
,
7753 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7754 count
* sizeof (struct bgp_node
)),
7757 count
= mtype_stats_alloc (MTYPE_BGP_ROUTE
);
7758 vty_out (vty
, "%ld BGP routes, using %s of memory%s", count
,
7759 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7760 count
* sizeof (struct bgp_info
)),
7762 if ((count
= mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA
)))
7763 vty_out (vty
, "%ld BGP route ancillaries, using %s of memory%s", count
,
7764 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7765 count
* sizeof (struct bgp_info_extra
)),
7768 if ((count
= mtype_stats_alloc (MTYPE_BGP_STATIC
)))
7769 vty_out (vty
, "%ld Static routes, using %s of memory%s", count
,
7770 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7771 count
* sizeof (struct bgp_static
)),
7774 if ((count
= mtype_stats_alloc (MTYPE_BGP_PACKET
)))
7775 vty_out (vty
, "%ld Packets, using %s of memory%s", count
,
7776 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7777 count
* sizeof (struct bpacket
)),
7781 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_IN
)))
7782 vty_out (vty
, "%ld Adj-In entries, using %s of memory%s", count
,
7783 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7784 count
* sizeof (struct bgp_adj_in
)),
7786 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_OUT
)))
7787 vty_out (vty
, "%ld Adj-Out entries, using %s of memory%s", count
,
7788 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7789 count
* sizeof (struct bgp_adj_out
)),
7792 if ((count
= mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE
)))
7793 vty_out (vty
, "%ld Nexthop cache entries, using %s of memory%s", count
,
7794 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7795 count
* sizeof (struct bgp_nexthop_cache
)),
7798 if ((count
= mtype_stats_alloc (MTYPE_BGP_DAMP_INFO
)))
7799 vty_out (vty
, "%ld Dampening entries, using %s of memory%s", count
,
7800 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7801 count
* sizeof (struct bgp_damp_info
)),
7805 count
= attr_count();
7806 vty_out (vty
, "%ld BGP attributes, using %s of memory%s", count
,
7807 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7808 count
* sizeof(struct attr
)),
7810 if ((count
= mtype_stats_alloc (MTYPE_ATTR_EXTRA
)))
7811 vty_out (vty
, "%ld BGP extra attributes, using %s of memory%s", count
,
7812 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7813 count
* sizeof(struct attr_extra
)),
7816 if ((count
= attr_unknown_count()))
7817 vty_out (vty
, "%ld unknown attributes%s", count
, VTY_NEWLINE
);
7819 /* AS_PATH attributes */
7820 count
= aspath_count ();
7821 vty_out (vty
, "%ld BGP AS-PATH entries, using %s of memory%s", count
,
7822 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7823 count
* sizeof (struct aspath
)),
7826 count
= mtype_stats_alloc (MTYPE_AS_SEG
);
7827 vty_out (vty
, "%ld BGP AS-PATH segments, using %s of memory%s", count
,
7828 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7829 count
* sizeof (struct assegment
)),
7832 /* Other attributes */
7833 if ((count
= community_count ()))
7834 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
7835 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7836 count
* sizeof (struct community
)),
7838 if ((count
= mtype_stats_alloc (MTYPE_ECOMMUNITY
)))
7839 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
7840 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7841 count
* sizeof (struct ecommunity
)),
7844 if ((count
= mtype_stats_alloc (MTYPE_CLUSTER
)))
7845 vty_out (vty
, "%ld Cluster lists, using %s of memory%s", count
,
7846 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7847 count
* sizeof (struct cluster_list
)),
7850 /* Peer related usage */
7851 count
= mtype_stats_alloc (MTYPE_BGP_PEER
);
7852 vty_out (vty
, "%ld peers, using %s of memory%s", count
,
7853 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7854 count
* sizeof (struct peer
)),
7857 if ((count
= mtype_stats_alloc (MTYPE_PEER_GROUP
)))
7858 vty_out (vty
, "%ld peer groups, using %s of memory%s", count
,
7859 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7860 count
* sizeof (struct peer_group
)),
7864 if ((count
= mtype_stats_alloc (MTYPE_HASH
)))
7865 vty_out (vty
, "%ld hash tables, using %s of memory%s", count
,
7866 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7867 count
* sizeof (struct hash
)),
7869 if ((count
= mtype_stats_alloc (MTYPE_HASH_BACKET
)))
7870 vty_out (vty
, "%ld hash buckets, using %s of memory%s", count
,
7871 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7872 count
* sizeof (struct hash_backet
)),
7874 if ((count
= mtype_stats_alloc (MTYPE_BGP_REGEXP
)))
7875 vty_out (vty
, "%ld compiled regexes, using %s of memory%s", count
,
7876 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7877 count
* sizeof (regex_t
)),
7883 bgp_adj_out_count (struct peer
*peer
, int afi
, int safi
)
7885 struct bgp_table
*table
;
7886 struct bgp_node
*rn
;
7887 struct bgp_adj_out
*adj
;
7890 if (!peer
) return(0);
7892 table
= peer
->bgp
->rib
[afi
][safi
];
7893 if (!table
) return(0);
7894 for (rn
= bgp_table_top(table
); rn
; rn
= bgp_route_next(rn
))
7895 if (bgp_adj_out_lookup(peer
, NULL
, afi
, safi
, rn
))
7900 /* Show BGP peer's summary information. */
7902 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
, char *delimit
)
7905 struct listnode
*node
, *nnode
;
7906 unsigned int count
= 0;
7907 char timebuf
[BGP_UPTIME_LEN
];
7910 /* Header string for each address family. */
7911 static char header
[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
7912 static char header_csv
[] = "Neighbor, V, AS, MsgRcvd, MsgSent, TblVer, InQ, OutQ, Up/Down, State/PfxRcd, PfxAdv";
7914 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
7916 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
7919 if (peer
->afc
[afi
][safi
])
7925 vty_out (vty
, "%s%s", header_csv
, VTY_NEWLINE
);
7931 char memstrbuf
[MTYPE_MEMSTR_LEN
];
7933 /* Usage summary and header */
7935 "BGP router identifier %s, local AS number %u%s",
7936 inet_ntoa (bgp
->router_id
), bgp
->as
, VTY_NEWLINE
);
7937 if (bgp_update_delay_configured(bgp
))
7939 vty_out (vty
, "Read-only mode update-delay limit: %d seconds%s",
7940 bgp
->v_update_delay
, VTY_NEWLINE
);
7941 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
7942 vty_out (vty
, " Establish wait: %d seconds%s",
7943 bgp
->v_establish_wait
, VTY_NEWLINE
);
7944 if (bgp_update_delay_active(bgp
))
7946 vty_out (vty
, " First neighbor established: %s%s",
7947 bgp
->update_delay_begin_time
, VTY_NEWLINE
);
7948 vty_out (vty
, " Delay in progress%s", VTY_NEWLINE
);
7952 if (bgp
->update_delay_over
)
7954 vty_out (vty
, " First neighbor established: %s%s",
7955 bgp
->update_delay_begin_time
, VTY_NEWLINE
);
7956 vty_out (vty
, " Best-paths resumed: %s%s",
7957 bgp
->update_delay_end_time
, VTY_NEWLINE
);
7958 vty_out (vty
, " zebra update resumed: %s%s",
7959 bgp
->update_delay_zebra_resume_time
, VTY_NEWLINE
);
7960 vty_out (vty
, " peers update resumed: %s%s",
7961 bgp
->update_delay_peers_resume_time
, VTY_NEWLINE
);
7966 if (bgp_maxmed_onstartup_configured(bgp
) && bgp
->maxmed_active
)
7967 vty_out (vty
, "Max-med on-startup active%s", VTY_NEWLINE
);
7968 if (bgp
->v_maxmed_admin
)
7969 vty_out (vty
, "Max-med administrative active%s", VTY_NEWLINE
);
7971 vty_out(vty
, "BGP table version %llu%s",
7972 bgp_table_version(bgp
->rib
[afi
][safi
]), VTY_NEWLINE
);
7974 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
7975 vty_out (vty
, "RIB entries %ld, using %s of memory%s", ents
,
7976 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7977 ents
* sizeof (struct bgp_node
)),
7980 /* Peer related usage */
7981 ents
= listcount (bgp
->peer
);
7982 vty_out (vty
, "Peers %ld, using %s of memory%s",
7984 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7985 ents
* sizeof (struct peer
)),
7988 if ((ents
= listcount (bgp
->rsclient
)))
7989 vty_out (vty
, "RS-Client peers %ld, using %s of memory%s",
7991 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7992 ents
* sizeof (struct peer
)),
7995 if ((ents
= listcount (bgp
->group
)))
7996 vty_out (vty
, "Peer groups %ld, using %s of memory%s", ents
,
7997 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
7998 ents
* sizeof (struct peer_group
)),
8001 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
8002 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
8003 vty_out (vty
, "%s", VTY_NEWLINE
);
8004 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
8009 len
= vty_out (vty
, "%s", peer
->host
);
8012 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
8014 vty_out (vty
, "%*s", len
, " ");
8017 vty_out(vty
, "%c", *delimit
);
8019 vty_out (vty
, "4 ");
8022 vty_out(vty
, "%c", *delimit
);
8025 vty_out (vty
, "%5u %7d %7d %8lu %4d %4u ",
8027 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
8028 + peer
->notify_in
+ peer
->refresh_in
8029 + peer
->dynamic_cap_in
,
8030 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
8031 + peer
->notify_out
+ peer
->refresh_out
8032 + peer
->dynamic_cap_out
,
8033 peer
->version
[afi
][safi
],
8035 (unsigned long) peer
->obuf
->count
);
8037 vty_out (vty
, "%5u %c %7d %c %7d %c %8lu %c %4d %c %4u %c",
8039 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
8040 + peer
->notify_in
+ peer
->refresh_in
8041 + peer
->dynamic_cap_in
, *delimit
,
8042 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
8043 + peer
->notify_out
+ peer
->refresh_out
8044 + peer
->dynamic_cap_out
, *delimit
,
8045 peer
->version
[afi
][safi
], *delimit
,
8047 (unsigned long) peer
->obuf
->count
, *delimit
);
8049 vty_out (vty
, "%8s",
8050 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
));
8052 vty_out(vty
, "%c", *delimit
);
8054 if (peer
->status
== Established
)
8055 vty_out (vty
, " %8ld", peer
->pcount
[afi
][safi
]);
8058 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
8059 vty_out (vty
, " Idle (Admin)");
8060 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
8061 vty_out (vty
, " Idle (PfxCt)");
8063 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, peer
->status
));
8066 vty_out(vty
, ", %d", bgp_adj_out_count(peer
, afi
, safi
));
8068 vty_out (vty
, "%s", VTY_NEWLINE
);
8073 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
8074 count
, VTY_NEWLINE
);
8076 vty_out (vty
, "No %s neighbor is configured%s",
8077 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
8083 bgp_show_summary_vty (struct vty
*vty
, const char *name
,
8084 afi_t afi
, safi_t safi
, char *delimit
)
8090 bgp
= bgp_lookup_by_name (name
);
8094 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
8098 bgp_show_summary (vty
, bgp
, afi
, safi
, delimit
);
8102 bgp
= bgp_get_default ();
8105 bgp_show_summary (vty
, bgp
, afi
, safi
, delimit
);
8110 /* `show ip bgp summary' commands. */
8111 DEFUN (show_ip_bgp_summary
,
8112 show_ip_bgp_summary_cmd
,
8113 "show ip bgp summary",
8117 "Summary of BGP neighbor status\n")
8119 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, NULL
);
8122 DEFUN (show_ip_bgp_summary_csv
,
8123 show_ip_bgp_summary_csv_cmd
,
8124 "show ip bgp summary csv",
8128 "Summary of BGP neighbor status\n")
8131 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, &csv
);
8134 DEFUN (show_ip_bgp_instance_summary
,
8135 show_ip_bgp_instance_summary_cmd
,
8136 "show ip bgp view WORD summary",
8142 "Summary of BGP neighbor status\n")
8144 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, NULL
);
8147 DEFUN (show_ip_bgp_ipv4_summary
,
8148 show_ip_bgp_ipv4_summary_cmd
,
8149 "show ip bgp ipv4 (unicast|multicast) summary",
8154 "Address Family modifier\n"
8155 "Address Family modifier\n"
8156 "Summary of BGP neighbor status\n")
8158 if (strncmp (argv
[0], "m", 1) == 0)
8159 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, NULL
);
8161 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, NULL
);
8164 ALIAS (show_ip_bgp_ipv4_summary
,
8165 show_bgp_ipv4_safi_summary_cmd
,
8166 "show bgp ipv4 (unicast|multicast) summary",
8170 "Address Family modifier\n"
8171 "Address Family modifier\n"
8172 "Summary of BGP neighbor status\n")
8174 DEFUN (show_ip_bgp_instance_ipv4_summary
,
8175 show_ip_bgp_instance_ipv4_summary_cmd
,
8176 "show ip bgp view WORD ipv4 (unicast|multicast) summary",
8183 "Address Family modifier\n"
8184 "Address Family modifier\n"
8185 "Summary of BGP neighbor status\n")
8187 if (strncmp (argv
[1], "m", 1) == 0)
8188 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, NULL
);
8190 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, NULL
);
8193 ALIAS (show_ip_bgp_instance_ipv4_summary
,
8194 show_bgp_instance_ipv4_safi_summary_cmd
,
8195 "show bgp view WORD ipv4 (unicast|multicast) summary",
8201 "Address Family modifier\n"
8202 "Address Family modifier\n"
8203 "Summary of BGP neighbor status\n")
8205 DEFUN (show_ip_bgp_vpnv4_all_summary
,
8206 show_ip_bgp_vpnv4_all_summary_cmd
,
8207 "show ip bgp vpnv4 all summary",
8211 "Display VPNv4 NLRI specific information\n"
8212 "Display information about all VPNv4 NLRIs\n"
8213 "Summary of BGP neighbor status\n")
8215 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, NULL
);
8218 DEFUN (show_ip_bgp_vpnv4_rd_summary
,
8219 show_ip_bgp_vpnv4_rd_summary_cmd
,
8220 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary",
8224 "Display VPNv4 NLRI specific information\n"
8225 "Display information for a route distinguisher\n"
8226 "VPN Route Distinguisher\n"
8227 "Summary of BGP neighbor status\n")
8230 struct prefix_rd prd
;
8232 ret
= str2prefix_rd (argv
[0], &prd
);
8235 vty_out (vty
, "%% Malformed Route Distinguisher%s", VTY_NEWLINE
);
8239 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, NULL
);
8243 DEFUN (show_bgp_summary
,
8244 show_bgp_summary_cmd
,
8248 "Summary of BGP neighbor status\n")
8250 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, NULL
);
8253 DEFUN (show_bgp_summary_csv
,
8254 show_bgp_summary_csv_cmd
,
8255 "show bgp summary csv",
8258 "Summary of BGP neighbor status\n")
8261 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, &csv
);
8264 DEFUN (show_bgp_instance_summary
,
8265 show_bgp_instance_summary_cmd
,
8266 "show bgp view WORD summary",
8271 "Summary of BGP neighbor status\n")
8273 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, NULL
);
8276 ALIAS (show_bgp_summary
,
8277 show_bgp_ipv6_summary_cmd
,
8278 "show bgp ipv6 summary",
8282 "Summary of BGP neighbor status\n")
8284 ALIAS (show_bgp_instance_summary
,
8285 show_bgp_instance_ipv6_summary_cmd
,
8286 "show bgp view WORD ipv6 summary",
8292 "Summary of BGP neighbor status\n")
8294 DEFUN (show_bgp_ipv6_safi_summary
,
8295 show_bgp_ipv6_safi_summary_cmd
,
8296 "show bgp ipv6 (unicast|multicast) summary",
8300 "Address Family modifier\n"
8301 "Address Family modifier\n"
8302 "Summary of BGP neighbor status\n")
8304 if (strncmp (argv
[0], "m", 1) == 0)
8305 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
, NULL
);
8307 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, NULL
);
8310 DEFUN (show_bgp_instance_ipv6_safi_summary
,
8311 show_bgp_instance_ipv6_safi_summary_cmd
,
8312 "show bgp view WORD ipv6 (unicast|multicast) summary",
8318 "Address Family modifier\n"
8319 "Address Family modifier\n"
8320 "Summary of BGP neighbor status\n")
8322 if (strncmp (argv
[1], "m", 1) == 0)
8323 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_MULTICAST
, NULL
);
8325 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, NULL
);
8329 DEFUN (show_ipv6_bgp_summary
,
8330 show_ipv6_bgp_summary_cmd
,
8331 "show ipv6 bgp summary",
8335 "Summary of BGP neighbor status\n")
8337 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, NULL
);
8341 DEFUN (show_ipv6_mbgp_summary
,
8342 show_ipv6_mbgp_summary_cmd
,
8343 "show ipv6 mbgp summary",
8347 "Summary of BGP neighbor status\n")
8349 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
, NULL
);
8351 #endif /* HAVE_IPV6 */
8354 afi_safi_print (afi_t afi
, safi_t safi
)
8356 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
8357 return "IPv4 Unicast";
8358 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
8359 return "IPv4 Multicast";
8360 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
8361 return "VPNv4 Unicast";
8362 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
8363 return "IPv6 Unicast";
8364 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
8365 return "IPv6 Multicast";
8370 /* Show BGP peer's information. */
8378 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
,
8379 afi_t afi
, safi_t safi
,
8380 u_int16_t adv_smcap
, u_int16_t adv_rmcap
,
8381 u_int16_t rcv_smcap
, u_int16_t rcv_rmcap
)
8384 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
8385 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
8387 vty_out (vty
, " Send-mode: ");
8388 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
8389 vty_out (vty
, "advertised");
8390 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
8391 vty_out (vty
, "%sreceived",
8392 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
8394 vty_out (vty
, "%s", VTY_NEWLINE
);
8398 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
8399 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
8401 vty_out (vty
, " Receive-mode: ");
8402 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
8403 vty_out (vty
, "advertised");
8404 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
8405 vty_out (vty
, "%sreceived",
8406 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
8408 vty_out (vty
, "%s", VTY_NEWLINE
);
8413 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
)
8415 struct bgp_filter
*filter
;
8416 struct peer_af
*paf
;
8417 char orf_pfx_name
[BUFSIZ
];
8420 filter
= &p
->filter
[afi
][safi
];
8422 vty_out (vty
, " For address family: %s%s", afi_safi_print (afi
, safi
),
8425 if (p
->af_group
[afi
][safi
])
8426 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
8428 paf
= peer_af_find(p
, afi
, safi
);
8429 if (paf
&& PAF_SUBGRP(paf
))
8431 vty_out (vty
, " Update group %llu, subgroup %llu%s",
8432 PAF_UPDGRP(paf
)->id
, PAF_SUBGRP(paf
)->id
, VTY_NEWLINE
);
8433 vty_out (vty
, " Packet Queue length %d%s",
8434 bpacket_queue_virtual_length(paf
), VTY_NEWLINE
);
8437 vty_out(vty
, " Not part of any update group%s", VTY_NEWLINE
);
8439 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
8440 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
8441 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
8442 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
8443 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
8444 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
8445 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
8447 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
8448 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
8449 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
8450 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
8452 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
8453 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
8454 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
8455 PEER_CAP_ORF_PREFIX_SM_ADV
,
8456 PEER_CAP_ORF_PREFIX_RM_ADV
,
8457 PEER_CAP_ORF_PREFIX_SM_RCV
,
8458 PEER_CAP_ORF_PREFIX_RM_RCV
);
8460 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
8461 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
8462 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
8463 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
8465 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
8466 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
8467 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
8468 PEER_CAP_ORF_PREFIX_SM_ADV
,
8469 PEER_CAP_ORF_PREFIX_RM_ADV
,
8470 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
8471 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
);
8474 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
8475 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
);
8477 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
8480 vty_out (vty
, " Outbound Route Filter (ORF):");
8481 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
8482 vty_out (vty
, " sent;");
8484 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
8485 vty_out (vty
, "%s", VTY_NEWLINE
);
8487 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
8488 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
8490 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
8491 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
8492 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
8493 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
8494 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
8495 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
8496 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
))
8497 vty_out (vty
, " Private AS numbers replaced in updates to this neighbor%s", VTY_NEWLINE
);
8498 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
8499 vty_out (vty
, " Private AS numbers removed in updates to this neighbor%s", VTY_NEWLINE
);
8501 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_OVERRIDE
))
8502 vty_out (vty
, " Override ASNs in outbound updates if aspath equals remote-as%s", VTY_NEWLINE
);
8504 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
) ||
8505 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF_ALL
))
8506 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
8507 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
8508 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
8509 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
8510 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
8511 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
8512 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
8513 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
8514 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
8516 vty_out (vty
, " Community attribute sent to this neighbor");
8517 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
8518 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
8519 vty_out (vty
, "(both)%s", VTY_NEWLINE
);
8520 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
8521 vty_out (vty
, "(extended)%s", VTY_NEWLINE
);
8523 vty_out (vty
, "(standard)%s", VTY_NEWLINE
);
8525 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
8527 vty_out (vty
, " Default information originate,");
8529 if (p
->default_rmap
[afi
][safi
].name
)
8530 vty_out (vty
, " default route-map %s%s,",
8531 p
->default_rmap
[afi
][safi
].map
? "*" : "",
8532 p
->default_rmap
[afi
][safi
].name
);
8533 if (paf
&& PAF_SUBGRP(paf
) && CHECK_FLAG(PAF_SUBGRP(paf
)->sflags
,
8534 SUBGRP_STATUS_DEFAULT_ORIGINATE
))
8535 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
8537 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
8540 if (filter
->plist
[FILTER_IN
].name
8541 || filter
->dlist
[FILTER_IN
].name
8542 || filter
->aslist
[FILTER_IN
].name
8543 || filter
->map
[RMAP_IN
].name
)
8544 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
8545 if (filter
->plist
[FILTER_OUT
].name
8546 || filter
->dlist
[FILTER_OUT
].name
8547 || filter
->aslist
[FILTER_OUT
].name
8548 || filter
->map
[RMAP_OUT
].name
8549 || filter
->usmap
.name
)
8550 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
8551 if (filter
->map
[RMAP_IMPORT
].name
)
8552 vty_out (vty
, " Import policy for this RS-client configured%s", VTY_NEWLINE
);
8553 if (filter
->map
[RMAP_EXPORT
].name
)
8554 vty_out (vty
, " Export policy for this RS-client configured%s", VTY_NEWLINE
);
8557 if (filter
->plist
[FILTER_IN
].name
)
8558 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
8559 filter
->plist
[FILTER_IN
].plist
? "*" : "",
8560 filter
->plist
[FILTER_IN
].name
,
8562 if (filter
->plist
[FILTER_OUT
].name
)
8563 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
8564 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
8565 filter
->plist
[FILTER_OUT
].name
,
8568 /* distribute-list */
8569 if (filter
->dlist
[FILTER_IN
].name
)
8570 vty_out (vty
, " Incoming update network filter list is %s%s%s",
8571 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
8572 filter
->dlist
[FILTER_IN
].name
,
8574 if (filter
->dlist
[FILTER_OUT
].name
)
8575 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
8576 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
8577 filter
->dlist
[FILTER_OUT
].name
,
8581 if (filter
->aslist
[FILTER_IN
].name
)
8582 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
8583 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
8584 filter
->aslist
[FILTER_IN
].name
,
8586 if (filter
->aslist
[FILTER_OUT
].name
)
8587 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
8588 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
8589 filter
->aslist
[FILTER_OUT
].name
,
8593 if (filter
->map
[RMAP_IN
].name
)
8594 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
8595 filter
->map
[RMAP_IN
].map
? "*" : "",
8596 filter
->map
[RMAP_IN
].name
,
8598 if (filter
->map
[RMAP_OUT
].name
)
8599 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
8600 filter
->map
[RMAP_OUT
].map
? "*" : "",
8601 filter
->map
[RMAP_OUT
].name
,
8603 if (filter
->map
[RMAP_IMPORT
].name
)
8604 vty_out (vty
, " Route map for advertisements going into this RS-client's table is %s%s%s",
8605 filter
->map
[RMAP_IMPORT
].map
? "*" : "",
8606 filter
->map
[RMAP_IMPORT
].name
,
8608 if (filter
->map
[RMAP_EXPORT
].name
)
8609 vty_out (vty
, " Route map for advertisements coming from this RS-client is %s%s%s",
8610 filter
->map
[RMAP_EXPORT
].map
? "*" : "",
8611 filter
->map
[RMAP_EXPORT
].name
,
8614 /* unsuppress-map */
8615 if (filter
->usmap
.name
)
8616 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
8617 filter
->usmap
.map
? "*" : "",
8618 filter
->usmap
.name
, VTY_NEWLINE
);
8620 /* Receive prefix count */
8621 vty_out (vty
, " %ld accepted prefixes%s", p
->pcount
[afi
][safi
], VTY_NEWLINE
);
8623 /* Maximum prefix */
8624 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
8626 vty_out (vty
, " Maximum prefixes allowed %ld%s%s", p
->pmax
[afi
][safi
],
8627 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
8628 ? " (warning-only)" : "", VTY_NEWLINE
);
8629 vty_out (vty
, " Threshold for warning message %d%%",
8630 p
->pmax_threshold
[afi
][safi
]);
8631 if (p
->pmax_restart
[afi
][safi
])
8632 vty_out (vty
, ", restart interval %d min", p
->pmax_restart
[afi
][safi
]);
8633 vty_out (vty
, "%s", VTY_NEWLINE
);
8636 vty_out (vty
, "%s", VTY_NEWLINE
);
8640 bgp_show_peer (struct vty
*vty
, struct peer
*p
)
8643 char buf1
[BUFSIZ
], buf
[SU_ADDRSTRLEN
];
8644 char timebuf
[BGP_UPTIME_LEN
];
8652 if (p
->conf_if
) /* Configured interface name. */
8653 vty_out (vty
, "BGP neighbor on %s: %s, ", p
->conf_if
,
8654 BGP_PEER_SU_UNSPEC(p
) ? "None" :
8655 sockunion2str (&p
->su
, buf
, SU_ADDRSTRLEN
));
8656 else /* Configured IP address. */
8657 vty_out (vty
, "BGP neighbor is %s, ", p
->host
);
8658 vty_out (vty
, "remote AS %u, ", p
->as
);
8659 vty_out (vty
, "local AS %u%s%s, ",
8660 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
8661 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
8663 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_REPLACE_AS
) ?
8664 " replace-as" : "");
8665 vty_out (vty
, "%s link%s",
8666 p
->as
== p
->local_as
? "internal" : "external",
8671 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
8675 vty_out (vty
, " Member of peer-group %s for session parameters%s",
8676 p
->group
->name
, VTY_NEWLINE
);
8678 /* Administrative shutdown. */
8679 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
8680 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
8683 vty_out (vty
, " BGP version 4");
8684 vty_out (vty
, ", remote router ID %s%s",
8685 inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
8689 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
)
8690 && bgp_confederation_peers_check (bgp
, p
->as
))
8691 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
8694 vty_out (vty
, " BGP state = %s",
8695 LOOKUP (bgp_status_msg
, p
->status
));
8696 if (p
->status
== Established
)
8697 vty_out (vty
, ", up for %8s",
8698 peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
));
8699 else if (p
->status
== Active
)
8701 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
8702 vty_out (vty
, " (passive)");
8703 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
8704 vty_out (vty
, " (NSF passive)");
8706 vty_out (vty
, "%s", VTY_NEWLINE
);
8709 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
));
8710 vty_out (vty
, ", Last write %s%s",
8711 peer_uptime (p
->last_write
, timebuf
, BGP_UPTIME_LEN
), VTY_NEWLINE
);
8713 /* Configured timer values. */
8714 vty_out (vty
, " Hold time is %d, keepalive interval is %d seconds%s",
8715 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
8716 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
8718 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
8719 vty_out (vty
, ", keepalive interval is %d seconds%s",
8720 p
->keepalive
, VTY_NEWLINE
);
8724 if (p
->status
== Established
)
8727 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
8728 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
8729 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
8730 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
8732 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
8733 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
8734 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
8735 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
8736 #endif /* HAVE_IPV6 */
8737 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
8738 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
8740 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
8743 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
)
8744 || CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
8746 vty_out (vty
, " 4 Byte AS:");
8747 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
8748 vty_out (vty
, " advertised");
8749 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
8750 vty_out (vty
, " %sreceived",
8751 CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
) ? "and " : "");
8752 vty_out (vty
, "%s", VTY_NEWLINE
);
8756 if (CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_RCV
)
8757 || CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_ADV
))
8759 vty_out (vty
, " AddPath:%s", VTY_NEWLINE
);
8761 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
8762 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
8765 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ||
8766 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
8768 vty_out (vty
, " %s: TX ", afi_safi_print (afi
, safi
));
8770 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
))
8771 vty_out (vty
, "advertised", afi_safi_print (afi
, safi
));
8773 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
8774 vty_out (vty
, "%sreceived", CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ? " and " : "" );
8776 vty_out (vty
, "%s", VTY_NEWLINE
);
8779 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ||
8780 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
8782 vty_out (vty
, " %s: RX ", afi_safi_print (afi
, safi
));
8784 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
))
8785 vty_out (vty
, "advertised", afi_safi_print (afi
, safi
));
8787 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
8788 vty_out (vty
, "%sreceived", CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ? " and " : "" );
8790 vty_out (vty
, "%s", VTY_NEWLINE
);
8796 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
8797 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
8799 vty_out (vty
, " Dynamic:");
8800 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
8801 vty_out (vty
, " advertised");
8802 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
8803 vty_out (vty
, " %sreceived",
8804 CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) ? "and " : "");
8805 vty_out (vty
, "%s", VTY_NEWLINE
);
8809 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
8810 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
8811 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
8813 vty_out (vty
, " Route refresh:");
8814 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
8815 vty_out (vty
, " advertised");
8816 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
8817 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
8818 vty_out (vty
, " %sreceived(%s)",
8819 CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) ? "and " : "",
8820 (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
8821 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)) ?
8822 "old & new" : CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) ? "old" : "new");
8824 vty_out (vty
, "%s", VTY_NEWLINE
);
8827 /* Multiprotocol Extensions */
8828 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
8829 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
8830 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
8832 vty_out (vty
, " Address family %s:", afi_safi_print (afi
, safi
));
8833 if (p
->afc_adv
[afi
][safi
])
8834 vty_out (vty
, " advertised");
8835 if (p
->afc_recv
[afi
][safi
])
8836 vty_out (vty
, " %sreceived", p
->afc_adv
[afi
][safi
] ? "and " : "");
8837 vty_out (vty
, "%s", VTY_NEWLINE
);
8840 /* Gracefull Restart */
8841 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
8842 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
8844 vty_out (vty
, " Graceful Restart Capabilty:");
8845 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
8846 vty_out (vty
, " advertised");
8847 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
8848 vty_out (vty
, " %sreceived",
8849 CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) ? "and " : "");
8850 vty_out (vty
, "%s", VTY_NEWLINE
);
8852 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
8854 int restart_af_count
= 0;
8856 vty_out (vty
, " Remote Restart timer is %d seconds%s",
8857 p
->v_gr_restart
, VTY_NEWLINE
);
8858 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
8860 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
8861 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
8862 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
8864 vty_out (vty
, "%s%s(%s)", restart_af_count
? ", " : "",
8865 afi_safi_print (afi
, safi
),
8866 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
) ?
8867 "preserved" : "not preserved");
8870 if (! restart_af_count
)
8871 vty_out (vty
, "none");
8872 vty_out (vty
, "%s", VTY_NEWLINE
);
8878 /* graceful restart information */
8879 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
8883 int eor_send_af_count
= 0;
8884 int eor_receive_af_count
= 0;
8886 vty_out (vty
, " Graceful restart informations:%s", VTY_NEWLINE
);
8887 if (p
->status
== Established
)
8889 vty_out (vty
, " End-of-RIB send: ");
8890 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
8891 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
8892 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
8894 vty_out (vty
, "%s%s", eor_send_af_count
? ", " : "",
8895 afi_safi_print (afi
, safi
));
8896 eor_send_af_count
++;
8898 vty_out (vty
, "%s", VTY_NEWLINE
);
8900 vty_out (vty
, " End-of-RIB received: ");
8901 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
8902 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
8903 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
8905 vty_out (vty
, "%s%s", eor_receive_af_count
? ", " : "",
8906 afi_safi_print (afi
, safi
));
8907 eor_receive_af_count
++;
8909 vty_out (vty
, "%s", VTY_NEWLINE
);
8912 if (p
->t_gr_restart
)
8913 vty_out (vty
, " The remaining time of restart timer is %ld%s",
8914 thread_timer_remain_second (p
->t_gr_restart
), VTY_NEWLINE
);
8917 vty_out (vty
, " The remaining time of stalepath timer is %ld%s",
8918 thread_timer_remain_second (p
->t_gr_stale
), VTY_NEWLINE
);
8921 /* Packet counts. */
8922 vty_out (vty
, " Message statistics:%s", VTY_NEWLINE
);
8923 vty_out (vty
, " Inq depth is 0%s", VTY_NEWLINE
);
8924 vty_out (vty
, " Outq depth is %lu%s", (unsigned long) p
->obuf
->count
, VTY_NEWLINE
);
8925 vty_out (vty
, " Sent Rcvd%s", VTY_NEWLINE
);
8926 vty_out (vty
, " Opens: %10d %10d%s", p
->open_out
, p
->open_in
, VTY_NEWLINE
);
8927 vty_out (vty
, " Notifications: %10d %10d%s", p
->notify_out
, p
->notify_in
, VTY_NEWLINE
);
8928 vty_out (vty
, " Updates: %10d %10d%s", p
->update_out
, p
->update_in
, VTY_NEWLINE
);
8929 vty_out (vty
, " Keepalives: %10d %10d%s", p
->keepalive_out
, p
->keepalive_in
, VTY_NEWLINE
);
8930 vty_out (vty
, " Route Refresh: %10d %10d%s", p
->refresh_out
, p
->refresh_in
, VTY_NEWLINE
);
8931 vty_out (vty
, " Capability: %10d %10d%s", p
->dynamic_cap_out
, p
->dynamic_cap_in
, VTY_NEWLINE
);
8932 vty_out (vty
, " Total: %10d %10d%s", p
->open_out
+ p
->notify_out
+
8933 p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
+ p
->dynamic_cap_out
,
8934 p
->open_in
+ p
->notify_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
+
8935 p
->dynamic_cap_in
, VTY_NEWLINE
);
8937 /* advertisement-interval */
8938 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
8939 p
->v_routeadv
, VTY_NEWLINE
);
8941 /* Update-source. */
8942 if (p
->update_if
|| p
->update_source
)
8944 vty_out (vty
, " Update source is ");
8946 vty_out (vty
, "%s", p
->update_if
);
8947 else if (p
->update_source
)
8949 sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
8950 vty_out (vty
, "%s", VTY_NEWLINE
);
8953 /* Default weight */
8954 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
8955 vty_out (vty
, " Default weight %d%s", p
->weight
,
8958 vty_out (vty
, "%s", VTY_NEWLINE
);
8960 /* Address Family Information */
8961 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
8962 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
8963 if (p
->afc
[afi
][safi
])
8964 bgp_show_peer_afi (vty
, p
, afi
, safi
);
8966 vty_out (vty
, " Connections established %d; dropped %d%s",
8967 p
->established
, p
->dropped
,
8970 if (! p
->last_reset
)
8971 vty_out (vty
, " Last reset never%s", VTY_NEWLINE
);
8974 vty_out (vty
, " Last reset %s, due to %s%s",
8975 peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
),
8976 peer_down_str
[(int) p
->last_reset
], VTY_NEWLINE
);
8978 if (p
->last_reset_cause_size
)
8980 msg
= p
->last_reset_cause
;
8981 vty_out(vty
, " Message received that caused BGP to send a NOTIFICATION:%s ", VTY_NEWLINE
);
8982 for (i
= 1; i
<= p
->last_reset_cause_size
; i
++)
8984 vty_out(vty
, "%02X", *msg
++);
8986 if (i
!= p
->last_reset_cause_size
)
8988 vty_out(vty
, "%s ", VTY_NEWLINE
);
8989 else if (i
% 4 == 0)
8992 vty_out(vty
, "%s", VTY_NEWLINE
);
8996 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
8998 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
9000 if (p
->t_pmax_restart
)
9001 vty_out (vty
, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
9002 p
->host
, thread_timer_remain_second (p
->t_pmax_restart
),
9005 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
9006 p
->host
, VTY_NEWLINE
);
9009 /* EBGP Multihop and GTSM */
9010 if (p
->sort
!= BGP_PEER_IBGP
)
9012 if (p
->gtsm_hops
> 0)
9013 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
9014 p
->gtsm_hops
, VTY_NEWLINE
);
9015 else if (p
->ttl
> 1)
9016 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
9017 p
->ttl
, VTY_NEWLINE
);
9021 if (p
->gtsm_hops
> 0)
9022 vty_out (vty
, " Internal BGP neighbor may be up to %d hops away.%s",
9023 p
->gtsm_hops
, VTY_NEWLINE
);
9026 /* Local address. */
9029 vty_out (vty
, "Local host: %s, Local port: %d%s",
9030 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
9031 ntohs (p
->su_local
->sin
.sin_port
),
9035 /* Remote address. */
9038 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
9039 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
9040 ntohs (p
->su_remote
->sin
.sin_port
),
9044 /* Nexthop display. */
9047 vty_out (vty
, "Nexthop: %s%s",
9048 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
9051 vty_out (vty
, "Nexthop global: %s%s",
9052 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
9054 vty_out (vty
, "Nexthop local: %s%s",
9055 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
9057 vty_out (vty
, "BGP connection: %s%s",
9058 p
->shared_network
? "shared network" : "non shared network",
9060 #endif /* HAVE_IPV6 */
9063 /* Timer information. */
9065 vty_out (vty
, "Next start timer due in %ld seconds%s",
9066 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
9068 vty_out (vty
, "Next connect timer due in %ld seconds%s",
9069 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
9071 vty_out (vty
, "MRAI (interval %u) timer expires in %ld seconds%s",
9072 p
->v_routeadv
, thread_timer_remain_second (p
->t_routeadv
),
9075 vty_out (vty
, "Read thread: %s Write thread: %s%s",
9076 p
->t_read
? "on" : "off",
9077 p
->t_write
? "on" : "off",
9080 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
9081 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
9082 bgp_capability_vty_out (vty
, p
);
9084 vty_out (vty
, "%s", VTY_NEWLINE
);
9088 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
,
9089 enum show_type type
, union sockunion
*su
, const char *conf_if
)
9091 struct listnode
*node
, *nnode
;
9095 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
9097 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
9103 bgp_show_peer (vty
, peer
);
9108 if (peer
->conf_if
&& !strcmp(peer
->conf_if
, conf_if
))
9111 bgp_show_peer (vty
, peer
);
9116 if (sockunion_same (&peer
->su
, su
))
9119 bgp_show_peer (vty
, peer
);
9126 if (type
== show_peer
&& ! find
)
9127 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
9133 bgp_show_neighbor_vty (struct vty
*vty
, const char *name
,
9134 enum show_type type
, const char *ip_str
)
9142 bgp
= bgp_lookup_by_name (name
);
9145 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
9151 bgp
= bgp_get_default ();
9158 ret
= str2sockunion (ip_str
, &su
);
9160 bgp_show_neighbor (vty
, bgp
, type
, NULL
, ip_str
);
9162 bgp_show_neighbor (vty
, bgp
, type
, &su
, NULL
);
9166 bgp_show_neighbor (vty
, bgp
, type
, NULL
, NULL
);
9173 /* "show ip bgp neighbors" commands. */
9174 DEFUN (show_ip_bgp_neighbors
,
9175 show_ip_bgp_neighbors_cmd
,
9176 "show ip bgp neighbors",
9180 "Detailed information on TCP and BGP neighbor connections\n")
9182 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
);
9185 ALIAS (show_ip_bgp_neighbors
,
9186 show_ip_bgp_ipv4_neighbors_cmd
,
9187 "show ip bgp ipv4 (unicast|multicast) neighbors",
9192 "Address Family modifier\n"
9193 "Address Family modifier\n"
9194 "Detailed information on TCP and BGP neighbor connections\n")
9196 ALIAS (show_ip_bgp_neighbors
,
9197 show_ip_bgp_vpnv4_all_neighbors_cmd
,
9198 "show ip bgp vpnv4 all neighbors",
9202 "Display VPNv4 NLRI specific information\n"
9203 "Display information about all VPNv4 NLRIs\n"
9204 "Detailed information on TCP and BGP neighbor connections\n")
9206 ALIAS (show_ip_bgp_neighbors
,
9207 show_ip_bgp_vpnv4_rd_neighbors_cmd
,
9208 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
9212 "Display VPNv4 NLRI specific information\n"
9213 "Display information for a route distinguisher\n"
9214 "VPN Route Distinguisher\n"
9215 "Detailed information on TCP and BGP neighbor connections\n")
9217 ALIAS (show_ip_bgp_neighbors
,
9218 show_bgp_neighbors_cmd
,
9219 "show bgp neighbors",
9222 "Detailed information on TCP and BGP neighbor connections\n")
9224 ALIAS (show_ip_bgp_neighbors
,
9225 show_bgp_ipv6_neighbors_cmd
,
9226 "show bgp ipv6 neighbors",
9230 "Detailed information on TCP and BGP neighbor connections\n")
9232 DEFUN (show_ip_bgp_neighbors_peer
,
9233 show_ip_bgp_neighbors_peer_cmd
,
9234 "show ip bgp neighbors (A.B.C.D|X:X::X:X|WORD)",
9238 "Detailed information on TCP and BGP neighbor connections\n"
9239 "Neighbor to display information about\n"
9240 "Neighbor to display information about\n"
9241 "Neighbor on bgp configured interface\n")
9243 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 1]);
9246 ALIAS (show_ip_bgp_neighbors_peer
,
9247 show_ip_bgp_ipv4_neighbors_peer_cmd
,
9248 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD)",
9253 "Address Family modifier\n"
9254 "Address Family modifier\n"
9255 "Detailed information on TCP and BGP neighbor connections\n"
9256 "Neighbor to display information about\n"
9257 "Neighbor to display information about\n"
9258 "Neighbor on bgp configured interface\n")
9260 ALIAS (show_ip_bgp_neighbors_peer
,
9261 show_ip_bgp_vpnv4_all_neighbors_peer_cmd
,
9262 "show ip bgp vpnv4 all neighbors A.B.C.D",
9266 "Display VPNv4 NLRI specific information\n"
9267 "Display information about all VPNv4 NLRIs\n"
9268 "Detailed information on TCP and BGP neighbor connections\n"
9269 "Neighbor to display information about\n")
9271 ALIAS (show_ip_bgp_neighbors_peer
,
9272 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
,
9273 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
9277 "Display VPNv4 NLRI specific information\n"
9278 "Display information about all VPNv4 NLRIs\n"
9279 "Detailed information on TCP and BGP neighbor connections\n"
9280 "Neighbor to display information about\n")
9282 ALIAS (show_ip_bgp_neighbors_peer
,
9283 show_bgp_neighbors_peer_cmd
,
9284 "show bgp neighbors (A.B.C.D|X:X::X:X|WORD)",
9287 "Detailed information on TCP and BGP neighbor connections\n"
9288 "Neighbor to display information about\n"
9289 "Neighbor to display information about\n"
9290 "Neighbor on bgp configured interface\n")
9292 ALIAS (show_ip_bgp_neighbors_peer
,
9293 show_bgp_ipv6_neighbors_peer_cmd
,
9294 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X|WORD)",
9298 "Detailed information on TCP and BGP neighbor connections\n"
9299 "Neighbor to display information about\n"
9300 "Neighbor to display information about\n"
9301 "Neighbor on bgp configured interface\n")
9303 DEFUN (show_ip_bgp_instance_neighbors
,
9304 show_ip_bgp_instance_neighbors_cmd
,
9305 "show ip bgp view WORD neighbors",
9311 "Detailed information on TCP and BGP neighbor connections\n")
9313 return bgp_show_neighbor_vty (vty
, argv
[0], show_all
, NULL
);
9316 ALIAS (show_ip_bgp_instance_neighbors
,
9317 show_bgp_instance_neighbors_cmd
,
9318 "show bgp view WORD neighbors",
9323 "Detailed information on TCP and BGP neighbor connections\n")
9325 ALIAS (show_ip_bgp_instance_neighbors
,
9326 show_bgp_instance_ipv6_neighbors_cmd
,
9327 "show bgp view WORD ipv6 neighbors",
9333 "Detailed information on TCP and BGP neighbor connections\n")
9335 DEFUN (show_ip_bgp_instance_neighbors_peer
,
9336 show_ip_bgp_instance_neighbors_peer_cmd
,
9337 "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X|WORD)",
9343 "Detailed information on TCP and BGP neighbor connections\n"
9344 "Neighbor to display information about\n"
9345 "Neighbor to display information about\n"
9346 "Neighbor on bgp configured interface\n")
9348 return bgp_show_neighbor_vty (vty
, argv
[0], show_peer
, argv
[1]);
9351 ALIAS (show_ip_bgp_instance_neighbors_peer
,
9352 show_bgp_instance_neighbors_peer_cmd
,
9353 "show bgp view WORD neighbors (A.B.C.D|X:X::X:X|WORD)",
9358 "Detailed information on TCP and BGP neighbor connections\n"
9359 "Neighbor to display information about\n"
9360 "Neighbor to display information about\n"
9361 "Neighbor on bgp configured interface\n")
9363 ALIAS (show_ip_bgp_instance_neighbors_peer
,
9364 show_bgp_instance_ipv6_neighbors_peer_cmd
,
9365 "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X|WORD)",
9371 "Detailed information on TCP and BGP neighbor connections\n"
9372 "Neighbor to display information about\n"
9373 "Neighbor to display information about\n"
9374 "Neighbor on bgp configured interface\n")
9376 /* Show BGP's AS paths internal data. There are both `show ip bgp
9377 paths' and `show ip mbgp paths'. Those functions results are the
9379 DEFUN (show_ip_bgp_paths
,
9380 show_ip_bgp_paths_cmd
,
9381 "show ip bgp paths",
9385 "Path information\n")
9387 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
9388 aspath_print_all_vty (vty
);
9392 DEFUN (show_ip_bgp_ipv4_paths
,
9393 show_ip_bgp_ipv4_paths_cmd
,
9394 "show ip bgp ipv4 (unicast|multicast) paths",
9399 "Address Family modifier\n"
9400 "Address Family modifier\n"
9401 "Path information\n")
9403 vty_out (vty
, "Address Refcnt Path\r\n");
9404 aspath_print_all_vty (vty
);
9412 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
9414 struct community
*com
;
9416 com
= (struct community
*) backet
->data
;
9417 vty_out (vty
, "[%p] (%ld) %s%s", backet
, com
->refcnt
,
9418 community_str (com
), VTY_NEWLINE
);
9421 /* Show BGP's community internal data. */
9422 DEFUN (show_ip_bgp_community_info
,
9423 show_ip_bgp_community_info_cmd
,
9424 "show ip bgp community-info",
9428 "List all bgp community information\n")
9430 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
9432 hash_iterate (community_hash (),
9433 (void (*) (struct hash_backet
*, void *))
9434 community_show_all_iterator
,
9440 DEFUN (show_ip_bgp_attr_info
,
9441 show_ip_bgp_attr_info_cmd
,
9442 "show ip bgp attribute-info",
9446 "List all bgp attribute information\n")
9448 attr_show_all (vty
);
9453 bgp_write_rsclient_summary (struct vty
*vty
, struct peer
*rsclient
,
9454 afi_t afi
, safi_t safi
)
9456 char timebuf
[BGP_UPTIME_LEN
];
9460 struct listnode
*node
, *nnode
;
9464 if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_GROUP
))
9466 for (ALL_LIST_ELEMENTS (rsclient
->group
->peer
, node
, nnode
, peer
))
9469 bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
9474 len
= vty_out (vty
, "%s", rsclient
->host
);
9478 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
9480 vty_out (vty
, "%*s", len
, " ");
9482 vty_out (vty
, "4 ");
9484 vty_out (vty
, "%11d ", rsclient
->as
);
9486 rmname
= ROUTE_MAP_EXPORT_NAME(&rsclient
->filter
[afi
][safi
]);
9487 if ( rmname
&& strlen (rmname
) > 13 )
9489 sprintf (rmbuf
, "%13s", "...");
9490 rmname
= strncpy (rmbuf
, rmname
, 10);
9494 vty_out (vty
, " %13s ", rmname
);
9496 rmname
= ROUTE_MAP_IMPORT_NAME(&rsclient
->filter
[afi
][safi
]);
9497 if ( rmname
&& strlen (rmname
) > 13 )
9499 sprintf (rmbuf
, "%13s", "...");
9500 rmname
= strncpy (rmbuf
, rmname
, 10);
9504 vty_out (vty
, " %13s ", rmname
);
9506 vty_out (vty
, "%8s", peer_uptime (rsclient
->uptime
, timebuf
, BGP_UPTIME_LEN
));
9508 if (CHECK_FLAG (rsclient
->flags
, PEER_FLAG_SHUTDOWN
))
9509 vty_out (vty
, " Idle (Admin)");
9510 else if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
9511 vty_out (vty
, " Idle (PfxCt)");
9513 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, rsclient
->status
));
9515 vty_out (vty
, "%s", VTY_NEWLINE
);
9521 bgp_show_rsclient_summary (struct vty
*vty
, struct bgp
*bgp
,
9522 afi_t afi
, safi_t safi
)
9525 struct listnode
*node
, *nnode
;
9528 /* Header string for each address family. */
9529 static char header
[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
9531 for (ALL_LIST_ELEMENTS (bgp
->rsclient
, node
, nnode
, peer
))
9533 if (peer
->afc
[afi
][safi
] &&
9534 CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
9539 "Route Server's BGP router identifier %s%s",
9540 inet_ntoa (bgp
->router_id
), VTY_NEWLINE
);
9542 "Route Server's local AS number %u%s", bgp
->as
,
9545 vty_out (vty
, "%s", VTY_NEWLINE
);
9546 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
9549 count
+= bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
9554 vty_out (vty
, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE
,
9555 count
, VTY_NEWLINE
);
9557 vty_out (vty
, "No %s Route Server Client is configured%s",
9558 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
9564 bgp_show_rsclient_summary_vty (struct vty
*vty
, const char *name
,
9565 afi_t afi
, safi_t safi
)
9571 bgp
= bgp_lookup_by_name (name
);
9575 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
9579 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
9583 bgp
= bgp_get_default ();
9586 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
9591 /* 'show bgp rsclient' commands. */
9592 DEFUN (show_ip_bgp_rsclient_summary
,
9593 show_ip_bgp_rsclient_summary_cmd
,
9594 "show ip bgp rsclient summary",
9598 "Information about Route Server Clients\n"
9599 "Summary of all Route Server Clients\n")
9601 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
9604 DEFUN (show_ip_bgp_instance_rsclient_summary
,
9605 show_ip_bgp_instance_rsclient_summary_cmd
,
9606 "show ip bgp view WORD rsclient summary",
9612 "Information about Route Server Clients\n"
9613 "Summary of all Route Server Clients\n")
9615 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
9618 DEFUN (show_ip_bgp_ipv4_rsclient_summary
,
9619 show_ip_bgp_ipv4_rsclient_summary_cmd
,
9620 "show ip bgp ipv4 (unicast|multicast) rsclient summary",
9625 "Address Family modifier\n"
9626 "Address Family modifier\n"
9627 "Information about Route Server Clients\n"
9628 "Summary of all Route Server Clients\n")
9630 if (strncmp (argv
[0], "m", 1) == 0)
9631 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
9633 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
9636 DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary
,
9637 show_ip_bgp_instance_ipv4_rsclient_summary_cmd
,
9638 "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary",
9645 "Address Family modifier\n"
9646 "Address Family modifier\n"
9647 "Information about Route Server Clients\n"
9648 "Summary of all Route Server Clients\n")
9650 if (strncmp (argv
[1], "m", 1) == 0)
9651 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
9653 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
9656 DEFUN (show_bgp_instance_ipv4_safi_rsclient_summary
,
9657 show_bgp_instance_ipv4_safi_rsclient_summary_cmd
,
9658 "show bgp view WORD ipv4 (unicast|multicast) rsclient summary",
9664 "Address Family modifier\n"
9665 "Address Family modifier\n"
9666 "Information about Route Server Clients\n"
9667 "Summary of all Route Server Clients\n")
9672 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
9673 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, safi
);
9675 safi
= (strncmp (argv
[0], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
9676 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, safi
);
9680 ALIAS (show_bgp_instance_ipv4_safi_rsclient_summary
,
9681 show_bgp_ipv4_safi_rsclient_summary_cmd
,
9682 "show bgp ipv4 (unicast|multicast) rsclient summary",
9686 "Address Family modifier\n"
9687 "Address Family modifier\n"
9688 "Information about Route Server Clients\n"
9689 "Summary of all Route Server Clients\n")
9692 DEFUN (show_bgp_rsclient_summary
,
9693 show_bgp_rsclient_summary_cmd
,
9694 "show bgp rsclient summary",
9697 "Information about Route Server Clients\n"
9698 "Summary of all Route Server Clients\n")
9700 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
9703 DEFUN (show_bgp_instance_rsclient_summary
,
9704 show_bgp_instance_rsclient_summary_cmd
,
9705 "show bgp view WORD rsclient summary",
9710 "Information about Route Server Clients\n"
9711 "Summary of all Route Server Clients\n")
9713 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
9716 ALIAS (show_bgp_rsclient_summary
,
9717 show_bgp_ipv6_rsclient_summary_cmd
,
9718 "show bgp ipv6 rsclient summary",
9722 "Information about Route Server Clients\n"
9723 "Summary of all Route Server Clients\n")
9725 ALIAS (show_bgp_instance_rsclient_summary
,
9726 show_bgp_instance_ipv6_rsclient_summary_cmd
,
9727 "show bgp view WORD ipv6 rsclient summary",
9733 "Information about Route Server Clients\n"
9734 "Summary of all Route Server Clients\n")
9736 DEFUN (show_bgp_instance_ipv6_safi_rsclient_summary
,
9737 show_bgp_instance_ipv6_safi_rsclient_summary_cmd
,
9738 "show bgp view WORD ipv6 (unicast|multicast) rsclient summary",
9744 "Address Family modifier\n"
9745 "Address Family modifier\n"
9746 "Information about Route Server Clients\n"
9747 "Summary of all Route Server Clients\n")
9752 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
9753 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, safi
);
9755 safi
= (strncmp (argv
[0], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
9756 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, safi
);
9760 ALIAS (show_bgp_instance_ipv6_safi_rsclient_summary
,
9761 show_bgp_ipv6_safi_rsclient_summary_cmd
,
9762 "show bgp ipv6 (unicast|multicast) rsclient summary",
9766 "Address Family modifier\n"
9767 "Address Family modifier\n"
9768 "Information about Route Server Clients\n"
9769 "Summary of all Route Server Clients\n")
9771 #endif /* HAVE IPV6 */
9773 DEFUN (show_ip_bgp_updgrps
,
9774 show_ip_bgp_updgrps_cmd
,
9775 "show ip bgp update-groups summary",
9779 "BGP update groups\n"
9780 "Summary information\n")
9784 bgp
= bgp_get_default();
9786 update_group_show(bgp
, AFI_IP
, SAFI_UNICAST
, vty
);
9790 DEFUN (show_bgp_ipv6_updgrps
,
9791 show_bgp_ipv6_updgrps_cmd
,
9792 "show bgp update-groups summary",
9795 "BGP update groups\n"
9796 "Summary information\n")
9800 bgp
= bgp_get_default();
9802 update_group_show(bgp
, AFI_IP6
, SAFI_UNICAST
, vty
);
9806 DEFUN (show_bgp_updgrps
,
9807 show_bgp_updgrps_cmd
,
9808 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups summary",
9813 "Address Family modifier\n"
9814 "Address Family modifier\n"
9815 "BGP update groups\n"
9816 "Summary information\n")
9822 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
9823 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
9824 bgp
= bgp_get_default();
9826 update_group_show(bgp
, afi
, safi
, vty
);
9830 DEFUN (show_bgp_updgrps_stats
,
9831 show_bgp_updgrps_stats_cmd
,
9832 "show bgp update-groups statistics",
9835 "BGP update groups\n"
9840 bgp
= bgp_get_default();
9842 update_group_show_stats(bgp
, vty
);
9848 show_bgp_updgrps_adj_info_aux (struct vty
*vty
, afi_t afi
, safi_t safi
,
9849 const char *what
, u_int64_t subgrp_id
)
9852 bgp
= bgp_get_default();
9855 if (!strcmp(what
, "advertise-queue"))
9856 update_group_show_adj_queue(bgp
, afi
, safi
, vty
, subgrp_id
);
9857 else if (!strcmp(what
, "advertised-routes"))
9858 update_group_show_advertised(bgp
, afi
, safi
, vty
, subgrp_id
);
9859 else if (!strcmp(what
, "packet-queue"))
9860 update_group_show_packet_queue(bgp
, afi
, safi
, vty
, subgrp_id
);
9864 DEFUN (show_ip_bgp_updgrps_adj
,
9865 show_ip_bgp_updgrps_adj_cmd
,
9866 "show ip bgp update-groups (advertise-queue|advertised-routes|packet-queue)",
9870 "BGP update groups\n"
9871 "Advertisement queue\n"
9872 "Announced routes\n"
9875 show_bgp_updgrps_adj_info_aux(vty
, AFI_IP
, SAFI_UNICAST
, argv
[0], 0);
9879 DEFUN (show_bgp_updgrps_afi_adj
,
9880 show_bgp_updgrps_afi_adj_cmd
,
9881 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups (advertise-queue|advertised-routes|packet-queue)",
9886 "Address Family modifier\n"
9887 "Address Family modifier\n"
9888 "BGP update groups\n"
9889 "Advertisement queue\n"
9890 "Announced routes\n"
9896 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
9897 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
9898 show_bgp_updgrps_adj_info_aux(vty
, afi
, safi
, argv
[2], 0);
9901 DEFUN (show_bgp_updgrps_adj
,
9902 show_bgp_updgrps_adj_cmd
,
9903 "show bgp update-groups (advertise-queue|advertised-routes|packet-queue)",
9906 "BGP update groups\n"
9907 "Advertisement queue\n"
9908 "Announced routes\n"
9911 show_bgp_updgrps_adj_info_aux(vty
, AFI_IP6
, SAFI_UNICAST
, argv
[0], 0);
9915 DEFUN (show_ip_bgp_updgrps_adj_s
,
9916 show_ip_bgp_updgrps_adj_subgroup_cmd
,
9917 "show ip bgp update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
9921 "BGP update groups\n"
9922 "64-bit subgroup id\n"
9923 "Advertisement queue\n"
9924 "Announced routes\n"
9927 show_bgp_updgrps_adj_info_aux(vty
, AFI_IP
, SAFI_UNICAST
, argv
[1],
9932 DEFUN (show_bgp_updgrps_adj_s
,
9933 show_bgp_updgrps_adj_subgroup_cmd
,
9934 "show bgp update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
9937 "BGP update groups\n"
9938 "64-bit subgroup id\n"
9939 "Advertisement queue\n"
9940 "Announced routes\n"
9943 show_bgp_updgrps_adj_info_aux(vty
, AFI_IP6
, SAFI_UNICAST
, argv
[1],
9948 DEFUN (show_bgp_updgrps_afi_adj_subgroup
,
9949 show_bgp_updgrps_afi_adj_subgroup_cmd
,
9950 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
9955 "Address Family modifier\n"
9956 "Address Family modifier\n"
9957 "BGP update groups\n"
9958 "64-bit subgroup id\n"
9959 "Advertisement queue\n"
9960 "Announced routes\n"
9966 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
9967 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
9968 show_bgp_updgrps_adj_info_aux(vty
, afi
, safi
, argv
[3], atoll(argv
[2]));
9972 /* Redistribute VTY commands. */
9974 DEFUN (bgp_redistribute_ipv4
,
9975 bgp_redistribute_ipv4_cmd
,
9976 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
,
9977 "Redistribute information from another routing protocol\n"
9978 QUAGGA_IP_REDIST_HELP_STR_BGPD
)
9982 type
= proto_redistnum (AFI_IP
, argv
[0]);
9983 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
9985 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
9988 bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
9989 return bgp_redistribute_set (AFI_IP
, type
, 0);
9992 DEFUN (bgp_redistribute_ipv4_rmap
,
9993 bgp_redistribute_ipv4_rmap_cmd
,
9994 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD",
9995 "Redistribute information from another routing protocol\n"
9996 QUAGGA_IP_REDIST_HELP_STR_BGPD
9997 "Route map reference\n"
9998 "Pointer to route-map entries\n")
10001 struct bgp_redist
*red
;
10003 type
= proto_redistnum (AFI_IP
, argv
[0]);
10004 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10006 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10007 return CMD_WARNING
;
10010 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
10011 bgp_redistribute_rmap_set (red
, argv
[1]);
10012 return bgp_redistribute_set (AFI_IP
, type
, 0);
10015 DEFUN (bgp_redistribute_ipv4_metric
,
10016 bgp_redistribute_ipv4_metric_cmd
,
10017 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295>",
10018 "Redistribute information from another routing protocol\n"
10019 QUAGGA_IP_REDIST_HELP_STR_BGPD
10020 "Metric for redistributed routes\n"
10021 "Default metric\n")
10025 struct bgp_redist
*red
;
10027 type
= proto_redistnum (AFI_IP
, argv
[0]);
10028 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10030 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10031 return CMD_WARNING
;
10033 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
10035 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
10036 bgp_redistribute_metric_set (red
, metric
);
10037 return bgp_redistribute_set (AFI_IP
, type
, 0);
10040 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
10041 bgp_redistribute_ipv4_rmap_metric_cmd
,
10042 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
10043 "Redistribute information from another routing protocol\n"
10044 QUAGGA_IP_REDIST_HELP_STR_BGPD
10045 "Route map reference\n"
10046 "Pointer to route-map entries\n"
10047 "Metric for redistributed routes\n"
10048 "Default metric\n")
10052 struct bgp_redist
*red
;
10054 type
= proto_redistnum (AFI_IP
, argv
[0]);
10055 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10057 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10058 return CMD_WARNING
;
10060 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
10062 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
10063 bgp_redistribute_rmap_set (red
, argv
[1]);
10064 bgp_redistribute_metric_set (red
, metric
);
10065 return bgp_redistribute_set (AFI_IP
, type
, 0);
10068 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
10069 bgp_redistribute_ipv4_metric_rmap_cmd
,
10070 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
10071 "Redistribute information from another routing protocol\n"
10072 QUAGGA_IP_REDIST_HELP_STR_BGPD
10073 "Metric for redistributed routes\n"
10075 "Route map reference\n"
10076 "Pointer to route-map entries\n")
10080 struct bgp_redist
*red
;
10082 type
= proto_redistnum (AFI_IP
, argv
[0]);
10083 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10085 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10086 return CMD_WARNING
;
10088 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
10090 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
10091 bgp_redistribute_metric_set (red
, metric
);
10092 bgp_redistribute_rmap_set (red
, argv
[2]);
10093 return bgp_redistribute_set (AFI_IP
, type
, 0);
10096 DEFUN (bgp_redistribute_ipv4_ospf
,
10097 bgp_redistribute_ipv4_ospf_cmd
,
10098 "redistribute (ospf|table) <1-65535>",
10099 "Redistribute information from another routing protocol\n"
10100 "Open Shortest Path First (OSPFv2)\n"
10106 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
10108 if (strncmp(argv
[0], "o", 1) == 0)
10109 protocol
= ZEBRA_ROUTE_OSPF
;
10111 protocol
= ZEBRA_ROUTE_TABLE
;
10113 bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
10114 return bgp_redistribute_set (AFI_IP
, protocol
, instance
);
10117 DEFUN (bgp_redistribute_ipv4_ospf_rmap
,
10118 bgp_redistribute_ipv4_ospf_rmap_cmd
,
10119 "redistribute (ospf|table) <1-65535> route-map WORD",
10120 "Redistribute information from another routing protocol\n"
10121 "Open Shortest Path First (OSPFv2)\n"
10123 "Route map reference\n"
10124 "Pointer to route-map entries\n")
10126 struct bgp_redist
*red
;
10130 if (strncmp(argv
[0], "o", 1) == 0)
10131 protocol
= ZEBRA_ROUTE_OSPF
;
10133 protocol
= ZEBRA_ROUTE_TABLE
;
10135 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
10136 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
10137 bgp_redistribute_rmap_set (red
, argv
[2]);
10138 return bgp_redistribute_set (AFI_IP
, protocol
, instance
);
10141 DEFUN (bgp_redistribute_ipv4_ospf_metric
,
10142 bgp_redistribute_ipv4_ospf_metric_cmd
,
10143 "redistribute (ospf|table) <1-65535> metric <0-4294967295>",
10144 "Redistribute information from another routing protocol\n"
10145 "Open Shortest Path First (OSPFv2)\n"
10147 "Metric for redistributed routes\n"
10148 "Default metric\n")
10151 struct bgp_redist
*red
;
10155 if (strncmp(argv
[0], "o", 1) == 0)
10156 protocol
= ZEBRA_ROUTE_OSPF
;
10158 protocol
= ZEBRA_ROUTE_TABLE
;
10160 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
10161 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
10163 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
10164 bgp_redistribute_metric_set (red
, metric
);
10165 return bgp_redistribute_set (AFI_IP
, protocol
, instance
);
10168 DEFUN (bgp_redistribute_ipv4_ospf_rmap_metric
,
10169 bgp_redistribute_ipv4_ospf_rmap_metric_cmd
,
10170 "redistribute (ospf|table) <1-65535> route-map WORD metric <0-4294967295>",
10171 "Redistribute information from another routing protocol\n"
10172 "Open Shortest Path First (OSPFv2)\n"
10174 "Route map reference\n"
10175 "Pointer to route-map entries\n"
10176 "Metric for redistributed routes\n"
10177 "Default metric\n")
10180 struct bgp_redist
*red
;
10184 if (strncmp(argv
[0], "o", 1) == 0)
10185 protocol
= ZEBRA_ROUTE_OSPF
;
10187 protocol
= ZEBRA_ROUTE_TABLE
;
10189 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
10190 VTY_GET_INTEGER ("metric", metric
, argv
[3]);
10192 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
10193 bgp_redistribute_rmap_set (red
, argv
[2]);
10194 bgp_redistribute_metric_set (red
, metric
);
10195 return bgp_redistribute_set (AFI_IP
, protocol
, instance
);
10198 DEFUN (bgp_redistribute_ipv4_ospf_metric_rmap
,
10199 bgp_redistribute_ipv4_ospf_metric_rmap_cmd
,
10200 "redistribute (ospf|table) <1-65535> metric <0-4294967295> route-map WORD",
10201 "Redistribute information from another routing protocol\n"
10202 "Open Shortest Path First (OSPFv2)\n"
10204 "Metric for redistributed routes\n"
10206 "Route map reference\n"
10207 "Pointer to route-map entries\n")
10210 struct bgp_redist
*red
;
10214 if (strncmp(argv
[0], "o", 1) == 0)
10215 protocol
= ZEBRA_ROUTE_OSPF
;
10217 protocol
= ZEBRA_ROUTE_TABLE
;
10219 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
10220 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
10222 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
10223 bgp_redistribute_metric_set (red
, metric
);
10224 bgp_redistribute_rmap_set (red
, argv
[3]);
10225 return bgp_redistribute_set (AFI_IP
, protocol
, instance
);
10228 DEFUN (no_bgp_redistribute_ipv4_ospf
,
10229 no_bgp_redistribute_ipv4_ospf_cmd
,
10230 "no redistribute (ospf|table) <1-65535>",
10232 "Redistribute information from another routing protocol\n"
10233 "Open Shortest Path First (OSPFv2)\n"
10239 if (strncmp(argv
[0], "o", 1) == 0)
10240 protocol
= ZEBRA_ROUTE_OSPF
;
10242 protocol
= ZEBRA_ROUTE_TABLE
;
10244 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
10245 return bgp_redistribute_unset (vty
->index
, AFI_IP
, protocol
, instance
);
10248 ALIAS (no_bgp_redistribute_ipv4_ospf
,
10249 no_bgp_redistribute_ipv4_ospf_rmap_cmd
,
10250 "no redistribute (ospf|table) <1-65535> route-map WORD",
10252 "Redistribute information from another routing protocol\n"
10253 "Open Shortest Path First (OSPFv2)\n"
10255 "Route map reference\n"
10256 "Pointer to route-map entries\n")
10258 ALIAS (no_bgp_redistribute_ipv4_ospf
,
10259 no_bgp_redistribute_ipv4_ospf_metric_cmd
,
10260 "no redistribute (ospf|table) <1-65535> metric <0-4294967295>",
10262 "Redistribute information from another routing protocol\n"
10263 "Open Shortest Path First (OSPFv2)\n"
10265 "Metric for redistributed routes\n"
10266 "Default metric\n")
10268 ALIAS (no_bgp_redistribute_ipv4_ospf
,
10269 no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd
,
10270 "no redistribute (ospf|table) <1-65535> route-map WORD metric <0-4294967295>",
10272 "Redistribute information from another routing protocol\n"
10273 "Open Shortest Path First (OSPFv2)\n"
10275 "Route map reference\n"
10276 "Pointer to route-map entries\n"
10277 "Metric for redistributed routes\n"
10278 "Default metric\n")
10280 ALIAS (no_bgp_redistribute_ipv4_ospf
,
10281 no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd
,
10282 "no redistribute (ospf|table) <1-65535> metric <0-4294967295> route-map WORD",
10284 "Redistribute information from another routing protocol\n"
10285 "Open Shortest Path First (OSPFv2)\n"
10287 "Metric for redistributed routes\n"
10289 "Route map reference\n"
10290 "Pointer to route-map entries\n")
10292 DEFUN (no_bgp_redistribute_ipv4
,
10293 no_bgp_redistribute_ipv4_cmd
,
10294 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
,
10296 "Redistribute information from another routing protocol\n"
10297 QUAGGA_IP_REDIST_HELP_STR_BGPD
)
10301 type
= proto_redistnum (AFI_IP
, argv
[0]);
10302 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10304 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10305 return CMD_WARNING
;
10307 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
, 0);
10310 ALIAS (no_bgp_redistribute_ipv4
,
10311 no_bgp_redistribute_ipv4_rmap_cmd
,
10312 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD",
10314 "Redistribute information from another routing protocol\n"
10315 QUAGGA_IP_REDIST_HELP_STR_BGPD
10316 "Route map reference\n"
10317 "Pointer to route-map entries\n")
10319 ALIAS (no_bgp_redistribute_ipv4
,
10320 no_bgp_redistribute_ipv4_metric_cmd
,
10321 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295>",
10323 "Redistribute information from another routing protocol\n"
10324 QUAGGA_IP_REDIST_HELP_STR_BGPD
10325 "Metric for redistributed routes\n"
10326 "Default metric\n")
10328 ALIAS (no_bgp_redistribute_ipv4
,
10329 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
10330 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
10332 "Redistribute information from another routing protocol\n"
10333 QUAGGA_IP_REDIST_HELP_STR_BGPD
10334 "Route map reference\n"
10335 "Pointer to route-map entries\n"
10336 "Metric for redistributed routes\n"
10337 "Default metric\n")
10339 ALIAS (no_bgp_redistribute_ipv4
,
10340 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
10341 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
10343 "Redistribute information from another routing protocol\n"
10344 QUAGGA_IP_REDIST_HELP_STR_BGPD
10345 "Metric for redistributed routes\n"
10347 "Route map reference\n"
10348 "Pointer to route-map entries\n")
10351 DEFUN (bgp_redistribute_ipv6
,
10352 bgp_redistribute_ipv6_cmd
,
10353 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
,
10354 "Redistribute information from another routing protocol\n"
10355 QUAGGA_IP6_REDIST_HELP_STR_BGPD
)
10359 type
= proto_redistnum (AFI_IP6
, argv
[0]);
10360 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10362 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10363 return CMD_WARNING
;
10366 bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
10367 return bgp_redistribute_set (AFI_IP6
, type
, 0);
10370 DEFUN (bgp_redistribute_ipv6_rmap
,
10371 bgp_redistribute_ipv6_rmap_cmd
,
10372 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD",
10373 "Redistribute information from another routing protocol\n"
10374 QUAGGA_IP6_REDIST_HELP_STR_BGPD
10375 "Route map reference\n"
10376 "Pointer to route-map entries\n")
10379 struct bgp_redist
*red
;
10381 type
= proto_redistnum (AFI_IP6
, argv
[0]);
10382 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10384 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10385 return CMD_WARNING
;
10388 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
10389 bgp_redistribute_rmap_set (red
, argv
[1]);
10390 return bgp_redistribute_set (AFI_IP6
, type
, 0);
10393 DEFUN (bgp_redistribute_ipv6_metric
,
10394 bgp_redistribute_ipv6_metric_cmd
,
10395 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295>",
10396 "Redistribute information from another routing protocol\n"
10397 QUAGGA_IP6_REDIST_HELP_STR_BGPD
10398 "Metric for redistributed routes\n"
10399 "Default metric\n")
10403 struct bgp_redist
*red
;
10405 type
= proto_redistnum (AFI_IP6
, argv
[0]);
10406 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10408 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10409 return CMD_WARNING
;
10411 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
10413 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
10414 bgp_redistribute_metric_set (red
, metric
);
10415 return bgp_redistribute_set (AFI_IP6
, type
, 0);
10418 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
10419 bgp_redistribute_ipv6_rmap_metric_cmd
,
10420 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
10421 "Redistribute information from another routing protocol\n"
10422 QUAGGA_IP6_REDIST_HELP_STR_BGPD
10423 "Route map reference\n"
10424 "Pointer to route-map entries\n"
10425 "Metric for redistributed routes\n"
10426 "Default metric\n")
10430 struct bgp_redist
*red
;
10432 type
= proto_redistnum (AFI_IP6
, argv
[0]);
10433 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10435 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10436 return CMD_WARNING
;
10438 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
10440 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
10441 bgp_redistribute_rmap_set (red
, argv
[1]);
10442 bgp_redistribute_metric_set (red
, metric
);
10443 return bgp_redistribute_set (AFI_IP6
, type
, 0);
10446 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
10447 bgp_redistribute_ipv6_metric_rmap_cmd
,
10448 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
10449 "Redistribute information from another routing protocol\n"
10450 QUAGGA_IP6_REDIST_HELP_STR_BGPD
10451 "Metric for redistributed routes\n"
10453 "Route map reference\n"
10454 "Pointer to route-map entries\n")
10458 struct bgp_redist
*red
;
10460 type
= proto_redistnum (AFI_IP6
, argv
[0]);
10461 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10463 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10464 return CMD_WARNING
;
10466 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
10468 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
10469 bgp_redistribute_metric_set (red
, metric
);
10470 bgp_redistribute_rmap_set (red
, argv
[2]);
10471 return bgp_redistribute_set (AFI_IP6
, type
, 0);
10474 DEFUN (no_bgp_redistribute_ipv6
,
10475 no_bgp_redistribute_ipv6_cmd
,
10476 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
,
10478 "Redistribute information from another routing protocol\n"
10479 QUAGGA_IP6_REDIST_HELP_STR_BGPD
)
10483 type
= proto_redistnum (AFI_IP6
, argv
[0]);
10484 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
10486 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
10487 return CMD_WARNING
;
10490 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
, 0);
10493 ALIAS (no_bgp_redistribute_ipv6
,
10494 no_bgp_redistribute_ipv6_rmap_cmd
,
10495 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD",
10497 "Redistribute information from another routing protocol\n"
10498 QUAGGA_IP6_REDIST_HELP_STR_BGPD
10499 "Route map reference\n"
10500 "Pointer to route-map entries\n")
10502 ALIAS (no_bgp_redistribute_ipv6
,
10503 no_bgp_redistribute_ipv6_metric_cmd
,
10504 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295>",
10506 "Redistribute information from another routing protocol\n"
10507 QUAGGA_IP6_REDIST_HELP_STR_BGPD
10508 "Metric for redistributed routes\n"
10509 "Default metric\n")
10511 ALIAS (no_bgp_redistribute_ipv6
,
10512 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
10513 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
10515 "Redistribute information from another routing protocol\n"
10516 QUAGGA_IP6_REDIST_HELP_STR_BGPD
10517 "Route map reference\n"
10518 "Pointer to route-map entries\n"
10519 "Metric for redistributed routes\n"
10520 "Default metric\n")
10522 ALIAS (no_bgp_redistribute_ipv6
,
10523 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
10524 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
10526 "Redistribute information from another routing protocol\n"
10527 QUAGGA_IP6_REDIST_HELP_STR_BGPD
10528 "Metric for redistributed routes\n"
10530 "Route map reference\n"
10531 "Pointer to route-map entries\n")
10532 #endif /* HAVE_IPV6 */
10535 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
10536 safi_t safi
, int *write
)
10540 /* Unicast redistribution only. */
10541 if (safi
!= SAFI_UNICAST
)
10544 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
10546 /* Redistribute BGP does not make sense. */
10547 if (i
!= ZEBRA_ROUTE_BGP
)
10549 struct list
*red_list
;
10550 struct listnode
*node
;
10551 struct bgp_redist
*red
;
10553 red_list
= bgp
->redist
[afi
][i
];
10557 for (ALL_LIST_ELEMENTS_RO(red_list
, node
, red
))
10559 /* Display "address-family" when it is not yet diplayed. */
10560 bgp_config_write_family_header (vty
, afi
, safi
, write
);
10562 /* "redistribute" configuration. */
10563 vty_out (vty
, " redistribute %s", zebra_route_string(i
));
10565 vty_out (vty
, " %d", red
->instance
);
10566 if (red
->redist_metric_flag
)
10567 vty_out (vty
, " metric %u", red
->redist_metric
);
10568 if (red
->rmap
.name
)
10569 vty_out (vty
, " route-map %s", red
->rmap
.name
);
10570 vty_out (vty
, "%s", VTY_NEWLINE
);
10577 /* BGP node structure. */
10578 static struct cmd_node bgp_node
=
10581 "%s(config-router)# ",
10585 static struct cmd_node bgp_ipv4_unicast_node
=
10588 "%s(config-router-af)# ",
10592 static struct cmd_node bgp_ipv4_multicast_node
=
10595 "%s(config-router-af)# ",
10599 static struct cmd_node bgp_ipv6_unicast_node
=
10602 "%s(config-router-af)# ",
10606 static struct cmd_node bgp_ipv6_multicast_node
=
10609 "%s(config-router-af)# ",
10613 static struct cmd_node bgp_vpnv4_node
=
10616 "%s(config-router-af)# ",
10620 static void community_list_vty (void);
10623 bgp_vty_init (void)
10625 /* Install bgp top node. */
10626 install_node (&bgp_node
, bgp_config_write
);
10627 install_node (&bgp_ipv4_unicast_node
, NULL
);
10628 install_node (&bgp_ipv4_multicast_node
, NULL
);
10629 install_node (&bgp_ipv6_unicast_node
, NULL
);
10630 install_node (&bgp_ipv6_multicast_node
, NULL
);
10631 install_node (&bgp_vpnv4_node
, NULL
);
10633 /* Install default VTY commands to new nodes. */
10634 install_default (BGP_NODE
);
10635 install_default (BGP_IPV4_NODE
);
10636 install_default (BGP_IPV4M_NODE
);
10637 install_default (BGP_IPV6_NODE
);
10638 install_default (BGP_IPV6M_NODE
);
10639 install_default (BGP_VPNV4_NODE
);
10641 /* "bgp multiple-instance" commands. */
10642 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
10643 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
10645 /* "bgp config-type" commands. */
10646 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
10647 install_element (CONFIG_NODE
, &no_bgp_config_type_cmd
);
10649 /* Dummy commands (Currently not supported) */
10650 install_element (BGP_NODE
, &no_synchronization_cmd
);
10651 install_element (BGP_NODE
, &no_auto_summary_cmd
);
10653 /* "router bgp" commands. */
10654 install_element (CONFIG_NODE
, &router_bgp_cmd
);
10655 install_element (CONFIG_NODE
, &router_bgp_view_cmd
);
10657 /* "no router bgp" commands. */
10658 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
10659 install_element (CONFIG_NODE
, &no_router_bgp_view_cmd
);
10661 /* "bgp router-id" commands. */
10662 install_element (BGP_NODE
, &bgp_router_id_cmd
);
10663 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
10664 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
10666 /* "bgp cluster-id" commands. */
10667 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
10668 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
10669 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
10670 install_element (BGP_NODE
, &no_bgp_cluster_id_arg_cmd
);
10672 /* "bgp confederation" commands. */
10673 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
10674 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
10675 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
10677 /* "bgp confederation peers" commands. */
10678 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
10679 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
10681 /* bgp max-med command */
10682 install_element (BGP_NODE
, &bgp_maxmed_admin_cmd
);
10683 install_element (BGP_NODE
, &no_bgp_maxmed_admin_cmd
);
10684 install_element (BGP_NODE
, &bgp_maxmed_admin_medv_cmd
);
10685 install_element (BGP_NODE
, &no_bgp_maxmed_admin_medv_cmd
);
10686 install_element (BGP_NODE
, &bgp_maxmed_onstartup_cmd
);
10687 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_cmd
);
10688 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_period_cmd
);
10689 install_element (BGP_NODE
, &bgp_maxmed_onstartup_medv_cmd
);
10690 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_period_medv_cmd
);
10692 /* bgp update-delay command */
10693 install_element (BGP_NODE
, &bgp_update_delay_cmd
);
10694 install_element (BGP_NODE
, &no_bgp_update_delay_cmd
);
10695 install_element (BGP_NODE
, &bgp_update_delay_establish_wait_cmd
);
10696 install_element (BGP_NODE
, &no_bgp_update_delay_establish_wait_cmd
);
10698 install_element (BGP_NODE
, &bgp_wpkt_quanta_cmd
);
10699 install_element (BGP_NODE
, &no_bgp_wpkt_quanta_cmd
);
10701 install_element (BGP_NODE
, &bgp_coalesce_time_cmd
);
10702 install_element (BGP_NODE
, &no_bgp_coalesce_time_cmd
);
10704 /* "maximum-paths" commands. */
10705 install_element (BGP_NODE
, &bgp_maxpaths_cmd
);
10706 install_element (BGP_NODE
, &no_bgp_maxpaths_cmd
);
10707 install_element (BGP_NODE
, &no_bgp_maxpaths_arg_cmd
);
10708 install_element (BGP_IPV4_NODE
, &bgp_maxpaths_cmd
);
10709 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_cmd
);
10710 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_arg_cmd
);
10711 install_element (BGP_IPV6_NODE
, &bgp_maxpaths_cmd
);
10712 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_cmd
);
10713 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_arg_cmd
);
10714 install_element (BGP_NODE
, &bgp_maxpaths_ibgp_cmd
);
10715 install_element(BGP_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
10716 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
10717 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
10718 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
10719 install_element (BGP_IPV4_NODE
, &bgp_maxpaths_ibgp_cmd
);
10720 install_element(BGP_IPV4_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
10721 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
10722 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
10723 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
10724 install_element (BGP_IPV6_NODE
, &bgp_maxpaths_ibgp_cmd
);
10725 install_element(BGP_IPV6_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
10726 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
10727 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
10728 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
10730 /* "timers bgp" commands. */
10731 install_element (BGP_NODE
, &bgp_timers_cmd
);
10732 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
10733 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
10735 /* route-map delay-timer commands */
10736 install_element (BGP_NODE
, &bgp_set_route_map_delay_timer_cmd
);
10737 install_element (BGP_NODE
, &no_bgp_set_route_map_delay_timer_cmd
);
10739 /* "bgp client-to-client reflection" commands */
10740 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
10741 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
10743 /* "bgp always-compare-med" commands */
10744 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
10745 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
10747 /* "bgp deterministic-med" commands */
10748 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
10749 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
10751 /* "bgp graceful-restart" commands */
10752 install_element (BGP_NODE
, &bgp_graceful_restart_cmd
);
10753 install_element (BGP_NODE
, &no_bgp_graceful_restart_cmd
);
10754 install_element (BGP_NODE
, &bgp_graceful_restart_stalepath_time_cmd
);
10755 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_cmd
);
10756 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_val_cmd
);
10758 /* "bgp fast-external-failover" commands */
10759 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
10760 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
10762 /* "bgp enforce-first-as" commands */
10763 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
10764 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
10766 /* "bgp bestpath compare-routerid" commands */
10767 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
10768 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
10770 /* "bgp bestpath as-path ignore" commands */
10771 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
10772 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
10774 /* "bgp bestpath as-path confed" commands */
10775 install_element (BGP_NODE
, &bgp_bestpath_aspath_confed_cmd
);
10776 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_confed_cmd
);
10778 /* "bgp bestpath as-path multipath-relax" commands */
10779 install_element (BGP_NODE
, &bgp_bestpath_aspath_multipath_relax_cmd
);
10780 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_multipath_relax_cmd
);
10782 /* "bgp log-neighbor-changes" commands */
10783 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
10784 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
10786 /* "bgp bestpath med" commands */
10787 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
10788 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
10789 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
10790 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
10791 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
10792 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
10794 /* "no bgp default ipv4-unicast" commands. */
10795 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
10796 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
10798 /* "bgp network import-check" commands. */
10799 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
10800 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
10802 /* "bgp default local-preference" commands. */
10803 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
10804 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
10805 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
10807 /* "bgp default subgroup-pkt-queue-max" commands. */
10808 install_element (BGP_NODE
, &bgp_default_subgroup_pkt_queue_max_cmd
);
10809 install_element (BGP_NODE
, &no_bgp_default_subgroup_pkt_queue_max_cmd
);
10811 /* bgp ibgp-allow-policy-mods command */
10812 install_element (BGP_NODE
, &bgp_rr_allow_outbound_policy_cmd
);
10813 install_element (BGP_NODE
, &no_bgp_rr_allow_outbound_policy_cmd
);
10815 /* "neighbor remote-as" commands. */
10816 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
10817 install_element (BGP_NODE
, &neighbor_interface_config_cmd
);
10818 install_element (BGP_NODE
, &no_neighbor_cmd
);
10819 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
10820 install_element (BGP_NODE
, &no_neighbor_interface_config_cmd
);
10822 /* "neighbor peer-group" commands. */
10823 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
10824 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
10825 install_element (BGP_NODE
, &no_neighbor_interface_peer_group_remote_as_cmd
);
10827 /* "neighbor local-as" commands. */
10828 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
10829 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
10830 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_replace_as_cmd
);
10831 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
10832 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
10833 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
10834 install_element (BGP_NODE
, &no_neighbor_local_as_val3_cmd
);
10836 /* "neighbor solo" commands. */
10837 install_element (BGP_NODE
, &neighbor_solo_cmd
);
10838 install_element (BGP_NODE
, &no_neighbor_solo_cmd
);
10840 /* "neighbor password" commands. */
10841 install_element (BGP_NODE
, &neighbor_password_cmd
);
10842 install_element (BGP_NODE
, &no_neighbor_password_cmd
);
10844 /* "neighbor activate" commands. */
10845 install_element (BGP_NODE
, &neighbor_activate_cmd
);
10846 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
10847 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
10848 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
10849 install_element (BGP_IPV6M_NODE
, &neighbor_activate_cmd
);
10850 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
10852 /* "no neighbor activate" commands. */
10853 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
10854 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
10855 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
10856 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
10857 install_element (BGP_IPV6M_NODE
, &no_neighbor_activate_cmd
);
10858 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
10860 /* "neighbor peer-group set" commands. */
10861 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
10862 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
10863 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
10864 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
10865 install_element (BGP_IPV6M_NODE
, &neighbor_set_peer_group_cmd
);
10866 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
10868 /* "no neighbor peer-group unset" commands. */
10869 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
10870 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
10871 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
10872 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
10873 install_element (BGP_IPV6M_NODE
, &no_neighbor_set_peer_group_cmd
);
10874 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
10876 /* "neighbor softreconfiguration inbound" commands.*/
10877 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
10878 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
10879 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
10880 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
10881 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
10882 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
10883 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
10884 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
10885 install_element (BGP_IPV6M_NODE
, &neighbor_soft_reconfiguration_cmd
);
10886 install_element (BGP_IPV6M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
10887 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
10888 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
10890 /* "neighbor attribute-unchanged" commands. */
10891 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
10892 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
10893 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
10894 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
10895 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
10896 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
10897 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
10898 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
10899 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
10900 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
10901 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
10902 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
10903 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
10904 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
10905 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
10906 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
10907 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
10908 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
10909 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
10910 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
10911 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
10912 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
10913 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
10914 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
10915 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
10916 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
10917 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
10918 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
10919 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
10920 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
10921 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
10922 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
10923 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
10924 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
10925 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
10926 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
10927 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
10928 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
10929 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
10930 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
10931 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
10932 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
10933 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
10934 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
10935 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
10936 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
10937 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
10938 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
10939 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
10940 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
10941 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
10942 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
10943 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
10944 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
10945 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
10946 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
10947 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
10948 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
10949 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
10950 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
10951 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
10952 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
10953 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
10954 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
10955 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
10956 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
10957 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
10958 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
10959 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
10960 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
10961 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
10962 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
10963 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
10964 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
10965 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
10966 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
10967 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
10968 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
10969 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
10970 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
10971 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
10972 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
10973 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
10974 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
10975 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
10976 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
10977 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
10978 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
10979 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged_cmd
);
10980 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged1_cmd
);
10981 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged2_cmd
);
10982 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged3_cmd
);
10983 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged4_cmd
);
10984 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged5_cmd
);
10985 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged6_cmd
);
10986 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged7_cmd
);
10987 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged8_cmd
);
10988 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged9_cmd
);
10989 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged10_cmd
);
10990 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged_cmd
);
10991 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
10992 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
10993 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
10994 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
10995 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
10996 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
10997 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
10998 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
10999 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
11000 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
11001 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
11002 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
11003 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
11004 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
11005 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
11006 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
11007 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
11008 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
11009 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
11010 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
11011 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
11012 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
11013 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
11014 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
11015 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
11016 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
11017 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
11018 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
11019 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
11020 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
11021 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
11022 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
11024 /* "nexthop-local unchanged" commands */
11025 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_local_unchanged_cmd
);
11026 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_local_unchanged_cmd
);
11028 /* "transparent-as" and "transparent-nexthop" for old version
11030 install_element (BGP_NODE
, &neighbor_transparent_as_cmd
);
11031 install_element (BGP_NODE
, &neighbor_transparent_nexthop_cmd
);
11033 /* "neighbor next-hop-self" commands. */
11034 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
11035 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
11036 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
11037 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
11038 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
11039 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
11040 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
11041 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
11042 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_cmd
);
11043 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_cmd
);
11044 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
11045 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
11047 /* "neighbor as-override" commands. */
11048 install_element (BGP_NODE
, &neighbor_as_override_cmd
);
11049 install_element (BGP_NODE
, &no_neighbor_as_override_cmd
);
11050 install_element (BGP_IPV4_NODE
, &neighbor_as_override_cmd
);
11051 install_element (BGP_IPV4_NODE
, &no_neighbor_as_override_cmd
);
11052 install_element (BGP_IPV4M_NODE
, &neighbor_as_override_cmd
);
11053 install_element (BGP_IPV4M_NODE
, &no_neighbor_as_override_cmd
);
11054 install_element (BGP_IPV6_NODE
, &neighbor_as_override_cmd
);
11055 install_element (BGP_IPV6_NODE
, &no_neighbor_as_override_cmd
);
11056 install_element (BGP_IPV6M_NODE
, &neighbor_as_override_cmd
);
11057 install_element (BGP_IPV6M_NODE
, &no_neighbor_as_override_cmd
);
11058 install_element (BGP_VPNV4_NODE
, &neighbor_as_override_cmd
);
11059 install_element (BGP_VPNV4_NODE
, &no_neighbor_as_override_cmd
);
11061 /* "neighbor remove-private-AS" commands. */
11062 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
11063 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
11064 install_element (BGP_NODE
, &neighbor_remove_private_as_all_cmd
);
11065 install_element (BGP_NODE
, &no_neighbor_remove_private_as_all_cmd
);
11066 install_element (BGP_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
11067 install_element (BGP_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
11068 install_element (BGP_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
11069 install_element (BGP_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
11070 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
11071 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
11072 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_all_cmd
);
11073 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_all_cmd
);
11074 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
11075 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
11076 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
11077 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
11078 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
11079 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
11080 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_all_cmd
);
11081 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_all_cmd
);
11082 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
11083 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
11084 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
11085 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
11086 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
11087 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
11088 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_all_cmd
);
11089 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_all_cmd
);
11090 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
11091 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
11092 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
11093 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
11094 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_cmd
);
11095 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_cmd
);
11096 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_all_cmd
);
11097 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_all_cmd
);
11098 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
11099 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
11100 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
11101 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
11102 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
11103 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
11104 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_all_cmd
);
11105 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_all_cmd
);
11106 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
11107 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
11108 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
11109 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
11111 /* "neighbor send-community" commands.*/
11112 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
11113 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
11114 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
11115 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
11116 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
11117 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
11118 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
11119 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
11120 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
11121 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
11122 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
11123 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
11124 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
11125 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
11126 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
11127 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
11128 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_cmd
);
11129 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_type_cmd
);
11130 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_cmd
);
11131 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_type_cmd
);
11132 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
11133 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
11134 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
11135 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
11137 /* "neighbor route-reflector" commands.*/
11138 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
11139 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
11140 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
11141 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
11142 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
11143 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
11144 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
11145 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
11146 install_element (BGP_IPV6M_NODE
, &neighbor_route_reflector_client_cmd
);
11147 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_reflector_client_cmd
);
11148 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
11149 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
11151 /* "neighbor route-server" commands.*/
11152 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
11153 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
11154 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
11155 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
11156 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
11157 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
11158 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
11159 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
11160 install_element (BGP_IPV6M_NODE
, &neighbor_route_server_client_cmd
);
11161 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_server_client_cmd
);
11162 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
11163 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
11165 /* "neighbor passive" commands. */
11166 install_element (BGP_NODE
, &neighbor_passive_cmd
);
11167 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
11169 /* "neighbor bfd" commands. */
11170 install_element (BGP_NODE
, &neighbor_bfd_cmd
);
11171 install_element (BGP_NODE
, &no_neighbor_bfd_cmd
);
11173 /* "neighbor shutdown" commands. */
11174 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
11175 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
11177 /* Deprecated "neighbor capability route-refresh" commands.*/
11178 install_element (BGP_NODE
, &neighbor_capability_route_refresh_cmd
);
11179 install_element (BGP_NODE
, &no_neighbor_capability_route_refresh_cmd
);
11181 /* "neighbor capability orf prefix-list" commands.*/
11182 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
11183 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
11184 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
11185 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
11186 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
11187 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
11188 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
11189 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
11190 install_element (BGP_IPV6M_NODE
, &neighbor_capability_orf_prefix_cmd
);
11191 install_element (BGP_IPV6M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
11193 /* "neighbor capability dynamic" commands.*/
11194 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
11195 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
11197 /* "neighbor dont-capability-negotiate" commands. */
11198 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
11199 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
11201 /* "neighbor ebgp-multihop" commands. */
11202 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
11203 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
11204 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
11205 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
11207 /* "neighbor disable-connected-check" commands. */
11208 install_element (BGP_NODE
, &neighbor_disable_connected_check_cmd
);
11209 install_element (BGP_NODE
, &no_neighbor_disable_connected_check_cmd
);
11210 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
11211 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
11213 /* "neighbor description" commands. */
11214 install_element (BGP_NODE
, &neighbor_description_cmd
);
11215 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
11216 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
11218 /* "neighbor update-source" commands. "*/
11219 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
11220 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
11222 /* "neighbor default-originate" commands. */
11223 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
11224 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
11225 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
11226 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
11227 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
11228 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
11229 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
11230 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
11231 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
11232 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
11233 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
11234 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
11235 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
11236 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
11237 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
11238 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
11239 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_cmd
);
11240 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_rmap_cmd
);
11241 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_cmd
);
11242 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
11244 /* "neighbor port" commands. */
11245 install_element (BGP_NODE
, &neighbor_port_cmd
);
11246 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
11247 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
11249 /* "neighbor weight" commands. */
11250 install_element (BGP_NODE
, &neighbor_weight_cmd
);
11251 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
11252 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
11254 /* "neighbor override-capability" commands. */
11255 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
11256 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
11258 /* "neighbor strict-capability-match" commands. */
11259 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
11260 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
11262 /* "neighbor timers" commands. */
11263 install_element (BGP_NODE
, &neighbor_timers_cmd
);
11264 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
11266 /* "neighbor timers connect" commands. */
11267 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
11268 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
11269 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
11271 /* "neighbor advertisement-interval" commands. */
11272 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
11273 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
11274 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
11276 /* "neighbor version" commands. */
11277 install_element (BGP_NODE
, &neighbor_version_cmd
);
11279 /* "neighbor interface" commands. */
11280 install_element (BGP_NODE
, &neighbor_interface_cmd
);
11281 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
11283 /* "neighbor distribute" commands. */
11284 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
11285 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
11286 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
11287 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
11288 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
11289 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
11290 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
11291 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
11292 install_element (BGP_IPV6M_NODE
, &neighbor_distribute_list_cmd
);
11293 install_element (BGP_IPV6M_NODE
, &no_neighbor_distribute_list_cmd
);
11294 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
11295 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
11297 /* "neighbor prefix-list" commands. */
11298 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
11299 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
11300 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
11301 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
11302 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
11303 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
11304 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
11305 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
11306 install_element (BGP_IPV6M_NODE
, &neighbor_prefix_list_cmd
);
11307 install_element (BGP_IPV6M_NODE
, &no_neighbor_prefix_list_cmd
);
11308 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
11309 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
11311 /* "neighbor filter-list" commands. */
11312 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
11313 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
11314 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
11315 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
11316 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
11317 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
11318 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
11319 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
11320 install_element (BGP_IPV6M_NODE
, &neighbor_filter_list_cmd
);
11321 install_element (BGP_IPV6M_NODE
, &no_neighbor_filter_list_cmd
);
11322 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
11323 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
11325 /* "neighbor route-map" commands. */
11326 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
11327 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
11328 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
11329 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
11330 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
11331 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
11332 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
11333 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
11334 install_element (BGP_IPV6M_NODE
, &neighbor_route_map_cmd
);
11335 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_map_cmd
);
11336 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
11337 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
11339 /* "neighbor unsuppress-map" commands. */
11340 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
11341 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
11342 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
11343 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
11344 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
11345 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
11346 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
11347 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
11348 install_element (BGP_IPV6M_NODE
, &neighbor_unsuppress_map_cmd
);
11349 install_element (BGP_IPV6M_NODE
, &no_neighbor_unsuppress_map_cmd
);
11350 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
11351 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
11353 /* "neighbor maximum-prefix" commands. */
11354 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
11355 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
11356 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
11357 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
11358 install_element (BGP_NODE
, &neighbor_maximum_prefix_restart_cmd
);
11359 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
11360 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
11361 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
11362 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
11363 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
11364 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
11365 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
11366 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
11367 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
11368 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
11369 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
11370 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
11371 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
11372 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
11373 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
11374 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
11375 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
11376 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
11377 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
11378 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
11379 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
11380 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
11381 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
11382 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
11383 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
11384 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
11385 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
11386 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
11387 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
11388 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
11389 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
11390 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
11391 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
11392 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
11393 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
11394 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
11395 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
11396 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
11397 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
11398 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
11399 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
11400 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
11401 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
11402 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
11403 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
11404 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
11405 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
11406 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_cmd
);
11407 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
11408 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
11409 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
11410 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
11411 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
11412 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_cmd
);
11413 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
11414 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
11415 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
11416 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
11417 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
11418 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
11419 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
11420 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
11421 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
11422 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
11423 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
11424 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
11425 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
11426 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
11427 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
11428 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
11429 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
11430 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
11431 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
11433 /* "neighbor allowas-in" */
11434 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
11435 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
11436 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
11437 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
11438 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
11439 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
11440 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
11441 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
11442 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
11443 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
11444 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
11445 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
11446 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_cmd
);
11447 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_arg_cmd
);
11448 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_cmd
);
11449 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
11450 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
11451 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
11453 /* address-family commands. */
11454 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
11455 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
11457 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
11458 install_element (BGP_NODE
, &address_family_ipv6_safi_cmd
);
11459 #endif /* HAVE_IPV6 */
11460 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
11461 install_element (BGP_NODE
, &address_family_vpnv4_unicast_cmd
);
11463 /* "exit-address-family" command. */
11464 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
11465 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
11466 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
11467 install_element (BGP_IPV6M_NODE
, &exit_address_family_cmd
);
11468 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
11470 /* "clear ip bgp commands" */
11471 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
11472 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
11473 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
11474 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
11475 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
11476 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
11478 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
11479 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
11480 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
11481 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
11482 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
11483 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
11484 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
11485 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
11486 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
11487 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
11488 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
11489 #endif /* HAVE_IPV6 */
11491 /* "clear ip bgp neighbor soft in" */
11492 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
11493 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
11494 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
11495 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
11496 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_prefix_filter_cmd
);
11497 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
11498 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
11499 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
11500 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
11501 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
11502 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
11503 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
11504 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
11505 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
11506 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
11507 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
11508 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
11509 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
11510 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
11511 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
11512 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
11513 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
);
11514 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
11515 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
11516 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
11517 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
11518 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
11519 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
11520 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
11521 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
11522 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
11523 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
11524 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
11525 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
11526 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_in_cmd
);
11527 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_in_cmd
);
11528 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_in_cmd
);
11529 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_in_cmd
);
11530 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_in_cmd
);
11531 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_in_cmd
);
11533 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
11534 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
11535 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
11536 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
11537 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
11538 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
11539 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
11540 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
11541 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
11542 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
11543 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
11544 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
11545 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
11546 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
11547 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
11548 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
11549 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
11550 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
11551 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
11552 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
11553 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
11554 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
11555 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
11556 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
11557 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
11558 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
11559 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
11560 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
11561 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
11562 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
11563 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
11564 #endif /* HAVE_IPV6 */
11566 /* clear ip bgp prefix */
11567 install_element (ENABLE_NODE
, &clear_ip_bgp_prefix_cmd
);
11568 install_element (ENABLE_NODE
, &clear_bgp_ipv6_safi_prefix_cmd
);
11570 /* "clear ip bgp neighbor soft out" */
11571 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
11572 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
11573 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
11574 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
11575 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
11576 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
11577 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
11578 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
11579 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
11580 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
11581 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
11582 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
11583 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
11584 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
11585 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
11586 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
11587 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
11588 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
11589 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
11590 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
11591 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
11592 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
11593 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_out_cmd
);
11594 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_out_cmd
);
11595 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_out_cmd
);
11596 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_out_cmd
);
11597 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_out_cmd
);
11598 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_out_cmd
);
11600 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
11601 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
11602 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
11603 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
11604 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
11605 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
11606 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
11607 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
11608 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
11609 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
11610 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
11611 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
11612 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
11613 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
11614 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
11615 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
11616 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
11617 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
11618 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
11619 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
11620 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
11621 #endif /* HAVE_IPV6 */
11623 /* "clear ip bgp neighbor soft" */
11624 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
11625 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
11626 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
11627 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
11628 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
11629 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
11630 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
11631 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
11632 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
11633 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
11634 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
11635 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
11636 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_cmd
);
11637 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_cmd
);
11638 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_cmd
);
11640 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
11641 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
11642 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
11643 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
11644 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
11645 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
11646 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
11647 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
11648 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
11649 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
11650 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
11651 #endif /* HAVE_IPV6 */
11653 /* "clear ip bgp neighbor rsclient" */
11654 install_element (ENABLE_NODE
, &clear_ip_bgp_all_rsclient_cmd
);
11655 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_rsclient_cmd
);
11656 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_rsclient_cmd
);
11657 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_rsclient_cmd
);
11659 install_element (ENABLE_NODE
, &clear_bgp_all_rsclient_cmd
);
11660 install_element (ENABLE_NODE
, &clear_bgp_instance_all_rsclient_cmd
);
11661 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_rsclient_cmd
);
11662 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_all_rsclient_cmd
);
11663 install_element (ENABLE_NODE
, &clear_bgp_peer_rsclient_cmd
);
11664 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_rsclient_cmd
);
11665 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_rsclient_cmd
);
11666 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_peer_rsclient_cmd
);
11667 #endif /* HAVE_IPV6 */
11669 /* "show ip bgp summary" commands. */
11670 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
11671 install_element (VIEW_NODE
, &show_ip_bgp_summary_csv_cmd
);
11672 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_cmd
);
11673 install_element (VIEW_NODE
, &show_bgp_updgrps_cmd
);
11674 install_element (VIEW_NODE
, &show_bgp_ipv6_updgrps_cmd
);
11675 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_adj_cmd
);
11676 install_element (VIEW_NODE
, &show_bgp_updgrps_adj_cmd
);
11677 install_element (VIEW_NODE
, &show_bgp_updgrps_afi_adj_cmd
);
11678 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_adj_subgroup_cmd
);
11679 install_element (VIEW_NODE
, &show_bgp_updgrps_adj_subgroup_cmd
);
11680 install_element (VIEW_NODE
, &show_bgp_updgrps_afi_adj_subgroup_cmd
);
11681 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
11682 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
11683 install_element (VIEW_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
11684 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
11685 install_element (VIEW_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
11686 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
11687 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
11689 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
11690 install_element (VIEW_NODE
, &show_bgp_summary_csv_cmd
);
11691 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
11692 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
11693 install_element (VIEW_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
11694 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
11695 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
11696 #endif /* HAVE_IPV6 */
11697 install_element (RESTRICTED_NODE
, &show_ip_bgp_summary_cmd
);
11698 install_element (RESTRICTED_NODE
, &show_ip_bgp_summary_csv_cmd
);
11699 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_cmd
);
11700 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_cmd
);
11701 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_updgrps_cmd
);
11702 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_adj_cmd
);
11703 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_adj_cmd
);
11704 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_afi_adj_cmd
);
11705 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_adj_subgroup_cmd
);
11706 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_adj_subgroup_cmd
);
11707 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_afi_adj_subgroup_cmd
);
11708 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_summary_cmd
);
11709 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
11710 install_element (RESTRICTED_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
11711 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
11712 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
11713 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
11714 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
11716 install_element (RESTRICTED_NODE
, &show_bgp_summary_cmd
);
11717 install_element (RESTRICTED_NODE
, &show_bgp_summary_csv_cmd
);
11718 install_element (RESTRICTED_NODE
, &show_bgp_instance_summary_cmd
);
11719 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_summary_cmd
);
11720 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
11721 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
11722 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
11723 #endif /* HAVE_IPV6 */
11724 install_element (ENABLE_NODE
, &show_ip_bgp_summary_cmd
);
11725 install_element (ENABLE_NODE
, &show_ip_bgp_summary_csv_cmd
);
11726 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_cmd
);
11727 install_element (ENABLE_NODE
, &show_bgp_updgrps_cmd
);
11728 install_element (ENABLE_NODE
, &show_bgp_ipv6_updgrps_cmd
);
11729 install_element (ENABLE_NODE
, &show_bgp_updgrps_stats_cmd
);
11730 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_adj_cmd
);
11731 install_element (ENABLE_NODE
, &show_bgp_updgrps_adj_cmd
);
11732 install_element (ENABLE_NODE
, &show_bgp_updgrps_afi_adj_cmd
);
11733 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_adj_subgroup_cmd
);
11734 install_element (ENABLE_NODE
, &show_bgp_updgrps_adj_subgroup_cmd
);
11735 install_element (ENABLE_NODE
, &show_bgp_updgrps_afi_adj_subgroup_cmd
);
11736 install_element (ENABLE_NODE
, &show_ip_bgp_instance_summary_cmd
);
11737 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
11738 install_element (ENABLE_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
11739 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
11740 install_element (ENABLE_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
11741 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
11742 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
11744 install_element (ENABLE_NODE
, &show_bgp_summary_cmd
);
11745 install_element (ENABLE_NODE
, &show_bgp_summary_csv_cmd
);
11746 install_element (ENABLE_NODE
, &show_bgp_instance_summary_cmd
);
11747 install_element (ENABLE_NODE
, &show_bgp_ipv6_summary_cmd
);
11748 install_element (ENABLE_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
11749 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
11750 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
11751 #endif /* HAVE_IPV6 */
11753 /* "show ip bgp neighbors" commands. */
11754 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
11755 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
11756 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
11757 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
11758 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
11759 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
11760 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
11761 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
11762 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
11763 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
11764 install_element (RESTRICTED_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
11765 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
11766 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
11767 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
11768 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
11769 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_cmd
);
11770 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
11771 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
11772 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
11773 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
11774 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
11775 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
11776 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
11777 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
11778 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
11781 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
11782 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
11783 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
11784 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
11785 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
11786 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
11787 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
11788 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
11789 install_element (RESTRICTED_NODE
, &show_bgp_neighbors_peer_cmd
);
11790 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
11791 install_element (RESTRICTED_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
11792 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
11793 install_element (ENABLE_NODE
, &show_bgp_neighbors_cmd
);
11794 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_cmd
);
11795 install_element (ENABLE_NODE
, &show_bgp_neighbors_peer_cmd
);
11796 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
11797 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_cmd
);
11798 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
11799 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
11800 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
11802 /* Old commands. */
11803 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
11804 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
11805 install_element (ENABLE_NODE
, &show_ipv6_bgp_summary_cmd
);
11806 install_element (ENABLE_NODE
, &show_ipv6_mbgp_summary_cmd
);
11807 #endif /* HAVE_IPV6 */
11809 /* "show ip bgp rsclient" commands. */
11810 install_element (VIEW_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
11811 install_element (VIEW_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
11812 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
11813 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
11814 install_element (VIEW_NODE
, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd
);
11815 install_element (VIEW_NODE
, &show_bgp_ipv4_safi_rsclient_summary_cmd
);
11816 install_element (RESTRICTED_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
11817 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
11818 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
11819 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
11820 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd
);
11821 install_element (RESTRICTED_NODE
, &show_bgp_ipv4_safi_rsclient_summary_cmd
);
11822 install_element (ENABLE_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
11823 install_element (ENABLE_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
11824 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
11825 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
11826 install_element (ENABLE_NODE
, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd
);
11827 install_element (ENABLE_NODE
, &show_bgp_ipv4_safi_rsclient_summary_cmd
);
11830 install_element (VIEW_NODE
, &show_bgp_rsclient_summary_cmd
);
11831 install_element (VIEW_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
11832 install_element (VIEW_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
11833 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
11834 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd
);
11835 install_element (VIEW_NODE
, &show_bgp_ipv6_safi_rsclient_summary_cmd
);
11836 install_element (RESTRICTED_NODE
, &show_bgp_rsclient_summary_cmd
);
11837 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
11838 install_element (RESTRICTED_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
11839 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
11840 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd
);
11841 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_safi_rsclient_summary_cmd
);
11842 install_element (ENABLE_NODE
, &show_bgp_rsclient_summary_cmd
);
11843 install_element (ENABLE_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
11844 install_element (ENABLE_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
11845 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
11846 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd
);
11847 install_element (ENABLE_NODE
, &show_bgp_ipv6_safi_rsclient_summary_cmd
);
11848 #endif /* HAVE_IPV6 */
11850 /* "show ip bgp paths" commands. */
11851 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
11852 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
11853 install_element (ENABLE_NODE
, &show_ip_bgp_paths_cmd
);
11854 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
11856 /* "show ip bgp community" commands. */
11857 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
11858 install_element (ENABLE_NODE
, &show_ip_bgp_community_info_cmd
);
11860 /* "show ip bgp attribute-info" commands. */
11861 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
11862 install_element (ENABLE_NODE
, &show_ip_bgp_attr_info_cmd
);
11864 /* "redistribute" commands. */
11865 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
11866 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
11867 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
11868 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
11869 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
11870 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
11871 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
11872 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
11873 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
11874 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
11875 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_cmd
);
11876 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_cmd
);
11877 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_rmap_cmd
);
11878 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_cmd
);
11879 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_metric_cmd
);
11880 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_cmd
);
11881 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
11882 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
11883 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
11884 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
11886 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
11887 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
11888 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
11889 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
11890 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
11891 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
11892 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
11893 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
11894 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
11895 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
11896 #endif /* HAVE_IPV6 */
11898 /* ttl_security commands */
11899 install_element (BGP_NODE
, &neighbor_ttl_security_cmd
);
11900 install_element (BGP_NODE
, &no_neighbor_ttl_security_cmd
);
11902 /* "show bgp memory" commands. */
11903 install_element (VIEW_NODE
, &show_bgp_memory_cmd
);
11904 install_element (RESTRICTED_NODE
, &show_bgp_memory_cmd
);
11905 install_element (ENABLE_NODE
, &show_bgp_memory_cmd
);
11907 /* "show bgp views" commands. */
11908 install_element (VIEW_NODE
, &show_bgp_views_cmd
);
11909 install_element (RESTRICTED_NODE
, &show_bgp_views_cmd
);
11910 install_element (ENABLE_NODE
, &show_bgp_views_cmd
);
11912 /* Community-list. */
11913 community_list_vty ();
11916 #include "memory.h"
11917 #include "bgp_regex.h"
11918 #include "bgp_clist.h"
11919 #include "bgp_ecommunity.h"
11921 /* VTY functions. */
11923 /* Direction value to string conversion. */
11924 static const char *
11925 community_direct_str (int direct
)
11929 case COMMUNITY_DENY
:
11931 case COMMUNITY_PERMIT
:
11938 /* Display error string. */
11940 community_list_perror (struct vty
*vty
, int ret
)
11944 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
11945 vty_out (vty
, "%% Can't find community-list%s", VTY_NEWLINE
);
11947 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
11948 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
11950 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
11951 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
11953 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
11954 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
11959 /* VTY interface for community_set() function. */
11961 community_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
11962 int style
, int reject_all_digit_name
)
11968 /* Check the list type. */
11969 if (strncmp (argv
[1], "p", 1) == 0)
11970 direct
= COMMUNITY_PERMIT
;
11971 else if (strncmp (argv
[1], "d", 1) == 0)
11972 direct
= COMMUNITY_DENY
;
11975 vty_out (vty
, "%% Matching condition must be permit or deny%s",
11977 return CMD_WARNING
;
11980 /* All digit name check. */
11981 if (reject_all_digit_name
&& all_digit (argv
[0]))
11983 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
11984 return CMD_WARNING
;
11987 /* Concat community string argument. */
11989 str
= argv_concat (argv
, argc
, 2);
11993 /* When community_list_set() return nevetive value, it means
11994 malformed community string. */
11995 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
11997 /* Free temporary community list string allocated by
12000 XFREE (MTYPE_TMP
, str
);
12004 /* Display error string. */
12005 community_list_perror (vty
, ret
);
12006 return CMD_WARNING
;
12009 return CMD_SUCCESS
;
12012 /* Communiyt-list entry delete. */
12014 community_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
12023 /* Check the list direct. */
12024 if (strncmp (argv
[1], "p", 1) == 0)
12025 direct
= COMMUNITY_PERMIT
;
12026 else if (strncmp (argv
[1], "d", 1) == 0)
12027 direct
= COMMUNITY_DENY
;
12030 vty_out (vty
, "%% Matching condition must be permit or deny%s",
12032 return CMD_WARNING
;
12035 /* Concat community string argument. */
12036 str
= argv_concat (argv
, argc
, 2);
12039 /* Unset community list. */
12040 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
12042 /* Free temporary community list string allocated by
12045 XFREE (MTYPE_TMP
, str
);
12049 community_list_perror (vty
, ret
);
12050 return CMD_WARNING
;
12053 return CMD_SUCCESS
;
12056 /* "community-list" keyword help string. */
12057 #define COMMUNITY_LIST_STR "Add a community list entry\n"
12058 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
12060 DEFUN (ip_community_list_standard
,
12061 ip_community_list_standard_cmd
,
12062 "ip community-list <1-99> (deny|permit) .AA:NN",
12065 "Community list number (standard)\n"
12066 "Specify community to reject\n"
12067 "Specify community to accept\n"
12070 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
12073 ALIAS (ip_community_list_standard
,
12074 ip_community_list_standard2_cmd
,
12075 "ip community-list <1-99> (deny|permit)",
12078 "Community list number (standard)\n"
12079 "Specify community to reject\n"
12080 "Specify community to accept\n")
12082 DEFUN (ip_community_list_expanded
,
12083 ip_community_list_expanded_cmd
,
12084 "ip community-list <100-500> (deny|permit) .LINE",
12087 "Community list number (expanded)\n"
12088 "Specify community to reject\n"
12089 "Specify community to accept\n"
12090 "An ordered list as a regular-expression\n")
12092 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
12095 DEFUN (ip_community_list_name_standard
,
12096 ip_community_list_name_standard_cmd
,
12097 "ip community-list standard WORD (deny|permit) .AA:NN",
12100 "Add a standard community-list entry\n"
12101 "Community list name\n"
12102 "Specify community to reject\n"
12103 "Specify community to accept\n"
12106 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
12109 ALIAS (ip_community_list_name_standard
,
12110 ip_community_list_name_standard2_cmd
,
12111 "ip community-list standard WORD (deny|permit)",
12114 "Add a standard community-list entry\n"
12115 "Community list name\n"
12116 "Specify community to reject\n"
12117 "Specify community to accept\n")
12119 DEFUN (ip_community_list_name_expanded
,
12120 ip_community_list_name_expanded_cmd
,
12121 "ip community-list expanded WORD (deny|permit) .LINE",
12124 "Add an expanded community-list entry\n"
12125 "Community list name\n"
12126 "Specify community to reject\n"
12127 "Specify community to accept\n"
12128 "An ordered list as a regular-expression\n")
12130 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
12133 DEFUN (no_ip_community_list_standard_all
,
12134 no_ip_community_list_standard_all_cmd
,
12135 "no ip community-list <1-99>",
12139 "Community list number (standard)\n")
12141 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
12144 DEFUN (no_ip_community_list_expanded_all
,
12145 no_ip_community_list_expanded_all_cmd
,
12146 "no ip community-list <100-500>",
12150 "Community list number (expanded)\n")
12152 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
12155 DEFUN (no_ip_community_list_name_standard_all
,
12156 no_ip_community_list_name_standard_all_cmd
,
12157 "no ip community-list standard WORD",
12161 "Add a standard community-list entry\n"
12162 "Community list name\n")
12164 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
12167 DEFUN (no_ip_community_list_name_expanded_all
,
12168 no_ip_community_list_name_expanded_all_cmd
,
12169 "no ip community-list expanded WORD",
12173 "Add an expanded community-list entry\n"
12174 "Community list name\n")
12176 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
12179 DEFUN (no_ip_community_list_standard
,
12180 no_ip_community_list_standard_cmd
,
12181 "no ip community-list <1-99> (deny|permit) .AA:NN",
12185 "Community list number (standard)\n"
12186 "Specify community to reject\n"
12187 "Specify community to accept\n"
12190 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
12193 DEFUN (no_ip_community_list_expanded
,
12194 no_ip_community_list_expanded_cmd
,
12195 "no ip community-list <100-500> (deny|permit) .LINE",
12199 "Community list number (expanded)\n"
12200 "Specify community to reject\n"
12201 "Specify community to accept\n"
12202 "An ordered list as a regular-expression\n")
12204 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
12207 DEFUN (no_ip_community_list_name_standard
,
12208 no_ip_community_list_name_standard_cmd
,
12209 "no ip community-list standard WORD (deny|permit) .AA:NN",
12213 "Specify a standard community-list\n"
12214 "Community list name\n"
12215 "Specify community to reject\n"
12216 "Specify community to accept\n"
12219 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
12222 DEFUN (no_ip_community_list_name_expanded
,
12223 no_ip_community_list_name_expanded_cmd
,
12224 "no ip community-list expanded WORD (deny|permit) .LINE",
12228 "Specify an expanded community-list\n"
12229 "Community list name\n"
12230 "Specify community to reject\n"
12231 "Specify community to accept\n"
12232 "An ordered list as a regular-expression\n")
12234 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
12238 community_list_show (struct vty
*vty
, struct community_list
*list
)
12240 struct community_entry
*entry
;
12242 for (entry
= list
->head
; entry
; entry
= entry
->next
)
12244 if (entry
== list
->head
)
12246 if (all_digit (list
->name
))
12247 vty_out (vty
, "Community %s list %s%s",
12248 entry
->style
== COMMUNITY_LIST_STANDARD
?
12249 "standard" : "(expanded) access",
12250 list
->name
, VTY_NEWLINE
);
12252 vty_out (vty
, "Named Community %s list %s%s",
12253 entry
->style
== COMMUNITY_LIST_STANDARD
?
12254 "standard" : "expanded",
12255 list
->name
, VTY_NEWLINE
);
12258 vty_out (vty
, " %s%s",
12259 community_direct_str (entry
->direct
), VTY_NEWLINE
);
12261 vty_out (vty
, " %s %s%s",
12262 community_direct_str (entry
->direct
),
12263 entry
->style
== COMMUNITY_LIST_STANDARD
12264 ? community_str (entry
->u
.com
) : entry
->config
,
12269 DEFUN (show_ip_community_list
,
12270 show_ip_community_list_cmd
,
12271 "show ip community-list",
12274 "List community-list\n")
12276 struct community_list
*list
;
12277 struct community_list_master
*cm
;
12279 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
12281 return CMD_SUCCESS
;
12283 for (list
= cm
->num
.head
; list
; list
= list
->next
)
12284 community_list_show (vty
, list
);
12286 for (list
= cm
->str
.head
; list
; list
= list
->next
)
12287 community_list_show (vty
, list
);
12289 return CMD_SUCCESS
;
12292 DEFUN (show_ip_community_list_arg
,
12293 show_ip_community_list_arg_cmd
,
12294 "show ip community-list (<1-500>|WORD)",
12297 "List community-list\n"
12298 "Community-list number\n"
12299 "Community-list name\n")
12301 struct community_list
*list
;
12303 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_MASTER
);
12306 vty_out (vty
, "%% Can't find community-list%s", VTY_NEWLINE
);
12307 return CMD_WARNING
;
12310 community_list_show (vty
, list
);
12312 return CMD_SUCCESS
;
12316 extcommunity_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
12317 int style
, int reject_all_digit_name
)
12323 /* Check the list type. */
12324 if (strncmp (argv
[1], "p", 1) == 0)
12325 direct
= COMMUNITY_PERMIT
;
12326 else if (strncmp (argv
[1], "d", 1) == 0)
12327 direct
= COMMUNITY_DENY
;
12330 vty_out (vty
, "%% Matching condition must be permit or deny%s",
12332 return CMD_WARNING
;
12335 /* All digit name check. */
12336 if (reject_all_digit_name
&& all_digit (argv
[0]))
12338 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
12339 return CMD_WARNING
;
12342 /* Concat community string argument. */
12344 str
= argv_concat (argv
, argc
, 2);
12348 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
12350 /* Free temporary community list string allocated by
12353 XFREE (MTYPE_TMP
, str
);
12357 community_list_perror (vty
, ret
);
12358 return CMD_WARNING
;
12360 return CMD_SUCCESS
;
12364 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
12373 /* Check the list direct. */
12374 if (strncmp (argv
[1], "p", 1) == 0)
12375 direct
= COMMUNITY_PERMIT
;
12376 else if (strncmp (argv
[1], "d", 1) == 0)
12377 direct
= COMMUNITY_DENY
;
12380 vty_out (vty
, "%% Matching condition must be permit or deny%s",
12382 return CMD_WARNING
;
12385 /* Concat community string argument. */
12386 str
= argv_concat (argv
, argc
, 2);
12389 /* Unset community list. */
12390 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
12392 /* Free temporary community list string allocated by
12395 XFREE (MTYPE_TMP
, str
);
12399 community_list_perror (vty
, ret
);
12400 return CMD_WARNING
;
12403 return CMD_SUCCESS
;
12406 /* "extcommunity-list" keyword help string. */
12407 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
12408 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
12410 DEFUN (ip_extcommunity_list_standard
,
12411 ip_extcommunity_list_standard_cmd
,
12412 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
12414 EXTCOMMUNITY_LIST_STR
12415 "Extended Community list number (standard)\n"
12416 "Specify community to reject\n"
12417 "Specify community to accept\n"
12418 EXTCOMMUNITY_VAL_STR
)
12420 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
12423 ALIAS (ip_extcommunity_list_standard
,
12424 ip_extcommunity_list_standard2_cmd
,
12425 "ip extcommunity-list <1-99> (deny|permit)",
12427 EXTCOMMUNITY_LIST_STR
12428 "Extended Community list number (standard)\n"
12429 "Specify community to reject\n"
12430 "Specify community to accept\n")
12432 DEFUN (ip_extcommunity_list_expanded
,
12433 ip_extcommunity_list_expanded_cmd
,
12434 "ip extcommunity-list <100-500> (deny|permit) .LINE",
12436 EXTCOMMUNITY_LIST_STR
12437 "Extended Community list number (expanded)\n"
12438 "Specify community to reject\n"
12439 "Specify community to accept\n"
12440 "An ordered list as a regular-expression\n")
12442 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
12445 DEFUN (ip_extcommunity_list_name_standard
,
12446 ip_extcommunity_list_name_standard_cmd
,
12447 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
12449 EXTCOMMUNITY_LIST_STR
12450 "Specify standard extcommunity-list\n"
12451 "Extended Community list name\n"
12452 "Specify community to reject\n"
12453 "Specify community to accept\n"
12454 EXTCOMMUNITY_VAL_STR
)
12456 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
12459 ALIAS (ip_extcommunity_list_name_standard
,
12460 ip_extcommunity_list_name_standard2_cmd
,
12461 "ip extcommunity-list standard WORD (deny|permit)",
12463 EXTCOMMUNITY_LIST_STR
12464 "Specify standard extcommunity-list\n"
12465 "Extended Community list name\n"
12466 "Specify community to reject\n"
12467 "Specify community to accept\n")
12469 DEFUN (ip_extcommunity_list_name_expanded
,
12470 ip_extcommunity_list_name_expanded_cmd
,
12471 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
12473 EXTCOMMUNITY_LIST_STR
12474 "Specify expanded extcommunity-list\n"
12475 "Extended Community list name\n"
12476 "Specify community to reject\n"
12477 "Specify community to accept\n"
12478 "An ordered list as a regular-expression\n")
12480 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
12483 DEFUN (no_ip_extcommunity_list_standard_all
,
12484 no_ip_extcommunity_list_standard_all_cmd
,
12485 "no ip extcommunity-list <1-99>",
12488 EXTCOMMUNITY_LIST_STR
12489 "Extended Community list number (standard)\n")
12491 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
12494 DEFUN (no_ip_extcommunity_list_expanded_all
,
12495 no_ip_extcommunity_list_expanded_all_cmd
,
12496 "no ip extcommunity-list <100-500>",
12499 EXTCOMMUNITY_LIST_STR
12500 "Extended Community list number (expanded)\n")
12502 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
12505 DEFUN (no_ip_extcommunity_list_name_standard_all
,
12506 no_ip_extcommunity_list_name_standard_all_cmd
,
12507 "no ip extcommunity-list standard WORD",
12510 EXTCOMMUNITY_LIST_STR
12511 "Specify standard extcommunity-list\n"
12512 "Extended Community list name\n")
12514 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
12517 DEFUN (no_ip_extcommunity_list_name_expanded_all
,
12518 no_ip_extcommunity_list_name_expanded_all_cmd
,
12519 "no ip extcommunity-list expanded WORD",
12522 EXTCOMMUNITY_LIST_STR
12523 "Specify expanded extcommunity-list\n"
12524 "Extended Community list name\n")
12526 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
12529 DEFUN (no_ip_extcommunity_list_standard
,
12530 no_ip_extcommunity_list_standard_cmd
,
12531 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
12534 EXTCOMMUNITY_LIST_STR
12535 "Extended Community list number (standard)\n"
12536 "Specify community to reject\n"
12537 "Specify community to accept\n"
12538 EXTCOMMUNITY_VAL_STR
)
12540 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
12543 DEFUN (no_ip_extcommunity_list_expanded
,
12544 no_ip_extcommunity_list_expanded_cmd
,
12545 "no ip extcommunity-list <100-500> (deny|permit) .LINE",
12548 EXTCOMMUNITY_LIST_STR
12549 "Extended Community list number (expanded)\n"
12550 "Specify community to reject\n"
12551 "Specify community to accept\n"
12552 "An ordered list as a regular-expression\n")
12554 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
12557 DEFUN (no_ip_extcommunity_list_name_standard
,
12558 no_ip_extcommunity_list_name_standard_cmd
,
12559 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
12562 EXTCOMMUNITY_LIST_STR
12563 "Specify standard extcommunity-list\n"
12564 "Extended Community list name\n"
12565 "Specify community to reject\n"
12566 "Specify community to accept\n"
12567 EXTCOMMUNITY_VAL_STR
)
12569 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
12572 DEFUN (no_ip_extcommunity_list_name_expanded
,
12573 no_ip_extcommunity_list_name_expanded_cmd
,
12574 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
12577 EXTCOMMUNITY_LIST_STR
12578 "Specify expanded extcommunity-list\n"
12579 "Community list name\n"
12580 "Specify community to reject\n"
12581 "Specify community to accept\n"
12582 "An ordered list as a regular-expression\n")
12584 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
12588 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
12590 struct community_entry
*entry
;
12592 for (entry
= list
->head
; entry
; entry
= entry
->next
)
12594 if (entry
== list
->head
)
12596 if (all_digit (list
->name
))
12597 vty_out (vty
, "Extended community %s list %s%s",
12598 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
12599 "standard" : "(expanded) access",
12600 list
->name
, VTY_NEWLINE
);
12602 vty_out (vty
, "Named extended community %s list %s%s",
12603 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
12604 "standard" : "expanded",
12605 list
->name
, VTY_NEWLINE
);
12608 vty_out (vty
, " %s%s",
12609 community_direct_str (entry
->direct
), VTY_NEWLINE
);
12611 vty_out (vty
, " %s %s%s",
12612 community_direct_str (entry
->direct
),
12613 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
12614 entry
->u
.ecom
->str
: entry
->config
,
12619 DEFUN (show_ip_extcommunity_list
,
12620 show_ip_extcommunity_list_cmd
,
12621 "show ip extcommunity-list",
12624 "List extended-community list\n")
12626 struct community_list
*list
;
12627 struct community_list_master
*cm
;
12629 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
12631 return CMD_SUCCESS
;
12633 for (list
= cm
->num
.head
; list
; list
= list
->next
)
12634 extcommunity_list_show (vty
, list
);
12636 for (list
= cm
->str
.head
; list
; list
= list
->next
)
12637 extcommunity_list_show (vty
, list
);
12639 return CMD_SUCCESS
;
12642 DEFUN (show_ip_extcommunity_list_arg
,
12643 show_ip_extcommunity_list_arg_cmd
,
12644 "show ip extcommunity-list (<1-500>|WORD)",
12647 "List extended-community list\n"
12648 "Extcommunity-list number\n"
12649 "Extcommunity-list name\n")
12651 struct community_list
*list
;
12653 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_MASTER
);
12656 vty_out (vty
, "%% Can't find extcommunity-list%s", VTY_NEWLINE
);
12657 return CMD_WARNING
;
12660 extcommunity_list_show (vty
, list
);
12662 return CMD_SUCCESS
;
12665 /* Return configuration string of community-list entry. */
12666 static const char *
12667 community_list_config_str (struct community_entry
*entry
)
12675 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
12676 str
= community_str (entry
->u
.com
);
12678 str
= entry
->config
;
12683 /* Display community-list and extcommunity-list configuration. */
12685 community_list_config_write (struct vty
*vty
)
12687 struct community_list
*list
;
12688 struct community_entry
*entry
;
12689 struct community_list_master
*cm
;
12692 /* Community-list. */
12693 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
12695 for (list
= cm
->num
.head
; list
; list
= list
->next
)
12696 for (entry
= list
->head
; entry
; entry
= entry
->next
)
12698 vty_out (vty
, "ip community-list %s %s %s%s",
12699 list
->name
, community_direct_str (entry
->direct
),
12700 community_list_config_str (entry
),
12704 for (list
= cm
->str
.head
; list
; list
= list
->next
)
12705 for (entry
= list
->head
; entry
; entry
= entry
->next
)
12707 vty_out (vty
, "ip community-list %s %s %s %s%s",
12708 entry
->style
== COMMUNITY_LIST_STANDARD
12709 ? "standard" : "expanded",
12710 list
->name
, community_direct_str (entry
->direct
),
12711 community_list_config_str (entry
),
12716 /* Extcommunity-list. */
12717 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
12719 for (list
= cm
->num
.head
; list
; list
= list
->next
)
12720 for (entry
= list
->head
; entry
; entry
= entry
->next
)
12722 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
12723 list
->name
, community_direct_str (entry
->direct
),
12724 community_list_config_str (entry
), VTY_NEWLINE
);
12727 for (list
= cm
->str
.head
; list
; list
= list
->next
)
12728 for (entry
= list
->head
; entry
; entry
= entry
->next
)
12730 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
12731 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
12732 ? "standard" : "expanded",
12733 list
->name
, community_direct_str (entry
->direct
),
12734 community_list_config_str (entry
), VTY_NEWLINE
);
12740 static struct cmd_node community_list_node
=
12742 COMMUNITY_LIST_NODE
,
12744 1 /* Export to vtysh. */
12748 community_list_vty (void)
12750 install_node (&community_list_node
, community_list_config_write
);
12752 /* Community-list. */
12753 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
12754 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
12755 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
12756 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
12757 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
12758 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
12759 install_element (CONFIG_NODE
, &no_ip_community_list_standard_all_cmd
);
12760 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_all_cmd
);
12761 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_all_cmd
);
12762 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_all_cmd
);
12763 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
12764 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
12765 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
12766 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
12767 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
12768 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
12769 install_element (ENABLE_NODE
, &show_ip_community_list_cmd
);
12770 install_element (ENABLE_NODE
, &show_ip_community_list_arg_cmd
);
12772 /* Extcommunity-list. */
12773 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
12774 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
12775 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
12776 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
12777 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
12778 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
12779 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_all_cmd
);
12780 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_all_cmd
);
12781 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_all_cmd
);
12782 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_all_cmd
);
12783 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
12784 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
12785 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
12786 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
12787 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
12788 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);
12789 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_cmd
);
12790 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_arg_cmd
);