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
36 #include "bgpd/bgpd.h"
37 #include "bgpd/bgp_advertise.h"
38 #include "bgpd/bgp_attr.h"
39 #include "bgpd/bgp_aspath.h"
40 #include "bgpd/bgp_community.h"
41 #include "bgpd/bgp_ecommunity.h"
42 #include "bgpd/bgp_damp.h"
43 #include "bgpd/bgp_debug.h"
44 #include "bgpd/bgp_fsm.h"
45 #include "bgpd/bgp_mplsvpn.h"
46 #include "bgpd/bgp_nexthop.h"
47 #include "bgpd/bgp_open.h"
48 #include "bgpd/bgp_regex.h"
49 #include "bgpd/bgp_route.h"
50 #include "bgpd/bgp_zebra.h"
51 #include "bgpd/bgp_table.h"
52 #include "bgpd/bgp_vty.h"
53 #include "bgpd/bgp_mpath.h"
54 #include "bgpd/bgp_packet.h"
55 #include "bgpd/bgp_updgrp.h"
56 #include "bgpd/bgp_bfd.h"
58 static struct peer_group
*
59 listen_range_exists (struct bgp
*bgp
, struct prefix
*range
, int exact
);
61 /* Utility function to get address family from current node. */
63 bgp_node_afi (struct vty
*vty
)
65 if (vty
->node
== BGP_IPV6_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
70 /* Utility function to get subsequent address family from current
73 bgp_node_safi (struct vty
*vty
)
75 if (vty
->node
== BGP_VPNV4_NODE
)
77 if (vty
->node
== BGP_IPV4M_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
78 return SAFI_MULTICAST
;
83 peer_address_self_check (struct bgp
*bgp
, union sockunion
*su
)
85 struct interface
*ifp
= NULL
;
87 if (su
->sa
.sa_family
== AF_INET
)
88 ifp
= if_lookup_by_ipv4_exact (&su
->sin
.sin_addr
, bgp
->vrf_id
);
90 else if (su
->sa
.sa_family
== AF_INET6
)
91 ifp
= if_lookup_by_ipv6_exact (&su
->sin6
.sin6_addr
,
92 su
->sin6
.sin6_scope_id
, bgp
->vrf_id
);
93 #endif /* HAVE IPV6 */
101 /* Utility function for looking up peer from VTY. */
102 /* This is used only for configuration, so disallow if attempted on
103 * a dynamic neighbor.
106 peer_lookup_vty (struct vty
*vty
, const char *ip_str
)
115 ret
= str2sockunion (ip_str
, &su
);
118 peer
= peer_lookup_by_conf_if (bgp
, ip_str
);
121 if ((peer
= peer_lookup_by_hostname(bgp
, ip_str
)) == NULL
)
123 vty_out (vty
, "%% Malformed address or name: %s%s", ip_str
, VTY_NEWLINE
);
130 peer
= peer_lookup (bgp
, &su
);
133 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
137 if (peer_dynamic_neighbor (peer
))
139 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
148 /* Utility function for looking up peer or peer group. */
149 /* This is used only for configuration, so disallow if attempted on
150 * a dynamic neighbor.
153 peer_and_group_lookup_vty (struct vty
*vty
, const char *peer_str
)
158 struct peer
*peer
= NULL
;
159 struct peer_group
*group
= NULL
;
163 ret
= str2sockunion (peer_str
, &su
);
166 /* IP address, locate peer. */
167 peer
= peer_lookup (bgp
, &su
);
171 /* Not IP, could match either peer configured on interface or a group. */
172 peer
= peer_lookup_by_conf_if (bgp
, peer_str
);
174 group
= peer_group_lookup (bgp
, peer_str
);
179 if (peer_dynamic_neighbor (peer
))
181 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
192 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
199 bgp_vty_return (struct vty
*vty
, int ret
)
201 const char *str
= NULL
;
205 case BGP_ERR_INVALID_VALUE
:
206 str
= "Invalid value";
208 case BGP_ERR_INVALID_FLAG
:
209 str
= "Invalid flag";
211 case BGP_ERR_PEER_GROUP_SHUTDOWN
:
212 str
= "Peer-group has been shutdown. Activate the peer-group first";
214 case BGP_ERR_PEER_FLAG_CONFLICT
:
215 str
= "Can't set override-capability and strict-capability-match at the same time";
217 case BGP_ERR_PEER_GROUP_NO_REMOTE_AS
:
218 str
= "Specify remote-as or peer-group remote AS first";
220 case BGP_ERR_PEER_GROUP_CANT_CHANGE
:
221 str
= "Cannot change the peer-group. Deconfigure first";
223 case BGP_ERR_PEER_GROUP_MISMATCH
:
224 str
= "Peer is not a member of this peer-group";
226 case BGP_ERR_PEER_FILTER_CONFLICT
:
227 str
= "Prefix/distribute list can not co-exist";
229 case BGP_ERR_NOT_INTERNAL_PEER
:
230 str
= "Invalid command. Not an internal neighbor";
232 case BGP_ERR_REMOVE_PRIVATE_AS
:
233 str
= "remove-private-AS cannot be configured for IBGP peers";
235 case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP
:
236 str
= "Local-AS allowed only for EBGP peers";
238 case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS
:
239 str
= "Cannot have local-as same as BGP AS number";
241 case BGP_ERR_TCPSIG_FAILED
:
242 str
= "Error while applying TCP-Sig to session(s)";
244 case BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK
:
245 str
= "ebgp-multihop and ttl-security cannot be configured together";
247 case BGP_ERR_NO_IBGP_WITH_TTLHACK
:
248 str
= "ttl-security only allowed for EBGP peers";
250 case BGP_ERR_AS_OVERRIDE
:
251 str
= "as-override cannot be configured for IBGP peers";
253 case BGP_ERR_INVALID_DYNAMIC_NEIGHBORS_LIMIT
:
254 str
= "Invalid limit for number of dynamic neighbors";
256 case BGP_ERR_DYNAMIC_NEIGHBORS_RANGE_EXISTS
:
257 str
= "Dynamic neighbor listen range already exists";
259 case BGP_ERR_INVALID_FOR_DYNAMIC_PEER
:
260 str
= "Operation not allowed on a dynamic neighbor";
265 vty_out (vty
, "%% %s%s", str
, VTY_NEWLINE
);
271 /* BGP clear sort. */
282 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
283 safi_t safi
, int error
)
287 case BGP_ERR_AF_UNCONFIGURED
:
289 "%%BGP: Enable %s %s address family for the neighbor %s%s",
290 afi
== AFI_IP6
? "IPv6" : safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
291 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
292 peer
->host
, VTY_NEWLINE
);
294 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
295 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
);
302 /* `clear ip bgp' functions. */
304 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
305 enum clear_sort sort
,enum bgp_clear_type stype
, const char *arg
)
309 struct listnode
*node
, *nnode
;
311 /* Clear all neighbors. */
313 * Pass along pointer to next node to peer_clear() when walking all nodes
314 * on the BGP instance as that may get freed if it is a doppelganger
316 if (sort
== clear_all
)
318 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
320 if (stype
== BGP_CLEAR_SOFT_NONE
)
321 ret
= peer_clear (peer
, &nnode
);
322 else if (peer
->afc
[afi
][safi
])
323 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
328 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
331 /* This is to apply read-only mode on this clear. */
332 if (stype
== BGP_CLEAR_SOFT_NONE
)
333 bgp
->update_delay_over
= 0;
338 /* Clear specified neighbors. */
339 if (sort
== clear_peer
)
344 /* Make sockunion for lookup. */
345 ret
= str2sockunion (arg
, &su
);
348 peer
= peer_lookup_by_conf_if (bgp
, arg
);
351 peer
= peer_lookup_by_hostname(bgp
, arg
);
354 vty_out (vty
, "Malformed address or name: %s%s", arg
, VTY_NEWLINE
);
361 peer
= peer_lookup (bgp
, &su
);
364 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
369 if (stype
== BGP_CLEAR_SOFT_NONE
)
370 ret
= peer_clear (peer
, NULL
);
372 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
375 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
380 /* Clear all peer-group members. */
381 if (sort
== clear_group
)
383 struct peer_group
*group
;
385 group
= peer_group_lookup (bgp
, arg
);
388 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
392 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
394 if (stype
== BGP_CLEAR_SOFT_NONE
)
396 ret
= peer_clear (peer
, NULL
);
400 if (! peer
->afc
[afi
][safi
])
403 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
406 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
411 if (sort
== clear_external
)
413 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
415 if (peer
->sort
== BGP_PEER_IBGP
)
418 if (stype
== BGP_CLEAR_SOFT_NONE
)
419 ret
= peer_clear (peer
, &nnode
);
421 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
424 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
429 if (sort
== clear_as
)
434 VTY_GET_INTEGER_RANGE ("AS", as
, arg
, 1, BGP_AS4_MAX
);
436 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
442 if (stype
== BGP_CLEAR_SOFT_NONE
)
443 ret
= peer_clear (peer
, &nnode
);
445 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
448 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
451 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
460 bgp_clear_vty (struct vty
*vty
, const char *name
, afi_t afi
, safi_t safi
,
461 enum clear_sort sort
, enum bgp_clear_type stype
,
466 /* BGP structure lookup. */
469 bgp
= bgp_lookup_by_name (name
);
472 vty_out (vty
, "Can't find BGP instance %s%s", name
, VTY_NEWLINE
);
478 bgp
= bgp_get_default ();
481 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
486 return bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
489 /* clear soft inbound */
491 bgp_clear_star_soft_in (struct vty
*vty
)
493 bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
494 BGP_CLEAR_SOFT_IN
, NULL
);
496 bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
497 BGP_CLEAR_SOFT_IN
, NULL
);
498 #endif /* HAVE_IPV6 */
501 /* clear soft outbound */
503 bgp_clear_star_soft_out (struct vty
*vty
)
505 bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
506 BGP_CLEAR_SOFT_OUT
, NULL
);
508 bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
509 BGP_CLEAR_SOFT_OUT
, NULL
);
510 #endif /* HAVE_IPV6 */
514 /* BGP global configuration. */
516 DEFUN (bgp_multiple_instance_func
,
517 bgp_multiple_instance_cmd
,
518 "bgp multiple-instance",
520 "Enable bgp multiple instance\n")
522 bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE
);
526 DEFUN (no_bgp_multiple_instance
,
527 no_bgp_multiple_instance_cmd
,
528 "no bgp multiple-instance",
531 "BGP multiple instance\n")
535 ret
= bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE
);
538 vty_out (vty
, "%% There are more than two BGP instances%s", VTY_NEWLINE
);
544 DEFUN (bgp_config_type
,
546 "bgp config-type (cisco|zebra)",
548 "Configuration type\n"
552 if (strncmp (argv
[0], "c", 1) == 0)
553 bgp_option_set (BGP_OPT_CONFIG_CISCO
);
555 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
560 DEFUN (no_bgp_config_type
,
561 no_bgp_config_type_cmd
,
562 "no bgp config-type",
565 "Display configuration type\n")
567 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
571 ALIAS (no_bgp_config_type
,
572 no_bgp_config_type_val_cmd
,
573 "no bgp config-type (cisco|zebra)",
576 "Configuration type\n"
580 DEFUN (no_synchronization
,
581 no_synchronization_cmd
,
582 "no synchronization",
584 "Perform IGP synchronization\n")
589 DEFUN (no_auto_summary
,
593 "Enable automatic network number summarization\n")
598 /* "router bgp" commands. */
601 "router bgp " CMD_AS_RANGE
,
609 const char *name
= NULL
;
610 enum bgp_instance_type inst_type
;
612 // "router bgp" without an ASN
615 //Pending: Make VRF option available for ASN less config
616 bgp
= bgp_get_default();
620 vty_out (vty
, "%% No BGP process is configured%s", VTY_NEWLINE
);
624 if (listcount(bm
->bgp
) > 1)
626 vty_out (vty
, "%% Multiple BGP processes are configured%s", VTY_NEWLINE
);
634 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
636 inst_type
= BGP_INSTANCE_TYPE_DEFAULT
;
640 if (!strcmp(argv
[1], "vrf"))
641 inst_type
= BGP_INSTANCE_TYPE_VRF
;
642 else if (!strcmp(argv
[1], "view"))
643 inst_type
= BGP_INSTANCE_TYPE_VIEW
;
646 ret
= bgp_get (&bgp
, &as
, name
, inst_type
);
649 case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET
:
650 vty_out (vty
, "Please specify 'bgp multiple-instance' first%s",
653 case BGP_ERR_AS_MISMATCH
:
654 vty_out (vty
, "BGP is already running; AS is %u%s", as
, VTY_NEWLINE
);
656 case BGP_ERR_INSTANCE_MISMATCH
:
657 vty_out (vty
, "BGP instance name and AS number mismatch%s", VTY_NEWLINE
);
658 vty_out (vty
, "BGP instance is already running; AS is %u%s",
663 /* Pending: handle when user tries to change a view to vrf n vv. */
666 vty
->node
= BGP_NODE
;
673 router_bgp_instance_cmd
,
674 "router bgp " CMD_AS_RANGE
" (view|vrf) WORD",
678 "BGP view\nBGP VRF\n"
682 router_bgp_noasn_cmd
,
687 /* "no router bgp" commands. */
688 DEFUN (no_router_bgp
,
690 "no router bgp " CMD_AS_RANGE
,
698 const char *name
= NULL
;
700 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
705 /* Lookup bgp structure. */
706 bgp
= bgp_lookup (as
, name
);
709 vty_out (vty
, "%% Can't find BGP instance%s", VTY_NEWLINE
);
718 ALIAS (no_router_bgp
,
719 no_router_bgp_instance_cmd
,
720 "no router bgp " CMD_AS_RANGE
" (view|vrf) WORD",
725 "BGP view\nBGP VRF\n"
730 DEFUN (bgp_router_id
,
732 "bgp router-id A.B.C.D",
734 "Override configured router identifier\n"
735 "Manually configured router identifier\n")
743 ret
= inet_aton (argv
[0], &id
);
746 vty_out (vty
, "%% Malformed bgp router identifier%s", VTY_NEWLINE
);
750 if (IPV4_ADDR_SAME (&bgp
->router_id_static
, &id
))
753 bgp
->router_id_static
= id
;
754 bgp_router_id_set (bgp
, &id
);
759 DEFUN (no_bgp_router_id
,
760 no_bgp_router_id_cmd
,
764 "Override configured router identifier\n")
774 ret
= inet_aton (argv
[0], &id
);
777 vty_out (vty
, "%% Malformed BGP router identifier%s", VTY_NEWLINE
);
781 if (! IPV4_ADDR_SAME (&bgp
->router_id_static
, &id
))
783 vty_out (vty
, "%% BGP router-id doesn't match%s", VTY_NEWLINE
);
788 bgp
->router_id_static
.s_addr
= 0;
789 bgp_router_id_set (bgp
, &bgp
->router_id_zebra
);
794 ALIAS (no_bgp_router_id
,
795 no_bgp_router_id_val_cmd
,
796 "no bgp router-id A.B.C.D",
799 "Override configured router identifier\n"
800 "Manually configured router identifier\n")
802 /* BGP Cluster ID. */
804 DEFUN (bgp_cluster_id
,
806 "bgp cluster-id A.B.C.D",
808 "Configure Route-Reflector Cluster-id\n"
809 "Route-Reflector Cluster-id in IP address format\n")
813 struct in_addr cluster
;
817 ret
= inet_aton (argv
[0], &cluster
);
820 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
824 bgp_cluster_id_set (bgp
, &cluster
);
825 bgp_clear_star_soft_out (vty
);
830 ALIAS (bgp_cluster_id
,
831 bgp_cluster_id32_cmd
,
832 "bgp cluster-id <1-4294967295>",
834 "Configure Route-Reflector Cluster-id\n"
835 "Route-Reflector Cluster-id as 32 bit quantity\n")
837 DEFUN (no_bgp_cluster_id
,
838 no_bgp_cluster_id_cmd
,
842 "Configure Route-Reflector Cluster-id\n")
846 struct in_addr cluster
;
852 ret
= inet_aton (argv
[0], &cluster
);
855 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
860 bgp_cluster_id_unset (bgp
);
861 bgp_clear_star_soft_out (vty
);
866 ALIAS (no_bgp_cluster_id
,
867 no_bgp_cluster_id_ip_cmd
,
868 "no bgp cluster-id A.B.C.D",
871 "Configure Route-Reflector Cluster-id\n"
872 "Route-Reflector Cluster-id in IP address format\n")
874 ALIAS (no_bgp_cluster_id
,
875 no_bgp_cluster_id_decimal_cmd
,
876 "no bgp cluster-id <1-4294967295>",
879 "Configure Route-Reflector Cluster-id\n"
880 "Route-Reflector Cluster-id as 32 bit quantity\n")
882 DEFUN (bgp_confederation_identifier
,
883 bgp_confederation_identifier_cmd
,
884 "bgp confederation identifier " CMD_AS_RANGE
,
885 "BGP specific commands\n"
886 "AS confederation parameters\n"
888 "Set routing domain confederation AS\n")
895 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
897 bgp_confederation_id_set (bgp
, as
);
902 DEFUN (no_bgp_confederation_identifier
,
903 no_bgp_confederation_identifier_cmd
,
904 "no bgp confederation identifier",
906 "BGP specific commands\n"
907 "AS confederation parameters\n"
914 bgp_confederation_id_unset (bgp
);
919 ALIAS (no_bgp_confederation_identifier
,
920 no_bgp_confederation_identifier_arg_cmd
,
921 "no bgp confederation identifier " CMD_AS_RANGE
,
923 "BGP specific commands\n"
924 "AS confederation parameters\n"
926 "Set routing domain confederation AS\n")
928 DEFUN (bgp_confederation_peers
,
929 bgp_confederation_peers_cmd
,
930 "bgp confederation peers ." CMD_AS_RANGE
,
931 "BGP specific commands\n"
932 "AS confederation parameters\n"
933 "Peer ASs in BGP confederation\n"
942 for (i
= 0; i
< argc
; i
++)
944 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
948 vty_out (vty
, "%% Local member-AS not allowed in confed peer list%s",
953 bgp_confederation_peers_add (bgp
, as
);
958 DEFUN (no_bgp_confederation_peers
,
959 no_bgp_confederation_peers_cmd
,
960 "no bgp confederation peers ." CMD_AS_RANGE
,
962 "BGP specific commands\n"
963 "AS confederation parameters\n"
964 "Peer ASs in BGP confederation\n"
973 for (i
= 0; i
< argc
; i
++)
975 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
977 bgp_confederation_peers_remove (bgp
, as
);
983 * Central routine for maximum-paths configuration.
984 * @peer_type: BGP_PEER_EBGP or BGP_PEER_IBGP
985 * @set: 1 for setting values, 0 for removing the max-paths config.
988 bgp_maxpaths_config_vty (struct vty
*vty
, int peer_type
, const char *mpaths
,
989 u_int16_t options
, int set
)
992 u_int16_t maxpaths
= 0;
998 afi
= bgp_node_afi (vty
);
999 safi
= bgp_node_safi (vty
);
1003 VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths
, mpaths
, 1,
1005 ret
= bgp_maximum_paths_set (bgp
, afi
, safi
, peer_type
, maxpaths
,
1009 ret
= bgp_maximum_paths_unset (bgp
, afi
, safi
, peer_type
);
1014 "%% Failed to %sset maximum-paths %s %u for afi %u, safi %u%s",
1015 (set
== 1) ? "" : "un",
1016 (peer_type
== BGP_PEER_EBGP
) ? "ebgp" : "ibgp",
1017 maxpaths
, afi
, safi
, VTY_NEWLINE
);
1021 bgp_recalculate_all_bestpaths (bgp
);
1026 DEFUN (bgp_maxmed_admin
,
1027 bgp_maxmed_admin_cmd
,
1028 "bgp max-med administrative ",
1030 "Advertise routes with max-med\n"
1031 "Administratively applied, for an indefinite period\n")
1037 bgp
->v_maxmed_admin
= 1;
1038 bgp
->maxmed_admin_value
= BGP_MAXMED_VALUE_DEFAULT
;
1040 bgp_maxmed_update(bgp
);
1045 DEFUN (bgp_maxmed_admin_medv
,
1046 bgp_maxmed_admin_medv_cmd
,
1047 "bgp max-med administrative <0-4294967294>",
1049 "Advertise routes with max-med\n"
1050 "Administratively applied, for an indefinite period\n"
1051 "Max MED value to be used\n")
1057 bgp
->v_maxmed_admin
= 1;
1058 VTY_GET_INTEGER ("max-med admin med-value", bgp
->maxmed_admin_value
, argv
[0]);
1060 bgp_maxmed_update(bgp
);
1065 DEFUN (no_bgp_maxmed_admin
,
1066 no_bgp_maxmed_admin_cmd
,
1067 "no bgp max-med administrative",
1070 "Advertise routes with max-med\n"
1071 "Administratively applied, for an indefinite period\n")
1077 bgp
->v_maxmed_admin
= BGP_MAXMED_ADMIN_UNCONFIGURED
;
1078 bgp
->maxmed_admin_value
= BGP_MAXMED_VALUE_DEFAULT
;
1080 bgp_maxmed_update(bgp
);
1085 ALIAS (no_bgp_maxmed_admin
,
1086 no_bgp_maxmed_admin_medv_cmd
,
1087 "no bgp max-med administrative <0-4294967294>",
1090 "Advertise routes with max-med\n"
1091 "Administratively applied, for an indefinite period\n"
1092 "Max MED value to be used\n")
1095 DEFUN (bgp_maxmed_onstartup
,
1096 bgp_maxmed_onstartup_cmd
,
1097 "bgp max-med on-startup <5-86400>",
1099 "Advertise routes with max-med\n"
1100 "Effective on a startup\n"
1101 "Time (seconds) period for max-med\n")
1109 vty_out (vty
, "%% Must supply max-med on-startup period");
1113 VTY_GET_INTEGER ("max-med on-startup period", bgp
->v_maxmed_onstartup
, argv
[0]);
1114 bgp
->maxmed_onstartup_value
= BGP_MAXMED_VALUE_DEFAULT
;
1116 bgp_maxmed_update(bgp
);
1121 DEFUN (bgp_maxmed_onstartup_medv
,
1122 bgp_maxmed_onstartup_medv_cmd
,
1123 "bgp max-med on-startup <5-86400> <0-4294967294>",
1125 "Advertise routes with max-med\n"
1126 "Effective on a startup\n"
1127 "Time (seconds) period for max-med\n"
1128 "Max MED value to be used\n")
1136 vty_out (vty
, "%% Must supply max-med on-startup period and med value");
1140 VTY_GET_INTEGER ("max-med on-startup period", bgp
->v_maxmed_onstartup
, argv
[0]);
1141 VTY_GET_INTEGER ("max-med on-startup med-value", bgp
->maxmed_onstartup_value
, argv
[1]);
1143 bgp_maxmed_update(bgp
);
1148 DEFUN (no_bgp_maxmed_onstartup
,
1149 no_bgp_maxmed_onstartup_cmd
,
1150 "no bgp max-med on-startup",
1153 "Advertise routes with max-med\n"
1154 "Effective on a startup\n")
1160 /* Cancel max-med onstartup if its on */
1161 if (bgp
->t_maxmed_onstartup
)
1163 THREAD_TIMER_OFF (bgp
->t_maxmed_onstartup
);
1164 bgp
->maxmed_onstartup_over
= 1;
1167 bgp
->v_maxmed_onstartup
= BGP_MAXMED_ONSTARTUP_UNCONFIGURED
;
1168 bgp
->maxmed_onstartup_value
= BGP_MAXMED_VALUE_DEFAULT
;
1170 bgp_maxmed_update(bgp
);
1175 ALIAS (no_bgp_maxmed_onstartup
,
1176 no_bgp_maxmed_onstartup_period_cmd
,
1177 "no bgp max-med on-startup <5-86400>",
1180 "Advertise routes with max-med\n"
1181 "Effective on a startup\n"
1182 "Time (seconds) period for max-med\n")
1184 ALIAS (no_bgp_maxmed_onstartup
,
1185 no_bgp_maxmed_onstartup_period_medv_cmd
,
1186 "no bgp max-med on-startup <5-86400> <0-4294967294>",
1189 "Advertise routes with max-med\n"
1190 "Effective on a startup\n"
1191 "Time (seconds) period for max-med\n"
1192 "Max MED value to be used\n")
1195 bgp_update_delay_config_vty (struct vty
*vty
, const char *delay
,
1199 u_int16_t update_delay
;
1200 u_int16_t establish_wait
;
1205 VTY_GET_INTEGER_RANGE ("update-delay", update_delay
, delay
,
1206 BGP_UPDATE_DELAY_MIN
, BGP_UPDATE_DELAY_MAX
);
1208 if (!wait
) /* update-delay <delay> */
1210 bgp
->v_update_delay
= update_delay
;
1211 bgp
->v_establish_wait
= bgp
->v_update_delay
;
1215 /* update-delay <delay> <establish-wait> */
1216 establish_wait
= atoi (wait
);
1217 if (update_delay
< establish_wait
)
1219 vty_out (vty
, "%%Failed: update-delay less than the establish-wait!%s",
1224 bgp
->v_update_delay
= update_delay
;
1225 bgp
->v_establish_wait
= establish_wait
;
1231 bgp_update_delay_deconfig_vty (struct vty
*vty
)
1237 bgp
->v_update_delay
= BGP_UPDATE_DELAY_DEF
;
1238 bgp
->v_establish_wait
= bgp
->v_update_delay
;
1244 bgp_config_write_update_delay (struct vty
*vty
, struct bgp
*bgp
)
1246 if (bgp
->v_update_delay
!= BGP_UPDATE_DELAY_DEF
)
1248 vty_out (vty
, " update-delay %d", bgp
->v_update_delay
);
1249 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
1250 vty_out (vty
, " %d", bgp
->v_establish_wait
);
1251 vty_out (vty
, "%s", VTY_NEWLINE
);
1258 /* Update-delay configuration */
1259 DEFUN (bgp_update_delay
,
1260 bgp_update_delay_cmd
,
1261 "update-delay <0-3600>",
1262 "Force initial delay for best-path and updates\n"
1265 return bgp_update_delay_config_vty(vty
, argv
[0], NULL
);
1268 DEFUN (bgp_update_delay_establish_wait
,
1269 bgp_update_delay_establish_wait_cmd
,
1270 "update-delay <0-3600> <1-3600>",
1271 "Force initial delay for best-path and updates\n"
1273 "Wait for peers to be established\n"
1276 return bgp_update_delay_config_vty(vty
, argv
[0], argv
[1]);
1279 /* Update-delay deconfiguration */
1280 DEFUN (no_bgp_update_delay
,
1281 no_bgp_update_delay_cmd
,
1282 "no update-delay <0-3600>",
1283 "Force initial delay for best-path and updates\n"
1286 return bgp_update_delay_deconfig_vty(vty
);
1289 ALIAS (no_bgp_update_delay
,
1290 no_bgp_update_delay_establish_wait_cmd
,
1291 "no update-delay <0-3600> <1-3600>",
1292 "Force initial delay for best-path and updates\n"
1294 "Wait for peers to be established\n"
1298 bgp_wpkt_quanta_config_vty (struct vty
*vty
, const char *num
, char set
)
1305 VTY_GET_INTEGER_RANGE ("write-quanta", bgp
->wpkt_quanta
, num
,
1308 bgp
->wpkt_quanta
= BGP_WRITE_PACKET_MAX
;
1314 bgp_config_write_wpkt_quanta (struct vty
*vty
, struct bgp
*bgp
)
1316 if (bgp
->wpkt_quanta
!= BGP_WRITE_PACKET_MAX
)
1317 vty_out (vty
, " write-quanta %d%s",
1318 bgp
->wpkt_quanta
, VTY_NEWLINE
);
1324 /* Update-delay configuration */
1325 DEFUN (bgp_wpkt_quanta
,
1326 bgp_wpkt_quanta_cmd
,
1327 "write-quanta <1-10000>",
1328 "How many packets to write to peer socket per run\n"
1329 "Number of packets\n")
1331 return bgp_wpkt_quanta_config_vty(vty
, argv
[0], 1);
1334 /* Update-delay deconfiguration */
1335 DEFUN (no_bgp_wpkt_quanta
,
1336 no_bgp_wpkt_quanta_cmd
,
1337 "no write-quanta <1-10000>",
1338 "How many packets to write to peer socket per run\n"
1339 "Number of packets\n")
1341 return bgp_wpkt_quanta_config_vty(vty
, argv
[0], 0);
1345 bgp_coalesce_config_vty (struct vty
*vty
, const char *num
, char set
)
1352 VTY_GET_INTEGER_RANGE ("coalesce-time", bgp
->coalesce_time
, num
,
1355 bgp
->coalesce_time
= BGP_DEFAULT_SUBGROUP_COALESCE_TIME
;
1361 bgp_config_write_coalesce_time (struct vty
*vty
, struct bgp
*bgp
)
1363 if (bgp
->coalesce_time
!= BGP_DEFAULT_SUBGROUP_COALESCE_TIME
)
1364 vty_out (vty
, " coalesce-time %d%s",
1365 bgp
->coalesce_time
, VTY_NEWLINE
);
1371 DEFUN (bgp_coalesce_time
,
1372 bgp_coalesce_time_cmd
,
1373 "coalesce-time <0-4294967295>",
1374 "Subgroup coalesce timer\n"
1375 "Subgroup coalesce timer value (in ms)\n")
1377 return bgp_coalesce_config_vty(vty
, argv
[0], 1);
1380 DEFUN (no_bgp_coalesce_time
,
1381 no_bgp_coalesce_time_cmd
,
1382 "no coalesce-time <0-4294967295>",
1383 "Subgroup coalesce timer\n"
1384 "Subgroup coalesce timer value (in ms)\n")
1386 return bgp_coalesce_config_vty(vty
, argv
[0], 0);
1389 /* Maximum-paths configuration */
1390 DEFUN (bgp_maxpaths
,
1392 "maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM
),
1393 "Forward packets over multiple paths\n"
1394 "Number of paths\n")
1396 return bgp_maxpaths_config_vty(vty
, BGP_PEER_EBGP
, argv
[0], 0, 1);
1399 DEFUN (bgp_maxpaths_ibgp
,
1400 bgp_maxpaths_ibgp_cmd
,
1401 "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM
),
1402 "Forward packets over multiple paths\n"
1404 "Number of paths\n")
1406 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, argv
[0], 0, 1);
1409 DEFUN (bgp_maxpaths_ibgp_cluster
,
1410 bgp_maxpaths_ibgp_cluster_cmd
,
1411 "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM
) " equal-cluster-length",
1412 "Forward packets over multiple paths\n"
1415 "Match the cluster length\n")
1417 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, argv
[0],
1418 BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN
, 1);
1421 DEFUN (no_bgp_maxpaths
,
1422 no_bgp_maxpaths_cmd
,
1425 "Forward packets over multiple paths\n"
1426 "Number of paths\n")
1428 return bgp_maxpaths_config_vty(vty
, BGP_PEER_EBGP
, NULL
, 0, 0);
1431 ALIAS (no_bgp_maxpaths
,
1432 no_bgp_maxpaths_arg_cmd
,
1433 "no maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM
),
1435 "Forward packets over multiple paths\n"
1436 "Number of paths\n")
1438 DEFUN (no_bgp_maxpaths_ibgp
,
1439 no_bgp_maxpaths_ibgp_cmd
,
1440 "no maximum-paths ibgp",
1442 "Forward packets over multiple paths\n"
1444 "Number of paths\n")
1446 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, NULL
, 0, 0);
1449 ALIAS (no_bgp_maxpaths_ibgp
,
1450 no_bgp_maxpaths_ibgp_arg_cmd
,
1451 "no maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM
),
1453 "Forward packets over multiple paths\n"
1455 "Number of paths\n")
1457 ALIAS (no_bgp_maxpaths_ibgp
,
1458 no_bgp_maxpaths_ibgp_cluster_cmd
,
1459 "no maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM
) " equal-cluster-length",
1461 "Forward packets over multiple paths\n"
1464 "Match the cluster length\n")
1467 bgp_config_write_maxpaths (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
1468 safi_t safi
, int *write
)
1470 if (bgp
->maxpaths
[afi
][safi
].maxpaths_ebgp
!= MULTIPATH_NUM
)
1472 bgp_config_write_family_header (vty
, afi
, safi
, write
);
1473 vty_out (vty
, " maximum-paths %d%s",
1474 bgp
->maxpaths
[afi
][safi
].maxpaths_ebgp
, VTY_NEWLINE
);
1477 if (bgp
->maxpaths
[afi
][safi
].maxpaths_ibgp
!= MULTIPATH_NUM
)
1479 bgp_config_write_family_header (vty
, afi
, safi
, write
);
1480 vty_out (vty
, " maximum-paths ibgp %d",
1481 bgp
->maxpaths
[afi
][safi
].maxpaths_ibgp
);
1482 if (CHECK_FLAG (bgp
->maxpaths
[afi
][safi
].ibgp_flags
,
1483 BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN
))
1484 vty_out (vty
, " equal-cluster-length");
1485 vty_out (vty
, "%s", VTY_NEWLINE
);
1495 "timers bgp <0-65535> <0-65535>",
1496 "Adjust routing timers\n"
1498 "Keepalive interval\n"
1502 unsigned long keepalive
= 0;
1503 unsigned long holdtime
= 0;
1507 VTY_GET_INTEGER ("keepalive", keepalive
, argv
[0]);
1508 VTY_GET_INTEGER ("holdtime", holdtime
, argv
[1]);
1510 /* Holdtime value check. */
1511 if (holdtime
< 3 && holdtime
!= 0)
1513 vty_out (vty
, "%% hold time value must be either 0 or greater than 3%s",
1518 bgp_timers_set (bgp
, keepalive
, holdtime
);
1523 DEFUN (no_bgp_timers
,
1527 "Adjust routing timers\n"
1533 bgp_timers_unset (bgp
);
1538 ALIAS (no_bgp_timers
,
1539 no_bgp_timers_arg_cmd
,
1540 "no timers bgp <0-65535> <0-65535>",
1542 "Adjust routing timers\n"
1544 "Keepalive interval\n"
1547 DEFUN (bgp_client_to_client_reflection
,
1548 bgp_client_to_client_reflection_cmd
,
1549 "bgp client-to-client reflection",
1550 "BGP specific commands\n"
1551 "Configure client to client route reflection\n"
1552 "reflection of routes allowed\n")
1557 bgp_flag_unset (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
1558 bgp_clear_star_soft_out (vty
);
1563 DEFUN (no_bgp_client_to_client_reflection
,
1564 no_bgp_client_to_client_reflection_cmd
,
1565 "no bgp client-to-client reflection",
1567 "BGP specific commands\n"
1568 "Configure client to client route reflection\n"
1569 "reflection of routes allowed\n")
1574 bgp_flag_set (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
1575 bgp_clear_star_soft_out (vty
);
1580 /* "bgp always-compare-med" configuration. */
1581 DEFUN (bgp_always_compare_med
,
1582 bgp_always_compare_med_cmd
,
1583 "bgp always-compare-med",
1584 "BGP specific commands\n"
1585 "Allow comparing MED from different neighbors\n")
1590 bgp_flag_set (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
1591 bgp_recalculate_all_bestpaths (bgp
);
1596 DEFUN (no_bgp_always_compare_med
,
1597 no_bgp_always_compare_med_cmd
,
1598 "no bgp always-compare-med",
1600 "BGP specific commands\n"
1601 "Allow comparing MED from different neighbors\n")
1606 bgp_flag_unset (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
1607 bgp_recalculate_all_bestpaths (bgp
);
1612 /* "bgp deterministic-med" configuration. */
1613 DEFUN (bgp_deterministic_med
,
1614 bgp_deterministic_med_cmd
,
1615 "bgp deterministic-med",
1616 "BGP specific commands\n"
1617 "Pick the best-MED path among paths advertised from the neighboring AS\n")
1623 if (!bgp_flag_check(bgp
, BGP_FLAG_DETERMINISTIC_MED
))
1625 bgp_flag_set (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
1626 bgp_recalculate_all_bestpaths (bgp
);
1632 DEFUN (no_bgp_deterministic_med
,
1633 no_bgp_deterministic_med_cmd
,
1634 "no bgp deterministic-med",
1636 "BGP specific commands\n"
1637 "Pick the best-MED path among paths advertised from the neighboring AS\n")
1640 int bestpath_per_as_used
;
1644 struct listnode
*node
, *nnode
;
1648 if (bgp_flag_check(bgp
, BGP_FLAG_DETERMINISTIC_MED
))
1650 bestpath_per_as_used
= 0;
1652 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
1654 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
1655 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
1656 if (CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS
))
1658 bestpath_per_as_used
= 1;
1662 if (bestpath_per_as_used
)
1666 if (bestpath_per_as_used
)
1668 vty_out (vty
, "bgp deterministic-med cannot be disabled while addpath-tx-bestpath-per-AS is in use%s",
1674 bgp_flag_unset (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
1675 bgp_recalculate_all_bestpaths (bgp
);
1682 /* "bgp graceful-restart" configuration. */
1683 DEFUN (bgp_graceful_restart
,
1684 bgp_graceful_restart_cmd
,
1685 "bgp graceful-restart",
1686 "BGP specific commands\n"
1687 "Graceful restart capability parameters\n")
1692 bgp_flag_set (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
1696 DEFUN (no_bgp_graceful_restart
,
1697 no_bgp_graceful_restart_cmd
,
1698 "no bgp graceful-restart",
1700 "BGP specific commands\n"
1701 "Graceful restart capability parameters\n")
1706 bgp_flag_unset (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
1710 DEFUN (bgp_graceful_restart_stalepath_time
,
1711 bgp_graceful_restart_stalepath_time_cmd
,
1712 "bgp graceful-restart stalepath-time <1-3600>",
1713 "BGP specific commands\n"
1714 "Graceful restart capability parameters\n"
1715 "Set the max time to hold onto restarting peer's stale paths\n"
1716 "Delay value (seconds)\n")
1719 u_int32_t stalepath
;
1725 VTY_GET_INTEGER_RANGE ("stalepath-time", stalepath
, argv
[0], 1, 3600);
1726 bgp
->stalepath_time
= stalepath
;
1730 DEFUN (no_bgp_graceful_restart_stalepath_time
,
1731 no_bgp_graceful_restart_stalepath_time_cmd
,
1732 "no bgp graceful-restart stalepath-time",
1734 "BGP specific commands\n"
1735 "Graceful restart capability parameters\n"
1736 "Set the max time to hold onto restarting peer's stale paths\n")
1744 bgp
->stalepath_time
= BGP_DEFAULT_STALEPATH_TIME
;
1748 ALIAS (no_bgp_graceful_restart_stalepath_time
,
1749 no_bgp_graceful_restart_stalepath_time_val_cmd
,
1750 "no bgp graceful-restart stalepath-time <1-3600>",
1752 "BGP specific commands\n"
1753 "Graceful restart capability parameters\n"
1754 "Set the max time to hold onto restarting peer's stale paths\n"
1755 "Delay value (seconds)\n")
1757 /* "bgp fast-external-failover" configuration. */
1758 DEFUN (bgp_fast_external_failover
,
1759 bgp_fast_external_failover_cmd
,
1760 "bgp fast-external-failover",
1762 "Immediately reset session if a link to a directly connected external peer goes down\n")
1767 bgp_flag_unset (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
1771 DEFUN (no_bgp_fast_external_failover
,
1772 no_bgp_fast_external_failover_cmd
,
1773 "no bgp fast-external-failover",
1776 "Immediately reset session if a link to a directly connected external peer goes down\n")
1781 bgp_flag_set (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
1785 /* "bgp enforce-first-as" configuration. */
1786 DEFUN (bgp_enforce_first_as
,
1787 bgp_enforce_first_as_cmd
,
1788 "bgp enforce-first-as",
1790 "Enforce the first AS for EBGP routes\n")
1795 bgp_flag_set (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
1796 bgp_clear_star_soft_in (vty
);
1801 DEFUN (no_bgp_enforce_first_as
,
1802 no_bgp_enforce_first_as_cmd
,
1803 "no bgp enforce-first-as",
1806 "Enforce the first AS for EBGP routes\n")
1811 bgp_flag_unset (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
1812 bgp_clear_star_soft_in (vty
);
1817 /* "bgp bestpath compare-routerid" configuration. */
1818 DEFUN (bgp_bestpath_compare_router_id
,
1819 bgp_bestpath_compare_router_id_cmd
,
1820 "bgp bestpath compare-routerid",
1821 "BGP specific commands\n"
1822 "Change the default bestpath selection\n"
1823 "Compare router-id for identical EBGP paths\n")
1828 bgp_flag_set (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
1829 bgp_recalculate_all_bestpaths (bgp
);
1834 DEFUN (no_bgp_bestpath_compare_router_id
,
1835 no_bgp_bestpath_compare_router_id_cmd
,
1836 "no bgp bestpath compare-routerid",
1838 "BGP specific commands\n"
1839 "Change the default bestpath selection\n"
1840 "Compare router-id for identical EBGP paths\n")
1845 bgp_flag_unset (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
1846 bgp_recalculate_all_bestpaths (bgp
);
1851 /* "bgp bestpath as-path ignore" configuration. */
1852 DEFUN (bgp_bestpath_aspath_ignore
,
1853 bgp_bestpath_aspath_ignore_cmd
,
1854 "bgp bestpath as-path ignore",
1855 "BGP specific commands\n"
1856 "Change the default bestpath selection\n"
1857 "AS-path attribute\n"
1858 "Ignore as-path length in selecting a route\n")
1863 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_IGNORE
);
1864 bgp_recalculate_all_bestpaths (bgp
);
1869 DEFUN (no_bgp_bestpath_aspath_ignore
,
1870 no_bgp_bestpath_aspath_ignore_cmd
,
1871 "no bgp bestpath as-path ignore",
1873 "BGP specific commands\n"
1874 "Change the default bestpath selection\n"
1875 "AS-path attribute\n"
1876 "Ignore as-path length in selecting a route\n")
1881 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_IGNORE
);
1882 bgp_recalculate_all_bestpaths (bgp
);
1887 /* "bgp bestpath as-path confed" configuration. */
1888 DEFUN (bgp_bestpath_aspath_confed
,
1889 bgp_bestpath_aspath_confed_cmd
,
1890 "bgp bestpath as-path confed",
1891 "BGP specific commands\n"
1892 "Change the default bestpath selection\n"
1893 "AS-path attribute\n"
1894 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1899 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_CONFED
);
1900 bgp_recalculate_all_bestpaths (bgp
);
1905 DEFUN (no_bgp_bestpath_aspath_confed
,
1906 no_bgp_bestpath_aspath_confed_cmd
,
1907 "no bgp bestpath as-path confed",
1909 "BGP specific commands\n"
1910 "Change the default bestpath selection\n"
1911 "AS-path attribute\n"
1912 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1917 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_CONFED
);
1918 bgp_recalculate_all_bestpaths (bgp
);
1923 /* "bgp bestpath as-path multipath-relax" configuration. */
1924 DEFUN (bgp_bestpath_aspath_multipath_relax
,
1925 bgp_bestpath_aspath_multipath_relax_cmd
,
1926 "bgp bestpath as-path multipath-relax {as-set|no-as-set}",
1927 "BGP specific commands\n"
1928 "Change the default bestpath selection\n"
1929 "AS-path attribute\n"
1930 "Allow load sharing across routes that have different AS paths (but same length)\n"
1931 "Generate an AS_SET\n"
1932 "Do not generate an AS_SET\n")
1937 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
1939 /* no-as-set is now the default behavior so we can silently
1941 if (argv
[0] != NULL
&& strncmp (argv
[0], "a", 1) == 0)
1942 bgp_flag_set (bgp
, BGP_FLAG_MULTIPATH_RELAX_AS_SET
);
1944 bgp_flag_unset (bgp
, BGP_FLAG_MULTIPATH_RELAX_AS_SET
) ;
1946 bgp_recalculate_all_bestpaths (bgp
);
1951 DEFUN (no_bgp_bestpath_aspath_multipath_relax
,
1952 no_bgp_bestpath_aspath_multipath_relax_cmd
,
1953 "no bgp bestpath as-path multipath-relax {as-set|no-as-set}",
1955 "BGP specific commands\n"
1956 "Change the default bestpath selection\n"
1957 "AS-path attribute\n"
1958 "Allow load sharing across routes that have different AS paths (but same length)\n"
1959 "Generate an AS_SET\n"
1960 "Do not generate an AS_SET\n")
1965 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
1966 bgp_flag_unset (bgp
, BGP_FLAG_MULTIPATH_RELAX_AS_SET
);
1967 bgp_recalculate_all_bestpaths (bgp
);
1972 /* "bgp log-neighbor-changes" configuration. */
1973 DEFUN (bgp_log_neighbor_changes
,
1974 bgp_log_neighbor_changes_cmd
,
1975 "bgp log-neighbor-changes",
1976 "BGP specific commands\n"
1977 "Log neighbor up/down and reset reason\n")
1982 bgp_flag_set (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
1986 DEFUN (no_bgp_log_neighbor_changes
,
1987 no_bgp_log_neighbor_changes_cmd
,
1988 "no bgp log-neighbor-changes",
1990 "BGP specific commands\n"
1991 "Log neighbor up/down and reset reason\n")
1996 bgp_flag_unset (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
2000 /* "bgp bestpath med" configuration. */
2001 DEFUN (bgp_bestpath_med
,
2002 bgp_bestpath_med_cmd
,
2003 "bgp bestpath med (confed|missing-as-worst)",
2004 "BGP specific commands\n"
2005 "Change the default bestpath selection\n"
2007 "Compare MED among confederation paths\n"
2008 "Treat missing MED as the least preferred one\n")
2014 if (strncmp (argv
[0], "confed", 1) == 0)
2015 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
2017 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2019 bgp_recalculate_all_bestpaths (bgp
);
2024 DEFUN (bgp_bestpath_med2
,
2025 bgp_bestpath_med2_cmd
,
2026 "bgp bestpath med confed missing-as-worst",
2027 "BGP specific commands\n"
2028 "Change the default bestpath selection\n"
2030 "Compare MED among confederation paths\n"
2031 "Treat missing MED as the least preferred one\n")
2036 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
2037 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2038 bgp_recalculate_all_bestpaths (bgp
);
2043 ALIAS (bgp_bestpath_med2
,
2044 bgp_bestpath_med3_cmd
,
2045 "bgp bestpath med missing-as-worst confed",
2046 "BGP specific commands\n"
2047 "Change the default bestpath selection\n"
2049 "Treat missing MED as the least preferred one\n"
2050 "Compare MED among confederation paths\n")
2052 DEFUN (no_bgp_bestpath_med
,
2053 no_bgp_bestpath_med_cmd
,
2054 "no bgp bestpath med (confed|missing-as-worst)",
2056 "BGP specific commands\n"
2057 "Change the default bestpath selection\n"
2059 "Compare MED among confederation paths\n"
2060 "Treat missing MED as the least preferred one\n")
2066 if (strncmp (argv
[0], "confed", 1) == 0)
2067 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
2069 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2071 bgp_recalculate_all_bestpaths (bgp
);
2076 DEFUN (no_bgp_bestpath_med2
,
2077 no_bgp_bestpath_med2_cmd
,
2078 "no bgp bestpath med confed missing-as-worst",
2080 "BGP specific commands\n"
2081 "Change the default bestpath selection\n"
2083 "Compare MED among confederation paths\n"
2084 "Treat missing MED as the least preferred one\n")
2089 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
2090 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2091 bgp_recalculate_all_bestpaths (bgp
);
2096 ALIAS (no_bgp_bestpath_med2
,
2097 no_bgp_bestpath_med3_cmd
,
2098 "no bgp bestpath med missing-as-worst confed",
2100 "BGP specific commands\n"
2101 "Change the default bestpath selection\n"
2103 "Treat missing MED as the least preferred one\n"
2104 "Compare MED among confederation paths\n")
2106 /* "no bgp default ipv4-unicast". */
2107 DEFUN (no_bgp_default_ipv4_unicast
,
2108 no_bgp_default_ipv4_unicast_cmd
,
2109 "no bgp default ipv4-unicast",
2111 "BGP specific commands\n"
2112 "Configure BGP defaults\n"
2113 "Activate ipv4-unicast for a peer by default\n")
2118 bgp_flag_set (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
2122 DEFUN (bgp_default_ipv4_unicast
,
2123 bgp_default_ipv4_unicast_cmd
,
2124 "bgp default ipv4-unicast",
2125 "BGP specific commands\n"
2126 "Configure BGP defaults\n"
2127 "Activate ipv4-unicast for a peer by default\n")
2132 bgp_flag_unset (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
2136 /* Display hostname in certain command outputs */
2137 DEFUN (bgp_default_show_hostname
,
2138 bgp_default_show_hostname_cmd
,
2139 "bgp default show-hostname",
2140 "BGP specific commands\n"
2141 "Configure BGP defaults\n"
2142 "Show hostname in certain command ouputs\n")
2147 bgp_flag_set (bgp
, BGP_FLAG_SHOW_HOSTNAME
);
2151 DEFUN (no_bgp_default_show_hostname
,
2152 no_bgp_default_show_hostname_cmd
,
2153 "no bgp default show-hostname",
2155 "BGP specific commands\n"
2156 "Configure BGP defaults\n"
2157 "Show hostname in certain command ouputs\n")
2162 bgp_flag_unset (bgp
, BGP_FLAG_SHOW_HOSTNAME
);
2166 /* "bgp import-check" configuration. */
2167 DEFUN (bgp_network_import_check
,
2168 bgp_network_import_check_cmd
,
2169 "bgp network import-check",
2170 "BGP specific commands\n"
2171 "BGP network command\n"
2172 "Check BGP network route exists in IGP\n")
2177 if (!bgp_flag_check(bgp
, BGP_FLAG_IMPORT_CHECK
))
2179 bgp_flag_set (bgp
, BGP_FLAG_IMPORT_CHECK
);
2180 bgp_static_redo_import_check(bgp
);
2186 DEFUN (no_bgp_network_import_check
,
2187 no_bgp_network_import_check_cmd
,
2188 "no bgp network import-check",
2190 "BGP specific commands\n"
2191 "BGP network command\n"
2192 "Check BGP network route exists in IGP\n")
2197 if (bgp_flag_check(bgp
, BGP_FLAG_IMPORT_CHECK
))
2199 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK
);
2200 bgp_static_redo_import_check(bgp
);
2206 DEFUN (bgp_default_local_preference
,
2207 bgp_default_local_preference_cmd
,
2208 "bgp default local-preference <0-4294967295>",
2209 "BGP specific commands\n"
2210 "Configure BGP defaults\n"
2211 "local preference (higher=more preferred)\n"
2212 "Configure default local preference value\n")
2215 u_int32_t local_pref
;
2219 VTY_GET_INTEGER ("local preference", local_pref
, argv
[0]);
2221 bgp_default_local_preference_set (bgp
, local_pref
);
2222 bgp_clear_star_soft_in (vty
);
2227 DEFUN (no_bgp_default_local_preference
,
2228 no_bgp_default_local_preference_cmd
,
2229 "no bgp default local-preference",
2231 "BGP specific commands\n"
2232 "Configure BGP defaults\n"
2233 "local preference (higher=more preferred)\n")
2238 bgp_default_local_preference_unset (bgp
);
2239 bgp_clear_star_soft_in (vty
);
2244 ALIAS (no_bgp_default_local_preference
,
2245 no_bgp_default_local_preference_val_cmd
,
2246 "no bgp default local-preference <0-4294967295>",
2248 "BGP specific commands\n"
2249 "Configure BGP defaults\n"
2250 "local preference (higher=more preferred)\n"
2251 "Configure default local preference value\n")
2253 DEFUN (bgp_default_subgroup_pkt_queue_max
,
2254 bgp_default_subgroup_pkt_queue_max_cmd
,
2255 "bgp default subgroup-pkt-queue-max <20-100>",
2256 "BGP specific commands\n"
2257 "Configure BGP defaults\n"
2258 "subgroup-pkt-queue-max\n"
2259 "Configure subgroup packet queue max\n")
2266 VTY_GET_INTEGER ("subgroup packet queue max", max_size
, argv
[0]);
2268 bgp_default_subgroup_pkt_queue_max_set (bgp
, max_size
);
2273 DEFUN (no_bgp_default_subgroup_pkt_queue_max
,
2274 no_bgp_default_subgroup_pkt_queue_max_cmd
,
2275 "no bgp default subgroup-pkt-queue-max",
2277 "BGP specific commands\n"
2278 "Configure BGP defaults\n"
2279 "subgroup-pkt-queue-max\n")
2284 bgp_default_subgroup_pkt_queue_max_unset (bgp
);
2288 ALIAS (no_bgp_default_subgroup_pkt_queue_max
,
2289 no_bgp_default_subgroup_pkt_queue_max_val_cmd
,
2290 "no bgp default subgroup-pkt-queue-max <20-100>",
2292 "BGP specific commands\n"
2293 "Configure BGP defaults\n"
2294 "subgroup-pkt-queue-max\n"
2295 "Configure subgroup packet queue max\n")
2297 DEFUN (bgp_rr_allow_outbound_policy
,
2298 bgp_rr_allow_outbound_policy_cmd
,
2299 "bgp route-reflector allow-outbound-policy",
2300 "BGP specific commands\n"
2301 "Allow modifications made by out route-map\n"
2302 "on ibgp neighbors\n")
2308 if (!bgp_flag_check(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
))
2310 bgp_flag_set(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
);
2311 update_group_announce_rrclients(bgp
);
2312 bgp_clear_star_soft_out (vty
);
2318 DEFUN (no_bgp_rr_allow_outbound_policy
,
2319 no_bgp_rr_allow_outbound_policy_cmd
,
2320 "no bgp route-reflector allow-outbound-policy",
2322 "BGP specific commands\n"
2323 "Allow modifications made by out route-map\n"
2324 "on ibgp neighbors\n")
2330 if (bgp_flag_check(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
))
2332 bgp_flag_unset(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
);
2333 update_group_announce_rrclients(bgp
);
2334 bgp_clear_star_soft_out (vty
);
2340 DEFUN (bgp_listen_limit
,
2341 bgp_listen_limit_cmd
,
2342 "bgp listen limit " DYNAMIC_NEIGHBOR_LIMIT_RANGE
,
2343 "BGP specific commands\n"
2344 "Configure BGP defaults\n"
2345 "maximum number of BGP Dynamic Neighbors that can be created\n"
2346 "Configure Dynamic Neighbors listen limit value\n")
2353 VTY_GET_INTEGER_RANGE ("listen limit", listen_limit
, argv
[0],
2354 BGP_DYNAMIC_NEIGHBORS_LIMIT_MIN
,
2355 BGP_DYNAMIC_NEIGHBORS_LIMIT_MAX
);
2357 bgp_listen_limit_set (bgp
, listen_limit
);
2362 DEFUN (no_bgp_listen_limit
,
2363 no_bgp_listen_limit_cmd
,
2364 "no bgp listen limit",
2365 "BGP specific commands\n"
2366 "Configure BGP defaults\n"
2367 "unset maximum number of BGP Dynamic Neighbors that can be created\n"
2368 "Configure Dynamic Neighbors listen limit value to default\n")
2373 bgp_listen_limit_unset (bgp
);
2377 ALIAS (no_bgp_listen_limit
,
2378 no_bgp_listen_limit_val_cmd
,
2379 "no bgp listen limit " DYNAMIC_NEIGHBOR_LIMIT_RANGE
,
2381 "BGP specific commands\n"
2382 "Configure BGP defaults\n"
2383 "maximum number of BGP Dynamic Neighbors that can be created\n"
2384 "Configure Dynamic Neighbors listen limit value\n")
2387 * Check if this listen range is already configured. Check for exact
2388 * match or overlap based on input.
2390 static struct peer_group
*
2391 listen_range_exists (struct bgp
*bgp
, struct prefix
*range
, int exact
)
2393 struct listnode
*node
, *nnode
;
2394 struct listnode
*node1
, *nnode1
;
2395 struct peer_group
*group
;
2400 afi
= family2afi(range
->family
);
2401 for (ALL_LIST_ELEMENTS (bgp
->group
, node
, nnode
, group
))
2403 for (ALL_LIST_ELEMENTS (group
->listen_range
[afi
], node1
,
2407 match
= prefix_same (range
, lr
);
2409 match
= (prefix_match (range
, lr
) || prefix_match (lr
, range
));
2418 DEFUN (bgp_listen_range
,
2419 bgp_listen_range_cmd
,
2420 LISTEN_RANGE_CMD
"peer-group WORD" ,
2421 "BGP specific commands\n"
2422 "Configure BGP Dynamic Neighbors\n"
2423 "add a listening range for Dynamic Neighbors\n"
2424 LISTEN_RANGE_ADDR_STR
)
2427 struct prefix range
;
2428 struct peer_group
*group
, *existing_group
;
2434 //VTY_GET_IPV4_PREFIX ("listen range", range, argv[0]);
2436 /* Convert IP prefix string to struct prefix. */
2437 ret
= str2prefix (argv
[0], &range
);
2440 vty_out (vty
, "%% Malformed listen range%s", VTY_NEWLINE
);
2444 afi
= family2afi(range
.family
);
2447 if (afi
== AFI_IP6
&& IN6_IS_ADDR_LINKLOCAL (&range
.u
.prefix6
))
2449 vty_out (vty
, "%% Malformed listen range (link-local address)%s",
2453 #endif /* HAVE_IPV6 */
2455 apply_mask (&range
);
2457 /* Check if same listen range is already configured. */
2458 existing_group
= listen_range_exists (bgp
, &range
, 1);
2461 if (strcmp (existing_group
->name
, argv
[1]) == 0)
2465 vty_out (vty
, "%% Same listen range is attached to peer-group %s%s",
2466 existing_group
->name
, VTY_NEWLINE
);
2471 /* Check if an overlapping listen range exists. */
2472 if (listen_range_exists (bgp
, &range
, 0))
2474 vty_out (vty
, "%% Listen range overlaps with existing listen range%s",
2479 group
= peer_group_lookup (bgp
, argv
[1]);
2482 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
2486 ret
= peer_group_listen_range_add(group
, &range
);
2487 return bgp_vty_return (vty
, ret
);
2490 DEFUN (no_bgp_listen_range
,
2491 no_bgp_listen_range_cmd
,
2492 "no bgp listen range A.B.C.D/M peer-group WORD" ,
2493 "BGP specific commands\n"
2494 "Configure BGP defaults\n"
2495 "delete a listening range for Dynamic Neighbors\n"
2496 "Remove Dynamic Neighbors listening range\n")
2499 struct prefix range
;
2500 struct peer_group
*group
;
2506 // VTY_GET_IPV4_PREFIX ("listen range", range, argv[0]);
2508 /* Convert IP prefix string to struct prefix. */
2509 ret
= str2prefix (argv
[0], &range
);
2512 vty_out (vty
, "%% Malformed listen range%s", VTY_NEWLINE
);
2516 afi
= family2afi(range
.family
);
2519 if (afi
== AFI_IP6
&& IN6_IS_ADDR_LINKLOCAL (&range
.u
.prefix6
))
2521 vty_out (vty
, "%% Malformed listen range (link-local address)%s",
2525 #endif /* HAVE_IPV6 */
2527 apply_mask (&range
);
2530 group
= peer_group_lookup (bgp
, argv
[1]);
2533 vty_out (vty
, "%% Peer-group does not exist%s", VTY_NEWLINE
);
2537 ret
= peer_group_listen_range_del(group
, &range
);
2538 return bgp_vty_return (vty
, ret
);
2542 bgp_config_write_listen (struct vty
*vty
, struct bgp
*bgp
)
2544 struct peer_group
*group
;
2545 struct listnode
*node
, *nnode
, *rnode
, *nrnode
;
2546 struct prefix
*range
;
2548 char buf
[PREFIX2STR_BUFFER
];
2550 if (bgp
->dynamic_neighbors_limit
!= BGP_DYNAMIC_NEIGHBORS_LIMIT_DEFAULT
)
2551 vty_out (vty
, " bgp listen limit %d%s",
2552 bgp
->dynamic_neighbors_limit
, VTY_NEWLINE
);
2554 for (ALL_LIST_ELEMENTS (bgp
->group
, node
, nnode
, group
))
2556 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
2558 for (ALL_LIST_ELEMENTS (group
->listen_range
[afi
], rnode
, nrnode
, range
))
2560 prefix2str(range
, buf
, sizeof(buf
));
2561 vty_out(vty
, " bgp listen range %s peer-group %s%s",
2562 buf
, group
->name
, VTY_NEWLINE
);
2571 DEFUN (bgp_disable_connected_route_check
,
2572 bgp_disable_connected_route_check_cmd
,
2573 "bgp disable-ebgp-connected-route-check",
2574 "BGP specific commands\n"
2575 "Disable checking if nexthop is connected on ebgp sessions\n")
2580 bgp_flag_set (bgp
, BGP_FLAG_DISABLE_NH_CONNECTED_CHK
);
2581 bgp_clear_star_soft_in (vty
);
2586 DEFUN (no_bgp_disable_connected_route_check
,
2587 no_bgp_disable_connected_route_check_cmd
,
2588 "no bgp disable-ebgp-connected-route-check",
2590 "BGP specific commands\n"
2591 "Disable checking if nexthop is connected on ebgp sessions\n")
2596 bgp_flag_unset (bgp
, BGP_FLAG_DISABLE_NH_CONNECTED_CHK
);
2597 bgp_clear_star_soft_in (vty
);
2604 peer_remote_as_vty (struct vty
*vty
, const char *peer_str
,
2605 const char *as_str
, afi_t afi
, safi_t safi
)
2610 int as_type
= AS_SPECIFIED
;
2615 if (strncmp(as_str
, "internal", strlen("internal")) == 0)
2618 as_type
= AS_INTERNAL
;
2620 else if (strncmp(as_str
, "external", strlen("external")) == 0)
2623 as_type
= AS_EXTERNAL
;
2627 /* Get AS number. */
2628 VTY_GET_INTEGER_RANGE ("AS", as
, as_str
, 1, BGP_AS4_MAX
);
2631 /* If peer is peer group, call proper function. */
2632 ret
= str2sockunion (peer_str
, &su
);
2635 /* Check for peer by interface */
2636 ret
= peer_remote_as (bgp
, NULL
, peer_str
, &as
, as_type
, afi
, safi
);
2639 ret
= peer_group_remote_as (bgp
, peer_str
, &as
, as_type
);
2642 vty_out (vty
, "%% Create the peer-group or interface first%s",
2651 if (peer_address_self_check (bgp
, &su
))
2653 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
2657 ret
= peer_remote_as (bgp
, &su
, NULL
, &as
, as_type
, afi
, safi
);
2660 /* This peer belongs to peer group. */
2663 case BGP_ERR_PEER_GROUP_MEMBER
:
2664 vty_out (vty
, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as
, VTY_NEWLINE
);
2666 case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
:
2667 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
);
2670 return bgp_vty_return (vty
, ret
);
2673 DEFUN (neighbor_remote_as
,
2674 neighbor_remote_as_cmd
,
2675 NEIGHBOR_CMD2
"remote-as (" CMD_AS_RANGE
"|external|internal)",
2678 "Specify a BGP neighbor\n"
2681 return peer_remote_as_vty (vty
, argv
[0], argv
[1], AFI_IP
, SAFI_UNICAST
);
2685 peer_conf_interface_get (struct vty
*vty
, const char *conf_if
, afi_t afi
,
2686 safi_t safi
, int v6only
, const char *peer_group_name
)
2691 struct peer_group
*group
;
2696 group
= peer_group_lookup (bgp
, conf_if
);
2700 vty_out (vty
, "%% Name conflict with peer-group %s", VTY_NEWLINE
);
2704 peer
= peer_lookup_by_conf_if (bgp
, conf_if
);
2707 if (bgp_flag_check (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
)
2708 && afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
2709 peer
= peer_create (NULL
, conf_if
, bgp
, bgp
->as
, 0, AS_UNSPECIFIED
, 0, 0, NULL
);
2711 peer
= peer_create (NULL
, conf_if
, bgp
, bgp
->as
, 0, AS_UNSPECIFIED
, afi
, safi
, NULL
);
2714 SET_FLAG(peer
->flags
, PEER_FLAG_IFPEER_V6ONLY
);
2716 else if ((v6only
&& !CHECK_FLAG(peer
->flags
, PEER_FLAG_IFPEER_V6ONLY
)) ||
2717 (!v6only
&& CHECK_FLAG(peer
->flags
, PEER_FLAG_IFPEER_V6ONLY
)))
2720 SET_FLAG(peer
->flags
, PEER_FLAG_IFPEER_V6ONLY
);
2722 UNSET_FLAG(peer
->flags
, PEER_FLAG_IFPEER_V6ONLY
);
2724 /* v6only flag changed. Reset bgp seesion */
2725 if (BGP_IS_VALID_STATE_FOR_NOTIF(peer
->status
))
2727 peer
->last_reset
= PEER_DOWN_V6ONLY_CHANGE
;
2728 bgp_notify_send (peer
, BGP_NOTIFY_CEASE
,
2729 BGP_NOTIFY_CEASE_CONFIG_CHANGE
);
2732 bgp_session_reset(peer
);
2738 if (peer_group_name
)
2740 group
= peer_group_lookup (bgp
, peer_group_name
);
2743 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
2747 ret
= peer_group_bind (bgp
, &su
, peer
, group
, &as
);
2750 return bgp_vty_return (vty
, ret
);
2753 DEFUN (neighbor_interface_config
,
2754 neighbor_interface_config_cmd
,
2755 "neighbor WORD interface",
2757 "Interface name or neighbor tag\n"
2758 "Enable BGP on interface\n")
2761 return peer_conf_interface_get (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, 0, argv
[1]);
2763 return peer_conf_interface_get (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, 0, NULL
);
2766 ALIAS (neighbor_interface_config
,
2767 neighbor_interface_config_peergroup_cmd
,
2768 "neighbor WORD interface peer-group WORD",
2770 "Interface name or neighbor tag\n"
2771 "Enable BGP on interface\n"
2772 "Member of the peer-group\n"
2773 "peer-group name\n")
2775 DEFUN (neighbor_interface_config_v6only
,
2776 neighbor_interface_config_v6only_cmd
,
2777 "neighbor WORD interface v6only",
2779 "Interface name or neighbor tag\n"
2780 "Enable BGP on interface\n"
2781 "Enable BGP with v6 link-local only\n")
2784 return peer_conf_interface_get (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, 1, argv
[1]);
2786 return peer_conf_interface_get (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, 1, NULL
);
2789 ALIAS (neighbor_interface_config_v6only
,
2790 neighbor_interface_config_v6only_peergroup_cmd
,
2791 "neighbor WORD interface v6only peer-group WORD",
2793 "Interface name or neighbor tag\n"
2794 "Enable BGP on interface\n"
2795 "Enable BGP with v6 link-local only\n"
2796 "Member of the peer-group\n"
2797 "peer-group name\n")
2799 DEFUN (neighbor_peer_group
,
2800 neighbor_peer_group_cmd
,
2801 "neighbor WORD peer-group",
2803 "Interface name or neighbor tag\n"
2804 "Configure peer-group\n")
2808 struct peer_group
*group
;
2811 peer
= peer_lookup_by_conf_if (bgp
, argv
[0]);
2814 vty_out (vty
, "%% Name conflict with interface: %s", VTY_NEWLINE
);
2818 group
= peer_group_get (bgp
, argv
[0]);
2834 struct peer_group
*group
;
2838 ret
= str2sockunion (argv
[0], &su
);
2841 /* look up for neighbor by interface name config. */
2842 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
2849 group
= peer_group_lookup (vty
->index
, argv
[0]);
2851 peer_group_delete (group
);
2854 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
2860 peer
= peer_lookup (vty
->index
, &su
);
2863 if (peer_dynamic_neighbor (peer
))
2865 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
2870 other
= peer
->doppelganger
;
2872 if (other
&& other
->status
!= Deleted
)
2881 no_neighbor_remote_as_cmd
,
2882 NO_NEIGHBOR_CMD
"remote-as (" CMD_AS_RANGE
"|internal|external)",
2886 "Specify a BGP neighbor\n"
2889 DEFUN (no_neighbor_interface_config
,
2890 no_neighbor_interface_config_cmd
,
2891 "no neighbor WORD interface",
2895 "Configure BGP on interface\n")
2899 /* look up for neighbor by interface name config. */
2900 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
2907 vty_out (vty
, "%% Create the bgp interface first%s", VTY_NEWLINE
);
2913 ALIAS (no_neighbor_interface_config
,
2914 no_neighbor_interface_config_peergroup_cmd
,
2915 "no neighbor WORD interface peer-group WORD",
2919 "Configure BGP on interface\n"
2920 "Member of the peer-group\n"
2921 "peer-group name\n")
2923 ALIAS (no_neighbor_interface_config
,
2924 no_neighbor_interface_config_v6only_cmd
,
2925 "no neighbor WORD interface v6only",
2929 "Configure BGP on interface\n"
2930 "Enable BGP with v6 link-local only\n")
2932 ALIAS (no_neighbor_interface_config
,
2933 no_neighbor_interface_config_v6only_peergroup_cmd
,
2934 "no neighbor WORD interface v6only peer-group WORD",
2938 "Configure BGP on interface\n"
2939 "Enable BGP with v6 link-local only\n"
2940 "Member of the peer-group\n"
2941 "peer-group name\n")
2944 DEFUN (no_neighbor_peer_group
,
2945 no_neighbor_peer_group_cmd
,
2946 "no neighbor WORD peer-group",
2950 "Configure peer-group\n")
2952 struct peer_group
*group
;
2954 group
= peer_group_lookup (vty
->index
, argv
[0]);
2956 peer_group_delete (group
);
2959 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
2965 DEFUN (no_neighbor_interface_peer_group_remote_as
,
2966 no_neighbor_interface_peer_group_remote_as_cmd
,
2967 "no neighbor WORD remote-as (" CMD_AS_RANGE
"|internal|external)",
2970 "Interface name or neighbor tag\n"
2971 "Specify a BGP neighbor\n"
2974 struct peer_group
*group
;
2977 /* look up for neighbor by interface name config. */
2978 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
2981 peer_as_change (peer
, 0, AS_SPECIFIED
);
2985 group
= peer_group_lookup (vty
->index
, argv
[0]);
2987 peer_group_remote_as_delete (group
);
2990 vty_out (vty
, "%% Create the peer-group or interface first%s", VTY_NEWLINE
);
2996 DEFUN (neighbor_local_as
,
2997 neighbor_local_as_cmd
,
2998 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
3001 "Specify a local-as number\n"
3002 "AS number used as local AS\n")
3007 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3011 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 0, 0);
3012 return bgp_vty_return (vty
, ret
);
3015 DEFUN (neighbor_local_as_no_prepend
,
3016 neighbor_local_as_no_prepend_cmd
,
3017 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
3020 "Specify a local-as number\n"
3021 "AS number used as local AS\n"
3022 "Do not prepend local-as to updates from ebgp peers\n")
3027 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3031 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1, 0);
3032 return bgp_vty_return (vty
, ret
);
3035 DEFUN (neighbor_local_as_no_prepend_replace_as
,
3036 neighbor_local_as_no_prepend_replace_as_cmd
,
3037 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend replace-as",
3040 "Specify a local-as number\n"
3041 "AS number used as local AS\n"
3042 "Do not prepend local-as to updates from ebgp peers\n"
3043 "Do not prepend local-as to updates from ibgp peers\n")
3048 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3052 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1, 1);
3053 return bgp_vty_return (vty
, ret
);
3057 DEFUN (no_neighbor_local_as
,
3058 no_neighbor_local_as_cmd
,
3059 NO_NEIGHBOR_CMD2
"local-as",
3063 "Specify a local-as number\n")
3068 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3072 ret
= peer_local_as_unset (peer
);
3073 return bgp_vty_return (vty
, ret
);
3076 ALIAS (no_neighbor_local_as
,
3077 no_neighbor_local_as_val_cmd
,
3078 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
3082 "Specify a local-as number\n"
3083 "AS number used as local AS\n")
3085 ALIAS (no_neighbor_local_as
,
3086 no_neighbor_local_as_val2_cmd
,
3087 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
3091 "Specify a local-as number\n"
3092 "AS number used as local AS\n"
3093 "Do not prepend local-as to updates from ebgp peers\n")
3095 ALIAS (no_neighbor_local_as
,
3096 no_neighbor_local_as_val3_cmd
,
3097 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend replace-as",
3101 "Specify a local-as number\n"
3102 "AS number used as local AS\n"
3103 "Do not prepend local-as to updates from ebgp peers\n"
3104 "Do not prepend local-as to updates from ibgp peers\n")
3106 DEFUN (neighbor_solo
,
3108 NEIGHBOR_CMD2
"solo",
3111 "Solo peer - part of its own update group\n")
3116 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3120 ret
= update_group_adjust_soloness(peer
, 1);
3121 return bgp_vty_return (vty
, ret
);
3124 DEFUN (no_neighbor_solo
,
3125 no_neighbor_solo_cmd
,
3126 NO_NEIGHBOR_CMD2
"solo",
3130 "Solo peer - part of its own update group\n")
3135 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3139 ret
= update_group_adjust_soloness(peer
, 0);
3140 return bgp_vty_return (vty
, ret
);
3143 DEFUN (neighbor_password
,
3144 neighbor_password_cmd
,
3145 NEIGHBOR_CMD2
"password LINE",
3154 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3158 ret
= peer_password_set (peer
, argv
[1]);
3159 return bgp_vty_return (vty
, ret
);
3162 DEFUN (no_neighbor_password
,
3163 no_neighbor_password_cmd
,
3164 NO_NEIGHBOR_CMD2
"password",
3173 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3177 ret
= peer_password_unset (peer
);
3178 return bgp_vty_return (vty
, ret
);
3181 ALIAS (no_neighbor_password
,
3182 no_neighbor_password_val_cmd
,
3183 NO_NEIGHBOR_CMD2
"password LINE",
3190 DEFUN (neighbor_activate
,
3191 neighbor_activate_cmd
,
3192 NEIGHBOR_CMD2
"activate",
3195 "Enable the Address Family for this Neighbor\n")
3200 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3204 ret
= peer_activate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3211 DEFUN (no_neighbor_activate
,
3212 no_neighbor_activate_cmd
,
3213 NO_NEIGHBOR_CMD2
"activate",
3217 "Enable the Address Family for this Neighbor\n")
3223 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3227 ret
= peer_deactivate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3234 DEFUN (neighbor_set_peer_group
,
3235 neighbor_set_peer_group_cmd
,
3236 NEIGHBOR_CMD2
"peer-group WORD",
3239 "Member of the peer-group\n"
3240 "peer-group name\n")
3247 struct peer_group
*group
;
3252 ret
= str2sockunion (argv
[0], &su
);
3255 peer
= peer_lookup_by_conf_if (bgp
, argv
[0]);
3258 vty_out (vty
, "%% Malformed address or name: %s%s", argv
[0], VTY_NEWLINE
);
3264 if (peer_address_self_check (bgp
, &su
))
3266 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
3271 /* Disallow for dynamic neighbor. */
3272 peer
= peer_lookup (bgp
, &su
);
3273 if (peer
&& peer_dynamic_neighbor (peer
))
3275 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
3281 group
= peer_group_lookup (bgp
, argv
[1]);
3284 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
3288 ret
= peer_group_bind (bgp
, &su
, peer
, group
, &as
);
3290 if (ret
== BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
)
3292 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
);
3296 return bgp_vty_return (vty
, ret
);
3299 DEFUN (no_neighbor_set_peer_group
,
3300 no_neighbor_set_peer_group_cmd
,
3301 NO_NEIGHBOR_CMD2
"peer-group WORD",
3305 "Member of the peer-group\n"
3306 "peer-group name\n")
3311 struct peer_group
*group
;
3315 peer
= peer_lookup_vty (vty
, argv
[0]);
3319 group
= peer_group_lookup (bgp
, argv
[1]);
3322 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
3326 ret
= peer_group_unbind (bgp
, peer
, group
);
3328 return bgp_vty_return (vty
, ret
);
3332 peer_flag_modify_vty (struct vty
*vty
, const char *ip_str
,
3333 u_int16_t flag
, int set
)
3338 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3343 ret
= peer_flag_set (peer
, flag
);
3345 ret
= peer_flag_unset (peer
, flag
);
3347 return bgp_vty_return (vty
, ret
);
3351 peer_flag_set_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
3353 return peer_flag_modify_vty (vty
, ip_str
, flag
, 1);
3357 peer_flag_unset_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
3359 return peer_flag_modify_vty (vty
, ip_str
, flag
, 0);
3362 /* neighbor passive. */
3363 DEFUN (neighbor_passive
,
3364 neighbor_passive_cmd
,
3365 NEIGHBOR_CMD2
"passive",
3368 "Don't send open messages to this neighbor\n")
3370 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
3373 DEFUN (no_neighbor_passive
,
3374 no_neighbor_passive_cmd
,
3375 NO_NEIGHBOR_CMD2
"passive",
3379 "Don't send open messages to this neighbor\n")
3381 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
3384 /* neighbor shutdown. */
3385 DEFUN (neighbor_shutdown
,
3386 neighbor_shutdown_cmd
,
3387 NEIGHBOR_CMD2
"shutdown",
3390 "Administratively shut down this neighbor\n")
3392 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
3395 DEFUN (no_neighbor_shutdown
,
3396 no_neighbor_shutdown_cmd
,
3397 NO_NEIGHBOR_CMD2
"shutdown",
3401 "Administratively shut down this neighbor\n")
3403 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
3406 /* neighbor capability dynamic. */
3407 DEFUN (neighbor_capability_dynamic
,
3408 neighbor_capability_dynamic_cmd
,
3409 NEIGHBOR_CMD2
"capability dynamic",
3412 "Advertise capability to the peer\n"
3413 "Advertise dynamic capability to this neighbor\n")
3415 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
3418 DEFUN (no_neighbor_capability_dynamic
,
3419 no_neighbor_capability_dynamic_cmd
,
3420 NO_NEIGHBOR_CMD2
"capability dynamic",
3424 "Advertise capability to the peer\n"
3425 "Advertise dynamic capability to this neighbor\n")
3427 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
3430 /* neighbor dont-capability-negotiate */
3431 DEFUN (neighbor_dont_capability_negotiate
,
3432 neighbor_dont_capability_negotiate_cmd
,
3433 NEIGHBOR_CMD2
"dont-capability-negotiate",
3436 "Do not perform capability negotiation\n")
3438 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
3441 DEFUN (no_neighbor_dont_capability_negotiate
,
3442 no_neighbor_dont_capability_negotiate_cmd
,
3443 NO_NEIGHBOR_CMD2
"dont-capability-negotiate",
3447 "Do not perform capability negotiation\n")
3449 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
3452 /* neighbor capability extended next hop encoding */
3453 DEFUN (neighbor_capability_enhe
,
3454 neighbor_capability_enhe_cmd
,
3455 NEIGHBOR_CMD2
"capability extended-nexthop",
3458 "Advertise capability to the peer\n"
3459 "Advertise extended next-hop capability to the peer\n")
3461 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_CAPABILITY_ENHE
);
3464 DEFUN (no_neighbor_capability_enhe
,
3465 no_neighbor_capability_enhe_cmd
,
3466 NO_NEIGHBOR_CMD2
"capability extended-nexthop",
3470 "Advertise capability to the peer\n"
3471 "Advertise extended next-hop capability to the peer\n")
3473 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_CAPABILITY_ENHE
);
3477 peer_af_flag_modify_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
3478 safi_t safi
, u_int32_t flag
, int set
)
3483 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3488 ret
= peer_af_flag_set (peer
, afi
, safi
, flag
);
3490 ret
= peer_af_flag_unset (peer
, afi
, safi
, flag
);
3492 return bgp_vty_return (vty
, ret
);
3496 peer_af_flag_set_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
3497 safi_t safi
, u_int32_t flag
)
3499 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 1);
3503 peer_af_flag_unset_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
3504 safi_t safi
, u_int32_t flag
)
3506 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 0);
3509 /* neighbor capability orf prefix-list. */
3510 DEFUN (neighbor_capability_orf_prefix
,
3511 neighbor_capability_orf_prefix_cmd
,
3512 NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
3515 "Advertise capability to the peer\n"
3516 "Advertise ORF capability to the peer\n"
3517 "Advertise prefixlist ORF capability to this neighbor\n"
3518 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
3519 "Capability to RECEIVE the ORF from this neighbor\n"
3520 "Capability to SEND the ORF to this neighbor\n")
3524 if (strncmp (argv
[1], "s", 1) == 0)
3525 flag
= PEER_FLAG_ORF_PREFIX_SM
;
3526 else if (strncmp (argv
[1], "r", 1) == 0)
3527 flag
= PEER_FLAG_ORF_PREFIX_RM
;
3528 else if (strncmp (argv
[1], "b", 1) == 0)
3529 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
3533 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3534 bgp_node_safi (vty
), flag
);
3537 DEFUN (no_neighbor_capability_orf_prefix
,
3538 no_neighbor_capability_orf_prefix_cmd
,
3539 NO_NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
3543 "Advertise capability to the peer\n"
3544 "Advertise ORF capability to the peer\n"
3545 "Advertise prefixlist ORF capability to this neighbor\n"
3546 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
3547 "Capability to RECEIVE the ORF from this neighbor\n"
3548 "Capability to SEND the ORF to this neighbor\n")
3552 if (strncmp (argv
[1], "s", 1) == 0)
3553 flag
= PEER_FLAG_ORF_PREFIX_SM
;
3554 else if (strncmp (argv
[1], "r", 1) == 0)
3555 flag
= PEER_FLAG_ORF_PREFIX_RM
;
3556 else if (strncmp (argv
[1], "b", 1) == 0)
3557 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
3561 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3562 bgp_node_safi (vty
), flag
);
3565 /* neighbor next-hop-self. */
3566 DEFUN (neighbor_nexthop_self
,
3567 neighbor_nexthop_self_cmd
,
3568 NEIGHBOR_CMD2
"next-hop-self",
3571 "Disable the next hop calculation for this neighbor\n")
3573 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3574 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
3577 /* neighbor next-hop-self. */
3578 DEFUN (neighbor_nexthop_self_force
,
3579 neighbor_nexthop_self_force_cmd
,
3580 NEIGHBOR_CMD2
"next-hop-self force",
3583 "Disable the next hop calculation for this neighbor\n"
3584 "Set the next hop to self for reflected routes\n")
3586 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3587 bgp_node_safi (vty
),
3588 PEER_FLAG_FORCE_NEXTHOP_SELF
);
3591 DEFUN (no_neighbor_nexthop_self
,
3592 no_neighbor_nexthop_self_cmd
,
3593 NO_NEIGHBOR_CMD2
"next-hop-self",
3597 "Disable the next hop calculation for this neighbor\n")
3599 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3600 bgp_node_safi (vty
),
3601 PEER_FLAG_NEXTHOP_SELF
);
3604 DEFUN (no_neighbor_nexthop_self_force
,
3605 no_neighbor_nexthop_self_force_cmd
,
3606 NO_NEIGHBOR_CMD2
"next-hop-self force",
3610 "Disable the next hop calculation for this neighbor\n"
3611 "Set the next hop to self for reflected routes\n")
3613 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3614 bgp_node_safi (vty
),
3615 PEER_FLAG_FORCE_NEXTHOP_SELF
);
3618 /* neighbor as-override */
3619 DEFUN (neighbor_as_override
,
3620 neighbor_as_override_cmd
,
3621 NEIGHBOR_CMD2
"as-override",
3624 "Override ASNs in outbound updates if aspath equals remote-as\n")
3626 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3627 bgp_node_safi (vty
),
3628 PEER_FLAG_AS_OVERRIDE
);
3631 DEFUN (no_neighbor_as_override
,
3632 no_neighbor_as_override_cmd
,
3633 NO_NEIGHBOR_CMD2
"as-override",
3637 "Override ASNs in outbound updates if aspath equals remote-as\n")
3639 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3640 bgp_node_safi (vty
),
3641 PEER_FLAG_AS_OVERRIDE
);
3644 /* neighbor remove-private-AS. */
3645 DEFUN (neighbor_remove_private_as
,
3646 neighbor_remove_private_as_cmd
,
3647 NEIGHBOR_CMD2
"remove-private-AS",
3650 "Remove private ASNs in outbound updates\n")
3652 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3653 bgp_node_safi (vty
),
3654 PEER_FLAG_REMOVE_PRIVATE_AS
);
3657 DEFUN (neighbor_remove_private_as_all
,
3658 neighbor_remove_private_as_all_cmd
,
3659 NEIGHBOR_CMD2
"remove-private-AS all",
3662 "Remove private ASNs in outbound updates\n"
3663 "Apply to all AS numbers")
3665 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3666 bgp_node_safi (vty
),
3667 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
);
3670 DEFUN (neighbor_remove_private_as_replace_as
,
3671 neighbor_remove_private_as_replace_as_cmd
,
3672 NEIGHBOR_CMD2
"remove-private-AS replace-AS",
3675 "Remove private ASNs in outbound updates\n"
3676 "Replace private ASNs with our ASN in outbound updates\n")
3678 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3679 bgp_node_safi (vty
),
3680 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
3683 DEFUN (neighbor_remove_private_as_all_replace_as
,
3684 neighbor_remove_private_as_all_replace_as_cmd
,
3685 NEIGHBOR_CMD2
"remove-private-AS all replace-AS",
3688 "Remove private ASNs in outbound updates\n"
3689 "Apply to all AS numbers"
3690 "Replace private ASNs with our ASN in outbound updates\n")
3692 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3693 bgp_node_safi (vty
),
3694 PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE
);
3697 DEFUN (no_neighbor_remove_private_as
,
3698 no_neighbor_remove_private_as_cmd
,
3699 NO_NEIGHBOR_CMD2
"remove-private-AS",
3703 "Remove private ASNs in outbound updates\n")
3705 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3706 bgp_node_safi (vty
),
3707 PEER_FLAG_REMOVE_PRIVATE_AS
);
3710 DEFUN (no_neighbor_remove_private_as_all
,
3711 no_neighbor_remove_private_as_all_cmd
,
3712 NO_NEIGHBOR_CMD2
"remove-private-AS all",
3716 "Remove private ASNs in outbound updates\n"
3717 "Apply to all AS numbers")
3719 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3720 bgp_node_safi (vty
),
3721 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
);
3724 DEFUN (no_neighbor_remove_private_as_replace_as
,
3725 no_neighbor_remove_private_as_replace_as_cmd
,
3726 NO_NEIGHBOR_CMD2
"remove-private-AS replace-AS",
3730 "Remove private ASNs in outbound updates\n"
3731 "Replace private ASNs with our ASN in outbound updates\n")
3733 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3734 bgp_node_safi (vty
),
3735 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
3738 DEFUN (no_neighbor_remove_private_as_all_replace_as
,
3739 no_neighbor_remove_private_as_all_replace_as_cmd
,
3740 NO_NEIGHBOR_CMD2
"remove-private-AS all replace-AS",
3744 "Remove private ASNs in outbound updates\n"
3745 "Apply to all AS numbers"
3746 "Replace private ASNs with our ASN in outbound updates\n")
3748 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3749 bgp_node_safi (vty
),
3750 PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE
);
3754 /* neighbor send-community. */
3755 DEFUN (neighbor_send_community
,
3756 neighbor_send_community_cmd
,
3757 NEIGHBOR_CMD2
"send-community",
3760 "Send Community attribute to this neighbor\n")
3762 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3763 bgp_node_safi (vty
),
3764 PEER_FLAG_SEND_COMMUNITY
);
3767 DEFUN (no_neighbor_send_community
,
3768 no_neighbor_send_community_cmd
,
3769 NO_NEIGHBOR_CMD2
"send-community",
3773 "Send Community attribute to this neighbor\n")
3775 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3776 bgp_node_safi (vty
),
3777 PEER_FLAG_SEND_COMMUNITY
);
3780 /* neighbor send-community extended. */
3781 DEFUN (neighbor_send_community_type
,
3782 neighbor_send_community_type_cmd
,
3783 NEIGHBOR_CMD2
"send-community (both|extended|standard)",
3786 "Send Community attribute to this neighbor\n"
3787 "Send Standard and Extended Community attributes\n"
3788 "Send Extended Community attributes\n"
3789 "Send Standard Community attributes\n")
3791 if (strncmp (argv
[1], "s", 1) == 0)
3792 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3793 bgp_node_safi (vty
),
3794 PEER_FLAG_SEND_COMMUNITY
);
3795 if (strncmp (argv
[1], "e", 1) == 0)
3796 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3797 bgp_node_safi (vty
),
3798 PEER_FLAG_SEND_EXT_COMMUNITY
);
3800 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3801 bgp_node_safi (vty
),
3802 (PEER_FLAG_SEND_COMMUNITY
|
3803 PEER_FLAG_SEND_EXT_COMMUNITY
));
3806 DEFUN (no_neighbor_send_community_type
,
3807 no_neighbor_send_community_type_cmd
,
3808 NO_NEIGHBOR_CMD2
"send-community (both|extended|standard)",
3812 "Send Community attribute to this neighbor\n"
3813 "Send Standard and Extended Community attributes\n"
3814 "Send Extended Community attributes\n"
3815 "Send Standard Community attributes\n")
3817 if (strncmp (argv
[1], "s", 1) == 0)
3818 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3819 bgp_node_safi (vty
),
3820 PEER_FLAG_SEND_COMMUNITY
);
3821 if (strncmp (argv
[1], "e", 1) == 0)
3822 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3823 bgp_node_safi (vty
),
3824 PEER_FLAG_SEND_EXT_COMMUNITY
);
3826 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3827 bgp_node_safi (vty
),
3828 (PEER_FLAG_SEND_COMMUNITY
|
3829 PEER_FLAG_SEND_EXT_COMMUNITY
));
3832 /* neighbor soft-reconfig. */
3833 DEFUN (neighbor_soft_reconfiguration
,
3834 neighbor_soft_reconfiguration_cmd
,
3835 NEIGHBOR_CMD2
"soft-reconfiguration inbound",
3838 "Per neighbor soft reconfiguration\n"
3839 "Allow inbound soft reconfiguration for this neighbor\n")
3841 return peer_af_flag_set_vty (vty
, argv
[0],
3842 bgp_node_afi (vty
), bgp_node_safi (vty
),
3843 PEER_FLAG_SOFT_RECONFIG
);
3846 DEFUN (no_neighbor_soft_reconfiguration
,
3847 no_neighbor_soft_reconfiguration_cmd
,
3848 NO_NEIGHBOR_CMD2
"soft-reconfiguration inbound",
3852 "Per neighbor soft reconfiguration\n"
3853 "Allow inbound soft reconfiguration for this neighbor\n")
3855 return peer_af_flag_unset_vty (vty
, argv
[0],
3856 bgp_node_afi (vty
), bgp_node_safi (vty
),
3857 PEER_FLAG_SOFT_RECONFIG
);
3860 DEFUN (neighbor_route_reflector_client
,
3861 neighbor_route_reflector_client_cmd
,
3862 NEIGHBOR_CMD2
"route-reflector-client",
3865 "Configure a neighbor as Route Reflector client\n")
3870 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3874 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3875 bgp_node_safi (vty
),
3876 PEER_FLAG_REFLECTOR_CLIENT
);
3879 DEFUN (no_neighbor_route_reflector_client
,
3880 no_neighbor_route_reflector_client_cmd
,
3881 NO_NEIGHBOR_CMD2
"route-reflector-client",
3885 "Configure a neighbor as Route Reflector client\n")
3887 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3888 bgp_node_safi (vty
),
3889 PEER_FLAG_REFLECTOR_CLIENT
);
3892 /* neighbor route-server-client. */
3893 DEFUN (neighbor_route_server_client
,
3894 neighbor_route_server_client_cmd
,
3895 NEIGHBOR_CMD2
"route-server-client",
3898 "Configure a neighbor as Route Server client\n")
3902 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3905 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3906 bgp_node_safi (vty
),
3907 PEER_FLAG_RSERVER_CLIENT
);
3910 DEFUN (no_neighbor_route_server_client
,
3911 no_neighbor_route_server_client_cmd
,
3912 NO_NEIGHBOR_CMD2
"route-server-client",
3916 "Configure a neighbor as Route Server client\n")
3918 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3919 bgp_node_safi (vty
),
3920 PEER_FLAG_RSERVER_CLIENT
);
3923 DEFUN (neighbor_nexthop_local_unchanged
,
3924 neighbor_nexthop_local_unchanged_cmd
,
3925 NEIGHBOR_CMD2
"nexthop-local unchanged",
3928 "Configure treatment of outgoing link-local nexthop attribute\n"
3929 "Leave link-local nexthop unchanged for this peer\n")
3931 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3932 bgp_node_safi (vty
),
3933 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
3936 DEFUN (no_neighbor_nexthop_local_unchanged
,
3937 no_neighbor_nexthop_local_unchanged_cmd
,
3938 NO_NEIGHBOR_CMD2
"nexthop-local unchanged",
3942 "Configure treatment of outgoing link-local-nexthop attribute\n"
3943 "Leave link-local nexthop unchanged for this peer\n")
3945 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3946 bgp_node_safi (vty
),
3947 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
3950 DEFUN (neighbor_attr_unchanged
,
3951 neighbor_attr_unchanged_cmd
,
3952 NEIGHBOR_CMD2
"attribute-unchanged",
3955 "BGP attribute is propagated unchanged to this neighbor\n")
3957 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3958 bgp_node_safi (vty
),
3959 (PEER_FLAG_AS_PATH_UNCHANGED
|
3960 PEER_FLAG_NEXTHOP_UNCHANGED
|
3961 PEER_FLAG_MED_UNCHANGED
));
3964 DEFUN (neighbor_attr_unchanged1
,
3965 neighbor_attr_unchanged1_cmd
,
3966 NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
3969 "BGP attribute is propagated unchanged to this neighbor\n"
3970 "As-path attribute\n"
3971 "Nexthop attribute\n"
3974 u_int16_t flags
= 0;
3976 if (strncmp (argv
[1], "as-path", 1) == 0)
3977 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
3978 else if (strncmp (argv
[1], "next-hop", 1) == 0)
3979 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
3980 else if (strncmp (argv
[1], "med", 1) == 0)
3981 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
3983 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3984 bgp_node_safi (vty
), flags
);
3987 DEFUN (neighbor_attr_unchanged2
,
3988 neighbor_attr_unchanged2_cmd
,
3989 NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
3992 "BGP attribute is propagated unchanged to this neighbor\n"
3993 "As-path attribute\n"
3994 "Nexthop attribute\n"
3997 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
3999 if (strncmp (argv
[1], "next-hop", 1) == 0)
4000 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4001 else if (strncmp (argv
[1], "med", 1) == 0)
4002 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4004 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4005 bgp_node_safi (vty
), flags
);
4009 DEFUN (neighbor_attr_unchanged3
,
4010 neighbor_attr_unchanged3_cmd
,
4011 NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
4014 "BGP attribute is propagated unchanged to this neighbor\n"
4015 "Nexthop attribute\n"
4016 "As-path attribute\n"
4019 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
4021 if (strncmp (argv
[1], "as-path", 1) == 0)
4022 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4023 else if (strncmp (argv
[1], "med", 1) == 0)
4024 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4026 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4027 bgp_node_safi (vty
), flags
);
4030 DEFUN (neighbor_attr_unchanged4
,
4031 neighbor_attr_unchanged4_cmd
,
4032 NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
4035 "BGP attribute is propagated unchanged to this neighbor\n"
4037 "As-path attribute\n"
4038 "Nexthop attribute\n")
4040 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
4042 if (strncmp (argv
[1], "as-path", 1) == 0)
4043 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4044 else if (strncmp (argv
[1], "next-hop", 1) == 0)
4045 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4047 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4048 bgp_node_safi (vty
), flags
);
4051 ALIAS (neighbor_attr_unchanged
,
4052 neighbor_attr_unchanged5_cmd
,
4053 NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
4056 "BGP attribute is propagated unchanged to this neighbor\n"
4057 "As-path attribute\n"
4058 "Nexthop attribute\n"
4061 ALIAS (neighbor_attr_unchanged
,
4062 neighbor_attr_unchanged6_cmd
,
4063 NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
4066 "BGP attribute is propagated unchanged to this neighbor\n"
4067 "As-path attribute\n"
4069 "Nexthop attribute\n")
4071 ALIAS (neighbor_attr_unchanged
,
4072 neighbor_attr_unchanged7_cmd
,
4073 NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
4076 "BGP attribute is propagated unchanged to this neighbor\n"
4077 "Nexthop attribute\n"
4079 "As-path attribute\n")
4081 ALIAS (neighbor_attr_unchanged
,
4082 neighbor_attr_unchanged8_cmd
,
4083 NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
4086 "BGP attribute is propagated unchanged to this neighbor\n"
4087 "Nexthop attribute\n"
4088 "As-path attribute\n"
4091 ALIAS (neighbor_attr_unchanged
,
4092 neighbor_attr_unchanged9_cmd
,
4093 NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
4096 "BGP attribute is propagated unchanged to this neighbor\n"
4098 "Nexthop attribute\n"
4099 "As-path attribute\n")
4101 ALIAS (neighbor_attr_unchanged
,
4102 neighbor_attr_unchanged10_cmd
,
4103 NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
4106 "BGP attribute is propagated unchanged to this neighbor\n"
4108 "As-path attribute\n"
4109 "Nexthop attribute\n")
4111 DEFUN (no_neighbor_attr_unchanged
,
4112 no_neighbor_attr_unchanged_cmd
,
4113 NO_NEIGHBOR_CMD2
"attribute-unchanged",
4117 "BGP attribute is propagated unchanged to this neighbor\n")
4119 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4120 bgp_node_safi (vty
),
4121 (PEER_FLAG_AS_PATH_UNCHANGED
|
4122 PEER_FLAG_NEXTHOP_UNCHANGED
|
4123 PEER_FLAG_MED_UNCHANGED
));
4126 DEFUN (no_neighbor_attr_unchanged1
,
4127 no_neighbor_attr_unchanged1_cmd
,
4128 NO_NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
4132 "BGP attribute is propagated unchanged to this neighbor\n"
4133 "As-path attribute\n"
4134 "Nexthop attribute\n"
4137 u_int16_t flags
= 0;
4139 if (strncmp (argv
[1], "as-path", 1) == 0)
4140 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4141 else if (strncmp (argv
[1], "next-hop", 1) == 0)
4142 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4143 else if (strncmp (argv
[1], "med", 1) == 0)
4144 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4146 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4147 bgp_node_safi (vty
), flags
);
4150 DEFUN (no_neighbor_attr_unchanged2
,
4151 no_neighbor_attr_unchanged2_cmd
,
4152 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
4156 "BGP attribute is propagated unchanged to this neighbor\n"
4157 "As-path attribute\n"
4158 "Nexthop attribute\n"
4161 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
4163 if (strncmp (argv
[1], "next-hop", 1) == 0)
4164 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4165 else if (strncmp (argv
[1], "med", 1) == 0)
4166 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4168 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4169 bgp_node_safi (vty
), flags
);
4172 DEFUN (no_neighbor_attr_unchanged3
,
4173 no_neighbor_attr_unchanged3_cmd
,
4174 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
4178 "BGP attribute is propagated unchanged to this neighbor\n"
4179 "Nexthop attribute\n"
4180 "As-path attribute\n"
4183 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
4185 if (strncmp (argv
[1], "as-path", 1) == 0)
4186 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4187 else if (strncmp (argv
[1], "med", 1) == 0)
4188 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4190 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4191 bgp_node_safi (vty
), flags
);
4194 DEFUN (no_neighbor_attr_unchanged4
,
4195 no_neighbor_attr_unchanged4_cmd
,
4196 NO_NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
4200 "BGP attribute is propagated unchanged to this neighbor\n"
4202 "As-path attribute\n"
4203 "Nexthop attribute\n")
4205 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
4207 if (strncmp (argv
[1], "as-path", 1) == 0)
4208 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4209 else if (strncmp (argv
[1], "next-hop", 1) == 0)
4210 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4212 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4213 bgp_node_safi (vty
), flags
);
4216 ALIAS (no_neighbor_attr_unchanged
,
4217 no_neighbor_attr_unchanged5_cmd
,
4218 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
4222 "BGP attribute is propagated unchanged to this neighbor\n"
4223 "As-path attribute\n"
4224 "Nexthop attribute\n"
4227 ALIAS (no_neighbor_attr_unchanged
,
4228 no_neighbor_attr_unchanged6_cmd
,
4229 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
4233 "BGP attribute is propagated unchanged to this neighbor\n"
4234 "As-path attribute\n"
4236 "Nexthop attribute\n")
4238 ALIAS (no_neighbor_attr_unchanged
,
4239 no_neighbor_attr_unchanged7_cmd
,
4240 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
4244 "BGP attribute is propagated unchanged to this neighbor\n"
4245 "Nexthop attribute\n"
4247 "As-path attribute\n")
4249 ALIAS (no_neighbor_attr_unchanged
,
4250 no_neighbor_attr_unchanged8_cmd
,
4251 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
4255 "BGP attribute is propagated unchanged to this neighbor\n"
4256 "Nexthop attribute\n"
4257 "As-path attribute\n"
4260 ALIAS (no_neighbor_attr_unchanged
,
4261 no_neighbor_attr_unchanged9_cmd
,
4262 NO_NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
4266 "BGP attribute is propagated unchanged to this neighbor\n"
4268 "Nexthop attribute\n"
4269 "As-path attribute\n")
4271 ALIAS (no_neighbor_attr_unchanged
,
4272 no_neighbor_attr_unchanged10_cmd
,
4273 NO_NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
4277 "BGP attribute is propagated unchanged to this neighbor\n"
4279 "As-path attribute\n"
4280 "Nexthop attribute\n")
4282 /* EBGP multihop configuration. */
4284 peer_ebgp_multihop_set_vty (struct vty
*vty
, const char *ip_str
,
4285 const char *ttl_str
)
4290 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4297 VTY_GET_INTEGER_RANGE ("TTL", ttl
, ttl_str
, 1, MAXTTL
);
4299 return bgp_vty_return (vty
, peer_ebgp_multihop_set (peer
, ttl
));
4303 peer_ebgp_multihop_unset_vty (struct vty
*vty
, const char *ip_str
)
4307 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4311 return bgp_vty_return (vty
, peer_ebgp_multihop_unset (peer
));
4314 /* neighbor ebgp-multihop. */
4315 DEFUN (neighbor_ebgp_multihop
,
4316 neighbor_ebgp_multihop_cmd
,
4317 NEIGHBOR_CMD2
"ebgp-multihop",
4320 "Allow EBGP neighbors not on directly connected networks\n")
4322 return peer_ebgp_multihop_set_vty (vty
, argv
[0], NULL
);
4325 DEFUN (neighbor_ebgp_multihop_ttl
,
4326 neighbor_ebgp_multihop_ttl_cmd
,
4327 NEIGHBOR_CMD2
"ebgp-multihop " CMD_RANGE_STR(1, MAXTTL
),
4330 "Allow EBGP neighbors not on directly connected networks\n"
4331 "maximum hop count\n")
4333 return peer_ebgp_multihop_set_vty (vty
, argv
[0], argv
[1]);
4336 DEFUN (no_neighbor_ebgp_multihop
,
4337 no_neighbor_ebgp_multihop_cmd
,
4338 NO_NEIGHBOR_CMD2
"ebgp-multihop",
4342 "Allow EBGP neighbors not on directly connected networks\n")
4344 return peer_ebgp_multihop_unset_vty (vty
, argv
[0]);
4347 ALIAS (no_neighbor_ebgp_multihop
,
4348 no_neighbor_ebgp_multihop_ttl_cmd
,
4349 NO_NEIGHBOR_CMD2
"ebgp-multihop " CMD_RANGE_STR(1, MAXTTL
),
4353 "Allow EBGP neighbors not on directly connected networks\n"
4354 "maximum hop count\n")
4356 /* disable-connected-check */
4357 DEFUN (neighbor_disable_connected_check
,
4358 neighbor_disable_connected_check_cmd
,
4359 NEIGHBOR_CMD2
"disable-connected-check",
4362 "one-hop away EBGP peer using loopback address\n")
4364 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
4367 DEFUN (no_neighbor_disable_connected_check
,
4368 no_neighbor_disable_connected_check_cmd
,
4369 NO_NEIGHBOR_CMD2
"disable-connected-check",
4373 "one-hop away EBGP peer using loopback address\n")
4375 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
4378 /* Enforce multihop. */
4379 ALIAS (neighbor_disable_connected_check
,
4380 neighbor_enforce_multihop_cmd
,
4381 NEIGHBOR_CMD2
"enforce-multihop",
4384 "Enforce EBGP neighbors perform multihop\n")
4386 /* Enforce multihop. */
4387 ALIAS (no_neighbor_disable_connected_check
,
4388 no_neighbor_enforce_multihop_cmd
,
4389 NO_NEIGHBOR_CMD2
"enforce-multihop",
4393 "Enforce EBGP neighbors perform multihop\n")
4395 DEFUN (neighbor_description
,
4396 neighbor_description_cmd
,
4397 NEIGHBOR_CMD2
"description .LINE",
4400 "Neighbor specific description\n"
4401 "Up to 80 characters describing this neighbor\n")
4406 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4413 str
= argv_concat(argv
, argc
, 1);
4415 peer_description_set (peer
, str
);
4417 XFREE (MTYPE_TMP
, str
);
4422 DEFUN (no_neighbor_description
,
4423 no_neighbor_description_cmd
,
4424 NO_NEIGHBOR_CMD2
"description",
4428 "Neighbor specific description\n")
4432 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4436 peer_description_unset (peer
);
4441 ALIAS (no_neighbor_description
,
4442 no_neighbor_description_val_cmd
,
4443 NO_NEIGHBOR_CMD2
"description .LINE",
4447 "Neighbor specific description\n"
4448 "Up to 80 characters describing this neighbor\n")
4450 /* Neighbor update-source. */
4452 peer_update_source_vty (struct vty
*vty
, const char *peer_str
,
4453 const char *source_str
)
4457 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
4467 int ret
= str2sockunion (source_str
, &su
);
4470 peer_update_source_addr_set (peer
, &su
);
4472 peer_update_source_if_set (peer
, source_str
);
4475 peer_update_source_unset (peer
);
4480 #define BGP_UPDATE_SOURCE_STR "A.B.C.D|X:X::X:X|WORD"
4481 #define BGP_UPDATE_SOURCE_REQ_STR "(" BGP_UPDATE_SOURCE_STR ")"
4482 #define BGP_UPDATE_SOURCE_OPT_STR "{" BGP_UPDATE_SOURCE_STR "}"
4483 #define BGP_UPDATE_SOURCE_HELP_STR \
4486 "Interface name (requires zebra to be running)\n"
4488 DEFUN (neighbor_update_source
,
4489 neighbor_update_source_cmd
,
4490 NEIGHBOR_CMD2
"update-source " BGP_UPDATE_SOURCE_REQ_STR
,
4493 "Source of routing updates\n"
4494 BGP_UPDATE_SOURCE_HELP_STR
)
4496 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
4499 DEFUN (no_neighbor_update_source
,
4500 no_neighbor_update_source_cmd
,
4501 NO_NEIGHBOR_CMD2
"update-source " BGP_UPDATE_SOURCE_OPT_STR
,
4505 "Source of routing updates\n"
4506 BGP_UPDATE_SOURCE_HELP_STR
)
4508 return peer_update_source_vty (vty
, argv
[0], NULL
);
4512 peer_default_originate_set_vty (struct vty
*vty
, const char *peer_str
,
4513 afi_t afi
, safi_t safi
,
4514 const char *rmap
, int set
)
4519 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
4524 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
4526 ret
= peer_default_originate_unset (peer
, afi
, safi
);
4528 return bgp_vty_return (vty
, ret
);
4531 /* neighbor default-originate. */
4532 DEFUN (neighbor_default_originate
,
4533 neighbor_default_originate_cmd
,
4534 NEIGHBOR_CMD2
"default-originate",
4537 "Originate default route to this neighbor\n")
4539 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4540 bgp_node_safi (vty
), NULL
, 1);
4543 DEFUN (neighbor_default_originate_rmap
,
4544 neighbor_default_originate_rmap_cmd
,
4545 NEIGHBOR_CMD2
"default-originate route-map WORD",
4548 "Originate default route to this neighbor\n"
4549 "Route-map to specify criteria to originate default\n"
4552 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4553 bgp_node_safi (vty
), argv
[1], 1);
4556 DEFUN (no_neighbor_default_originate
,
4557 no_neighbor_default_originate_cmd
,
4558 NO_NEIGHBOR_CMD2
"default-originate",
4562 "Originate default route to this neighbor\n")
4564 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4565 bgp_node_safi (vty
), NULL
, 0);
4568 ALIAS (no_neighbor_default_originate
,
4569 no_neighbor_default_originate_rmap_cmd
,
4570 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
4574 "Originate default route to this neighbor\n"
4575 "Route-map to specify criteria to originate default\n"
4578 /* Set neighbor's BGP port. */
4580 peer_port_vty (struct vty
*vty
, const char *ip_str
, int afi
,
4581 const char *port_str
)
4587 peer
= peer_lookup_vty (vty
, ip_str
);
4593 sp
= getservbyname ("bgp", "tcp");
4594 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
4598 VTY_GET_INTEGER("port", port
, port_str
);
4601 peer_port_set (peer
, port
);
4606 /* Set specified peer's BGP port. */
4607 DEFUN (neighbor_port
,
4609 NEIGHBOR_CMD
"port <0-65535>",
4612 "Neighbor's BGP port\n"
4613 "TCP port number\n")
4615 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
4618 DEFUN (no_neighbor_port
,
4619 no_neighbor_port_cmd
,
4620 NO_NEIGHBOR_CMD
"port",
4624 "Neighbor's BGP port\n")
4626 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
4629 ALIAS (no_neighbor_port
,
4630 no_neighbor_port_val_cmd
,
4631 NO_NEIGHBOR_CMD
"port <0-65535>",
4635 "Neighbor's BGP port\n"
4636 "TCP port number\n")
4638 /* neighbor weight. */
4640 peer_weight_set_vty (struct vty
*vty
, const char *ip_str
,
4641 const char *weight_str
)
4644 unsigned long weight
;
4646 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4650 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
4652 peer_weight_set (peer
, weight
);
4658 peer_weight_unset_vty (struct vty
*vty
, const char *ip_str
)
4662 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4666 peer_weight_unset (peer
);
4671 DEFUN (neighbor_weight
,
4672 neighbor_weight_cmd
,
4673 NEIGHBOR_CMD2
"weight <0-65535>",
4676 "Set default weight for routes from this neighbor\n"
4679 return peer_weight_set_vty (vty
, argv
[0], argv
[1]);
4682 DEFUN (no_neighbor_weight
,
4683 no_neighbor_weight_cmd
,
4684 NO_NEIGHBOR_CMD2
"weight",
4688 "Set default weight for routes from this neighbor\n")
4690 return peer_weight_unset_vty (vty
, argv
[0]);
4693 ALIAS (no_neighbor_weight
,
4694 no_neighbor_weight_val_cmd
,
4695 NO_NEIGHBOR_CMD2
"weight <0-65535>",
4699 "Set default weight for routes from this neighbor\n"
4702 /* Override capability negotiation. */
4703 DEFUN (neighbor_override_capability
,
4704 neighbor_override_capability_cmd
,
4705 NEIGHBOR_CMD2
"override-capability",
4708 "Override capability negotiation result\n")
4710 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
4713 DEFUN (no_neighbor_override_capability
,
4714 no_neighbor_override_capability_cmd
,
4715 NO_NEIGHBOR_CMD2
"override-capability",
4719 "Override capability negotiation result\n")
4721 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
4724 DEFUN (neighbor_strict_capability
,
4725 neighbor_strict_capability_cmd
,
4726 NEIGHBOR_CMD
"strict-capability-match",
4729 "Strict capability negotiation match\n")
4731 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
4734 DEFUN (no_neighbor_strict_capability
,
4735 no_neighbor_strict_capability_cmd
,
4736 NO_NEIGHBOR_CMD
"strict-capability-match",
4740 "Strict capability negotiation match\n")
4742 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
4746 peer_timers_set_vty (struct vty
*vty
, const char *ip_str
,
4747 const char *keep_str
, const char *hold_str
)
4751 u_int32_t keepalive
;
4754 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4758 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
4759 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
4761 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
4763 return bgp_vty_return (vty
, ret
);
4767 peer_timers_unset_vty (struct vty
*vty
, const char *ip_str
)
4772 peer
= peer_lookup_vty (vty
, ip_str
);
4776 ret
= peer_timers_unset (peer
);
4778 return bgp_vty_return (vty
, ret
);
4781 DEFUN (neighbor_timers
,
4782 neighbor_timers_cmd
,
4783 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
4786 "BGP per neighbor timers\n"
4787 "Keepalive interval\n"
4790 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
4793 DEFUN (no_neighbor_timers
,
4794 no_neighbor_timers_cmd
,
4795 NO_NEIGHBOR_CMD2
"timers",
4799 "BGP per neighbor timers\n")
4801 return peer_timers_unset_vty (vty
, argv
[0]);
4804 ALIAS (no_neighbor_timers
,
4805 no_neighbor_timers_val_cmd
,
4806 NO_NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
4810 "BGP per neighbor timers\n"
4811 "Keepalive interval\n"
4815 peer_timers_connect_set_vty (struct vty
*vty
, const char *ip_str
,
4816 const char *time_str
)
4822 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4826 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
4828 ret
= peer_timers_connect_set (peer
, connect
);
4830 return bgp_vty_return (vty
, ret
);
4834 peer_timers_connect_unset_vty (struct vty
*vty
, const char *ip_str
)
4839 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4843 ret
= peer_timers_connect_unset (peer
);
4845 return bgp_vty_return (vty
, ret
);
4848 DEFUN (neighbor_timers_connect
,
4849 neighbor_timers_connect_cmd
,
4850 NEIGHBOR_CMD2
"timers connect <1-65535>",
4853 "BGP per neighbor timers\n"
4854 "BGP connect timer\n"
4857 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
4860 DEFUN (no_neighbor_timers_connect
,
4861 no_neighbor_timers_connect_cmd
,
4862 NO_NEIGHBOR_CMD2
"timers connect",
4866 "BGP per neighbor timers\n"
4867 "BGP connect timer\n")
4869 return peer_timers_connect_unset_vty (vty
, argv
[0]);
4872 ALIAS (no_neighbor_timers_connect
,
4873 no_neighbor_timers_connect_val_cmd
,
4874 NO_NEIGHBOR_CMD2
"timers connect <1-65535>",
4878 "BGP per neighbor timers\n"
4879 "BGP connect timer\n"
4883 peer_advertise_interval_vty (struct vty
*vty
, const char *ip_str
,
4884 const char *time_str
, int set
)
4888 u_int32_t routeadv
= 0;
4890 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4895 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
4898 ret
= peer_advertise_interval_set (peer
, routeadv
);
4900 ret
= peer_advertise_interval_unset (peer
);
4902 return bgp_vty_return (vty
, ret
);
4905 DEFUN (neighbor_advertise_interval
,
4906 neighbor_advertise_interval_cmd
,
4907 NEIGHBOR_CMD2
"advertisement-interval <0-600>",
4910 "Minimum interval between sending BGP routing updates\n"
4911 "time in seconds\n")
4913 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
4916 DEFUN (no_neighbor_advertise_interval
,
4917 no_neighbor_advertise_interval_cmd
,
4918 NO_NEIGHBOR_CMD2
"advertisement-interval",
4922 "Minimum interval between sending BGP routing updates\n")
4924 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
4927 ALIAS (no_neighbor_advertise_interval
,
4928 no_neighbor_advertise_interval_val_cmd
,
4929 NO_NEIGHBOR_CMD2
"advertisement-interval <0-600>",
4933 "Minimum interval between sending BGP routing updates\n"
4934 "time in seconds\n")
4936 /* Time to wait before processing route-map updates */
4937 DEFUN (bgp_set_route_map_delay_timer
,
4938 bgp_set_route_map_delay_timer_cmd
,
4939 "bgp route-map delay-timer <0-600>",
4941 "BGP route-map delay timer\n"
4942 "Time in secs to wait before processing route-map changes\n"
4943 "0 disables the timer, no route updates happen when route-maps change\n")
4945 u_int32_t rmap_delay_timer
;
4949 VTY_GET_INTEGER_RANGE ("delay-timer", rmap_delay_timer
, argv
[0], 0, 600);
4950 bm
->rmap_update_timer
= rmap_delay_timer
;
4952 /* if the dynamic update handling is being disabled, and a timer is
4953 * running, stop the timer and act as if the timer has already fired.
4955 if (!rmap_delay_timer
&& bm
->t_rmap_update
)
4957 BGP_TIMER_OFF(bm
->t_rmap_update
);
4958 thread_execute (bm
->master
, bgp_route_map_update_timer
, NULL
, 0);
4966 DEFUN (no_bgp_set_route_map_delay_timer
,
4967 no_bgp_set_route_map_delay_timer_cmd
,
4968 "no bgp route-map delay-timer",
4970 "Default BGP route-map delay timer\n"
4971 "Reset to default time to wait for processing route-map changes\n")
4974 bm
->rmap_update_timer
= RMAP_DEFAULT_UPDATE_TIMER
;
4979 ALIAS (no_bgp_set_route_map_delay_timer
,
4980 no_bgp_set_route_map_delay_timer_val_cmd
,
4981 "no bgp route-map delay-timer <0-600>",
4983 "Default BGP route-map delay timer\n"
4984 "Reset to default time to wait for processing route-map changes\n"
4985 "0 disables the timer, no route updates happen when route-maps change\n")
4987 /* neighbor interface */
4989 peer_interface_vty (struct vty
*vty
, const char *ip_str
, const char *str
)
4993 peer
= peer_lookup_vty (vty
, ip_str
);
4994 if (! peer
|| peer
->conf_if
)
4998 peer_interface_set (peer
, str
);
5000 peer_interface_unset (peer
);
5005 DEFUN (neighbor_interface
,
5006 neighbor_interface_cmd
,
5007 NEIGHBOR_CMD
"interface WORD",
5014 return peer_interface_vty (vty
, argv
[0], argv
[1]);
5016 return peer_interface_vty (vty
, argv
[0], argv
[1]);
5019 DEFUN (no_neighbor_interface
,
5020 no_neighbor_interface_cmd
,
5021 NO_NEIGHBOR_CMD2
"interface WORD",
5028 return peer_interface_vty (vty
, argv
[0], NULL
);
5031 /* Set distribute list to the peer. */
5033 peer_distribute_set_vty (struct vty
*vty
, const char *ip_str
,
5034 afi_t afi
, safi_t safi
,
5035 const char *name_str
, const char *direct_str
)
5039 int direct
= FILTER_IN
;
5041 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5045 /* Check filter direction. */
5046 if (strncmp (direct_str
, "i", 1) == 0)
5048 else if (strncmp (direct_str
, "o", 1) == 0)
5049 direct
= FILTER_OUT
;
5051 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
5053 return bgp_vty_return (vty
, ret
);
5057 peer_distribute_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5058 safi_t safi
, const char *direct_str
)
5062 int direct
= FILTER_IN
;
5064 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5068 /* Check filter direction. */
5069 if (strncmp (direct_str
, "i", 1) == 0)
5071 else if (strncmp (direct_str
, "o", 1) == 0)
5072 direct
= FILTER_OUT
;
5074 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
5076 return bgp_vty_return (vty
, ret
);
5079 DEFUN (neighbor_distribute_list
,
5080 neighbor_distribute_list_cmd
,
5081 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
5084 "Filter updates to/from this neighbor\n"
5085 "IP access-list number\n"
5086 "IP access-list number (expanded range)\n"
5087 "IP Access-list name\n"
5088 "Filter incoming updates\n"
5089 "Filter outgoing updates\n")
5091 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5092 bgp_node_safi (vty
), argv
[1], argv
[2]);
5095 DEFUN (no_neighbor_distribute_list
,
5096 no_neighbor_distribute_list_cmd
,
5097 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
5101 "Filter updates to/from this neighbor\n"
5102 "IP access-list number\n"
5103 "IP access-list number (expanded range)\n"
5104 "IP Access-list name\n"
5105 "Filter incoming updates\n"
5106 "Filter outgoing updates\n")
5108 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5109 bgp_node_safi (vty
), argv
[2]);
5112 /* Set prefix list to the peer. */
5114 peer_prefix_list_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5115 safi_t safi
, const char *name_str
,
5116 const char *direct_str
)
5120 int direct
= FILTER_IN
;
5122 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5126 /* Check filter direction. */
5127 if (strncmp (direct_str
, "i", 1) == 0)
5129 else if (strncmp (direct_str
, "o", 1) == 0)
5130 direct
= FILTER_OUT
;
5132 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
5134 return bgp_vty_return (vty
, ret
);
5138 peer_prefix_list_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5139 safi_t safi
, const char *direct_str
)
5143 int direct
= FILTER_IN
;
5145 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5149 /* Check filter direction. */
5150 if (strncmp (direct_str
, "i", 1) == 0)
5152 else if (strncmp (direct_str
, "o", 1) == 0)
5153 direct
= FILTER_OUT
;
5155 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
5157 return bgp_vty_return (vty
, ret
);
5160 DEFUN (neighbor_prefix_list
,
5161 neighbor_prefix_list_cmd
,
5162 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
5165 "Filter updates to/from this neighbor\n"
5166 "Name of a prefix list\n"
5167 "Filter incoming updates\n"
5168 "Filter outgoing updates\n")
5170 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5171 bgp_node_safi (vty
), argv
[1], argv
[2]);
5174 DEFUN (no_neighbor_prefix_list
,
5175 no_neighbor_prefix_list_cmd
,
5176 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
5180 "Filter updates to/from this neighbor\n"
5181 "Name of a prefix list\n"
5182 "Filter incoming updates\n"
5183 "Filter outgoing updates\n")
5185 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5186 bgp_node_safi (vty
), argv
[2]);
5190 peer_aslist_set_vty (struct vty
*vty
, const char *ip_str
,
5191 afi_t afi
, safi_t safi
,
5192 const char *name_str
, const char *direct_str
)
5196 int direct
= FILTER_IN
;
5198 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5202 /* Check filter direction. */
5203 if (strncmp (direct_str
, "i", 1) == 0)
5205 else if (strncmp (direct_str
, "o", 1) == 0)
5206 direct
= FILTER_OUT
;
5208 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
5210 return bgp_vty_return (vty
, ret
);
5214 peer_aslist_unset_vty (struct vty
*vty
, const char *ip_str
,
5215 afi_t afi
, safi_t safi
,
5216 const char *direct_str
)
5220 int direct
= FILTER_IN
;
5222 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5226 /* Check filter direction. */
5227 if (strncmp (direct_str
, "i", 1) == 0)
5229 else if (strncmp (direct_str
, "o", 1) == 0)
5230 direct
= FILTER_OUT
;
5232 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
5234 return bgp_vty_return (vty
, ret
);
5237 DEFUN (neighbor_filter_list
,
5238 neighbor_filter_list_cmd
,
5239 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
5242 "Establish BGP filters\n"
5243 "AS path access-list name\n"
5244 "Filter incoming routes\n"
5245 "Filter outgoing routes\n")
5247 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5248 bgp_node_safi (vty
), argv
[1], argv
[2]);
5251 DEFUN (no_neighbor_filter_list
,
5252 no_neighbor_filter_list_cmd
,
5253 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
5257 "Establish BGP filters\n"
5258 "AS path access-list name\n"
5259 "Filter incoming routes\n"
5260 "Filter outgoing routes\n")
5262 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5263 bgp_node_safi (vty
), argv
[2]);
5266 /* Set route-map to the peer. */
5268 peer_route_map_set_vty (struct vty
*vty
, const char *ip_str
,
5269 afi_t afi
, safi_t safi
,
5270 const char *name_str
, const char *direct_str
)
5274 int direct
= RMAP_IN
;
5276 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5280 /* Check filter direction. */
5281 if (strncmp (direct_str
, "in", 2) == 0)
5283 else if (strncmp (direct_str
, "o", 1) == 0)
5286 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
5288 return bgp_vty_return (vty
, ret
);
5292 peer_route_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5293 safi_t safi
, const char *direct_str
)
5297 int direct
= RMAP_IN
;
5299 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5303 /* Check filter direction. */
5304 if (strncmp (direct_str
, "in", 2) == 0)
5306 else if (strncmp (direct_str
, "o", 1) == 0)
5309 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
5311 return bgp_vty_return (vty
, ret
);
5314 DEFUN (neighbor_route_map
,
5315 neighbor_route_map_cmd
,
5316 NEIGHBOR_CMD2
"route-map WORD (in|out)",
5319 "Apply route map to neighbor\n"
5320 "Name of route map\n"
5321 "Apply map to incoming routes\n"
5322 "Apply map to outbound routes\n")
5324 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5325 bgp_node_safi (vty
), argv
[1], argv
[2]);
5328 DEFUN (no_neighbor_route_map
,
5329 no_neighbor_route_map_cmd
,
5330 NO_NEIGHBOR_CMD2
"route-map WORD (in|out)",
5334 "Apply route map to neighbor\n"
5335 "Name of route map\n"
5336 "Apply map to incoming routes\n"
5337 "Apply map to outbound routes\n")
5339 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5340 bgp_node_safi (vty
), argv
[2]);
5343 /* Set unsuppress-map to the peer. */
5345 peer_unsuppress_map_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5346 safi_t safi
, const char *name_str
)
5351 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5355 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
5357 return bgp_vty_return (vty
, ret
);
5360 /* Unset route-map from the peer. */
5362 peer_unsuppress_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5368 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5372 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
5374 return bgp_vty_return (vty
, ret
);
5377 DEFUN (neighbor_unsuppress_map
,
5378 neighbor_unsuppress_map_cmd
,
5379 NEIGHBOR_CMD2
"unsuppress-map WORD",
5382 "Route-map to selectively unsuppress suppressed routes\n"
5383 "Name of route map\n")
5385 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5386 bgp_node_safi (vty
), argv
[1]);
5389 DEFUN (no_neighbor_unsuppress_map
,
5390 no_neighbor_unsuppress_map_cmd
,
5391 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
5395 "Route-map to selectively unsuppress suppressed routes\n"
5396 "Name of route map\n")
5398 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5399 bgp_node_safi (vty
));
5403 peer_maximum_prefix_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5404 safi_t safi
, const char *num_str
,
5405 const char *threshold_str
, int warning
,
5406 const char *restart_str
)
5414 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5418 VTY_GET_INTEGER ("maximum number", max
, num_str
);
5420 threshold
= atoi (threshold_str
);
5422 threshold
= MAXIMUM_PREFIX_THRESHOLD_DEFAULT
;
5425 restart
= atoi (restart_str
);
5429 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, threshold
, warning
, restart
);
5431 return bgp_vty_return (vty
, ret
);
5435 peer_maximum_prefix_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5441 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5445 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
5447 return bgp_vty_return (vty
, ret
);
5450 /* Maximum number of prefix configuration. prefix count is different
5451 for each peer configuration. So this configuration can be set for
5452 each peer configuration. */
5453 DEFUN (neighbor_maximum_prefix
,
5454 neighbor_maximum_prefix_cmd
,
5455 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
5458 "Maximum number of prefix accept from this peer\n"
5459 "maximum no. of prefix limit\n")
5461 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5462 bgp_node_safi (vty
), argv
[1], NULL
, 0,
5466 DEFUN (neighbor_maximum_prefix_threshold
,
5467 neighbor_maximum_prefix_threshold_cmd
,
5468 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
5471 "Maximum number of prefix accept from this peer\n"
5472 "maximum no. of prefix limit\n"
5473 "Threshold value (%) at which to generate a warning msg\n")
5475 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5476 bgp_node_safi (vty
), argv
[1], argv
[2], 0,
5480 DEFUN (neighbor_maximum_prefix_warning
,
5481 neighbor_maximum_prefix_warning_cmd
,
5482 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
5485 "Maximum number of prefix accept from this peer\n"
5486 "maximum no. of prefix limit\n"
5487 "Only give warning message when limit is exceeded\n")
5489 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5490 bgp_node_safi (vty
), argv
[1], NULL
, 1,
5494 DEFUN (neighbor_maximum_prefix_threshold_warning
,
5495 neighbor_maximum_prefix_threshold_warning_cmd
,
5496 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
5499 "Maximum number of prefix accept from this peer\n"
5500 "maximum no. of prefix limit\n"
5501 "Threshold value (%) at which to generate a warning msg\n"
5502 "Only give warning message when limit is exceeded\n")
5504 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5505 bgp_node_safi (vty
), argv
[1], argv
[2], 1, NULL
);
5508 DEFUN (neighbor_maximum_prefix_restart
,
5509 neighbor_maximum_prefix_restart_cmd
,
5510 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
5513 "Maximum number of prefix accept from this peer\n"
5514 "maximum no. of prefix limit\n"
5515 "Restart bgp connection after limit is exceeded\n"
5516 "Restart interval in minutes")
5518 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5519 bgp_node_safi (vty
), argv
[1], NULL
, 0, argv
[2]);
5522 DEFUN (neighbor_maximum_prefix_threshold_restart
,
5523 neighbor_maximum_prefix_threshold_restart_cmd
,
5524 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
5527 "Maximum number of prefix accept from this peer\n"
5528 "maximum no. of prefix limit\n"
5529 "Threshold value (%) at which to generate a warning msg\n"
5530 "Restart bgp connection after limit is exceeded\n"
5531 "Restart interval in minutes")
5533 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5534 bgp_node_safi (vty
), argv
[1], argv
[2], 0, argv
[3]);
5537 DEFUN (no_neighbor_maximum_prefix
,
5538 no_neighbor_maximum_prefix_cmd
,
5539 NO_NEIGHBOR_CMD2
"maximum-prefix",
5543 "Maximum number of prefix accept from this peer\n")
5545 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5546 bgp_node_safi (vty
));
5549 ALIAS (no_neighbor_maximum_prefix
,
5550 no_neighbor_maximum_prefix_val_cmd
,
5551 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
5555 "Maximum number of prefix accept from this peer\n"
5556 "maximum no. of prefix limit\n")
5558 ALIAS (no_neighbor_maximum_prefix
,
5559 no_neighbor_maximum_prefix_threshold_cmd
,
5560 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
5564 "Maximum number of prefix accept from this peer\n"
5565 "maximum no. of prefix limit\n"
5566 "Threshold value (%) at which to generate a warning msg\n")
5568 ALIAS (no_neighbor_maximum_prefix
,
5569 no_neighbor_maximum_prefix_warning_cmd
,
5570 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
5574 "Maximum number of prefix accept from this peer\n"
5575 "maximum no. of prefix limit\n"
5576 "Only give warning message when limit is exceeded\n")
5578 ALIAS (no_neighbor_maximum_prefix
,
5579 no_neighbor_maximum_prefix_threshold_warning_cmd
,
5580 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
5584 "Maximum number of prefix accept from this peer\n"
5585 "maximum no. of prefix limit\n"
5586 "Threshold value (%) at which to generate a warning msg\n"
5587 "Only give warning message when limit is exceeded\n")
5589 ALIAS (no_neighbor_maximum_prefix
,
5590 no_neighbor_maximum_prefix_restart_cmd
,
5591 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
5595 "Maximum number of prefix accept from this peer\n"
5596 "maximum no. of prefix limit\n"
5597 "Restart bgp connection after limit is exceeded\n"
5598 "Restart interval in minutes")
5600 ALIAS (no_neighbor_maximum_prefix
,
5601 no_neighbor_maximum_prefix_threshold_restart_cmd
,
5602 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
5606 "Maximum number of prefix accept from this peer\n"
5607 "maximum no. of prefix limit\n"
5608 "Threshold value (%) at which to generate a warning msg\n"
5609 "Restart bgp connection after limit is exceeded\n"
5610 "Restart interval in minutes")
5612 /* "neighbor allowas-in" */
5613 DEFUN (neighbor_allowas_in
,
5614 neighbor_allowas_in_cmd
,
5615 NEIGHBOR_CMD2
"allowas-in",
5618 "Accept as-path with my AS present in it\n")
5622 unsigned int allow_num
;
5624 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5631 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
5633 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
5636 return bgp_vty_return (vty
, ret
);
5639 ALIAS (neighbor_allowas_in
,
5640 neighbor_allowas_in_arg_cmd
,
5641 NEIGHBOR_CMD2
"allowas-in <1-10>",
5644 "Accept as-path with my AS present in it\n"
5645 "Number of occurances of AS number\n")
5647 DEFUN (no_neighbor_allowas_in
,
5648 no_neighbor_allowas_in_cmd
,
5649 NO_NEIGHBOR_CMD2
"allowas-in",
5653 "allow local ASN appears in aspath attribute\n")
5658 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5662 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
5664 return bgp_vty_return (vty
, ret
);
5667 ALIAS (no_neighbor_allowas_in
,
5668 no_neighbor_allowas_in_val_cmd
,
5669 NO_NEIGHBOR_CMD2
"allowas-in <1-10>",
5673 "allow local ASN appears in aspath attribute\n"
5674 "Number of occurances of AS number\n")
5676 DEFUN (neighbor_ttl_security
,
5677 neighbor_ttl_security_cmd
,
5678 NEIGHBOR_CMD2
"ttl-security hops <1-254>",
5681 "Specify the maximum number of hops to the BGP peer\n")
5686 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5690 VTY_GET_INTEGER_RANGE ("", gtsm_hops
, argv
[1], 1, 254);
5692 return bgp_vty_return (vty
, peer_ttl_security_hops_set (peer
, gtsm_hops
));
5695 DEFUN (no_neighbor_ttl_security
,
5696 no_neighbor_ttl_security_cmd
,
5697 NO_NEIGHBOR_CMD2
"ttl-security hops <1-254>",
5701 "Specify the maximum number of hops to the BGP peer\n")
5705 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5709 return bgp_vty_return (vty
, peer_ttl_security_hops_unset (peer
));
5712 DEFUN (neighbor_addpath_tx_all_paths
,
5713 neighbor_addpath_tx_all_paths_cmd
,
5714 NEIGHBOR_CMD2
"addpath-tx-all-paths",
5717 "Use addpath to advertise all paths to a neighbor\n")
5721 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5725 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5726 bgp_node_safi (vty
),
5727 PEER_FLAG_ADDPATH_TX_ALL_PATHS
);
5730 DEFUN (no_neighbor_addpath_tx_all_paths
,
5731 no_neighbor_addpath_tx_all_paths_cmd
,
5732 NO_NEIGHBOR_CMD2
"addpath-tx-all-paths",
5736 "Use addpath to advertise all paths to a neighbor\n")
5738 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5739 bgp_node_safi (vty
),
5740 PEER_FLAG_ADDPATH_TX_ALL_PATHS
);
5743 DEFUN (neighbor_addpath_tx_bestpath_per_as
,
5744 neighbor_addpath_tx_bestpath_per_as_cmd
,
5745 NEIGHBOR_CMD2
"addpath-tx-bestpath-per-AS",
5748 "Use addpath to advertise the bestpath per each neighboring AS\n")
5752 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5756 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5757 bgp_node_safi (vty
),
5758 PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS
);
5761 DEFUN (no_neighbor_addpath_tx_bestpath_per_as
,
5762 no_neighbor_addpath_tx_bestpath_per_as_cmd
,
5763 NO_NEIGHBOR_CMD2
"addpath-tx-bestpath-per-AS",
5767 "Use addpath to advertise the bestpath per each neighboring AS\n")
5769 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5770 bgp_node_safi (vty
),
5771 PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS
);
5775 /* Address family configuration. */
5776 DEFUN (address_family_ipv4
,
5777 address_family_ipv4_cmd
,
5778 "address-family ipv4",
5779 "Enter Address Family command mode\n"
5782 vty
->node
= BGP_IPV4_NODE
;
5786 DEFUN (address_family_ipv4_safi
,
5787 address_family_ipv4_safi_cmd
,
5788 "address-family ipv4 (unicast|multicast)",
5789 "Enter Address Family command mode\n"
5791 "Address Family modifier\n"
5792 "Address Family modifier\n")
5794 if (strncmp (argv
[0], "m", 1) == 0)
5795 vty
->node
= BGP_IPV4M_NODE
;
5797 vty
->node
= BGP_IPV4_NODE
;
5802 DEFUN (address_family_ipv6
,
5803 address_family_ipv6_cmd
,
5804 "address-family ipv6",
5805 "Enter Address Family command mode\n"
5808 vty
->node
= BGP_IPV6_NODE
;
5812 DEFUN (address_family_ipv6_safi
,
5813 address_family_ipv6_safi_cmd
,
5814 "address-family ipv6 (unicast|multicast)",
5815 "Enter Address Family command mode\n"
5817 "Address Family modifier\n"
5818 "Address Family modifier\n")
5820 if (strncmp (argv
[0], "m", 1) == 0)
5821 vty
->node
= BGP_IPV6M_NODE
;
5823 vty
->node
= BGP_IPV6_NODE
;
5828 DEFUN (address_family_vpnv4
,
5829 address_family_vpnv4_cmd
,
5830 "address-family vpnv4",
5831 "Enter Address Family command mode\n"
5834 vty
->node
= BGP_VPNV4_NODE
;
5838 ALIAS (address_family_vpnv4
,
5839 address_family_vpnv4_unicast_cmd
,
5840 "address-family vpnv4 unicast",
5841 "Enter Address Family command mode\n"
5843 "Address Family Modifier\n")
5845 DEFUN (exit_address_family
,
5846 exit_address_family_cmd
,
5847 "exit-address-family",
5848 "Exit from Address Family configuration mode\n")
5850 if (vty
->node
== BGP_IPV4_NODE
5851 || vty
->node
== BGP_IPV4M_NODE
5852 || vty
->node
== BGP_VPNV4_NODE
5853 || vty
->node
== BGP_IPV6_NODE
5854 || vty
->node
== BGP_IPV6M_NODE
)
5855 vty
->node
= BGP_NODE
;
5859 /* Recalculate bestpath and re-advertise a prefix */
5861 bgp_clear_prefix (struct vty
*vty
, const char *view_name
, const char *ip_str
,
5862 afi_t afi
, safi_t safi
, struct prefix_rd
*prd
)
5865 struct prefix match
;
5866 struct bgp_node
*rn
;
5867 struct bgp_node
*rm
;
5869 struct bgp_table
*table
;
5870 struct bgp_table
*rib
;
5872 /* BGP structure lookup. */
5875 bgp
= bgp_lookup_by_name (view_name
);
5878 vty_out (vty
, "%% Can't find BGP instance %s%s", view_name
, VTY_NEWLINE
);
5884 bgp
= bgp_get_default ();
5887 vty_out (vty
, "%% No BGP process is configured%s", VTY_NEWLINE
);
5892 /* Check IP address argument. */
5893 ret
= str2prefix (ip_str
, &match
);
5896 vty_out (vty
, "%% address is malformed%s", VTY_NEWLINE
);
5900 match
.family
= afi2family (afi
);
5901 rib
= bgp
->rib
[afi
][safi
];
5903 if (safi
== SAFI_MPLS_VPN
)
5905 for (rn
= bgp_table_top (rib
); rn
; rn
= bgp_route_next (rn
))
5907 if (prd
&& memcmp (rn
->p
.u
.val
, prd
->val
, 8) != 0)
5910 if ((table
= rn
->info
) != NULL
)
5912 if ((rm
= bgp_node_match (table
, &match
)) != NULL
)
5914 if (rm
->p
.prefixlen
== match
.prefixlen
)
5916 SET_FLAG (rn
->flags
, BGP_NODE_USER_CLEAR
);
5917 bgp_process (bgp
, rm
, afi
, safi
);
5919 bgp_unlock_node (rm
);
5926 if ((rn
= bgp_node_match (rib
, &match
)) != NULL
)
5928 if (rn
->p
.prefixlen
== match
.prefixlen
)
5930 SET_FLAG (rn
->flags
, BGP_NODE_USER_CLEAR
);
5931 bgp_process (bgp
, rn
, afi
, safi
);
5933 bgp_unlock_node (rn
);
5940 DEFUN (clear_ip_bgp_all
,
5941 clear_ip_bgp_all_cmd
,
5946 "Clear all peers\n")
5949 return bgp_clear_vty (vty
, argv
[1], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
5951 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
5954 ALIAS (clear_ip_bgp_all
,
5955 clear_ip_bgp_instance_all_cmd
,
5956 "clear ip bgp " BGP_INSTANCE_CMD
" *",
5960 BGP_INSTANCE_HELP_STR
5961 "Clear all peers\n")
5963 ALIAS (clear_ip_bgp_all
,
5968 "Clear all peers\n")
5970 ALIAS (clear_ip_bgp_all
,
5971 clear_bgp_instance_all_cmd
,
5972 "clear bgp " BGP_INSTANCE_CMD
" *",
5975 BGP_INSTANCE_HELP_STR
5976 "Clear all peers\n")
5978 ALIAS (clear_ip_bgp_all
,
5979 clear_bgp_ipv6_all_cmd
,
5984 "Clear all peers\n")
5986 ALIAS (clear_ip_bgp_all
,
5987 clear_bgp_instance_ipv6_all_cmd
,
5988 "clear bgp " BGP_INSTANCE_CMD
" ipv6 *",
5991 BGP_INSTANCE_HELP_STR
5993 "Clear all peers\n")
5995 DEFUN (clear_ip_bgp_peer
,
5996 clear_ip_bgp_peer_cmd
,
5997 "clear ip bgp (A.B.C.D|X:X::X:X|WORD)",
6001 "BGP neighbor IP address to clear\n"
6002 "BGP IPv6 neighbor to clear\n"
6003 "BGP neighbor on interface to clear\n")
6006 return bgp_clear_vty (vty
, argv
[1], 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[2]);
6008 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
6011 ALIAS (clear_ip_bgp_peer
,
6012 clear_ip_bgp_instance_peer_cmd
,
6013 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD)",
6017 BGP_INSTANCE_HELP_STR
6018 "BGP neighbor IP address to clear\n"
6019 "BGP IPv6 neighbor to clear\n"
6020 "BGP neighbor on interface to clear\n")
6022 ALIAS (clear_ip_bgp_peer
,
6024 "clear bgp (A.B.C.D|X:X::X:X|WORD)",
6027 "BGP neighbor address to clear\n"
6028 "BGP IPv6 neighbor to clear\n"
6029 "BGP neighbor on interface to clear\n")
6031 ALIAS (clear_ip_bgp_peer
,
6032 clear_bgp_instance_peer_cmd
,
6033 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD)",
6036 BGP_INSTANCE_HELP_STR
6037 "BGP neighbor IP address to clear\n"
6038 "BGP IPv6 neighbor to clear\n"
6039 "BGP neighbor on interface to clear\n")
6041 ALIAS (clear_ip_bgp_peer
,
6042 clear_bgp_ipv6_peer_cmd
,
6043 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD)",
6047 "BGP neighbor address to clear\n"
6048 "BGP IPv6 neighbor to clear\n"
6049 "BGP neighbor on interface to clear\n")
6051 ALIAS (clear_ip_bgp_peer
,
6052 clear_bgp_instance_ipv6_peer_cmd
,
6053 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD)",
6056 BGP_INSTANCE_HELP_STR
6058 "BGP neighbor IP address to clear\n"
6059 "BGP IPv6 neighbor to clear\n"
6060 "BGP neighbor on interface to clear\n")
6062 DEFUN (clear_ip_bgp_peer_group
,
6063 clear_ip_bgp_peer_group_cmd
,
6064 "clear ip bgp peer-group WORD",
6068 "Clear all members of peer-group\n"
6069 "BGP peer-group name\n")
6072 return bgp_clear_vty (vty
, argv
[1], 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[2]);
6074 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
6077 ALIAS (clear_ip_bgp_peer_group
,
6078 clear_ip_bgp_instance_peer_group_cmd
,
6079 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD",
6083 BGP_INSTANCE_HELP_STR
6084 "Clear all members of peer-group\n"
6085 "BGP peer-group name\n")
6087 ALIAS (clear_ip_bgp_peer_group
,
6088 clear_bgp_peer_group_cmd
,
6089 "clear bgp peer-group WORD",
6092 "Clear all members of peer-group\n"
6093 "BGP peer-group name\n")
6095 ALIAS (clear_ip_bgp_peer_group
,
6096 clear_bgp_instance_peer_group_cmd
,
6097 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD",
6100 BGP_INSTANCE_HELP_STR
6101 "Clear all members of peer-group\n"
6102 "BGP peer-group name\n")
6104 ALIAS (clear_ip_bgp_peer_group
,
6105 clear_bgp_ipv6_peer_group_cmd
,
6106 "clear bgp ipv6 peer-group WORD",
6110 "Clear all members of peer-group\n"
6111 "BGP peer-group name\n")
6113 ALIAS (clear_ip_bgp_peer_group
,
6114 clear_bgp_instance_ipv6_peer_group_cmd
,
6115 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD",
6118 BGP_INSTANCE_HELP_STR
6120 "Clear all members of peer-group\n"
6121 "BGP peer-group name\n")
6123 DEFUN (clear_ip_bgp_external
,
6124 clear_ip_bgp_external_cmd
,
6125 "clear ip bgp external",
6129 "Clear all external peers\n")
6132 return bgp_clear_vty (vty
, argv
[1], 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
6134 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
6137 ALIAS (clear_ip_bgp_external
,
6138 clear_ip_bgp_instance_external_cmd
,
6139 "clear ip bgp " BGP_INSTANCE_CMD
" external",
6143 BGP_INSTANCE_HELP_STR
6144 "Clear all external peers\n")
6146 ALIAS (clear_ip_bgp_external
,
6147 clear_bgp_external_cmd
,
6148 "clear bgp external",
6151 "Clear all external peers\n")
6153 ALIAS (clear_ip_bgp_external
,
6154 clear_bgp_instance_external_cmd
,
6155 "clear bgp " BGP_INSTANCE_CMD
" external",
6158 BGP_INSTANCE_HELP_STR
6159 "Clear all external peers\n")
6161 ALIAS (clear_ip_bgp_external
,
6162 clear_bgp_ipv6_external_cmd
,
6163 "clear bgp ipv6 external",
6167 "Clear all external peers\n")
6169 ALIAS (clear_ip_bgp_external
,
6170 clear_bgp_instance_ipv6_external_cmd
,
6171 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external",
6174 BGP_INSTANCE_HELP_STR
6176 "Clear all external peers\n")
6178 DEFUN (clear_ip_bgp_prefix
,
6179 clear_ip_bgp_prefix_cmd
,
6180 "clear ip bgp prefix A.B.C.D/M",
6184 "Clear bestpath and re-advertise\n"
6185 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
6188 return bgp_clear_prefix (vty
, argv
[1], argv
[2], AFI_IP
, SAFI_UNICAST
, NULL
);
6190 return bgp_clear_prefix (vty
, NULL
, argv
[0], AFI_IP
, SAFI_UNICAST
, NULL
);
6193 ALIAS (clear_ip_bgp_prefix
,
6194 clear_ip_bgp_instance_prefix_cmd
,
6195 "clear ip bgp " BGP_INSTANCE_CMD
" prefix A.B.C.D/M",
6199 BGP_INSTANCE_HELP_STR
6200 "Clear bestpath and re-advertise\n"
6201 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
6203 ALIAS (clear_ip_bgp_prefix
,
6204 clear_bgp_prefix_cmd
,
6205 "clear bgp prefix A.B.C.D/M",
6208 "Clear bestpath and re-advertise\n"
6209 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
6211 ALIAS (clear_ip_bgp_prefix
,
6212 clear_bgp_instance_prefix_cmd
,
6213 "clear bgp " BGP_INSTANCE_CMD
" prefix A.B.C.D/M",
6216 BGP_INSTANCE_HELP_STR
6217 "Clear bestpath and re-advertise\n"
6218 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
6220 DEFUN (clear_ip_bgp_as
,
6221 clear_ip_bgp_as_cmd
,
6222 "clear ip bgp " CMD_AS_RANGE
,
6226 "Clear peers with the AS number\n")
6229 return bgp_clear_vty (vty
, argv
[1], 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[2]);
6231 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
6234 ALIAS (clear_ip_bgp_as
,
6235 clear_ip_bgp_instance_as_cmd
,
6236 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
,
6240 BGP_INSTANCE_HELP_STR
6241 "Clear peers with the AS number\n")
6243 ALIAS (clear_ip_bgp_as
,
6245 "clear bgp " CMD_AS_RANGE
,
6248 "Clear peers with the AS number\n")
6250 ALIAS (clear_ip_bgp_as
,
6251 clear_bgp_instance_as_cmd
,
6252 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
,
6255 BGP_INSTANCE_HELP_STR
6256 "Clear peers with the AS number\n")
6258 ALIAS (clear_ip_bgp_as
,
6259 clear_bgp_ipv6_as_cmd
,
6260 "clear bgp ipv6 " CMD_AS_RANGE
,
6264 "Clear peers with the AS number\n")
6266 ALIAS (clear_ip_bgp_as
,
6267 clear_bgp_instance_ipv6_as_cmd
,
6268 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
,
6271 BGP_INSTANCE_HELP_STR
6273 "Clear peers with the AS number\n")
6275 /* Outbound soft-reconfiguration */
6276 DEFUN (clear_ip_bgp_all_soft_out
,
6277 clear_ip_bgp_all_soft_out_cmd
,
6278 "clear ip bgp * soft out",
6287 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_all
,
6288 BGP_CLEAR_SOFT_OUT
, NULL
);
6290 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6291 BGP_CLEAR_SOFT_OUT
, NULL
);
6294 ALIAS (clear_ip_bgp_all_soft_out
,
6295 clear_ip_bgp_instance_all_soft_out_cmd
,
6296 "clear ip bgp " BGP_INSTANCE_CMD
" * soft out",
6300 BGP_INSTANCE_HELP_STR
6305 ALIAS (clear_ip_bgp_all_soft_out
,
6306 clear_ip_bgp_all_out_cmd
,
6307 "clear ip bgp * out",
6314 ALIAS (clear_ip_bgp_all_soft_out
,
6315 clear_ip_bgp_instance_all_out_cmd
,
6316 "clear ip bgp " BGP_INSTANCE_CMD
" * out",
6320 BGP_INSTANCE_HELP_STR
6324 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
6325 clear_ip_bgp_all_ipv4_soft_out_cmd
,
6326 "clear ip bgp * ipv4 (unicast|multicast) soft out",
6332 "Address Family modifier\n"
6333 "Address Family modifier\n"
6337 if (strncmp (argv
[0], "m", 1) == 0)
6338 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6339 BGP_CLEAR_SOFT_OUT
, NULL
);
6341 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6342 BGP_CLEAR_SOFT_OUT
, NULL
);
6345 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
6346 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
6347 "clear ip bgp " BGP_INSTANCE_CMD
" * ipv4 (unicast|multicast) soft out",
6351 BGP_INSTANCE_HELP_STR
6354 "Address Family modifier\n"
6355 "Address Family modifier\n"
6358 if (strncmp (argv
[2], "m", 1) == 0)
6359 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_all
,
6360 BGP_CLEAR_SOFT_OUT
, NULL
);
6362 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6363 BGP_CLEAR_SOFT_OUT
, NULL
);
6366 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
6367 clear_ip_bgp_all_ipv4_out_cmd
,
6368 "clear ip bgp * ipv4 (unicast|multicast) out",
6374 "Address Family modifier\n"
6375 "Address Family modifier\n"
6378 ALIAS (clear_ip_bgp_instance_all_ipv4_soft_out
,
6379 clear_ip_bgp_instance_all_ipv4_out_cmd
,
6380 "clear ip bgp " BGP_INSTANCE_CMD
" * ipv4 (unicast|multicast) out",
6384 BGP_INSTANCE_HELP_STR
6387 "Address Family modifier\n"
6388 "Address Family modifier\n"
6391 DEFUN (clear_ip_bgp_all_vpnv4_soft_out
,
6392 clear_ip_bgp_all_vpnv4_soft_out_cmd
,
6393 "clear ip bgp * vpnv4 unicast soft out",
6399 "Address Family Modifier\n"
6403 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
6404 BGP_CLEAR_SOFT_OUT
, NULL
);
6407 ALIAS (clear_ip_bgp_all_vpnv4_soft_out
,
6408 clear_ip_bgp_all_vpnv4_out_cmd
,
6409 "clear ip bgp * vpnv4 unicast out",
6415 "Address Family Modifier\n"
6418 DEFUN (clear_bgp_all_soft_out
,
6419 clear_bgp_all_soft_out_cmd
,
6420 "clear bgp * soft out",
6428 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6429 BGP_CLEAR_SOFT_OUT
, NULL
);
6431 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6432 BGP_CLEAR_SOFT_OUT
, NULL
);
6435 ALIAS (clear_bgp_all_soft_out
,
6436 clear_bgp_instance_all_soft_out_cmd
,
6437 "clear bgp " BGP_INSTANCE_CMD
" * soft out",
6440 BGP_INSTANCE_HELP_STR
6445 ALIAS (clear_bgp_all_soft_out
,
6446 clear_bgp_all_out_cmd
,
6453 ALIAS (clear_bgp_all_soft_out
,
6454 clear_bgp_instance_all_out_cmd
,
6455 "clear bgp " BGP_INSTANCE_CMD
" * out",
6458 BGP_INSTANCE_HELP_STR
6462 ALIAS (clear_bgp_all_soft_out
,
6463 clear_bgp_ipv6_all_soft_out_cmd
,
6464 "clear bgp ipv6 * soft out",
6472 ALIAS (clear_bgp_all_soft_out
,
6473 clear_bgp_instance_ipv6_all_soft_out_cmd
,
6474 "clear bgp " BGP_INSTANCE_CMD
" ipv6 * soft out",
6477 BGP_INSTANCE_HELP_STR
6483 ALIAS (clear_bgp_all_soft_out
,
6484 clear_bgp_ipv6_all_out_cmd
,
6485 "clear bgp ipv6 * out",
6492 ALIAS (clear_bgp_all_soft_out
,
6493 clear_bgp_instance_ipv6_all_out_cmd
,
6494 "clear bgp " BGP_INSTANCE_CMD
" ipv6 * out",
6497 BGP_INSTANCE_HELP_STR
6502 DEFUN (clear_bgp_ipv6_safi_prefix
,
6503 clear_bgp_ipv6_safi_prefix_cmd
,
6504 "clear bgp ipv6 (unicast|multicast) prefix X:X::X:X/M",
6508 "Address Family Modifier\n"
6509 "Clear bestpath and re-advertise\n"
6510 "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
6512 if (strncmp (argv
[0], "m", 1) == 0)
6513 return bgp_clear_prefix (vty
, NULL
, argv
[1], AFI_IP6
, SAFI_MULTICAST
, NULL
);
6515 return bgp_clear_prefix (vty
, NULL
, argv
[1], AFI_IP6
, SAFI_UNICAST
, NULL
);
6518 DEFUN (clear_bgp_instance_ipv6_safi_prefix
,
6519 clear_bgp_instance_ipv6_safi_prefix_cmd
,
6520 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (unicast|multicast) prefix X:X::X:X/M",
6523 BGP_INSTANCE_HELP_STR
6525 "Address Family Modifier\n"
6526 "Clear bestpath and re-advertise\n"
6527 "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
6529 if (strncmp (argv
[2], "m", 1) == 0)
6530 return bgp_clear_prefix (vty
, argv
[1], argv
[3], AFI_IP6
, SAFI_MULTICAST
, NULL
);
6532 return bgp_clear_prefix (vty
, argv
[1], argv
[3], AFI_IP6
, SAFI_UNICAST
, NULL
);
6535 DEFUN (clear_ip_bgp_peer_soft_out
,
6536 clear_ip_bgp_peer_soft_out_cmd
,
6537 "clear ip bgp (A.B.C.D|WORD) soft out",
6541 "BGP neighbor address to clear\n"
6542 "BGP neighbor on interface to clear\n"
6547 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_peer
,
6548 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6550 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6551 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6554 ALIAS (clear_ip_bgp_peer_soft_out
,
6555 clear_ip_bgp_instance_peer_soft_out_cmd
,
6556 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) soft out",
6560 BGP_INSTANCE_HELP_STR
6561 "BGP neighbor address to clear\n"
6562 "BGP neighbor on interface to clear\n"
6566 ALIAS (clear_ip_bgp_peer_soft_out
,
6567 clear_ip_bgp_peer_out_cmd
,
6568 "clear ip bgp (A.B.C.D|WORD) out",
6572 "BGP neighbor address to clear\n"
6573 "BGP neighbor on interface to clear\n"
6576 ALIAS (clear_ip_bgp_peer_soft_out
,
6577 clear_ip_bgp_instance_peer_out_cmd
,
6578 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) out",
6582 BGP_INSTANCE_HELP_STR
6583 "BGP neighbor address to clear\n"
6584 "BGP neighbor on interface to clear\n"
6587 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
6588 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
6589 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) soft out",
6593 "BGP neighbor address to clear\n"
6594 "BGP neighbor on interface to clear\n"
6596 "Address Family modifier\n"
6597 "Address Family modifier\n"
6601 if (strncmp (argv
[1], "m", 1) == 0)
6602 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
6603 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6605 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6606 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6609 DEFUN (clear_ip_bgp_instance_peer_ipv4_soft_out
,
6610 clear_ip_bgp_instance_peer_ipv4_soft_out_cmd
,
6611 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) ipv4 (unicast|multicast) soft out",
6615 BGP_INSTANCE_HELP_STR
6616 "BGP neighbor address to clear\n"
6617 "BGP neighbor on interface to clear\n"
6619 "Address Family modifier\n"
6620 "Address Family modifier\n"
6624 if (strncmp (argv
[3], "m", 1) == 0)
6625 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_peer
,
6626 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6628 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_peer
,
6629 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6632 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
6633 clear_ip_bgp_peer_ipv4_out_cmd
,
6634 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) out",
6638 "BGP neighbor address to clear\n"
6639 "BGP neighbor on interface to clear\n"
6641 "Address Family modifier\n"
6642 "Address Family modifier\n"
6645 ALIAS (clear_ip_bgp_instance_peer_ipv4_soft_out
,
6646 clear_ip_bgp_instance_peer_ipv4_out_cmd
,
6647 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) ipv4 (unicast|multicast) out",
6651 BGP_INSTANCE_HELP_STR
6652 "BGP neighbor address to clear\n"
6653 "BGP neighbor on interface to clear\n"
6655 "Address Family modifier\n"
6656 "Address Family modifier\n"
6659 /* NOTE: WORD peers have not been tested for vpnv4 */
6660 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out
,
6661 clear_ip_bgp_peer_vpnv4_soft_out_cmd
,
6662 "clear ip bgp (A.B.C.D|WORD) vpnv4 unicast soft out",
6666 "BGP neighbor address to clear\n"
6667 "BGP neighbor on interface to clear\n"
6669 "Address Family Modifier\n"
6673 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
6674 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6677 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out
,
6678 clear_ip_bgp_peer_vpnv4_out_cmd
,
6679 "clear ip bgp (A.B.C.D|WORD) vpnv4 unicast out",
6683 "BGP neighbor address to clear\n"
6684 "BGP neighbor on interface to clear\n"
6686 "Address Family Modifier\n"
6689 DEFUN (clear_bgp_peer_soft_out
,
6690 clear_bgp_peer_soft_out_cmd
,
6691 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft out",
6694 "BGP neighbor address to clear\n"
6695 "BGP IPv6 neighbor to clear\n"
6696 "BGP neighbor on interface to clear\n"
6701 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6702 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6704 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6705 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6708 ALIAS (clear_bgp_peer_soft_out
,
6709 clear_bgp_instance_peer_soft_out_cmd
,
6710 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD) soft out",
6713 BGP_INSTANCE_HELP_STR
6714 "BGP neighbor address to clear\n"
6715 "BGP IPv6 neighbor to clear\n"
6716 "BGP neighbor on interface to clear\n"
6720 ALIAS (clear_bgp_peer_soft_out
,
6721 clear_bgp_ipv6_peer_soft_out_cmd
,
6722 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft out",
6726 "BGP neighbor address to clear\n"
6727 "BGP IPv6 neighbor to clear\n"
6728 "BGP neighbor on interface to clear\n"
6732 ALIAS (clear_bgp_peer_soft_out
,
6733 clear_bgp_instance_ipv6_peer_soft_out_cmd
,
6734 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD) soft out",
6737 BGP_INSTANCE_HELP_STR
6739 "BGP neighbor address to clear\n"
6740 "BGP IPv6 neighbor to clear\n"
6741 "BGP neighbor on interface to clear\n"
6745 ALIAS (clear_bgp_peer_soft_out
,
6746 clear_bgp_peer_out_cmd
,
6747 "clear bgp (A.B.C.D|X:X::X:X|WORD) out",
6750 "BGP neighbor address to clear\n"
6751 "BGP IPv6 neighbor to clear\n"
6752 "BGP neighbor on interface to clear\n"
6755 ALIAS (clear_bgp_peer_soft_out
,
6756 clear_bgp_instance_peer_out_cmd
,
6757 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD) out",
6760 BGP_INSTANCE_HELP_STR
6761 "BGP neighbor address to clear\n"
6762 "BGP IPv6 neighbor to clear\n"
6763 "BGP neighbor on interface to clear\n"
6766 ALIAS (clear_bgp_peer_soft_out
,
6767 clear_bgp_ipv6_peer_out_cmd
,
6768 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) out",
6772 "BGP neighbor address to clear\n"
6773 "BGP IPv6 neighbor to clear\n"
6774 "BGP neighbor on interface to clear\n"
6777 ALIAS (clear_bgp_peer_soft_out
,
6778 clear_bgp_instance_ipv6_peer_out_cmd
,
6779 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD) out",
6782 BGP_INSTANCE_HELP_STR
6784 "BGP neighbor address to clear\n"
6785 "BGP IPv6 neighbor to clear\n"
6786 "BGP neighbor on interface to clear\n"
6789 DEFUN (clear_ip_bgp_peer_group_soft_out
,
6790 clear_ip_bgp_peer_group_soft_out_cmd
,
6791 "clear ip bgp peer-group WORD soft out",
6795 "Clear all members of peer-group\n"
6796 "BGP peer-group name\n"
6801 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_group
,
6802 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6804 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6805 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6808 ALIAS (clear_ip_bgp_peer_group_soft_out
,
6809 clear_ip_bgp_instance_peer_group_soft_out_cmd
,
6810 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD soft out",
6814 BGP_INSTANCE_HELP_STR
6815 "Clear all members of peer-group\n"
6816 "BGP peer-group name\n"
6820 ALIAS (clear_ip_bgp_peer_group_soft_out
,
6821 clear_ip_bgp_peer_group_out_cmd
,
6822 "clear ip bgp peer-group WORD out",
6826 "Clear all members of peer-group\n"
6827 "BGP peer-group name\n"
6830 ALIAS (clear_ip_bgp_peer_group_soft_out
,
6831 clear_ip_bgp_instance_peer_group_out_cmd
,
6832 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD out",
6836 BGP_INSTANCE_HELP_STR
6837 "Clear all members of peer-group\n"
6838 "BGP peer-group name\n"
6841 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
6842 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
6843 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
6847 "Clear all members of peer-group\n"
6848 "BGP peer-group name\n"
6850 "Address Family modifier\n"
6851 "Address Family modifier\n"
6855 if (strncmp (argv
[1], "m", 1) == 0)
6856 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
6857 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6859 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6860 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6863 DEFUN (clear_ip_bgp_instance_peer_group_ipv4_soft_out
,
6864 clear_ip_bgp_instance_peer_group_ipv4_soft_out_cmd
,
6865 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD ipv4 (unicast|multicast) soft out",
6869 BGP_INSTANCE_HELP_STR
6870 "Clear all members of peer-group\n"
6871 "BGP peer-group name\n"
6873 "Address Family modifier\n"
6874 "Address Family modifier\n"
6878 if (strncmp (argv
[3], "m", 1) == 0)
6879 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_group
,
6880 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6882 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_group
,
6883 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6886 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
6887 clear_ip_bgp_peer_group_ipv4_out_cmd
,
6888 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
6892 "Clear all members of peer-group\n"
6893 "BGP peer-group name\n"
6895 "Address Family modifier\n"
6896 "Address Family modifier\n"
6899 ALIAS (clear_ip_bgp_instance_peer_group_ipv4_soft_out
,
6900 clear_ip_bgp_instance_peer_group_ipv4_out_cmd
,
6901 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD ipv4 (unicast|multicast) out",
6905 BGP_INSTANCE_HELP_STR
6906 "Clear all members of peer-group\n"
6907 "BGP peer-group name\n"
6909 "Address Family modifier\n"
6910 "Address Family modifier\n"
6913 DEFUN (clear_bgp_peer_group_soft_out
,
6914 clear_bgp_peer_group_soft_out_cmd
,
6915 "clear bgp peer-group WORD soft out",
6918 "Clear all members of peer-group\n"
6919 "BGP peer-group name\n"
6924 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_group
,
6925 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6927 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
6928 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6931 ALIAS (clear_bgp_peer_group_soft_out
,
6932 clear_bgp_instance_peer_group_soft_out_cmd
,
6933 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD soft out",
6936 BGP_INSTANCE_HELP_STR
6937 "Clear all members of peer-group\n"
6938 "BGP peer-group name\n"
6942 ALIAS (clear_bgp_peer_group_soft_out
,
6943 clear_bgp_ipv6_peer_group_soft_out_cmd
,
6944 "clear bgp ipv6 peer-group WORD soft out",
6948 "Clear all members of peer-group\n"
6949 "BGP peer-group name\n"
6953 ALIAS (clear_bgp_peer_group_soft_out
,
6954 clear_bgp_instance_ipv6_peer_group_soft_out_cmd
,
6955 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD soft out",
6958 BGP_INSTANCE_HELP_STR
6960 "Clear all members of peer-group\n"
6961 "BGP peer-group name\n"
6965 ALIAS (clear_bgp_peer_group_soft_out
,
6966 clear_bgp_peer_group_out_cmd
,
6967 "clear bgp peer-group WORD out",
6970 "Clear all members of peer-group\n"
6971 "BGP peer-group name\n"
6974 ALIAS (clear_bgp_peer_group_soft_out
,
6975 clear_bgp_instance_peer_group_out_cmd
,
6976 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD out",
6979 BGP_INSTANCE_HELP_STR
6980 "Clear all members of peer-group\n"
6981 "BGP peer-group name\n"
6984 ALIAS (clear_bgp_peer_group_soft_out
,
6985 clear_bgp_ipv6_peer_group_out_cmd
,
6986 "clear bgp ipv6 peer-group WORD out",
6990 "Clear all members of peer-group\n"
6991 "BGP peer-group name\n"
6994 ALIAS (clear_bgp_peer_group_soft_out
,
6995 clear_bgp_instance_ipv6_peer_group_out_cmd
,
6996 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD out",
6999 BGP_INSTANCE_HELP_STR
7001 "Clear all members of peer-group\n"
7002 "BGP peer-group name\n"
7005 DEFUN (clear_ip_bgp_external_soft_out
,
7006 clear_ip_bgp_external_soft_out_cmd
,
7007 "clear ip bgp external soft out",
7011 "Clear all external peers\n"
7016 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_external
,
7017 BGP_CLEAR_SOFT_OUT
, NULL
);
7019 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7020 BGP_CLEAR_SOFT_OUT
, NULL
);
7023 ALIAS (clear_ip_bgp_external_soft_out
,
7024 clear_ip_bgp_instance_external_soft_out_cmd
,
7025 "clear ip bgp " BGP_INSTANCE_CMD
" external soft out",
7029 BGP_INSTANCE_HELP_STR
7030 "Clear all external peers\n"
7034 ALIAS (clear_ip_bgp_external_soft_out
,
7035 clear_ip_bgp_external_out_cmd
,
7036 "clear ip bgp external out",
7040 "Clear all external peers\n"
7043 ALIAS (clear_ip_bgp_external_soft_out
,
7044 clear_ip_bgp_instance_external_out_cmd
,
7045 "clear ip bgp " BGP_INSTANCE_CMD
" external out",
7049 BGP_INSTANCE_HELP_STR
7050 "Clear all external peers\n"
7053 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
7054 clear_ip_bgp_external_ipv4_soft_out_cmd
,
7055 "clear ip bgp external ipv4 (unicast|multicast) soft out",
7059 "Clear all external peers\n"
7061 "Address Family modifier\n"
7062 "Address Family modifier\n"
7066 if (strncmp (argv
[0], "m", 1) == 0)
7067 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
7068 BGP_CLEAR_SOFT_OUT
, NULL
);
7070 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7071 BGP_CLEAR_SOFT_OUT
, NULL
);
7074 DEFUN (clear_ip_bgp_instance_external_ipv4_soft_out
,
7075 clear_ip_bgp_instance_external_ipv4_soft_out_cmd
,
7076 "clear ip bgp " BGP_INSTANCE_CMD
" external ipv4 (unicast|multicast) soft out",
7080 BGP_INSTANCE_HELP_STR
7081 "Clear all external peers\n"
7083 "Address Family modifier\n"
7084 "Address Family modifier\n"
7088 if (strncmp (argv
[2], "m", 1) == 0)
7089 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_external
,
7090 BGP_CLEAR_SOFT_OUT
, NULL
);
7092 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_external
,
7093 BGP_CLEAR_SOFT_OUT
, NULL
);
7096 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
7097 clear_ip_bgp_external_ipv4_out_cmd
,
7098 "clear ip bgp external ipv4 (unicast|multicast) out",
7102 "Clear all external peers\n"
7104 "Address Family modifier\n"
7105 "Address Family modifier\n"
7108 ALIAS (clear_ip_bgp_instance_external_ipv4_soft_out
,
7109 clear_ip_bgp_instance_external_ipv4_out_cmd
,
7110 "clear ip bgp " BGP_INSTANCE_CMD
" external ipv4 (unicast|multicast) out",
7114 BGP_INSTANCE_HELP_STR
7115 "Clear all external peers\n"
7117 "Address Family modifier\n"
7118 "Address Family modifier\n"
7121 DEFUN (clear_bgp_external_soft_out
,
7122 clear_bgp_external_soft_out_cmd
,
7123 "clear bgp external soft out",
7126 "Clear all external peers\n"
7131 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_external
,
7132 BGP_CLEAR_SOFT_OUT
, NULL
);
7134 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
7135 BGP_CLEAR_SOFT_OUT
, NULL
);
7138 ALIAS (clear_bgp_external_soft_out
,
7139 clear_bgp_instance_external_soft_out_cmd
,
7140 "clear bgp " BGP_INSTANCE_CMD
" external soft out",
7143 BGP_INSTANCE_HELP_STR
7144 "Clear all external peers\n"
7148 ALIAS (clear_bgp_external_soft_out
,
7149 clear_bgp_ipv6_external_soft_out_cmd
,
7150 "clear bgp ipv6 external soft out",
7154 "Clear all external peers\n"
7158 ALIAS (clear_bgp_external_soft_out
,
7159 clear_bgp_instance_ipv6_external_soft_out_cmd
,
7160 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external soft out",
7163 BGP_INSTANCE_HELP_STR
7165 "Clear all external peers\n"
7169 ALIAS (clear_bgp_external_soft_out
,
7170 clear_bgp_external_out_cmd
,
7171 "clear bgp external out",
7174 "Clear all external peers\n"
7177 ALIAS (clear_bgp_external_soft_out
,
7178 clear_bgp_instance_external_out_cmd
,
7179 "clear bgp " BGP_INSTANCE_CMD
" external out",
7182 BGP_INSTANCE_HELP_STR
7183 "Clear all external peers\n"
7186 ALIAS (clear_bgp_external_soft_out
,
7187 clear_bgp_ipv6_external_out_cmd
,
7188 "clear bgp ipv6 external WORD out",
7192 "Clear all external peers\n"
7195 ALIAS (clear_bgp_external_soft_out
,
7196 clear_bgp_instance_ipv6_external_out_cmd
,
7197 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external WORD out",
7200 BGP_INSTANCE_HELP_STR
7202 "Clear all external peers\n"
7205 DEFUN (clear_ip_bgp_as_soft_out
,
7206 clear_ip_bgp_as_soft_out_cmd
,
7207 "clear ip bgp " CMD_AS_RANGE
" soft out",
7211 "Clear peers with the AS number\n"
7216 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_as
,
7217 BGP_CLEAR_SOFT_OUT
, argv
[2]);
7219 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7220 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7223 ALIAS (clear_ip_bgp_as_soft_out
,
7224 clear_ip_bgp_instance_as_soft_out_cmd
,
7225 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft out",
7229 BGP_INSTANCE_HELP_STR
7230 "Clear peers with the AS number\n"
7234 ALIAS (clear_ip_bgp_as_soft_out
,
7235 clear_ip_bgp_as_out_cmd
,
7236 "clear ip bgp " CMD_AS_RANGE
" out",
7240 "Clear peers with the AS number\n"
7243 ALIAS (clear_ip_bgp_as_soft_out
,
7244 clear_ip_bgp_instance_as_out_cmd
,
7245 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" out",
7249 BGP_INSTANCE_HELP_STR
7250 "Clear peers with the AS number\n"
7253 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
7254 clear_ip_bgp_as_ipv4_soft_out_cmd
,
7255 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft out",
7259 "Clear peers with the AS number\n"
7261 "Address Family modifier\n"
7262 "Address Family modifier\n"
7266 if (strncmp (argv
[1], "m", 1) == 0)
7267 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
7268 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7270 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7271 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7274 DEFUN (clear_ip_bgp_instance_as_ipv4_soft_out
,
7275 clear_ip_bgp_instance_as_ipv4_soft_out_cmd
,
7276 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft out",
7280 BGP_INSTANCE_HELP_STR
7281 "Clear peers with the AS number\n"
7283 "Address Family modifier\n"
7284 "Address Family modifier\n"
7288 if (strncmp (argv
[3], "m", 1) == 0)
7289 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_as
,
7290 BGP_CLEAR_SOFT_OUT
, argv
[2]);
7292 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_as
,
7293 BGP_CLEAR_SOFT_OUT
, argv
[2]);
7296 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
7297 clear_ip_bgp_as_ipv4_out_cmd
,
7298 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) out",
7302 "Clear peers with the AS number\n"
7304 "Address Family modifier\n"
7305 "Address Family modifier\n"
7308 ALIAS (clear_ip_bgp_instance_as_ipv4_soft_out
,
7309 clear_ip_bgp_instance_as_ipv4_out_cmd
,
7310 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" ipv4 (unicast|multicast) out",
7314 BGP_INSTANCE_HELP_STR
7315 "Clear peers with the AS number\n"
7317 "Address Family modifier\n"
7318 "Address Family modifier\n"
7321 DEFUN (clear_ip_bgp_as_vpnv4_soft_out
,
7322 clear_ip_bgp_as_vpnv4_soft_out_cmd
,
7323 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft out",
7327 "Clear peers with the AS number\n"
7329 "Address Family modifier\n"
7333 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
7334 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7337 ALIAS (clear_ip_bgp_as_vpnv4_soft_out
,
7338 clear_ip_bgp_as_vpnv4_out_cmd
,
7339 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast out",
7343 "Clear peers with the AS number\n"
7345 "Address Family modifier\n"
7348 DEFUN (clear_bgp_as_soft_out
,
7349 clear_bgp_as_soft_out_cmd
,
7350 "clear bgp " CMD_AS_RANGE
" soft out",
7353 "Clear peers with the AS number\n"
7358 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_as
,
7359 BGP_CLEAR_SOFT_OUT
, argv
[2]);
7361 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
7362 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7365 ALIAS (clear_bgp_as_soft_out
,
7366 clear_bgp_instance_as_soft_out_cmd
,
7367 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft out",
7370 BGP_INSTANCE_HELP_STR
7371 "Clear peers with the AS number\n"
7375 ALIAS (clear_bgp_as_soft_out
,
7376 clear_bgp_ipv6_as_soft_out_cmd
,
7377 "clear bgp ipv6 " CMD_AS_RANGE
" soft out",
7381 "Clear peers with the AS number\n"
7385 ALIAS (clear_bgp_as_soft_out
,
7386 clear_bgp_instance_ipv6_as_soft_out_cmd
,
7387 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
" soft out",
7390 BGP_INSTANCE_HELP_STR
7392 "Clear peers with the AS number\n"
7396 ALIAS (clear_bgp_as_soft_out
,
7397 clear_bgp_as_out_cmd
,
7398 "clear bgp " CMD_AS_RANGE
" out",
7401 "Clear peers with the AS number\n"
7404 ALIAS (clear_bgp_as_soft_out
,
7405 clear_bgp_instance_as_out_cmd
,
7406 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" out",
7409 BGP_INSTANCE_HELP_STR
7410 "Clear peers with the AS number\n"
7413 ALIAS (clear_bgp_as_soft_out
,
7414 clear_bgp_ipv6_as_out_cmd
,
7415 "clear bgp ipv6 " CMD_AS_RANGE
" out",
7419 "Clear peers with the AS number\n"
7422 ALIAS (clear_bgp_as_soft_out
,
7423 clear_bgp_instance_ipv6_as_out_cmd
,
7424 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
" out",
7427 BGP_INSTANCE_HELP_STR
7429 "Clear peers with the AS number\n"
7432 /* Inbound soft-reconfiguration */
7433 DEFUN (clear_ip_bgp_all_soft_in
,
7434 clear_ip_bgp_all_soft_in_cmd
,
7435 "clear ip bgp * soft in",
7444 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_all
,
7445 BGP_CLEAR_SOFT_IN
, NULL
);
7447 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7448 BGP_CLEAR_SOFT_IN
, NULL
);
7451 ALIAS (clear_ip_bgp_all_soft_in
,
7452 clear_ip_bgp_instance_all_soft_in_cmd
,
7453 "clear ip bgp " BGP_INSTANCE_CMD
" * soft in",
7457 BGP_INSTANCE_HELP_STR
7462 ALIAS (clear_ip_bgp_all_soft_in
,
7463 clear_ip_bgp_all_in_cmd
,
7464 "clear ip bgp * in",
7471 ALIAS (clear_ip_bgp_all_soft_in
,
7472 clear_ip_bgp_instance_all_in_cmd
,
7473 "clear ip bgp " BGP_INSTANCE_CMD
" * in",
7477 BGP_INSTANCE_HELP_STR
7481 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
7482 clear_ip_bgp_all_in_prefix_filter_cmd
,
7483 "clear ip bgp * in prefix-filter",
7489 "Push out prefix-list ORF and do inbound soft reconfig\n")
7492 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_all
,
7493 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7495 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7496 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7499 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
7500 clear_ip_bgp_all_ipv4_soft_in_cmd
,
7501 "clear ip bgp * ipv4 (unicast|multicast) soft in",
7507 "Address Family modifier\n"
7508 "Address Family modifier\n"
7512 if (strncmp (argv
[0], "m", 1) == 0)
7513 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
7514 BGP_CLEAR_SOFT_IN
, NULL
);
7516 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7517 BGP_CLEAR_SOFT_IN
, NULL
);
7520 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
7521 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
7522 "clear ip bgp " BGP_INSTANCE_CMD
" * ipv4 (unicast|multicast) soft in",
7526 BGP_INSTANCE_HELP_STR
7529 "Address Family modifier\n"
7530 "Address Family modifier\n"
7534 if (strncmp (argv
[2], "m", 1) == 0)
7535 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_all
,
7536 BGP_CLEAR_SOFT_IN
, NULL
);
7538 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_all
,
7539 BGP_CLEAR_SOFT_IN
, NULL
);
7542 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
7543 clear_ip_bgp_all_ipv4_in_cmd
,
7544 "clear ip bgp * ipv4 (unicast|multicast) in",
7550 "Address Family modifier\n"
7551 "Address Family modifier\n"
7554 ALIAS (clear_ip_bgp_instance_all_ipv4_soft_in
,
7555 clear_ip_bgp_instance_all_ipv4_in_cmd
,
7556 "clear ip bgp " BGP_INSTANCE_CMD
" * ipv4 (unicast|multicast) in",
7560 BGP_INSTANCE_HELP_STR
7563 "Address Family modifier\n"
7564 "Address Family modifier\n"
7567 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
7568 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
7569 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
7575 "Address Family modifier\n"
7576 "Address Family modifier\n"
7578 "Push out prefix-list ORF and do inbound soft reconfig\n")
7580 if (strncmp (argv
[0], "m", 1) == 0)
7581 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
7582 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7584 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7585 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7588 DEFUN (clear_ip_bgp_all_vpnv4_soft_in
,
7589 clear_ip_bgp_all_vpnv4_soft_in_cmd
,
7590 "clear ip bgp * vpnv4 unicast soft in",
7596 "Address Family Modifier\n"
7600 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
7601 BGP_CLEAR_SOFT_IN
, NULL
);
7604 ALIAS (clear_ip_bgp_all_vpnv4_soft_in
,
7605 clear_ip_bgp_all_vpnv4_in_cmd
,
7606 "clear ip bgp * vpnv4 unicast in",
7612 "Address Family Modifier\n"
7615 DEFUN (clear_bgp_all_soft_in
,
7616 clear_bgp_all_soft_in_cmd
,
7617 "clear bgp * soft in",
7625 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_all
,
7626 BGP_CLEAR_SOFT_IN
, NULL
);
7628 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
7629 BGP_CLEAR_SOFT_IN
, NULL
);
7632 ALIAS (clear_bgp_all_soft_in
,
7633 clear_bgp_instance_all_soft_in_cmd
,
7634 "clear bgp " BGP_INSTANCE_CMD
" * soft in",
7637 BGP_INSTANCE_HELP_STR
7642 ALIAS (clear_bgp_all_soft_in
,
7643 clear_bgp_ipv6_all_soft_in_cmd
,
7644 "clear bgp ipv6 * soft in",
7652 ALIAS (clear_bgp_all_soft_in
,
7653 clear_bgp_instance_ipv6_all_soft_in_cmd
,
7654 "clear bgp " BGP_INSTANCE_CMD
" ipv6 * soft in",
7657 BGP_INSTANCE_HELP_STR
7663 ALIAS (clear_bgp_all_soft_in
,
7664 clear_bgp_all_in_cmd
,
7671 ALIAS (clear_bgp_all_soft_in
,
7672 clear_bgp_instance_all_in_cmd
,
7673 "clear bgp " BGP_INSTANCE_CMD
" * in",
7676 BGP_INSTANCE_HELP_STR
7680 ALIAS (clear_bgp_all_soft_in
,
7681 clear_bgp_ipv6_all_in_cmd
,
7682 "clear bgp ipv6 * in",
7689 ALIAS (clear_bgp_all_soft_in
,
7690 clear_bgp_instance_ipv6_all_in_cmd
,
7691 "clear bgp " BGP_INSTANCE_CMD
" ipv6 * in",
7694 BGP_INSTANCE_HELP_STR
7699 DEFUN (clear_bgp_all_in_prefix_filter
,
7700 clear_bgp_all_in_prefix_filter_cmd
,
7701 "clear bgp * in prefix-filter",
7706 "Push out prefix-list ORF and do inbound soft reconfig\n")
7708 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
7709 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7712 ALIAS (clear_bgp_all_in_prefix_filter
,
7713 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
7714 "clear bgp ipv6 * in prefix-filter",
7720 "Push out prefix-list ORF and do inbound soft reconfig\n")
7722 DEFUN (clear_ip_bgp_peer_soft_in
,
7723 clear_ip_bgp_peer_soft_in_cmd
,
7724 "clear ip bgp (A.B.C.D|WORD) soft in",
7728 "BGP neighbor address to clear\n"
7729 "BGP neighbor on interface to clear\n"
7734 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_peer
,
7735 BGP_CLEAR_SOFT_IN
, argv
[2]);
7737 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7738 BGP_CLEAR_SOFT_IN
, argv
[0]);
7741 ALIAS (clear_ip_bgp_peer_soft_in
,
7742 clear_ip_bgp_instance_peer_soft_in_cmd
,
7743 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) soft in",
7747 BGP_INSTANCE_HELP_STR
7748 "BGP neighbor address to clear\n"
7749 "BGP neighbor on interface to clear\n"
7753 ALIAS (clear_ip_bgp_peer_soft_in
,
7754 clear_ip_bgp_peer_in_cmd
,
7755 "clear ip bgp (A.B.C.D|WORD) in",
7759 "BGP neighbor address to clear\n"
7760 "BGP neighbor on interface to clear\n"
7763 ALIAS (clear_ip_bgp_peer_soft_in
,
7764 clear_ip_bgp_instance_peer_in_cmd
,
7765 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) in",
7769 BGP_INSTANCE_HELP_STR
7770 "BGP neighbor address to clear\n"
7771 "BGP neighbor on interface to clear\n"
7774 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
7775 clear_ip_bgp_peer_in_prefix_filter_cmd
,
7776 "clear ip bgp (A.B.C.D|WORD) in prefix-filter",
7780 "BGP neighbor address to clear\n"
7781 "BGP neighbor on interface to clear\n"
7783 "Push out the existing ORF prefix-list\n")
7785 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7786 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7789 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
7790 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
7791 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) soft in",
7795 "BGP neighbor address to clear\n"
7796 "BGP neighbor on interface to clear\n"
7798 "Address Family modifier\n"
7799 "Address Family modifier\n"
7803 if (strncmp (argv
[1], "m", 1) == 0)
7804 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
7805 BGP_CLEAR_SOFT_IN
, argv
[0]);
7807 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7808 BGP_CLEAR_SOFT_IN
, argv
[0]);
7811 DEFUN (clear_ip_bgp_instance_peer_ipv4_soft_in
,
7812 clear_ip_bgp_instance_peer_ipv4_soft_in_cmd
,
7813 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) ipv4 (unicast|multicast) soft in",
7817 BGP_INSTANCE_HELP_STR
7818 "BGP neighbor address to clear\n"
7819 "BGP neighbor on interface to clear\n"
7821 "Address Family modifier\n"
7822 "Address Family modifier\n"
7826 if (strncmp (argv
[3], "m", 1) == 0)
7827 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_peer
,
7828 BGP_CLEAR_SOFT_IN
, argv
[2]);
7830 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_peer
,
7831 BGP_CLEAR_SOFT_IN
, argv
[2]);
7834 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
7835 clear_ip_bgp_peer_ipv4_in_cmd
,
7836 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) in",
7840 "BGP neighbor address to clear\n"
7841 "BGP neighbor on interface to clear\n"
7843 "Address Family modifier\n"
7844 "Address Family modifier\n"
7847 ALIAS (clear_ip_bgp_instance_peer_ipv4_soft_in
,
7848 clear_ip_bgp_instance_peer_ipv4_in_cmd
,
7849 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) ipv4 (unicast|multicast) in",
7853 BGP_INSTANCE_HELP_STR
7854 "BGP neighbor address to clear\n"
7855 "BGP neighbor on interface to clear\n"
7857 "Address Family modifier\n"
7858 "Address Family modifier\n"
7861 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
7862 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
7863 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) in prefix-filter",
7867 "BGP neighbor address to clear\n"
7868 "BGP neighbor on interface to clear\n"
7870 "Address Family modifier\n"
7871 "Address Family modifier\n"
7873 "Push out the existing ORF prefix-list\n")
7875 if (strncmp (argv
[1], "m", 1) == 0)
7876 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
7877 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7879 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7880 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7883 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in
,
7884 clear_ip_bgp_peer_vpnv4_soft_in_cmd
,
7885 "clear ip bgp (A.B.C.D|WORD) vpnv4 unicast soft in",
7889 "BGP neighbor address to clear\n"
7890 "BGP neighbor on interface to clear\n"
7892 "Address Family Modifier\n"
7896 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
7897 BGP_CLEAR_SOFT_IN
, argv
[0]);
7900 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in
,
7901 clear_ip_bgp_peer_vpnv4_in_cmd
,
7902 "clear ip bgp (A.B.C.D|WORD) vpnv4 unicast in",
7906 "BGP neighbor address to clear\n"
7907 "BGP neighbor on interface to clear\n"
7909 "Address Family Modifier\n"
7912 DEFUN (clear_bgp_peer_soft_in
,
7913 clear_bgp_peer_soft_in_cmd
,
7914 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft in",
7917 "BGP neighbor address to clear\n"
7918 "BGP IPv6 neighbor to clear\n"
7919 "BGP neighbor on interface to clear\n"
7924 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
7925 BGP_CLEAR_SOFT_IN
, argv
[2]);
7927 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
7928 BGP_CLEAR_SOFT_IN
, argv
[0]);
7931 ALIAS (clear_bgp_peer_soft_in
,
7932 clear_bgp_instance_peer_soft_in_cmd
,
7933 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD) soft in",
7936 BGP_INSTANCE_HELP_STR
7937 "BGP neighbor address to clear\n"
7938 "BGP IPv6 neighbor to clear\n"
7939 "BGP neighbor on interface to clear\n"
7943 ALIAS (clear_bgp_peer_soft_in
,
7944 clear_bgp_ipv6_peer_soft_in_cmd
,
7945 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft in",
7949 "BGP neighbor address to clear\n"
7950 "BGP IPv6 neighbor to clear\n"
7951 "BGP neighbor on interface to clear\n"
7955 ALIAS (clear_bgp_peer_soft_in
,
7956 clear_bgp_instance_ipv6_peer_soft_in_cmd
,
7957 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD) soft in",
7960 BGP_INSTANCE_HELP_STR
7962 "BGP neighbor address to clear\n"
7963 "BGP IPv6 neighbor to clear\n"
7964 "BGP neighbor on interface to clear\n"
7968 ALIAS (clear_bgp_peer_soft_in
,
7969 clear_bgp_peer_in_cmd
,
7970 "clear bgp (A.B.C.D|X:X::X:X|WORD) in",
7973 "BGP neighbor address to clear\n"
7974 "BGP IPv6 neighbor to clear\n"
7975 "BGP neighbor on interface to clear\n"
7978 ALIAS (clear_bgp_peer_soft_in
,
7979 clear_bgp_instance_peer_in_cmd
,
7980 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD) in",
7983 BGP_INSTANCE_HELP_STR
7984 "BGP neighbor address to clear\n"
7985 "BGP IPv6 neighbor to clear\n"
7986 "BGP neighbor on interface to clear\n"
7989 ALIAS (clear_bgp_peer_soft_in
,
7990 clear_bgp_ipv6_peer_in_cmd
,
7991 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) in",
7995 "BGP neighbor address to clear\n"
7996 "BGP IPv6 neighbor to clear\n"
7997 "BGP neighbor on interface to clear\n"
8000 ALIAS (clear_bgp_peer_soft_in
,
8001 clear_bgp_instance_ipv6_peer_in_cmd
,
8002 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD) in",
8005 BGP_INSTANCE_HELP_STR
8007 "BGP neighbor address to clear\n"
8008 "BGP IPv6 neighbor to clear\n"
8009 "BGP neighbor on interface to clear\n"
8012 DEFUN (clear_bgp_peer_in_prefix_filter
,
8013 clear_bgp_peer_in_prefix_filter_cmd
,
8014 "clear bgp (A.B.C.D|X:X::X:X|WORD) in prefix-filter",
8017 "BGP neighbor address to clear\n"
8018 "BGP IPv6 neighbor to clear\n"
8019 "BGP neighbor on interface to clear\n"
8021 "Push out the existing ORF prefix-list\n")
8023 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
8024 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8027 ALIAS (clear_bgp_peer_in_prefix_filter
,
8028 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
8029 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) in prefix-filter",
8033 "BGP neighbor address to clear\n"
8034 "BGP IPv6 neighbor to clear\n"
8035 "BGP neighbor on interface to clear\n"
8037 "Push out the existing ORF prefix-list\n")
8039 DEFUN (clear_ip_bgp_peer_group_soft_in
,
8040 clear_ip_bgp_peer_group_soft_in_cmd
,
8041 "clear ip bgp peer-group WORD soft in",
8045 "Clear all members of peer-group\n"
8046 "BGP peer-group name\n"
8051 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_group
,
8052 BGP_CLEAR_SOFT_IN
, argv
[2]);
8054 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
8055 BGP_CLEAR_SOFT_IN
, argv
[0]);
8058 ALIAS (clear_ip_bgp_peer_group_soft_in
,
8059 clear_ip_bgp_instance_peer_group_soft_in_cmd
,
8060 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD soft in",
8064 BGP_INSTANCE_HELP_STR
8065 "Clear all members of peer-group\n"
8066 "BGP peer-group name\n"
8070 ALIAS (clear_ip_bgp_peer_group_soft_in
,
8071 clear_ip_bgp_peer_group_in_cmd
,
8072 "clear ip bgp peer-group WORD in",
8076 "Clear all members of peer-group\n"
8077 "BGP peer-group name\n"
8080 ALIAS (clear_ip_bgp_peer_group_soft_in
,
8081 clear_ip_bgp_instance_peer_group_in_cmd
,
8082 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD in",
8086 BGP_INSTANCE_HELP_STR
8087 "Clear all members of peer-group\n"
8088 "BGP peer-group name\n"
8091 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
8092 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
8093 "clear ip bgp peer-group WORD in prefix-filter",
8097 "Clear all members of peer-group\n"
8098 "BGP peer-group name\n"
8100 "Push out prefix-list ORF and do inbound soft reconfig\n")
8102 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
8103 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8106 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
8107 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
8108 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
8112 "Clear all members of peer-group\n"
8113 "BGP peer-group name\n"
8115 "Address Family modifier\n"
8116 "Address Family modifier\n"
8120 if (strncmp (argv
[1], "m", 1) == 0)
8121 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
8122 BGP_CLEAR_SOFT_IN
, argv
[0]);
8124 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
8125 BGP_CLEAR_SOFT_IN
, argv
[0]);
8128 DEFUN (clear_ip_bgp_instance_peer_group_ipv4_soft_in
,
8129 clear_ip_bgp_instance_peer_group_ipv4_soft_in_cmd
,
8130 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD ipv4 (unicast|multicast) soft in",
8134 BGP_INSTANCE_HELP_STR
8135 "Clear all members of peer-group\n"
8136 "BGP peer-group name\n"
8138 "Address Family modifier\n"
8139 "Address Family modifier\n"
8143 if (strncmp (argv
[3], "m", 1) == 0)
8144 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_group
,
8145 BGP_CLEAR_SOFT_IN
, argv
[2]);
8147 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_group
,
8148 BGP_CLEAR_SOFT_IN
, argv
[2]);
8151 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
8152 clear_ip_bgp_peer_group_ipv4_in_cmd
,
8153 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
8157 "Clear all members of peer-group\n"
8158 "BGP peer-group name\n"
8160 "Address Family modifier\n"
8161 "Address Family modifier\n"
8164 ALIAS (clear_ip_bgp_instance_peer_group_ipv4_soft_in
,
8165 clear_ip_bgp_instance_peer_group_ipv4_in_cmd
,
8166 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD ipv4 (unicast|multicast) in",
8170 BGP_INSTANCE_HELP_STR
8171 "Clear all members of peer-group\n"
8172 "BGP peer-group name\n"
8174 "Address Family modifier\n"
8175 "Address Family modifier\n"
8178 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
8179 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
8180 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
8184 "Clear all members of peer-group\n"
8185 "BGP peer-group name\n"
8187 "Address Family modifier\n"
8188 "Address Family modifier\n"
8190 "Push out prefix-list ORF and do inbound soft reconfig\n")
8192 if (strncmp (argv
[1], "m", 1) == 0)
8193 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
8194 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8196 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
8197 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8200 DEFUN (clear_bgp_peer_group_soft_in
,
8201 clear_bgp_peer_group_soft_in_cmd
,
8202 "clear bgp peer-group WORD soft in",
8205 "Clear all members of peer-group\n"
8206 "BGP peer-group name\n"
8211 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_group
,
8212 BGP_CLEAR_SOFT_IN
, argv
[2]);
8214 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
8215 BGP_CLEAR_SOFT_IN
, argv
[0]);
8218 ALIAS (clear_bgp_peer_group_soft_in
,
8219 clear_bgp_instance_peer_group_soft_in_cmd
,
8220 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD soft in",
8223 BGP_INSTANCE_HELP_STR
8224 "Clear all members of peer-group\n"
8225 "BGP peer-group name\n"
8229 ALIAS (clear_bgp_peer_group_soft_in
,
8230 clear_bgp_ipv6_peer_group_soft_in_cmd
,
8231 "clear bgp ipv6 peer-group WORD soft in",
8235 "Clear all members of peer-group\n"
8236 "BGP peer-group name\n"
8240 ALIAS (clear_bgp_peer_group_soft_in
,
8241 clear_bgp_instance_ipv6_peer_group_soft_in_cmd
,
8242 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD soft in",
8245 BGP_INSTANCE_HELP_STR
8247 "Clear all members of peer-group\n"
8248 "BGP peer-group name\n"
8252 ALIAS (clear_bgp_peer_group_soft_in
,
8253 clear_bgp_peer_group_in_cmd
,
8254 "clear bgp peer-group WORD in",
8257 "Clear all members of peer-group\n"
8258 "BGP peer-group name\n"
8261 ALIAS (clear_bgp_peer_group_soft_in
,
8262 clear_bgp_instance_peer_group_in_cmd
,
8263 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD in",
8266 BGP_INSTANCE_HELP_STR
8267 "Clear all members of peer-group\n"
8268 "BGP peer-group name\n"
8271 ALIAS (clear_bgp_peer_group_soft_in
,
8272 clear_bgp_ipv6_peer_group_in_cmd
,
8273 "clear bgp ipv6 peer-group WORD in",
8277 "Clear all members of peer-group\n"
8278 "BGP peer-group name\n"
8281 ALIAS (clear_bgp_peer_group_soft_in
,
8282 clear_bgp_instance_ipv6_peer_group_in_cmd
,
8283 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD in",
8286 BGP_INSTANCE_HELP_STR
8288 "Clear all members of peer-group\n"
8289 "BGP peer-group name\n"
8292 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
8293 clear_bgp_peer_group_in_prefix_filter_cmd
,
8294 "clear bgp peer-group WORD in prefix-filter",
8297 "Clear all members of peer-group\n"
8298 "BGP peer-group name\n"
8300 "Push out prefix-list ORF and do inbound soft reconfig\n")
8302 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
8303 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8306 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
8307 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
8308 "clear bgp ipv6 peer-group WORD in prefix-filter",
8312 "Clear all members of peer-group\n"
8313 "BGP peer-group name\n"
8315 "Push out prefix-list ORF and do inbound soft reconfig\n")
8317 DEFUN (clear_ip_bgp_external_soft_in
,
8318 clear_ip_bgp_external_soft_in_cmd
,
8319 "clear ip bgp external soft in",
8323 "Clear all external peers\n"
8328 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_external
,
8329 BGP_CLEAR_SOFT_IN
, NULL
);
8331 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
8332 BGP_CLEAR_SOFT_IN
, NULL
);
8335 ALIAS (clear_ip_bgp_external_soft_in
,
8336 clear_ip_bgp_instance_external_soft_in_cmd
,
8337 "clear ip bgp " BGP_INSTANCE_CMD
" external soft in",
8341 BGP_INSTANCE_HELP_STR
8342 "Clear all external peers\n"
8346 ALIAS (clear_ip_bgp_external_soft_in
,
8347 clear_ip_bgp_external_in_cmd
,
8348 "clear ip bgp external in",
8352 "Clear all external peers\n"
8355 ALIAS (clear_ip_bgp_external_soft_in
,
8356 clear_ip_bgp_instance_external_in_cmd
,
8357 "clear ip bgp " BGP_INSTANCE_CMD
" external in",
8361 BGP_INSTANCE_HELP_STR
8362 "Clear all external peers\n"
8365 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
8366 clear_ip_bgp_external_in_prefix_filter_cmd
,
8367 "clear ip bgp external in prefix-filter",
8371 "Clear all external peers\n"
8373 "Push out prefix-list ORF and do inbound soft reconfig\n")
8375 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
8376 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
8379 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
8380 clear_ip_bgp_external_ipv4_soft_in_cmd
,
8381 "clear ip bgp external ipv4 (unicast|multicast) soft in",
8385 "Clear all external peers\n"
8387 "Address Family modifier\n"
8388 "Address Family modifier\n"
8392 if (strncmp (argv
[0], "m", 1) == 0)
8393 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
8394 BGP_CLEAR_SOFT_IN
, NULL
);
8396 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
8397 BGP_CLEAR_SOFT_IN
, NULL
);
8400 DEFUN (clear_ip_bgp_instance_external_ipv4_soft_in
,
8401 clear_ip_bgp_instance_external_ipv4_soft_in_cmd
,
8402 "clear ip bgp " BGP_INSTANCE_CMD
" external ipv4 (unicast|multicast) soft in",
8406 BGP_INSTANCE_HELP_STR
8407 "Clear all external peers\n"
8409 "Address Family modifier\n"
8410 "Address Family modifier\n"
8414 if (strncmp (argv
[2], "m", 1) == 0)
8415 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_external
,
8416 BGP_CLEAR_SOFT_IN
, NULL
);
8418 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_external
,
8419 BGP_CLEAR_SOFT_IN
, NULL
);
8422 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
8423 clear_ip_bgp_external_ipv4_in_cmd
,
8424 "clear ip bgp external ipv4 (unicast|multicast) in",
8428 "Clear all external peers\n"
8430 "Address Family modifier\n"
8431 "Address Family modifier\n"
8434 ALIAS (clear_ip_bgp_instance_external_ipv4_soft_in
,
8435 clear_ip_bgp_instance_external_ipv4_in_cmd
,
8436 "clear ip bgp " BGP_INSTANCE_CMD
" external ipv4 (unicast|multicast) in",
8440 BGP_INSTANCE_HELP_STR
8441 "Clear all external peers\n"
8443 "Address Family modifier\n"
8444 "Address Family modifier\n"
8447 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
8448 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
8449 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
8453 "Clear all external peers\n"
8455 "Address Family modifier\n"
8456 "Address Family modifier\n"
8458 "Push out prefix-list ORF and do inbound soft reconfig\n")
8460 if (strncmp (argv
[0], "m", 1) == 0)
8461 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
8462 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
8464 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
8465 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
8468 DEFUN (clear_bgp_external_soft_in
,
8469 clear_bgp_external_soft_in_cmd
,
8470 "clear bgp external soft in",
8473 "Clear all external peers\n"
8478 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_external
,
8479 BGP_CLEAR_SOFT_IN
, NULL
);
8481 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
8482 BGP_CLEAR_SOFT_IN
, NULL
);
8485 ALIAS (clear_bgp_external_soft_in
,
8486 clear_bgp_instance_external_soft_in_cmd
,
8487 "clear bgp " BGP_INSTANCE_CMD
" external soft in",
8490 BGP_INSTANCE_HELP_STR
8491 "Clear all external peers\n"
8495 ALIAS (clear_bgp_external_soft_in
,
8496 clear_bgp_ipv6_external_soft_in_cmd
,
8497 "clear bgp ipv6 external soft in",
8501 "Clear all external peers\n"
8505 ALIAS (clear_bgp_external_soft_in
,
8506 clear_bgp_instance_ipv6_external_soft_in_cmd
,
8507 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external soft in",
8510 BGP_INSTANCE_HELP_STR
8512 "Clear all external peers\n"
8516 ALIAS (clear_bgp_external_soft_in
,
8517 clear_bgp_external_in_cmd
,
8518 "clear bgp external in",
8521 "Clear all external peers\n"
8524 ALIAS (clear_bgp_external_soft_in
,
8525 clear_bgp_instance_external_in_cmd
,
8526 "clear bgp " BGP_INSTANCE_CMD
" external in",
8529 BGP_INSTANCE_HELP_STR
8530 "Clear all external peers\n"
8533 ALIAS (clear_bgp_external_soft_in
,
8534 clear_bgp_ipv6_external_in_cmd
,
8535 "clear bgp ipv6 external WORD in",
8539 "Clear all external peers\n"
8542 ALIAS (clear_bgp_external_soft_in
,
8543 clear_bgp_instance_ipv6_external_in_cmd
,
8544 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external WORD in",
8547 BGP_INSTANCE_HELP_STR
8549 "Clear all external peers\n"
8552 DEFUN (clear_bgp_external_in_prefix_filter
,
8553 clear_bgp_external_in_prefix_filter_cmd
,
8554 "clear bgp external in prefix-filter",
8557 "Clear all external peers\n"
8559 "Push out prefix-list ORF and do inbound soft reconfig\n")
8561 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
8562 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
8565 ALIAS (clear_bgp_external_in_prefix_filter
,
8566 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
8567 "clear bgp ipv6 external in prefix-filter",
8571 "Clear all external peers\n"
8573 "Push out prefix-list ORF and do inbound soft reconfig\n")
8575 DEFUN (clear_ip_bgp_as_soft_in
,
8576 clear_ip_bgp_as_soft_in_cmd
,
8577 "clear ip bgp " CMD_AS_RANGE
" soft in",
8581 "Clear peers with the AS number\n"
8586 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_as
,
8587 BGP_CLEAR_SOFT_IN
, argv
[2]);
8589 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
8590 BGP_CLEAR_SOFT_IN
, argv
[0]);
8593 ALIAS (clear_ip_bgp_as_soft_in
,
8594 clear_ip_bgp_instance_as_soft_in_cmd
,
8595 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft in",
8599 BGP_INSTANCE_HELP_STR
8600 "Clear peers with the AS number\n"
8604 ALIAS (clear_ip_bgp_as_soft_in
,
8605 clear_ip_bgp_as_in_cmd
,
8606 "clear ip bgp " CMD_AS_RANGE
" in",
8610 "Clear peers with the AS number\n"
8613 ALIAS (clear_ip_bgp_as_soft_in
,
8614 clear_ip_bgp_instance_as_in_cmd
,
8615 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" in",
8619 BGP_INSTANCE_HELP_STR
8620 "Clear peers with the AS number\n"
8623 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
8624 clear_ip_bgp_as_in_prefix_filter_cmd
,
8625 "clear ip bgp " CMD_AS_RANGE
" in prefix-filter",
8629 "Clear peers with the AS number\n"
8631 "Push out prefix-list ORF and do inbound soft reconfig\n")
8633 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
8634 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8637 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
8638 clear_ip_bgp_as_ipv4_soft_in_cmd
,
8639 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft in",
8643 "Clear peers with the AS number\n"
8645 "Address Family modifier\n"
8646 "Address Family modifier\n"
8650 if (strncmp (argv
[1], "m", 1) == 0)
8651 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
8652 BGP_CLEAR_SOFT_IN
, argv
[0]);
8654 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
8655 BGP_CLEAR_SOFT_IN
, argv
[0]);
8658 DEFUN (clear_ip_bgp_instance_as_ipv4_soft_in
,
8659 clear_ip_bgp_instance_as_ipv4_soft_in_cmd
,
8660 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft in",
8664 BGP_INSTANCE_HELP_STR
8665 "Clear peers with the AS number\n"
8667 "Address Family modifier\n"
8668 "Address Family modifier\n"
8672 if (strncmp (argv
[3], "m", 1) == 0)
8673 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_as
,
8674 BGP_CLEAR_SOFT_IN
, argv
[2]);
8676 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_as
,
8677 BGP_CLEAR_SOFT_IN
, argv
[2]);
8680 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
8681 clear_ip_bgp_as_ipv4_in_cmd
,
8682 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in",
8686 "Clear peers with the AS number\n"
8688 "Address Family modifier\n"
8689 "Address Family modifier\n"
8692 ALIAS (clear_ip_bgp_instance_as_ipv4_soft_in
,
8693 clear_ip_bgp_instance_as_ipv4_in_cmd
,
8694 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" ipv4 (unicast|multicast) in",
8698 BGP_INSTANCE_HELP_STR
8699 "Clear peers with the AS number\n"
8701 "Address Family modifier\n"
8702 "Address Family modifier\n"
8705 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
8706 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
8707 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in prefix-filter",
8711 "Clear peers with the AS number\n"
8713 "Address Family modifier\n"
8714 "Address Family modifier\n"
8716 "Push out prefix-list ORF and do inbound soft reconfig\n")
8718 if (strncmp (argv
[1], "m", 1) == 0)
8719 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
8720 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8722 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
8723 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8726 DEFUN (clear_ip_bgp_as_vpnv4_soft_in
,
8727 clear_ip_bgp_as_vpnv4_soft_in_cmd
,
8728 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft in",
8732 "Clear peers with the AS number\n"
8734 "Address Family modifier\n"
8738 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
8739 BGP_CLEAR_SOFT_IN
, argv
[0]);
8742 ALIAS (clear_ip_bgp_as_vpnv4_soft_in
,
8743 clear_ip_bgp_as_vpnv4_in_cmd
,
8744 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast in",
8748 "Clear peers with the AS number\n"
8750 "Address Family modifier\n"
8753 DEFUN (clear_bgp_as_soft_in
,
8754 clear_bgp_as_soft_in_cmd
,
8755 "clear bgp " CMD_AS_RANGE
" soft in",
8758 "Clear peers with the AS number\n"
8763 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_as
,
8764 BGP_CLEAR_SOFT_IN
, argv
[2]);
8766 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
8767 BGP_CLEAR_SOFT_IN
, argv
[0]);
8770 ALIAS (clear_bgp_as_soft_in
,
8771 clear_bgp_instance_as_soft_in_cmd
,
8772 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft in",
8775 BGP_INSTANCE_HELP_STR
8776 "Clear peers with the AS number\n"
8780 ALIAS (clear_bgp_as_soft_in
,
8781 clear_bgp_ipv6_as_soft_in_cmd
,
8782 "clear bgp ipv6 " CMD_AS_RANGE
" soft in",
8786 "Clear peers with the AS number\n"
8790 ALIAS (clear_bgp_as_soft_in
,
8791 clear_bgp_instance_ipv6_as_soft_in_cmd
,
8792 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
" soft in",
8795 BGP_INSTANCE_HELP_STR
8797 "Clear peers with the AS number\n"
8801 ALIAS (clear_bgp_as_soft_in
,
8802 clear_bgp_as_in_cmd
,
8803 "clear bgp " CMD_AS_RANGE
" in",
8806 "Clear peers with the AS number\n"
8809 ALIAS (clear_bgp_as_soft_in
,
8810 clear_bgp_instance_as_in_cmd
,
8811 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" in",
8814 BGP_INSTANCE_HELP_STR
8815 "Clear peers with the AS number\n"
8818 ALIAS (clear_bgp_as_soft_in
,
8819 clear_bgp_ipv6_as_in_cmd
,
8820 "clear bgp ipv6 " CMD_AS_RANGE
" in",
8824 "Clear peers with the AS number\n"
8827 ALIAS (clear_bgp_as_soft_in
,
8828 clear_bgp_instance_ipv6_as_in_cmd
,
8829 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
" in",
8832 BGP_INSTANCE_HELP_STR
8834 "Clear peers with the AS number\n"
8837 DEFUN (clear_bgp_as_in_prefix_filter
,
8838 clear_bgp_as_in_prefix_filter_cmd
,
8839 "clear bgp " CMD_AS_RANGE
" in prefix-filter",
8842 "Clear peers with the AS number\n"
8844 "Push out prefix-list ORF and do inbound soft reconfig\n")
8846 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
8847 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8850 ALIAS (clear_bgp_as_in_prefix_filter
,
8851 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
8852 "clear bgp ipv6 " CMD_AS_RANGE
" in prefix-filter",
8856 "Clear peers with the AS number\n"
8858 "Push out prefix-list ORF and do inbound soft reconfig\n")
8860 /* Both soft-reconfiguration */
8861 DEFUN (clear_ip_bgp_all_soft
,
8862 clear_ip_bgp_all_soft_cmd
,
8863 "clear ip bgp * soft",
8871 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_all
,
8872 BGP_CLEAR_SOFT_BOTH
, NULL
);
8874 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
8875 BGP_CLEAR_SOFT_BOTH
, NULL
);
8878 ALIAS (clear_ip_bgp_all_soft
,
8879 clear_ip_bgp_instance_all_soft_cmd
,
8880 "clear ip bgp " BGP_INSTANCE_CMD
" * soft",
8884 BGP_INSTANCE_HELP_STR
8889 DEFUN (clear_ip_bgp_all_ipv4_soft
,
8890 clear_ip_bgp_all_ipv4_soft_cmd
,
8891 "clear ip bgp * ipv4 (unicast|multicast) soft",
8897 "Address Family Modifier\n"
8898 "Address Family Modifier\n"
8901 if (strncmp (argv
[0], "m", 1) == 0)
8902 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
8903 BGP_CLEAR_SOFT_BOTH
, NULL
);
8905 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
8906 BGP_CLEAR_SOFT_BOTH
, NULL
);
8909 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
8910 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
8911 "clear ip bgp " BGP_INSTANCE_CMD
" * ipv4 (unicast|multicast) soft",
8915 BGP_INSTANCE_HELP_STR
8918 "Address Family Modifier\n"
8919 "Address Family Modifier\n"
8922 if (strncmp (argv
[2], "m", 1) == 0)
8923 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_all
,
8924 BGP_CLEAR_SOFT_BOTH
, NULL
);
8926 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
8927 BGP_CLEAR_SOFT_BOTH
, NULL
);
8930 DEFUN (clear_ip_bgp_all_vpnv4_soft
,
8931 clear_ip_bgp_all_vpnv4_soft_cmd
,
8932 "clear ip bgp * vpnv4 unicast soft",
8938 "Address Family Modifier\n"
8941 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
8942 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
8945 DEFUN (clear_bgp_all_soft
,
8946 clear_bgp_all_soft_cmd
,
8954 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_all
,
8955 BGP_CLEAR_SOFT_BOTH
, NULL
);
8957 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
8958 BGP_CLEAR_SOFT_BOTH
, NULL
);
8961 ALIAS (clear_bgp_all_soft
,
8962 clear_bgp_instance_all_soft_cmd
,
8963 "clear bgp " BGP_INSTANCE_CMD
" * soft",
8966 BGP_INSTANCE_HELP_STR
8970 ALIAS (clear_bgp_all_soft
,
8971 clear_bgp_ipv6_all_soft_cmd
,
8972 "clear bgp ipv6 * soft",
8979 ALIAS (clear_bgp_all_soft
,
8980 clear_bgp_instance_ipv6_all_soft_cmd
,
8981 "clear bgp " BGP_INSTANCE_CMD
" ipv6 * soft",
8984 BGP_INSTANCE_HELP_STR
8989 DEFUN (clear_ip_bgp_peer_soft
,
8990 clear_ip_bgp_peer_soft_cmd
,
8991 "clear ip bgp (A.B.C.D|WORD) soft",
8995 "BGP neighbor address to clear\n"
8996 "BGP neighbor on interface to clear\n"
9000 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_peer
,
9001 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9003 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
9004 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9007 ALIAS (clear_ip_bgp_peer_soft
,
9008 clear_ip_bgp_instance_peer_soft_cmd
,
9009 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) soft",
9013 BGP_INSTANCE_HELP_STR
9014 "BGP neighbor address to clear\n"
9015 "BGP neighbor on interface to clear\n"
9018 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
9019 clear_ip_bgp_peer_ipv4_soft_cmd
,
9020 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) soft",
9024 "BGP neighbor address to clear\n"
9025 "BGP neighbor on interface to clear\n"
9027 "Address Family Modifier\n"
9028 "Address Family Modifier\n"
9031 if (strncmp (argv
[1], "m", 1) == 0)
9032 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
9033 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9035 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
9036 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9039 DEFUN (clear_ip_bgp_instance_peer_ipv4_soft
,
9040 clear_ip_bgp_instance_peer_ipv4_soft_cmd
,
9041 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) ipv4 (unicast|multicast) soft",
9045 BGP_INSTANCE_HELP_STR
9046 "BGP neighbor address to clear\n"
9047 "BGP neighbor on interface to clear\n"
9049 "Address Family Modifier\n"
9050 "Address Family Modifier\n"
9053 if (strncmp (argv
[3], "m", 1) == 0)
9054 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_peer
,
9055 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9057 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_peer
,
9058 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9061 DEFUN (clear_ip_bgp_peer_vpnv4_soft
,
9062 clear_ip_bgp_peer_vpnv4_soft_cmd
,
9063 "clear ip bgp (A.B.C.D|WORD) vpnv4 unicast soft",
9067 "BGP neighbor address to clear\n"
9068 "BGP neighbor on interface to clear\n"
9070 "Address Family Modifier\n"
9073 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
9074 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9077 DEFUN (clear_bgp_peer_soft
,
9078 clear_bgp_peer_soft_cmd
,
9079 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft",
9082 "BGP neighbor address to clear\n"
9083 "BGP IPv6 neighbor to clear\n"
9084 "BGP neighbor on interface to clear\n"
9088 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
9089 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9091 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
9092 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9095 ALIAS (clear_bgp_peer_soft
,
9096 clear_bgp_instance_peer_soft_cmd
,
9097 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD) soft",
9100 BGP_INSTANCE_HELP_STR
9101 "BGP neighbor address to clear\n"
9102 "BGP IPv6 neighbor to clear\n"
9103 "BGP neighbor on interface to clear\n"
9106 ALIAS (clear_bgp_peer_soft
,
9107 clear_bgp_ipv6_peer_soft_cmd
,
9108 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft",
9112 "BGP neighbor address to clear\n"
9113 "BGP IPv6 neighbor to clear\n"
9114 "BGP neighbor on interface to clear\n"
9117 ALIAS (clear_bgp_peer_soft
,
9118 clear_bgp_instance_ipv6_peer_soft_cmd
,
9119 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD) soft",
9122 BGP_INSTANCE_HELP_STR
9124 "BGP neighbor address to clear\n"
9125 "BGP IPv6 neighbor to clear\n"
9126 "BGP neighbor on interface to clear\n"
9129 DEFUN (clear_ip_bgp_peer_group_soft
,
9130 clear_ip_bgp_peer_group_soft_cmd
,
9131 "clear ip bgp peer-group WORD soft",
9135 "Clear all members of peer-group\n"
9136 "BGP peer-group name\n"
9140 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_group
,
9141 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9143 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
9144 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9147 ALIAS (clear_ip_bgp_peer_group_soft
,
9148 clear_ip_bgp_instance_peer_group_soft_cmd
,
9149 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD soft",
9153 BGP_INSTANCE_HELP_STR
9154 "Clear all members of peer-group\n"
9155 "BGP peer-group name\n"
9158 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
9159 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
9160 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
9164 "Clear all members of peer-group\n"
9165 "BGP peer-group name\n"
9167 "Address Family modifier\n"
9168 "Address Family modifier\n"
9171 if (strncmp (argv
[1], "m", 1) == 0)
9172 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
9173 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9175 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
9176 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9179 DEFUN (clear_ip_bgp_instance_peer_group_ipv4_soft
,
9180 clear_ip_bgp_instance_peer_group_ipv4_soft_cmd
,
9181 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD ipv4 (unicast|multicast) soft",
9185 BGP_INSTANCE_HELP_STR
9186 "Clear all members of peer-group\n"
9187 "BGP peer-group name\n"
9189 "Address Family modifier\n"
9190 "Address Family modifier\n"
9193 if (strncmp (argv
[3], "m", 1) == 0)
9194 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_group
,
9195 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9197 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_group
,
9198 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9201 DEFUN (clear_bgp_peer_group_soft
,
9202 clear_bgp_peer_group_soft_cmd
,
9203 "clear bgp peer-group WORD soft",
9206 "Clear all members of peer-group\n"
9207 "BGP peer-group name\n"
9211 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_group
,
9212 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9214 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
9215 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9218 ALIAS (clear_bgp_peer_group_soft
,
9219 clear_bgp_instance_peer_group_soft_cmd
,
9220 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD soft",
9223 BGP_INSTANCE_HELP_STR
9224 "Clear all members of peer-group\n"
9225 "BGP peer-group name\n"
9228 ALIAS (clear_bgp_peer_group_soft
,
9229 clear_bgp_ipv6_peer_group_soft_cmd
,
9230 "clear bgp ipv6 peer-group WORD soft",
9234 "Clear all members of peer-group\n"
9235 "BGP peer-group name\n"
9238 ALIAS (clear_bgp_peer_group_soft
,
9239 clear_bgp_instance_ipv6_peer_group_soft_cmd
,
9240 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD soft",
9243 BGP_INSTANCE_HELP_STR
9245 "Clear all members of peer-group\n"
9246 "BGP peer-group name\n"
9249 DEFUN (clear_ip_bgp_external_soft
,
9250 clear_ip_bgp_external_soft_cmd
,
9251 "clear ip bgp external soft",
9255 "Clear all external peers\n"
9259 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_external
,
9260 BGP_CLEAR_SOFT_BOTH
, NULL
);
9262 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
9263 BGP_CLEAR_SOFT_BOTH
, NULL
);
9266 ALIAS (clear_ip_bgp_external_soft
,
9267 clear_ip_bgp_instance_external_soft_cmd
,
9268 "clear ip bgp " BGP_INSTANCE_CMD
" external soft",
9272 BGP_INSTANCE_HELP_STR
9273 "Clear all external peers\n"
9276 DEFUN (clear_ip_bgp_external_ipv4_soft
,
9277 clear_ip_bgp_external_ipv4_soft_cmd
,
9278 "clear ip bgp external ipv4 (unicast|multicast) soft",
9282 "Clear all external peers\n"
9284 "Address Family modifier\n"
9285 "Address Family modifier\n"
9288 if (strncmp (argv
[0], "m", 1) == 0)
9289 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
9290 BGP_CLEAR_SOFT_BOTH
, NULL
);
9292 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
9293 BGP_CLEAR_SOFT_BOTH
, NULL
);
9296 DEFUN (clear_ip_bgp_instance_external_ipv4_soft
,
9297 clear_ip_bgp_instance_external_ipv4_soft_cmd
,
9298 "clear ip bgp " BGP_INSTANCE_CMD
" external ipv4 (unicast|multicast) soft",
9302 BGP_INSTANCE_HELP_STR
9303 "Clear all external peers\n"
9305 "Address Family modifier\n"
9306 "Address Family modifier\n"
9309 if (strncmp (argv
[2], "m", 1) == 0)
9310 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_external
,
9311 BGP_CLEAR_SOFT_BOTH
, NULL
);
9313 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_external
,
9314 BGP_CLEAR_SOFT_BOTH
, NULL
);
9317 DEFUN (clear_bgp_external_soft
,
9318 clear_bgp_external_soft_cmd
,
9319 "clear bgp external soft",
9322 "Clear all external peers\n"
9326 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_external
,
9327 BGP_CLEAR_SOFT_BOTH
, NULL
);
9329 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
9330 BGP_CLEAR_SOFT_BOTH
, NULL
);
9333 ALIAS (clear_bgp_external_soft
,
9334 clear_bgp_instance_external_soft_cmd
,
9335 "clear bgp " BGP_INSTANCE_CMD
" external soft",
9338 BGP_INSTANCE_HELP_STR
9339 "Clear all external peers\n"
9342 ALIAS (clear_bgp_external_soft
,
9343 clear_bgp_ipv6_external_soft_cmd
,
9344 "clear bgp ipv6 external soft",
9348 "Clear all external peers\n"
9351 ALIAS (clear_bgp_external_soft
,
9352 clear_bgp_instance_ipv6_external_soft_cmd
,
9353 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external soft",
9356 BGP_INSTANCE_HELP_STR
9358 "Clear all external peers\n"
9361 DEFUN (clear_ip_bgp_as_soft
,
9362 clear_ip_bgp_as_soft_cmd
,
9363 "clear ip bgp " CMD_AS_RANGE
" soft",
9367 "Clear peers with the AS number\n"
9371 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_as
,
9372 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9374 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
9375 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9378 ALIAS (clear_ip_bgp_as_soft
,
9379 clear_ip_bgp_instance_as_soft_cmd
,
9380 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft",
9384 BGP_INSTANCE_HELP_STR
9385 "Clear peers with the AS number\n"
9388 DEFUN (clear_ip_bgp_as_ipv4_soft
,
9389 clear_ip_bgp_as_ipv4_soft_cmd
,
9390 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft",
9394 "Clear peers with the AS number\n"
9396 "Address Family Modifier\n"
9397 "Address Family Modifier\n"
9400 if (strncmp (argv
[1], "m", 1) == 0)
9401 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
9402 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9404 return bgp_clear_vty (vty
, NULL
,AFI_IP
, SAFI_UNICAST
, clear_as
,
9405 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9408 DEFUN (clear_ip_bgp_instance_as_ipv4_soft
,
9409 clear_ip_bgp_instance_as_ipv4_soft_cmd
,
9410 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft",
9414 BGP_INSTANCE_HELP_STR
9415 "Clear peers with the AS number\n"
9417 "Address Family Modifier\n"
9418 "Address Family Modifier\n"
9421 if (strncmp (argv
[3], "m", 1) == 0)
9422 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_MULTICAST
, clear_as
,
9423 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9425 return bgp_clear_vty (vty
, argv
[1],AFI_IP
, SAFI_UNICAST
, clear_as
,
9426 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9429 DEFUN (clear_ip_bgp_as_vpnv4_soft
,
9430 clear_ip_bgp_as_vpnv4_soft_cmd
,
9431 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft",
9435 "Clear peers with the AS number\n"
9437 "Address Family Modifier\n"
9440 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
9441 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9444 DEFUN (clear_bgp_as_soft
,
9445 clear_bgp_as_soft_cmd
,
9446 "clear bgp " CMD_AS_RANGE
" soft",
9449 "Clear peers with the AS number\n"
9453 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_as
,
9454 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9456 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
9457 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9460 ALIAS (clear_bgp_as_soft
,
9461 clear_bgp_instance_as_soft_cmd
,
9462 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft",
9465 BGP_INSTANCE_HELP_STR
9466 "Clear peers with the AS number\n"
9469 ALIAS (clear_bgp_as_soft
,
9470 clear_bgp_ipv6_as_soft_cmd
,
9471 "clear bgp ipv6 " CMD_AS_RANGE
" soft",
9475 "Clear peers with the AS number\n"
9478 ALIAS (clear_bgp_as_soft
,
9479 clear_bgp_instance_ipv6_as_soft_cmd
,
9480 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
" soft",
9483 BGP_INSTANCE_HELP_STR
9485 "Clear peers with the AS number\n"
9488 DEFUN (show_bgp_views
,
9493 "Show the defined BGP views\n")
9495 struct list
*inst
= bm
->bgp
;
9496 struct listnode
*node
;
9499 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE
))
9501 vty_out (vty
, "BGP Multiple Instance is not enabled%s", VTY_NEWLINE
);
9505 vty_out (vty
, "Defined BGP views:%s", VTY_NEWLINE
);
9506 for (ALL_LIST_ELEMENTS_RO(inst
, node
, bgp
))
9509 if (bgp
->inst_type
== BGP_INSTANCE_TYPE_VRF
)
9511 vty_out (vty
, "\t%s (AS%u)%s",
9512 bgp
->name
? bgp
->name
: "(null)",
9513 bgp
->as
, VTY_NEWLINE
);
9519 DEFUN (show_bgp_vrfs
,
9521 "show bgp vrfs {json}",
9525 "JavaScript Object Notation\n")
9527 struct list
*inst
= bm
->bgp
;
9528 struct listnode
*node
;
9530 u_char uj
= use_json(argc
, argv
);
9531 json_object
*json
= NULL
;
9532 json_object
*json_vrfs
= NULL
;
9534 static char header
[] = "Type Id RouterId #PeersCfg #PeersEstb Name";
9536 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE
))
9538 vty_out (vty
, "BGP Multiple Instance is not enabled%s", VTY_NEWLINE
);
9544 json
= json_object_new_object();
9545 json_vrfs
= json_object_new_object();
9548 for (ALL_LIST_ELEMENTS_RO(inst
, node
, bgp
))
9550 const char *name
, *type
;
9552 struct listnode
*node
, *nnode
;
9553 int peers_cfg
, peers_estb
;
9554 json_object
*json_vrf
= NULL
;
9557 if (bgp
->inst_type
== BGP_INSTANCE_TYPE_VIEW
)
9561 if (!uj
&& count
== 1)
9562 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
9564 peers_cfg
= peers_estb
= 0;
9566 json_vrf
= json_object_new_object();
9569 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
9571 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
9574 if (peer
->status
== Established
)
9578 if (bgp
->inst_type
== BGP_INSTANCE_TYPE_DEFAULT
)
9591 json_object_string_add(json_vrf
, "type", type
);
9592 json_object_int_add(json_vrf
, "vrfId", bgp
->vrf_id
);
9593 json_object_string_add(json_vrf
, "routerId", inet_ntoa (bgp
->router_id
));
9594 json_object_int_add(json_vrf
, "numConfiguredPeers", peers_cfg
);
9595 json_object_int_add(json_vrf
, "numEstablishedPeers", peers_estb
);
9597 json_object_object_add(json_vrfs
, name
, json_vrf
);
9600 vty_out (vty
, "%4s %-5u %-16s %9u %10u %s%s",
9601 type
, bgp
->vrf_id
, inet_ntoa (bgp
->router_id
),
9602 peers_cfg
, peers_estb
, name
,
9608 json_object_object_add(json
, "vrfs", json_vrfs
);
9610 json_object_int_add(json
, "totalVrfs", count
);
9612 vty_out (vty
, "%s%s", json_object_to_json_string(json
), VTY_NEWLINE
);
9613 json_object_free(json
);
9618 vty_out (vty
, "%sTotal number of VRFs (including default): %d%s",
9619 VTY_NEWLINE
, count
, VTY_NEWLINE
);
9625 DEFUN (show_bgp_memory
,
9626 show_bgp_memory_cmd
,
9630 "Global BGP memory statistics\n")
9632 char memstrbuf
[MTYPE_MEMSTR_LEN
];
9633 unsigned long count
;
9635 /* RIB related usage stats */
9636 count
= mtype_stats_alloc (MTYPE_BGP_NODE
);
9637 vty_out (vty
, "%ld RIB nodes, using %s of memory%s", count
,
9638 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9639 count
* sizeof (struct bgp_node
)),
9642 count
= mtype_stats_alloc (MTYPE_BGP_ROUTE
);
9643 vty_out (vty
, "%ld BGP routes, using %s of memory%s", count
,
9644 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9645 count
* sizeof (struct bgp_info
)),
9647 if ((count
= mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA
)))
9648 vty_out (vty
, "%ld BGP route ancillaries, using %s of memory%s", count
,
9649 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9650 count
* sizeof (struct bgp_info_extra
)),
9653 if ((count
= mtype_stats_alloc (MTYPE_BGP_STATIC
)))
9654 vty_out (vty
, "%ld Static routes, using %s of memory%s", count
,
9655 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9656 count
* sizeof (struct bgp_static
)),
9659 if ((count
= mtype_stats_alloc (MTYPE_BGP_PACKET
)))
9660 vty_out (vty
, "%ld Packets, using %s of memory%s", count
,
9661 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9662 count
* sizeof (struct bpacket
)),
9666 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_IN
)))
9667 vty_out (vty
, "%ld Adj-In entries, using %s of memory%s", count
,
9668 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9669 count
* sizeof (struct bgp_adj_in
)),
9671 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_OUT
)))
9672 vty_out (vty
, "%ld Adj-Out entries, using %s of memory%s", count
,
9673 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9674 count
* sizeof (struct bgp_adj_out
)),
9677 if ((count
= mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE
)))
9678 vty_out (vty
, "%ld Nexthop cache entries, using %s of memory%s", count
,
9679 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9680 count
* sizeof (struct bgp_nexthop_cache
)),
9683 if ((count
= mtype_stats_alloc (MTYPE_BGP_DAMP_INFO
)))
9684 vty_out (vty
, "%ld Dampening entries, using %s of memory%s", count
,
9685 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9686 count
* sizeof (struct bgp_damp_info
)),
9690 count
= attr_count();
9691 vty_out (vty
, "%ld BGP attributes, using %s of memory%s", count
,
9692 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9693 count
* sizeof(struct attr
)),
9695 if ((count
= mtype_stats_alloc (MTYPE_ATTR_EXTRA
)))
9696 vty_out (vty
, "%ld BGP extra attributes, using %s of memory%s", count
,
9697 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9698 count
* sizeof(struct attr_extra
)),
9701 if ((count
= attr_unknown_count()))
9702 vty_out (vty
, "%ld unknown attributes%s", count
, VTY_NEWLINE
);
9704 /* AS_PATH attributes */
9705 count
= aspath_count ();
9706 vty_out (vty
, "%ld BGP AS-PATH entries, using %s of memory%s", count
,
9707 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9708 count
* sizeof (struct aspath
)),
9711 count
= mtype_stats_alloc (MTYPE_AS_SEG
);
9712 vty_out (vty
, "%ld BGP AS-PATH segments, using %s of memory%s", count
,
9713 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9714 count
* sizeof (struct assegment
)),
9717 /* Other attributes */
9718 if ((count
= community_count ()))
9719 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
9720 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9721 count
* sizeof (struct community
)),
9723 if ((count
= mtype_stats_alloc (MTYPE_ECOMMUNITY
)))
9724 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
9725 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9726 count
* sizeof (struct ecommunity
)),
9729 if ((count
= mtype_stats_alloc (MTYPE_CLUSTER
)))
9730 vty_out (vty
, "%ld Cluster lists, using %s of memory%s", count
,
9731 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9732 count
* sizeof (struct cluster_list
)),
9735 /* Peer related usage */
9736 count
= mtype_stats_alloc (MTYPE_BGP_PEER
);
9737 vty_out (vty
, "%ld peers, using %s of memory%s", count
,
9738 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9739 count
* sizeof (struct peer
)),
9742 if ((count
= mtype_stats_alloc (MTYPE_BGP_PEER_GROUP
)))
9743 vty_out (vty
, "%ld peer groups, using %s of memory%s", count
,
9744 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9745 count
* sizeof (struct peer_group
)),
9749 if ((count
= mtype_stats_alloc (MTYPE_HASH
)))
9750 vty_out (vty
, "%ld hash tables, using %s of memory%s", count
,
9751 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9752 count
* sizeof (struct hash
)),
9754 if ((count
= mtype_stats_alloc (MTYPE_HASH_BACKET
)))
9755 vty_out (vty
, "%ld hash buckets, using %s of memory%s", count
,
9756 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9757 count
* sizeof (struct hash_backet
)),
9759 if ((count
= mtype_stats_alloc (MTYPE_BGP_REGEXP
)))
9760 vty_out (vty
, "%ld compiled regexes, using %s of memory%s", count
,
9761 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9762 count
* sizeof (regex_t
)),
9767 /* Show BGP peer's summary information. */
9769 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
,
9773 struct listnode
*node
, *nnode
;
9774 unsigned int count
= 0, dn_count
= 0;
9775 char timebuf
[BGP_UPTIME_LEN
], dn_flag
[2];
9777 json_object
*json
= NULL
;
9778 json_object
*json_peer
= NULL
;
9779 json_object
*json_peers
= NULL
;
9781 /* Header string for each address family. */
9782 static char header
[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
9786 json
= json_object_new_object();
9787 json_peers
= json_object_new_object();
9790 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
9792 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
9795 if (peer
->afc
[afi
][safi
])
9800 char memstrbuf
[MTYPE_MEMSTR_LEN
];
9802 /* Usage summary and header */
9805 json_object_string_add(json
, "routerId", inet_ntoa (bgp
->router_id
));
9806 json_object_int_add(json
, "as", bgp
->as
);
9809 json_object_int_add(json
, "vrf-id", bgp
->vrf_id
);
9815 "BGP router identifier %s, local AS number %u",
9816 inet_ntoa (bgp
->router_id
), bgp
->as
);
9819 vty_out (vty
, " vrf-id %u", bgp
->vrf_id
);
9821 vty_out (vty
, "%s", VTY_NEWLINE
);
9824 if (bgp_update_delay_configured(bgp
))
9828 json_object_int_add(json
, "updateDelayLimit", bgp
->v_update_delay
);
9830 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
9831 json_object_int_add(json
, "updateDelayEstablishWait", bgp
->v_establish_wait
);
9833 if (bgp_update_delay_active(bgp
))
9835 json_object_string_add(json
, "updateDelayFirstNeighbor", bgp
->update_delay_begin_time
);
9836 json_object_boolean_true_add(json
, "updateDelayInProgress");
9840 if (bgp
->update_delay_over
)
9842 json_object_string_add(json
, "updateDelayFirstNeighbor",
9843 bgp
->update_delay_begin_time
);
9844 json_object_string_add(json
, "updateDelayBestpathResumed",
9845 bgp
->update_delay_end_time
);
9846 json_object_string_add(json
, "updateDelayZebraUpdateResume",
9847 bgp
->update_delay_zebra_resume_time
);
9848 json_object_string_add(json
, "updateDelayPeerUpdateResume",
9849 bgp
->update_delay_peers_resume_time
);
9855 vty_out (vty
, "Read-only mode update-delay limit: %d seconds%s",
9856 bgp
->v_update_delay
, VTY_NEWLINE
);
9857 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
9858 vty_out (vty
, " Establish wait: %d seconds%s",
9859 bgp
->v_establish_wait
, VTY_NEWLINE
);
9861 if (bgp_update_delay_active(bgp
))
9863 vty_out (vty
, " First neighbor established: %s%s",
9864 bgp
->update_delay_begin_time
, VTY_NEWLINE
);
9865 vty_out (vty
, " Delay in progress%s", VTY_NEWLINE
);
9869 if (bgp
->update_delay_over
)
9871 vty_out (vty
, " First neighbor established: %s%s",
9872 bgp
->update_delay_begin_time
, VTY_NEWLINE
);
9873 vty_out (vty
, " Best-paths resumed: %s%s",
9874 bgp
->update_delay_end_time
, VTY_NEWLINE
);
9875 vty_out (vty
, " zebra update resumed: %s%s",
9876 bgp
->update_delay_zebra_resume_time
, VTY_NEWLINE
);
9877 vty_out (vty
, " peers update resumed: %s%s",
9878 bgp
->update_delay_peers_resume_time
, VTY_NEWLINE
);
9886 if (bgp_maxmed_onstartup_configured(bgp
) && bgp
->maxmed_active
)
9887 json_object_boolean_true_add(json
, "maxMedOnStartup");
9888 if (bgp
->v_maxmed_admin
)
9889 json_object_boolean_true_add(json
, "maxMedAdministrative");
9891 json_object_int_add(json
, "tableVersion", bgp_table_version(bgp
->rib
[afi
][safi
]));
9893 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
9894 json_object_int_add(json
, "ribCount", ents
);
9895 json_object_int_add(json
, "ribMemory", ents
* sizeof (struct bgp_node
));
9897 ents
= listcount (bgp
->peer
);
9898 json_object_int_add(json
, "peerCount", ents
);
9899 json_object_int_add(json
, "peerMemory", ents
* sizeof (struct peer
));
9901 if ((ents
= listcount (bgp
->group
)))
9903 json_object_int_add(json
, "peerGroupCount", ents
);
9904 json_object_int_add(json
, "peerGroupMemory", ents
* sizeof (struct peer_group
));
9907 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
9908 json_object_boolean_true_add(json
, "dampeningEnabled");
9912 if (bgp_maxmed_onstartup_configured(bgp
) && bgp
->maxmed_active
)
9913 vty_out (vty
, "Max-med on-startup active%s", VTY_NEWLINE
);
9914 if (bgp
->v_maxmed_admin
)
9915 vty_out (vty
, "Max-med administrative active%s", VTY_NEWLINE
);
9917 vty_out(vty
, "BGP table version %" PRIu64
"%s",
9918 bgp_table_version(bgp
->rib
[afi
][safi
]), VTY_NEWLINE
);
9920 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
9921 vty_out (vty
, "RIB entries %ld, using %s of memory%s", ents
,
9922 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9923 ents
* sizeof (struct bgp_node
)),
9926 /* Peer related usage */
9927 ents
= listcount (bgp
->peer
);
9928 vty_out (vty
, "Peers %ld, using %s of memory%s",
9930 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9931 ents
* sizeof (struct peer
)),
9934 if ((ents
= listcount (bgp
->group
)))
9935 vty_out (vty
, "Peer groups %ld, using %s of memory%s", ents
,
9936 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9937 ents
* sizeof (struct peer_group
)),
9940 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
9941 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
9942 vty_out (vty
, "%s", VTY_NEWLINE
);
9943 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
9951 json_peer
= json_object_new_object();
9953 if (peer_dynamic_neighbor(peer
))
9954 json_object_boolean_true_add(json_peer
, "dynamicPeer");
9957 json_object_string_add(json_peer
, "hostname", peer
->hostname
);
9959 if (peer
->domainname
)
9960 json_object_string_add(json_peer
, "domainname", peer
->domainname
);
9962 json_object_int_add(json_peer
, "remoteAs", peer
->as
);
9963 json_object_int_add(json_peer
, "version", 4);
9964 json_object_int_add(json_peer
, "msgRcvd",
9965 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
9966 + peer
->notify_in
+ peer
->refresh_in
9967 + peer
->dynamic_cap_in
);
9968 json_object_int_add(json_peer
, "msgSent",
9969 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
9970 + peer
->notify_out
+ peer
->refresh_out
9971 + peer
->dynamic_cap_out
);
9973 json_object_int_add(json_peer
, "tableVersion", peer
->version
[afi
][safi
]);
9974 json_object_int_add(json_peer
, "outq", peer
->obuf
->count
);
9975 json_object_int_add(json_peer
, "inq", 0);
9976 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
, use_json
, json_peer
);
9977 json_object_int_add(json_peer
, "prefixReceivedCount", peer
->pcount
[afi
][safi
]);
9979 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
9980 json_object_string_add(json_peer
, "state", "Idle (Admin)");
9981 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
9982 json_object_string_add(json_peer
, "state", "Idle (PfxCt)");
9984 json_object_string_add(json_peer
, "state", LOOKUP(bgp_status_msg
, peer
->status
));
9987 json_object_string_add(json_peer
, "idType", "interface");
9988 else if (peer
->su
.sa
.sa_family
== AF_INET
)
9989 json_object_string_add(json_peer
, "idType", "ipv4");
9990 else if (peer
->su
.sa
.sa_family
== AF_INET6
)
9991 json_object_string_add(json_peer
, "idType", "ipv6");
9993 json_object_object_add(json_peers
, peer
->host
, json_peer
);
9997 memset(dn_flag
, '\0', sizeof(dn_flag
));
9998 if (peer_dynamic_neighbor(peer
))
10004 if (peer
->hostname
&& bgp_flag_check(bgp
, BGP_FLAG_SHOW_HOSTNAME
))
10005 len
= vty_out (vty
, "%s%s(%s)", dn_flag
, peer
->hostname
,
10008 len
= vty_out (vty
, "%s%s", dn_flag
, peer
->host
);
10012 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
10014 vty_out (vty
, "%*s", len
, " ");
10016 vty_out (vty
, "4 ");
10018 vty_out (vty
, "%5u %7d %7d %8" PRIu64
" %4d %4zd ",
10020 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
10021 + peer
->notify_in
+ peer
->refresh_in
10022 + peer
->dynamic_cap_in
,
10023 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
10024 + peer
->notify_out
+ peer
->refresh_out
10025 + peer
->dynamic_cap_out
,
10026 peer
->version
[afi
][safi
],
10028 peer
->obuf
->count
);
10030 vty_out (vty
, "%-8s",
10031 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
, 0, NULL
));
10033 if (peer
->status
== Established
)
10034 vty_out (vty
, " %8ld", peer
->pcount
[afi
][safi
]);
10037 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
10038 vty_out (vty
, " Idle (Admin)");
10039 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
10040 vty_out (vty
, " Idle (PfxCt)");
10042 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, peer
->status
));
10044 vty_out (vty
, "%s", VTY_NEWLINE
);
10051 json_object_object_add(json
, "peers", json_peers
);
10053 json_object_int_add(json
, "totalPeers", count
);
10054 json_object_int_add(json
, "dynamicPeers", dn_count
);
10056 vty_out (vty
, "%s%s", json_object_to_json_string(json
), VTY_NEWLINE
);
10057 json_object_free(json
);
10062 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
10063 count
, VTY_NEWLINE
);
10065 vty_out (vty
, "No %s neighbor is configured%s",
10066 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
10070 vty_out(vty
, "* - dynamic neighbor%s", VTY_NEWLINE
);
10072 "%d dynamic neighbor(s), limit %d%s",
10073 dn_count
, bgp
->dynamic_neighbors_limit
, VTY_NEWLINE
);
10077 return CMD_SUCCESS
;
10081 bgp_show_summary_vty (struct vty
*vty
, const char *name
,
10082 afi_t afi
, safi_t safi
, u_char use_json
)
10088 bgp
= bgp_lookup_by_name (name
);
10092 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
10093 return CMD_WARNING
;
10096 bgp_show_summary (vty
, bgp
, afi
, safi
, use_json
);
10097 return CMD_SUCCESS
;
10100 bgp
= bgp_get_default ();
10103 bgp_show_summary (vty
, bgp
, afi
, safi
, use_json
);
10105 return CMD_SUCCESS
;
10108 /* `show ip bgp summary' commands. */
10109 DEFUN (show_ip_bgp_summary
,
10110 show_ip_bgp_summary_cmd
,
10111 "show ip bgp summary {json}",
10115 "Summary of BGP neighbor status\n"
10116 "JavaScript Object Notation\n")
10118 u_char uj
= use_json(argc
, argv
);
10119 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, uj
);
10122 DEFUN (show_ip_bgp_instance_summary
,
10123 show_ip_bgp_instance_summary_cmd
,
10124 "show ip bgp " BGP_INSTANCE_CMD
" summary {json}",
10128 BGP_INSTANCE_HELP_STR
10129 "Summary of BGP neighbor status\n"
10130 "JavaScript Object Notation\n")
10132 u_char uj
= use_json(argc
, argv
);
10133 return bgp_show_summary_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, uj
);
10136 DEFUN (show_ip_bgp_ipv4_summary
,
10137 show_ip_bgp_ipv4_summary_cmd
,
10138 "show ip bgp ipv4 (unicast|multicast) summary {json}",
10143 "Address Family modifier\n"
10144 "Address Family modifier\n"
10145 "Summary of BGP neighbor status\n"
10146 "JavaScript Object Notation\n")
10148 u_char uj
= use_json(argc
, argv
);
10149 if (strncmp (argv
[0], "m", 1) == 0)
10150 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, uj
);
10152 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, uj
);
10155 ALIAS (show_ip_bgp_ipv4_summary
,
10156 show_bgp_ipv4_safi_summary_cmd
,
10157 "show bgp ipv4 (unicast|multicast) summary {json}",
10161 "Address Family modifier\n"
10162 "Address Family modifier\n"
10163 "Summary of BGP neighbor status\n")
10165 DEFUN (show_ip_bgp_instance_ipv4_summary
,
10166 show_ip_bgp_instance_ipv4_summary_cmd
,
10167 "show ip bgp view WORD ipv4 (unicast|multicast) summary {json}",
10174 "Address Family modifier\n"
10175 "Address Family modifier\n"
10176 "Summary of BGP neighbor status\n"
10177 "JavaScript Object Notation\n")
10179 u_char uj
= use_json(argc
, argv
);
10180 if (strncmp (argv
[1], "m", 1) == 0)
10181 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, uj
);
10183 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, uj
);
10186 ALIAS (show_ip_bgp_instance_ipv4_summary
,
10187 show_bgp_instance_ipv4_safi_summary_cmd
,
10188 "show bgp view WORD ipv4 (unicast|multicast) summary {json}",
10194 "Address Family modifier\n"
10195 "Address Family modifier\n"
10196 "Summary of BGP neighbor status\n")
10198 DEFUN (show_ip_bgp_vpnv4_all_summary
,
10199 show_ip_bgp_vpnv4_all_summary_cmd
,
10200 "show ip bgp vpnv4 all summary {json}",
10204 "Display VPNv4 NLRI specific information\n"
10205 "Display information about all VPNv4 NLRIs\n"
10206 "Summary of BGP neighbor status\n"
10207 "JavaScript Object Notation\n")
10209 u_char uj
= use_json(argc
, argv
);
10210 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, uj
);
10213 DEFUN (show_ip_bgp_vpnv4_rd_summary
,
10214 show_ip_bgp_vpnv4_rd_summary_cmd
,
10215 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary {json}",
10219 "Display VPNv4 NLRI specific information\n"
10220 "Display information for a route distinguisher\n"
10221 "VPN Route Distinguisher\n"
10222 "Summary of BGP neighbor status\n"
10223 "JavaScript Object Notation\n")
10226 struct prefix_rd prd
;
10227 u_char uj
= use_json(argc
, argv
);
10229 ret
= str2prefix_rd (argv
[0], &prd
);
10232 vty_out (vty
, "%% Malformed Route Distinguisher%s", VTY_NEWLINE
);
10233 return CMD_WARNING
;
10236 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, uj
);
10240 DEFUN (show_bgp_summary
,
10241 show_bgp_summary_cmd
,
10242 "show bgp summary {json}",
10245 "Summary of BGP neighbor status\n"
10246 "JavaScript Object Notation\n")
10248 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, use_json(argc
, argv
));
10251 DEFUN (show_bgp_instance_summary
,
10252 show_bgp_instance_summary_cmd
,
10253 "show bgp " BGP_INSTANCE_CMD
" summary {json}",
10256 BGP_INSTANCE_HELP_STR
10257 "Summary of BGP neighbor status\n"
10258 "JavaScript Object Notation\n")
10260 return bgp_show_summary_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, use_json(argc
, argv
));
10263 ALIAS (show_bgp_summary
,
10264 show_bgp_ipv6_summary_cmd
,
10265 "show bgp ipv6 summary {json}",
10269 "Summary of BGP neighbor status\n")
10271 ALIAS (show_bgp_instance_summary
,
10272 show_bgp_instance_ipv6_summary_cmd
,
10273 "show bgp " BGP_INSTANCE_CMD
" ipv6 summary {json}",
10276 BGP_INSTANCE_HELP_STR
10278 "Summary of BGP neighbor status\n")
10280 DEFUN (show_bgp_ipv6_safi_summary
,
10281 show_bgp_ipv6_safi_summary_cmd
,
10282 "show bgp ipv6 (unicast|multicast) summary {json}",
10286 "Address Family modifier\n"
10287 "Address Family modifier\n"
10288 "Summary of BGP neighbor status\n"
10289 "JavaScript Object Notation\n")
10291 u_char uj
= use_json(argc
, argv
);
10292 if (strncmp (argv
[0], "m", 1) == 0)
10293 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
, uj
);
10295 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, uj
);
10298 DEFUN (show_bgp_instance_ipv6_safi_summary
,
10299 show_bgp_instance_ipv6_safi_summary_cmd
,
10300 "show bgp " BGP_INSTANCE_CMD
" ipv6 (unicast|multicast) summary {json}",
10303 BGP_INSTANCE_HELP_STR
10305 "Address Family modifier\n"
10306 "Address Family modifier\n"
10307 "Summary of BGP neighbor status\n"
10308 "JavaScript Object Notation\n")
10310 u_char uj
= use_json(argc
, argv
);
10311 if (strncmp (argv
[2], "m", 1) == 0)
10312 return bgp_show_summary_vty (vty
, argv
[1], AFI_IP6
, SAFI_MULTICAST
, uj
);
10314 return bgp_show_summary_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, uj
);
10318 DEFUN (show_ipv6_bgp_summary
,
10319 show_ipv6_bgp_summary_cmd
,
10320 "show ipv6 bgp summary {json}",
10324 "Summary of BGP neighbor status\n"
10325 "JavaScript Object Notation\n")
10327 u_char uj
= use_json(argc
, argv
);
10328 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, uj
);
10332 DEFUN (show_ipv6_mbgp_summary
,
10333 show_ipv6_mbgp_summary_cmd
,
10334 "show ipv6 mbgp summary {json}",
10338 "Summary of BGP neighbor status\n"
10339 "JavaScript Object Notation\n")
10341 u_char uj
= use_json(argc
, argv
);
10342 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
, uj
);
10344 #endif /* HAVE_IPV6 */
10347 afi_safi_print (afi_t afi
, safi_t safi
)
10349 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
10350 return "IPv4 Unicast";
10351 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
10352 return "IPv4 Multicast";
10353 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
10354 return "VPNv4 Unicast";
10355 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
10356 return "IPv6 Unicast";
10357 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
10358 return "IPv6 Multicast";
10363 /* Show BGP peer's information. */
10371 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
,
10372 u_int16_t adv_smcap
, u_int16_t adv_rmcap
, u_int16_t rcv_smcap
,
10373 u_int16_t rcv_rmcap
, u_char use_json
, json_object
*json_pref
)
10376 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
10377 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
10381 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) && CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
10382 json_object_string_add(json_pref
, "sendMode", "advertisedAndReceived");
10383 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
10384 json_object_string_add(json_pref
, "sendMode", "advertised");
10385 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
10386 json_object_string_add(json_pref
, "sendMode", "received");
10390 vty_out (vty
, " Send-mode: ");
10391 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
10392 vty_out (vty
, "advertised");
10393 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
10394 vty_out (vty
, "%sreceived",
10395 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
10397 vty_out (vty
, "%s", VTY_NEWLINE
);
10402 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
10403 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
10407 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) && CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
10408 json_object_string_add(json_pref
, "recvMode", "advertisedAndReceived");
10409 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
10410 json_object_string_add(json_pref
, "recvMode", "advertised");
10411 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
10412 json_object_string_add(json_pref
, "recvMode", "received");
10416 vty_out (vty
, " Receive-mode: ");
10417 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
10418 vty_out (vty
, "advertised");
10419 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
10420 vty_out (vty
, "%sreceived",
10421 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
10423 vty_out (vty
, "%s", VTY_NEWLINE
);
10429 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
,
10430 u_char use_json
, json_object
*json_neigh
)
10432 struct bgp_filter
*filter
;
10433 struct peer_af
*paf
;
10434 char orf_pfx_name
[BUFSIZ
];
10436 json_object
*json_af
= NULL
;
10437 json_object
*json_prefA
= NULL
;
10438 json_object
*json_prefB
= NULL
;
10439 json_object
*json_addr
= NULL
;
10443 json_addr
= json_object_new_object();
10444 json_af
= json_object_new_object();
10445 json_prefA
= json_object_new_object();
10446 json_prefB
= json_object_new_object();
10447 filter
= &p
->filter
[afi
][safi
];
10449 if (peer_group_active(p
))
10450 json_object_string_add(json_addr
, "peerGroupMember", p
->group
->name
);
10452 paf
= peer_af_find(p
, afi
, safi
);
10453 if (paf
&& PAF_SUBGRP(paf
))
10455 json_object_int_add(json_addr
, "updateGroupId", PAF_UPDGRP(paf
)->id
);
10456 json_object_int_add(json_addr
, "subGroupId", PAF_SUBGRP(paf
)->id
);
10457 json_object_int_add(json_addr
, "packetQueueLength", bpacket_queue_virtual_length(paf
));
10460 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10461 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
10462 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10463 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
10465 json_object_int_add(json_af
, "orfType", ORF_TYPE_PREFIX
);
10466 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
10467 PEER_CAP_ORF_PREFIX_SM_ADV
,
10468 PEER_CAP_ORF_PREFIX_RM_ADV
,
10469 PEER_CAP_ORF_PREFIX_SM_RCV
,
10470 PEER_CAP_ORF_PREFIX_RM_RCV
, use_json
, json_prefA
);
10471 json_object_object_add(json_af
, "orfPrefixList", json_prefA
);
10474 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10475 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
10476 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10477 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
10479 json_object_int_add(json_af
, "orfOldType", ORF_TYPE_PREFIX_OLD
);
10480 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
10481 PEER_CAP_ORF_PREFIX_SM_ADV
,
10482 PEER_CAP_ORF_PREFIX_RM_ADV
,
10483 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
10484 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
, use_json
, json_prefB
);
10485 json_object_object_add(json_af
, "orfOldPrefixList", json_prefB
);
10488 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10489 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
10490 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
10491 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10492 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
10493 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
10494 json_object_object_add(json_addr
, "afDependentCap", json_af
);
10496 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
10497 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
, use_json
);
10499 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
10502 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
10503 json_object_boolean_true_add(json_neigh
, "orfSent");
10505 json_object_int_add(json_addr
, "orfRecvCounter", orf_pfx_count
);
10507 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
10508 json_object_string_add(json_addr
, "orfFirstUpdate", "deferredUntilORFOrRouteRefreshRecvd");
10510 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
10511 json_object_boolean_true_add(json_addr
, "routeReflectorClient");
10512 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
10513 json_object_boolean_true_add(json_addr
, "routeServerClient");
10514 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
10515 json_object_boolean_true_add(json_addr
, "inboundSoftConfigPermit");
10517 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE
))
10518 json_object_boolean_true_add(json_addr
, "privateAsNumsAllReplacedInUpdatesToNbr");
10519 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
))
10520 json_object_boolean_true_add(json_addr
, "privateAsNumsReplacedInUpdatesToNbr");
10521 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_ALL
))
10522 json_object_boolean_true_add(json_addr
, "privateAsNumsAllRemovedInUpdatesToNbr");
10523 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
10524 json_object_boolean_true_add(json_addr
, "privateAsNumsRemovedInUpdatesToNbr");
10526 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_ADDPATH_TX_ALL_PATHS
))
10527 json_object_boolean_true_add(json_addr
, "addpathTxAllPaths");
10529 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS
))
10530 json_object_boolean_true_add(json_addr
, "addpathTxBestpathPerAS");
10532 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_OVERRIDE
))
10533 json_object_string_add(json_addr
, "overrideASNsInOutboundUpdates", "ifAspathEqualRemoteAs");
10535 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
) ||
10536 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_FORCE_NEXTHOP_SELF
))
10537 json_object_boolean_true_add(json_addr
, "routerAlwaysNextHop");
10538 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
10539 json_object_boolean_true_add(json_addr
, "unchangedAsPathPropogatedToNbr");
10540 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
10541 json_object_boolean_true_add(json_addr
, "unchangedNextHopPropogatedToNbr");
10542 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
10543 json_object_boolean_true_add(json_addr
, "unchangedMedPropogatedToNbr");
10544 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
10545 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10547 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
10548 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10549 json_object_string_add(json_addr
, "commAttriSentToNbr", "extendedAndStandard");
10550 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10551 json_object_string_add(json_addr
, "commAttriSentToNbr", "extended");
10553 json_object_string_add(json_addr
, "commAttriSentToNbr", "standard");
10555 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
10557 if (p
->default_rmap
[afi
][safi
].name
)
10558 json_object_string_add(json_addr
, "defaultRouteMap", p
->default_rmap
[afi
][safi
].name
);
10560 if (paf
&& PAF_SUBGRP(paf
) && CHECK_FLAG(PAF_SUBGRP(paf
)->sflags
, SUBGRP_STATUS_DEFAULT_ORIGINATE
))
10561 json_object_boolean_true_add(json_addr
, "defaultSent");
10563 json_object_boolean_true_add(json_addr
, "defaultNotSent");
10566 if (filter
->plist
[FILTER_IN
].name
10567 || filter
->dlist
[FILTER_IN
].name
10568 || filter
->aslist
[FILTER_IN
].name
10569 || filter
->map
[RMAP_IN
].name
)
10570 json_object_boolean_true_add(json_addr
, "inboundPathPolicyConfig");
10571 if (filter
->plist
[FILTER_OUT
].name
10572 || filter
->dlist
[FILTER_OUT
].name
10573 || filter
->aslist
[FILTER_OUT
].name
10574 || filter
->map
[RMAP_OUT
].name
10575 || filter
->usmap
.name
)
10576 json_object_boolean_true_add(json_addr
, "outboundPathPolicyConfig");
10579 if (filter
->plist
[FILTER_IN
].name
)
10580 json_object_string_add(json_addr
, "incomingUpdatePrefixFilterList", filter
->plist
[FILTER_IN
].name
);
10581 if (filter
->plist
[FILTER_OUT
].name
)
10582 json_object_string_add(json_addr
, "outgoingUpdatePrefixFilterList", filter
->plist
[FILTER_OUT
].name
);
10584 /* distribute-list */
10585 if (filter
->dlist
[FILTER_IN
].name
)
10586 json_object_string_add(json_addr
, "incomingUpdateNetworkFilterList", filter
->dlist
[FILTER_IN
].name
);
10587 if (filter
->dlist
[FILTER_OUT
].name
)
10588 json_object_string_add(json_addr
, "outgoingUpdateNetworkFilterList", filter
->dlist
[FILTER_OUT
].name
);
10591 if (filter
->aslist
[FILTER_IN
].name
)
10592 json_object_string_add(json_addr
, "incomingUpdateAsPathFilterList", filter
->aslist
[FILTER_IN
].name
);
10593 if (filter
->aslist
[FILTER_OUT
].name
)
10594 json_object_string_add(json_addr
, "outgoingUpdateAsPathFilterList", filter
->aslist
[FILTER_OUT
].name
);
10597 if (filter
->map
[RMAP_IN
].name
)
10598 json_object_string_add(json_addr
, "routeMapForIncomingAdvertisements", filter
->map
[RMAP_IN
].name
);
10599 if (filter
->map
[RMAP_OUT
].name
)
10600 json_object_string_add(json_addr
, "routeMapForOutgoingAdvertisements", filter
->map
[RMAP_OUT
].name
);
10602 /* unsuppress-map */
10603 if (filter
->usmap
.name
)
10604 json_object_string_add(json_addr
, "selectiveUnsuppressRouteMap", filter
->usmap
.name
);
10606 /* Receive prefix count */
10607 json_object_int_add(json_addr
, "acceptedPrefixCounter", p
->pcount
[afi
][safi
]);
10609 /* Maximum prefix */
10610 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
10612 json_object_int_add(json_addr
, "prefixAllowedMax", p
->pmax
[afi
][safi
]);
10613 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
))
10614 json_object_boolean_true_add(json_addr
, "prefixAllowedMaxWarning");
10615 json_object_int_add(json_addr
, "prefixAllowedWarningThresh", p
->pmax_threshold
[afi
][safi
]);
10616 if (p
->pmax_restart
[afi
][safi
])
10617 json_object_int_add(json_addr
, "prefixAllowedRestartIntervalMsecs", p
->pmax_restart
[afi
][safi
] * 60000);
10619 json_object_object_add(json_neigh
, afi_safi_print (afi
, safi
), json_addr
);
10624 filter
= &p
->filter
[afi
][safi
];
10626 vty_out (vty
, " For address family: %s%s", afi_safi_print (afi
, safi
),
10629 if (peer_group_active(p
))
10630 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
10632 paf
= peer_af_find(p
, afi
, safi
);
10633 if (paf
&& PAF_SUBGRP(paf
))
10635 vty_out (vty
, " Update group %" PRIu64
", subgroup %" PRIu64
"%s",
10636 PAF_UPDGRP(paf
)->id
, PAF_SUBGRP(paf
)->id
, VTY_NEWLINE
);
10637 vty_out (vty
, " Packet Queue length %d%s",
10638 bpacket_queue_virtual_length(paf
), VTY_NEWLINE
);
10642 vty_out(vty
, " Not part of any update group%s", VTY_NEWLINE
);
10644 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10645 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
10646 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
10647 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10648 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
10649 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
10650 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
10652 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10653 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
10654 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10655 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
10657 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
10658 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
10659 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
10660 PEER_CAP_ORF_PREFIX_SM_ADV
,
10661 PEER_CAP_ORF_PREFIX_RM_ADV
,
10662 PEER_CAP_ORF_PREFIX_SM_RCV
,
10663 PEER_CAP_ORF_PREFIX_RM_RCV
, use_json
, NULL
);
10665 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10666 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
10667 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10668 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
10670 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
10671 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
10672 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
10673 PEER_CAP_ORF_PREFIX_SM_ADV
,
10674 PEER_CAP_ORF_PREFIX_RM_ADV
,
10675 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
10676 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
, use_json
, NULL
);
10679 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
10680 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
, use_json
);
10682 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
10685 vty_out (vty
, " Outbound Route Filter (ORF):");
10686 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
10687 vty_out (vty
, " sent;");
10689 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
10690 vty_out (vty
, "%s", VTY_NEWLINE
);
10692 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
10693 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
10695 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
10696 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
10697 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
10698 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
10699 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
10700 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
10702 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE
))
10703 vty_out (vty
, " Private AS numbers (all) replaced in updates to this neighbor%s", VTY_NEWLINE
);
10704 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
))
10705 vty_out (vty
, " Private AS numbers replaced in updates to this neighbor%s", VTY_NEWLINE
);
10706 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_ALL
))
10707 vty_out (vty
, " Private AS numbers (all) removed in updates to this neighbor%s", VTY_NEWLINE
);
10708 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
10709 vty_out (vty
, " Private AS numbers removed in updates to this neighbor%s", VTY_NEWLINE
);
10711 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_ADDPATH_TX_ALL_PATHS
))
10712 vty_out (vty
, " Advertise all paths via addpath%s", VTY_NEWLINE
);
10714 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS
))
10715 vty_out (vty
, " Advertise bestpath per AS via addpath%s", VTY_NEWLINE
);
10717 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_OVERRIDE
))
10718 vty_out (vty
, " Override ASNs in outbound updates if aspath equals remote-as%s", VTY_NEWLINE
);
10720 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
) ||
10721 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_FORCE_NEXTHOP_SELF
))
10722 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
10723 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
10724 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
10725 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
10726 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
10727 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
10728 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
10729 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
10730 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10732 vty_out (vty
, " Community attribute sent to this neighbor");
10733 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
10734 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10735 vty_out (vty
, "(both)%s", VTY_NEWLINE
);
10736 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10737 vty_out (vty
, "(extended)%s", VTY_NEWLINE
);
10739 vty_out (vty
, "(standard)%s", VTY_NEWLINE
);
10741 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
10743 vty_out (vty
, " Default information originate,");
10745 if (p
->default_rmap
[afi
][safi
].name
)
10746 vty_out (vty
, " default route-map %s%s,",
10747 p
->default_rmap
[afi
][safi
].map
? "*" : "",
10748 p
->default_rmap
[afi
][safi
].name
);
10749 if (paf
&& PAF_SUBGRP(paf
) && CHECK_FLAG(PAF_SUBGRP(paf
)->sflags
, SUBGRP_STATUS_DEFAULT_ORIGINATE
))
10750 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
10752 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
10755 if (filter
->plist
[FILTER_IN
].name
10756 || filter
->dlist
[FILTER_IN
].name
10757 || filter
->aslist
[FILTER_IN
].name
10758 || filter
->map
[RMAP_IN
].name
)
10759 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
10760 if (filter
->plist
[FILTER_OUT
].name
10761 || filter
->dlist
[FILTER_OUT
].name
10762 || filter
->aslist
[FILTER_OUT
].name
10763 || filter
->map
[RMAP_OUT
].name
10764 || filter
->usmap
.name
)
10765 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
10768 if (filter
->plist
[FILTER_IN
].name
)
10769 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
10770 filter
->plist
[FILTER_IN
].plist
? "*" : "",
10771 filter
->plist
[FILTER_IN
].name
,
10773 if (filter
->plist
[FILTER_OUT
].name
)
10774 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
10775 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
10776 filter
->plist
[FILTER_OUT
].name
,
10779 /* distribute-list */
10780 if (filter
->dlist
[FILTER_IN
].name
)
10781 vty_out (vty
, " Incoming update network filter list is %s%s%s",
10782 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
10783 filter
->dlist
[FILTER_IN
].name
,
10785 if (filter
->dlist
[FILTER_OUT
].name
)
10786 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
10787 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
10788 filter
->dlist
[FILTER_OUT
].name
,
10792 if (filter
->aslist
[FILTER_IN
].name
)
10793 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
10794 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
10795 filter
->aslist
[FILTER_IN
].name
,
10797 if (filter
->aslist
[FILTER_OUT
].name
)
10798 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
10799 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
10800 filter
->aslist
[FILTER_OUT
].name
,
10804 if (filter
->map
[RMAP_IN
].name
)
10805 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
10806 filter
->map
[RMAP_IN
].map
? "*" : "",
10807 filter
->map
[RMAP_IN
].name
,
10809 if (filter
->map
[RMAP_OUT
].name
)
10810 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
10811 filter
->map
[RMAP_OUT
].map
? "*" : "",
10812 filter
->map
[RMAP_OUT
].name
,
10815 /* unsuppress-map */
10816 if (filter
->usmap
.name
)
10817 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
10818 filter
->usmap
.map
? "*" : "",
10819 filter
->usmap
.name
, VTY_NEWLINE
);
10821 /* Receive prefix count */
10822 vty_out (vty
, " %ld accepted prefixes%s", p
->pcount
[afi
][safi
], VTY_NEWLINE
);
10824 /* Maximum prefix */
10825 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
10827 vty_out (vty
, " Maximum prefixes allowed %ld%s%s", p
->pmax
[afi
][safi
],
10828 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
10829 ? " (warning-only)" : "", VTY_NEWLINE
);
10830 vty_out (vty
, " Threshold for warning message %d%%",
10831 p
->pmax_threshold
[afi
][safi
]);
10832 if (p
->pmax_restart
[afi
][safi
])
10833 vty_out (vty
, ", restart interval %d min", p
->pmax_restart
[afi
][safi
]);
10834 vty_out (vty
, "%s", VTY_NEWLINE
);
10837 vty_out (vty
, "%s", VTY_NEWLINE
);
10842 bgp_show_peer (struct vty
*vty
, struct peer
*p
, u_char use_json
, json_object
*json
, json_object
*json_neigh
)
10845 char buf1
[PREFIX2STR_BUFFER
], buf
[SU_ADDRSTRLEN
];
10846 char timebuf
[BGP_UPTIME_LEN
];
10848 const char *subcode_str
;
10849 const char *code_str
;
10859 if (p
->conf_if
) /* Configured interface name. */
10860 vty_out (vty
, "BGP neighbor on %s: %s, ", p
->conf_if
,
10861 BGP_PEER_SU_UNSPEC(p
) ? "None" :
10862 sockunion2str (&p
->su
, buf
, SU_ADDRSTRLEN
));
10863 else /* Configured IP address. */
10865 memset(dn_flag
, '\0', sizeof(dn_flag
));
10866 if (peer_dynamic_neighbor(p
))
10869 vty_out (vty
, "BGP neighbor is %s%s, ", dn_flag
, p
->host
);
10875 if (p
->conf_if
&& BGP_PEER_SU_UNSPEC(p
))
10876 json_object_string_add(json_neigh
, "bgpNeighborAddr", "none");
10877 else if (p
->conf_if
&& !BGP_PEER_SU_UNSPEC(p
))
10878 json_object_string_add(json_neigh
, "bgpNeighborAddr", sockunion2str (&p
->su
, buf
, SU_ADDRSTRLEN
));
10880 json_object_int_add(json_neigh
, "remoteAs", p
->as
);
10882 if (p
->change_local_as
)
10883 json_object_int_add(json_neigh
, "localAs", p
->change_local_as
);
10885 json_object_int_add(json_neigh
, "localAs", p
->local_as
);
10887 if (CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
))
10888 json_object_boolean_true_add(json_neigh
, "localAsNoPrepend");
10890 if (CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_REPLACE_AS
))
10891 json_object_boolean_true_add(json_neigh
, "localAsReplaceAs");
10895 if ((p
->as_type
== AS_SPECIFIED
) ||
10896 (p
->as_type
== AS_EXTERNAL
) ||
10897 (p
->as_type
== AS_INTERNAL
))
10898 vty_out (vty
, "remote AS %u, ", p
->as
);
10900 vty_out (vty
, "remote AS Unspecified, ");
10901 vty_out (vty
, "local AS %u%s%s, ",
10902 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
10903 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
10904 " no-prepend" : "",
10905 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_REPLACE_AS
) ?
10906 " replace-as" : "");
10908 /* peer type internal, external, confed-internal or confed-external */
10909 if (p
->as
== p
->local_as
)
10913 if (CHECK_FLAG(bgp
->config
, BGP_CONFIG_CONFEDERATION
))
10914 json_object_boolean_true_add(json_neigh
, "nbrConfedInternalLink");
10916 json_object_boolean_true_add(json_neigh
, "nbrInternalLink");
10920 if (CHECK_FLAG(bgp
->config
, BGP_CONFIG_CONFEDERATION
))
10921 vty_out (vty
, "confed-internal link%s", VTY_NEWLINE
);
10923 vty_out (vty
, "internal link%s", VTY_NEWLINE
);
10930 if (CHECK_FLAG(bgp
->config
, BGP_CONFIG_CONFEDERATION
))
10931 json_object_boolean_true_add(json_neigh
, "nbrConfedExternalLink");
10933 json_object_boolean_true_add(json_neigh
, "nbrExternalLink");
10937 if (bgp_confederation_peers_check(bgp
, p
->as
))
10938 vty_out (vty
, "confed-external link%s", VTY_NEWLINE
);
10940 vty_out (vty
, "external link%s", VTY_NEWLINE
);
10948 json_object_string_add(json_neigh
, "nbrDesc", p
->desc
);
10950 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
10958 json_object_string_add(json_neigh
, "hostname", p
->hostname
);
10961 json_object_string_add(json_neigh
, "domainname", p
->domainname
);
10965 if (p
->domainname
&& (p
->domainname
[0] != '\0'))
10966 vty_out(vty
, "Hostname: %s.%s%s", p
->hostname
, p
->domainname
,
10969 vty_out(vty
, "Hostname: %s%s", p
->hostname
, VTY_NEWLINE
);
10979 json_object_string_add(json_neigh
, "peerGroup", p
->group
->name
);
10983 struct prefix
*prefix
= NULL
, *range
= NULL
;
10985 prefix
= sockunion2hostprefix(&(p
->su
));
10987 range
= peer_group_lookup_dynamic_neighbor_range (p
->group
, prefix
);
10991 prefix2str(range
, buf1
, sizeof(buf1
));
10992 json_object_string_add(json_neigh
, "peerSubnetRangeGroup", buf1
);
10998 vty_out (vty
, " Member of peer-group %s for session parameters%s",
10999 p
->group
->name
, VTY_NEWLINE
);
11003 struct prefix
*prefix
= NULL
, *range
= NULL
;
11005 prefix
= sockunion2hostprefix(&(p
->su
));
11007 range
= peer_group_lookup_dynamic_neighbor_range (p
->group
, prefix
);
11011 prefix2str(range
, buf1
, sizeof(buf1
));
11012 vty_out (vty
, " Belongs to the subnet range group: %s%s", buf1
, VTY_NEWLINE
);
11020 /* Administrative shutdown. */
11021 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
11022 json_object_boolean_true_add(json_neigh
, "adminShutDown");
11025 json_object_int_add(json_neigh
, "bgpVersion", 4);
11026 json_object_string_add(json_neigh
, "remoteRouterId", inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
));
11028 /* Confederation */
11029 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
) && bgp_confederation_peers_check (bgp
, p
->as
))
11030 json_object_boolean_true_add(json_neigh
, "nbrCommonAdmin");
11033 json_object_string_add(json_neigh
, "bgpState", LOOKUP (bgp_status_msg
, p
->status
));
11035 if (p
->status
== Established
)
11040 uptime
= bgp_clock();
11041 uptime
-= p
->uptime
;
11042 tm
= gmtime(&uptime
);
11044 json_object_int_add(json_neigh
, "bgpTimerUp", (tm
->tm_sec
* 1000) + (tm
->tm_min
* 60000) + (tm
->tm_hour
* 3600000));
11047 else if (p
->status
== Active
)
11049 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
11050 json_object_string_add(json_neigh
, "bgpStateIs", "passive");
11051 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
11052 json_object_string_add(json_neigh
, "bgpStateIs", "passiveNSF");
11059 uptime
= bgp_clock();
11060 uptime
-= p
->readtime
;
11061 tm
= gmtime(&uptime
);
11062 json_object_int_add(json_neigh
, "bgpTimerLastRead", (tm
->tm_sec
* 1000) + (tm
->tm_min
* 60000) + (tm
->tm_hour
* 3600000));
11064 uptime
= bgp_clock();
11065 uptime
-= p
->last_write
;
11066 tm
= gmtime(&uptime
);
11067 json_object_int_add(json_neigh
, "bgpTimerLastRead", (tm
->tm_sec
* 1000) + (tm
->tm_min
* 60000) + (tm
->tm_hour
* 3600000));
11069 /* Configured timer values. */
11070 json_object_int_add(json_neigh
, "bgpTimerHoldTimeMsecs", p
->v_holdtime
* 1000);
11071 json_object_int_add(json_neigh
, "bgpTimerKeepAliveIntervalMsecs", p
->v_keepalive
* 1000);
11073 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
11075 json_object_int_add(json_neigh
, "bgpTimerConfiguredHoldTimeMsecs", p
->holdtime
* 1000);
11076 json_object_int_add(json_neigh
, "bgpTimerConfiguredKeepAliveIntervalMsecs", p
->keepalive
* 1000);
11081 /* Administrative shutdown. */
11082 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
11083 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
11086 vty_out (vty
, " BGP version 4");
11087 vty_out (vty
, ", remote router ID %s%s", inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
11090 /* Confederation */
11091 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
)
11092 && bgp_confederation_peers_check (bgp
, p
->as
))
11093 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
11096 vty_out (vty
, " BGP state = %s", LOOKUP (bgp_status_msg
, p
->status
));
11098 if (p
->status
== Established
)
11099 vty_out (vty
, ", up for %8s", peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
, 0, NULL
));
11101 else if (p
->status
== Active
)
11103 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
11104 vty_out (vty
, " (passive)");
11105 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
11106 vty_out (vty
, " (NSF passive)");
11108 vty_out (vty
, "%s", VTY_NEWLINE
);
11111 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
, 0, NULL
));
11112 vty_out (vty
, ", Last write %s%s",
11113 peer_uptime (p
->last_write
, timebuf
, BGP_UPTIME_LEN
, 0, NULL
), VTY_NEWLINE
);
11115 /* Configured timer values. */
11116 vty_out (vty
, " Hold time is %d, keepalive interval is %d seconds%s",
11117 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
11118 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
11120 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
11121 vty_out (vty
, ", keepalive interval is %d seconds%s",
11122 p
->keepalive
, VTY_NEWLINE
);
11126 if (p
->status
== Established
)
11129 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
11130 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
11131 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
11132 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
11134 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
11135 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
11136 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
11137 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
11138 #endif /* HAVE_IPV6 */
11139 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
11140 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
11144 json_object
*json_cap
= NULL
;
11146 json_cap
= json_object_new_object();
11149 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
)
11150 || CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
11152 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
) && CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
11153 json_object_string_add(json_cap
, "4byteAs", "advertisedAndReceived");
11154 else if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
11155 json_object_string_add(json_cap
, "4byteAs", "advertised");
11156 else if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
11157 json_object_string_add(json_cap
, "4byteAs", "received");
11161 if (CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_RCV
)
11162 || CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_ADV
))
11164 json_object
*json_add
= NULL
;
11165 const char *print_store
;
11167 json_add
= json_object_new_object();
11169 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11170 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11172 json_object
*json_sub
= NULL
;
11173 json_sub
= json_object_new_object();
11174 print_store
= afi_safi_print (afi
, safi
);
11176 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ||
11177 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
11179 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) && CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
11180 json_object_boolean_true_add(json_sub
, "txAdvertisedAndReceived");
11181 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
))
11182 json_object_boolean_true_add(json_sub
, "txAdvertised");
11183 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
11184 json_object_boolean_true_add(json_sub
, "txReceived");
11187 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ||
11188 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11190 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) && CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11191 json_object_boolean_true_add(json_sub
, "rxAdvertisedAndReceived");
11192 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
))
11193 json_object_boolean_true_add(json_sub
, "rxAdvertised");
11194 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11195 json_object_boolean_true_add(json_sub
, "rxReceived");
11198 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ||
11199 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
) ||
11200 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ||
11201 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11202 json_object_object_add(json_add
, print_store
, json_sub
);
11205 json_object_object_add(json_cap
, "addPath", json_add
);
11209 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
11210 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
11212 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) && CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
11213 json_object_string_add(json_cap
, "dynamic", "advertisedAndReceived");
11214 else if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
11215 json_object_string_add(json_cap
, "dynamic", "advertised");
11216 else if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
11217 json_object_string_add(json_cap
, "dynamic", "received");
11220 /* Extended nexthop */
11221 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
)
11222 || CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
))
11224 json_object
*json_nxt
= NULL
;
11225 const char *print_store
;
11227 json_nxt
= json_object_new_object();
11229 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
) && CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
11230 json_object_string_add(json_cap
, "extendedNexthop", "advertisedAndReceived");
11231 else if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
))
11232 json_object_string_add(json_cap
, "extendedNexthop", "advertised");
11233 else if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
11234 json_object_string_add(json_cap
, "extendedNexthop", "received");
11236 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
11238 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11240 if (CHECK_FLAG (p
->af_cap
[AFI_IP
][safi
], PEER_CAP_ENHE_AF_RCV
))
11242 print_store
= afi_safi_print (AFI_IP
, safi
);
11243 json_object_string_add(json_nxt
, print_store
, "recieved");
11246 json_object_object_add(json_cap
, "extendedNexthopFamililesByPeer", json_nxt
);
11250 /* Route Refresh */
11251 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
11252 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
11253 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
11255 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) && (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
) || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)))
11257 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
))
11258 json_object_string_add(json_cap
, "routeRefresh", "advertisedAndReceivedOldNew");
11261 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
11262 json_object_string_add(json_cap
, "routeRefresh", "advertisedAndReceivedOld");
11264 json_object_string_add(json_cap
, "routeRefresh", "advertisedAndReceivedNew");
11267 else if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
11268 json_object_string_add(json_cap
, "routeRefresh", "advertised");
11269 else if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
) || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
11270 json_object_string_add(json_cap
, "routeRefresh", "received");
11273 /* Multiprotocol Extensions */
11274 json_object
*json_multi
= NULL
;
11275 json_multi
= json_object_new_object();
11277 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11279 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11281 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
11283 json_object
*json_exten
= NULL
;
11284 json_exten
= json_object_new_object();
11286 if (p
->afc_adv
[afi
][safi
] && p
->afc_recv
[afi
][safi
])
11287 json_object_boolean_true_add(json_exten
, "advertisedAndReceived");
11288 else if (p
->afc_adv
[afi
][safi
])
11289 json_object_boolean_true_add(json_exten
, "advertised");
11290 else if (p
->afc_recv
[afi
][safi
])
11291 json_object_boolean_true_add(json_exten
, "received");
11293 json_object_object_add(json_multi
, afi_safi_print (afi
, safi
), json_exten
);
11297 json_object_object_add(json_cap
, "multiprotocolExtensions", json_multi
);
11299 /* Gracefull Restart */
11300 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
11301 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
11303 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) && CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
11304 json_object_string_add(json_cap
, "gracefulRestart", "advertisedAndReceived");
11305 else if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
11306 json_object_string_add(json_cap
, "gracefulRestartCapability", "advertised");
11307 else if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
11308 json_object_string_add(json_cap
, "gracefulRestartCapability", "received");
11310 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
11312 int restart_af_count
= 0;
11313 json_object
*json_restart
= NULL
;
11314 json_restart
= json_object_new_object();
11316 json_object_int_add(json_cap
, "gracefulRestartRemoteTimerMsecs", p
->v_gr_restart
* 1000);
11318 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11320 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11322 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
11324 json_object
*json_sub
= NULL
;
11325 json_sub
= json_object_new_object();
11327 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
))
11328 json_object_boolean_true_add(json_sub
, "preserved");
11329 restart_af_count
++;
11330 json_object_object_add(json_restart
, afi_safi_print (afi
, safi
), json_sub
);
11334 if (! restart_af_count
)
11335 json_object_string_add(json_cap
, "addressFamiliesByPeer", "none");
11337 json_object_object_add(json_cap
, "addressFamiliesByPeer", json_restart
);
11340 json_object_object_add(json_neigh
, "neighborCapabilities", json_cap
);
11344 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
11347 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
)
11348 || CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
11350 vty_out (vty
, " 4 Byte AS:");
11351 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
11352 vty_out (vty
, " advertised");
11353 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
11354 vty_out (vty
, " %sreceived",
11355 CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
) ? "and " : "");
11356 vty_out (vty
, "%s", VTY_NEWLINE
);
11360 if (CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_RCV
)
11361 || CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_ADV
))
11363 vty_out (vty
, " AddPath:%s", VTY_NEWLINE
);
11365 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11366 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11368 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ||
11369 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
11371 vty_out (vty
, " %s: TX ", afi_safi_print (afi
, safi
));
11373 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
))
11374 vty_out (vty
, "advertised %s", afi_safi_print (afi
, safi
));
11376 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
11377 vty_out (vty
, "%sreceived", CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ? " and " : "" );
11379 vty_out (vty
, "%s", VTY_NEWLINE
);
11382 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ||
11383 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11385 vty_out (vty
, " %s: RX ", afi_safi_print (afi
, safi
));
11387 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
))
11388 vty_out (vty
, "advertised %s", afi_safi_print (afi
, safi
));
11390 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11391 vty_out (vty
, "%sreceived", CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ? " and " : "" );
11393 vty_out (vty
, "%s", VTY_NEWLINE
);
11399 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
11400 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
11402 vty_out (vty
, " Dynamic:");
11403 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
11404 vty_out (vty
, " advertised");
11405 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
11406 vty_out (vty
, " %sreceived",
11407 CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) ? "and " : "");
11408 vty_out (vty
, "%s", VTY_NEWLINE
);
11411 /* Extended nexthop */
11412 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
)
11413 || CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
))
11415 vty_out (vty
, " Extended nexthop:");
11416 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
))
11417 vty_out (vty
, " advertised");
11418 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
11419 vty_out (vty
, " %sreceived",
11420 CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
) ? "and " : "");
11421 vty_out (vty
, "%s", VTY_NEWLINE
);
11423 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
11425 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
11426 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11427 if (CHECK_FLAG (p
->af_cap
[AFI_IP
][safi
], PEER_CAP_ENHE_AF_RCV
))
11428 vty_out (vty
, " %s%s",
11429 afi_safi_print (AFI_IP
, safi
), VTY_NEWLINE
);
11433 /* Route Refresh */
11434 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
11435 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
11436 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
11438 vty_out (vty
, " Route refresh:");
11439 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
11440 vty_out (vty
, " advertised");
11441 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
11442 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
11443 vty_out (vty
, " %sreceived(%s)",
11444 CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) ? "and " : "",
11445 (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
11446 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)) ?
11447 "old & new" : CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) ? "old" : "new");
11449 vty_out (vty
, "%s", VTY_NEWLINE
);
11452 /* Multiprotocol Extensions */
11453 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11454 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11455 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
11457 vty_out (vty
, " Address family %s:", afi_safi_print (afi
, safi
));
11458 if (p
->afc_adv
[afi
][safi
])
11459 vty_out (vty
, " advertised");
11460 if (p
->afc_recv
[afi
][safi
])
11461 vty_out (vty
, " %sreceived", p
->afc_adv
[afi
][safi
] ? "and " : "");
11462 vty_out (vty
, "%s", VTY_NEWLINE
);
11465 /* Hostname capability */
11466 if (CHECK_FLAG(p
->cap
, PEER_CAP_HOSTNAME_ADV
) ||
11467 CHECK_FLAG(p
->cap
, PEER_CAP_HOSTNAME_RCV
))
11469 vty_out (vty
, " Hostname Capability:");
11470 if (CHECK_FLAG (p
->cap
, PEER_CAP_HOSTNAME_ADV
))
11471 vty_out (vty
, " advertised");
11472 if (CHECK_FLAG (p
->cap
, PEER_CAP_HOSTNAME_RCV
))
11473 vty_out (vty
, " %sreceived",
11474 CHECK_FLAG (p
->cap
, PEER_CAP_HOSTNAME_ADV
) ? "and " : "");
11475 vty_out (vty
, "%s", VTY_NEWLINE
);
11478 /* Gracefull Restart */
11479 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
11480 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
11482 vty_out (vty
, " Graceful Restart Capabilty:");
11483 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
11484 vty_out (vty
, " advertised");
11485 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
11486 vty_out (vty
, " %sreceived",
11487 CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) ? "and " : "");
11488 vty_out (vty
, "%s", VTY_NEWLINE
);
11490 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
11492 int restart_af_count
= 0;
11494 vty_out (vty
, " Remote Restart timer is %d seconds%s",
11495 p
->v_gr_restart
, VTY_NEWLINE
);
11496 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
11498 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11499 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11500 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
11502 vty_out (vty
, "%s%s(%s)", restart_af_count
? ", " : "",
11503 afi_safi_print (afi
, safi
),
11504 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
) ?
11505 "preserved" : "not preserved");
11506 restart_af_count
++;
11508 if (! restart_af_count
)
11509 vty_out (vty
, "none");
11510 vty_out (vty
, "%s", VTY_NEWLINE
);
11517 /* graceful restart information */
11518 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
11522 json_object
*json_grace
= NULL
;
11523 json_object
*json_grace_send
= NULL
;
11524 json_object
*json_grace_recv
= NULL
;
11525 int eor_send_af_count
= 0;
11526 int eor_receive_af_count
= 0;
11530 json_grace
= json_object_new_object();
11531 json_grace_send
= json_object_new_object();
11532 json_grace_recv
= json_object_new_object();
11534 if (p
->status
== Established
)
11536 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11538 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11540 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
11542 json_object_boolean_true_add(json_grace_send
, afi_safi_print (afi
, safi
));
11543 eor_send_af_count
++;
11547 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11549 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11551 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
11553 json_object_boolean_true_add(json_grace_recv
, afi_safi_print (afi
, safi
));
11554 eor_receive_af_count
++;
11560 json_object_object_add(json_grace
, "endOfRibSend", json_grace_send
);
11561 json_object_object_add(json_grace
, "endOfRibRecv", json_grace_recv
);
11563 if (p
->t_gr_restart
)
11564 json_object_int_add(json_grace
, "gracefulRestartTimerMsecs", thread_timer_remain_second (p
->t_gr_restart
) * 1000);
11567 json_object_int_add(json_grace
, "gracefulStalepathTimerMsecs", thread_timer_remain_second (p
->t_gr_stale
) * 1000);
11569 json_object_object_add(json_neigh
, "gracefulRestartInfo", json_grace
);
11573 vty_out (vty
, " Graceful restart informations:%s", VTY_NEWLINE
);
11574 if (p
->status
== Established
)
11576 vty_out (vty
, " End-of-RIB send: ");
11577 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11579 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11581 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
11583 vty_out (vty
, "%s%s", eor_send_af_count
? ", " : "",
11584 afi_safi_print (afi
, safi
));
11585 eor_send_af_count
++;
11589 vty_out (vty
, "%s", VTY_NEWLINE
);
11590 vty_out (vty
, " End-of-RIB received: ");
11591 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11593 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11595 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
11597 vty_out (vty
, "%s%s", eor_receive_af_count
? ", " : "",
11598 afi_safi_print (afi
, safi
));
11599 eor_receive_af_count
++;
11603 vty_out (vty
, "%s", VTY_NEWLINE
);
11606 if (p
->t_gr_restart
)
11607 vty_out (vty
, " The remaining time of restart timer is %ld%s",
11608 thread_timer_remain_second (p
->t_gr_restart
), VTY_NEWLINE
);
11611 vty_out (vty
, " The remaining time of stalepath timer is %ld%s",
11612 thread_timer_remain_second (p
->t_gr_stale
), VTY_NEWLINE
);
11617 json_object
*json_stat
= NULL
;
11618 json_stat
= json_object_new_object();
11619 /* Packet counts. */
11620 json_object_int_add(json_stat
, "depthInq", 0);
11621 json_object_int_add(json_stat
, "depthOutq", (unsigned long) p
->obuf
->count
);
11622 json_object_int_add(json_stat
, "opensSent", p
->open_out
);
11623 json_object_int_add(json_stat
, "opensRecv", p
->open_in
);
11624 json_object_int_add(json_stat
, "notificationsSent", p
->notify_out
);
11625 json_object_int_add(json_stat
, "notificationsRecv", p
->notify_in
);
11626 json_object_int_add(json_stat
, "updatesSent", p
->update_out
);
11627 json_object_int_add(json_stat
, "updatesRecv", p
->update_in
);
11628 json_object_int_add(json_stat
, "keepalivesSent", p
->keepalive_out
);
11629 json_object_int_add(json_stat
, "keepalivesRecv", p
->keepalive_in
);
11630 json_object_int_add(json_stat
, "routeRefreshSent", p
->refresh_out
);
11631 json_object_int_add(json_stat
, "routeRefreshRecv", p
->refresh_in
);
11632 json_object_int_add(json_stat
, "capabilitySent", p
->dynamic_cap_out
);
11633 json_object_int_add(json_stat
, "capabilityRecv", p
->dynamic_cap_in
);
11634 json_object_int_add(json_stat
, "totalSent", p
->open_out
+ p
->notify_out
+ p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
+ p
->dynamic_cap_out
);
11635 json_object_int_add(json_stat
, "totalRecv", p
->open_in
+ p
->notify_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
+ p
->dynamic_cap_in
);
11636 json_object_object_add(json_neigh
, "messageStats", json_stat
);
11640 /* Packet counts. */
11641 vty_out (vty
, " Message statistics:%s", VTY_NEWLINE
);
11642 vty_out (vty
, " Inq depth is 0%s", VTY_NEWLINE
);
11643 vty_out (vty
, " Outq depth is %lu%s", (unsigned long) p
->obuf
->count
, VTY_NEWLINE
);
11644 vty_out (vty
, " Sent Rcvd%s", VTY_NEWLINE
);
11645 vty_out (vty
, " Opens: %10d %10d%s", p
->open_out
, p
->open_in
, VTY_NEWLINE
);
11646 vty_out (vty
, " Notifications: %10d %10d%s", p
->notify_out
, p
->notify_in
, VTY_NEWLINE
);
11647 vty_out (vty
, " Updates: %10d %10d%s", p
->update_out
, p
->update_in
, VTY_NEWLINE
);
11648 vty_out (vty
, " Keepalives: %10d %10d%s", p
->keepalive_out
, p
->keepalive_in
, VTY_NEWLINE
);
11649 vty_out (vty
, " Route Refresh: %10d %10d%s", p
->refresh_out
, p
->refresh_in
, VTY_NEWLINE
);
11650 vty_out (vty
, " Capability: %10d %10d%s", p
->dynamic_cap_out
, p
->dynamic_cap_in
, VTY_NEWLINE
);
11651 vty_out (vty
, " Total: %10d %10d%s", p
->open_out
+ p
->notify_out
+
11652 p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
+ p
->dynamic_cap_out
,
11653 p
->open_in
+ p
->notify_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
+
11654 p
->dynamic_cap_in
, VTY_NEWLINE
);
11659 /* advertisement-interval */
11660 json_object_int_add(json_neigh
, "minBtwnAdvertisementRunsTimerMsecs", p
->v_routeadv
* 1000);
11662 /* Update-source. */
11663 if (p
->update_if
|| p
->update_source
)
11666 json_object_string_add(json_neigh
, "updateSource", p
->update_if
);
11667 else if (p
->update_source
)
11668 json_object_string_add(json_neigh
, "updateSource", sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
11671 /* Default weight */
11672 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
11673 json_object_int_add(json_neigh
, "defaultWeight", p
->weight
);
11678 /* advertisement-interval */
11679 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
11680 p
->v_routeadv
, VTY_NEWLINE
);
11682 /* Update-source. */
11683 if (p
->update_if
|| p
->update_source
)
11685 vty_out (vty
, " Update source is ");
11687 vty_out (vty
, "%s", p
->update_if
);
11688 else if (p
->update_source
)
11689 vty_out (vty
, "%s", sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
11690 vty_out (vty
, "%s", VTY_NEWLINE
);
11693 /* Default weight */
11694 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
11695 vty_out (vty
, " Default weight %d%s", p
->weight
, VTY_NEWLINE
);
11697 vty_out (vty
, "%s", VTY_NEWLINE
);
11700 /* Address Family Information */
11701 json_object
*json_hold
= NULL
;
11704 json_hold
= json_object_new_object();
11706 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11707 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11708 if (p
->afc
[afi
][safi
])
11709 bgp_show_peer_afi (vty
, p
, afi
, safi
, use_json
, json_hold
);
11713 json_object_int_add(json_hold
, "connectionsEstablished", p
->established
);
11714 json_object_int_add(json_hold
, "connectionsDropped", p
->dropped
);
11717 vty_out (vty
, " Connections established %d; dropped %d%s", p
->established
, p
->dropped
,
11720 if (! p
->last_reset
)
11723 json_object_string_add(json_hold
, "lastReset", "never");
11725 vty_out (vty
, " Last reset never%s", VTY_NEWLINE
);
11734 uptime
= bgp_clock();
11735 uptime
-= p
->resettime
;
11736 tm
= gmtime(&uptime
);
11737 json_object_int_add(json_hold
, "lastResetTimerMsecs", (tm
->tm_sec
* 1000) + (tm
->tm_min
* 60000) + (tm
->tm_hour
* 3600000));
11738 json_object_string_add(json_hold
, "lastResetDueTo", peer_down_str
[(int) p
->last_reset
]);
11739 if (p
->last_reset_cause_size
)
11741 msg
= p
->last_reset_cause
;
11742 char adapter
[BUFSIZ
];
11743 sprintf(adapter
, "%s", msg
);
11744 json_object_string_add(json_hold
, "messageReceivedThatCausedBgpNotification", adapter
);
11749 vty_out (vty
, " Last reset %s, ",
11750 peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
, 0, NULL
));
11752 if (p
->last_reset
== PEER_DOWN_NOTIFY_SEND
||
11753 p
->last_reset
== PEER_DOWN_NOTIFY_RECEIVED
)
11755 code_str
= bgp_notify_code_str(p
->notify
.code
);
11756 subcode_str
= bgp_notify_subcode_str(p
->notify
.code
, p
->notify
.subcode
);
11757 vty_out (vty
, "due to NOTIFICATION %s (%s%s)%s",
11758 p
->last_reset
== PEER_DOWN_NOTIFY_SEND
? "sent" : "received",
11759 code_str
, subcode_str
, VTY_NEWLINE
);
11763 vty_out (vty
, "due to %s%s",
11764 peer_down_str
[(int) p
->last_reset
], VTY_NEWLINE
);
11767 if (p
->last_reset_cause_size
)
11769 msg
= p
->last_reset_cause
;
11770 vty_out(vty
, " Message received that caused BGP to send a NOTIFICATION:%s ", VTY_NEWLINE
);
11771 for (i
= 1; i
<= p
->last_reset_cause_size
; i
++)
11773 vty_out(vty
, "%02X", *msg
++);
11775 if (i
!= p
->last_reset_cause_size
)
11779 vty_out(vty
, "%s ", VTY_NEWLINE
);
11781 else if (i
% 4 == 0)
11787 vty_out(vty
, "%s", VTY_NEWLINE
);
11792 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
11795 json_object_boolean_true_add(json_hold
, "prefixesConfigExceedMax");
11797 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
11799 if (p
->t_pmax_restart
)
11803 json_object_string_add(json_hold
, "reducePrefixNumFrom", p
->host
);
11804 json_object_int_add(json_hold
, "restartInTimerMsec", thread_timer_remain_second (p
->t_pmax_restart
) * 1000);
11807 vty_out (vty
, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
11808 p
->host
, thread_timer_remain_second (p
->t_pmax_restart
),
11814 json_object_string_add(json_hold
, "reducePrefixNumAndClearIpBgp", p
->host
);
11816 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
11817 p
->host
, VTY_NEWLINE
);
11822 json_object_object_add(json_neigh
, "addressFamilyInfo", json_hold
);
11824 /* EBGP Multihop and GTSM */
11825 if (p
->sort
!= BGP_PEER_IBGP
)
11829 if (p
->gtsm_hops
> 0)
11830 json_object_int_add(json_neigh
, "externalBgpNbrMaxHopsAway", p
->gtsm_hops
);
11831 else if (p
->ttl
> 1)
11832 json_object_int_add(json_neigh
, "externalBgpNbrMaxHopsAway", p
->ttl
);
11836 if (p
->gtsm_hops
> 0)
11837 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
11838 p
->gtsm_hops
, VTY_NEWLINE
);
11839 else if (p
->ttl
> 1)
11840 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
11841 p
->ttl
, VTY_NEWLINE
);
11846 if (p
->gtsm_hops
> 0)
11849 json_object_int_add(json_neigh
, "internalBgpNbrMaxHopsAway", p
->gtsm_hops
);
11851 vty_out (vty
, " Internal BGP neighbor may be up to %d hops away.%s",
11852 p
->gtsm_hops
, VTY_NEWLINE
);
11856 /* Local address. */
11861 json_object_string_add(json_neigh
, "hostLocal", sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
));
11862 json_object_int_add(json_neigh
, "portLocal", ntohs (p
->su_local
->sin
.sin_port
));
11865 vty_out (vty
, "Local host: %s, Local port: %d%s",
11866 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
11867 ntohs (p
->su_local
->sin
.sin_port
),
11871 /* Remote address. */
11876 json_object_string_add(json_neigh
, "hostForeign", sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
));
11877 json_object_int_add(json_neigh
, "portForeign", ntohs (p
->su_remote
->sin
.sin_port
));
11880 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
11881 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
11882 ntohs (p
->su_remote
->sin
.sin_port
),
11886 /* Nexthop display. */
11891 json_object_string_add(json_neigh
, "nexthop", inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
));
11893 json_object_string_add(json_neigh
, "nexthopGlobal", inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
));
11894 json_object_string_add(json_neigh
, "nexthopLocal", inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
));
11895 if (p
->shared_network
)
11896 json_object_string_add(json_neigh
, "bgpConnection", "sharedNetwork");
11898 json_object_string_add(json_neigh
, "bgpConnection", "nonSharedNetwork");
11899 #endif /* HAVE_IPV6 */
11903 vty_out (vty
, "Nexthop: %s%s",
11904 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
11907 vty_out (vty
, "Nexthop global: %s%s",
11908 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
11910 vty_out (vty
, "Nexthop local: %s%s",
11911 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
11913 vty_out (vty
, "BGP connection: %s%s",
11914 p
->shared_network
? "shared network" : "non shared network",
11916 #endif /* HAVE_IPV6 */
11920 /* Timer information. */
11924 json_object_int_add(json_neigh
, "nextStartTimerDueInMsecs", thread_timer_remain_second (p
->t_start
) * 1000);
11926 json_object_int_add(json_neigh
, "nextConnectTimerDueInMsecs", thread_timer_remain_second (p
->t_connect
) * 1000);
11929 json_object_int_add(json_neigh
, "mraiInterval", p
->v_routeadv
);
11930 json_object_int_add(json_neigh
, "mraiTimerExpireInMsecs", thread_timer_remain_second (p
->t_routeadv
) * 1000);
11934 json_object_string_add(json_neigh
, "readThread", "on");
11936 json_object_string_add(json_neigh
, "readThread", "off");
11938 json_object_string_add(json_neigh
, "writeThread", "on");
11940 json_object_string_add(json_neigh
, "writeThread", "off");
11945 vty_out (vty
, "Next start timer due in %ld seconds%s",
11946 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
11948 vty_out (vty
, "Next connect timer due in %ld seconds%s",
11949 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
11951 vty_out (vty
, "MRAI (interval %u) timer expires in %ld seconds%s",
11952 p
->v_routeadv
, thread_timer_remain_second (p
->t_routeadv
),
11955 vty_out (vty
, "Read thread: %s Write thread: %s%s",
11956 p
->t_read
? "on" : "off",
11957 p
->t_write
? "on" : "off",
11961 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
11962 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
11963 bgp_capability_vty_out (vty
, p
, use_json
, json_neigh
);
11966 vty_out (vty
, "%s", VTY_NEWLINE
);
11968 /* BFD information. */
11969 bgp_bfd_show_info(vty
, p
, use_json
, json_neigh
);
11973 if (p
->conf_if
) /* Configured interface name. */
11974 json_object_object_add(json
, p
->conf_if
, json_neigh
);
11975 else /* Configured IP address. */
11976 json_object_object_add(json
, p
->host
, json_neigh
);
11981 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
, enum show_type type
,
11982 union sockunion
*su
, const char *conf_if
, u_char use_json
, json_object
*json
)
11984 struct listnode
*node
, *nnode
;
11987 json_object
*json_neigh
= NULL
;
11990 json_neigh
= json_object_new_object();
11992 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
11994 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
12000 bgp_show_peer (vty
, peer
, use_json
, json
, json_neigh
);
12005 if ((peer
->conf_if
&& !strcmp(peer
->conf_if
, conf_if
)) ||
12006 (peer
->hostname
&& !strcmp(peer
->hostname
, conf_if
)))
12009 bgp_show_peer (vty
, peer
, use_json
, json
, json_neigh
);
12014 if (sockunion_same (&peer
->su
, su
))
12017 bgp_show_peer (vty
, peer
, use_json
, json
, json_neigh
);
12024 if (type
== show_peer
&& ! find
)
12027 json_object_boolean_true_add(json
, "bgpNoSuchNeighbor");
12029 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
12034 vty_out (vty
, "%s%s", json_object_to_json_string(json
), VTY_NEWLINE
);
12035 json_object_free(json
);
12039 vty_out (vty
, "%s", VTY_NEWLINE
);
12042 return CMD_SUCCESS
;
12046 bgp_show_neighbor_vty (struct vty
*vty
, const char *name
,
12047 enum show_type type
, const char *ip_str
, u_char use_json
)
12051 union sockunion su
;
12052 json_object
*json
= NULL
;
12055 json
= json_object_new_object();
12059 bgp
= bgp_lookup_by_name (name
);
12064 json_object_boolean_true_add(json
, "bgpNoSuchInstance");
12065 vty_out (vty
, "%s%s", json_object_to_json_string(json
), VTY_NEWLINE
);
12066 json_object_free(json
);
12069 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
12071 return CMD_WARNING
;
12076 bgp
= bgp_get_default ();
12083 ret
= str2sockunion (ip_str
, &su
);
12085 bgp_show_neighbor (vty
, bgp
, type
, NULL
, ip_str
, use_json
, json
);
12087 bgp_show_neighbor (vty
, bgp
, type
, &su
, NULL
, use_json
, json
);
12091 bgp_show_neighbor (vty
, bgp
, type
, NULL
, NULL
, use_json
, json
);
12095 return CMD_SUCCESS
;
12098 /* "show ip bgp neighbors" commands. */
12099 DEFUN (show_ip_bgp_neighbors
,
12100 show_ip_bgp_neighbors_cmd
,
12101 "show ip bgp neighbors {json}",
12105 "Detailed information on TCP and BGP neighbor connections\n"
12106 "JavaScript Object Notation\n")
12108 u_char uj
= use_json(argc
, argv
);
12110 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
, uj
);
12113 ALIAS (show_ip_bgp_neighbors
,
12114 show_ip_bgp_ipv4_neighbors_cmd
,
12115 "show ip bgp ipv4 (unicast|multicast) neighbors {json}",
12120 "Address Family modifier\n"
12121 "Address Family modifier\n"
12122 "Detailed information on TCP and BGP neighbor connections\n"
12123 "JavaScript Object Notation\n")
12125 ALIAS (show_ip_bgp_neighbors
,
12126 show_ip_bgp_vpnv4_all_neighbors_cmd
,
12127 "show ip bgp vpnv4 all neighbors {json}",
12131 "Display VPNv4 NLRI specific information\n"
12132 "Display information about all VPNv4 NLRIs\n"
12133 "Detailed information on TCP and BGP neighbor connections\n"
12134 "JavaScript Object Notation\n")
12136 ALIAS (show_ip_bgp_neighbors
,
12137 show_ip_bgp_vpnv4_rd_neighbors_cmd
,
12138 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors {json}",
12142 "Display VPNv4 NLRI specific information\n"
12143 "Display information for a route distinguisher\n"
12144 "VPN Route Distinguisher\n"
12145 "Detailed information on TCP and BGP neighbor connections\n"
12146 "JavaScript Object Notation\n")
12148 ALIAS (show_ip_bgp_neighbors
,
12149 show_bgp_neighbors_cmd
,
12150 "show bgp neighbors {json}",
12153 "Detailed information on TCP and BGP neighbor connections\n"
12154 "JavaScript Object Notation\n")
12156 ALIAS (show_ip_bgp_neighbors
,
12157 show_bgp_ipv6_neighbors_cmd
,
12158 "show bgp ipv6 neighbors {json}",
12162 "Detailed information on TCP and BGP neighbor connections\n"
12163 "JavaScript Object Notation\n")
12165 DEFUN (show_ip_bgp_neighbors_peer
,
12166 show_ip_bgp_neighbors_peer_cmd
,
12167 "show ip bgp neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12171 "Detailed information on TCP and BGP neighbor connections\n"
12172 "Neighbor to display information about\n"
12173 "Neighbor to display information about\n"
12174 "Neighbor on bgp configured interface\n"
12175 "JavaScript Object Notation\n")
12177 u_char uj
= use_json(argc
, argv
);
12179 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 2], uj
);
12182 ALIAS (show_ip_bgp_neighbors_peer
,
12183 show_ip_bgp_ipv4_neighbors_peer_cmd
,
12184 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12189 "Address Family modifier\n"
12190 "Address Family modifier\n"
12191 "Detailed information on TCP and BGP neighbor connections\n"
12192 "Neighbor to display information about\n"
12193 "Neighbor to display information about\n"
12194 "Neighbor on bgp configured interface\n"
12195 "JavaScript Object Notation\n")
12197 ALIAS (show_ip_bgp_neighbors_peer
,
12198 show_ip_bgp_vpnv4_all_neighbors_peer_cmd
,
12199 "show ip bgp vpnv4 all neighbors A.B.C.D {json}",
12203 "Display VPNv4 NLRI specific information\n"
12204 "Display information about all VPNv4 NLRIs\n"
12205 "Detailed information on TCP and BGP neighbor connections\n"
12206 "Neighbor to display information about\n"
12207 "JavaScript Object Notation\n")
12209 ALIAS (show_ip_bgp_neighbors_peer
,
12210 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
,
12211 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D {json}",
12215 "Display VPNv4 NLRI specific information\n"
12216 "Display information about all VPNv4 NLRIs\n"
12217 "Detailed information on TCP and BGP neighbor connections\n"
12218 "Neighbor to display information about\n"
12219 "JavaScript Object Notation\n")
12221 ALIAS (show_ip_bgp_neighbors_peer
,
12222 show_bgp_neighbors_peer_cmd
,
12223 "show bgp neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12226 "Detailed information on TCP and BGP neighbor connections\n"
12227 "Neighbor to display information about\n"
12228 "Neighbor to display information about\n"
12229 "Neighbor on bgp configured interface\n"
12230 "JavaScript Object Notation\n")
12232 ALIAS (show_ip_bgp_neighbors_peer
,
12233 show_bgp_ipv6_neighbors_peer_cmd
,
12234 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12238 "Detailed information on TCP and BGP neighbor connections\n"
12239 "Neighbor to display information about\n"
12240 "Neighbor to display information about\n"
12241 "Neighbor on bgp configured interface\n"
12242 "JavaScript Object Notation\n")
12244 DEFUN (show_ip_bgp_instance_neighbors
,
12245 show_ip_bgp_instance_neighbors_cmd
,
12246 "show ip bgp " BGP_INSTANCE_CMD
" neighbors {json}",
12250 BGP_INSTANCE_HELP_STR
12251 "Detailed information on TCP and BGP neighbor connections\n"
12252 "JavaScript Object Notation\n")
12254 u_char uj
= use_json(argc
, argv
);
12256 return bgp_show_neighbor_vty (vty
, argv
[1], show_all
, NULL
, uj
);
12259 ALIAS (show_ip_bgp_instance_neighbors
,
12260 show_bgp_instance_neighbors_cmd
,
12261 "show bgp " BGP_INSTANCE_CMD
" neighbors {json}",
12264 BGP_INSTANCE_HELP_STR
12265 "Detailed information on TCP and BGP neighbor connections\n"
12266 "JavaScript Object Notation\n")
12268 ALIAS (show_ip_bgp_instance_neighbors
,
12269 show_bgp_instance_ipv6_neighbors_cmd
,
12270 "show bgp " BGP_INSTANCE_CMD
" ipv6 neighbors {json}",
12273 BGP_INSTANCE_HELP_STR
12275 "Detailed information on TCP and BGP neighbor connections\n"
12276 "JavaScript Object Notation\n")
12278 DEFUN (show_ip_bgp_instance_neighbors_peer
,
12279 show_ip_bgp_instance_neighbors_peer_cmd
,
12280 "show ip bgp " BGP_INSTANCE_CMD
" neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12284 BGP_INSTANCE_HELP_STR
12285 "Detailed information on TCP and BGP neighbor connections\n"
12286 "Neighbor to display information about\n"
12287 "Neighbor to display information about\n"
12288 "Neighbor on bgp configured interface\n"
12289 "JavaScript Object Notation\n")
12291 u_char uj
= use_json(argc
, argv
);
12293 return bgp_show_neighbor_vty (vty
, argv
[1], show_peer
, argv
[2], uj
);
12296 ALIAS (show_ip_bgp_instance_neighbors_peer
,
12297 show_bgp_instance_neighbors_peer_cmd
,
12298 "show bgp " BGP_INSTANCE_CMD
" neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12301 BGP_INSTANCE_HELP_STR
12302 "Detailed information on TCP and BGP neighbor connections\n"
12303 "Neighbor to display information about\n"
12304 "Neighbor to display information about\n"
12305 "Neighbor on bgp configured interface\n"
12306 "JavaScript Object Notation\n")
12308 ALIAS (show_ip_bgp_instance_neighbors_peer
,
12309 show_bgp_instance_ipv6_neighbors_peer_cmd
,
12310 "show bgp " BGP_INSTANCE_CMD
" ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12313 BGP_INSTANCE_HELP_STR
12315 "Detailed information on TCP and BGP neighbor connections\n"
12316 "Neighbor to display information about\n"
12317 "Neighbor to display information about\n"
12318 "Neighbor on bgp configured interface\n"
12319 "JavaScript Object Notation\n")
12321 /* Show BGP's AS paths internal data. There are both `show ip bgp
12322 paths' and `show ip mbgp paths'. Those functions results are the
12324 DEFUN (show_ip_bgp_paths
,
12325 show_ip_bgp_paths_cmd
,
12326 "show ip bgp paths",
12330 "Path information\n")
12332 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
12333 aspath_print_all_vty (vty
);
12334 return CMD_SUCCESS
;
12337 DEFUN (show_ip_bgp_ipv4_paths
,
12338 show_ip_bgp_ipv4_paths_cmd
,
12339 "show ip bgp ipv4 (unicast|multicast) paths",
12344 "Address Family modifier\n"
12345 "Address Family modifier\n"
12346 "Path information\n")
12348 vty_out (vty
, "Address Refcnt Path\r\n");
12349 aspath_print_all_vty (vty
);
12351 return CMD_SUCCESS
;
12357 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
12359 struct community
*com
;
12361 com
= (struct community
*) backet
->data
;
12362 vty_out (vty
, "[%p] (%ld) %s%s", backet
, com
->refcnt
,
12363 community_str (com
), VTY_NEWLINE
);
12366 /* Show BGP's community internal data. */
12367 DEFUN (show_ip_bgp_community_info
,
12368 show_ip_bgp_community_info_cmd
,
12369 "show ip bgp community-info",
12373 "List all bgp community information\n")
12375 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
12377 hash_iterate (community_hash (),
12378 (void (*) (struct hash_backet
*, void *))
12379 community_show_all_iterator
,
12382 return CMD_SUCCESS
;
12385 DEFUN (show_ip_bgp_attr_info
,
12386 show_ip_bgp_attr_info_cmd
,
12387 "show ip bgp attribute-info",
12391 "List all bgp attribute information\n")
12393 attr_show_all (vty
);
12394 return CMD_SUCCESS
;
12397 static int bgp_show_update_groups(struct vty
*vty
, const char *name
,
12399 u_int64_t subgrp_id
)
12404 bgp
= bgp_lookup_by_name (name
);
12406 bgp
= bgp_get_default ();
12409 update_group_show(bgp
, afi
, safi
, vty
, subgrp_id
);
12410 return CMD_SUCCESS
;
12413 DEFUN (show_ip_bgp_updgrps
,
12414 show_ip_bgp_updgrps_cmd
,
12415 "show ip bgp update-groups",
12419 "Detailed info about dynamic update groups\n")
12421 return (bgp_show_update_groups(vty
, NULL
, AFI_IP
, SAFI_UNICAST
, 0));
12424 DEFUN (show_ip_bgp_instance_updgrps
,
12425 show_ip_bgp_instance_updgrps_cmd
,
12426 "show ip bgp " BGP_INSTANCE_CMD
" update-groups",
12430 BGP_INSTANCE_HELP_STR
12431 "Detailed info about dynamic update groups\n")
12433 return (bgp_show_update_groups(vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, 0));
12436 DEFUN (show_bgp_ipv6_updgrps
,
12437 show_bgp_ipv6_updgrps_cmd
,
12438 "show bgp update-groups",
12441 "Detailed info about v6 dynamic update groups\n")
12443 return (bgp_show_update_groups(vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, 0));
12446 DEFUN (show_bgp_instance_ipv6_updgrps
,
12447 show_bgp_instance_ipv6_updgrps_cmd
,
12448 "show bgp " BGP_INSTANCE_CMD
" update-groups",
12451 BGP_INSTANCE_HELP_STR
12452 "Detailed info about v6 dynamic update groups\n")
12454 return (bgp_show_update_groups(vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, 0));
12457 DEFUN (show_bgp_updgrps
,
12458 show_bgp_updgrps_cmd
,
12459 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups",
12464 "Address Family modifier\n"
12465 "Address Family modifier\n"
12466 "Detailed info about dynamic update groups\n")
12471 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
12472 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
12473 return (bgp_show_update_groups(vty
, NULL
, afi
, safi
, 0));
12476 DEFUN (show_ip_bgp_updgrps_s
,
12477 show_ip_bgp_updgrps_s_cmd
,
12478 "show ip bgp update-groups SUBGROUP-ID",
12482 "Detailed info about dynamic update groups\n"
12483 "Specific subgroup to display detailed info for\n")
12485 u_int64_t subgrp_id
;
12487 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
12488 return (bgp_show_update_groups(vty
, NULL
, AFI_IP
, SAFI_UNICAST
, subgrp_id
));
12491 DEFUN (show_ip_bgp_instance_updgrps_s
,
12492 show_ip_bgp_instance_updgrps_s_cmd
,
12493 "show ip bgp " BGP_INSTANCE_CMD
" update-groups SUBGROUP-ID",
12497 BGP_INSTANCE_HELP_STR
12498 "Detailed info about dynamic update groups\n"
12499 "Specific subgroup to display detailed info for\n")
12501 u_int64_t subgrp_id
;
12503 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
12504 return (bgp_show_update_groups(vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, subgrp_id
));
12507 DEFUN (show_bgp_ipv6_updgrps_s
,
12508 show_bgp_ipv6_updgrps_s_cmd
,
12509 "show bgp update-groups SUBGROUP-ID",
12512 "Detailed info about v6 dynamic update groups\n"
12513 "Specific subgroup to display detailed info for\n")
12515 u_int64_t subgrp_id
;
12517 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
12518 return(bgp_show_update_groups(vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, subgrp_id
));
12521 DEFUN (show_bgp_instance_ipv6_updgrps_s
,
12522 show_bgp_instance_ipv6_updgrps_s_cmd
,
12523 "show bgp " BGP_INSTANCE_CMD
" update-groups SUBGROUP-ID",
12526 "Detailed info about v6 dynamic update groups\n"
12527 "Specific subgroup to display detailed info for\n")
12529 u_int64_t subgrp_id
;
12531 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
12532 return(bgp_show_update_groups(vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, subgrp_id
));
12535 DEFUN (show_bgp_updgrps_s
,
12536 show_bgp_updgrps_s_cmd
,
12537 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups SUBGROUP-ID",
12542 "Address Family modifier\n"
12543 "Address Family modifier\n"
12544 "Detailed info about v6 dynamic update groups\n"
12545 "Specific subgroup to display detailed info for")
12549 u_int64_t subgrp_id
;
12551 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
12552 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
12554 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
12555 return(bgp_show_update_groups(vty
, NULL
, afi
, safi
, subgrp_id
));
12558 DEFUN (show_bgp_updgrps_stats
,
12559 show_bgp_updgrps_stats_cmd
,
12560 "show bgp update-groups statistics",
12563 "BGP update groups\n"
12568 bgp
= bgp_get_default();
12570 update_group_show_stats(bgp
, vty
);
12572 return CMD_SUCCESS
;
12575 DEFUN (show_bgp_instance_updgrps_stats
,
12576 show_bgp_instance_updgrps_stats_cmd
,
12577 "show bgp " BGP_INSTANCE_CMD
" update-groups statistics",
12580 BGP_INSTANCE_HELP_STR
12581 "BGP update groups\n"
12586 bgp
= bgp_lookup_by_name (argv
[1]);
12588 update_group_show_stats(bgp
, vty
);
12590 return CMD_SUCCESS
;
12594 show_bgp_updgrps_adj_info_aux (struct vty
*vty
, const char *name
,
12595 afi_t afi
, safi_t safi
,
12596 const char *what
, u_int64_t subgrp_id
)
12601 bgp
= bgp_lookup_by_name (name
);
12603 bgp
= bgp_get_default ();
12607 if (!strcmp(what
, "advertise-queue"))
12608 update_group_show_adj_queue(bgp
, afi
, safi
, vty
, subgrp_id
);
12609 else if (!strcmp(what
, "advertised-routes"))
12610 update_group_show_advertised(bgp
, afi
, safi
, vty
, subgrp_id
);
12611 else if (!strcmp(what
, "packet-queue"))
12612 update_group_show_packet_queue(bgp
, afi
, safi
, vty
, subgrp_id
);
12616 DEFUN (show_ip_bgp_updgrps_adj
,
12617 show_ip_bgp_updgrps_adj_cmd
,
12618 "show ip bgp update-groups (advertise-queue|advertised-routes|packet-queue)",
12622 "BGP update groups\n"
12623 "Advertisement queue\n"
12624 "Announced routes\n"
12628 show_bgp_updgrps_adj_info_aux(vty
, NULL
, AFI_IP
, SAFI_UNICAST
, argv
[0], 0);
12629 return CMD_SUCCESS
;
12632 DEFUN (show_ip_bgp_instance_updgrps_adj
,
12633 show_ip_bgp_instance_updgrps_adj_cmd
,
12634 "show ip bgp " BGP_INSTANCE_CMD
" update-groups (advertise-queue|advertised-routes|packet-queue)",
12638 BGP_INSTANCE_HELP_STR
12639 "BGP update groups\n"
12640 "Advertisement queue\n"
12641 "Announced routes\n"
12645 show_bgp_updgrps_adj_info_aux(vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, argv
[2], 0);
12646 return CMD_SUCCESS
;
12649 DEFUN (show_bgp_updgrps_afi_adj
,
12650 show_bgp_updgrps_afi_adj_cmd
,
12651 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups (advertise-queue|advertised-routes|packet-queue)",
12656 "Address Family modifier\n"
12657 "Address Family modifier\n"
12658 "BGP update groups\n"
12659 "Advertisement queue\n"
12660 "Announced routes\n"
12662 "Specific subgroup info wanted for\n")
12667 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
12668 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
12669 show_bgp_updgrps_adj_info_aux(vty
, NULL
, afi
, safi
, argv
[2], 0);
12670 return CMD_SUCCESS
;
12673 DEFUN (show_bgp_updgrps_adj
,
12674 show_bgp_updgrps_adj_cmd
,
12675 "show bgp update-groups (advertise-queue|advertised-routes|packet-queue)",
12678 "BGP update groups\n"
12679 "Advertisement queue\n"
12680 "Announced routes\n"
12683 show_bgp_updgrps_adj_info_aux(vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, argv
[0], 0);
12684 return CMD_SUCCESS
;
12687 DEFUN (show_bgp_instance_updgrps_adj
,
12688 show_bgp_instance_updgrps_adj_cmd
,
12689 "show bgp " BGP_INSTANCE_CMD
" update-groups (advertise-queue|advertised-routes|packet-queue)",
12692 BGP_INSTANCE_HELP_STR
12693 "BGP update groups\n"
12694 "Advertisement queue\n"
12695 "Announced routes\n"
12698 show_bgp_updgrps_adj_info_aux(vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, argv
[2], 0);
12699 return CMD_SUCCESS
;
12702 DEFUN (show_ip_bgp_updgrps_adj_s
,
12703 show_ip_bgp_updgrps_adj_s_cmd
,
12704 "show ip bgp update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
12708 "BGP update groups\n"
12709 "Specific subgroup to display info for\n"
12710 "Advertisement queue\n"
12711 "Announced routes\n"
12715 u_int64_t subgrp_id
;
12717 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
12719 show_bgp_updgrps_adj_info_aux(vty
, NULL
, AFI_IP
, SAFI_UNICAST
, argv
[1], subgrp_id
);
12720 return CMD_SUCCESS
;
12723 DEFUN (show_ip_bgp_instance_updgrps_adj_s
,
12724 show_ip_bgp_instance_updgrps_adj_s_cmd
,
12725 "show ip bgp " BGP_INSTANCE_CMD
" update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
12729 BGP_INSTANCE_HELP_STR
12730 "BGP update groups\n"
12731 "Specific subgroup to display info for\n"
12732 "Advertisement queue\n"
12733 "Announced routes\n"
12737 u_int64_t subgrp_id
;
12739 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
12741 show_bgp_updgrps_adj_info_aux(vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, argv
[3], subgrp_id
);
12742 return CMD_SUCCESS
;
12745 DEFUN (show_bgp_updgrps_afi_adj_s
,
12746 show_bgp_updgrps_afi_adj_s_cmd
,
12747 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
12752 "Address Family modifier\n"
12753 "Address Family modifier\n"
12754 "BGP update groups\n"
12755 "Specific subgroup to display info for\n"
12756 "Advertisement queue\n"
12757 "Announced routes\n"
12759 "Specific subgroup info wanted for\n")
12763 u_int64_t subgrp_id
;
12765 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
12766 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
12767 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
12769 show_bgp_updgrps_adj_info_aux(vty
, NULL
, afi
, safi
, argv
[3], subgrp_id
);
12770 return CMD_SUCCESS
;
12773 DEFUN (show_bgp_updgrps_adj_s
,
12774 show_bgp_updgrps_adj_s_cmd
,
12775 "show bgp update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
12778 "BGP update groups\n"
12779 "Specific subgroup to display info for\n"
12780 "Advertisement queue\n"
12781 "Announced routes\n"
12784 u_int64_t subgrp_id
;
12786 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
12788 show_bgp_updgrps_adj_info_aux(vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, argv
[1], subgrp_id
);
12789 return CMD_SUCCESS
;
12792 DEFUN (show_bgp_instance_updgrps_adj_s
,
12793 show_bgp_instance_updgrps_adj_s_cmd
,
12794 "show bgp " BGP_INSTANCE_CMD
" update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
12797 BGP_INSTANCE_HELP_STR
12798 "BGP update groups\n"
12799 "Specific subgroup to display info for\n"
12800 "Advertisement queue\n"
12801 "Announced routes\n"
12804 u_int64_t subgrp_id
;
12806 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
12808 show_bgp_updgrps_adj_info_aux(vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, argv
[3], subgrp_id
);
12809 return CMD_SUCCESS
;
12815 bgp_show_one_peer_group (struct vty
*vty
, struct peer_group
*group
)
12817 struct listnode
*node
, *nnode
;
12818 struct prefix
*range
;
12821 char buf
[PREFIX2STR_BUFFER
];
12824 const char *peer_status
;
12825 const char *af_str
;
12830 conf
= group
->conf
;
12832 if (conf
->as_type
== AS_SPECIFIED
||
12833 conf
->as_type
== AS_EXTERNAL
) {
12834 vty_out (vty
, "%sBGP peer-group %s, remote AS %d%s",
12835 VTY_NEWLINE
, group
->name
, conf
->as
, VTY_NEWLINE
);
12836 } else if (conf
->as_type
== AS_INTERNAL
) {
12837 vty_out (vty
, "%sBGP peer-group %s, remote AS %d%s",
12838 VTY_NEWLINE
, group
->name
, group
->bgp
->as
, VTY_NEWLINE
);
12840 vty_out (vty
, "%sBGP peer-group %s%s",
12841 VTY_NEWLINE
, group
->name
, VTY_NEWLINE
);
12844 if ((group
->bgp
->as
== conf
->as
) || (conf
->as_type
== AS_INTERNAL
))
12845 vty_out (vty
, " Peer-group type is internal%s", VTY_NEWLINE
);
12847 vty_out (vty
, " Peer-group type is external%s", VTY_NEWLINE
);
12849 /* Display AFs configured. */
12850 vty_out (vty
, " Configured address-families:");
12851 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
12852 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
12854 if (conf
->afc
[afi
][safi
])
12857 vty_out (vty
, " %s;", afi_safi_print(afi
, safi
));
12861 vty_out (vty
, " none%s", VTY_NEWLINE
);
12863 vty_out (vty
, "%s", VTY_NEWLINE
);
12865 /* Display listen ranges (for dynamic neighbors), if any */
12866 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
12870 else if (afi
== AFI_IP6
)
12872 lr_count
= listcount(group
->listen_range
[afi
]);
12876 " %d %s listen range(s)%s",
12877 lr_count
, af_str
, VTY_NEWLINE
);
12880 for (ALL_LIST_ELEMENTS (group
->listen_range
[afi
], node
,
12883 prefix2str(range
, buf
, sizeof(buf
));
12884 vty_out(vty
, " %s%s", buf
, VTY_NEWLINE
);
12889 /* Display group members and their status */
12890 if (listcount(group
->peer
))
12892 vty_out (vty
, " Peer-group members:%s", VTY_NEWLINE
);
12893 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
12895 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
12896 peer_status
= "Idle (Admin)";
12897 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
12898 peer_status
= "Idle (PfxCt)";
12900 peer_status
= LOOKUP(bgp_status_msg
, peer
->status
);
12902 dynamic
= peer_dynamic_neighbor(peer
);
12903 vty_out (vty
, " %s %s %s %s",
12904 peer
->host
, dynamic
? "(dynamic)" : "",
12905 peer_status
, VTY_NEWLINE
);
12909 return CMD_SUCCESS
;
12912 /* Show BGP peer group's information. */
12913 enum show_group_type
12920 bgp_show_peer_group (struct vty
*vty
, struct bgp
*bgp
,
12921 enum show_group_type type
, const char *group_name
)
12923 struct listnode
*node
, *nnode
;
12924 struct peer_group
*group
;
12927 for (ALL_LIST_ELEMENTS (bgp
->group
, node
, nnode
, group
))
12931 case show_all_groups
:
12932 bgp_show_one_peer_group (vty
, group
);
12934 case show_peer_group
:
12935 if (group_name
&& (strcmp(group
->name
, group_name
) == 0))
12938 bgp_show_one_peer_group (vty
, group
);
12944 if (type
== show_peer_group
&& ! find
)
12945 vty_out (vty
, "%% No such peer-groupr%s", VTY_NEWLINE
);
12947 return CMD_SUCCESS
;
12951 bgp_show_peer_group_vty (struct vty
*vty
, const char *name
,
12952 enum show_group_type type
, const char *group_name
)
12955 int ret
= CMD_SUCCESS
;
12958 bgp
= bgp_lookup_by_name (name
);
12960 bgp
= bgp_get_default ();
12964 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
12965 return CMD_WARNING
;
12968 ret
= bgp_show_peer_group (vty
, bgp
, type
, group_name
);
12973 DEFUN (show_ip_bgp_peer_groups
,
12974 show_ip_bgp_peer_groups_cmd
,
12975 "show ip bgp peer-group",
12979 "Detailed information on all BGP peer groups\n")
12981 return bgp_show_peer_group_vty (vty
, NULL
, show_all_groups
, NULL
);
12984 DEFUN (show_ip_bgp_instance_peer_groups
,
12985 show_ip_bgp_instance_peer_groups_cmd
,
12986 "show ip bgp " BGP_INSTANCE_CMD
" peer-group",
12990 BGP_INSTANCE_HELP_STR
12991 "Detailed information on all BGP peer groups\n")
12993 return bgp_show_peer_group_vty (vty
, argv
[1], show_all_groups
, NULL
);
12996 DEFUN (show_ip_bgp_peer_group
,
12997 show_ip_bgp_peer_group_cmd
,
12998 "show ip bgp peer-group WORD",
13002 "BGP peer-group name\n"
13003 "Detailed information on a BGP peer group\n")
13005 return bgp_show_peer_group_vty (vty
, NULL
, show_peer_group
, argv
[0]);
13008 DEFUN (show_ip_bgp_instance_peer_group
,
13009 show_ip_bgp_instance_peer_group_cmd
,
13010 "show ip bgp " BGP_INSTANCE_CMD
" peer-group WORD",
13014 BGP_INSTANCE_HELP_STR
13015 "BGP peer-group name\n"
13016 "Detailed information on a BGP peer group\n")
13018 return bgp_show_peer_group_vty (vty
, argv
[1], show_peer_group
, argv
[2]);
13021 /* Redistribute VTY commands. */
13023 DEFUN (bgp_redistribute_ipv4
,
13024 bgp_redistribute_ipv4_cmd
,
13025 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
,
13026 "Redistribute information from another routing protocol\n"
13027 QUAGGA_IP_REDIST_HELP_STR_BGPD
)
13031 type
= proto_redistnum (AFI_IP
, argv
[0]);
13032 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13034 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13035 return CMD_WARNING
;
13037 bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
13038 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
, 0);
13041 DEFUN (bgp_redistribute_ipv4_rmap
,
13042 bgp_redistribute_ipv4_rmap_cmd
,
13043 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD",
13044 "Redistribute information from another routing protocol\n"
13045 QUAGGA_IP_REDIST_HELP_STR_BGPD
13046 "Route map reference\n"
13047 "Pointer to route-map entries\n")
13050 struct bgp_redist
*red
;
13052 type
= proto_redistnum (AFI_IP
, argv
[0]);
13053 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13055 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13056 return CMD_WARNING
;
13059 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
13060 bgp_redistribute_rmap_set (red
, argv
[1]);
13061 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
, 0);
13064 DEFUN (bgp_redistribute_ipv4_metric
,
13065 bgp_redistribute_ipv4_metric_cmd
,
13066 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295>",
13067 "Redistribute information from another routing protocol\n"
13068 QUAGGA_IP_REDIST_HELP_STR_BGPD
13069 "Metric for redistributed routes\n"
13070 "Default metric\n")
13074 struct bgp_redist
*red
;
13076 type
= proto_redistnum (AFI_IP
, argv
[0]);
13077 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13079 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13080 return CMD_WARNING
;
13082 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
13084 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
13085 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, type
, metric
);
13086 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
, 0);
13089 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
13090 bgp_redistribute_ipv4_rmap_metric_cmd
,
13091 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
13092 "Redistribute information from another routing protocol\n"
13093 QUAGGA_IP_REDIST_HELP_STR_BGPD
13094 "Route map reference\n"
13095 "Pointer to route-map entries\n"
13096 "Metric for redistributed routes\n"
13097 "Default metric\n")
13101 struct bgp_redist
*red
;
13103 type
= proto_redistnum (AFI_IP
, argv
[0]);
13104 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13106 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13107 return CMD_WARNING
;
13109 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
13111 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
13112 bgp_redistribute_rmap_set (red
, argv
[1]);
13113 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, type
, metric
);
13114 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
, 0);
13117 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
13118 bgp_redistribute_ipv4_metric_rmap_cmd
,
13119 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
13120 "Redistribute information from another routing protocol\n"
13121 QUAGGA_IP_REDIST_HELP_STR_BGPD
13122 "Metric for redistributed routes\n"
13124 "Route map reference\n"
13125 "Pointer to route-map entries\n")
13129 struct bgp_redist
*red
;
13131 type
= proto_redistnum (AFI_IP
, argv
[0]);
13132 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13134 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13135 return CMD_WARNING
;
13137 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
13139 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
13140 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, type
, metric
);
13141 bgp_redistribute_rmap_set (red
, argv
[2]);
13142 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
, 0);
13145 DEFUN (bgp_redistribute_ipv4_ospf
,
13146 bgp_redistribute_ipv4_ospf_cmd
,
13147 "redistribute (ospf|table) <1-65535>",
13148 "Redistribute information from another routing protocol\n"
13149 "Open Shortest Path First (OSPFv2)\n"
13150 "Non-main Kernel Routing Table\n"
13151 "Instance ID/Table ID\n")
13156 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13158 if (strncmp(argv
[0], "o", 1) == 0)
13159 protocol
= ZEBRA_ROUTE_OSPF
;
13161 protocol
= ZEBRA_ROUTE_TABLE
;
13163 bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
13164 return bgp_redistribute_set (vty
->index
, AFI_IP
, protocol
, instance
);
13167 DEFUN (bgp_redistribute_ipv4_ospf_rmap
,
13168 bgp_redistribute_ipv4_ospf_rmap_cmd
,
13169 "redistribute (ospf|table) <1-65535> route-map WORD",
13170 "Redistribute information from another routing protocol\n"
13171 "Open Shortest Path First (OSPFv2)\n"
13172 "Non-main Kernel Routing Table\n"
13173 "Instance ID/Table ID\n"
13174 "Route map reference\n"
13175 "Pointer to route-map entries\n")
13177 struct bgp_redist
*red
;
13181 if (strncmp(argv
[0], "o", 1) == 0)
13182 protocol
= ZEBRA_ROUTE_OSPF
;
13184 protocol
= ZEBRA_ROUTE_TABLE
;
13186 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13187 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
13188 bgp_redistribute_rmap_set (red
, argv
[2]);
13189 return bgp_redistribute_set (vty
->index
, AFI_IP
, protocol
, instance
);
13192 DEFUN (bgp_redistribute_ipv4_ospf_metric
,
13193 bgp_redistribute_ipv4_ospf_metric_cmd
,
13194 "redistribute (ospf|table) <1-65535> metric <0-4294967295>",
13195 "Redistribute information from another routing protocol\n"
13196 "Open Shortest Path First (OSPFv2)\n"
13197 "Non-main Kernel Routing Table\n"
13198 "Instance ID/Table ID\n"
13199 "Metric for redistributed routes\n"
13200 "Default metric\n")
13203 struct bgp_redist
*red
;
13207 if (strncmp(argv
[0], "o", 1) == 0)
13208 protocol
= ZEBRA_ROUTE_OSPF
;
13210 protocol
= ZEBRA_ROUTE_TABLE
;
13212 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13213 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
13215 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
13216 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, protocol
, metric
);
13217 return bgp_redistribute_set (vty
->index
, AFI_IP
, protocol
, instance
);
13220 DEFUN (bgp_redistribute_ipv4_ospf_rmap_metric
,
13221 bgp_redistribute_ipv4_ospf_rmap_metric_cmd
,
13222 "redistribute (ospf|table) <1-65535> route-map WORD metric <0-4294967295>",
13223 "Redistribute information from another routing protocol\n"
13224 "Open Shortest Path First (OSPFv2)\n"
13225 "Non-main Kernel Routing Table\n"
13226 "Instance ID/Table ID\n"
13227 "Route map reference\n"
13228 "Pointer to route-map entries\n"
13229 "Metric for redistributed routes\n"
13230 "Default metric\n")
13233 struct bgp_redist
*red
;
13237 if (strncmp(argv
[0], "o", 1) == 0)
13238 protocol
= ZEBRA_ROUTE_OSPF
;
13240 protocol
= ZEBRA_ROUTE_TABLE
;
13242 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13243 VTY_GET_INTEGER ("metric", metric
, argv
[3]);
13245 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
13246 bgp_redistribute_rmap_set (red
, argv
[2]);
13247 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, protocol
, metric
);
13248 return bgp_redistribute_set (vty
->index
, AFI_IP
, protocol
, instance
);
13251 DEFUN (bgp_redistribute_ipv4_ospf_metric_rmap
,
13252 bgp_redistribute_ipv4_ospf_metric_rmap_cmd
,
13253 "redistribute (ospf|table) <1-65535> metric <0-4294967295> route-map WORD",
13254 "Redistribute information from another routing protocol\n"
13255 "Open Shortest Path First (OSPFv2)\n"
13256 "Non-main Kernel Routing Table\n"
13257 "Instance ID/Table ID\n"
13258 "Metric for redistributed routes\n"
13260 "Route map reference\n"
13261 "Pointer to route-map entries\n")
13264 struct bgp_redist
*red
;
13268 if (strncmp(argv
[0], "o", 1) == 0)
13269 protocol
= ZEBRA_ROUTE_OSPF
;
13271 protocol
= ZEBRA_ROUTE_TABLE
;
13273 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13274 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
13276 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
13277 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, protocol
, metric
);
13278 bgp_redistribute_rmap_set (red
, argv
[3]);
13279 return bgp_redistribute_set (vty
->index
, AFI_IP
, protocol
, instance
);
13282 DEFUN (no_bgp_redistribute_ipv4_ospf
,
13283 no_bgp_redistribute_ipv4_ospf_cmd
,
13284 "no redistribute (ospf|table) <1-65535>",
13286 "Redistribute information from another routing protocol\n"
13287 "Open Shortest Path First (OSPFv2)\n"
13288 "Non-main Kernel Routing Table\n"
13289 "Instance ID/Table ID\n")
13294 if (strncmp(argv
[0], "o", 1) == 0)
13295 protocol
= ZEBRA_ROUTE_OSPF
;
13297 protocol
= ZEBRA_ROUTE_TABLE
;
13299 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13300 return bgp_redistribute_unset (vty
->index
, AFI_IP
, protocol
, instance
);
13303 ALIAS (no_bgp_redistribute_ipv4_ospf
,
13304 no_bgp_redistribute_ipv4_ospf_rmap_cmd
,
13305 "no redistribute (ospf|table) <1-65535> route-map WORD",
13307 "Redistribute information from another routing protocol\n"
13308 "Open Shortest Path First (OSPFv2)\n"
13309 "Non-main Kernel Routing Table\n"
13310 "Instance ID/Table ID\n"
13311 "Route map reference\n"
13312 "Pointer to route-map entries\n")
13314 ALIAS (no_bgp_redistribute_ipv4_ospf
,
13315 no_bgp_redistribute_ipv4_ospf_metric_cmd
,
13316 "no redistribute (ospf|table) <1-65535> metric <0-4294967295>",
13318 "Redistribute information from another routing protocol\n"
13319 "Open Shortest Path First (OSPFv2)\n"
13320 "Non-main Kernel Routing Table\n"
13321 "Instance ID/Table ID\n"
13322 "Metric for redistributed routes\n"
13323 "Default metric\n")
13325 ALIAS (no_bgp_redistribute_ipv4_ospf
,
13326 no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd
,
13327 "no redistribute (ospf|table) <1-65535> route-map WORD metric <0-4294967295>",
13329 "Redistribute information from another routing protocol\n"
13330 "Open Shortest Path First (OSPFv2)\n"
13331 "Non-main Kernel Routing Table\n"
13332 "Instance ID/Table ID\n"
13333 "Route map reference\n"
13334 "Pointer to route-map entries\n"
13335 "Metric for redistributed routes\n"
13336 "Default metric\n")
13338 ALIAS (no_bgp_redistribute_ipv4_ospf
,
13339 no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd
,
13340 "no redistribute (ospf|table) <1-65535> metric <0-4294967295> route-map WORD",
13342 "Redistribute information from another routing protocol\n"
13343 "Open Shortest Path First (OSPFv2)\n"
13344 "Non-main Kernel Routing Table\n"
13345 "Instance ID/Table ID\n"
13346 "Metric for redistributed routes\n"
13348 "Route map reference\n"
13349 "Pointer to route-map entries\n")
13351 DEFUN (no_bgp_redistribute_ipv4
,
13352 no_bgp_redistribute_ipv4_cmd
,
13353 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
,
13355 "Redistribute information from another routing protocol\n"
13356 QUAGGA_IP_REDIST_HELP_STR_BGPD
)
13360 type
= proto_redistnum (AFI_IP
, argv
[0]);
13361 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13363 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13364 return CMD_WARNING
;
13366 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
, 0);
13369 ALIAS (no_bgp_redistribute_ipv4
,
13370 no_bgp_redistribute_ipv4_rmap_cmd
,
13371 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD",
13373 "Redistribute information from another routing protocol\n"
13374 QUAGGA_IP_REDIST_HELP_STR_BGPD
13375 "Route map reference\n"
13376 "Pointer to route-map entries\n")
13378 ALIAS (no_bgp_redistribute_ipv4
,
13379 no_bgp_redistribute_ipv4_metric_cmd
,
13380 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295>",
13382 "Redistribute information from another routing protocol\n"
13383 QUAGGA_IP_REDIST_HELP_STR_BGPD
13384 "Metric for redistributed routes\n"
13385 "Default metric\n")
13387 ALIAS (no_bgp_redistribute_ipv4
,
13388 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
13389 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
13391 "Redistribute information from another routing protocol\n"
13392 QUAGGA_IP_REDIST_HELP_STR_BGPD
13393 "Route map reference\n"
13394 "Pointer to route-map entries\n"
13395 "Metric for redistributed routes\n"
13396 "Default metric\n")
13398 ALIAS (no_bgp_redistribute_ipv4
,
13399 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
13400 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
13402 "Redistribute information from another routing protocol\n"
13403 QUAGGA_IP_REDIST_HELP_STR_BGPD
13404 "Metric for redistributed routes\n"
13406 "Route map reference\n"
13407 "Pointer to route-map entries\n")
13410 DEFUN (bgp_redistribute_ipv6
,
13411 bgp_redistribute_ipv6_cmd
,
13412 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
,
13413 "Redistribute information from another routing protocol\n"
13414 QUAGGA_IP6_REDIST_HELP_STR_BGPD
)
13418 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13419 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13421 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13422 return CMD_WARNING
;
13425 bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
13426 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
, 0);
13429 DEFUN (bgp_redistribute_ipv6_rmap
,
13430 bgp_redistribute_ipv6_rmap_cmd
,
13431 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD",
13432 "Redistribute information from another routing protocol\n"
13433 QUAGGA_IP6_REDIST_HELP_STR_BGPD
13434 "Route map reference\n"
13435 "Pointer to route-map entries\n")
13438 struct bgp_redist
*red
;
13440 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13441 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13443 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13444 return CMD_WARNING
;
13447 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
13448 bgp_redistribute_rmap_set (red
, argv
[1]);
13449 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
, 0);
13452 DEFUN (bgp_redistribute_ipv6_metric
,
13453 bgp_redistribute_ipv6_metric_cmd
,
13454 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295>",
13455 "Redistribute information from another routing protocol\n"
13456 QUAGGA_IP6_REDIST_HELP_STR_BGPD
13457 "Metric for redistributed routes\n"
13458 "Default metric\n")
13462 struct bgp_redist
*red
;
13464 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13465 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13467 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13468 return CMD_WARNING
;
13470 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
13472 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
13473 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP6
, type
, metric
);
13474 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
, 0);
13477 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
13478 bgp_redistribute_ipv6_rmap_metric_cmd
,
13479 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
13480 "Redistribute information from another routing protocol\n"
13481 QUAGGA_IP6_REDIST_HELP_STR_BGPD
13482 "Route map reference\n"
13483 "Pointer to route-map entries\n"
13484 "Metric for redistributed routes\n"
13485 "Default metric\n")
13489 struct bgp_redist
*red
;
13491 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13492 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13494 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13495 return CMD_WARNING
;
13497 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
13499 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
13500 bgp_redistribute_rmap_set (red
, argv
[1]);
13501 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP6
, type
, metric
);
13502 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
, 0);
13505 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
13506 bgp_redistribute_ipv6_metric_rmap_cmd
,
13507 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
13508 "Redistribute information from another routing protocol\n"
13509 QUAGGA_IP6_REDIST_HELP_STR_BGPD
13510 "Metric for redistributed routes\n"
13512 "Route map reference\n"
13513 "Pointer to route-map entries\n")
13517 struct bgp_redist
*red
;
13519 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13520 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13522 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13523 return CMD_WARNING
;
13525 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
13527 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
13528 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP6
, SAFI_UNICAST
, metric
);
13529 bgp_redistribute_rmap_set (red
, argv
[2]);
13530 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
, 0);
13533 DEFUN (no_bgp_redistribute_ipv6
,
13534 no_bgp_redistribute_ipv6_cmd
,
13535 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
,
13537 "Redistribute information from another routing protocol\n"
13538 QUAGGA_IP6_REDIST_HELP_STR_BGPD
)
13542 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13543 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13545 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13546 return CMD_WARNING
;
13549 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
, 0);
13552 ALIAS (no_bgp_redistribute_ipv6
,
13553 no_bgp_redistribute_ipv6_rmap_cmd
,
13554 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD",
13556 "Redistribute information from another routing protocol\n"
13557 QUAGGA_IP6_REDIST_HELP_STR_BGPD
13558 "Route map reference\n"
13559 "Pointer to route-map entries\n")
13561 ALIAS (no_bgp_redistribute_ipv6
,
13562 no_bgp_redistribute_ipv6_metric_cmd
,
13563 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295>",
13565 "Redistribute information from another routing protocol\n"
13566 QUAGGA_IP6_REDIST_HELP_STR_BGPD
13567 "Metric for redistributed routes\n"
13568 "Default metric\n")
13570 ALIAS (no_bgp_redistribute_ipv6
,
13571 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
13572 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
13574 "Redistribute information from another routing protocol\n"
13575 QUAGGA_IP6_REDIST_HELP_STR_BGPD
13576 "Route map reference\n"
13577 "Pointer to route-map entries\n"
13578 "Metric for redistributed routes\n"
13579 "Default metric\n")
13581 ALIAS (no_bgp_redistribute_ipv6
,
13582 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
13583 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
13585 "Redistribute information from another routing protocol\n"
13586 QUAGGA_IP6_REDIST_HELP_STR_BGPD
13587 "Metric for redistributed routes\n"
13589 "Route map reference\n"
13590 "Pointer to route-map entries\n")
13591 #endif /* HAVE_IPV6 */
13594 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
13595 safi_t safi
, int *write
)
13599 /* Unicast redistribution only. */
13600 if (safi
!= SAFI_UNICAST
)
13603 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
13605 /* Redistribute BGP does not make sense. */
13606 if (i
!= ZEBRA_ROUTE_BGP
)
13608 struct list
*red_list
;
13609 struct listnode
*node
;
13610 struct bgp_redist
*red
;
13612 red_list
= bgp
->redist
[afi
][i
];
13616 for (ALL_LIST_ELEMENTS_RO(red_list
, node
, red
))
13618 /* Display "address-family" when it is not yet diplayed. */
13619 bgp_config_write_family_header (vty
, afi
, safi
, write
);
13621 /* "redistribute" configuration. */
13622 vty_out (vty
, " redistribute %s", zebra_route_string(i
));
13624 vty_out (vty
, " %d", red
->instance
);
13625 if (red
->redist_metric_flag
)
13626 vty_out (vty
, " metric %u", red
->redist_metric
);
13627 if (red
->rmap
.name
)
13628 vty_out (vty
, " route-map %s", red
->rmap
.name
);
13629 vty_out (vty
, "%s", VTY_NEWLINE
);
13636 /* BGP node structure. */
13637 static struct cmd_node bgp_node
=
13640 "%s(config-router)# ",
13644 static struct cmd_node bgp_ipv4_unicast_node
=
13647 "%s(config-router-af)# ",
13651 static struct cmd_node bgp_ipv4_multicast_node
=
13654 "%s(config-router-af)# ",
13658 static struct cmd_node bgp_ipv6_unicast_node
=
13661 "%s(config-router-af)# ",
13665 static struct cmd_node bgp_ipv6_multicast_node
=
13668 "%s(config-router-af)# ",
13672 static struct cmd_node bgp_vpnv4_node
=
13675 "%s(config-router-af)# ",
13679 static void community_list_vty (void);
13682 bgp_vty_init (void)
13684 /* Install bgp top node. */
13685 install_node (&bgp_node
, bgp_config_write
);
13686 install_node (&bgp_ipv4_unicast_node
, NULL
);
13687 install_node (&bgp_ipv4_multicast_node
, NULL
);
13688 install_node (&bgp_ipv6_unicast_node
, NULL
);
13689 install_node (&bgp_ipv6_multicast_node
, NULL
);
13690 install_node (&bgp_vpnv4_node
, NULL
);
13692 /* Install default VTY commands to new nodes. */
13693 install_default (BGP_NODE
);
13694 install_default (BGP_IPV4_NODE
);
13695 install_default (BGP_IPV4M_NODE
);
13696 install_default (BGP_IPV6_NODE
);
13697 install_default (BGP_IPV6M_NODE
);
13698 install_default (BGP_VPNV4_NODE
);
13700 /* "bgp multiple-instance" commands. */
13701 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
13702 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
13704 /* "bgp config-type" commands. */
13705 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
13706 install_element (CONFIG_NODE
, &no_bgp_config_type_val_cmd
);
13708 /* bgp route-map delay-timer commands. */
13709 install_element (CONFIG_NODE
, &bgp_set_route_map_delay_timer_cmd
);
13710 install_element (CONFIG_NODE
, &no_bgp_set_route_map_delay_timer_cmd
);
13711 install_element (CONFIG_NODE
, &no_bgp_set_route_map_delay_timer_val_cmd
);
13713 /* Dummy commands (Currently not supported) */
13714 install_element (BGP_NODE
, &no_synchronization_cmd
);
13715 install_element (BGP_NODE
, &no_auto_summary_cmd
);
13717 /* "router bgp" commands. */
13718 install_element (CONFIG_NODE
, &router_bgp_cmd
);
13719 install_element (CONFIG_NODE
, &router_bgp_instance_cmd
);
13720 install_element (CONFIG_NODE
, &router_bgp_noasn_cmd
);
13722 /* "no router bgp" commands. */
13723 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
13724 install_element (CONFIG_NODE
, &no_router_bgp_instance_cmd
);
13726 /* "bgp router-id" commands. */
13727 install_element (BGP_NODE
, &bgp_router_id_cmd
);
13728 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
13729 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
13731 /* "bgp cluster-id" commands. */
13732 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
13733 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
13734 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
13735 install_element (BGP_NODE
, &no_bgp_cluster_id_ip_cmd
);
13736 install_element (BGP_NODE
, &no_bgp_cluster_id_decimal_cmd
);
13738 /* "bgp confederation" commands. */
13739 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
13740 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
13741 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
13743 /* "bgp confederation peers" commands. */
13744 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
13745 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
13747 /* bgp max-med command */
13748 install_element (BGP_NODE
, &bgp_maxmed_admin_cmd
);
13749 install_element (BGP_NODE
, &no_bgp_maxmed_admin_cmd
);
13750 install_element (BGP_NODE
, &bgp_maxmed_admin_medv_cmd
);
13751 install_element (BGP_NODE
, &no_bgp_maxmed_admin_medv_cmd
);
13752 install_element (BGP_NODE
, &bgp_maxmed_onstartup_cmd
);
13753 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_cmd
);
13754 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_period_cmd
);
13755 install_element (BGP_NODE
, &bgp_maxmed_onstartup_medv_cmd
);
13756 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_period_medv_cmd
);
13758 /* bgp disable-ebgp-connected-nh-check */
13759 install_element (BGP_NODE
, &bgp_disable_connected_route_check_cmd
);
13760 install_element (BGP_NODE
, &no_bgp_disable_connected_route_check_cmd
);
13762 /* bgp update-delay command */
13763 install_element (BGP_NODE
, &bgp_update_delay_cmd
);
13764 install_element (BGP_NODE
, &no_bgp_update_delay_cmd
);
13765 install_element (BGP_NODE
, &bgp_update_delay_establish_wait_cmd
);
13766 install_element (BGP_NODE
, &no_bgp_update_delay_establish_wait_cmd
);
13768 install_element (BGP_NODE
, &bgp_wpkt_quanta_cmd
);
13769 install_element (BGP_NODE
, &no_bgp_wpkt_quanta_cmd
);
13771 install_element (BGP_NODE
, &bgp_coalesce_time_cmd
);
13772 install_element (BGP_NODE
, &no_bgp_coalesce_time_cmd
);
13774 /* "maximum-paths" commands. */
13775 install_element (BGP_NODE
, &bgp_maxpaths_cmd
);
13776 install_element (BGP_NODE
, &no_bgp_maxpaths_cmd
);
13777 install_element (BGP_NODE
, &no_bgp_maxpaths_arg_cmd
);
13778 install_element (BGP_IPV4_NODE
, &bgp_maxpaths_cmd
);
13779 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_cmd
);
13780 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_arg_cmd
);
13781 install_element (BGP_IPV6_NODE
, &bgp_maxpaths_cmd
);
13782 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_cmd
);
13783 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_arg_cmd
);
13784 install_element (BGP_NODE
, &bgp_maxpaths_ibgp_cmd
);
13785 install_element(BGP_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
13786 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
13787 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
13788 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
13789 install_element (BGP_IPV4_NODE
, &bgp_maxpaths_ibgp_cmd
);
13790 install_element(BGP_IPV4_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
13791 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
13792 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
13793 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
13794 install_element (BGP_IPV6_NODE
, &bgp_maxpaths_ibgp_cmd
);
13795 install_element(BGP_IPV6_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
13796 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
13797 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
13798 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
13800 /* "timers bgp" commands. */
13801 install_element (BGP_NODE
, &bgp_timers_cmd
);
13802 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
13803 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
13805 /* route-map delay-timer commands - per instance for backwards compat. */
13806 install_element (BGP_NODE
, &bgp_set_route_map_delay_timer_cmd
);
13807 install_element (BGP_NODE
, &no_bgp_set_route_map_delay_timer_cmd
);
13808 install_element (BGP_NODE
, &no_bgp_set_route_map_delay_timer_val_cmd
);
13810 /* "bgp client-to-client reflection" commands */
13811 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
13812 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
13814 /* "bgp always-compare-med" commands */
13815 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
13816 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
13818 /* "bgp deterministic-med" commands */
13819 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
13820 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
13822 /* "bgp graceful-restart" commands */
13823 install_element (BGP_NODE
, &bgp_graceful_restart_cmd
);
13824 install_element (BGP_NODE
, &no_bgp_graceful_restart_cmd
);
13825 install_element (BGP_NODE
, &bgp_graceful_restart_stalepath_time_cmd
);
13826 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_cmd
);
13827 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_val_cmd
);
13829 /* "bgp fast-external-failover" commands */
13830 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
13831 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
13833 /* "bgp enforce-first-as" commands */
13834 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
13835 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
13837 /* "bgp bestpath compare-routerid" commands */
13838 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
13839 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
13841 /* "bgp bestpath as-path ignore" commands */
13842 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
13843 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
13845 /* "bgp bestpath as-path confed" commands */
13846 install_element (BGP_NODE
, &bgp_bestpath_aspath_confed_cmd
);
13847 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_confed_cmd
);
13849 /* "bgp bestpath as-path multipath-relax" commands */
13850 install_element (BGP_NODE
, &bgp_bestpath_aspath_multipath_relax_cmd
);
13851 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_multipath_relax_cmd
);
13853 /* "bgp log-neighbor-changes" commands */
13854 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
13855 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
13857 /* "bgp bestpath med" commands */
13858 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
13859 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
13860 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
13861 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
13862 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
13863 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
13865 /* "no bgp default ipv4-unicast" commands. */
13866 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
13867 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
13869 /* "bgp network import-check" commands. */
13870 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
13871 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
13873 /* "bgp default local-preference" commands. */
13874 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
13875 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
13876 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
13878 /* bgp default show-hostname */
13879 install_element (BGP_NODE
, &bgp_default_show_hostname_cmd
);
13880 install_element (BGP_NODE
, &no_bgp_default_show_hostname_cmd
);
13882 /* "bgp default subgroup-pkt-queue-max" commands. */
13883 install_element (BGP_NODE
, &bgp_default_subgroup_pkt_queue_max_cmd
);
13884 install_element (BGP_NODE
, &no_bgp_default_subgroup_pkt_queue_max_cmd
);
13885 install_element (BGP_NODE
, &no_bgp_default_subgroup_pkt_queue_max_val_cmd
);
13887 /* bgp ibgp-allow-policy-mods command */
13888 install_element (BGP_NODE
, &bgp_rr_allow_outbound_policy_cmd
);
13889 install_element (BGP_NODE
, &no_bgp_rr_allow_outbound_policy_cmd
);
13891 /* "bgp listen limit" commands. */
13892 install_element (BGP_NODE
, &bgp_listen_limit_cmd
);
13893 install_element (BGP_NODE
, &no_bgp_listen_limit_cmd
);
13894 install_element (BGP_NODE
, &no_bgp_listen_limit_val_cmd
);
13896 /* "bgp listen range" commands. */
13897 install_element (BGP_NODE
, &bgp_listen_range_cmd
);
13898 install_element (BGP_NODE
, &no_bgp_listen_range_cmd
);
13900 /* "neighbor remote-as" commands. */
13901 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
13902 install_element (BGP_NODE
, &neighbor_interface_config_cmd
);
13903 install_element (BGP_NODE
, &neighbor_interface_config_v6only_cmd
);
13904 install_element (BGP_NODE
, &neighbor_interface_config_peergroup_cmd
);
13905 install_element (BGP_NODE
, &neighbor_interface_config_v6only_peergroup_cmd
);
13906 install_element (BGP_NODE
, &no_neighbor_cmd
);
13907 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
13908 install_element (BGP_NODE
, &no_neighbor_interface_config_cmd
);
13909 install_element (BGP_NODE
, &no_neighbor_interface_config_v6only_cmd
);
13910 install_element (BGP_NODE
, &no_neighbor_interface_config_peergroup_cmd
);
13911 install_element (BGP_NODE
, &no_neighbor_interface_config_v6only_peergroup_cmd
);
13913 /* "neighbor peer-group" commands. */
13914 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
13915 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
13916 install_element (BGP_NODE
, &no_neighbor_interface_peer_group_remote_as_cmd
);
13918 /* "neighbor local-as" commands. */
13919 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
13920 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
13921 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_replace_as_cmd
);
13922 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
13923 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
13924 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
13925 install_element (BGP_NODE
, &no_neighbor_local_as_val3_cmd
);
13927 /* "neighbor solo" commands. */
13928 install_element (BGP_NODE
, &neighbor_solo_cmd
);
13929 install_element (BGP_NODE
, &no_neighbor_solo_cmd
);
13931 /* "neighbor password" commands. */
13932 install_element (BGP_NODE
, &neighbor_password_cmd
);
13933 install_element (BGP_NODE
, &no_neighbor_password_cmd
);
13934 install_element (BGP_NODE
, &no_neighbor_password_val_cmd
);
13936 /* "neighbor activate" commands. */
13937 install_element (BGP_NODE
, &neighbor_activate_cmd
);
13938 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
13939 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
13940 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
13941 install_element (BGP_IPV6M_NODE
, &neighbor_activate_cmd
);
13942 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
13944 /* "no neighbor activate" commands. */
13945 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
13946 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
13947 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
13948 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
13949 install_element (BGP_IPV6M_NODE
, &no_neighbor_activate_cmd
);
13950 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
13952 /* "neighbor peer-group" set commands.
13953 * Long term we should only accept this command under BGP_NODE and not all of
13954 * the afi/safi sub-contexts. For now though we need to accept it for backwards
13955 * compatibility. This changed when we stopped requiring that peers be assigned
13956 * to their peer-group under each address-family sub-context.
13958 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
13959 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
13960 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
13961 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
13962 install_element (BGP_IPV6M_NODE
, &neighbor_set_peer_group_cmd
);
13963 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
13965 /* "no neighbor peer-group unset" commands. */
13966 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
13967 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
13968 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
13969 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
13970 install_element (BGP_IPV6M_NODE
, &no_neighbor_set_peer_group_cmd
);
13971 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
13973 /* "neighbor softreconfiguration inbound" commands.*/
13974 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
13975 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
13976 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
13977 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
13978 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
13979 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
13980 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
13981 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
13982 install_element (BGP_IPV6M_NODE
, &neighbor_soft_reconfiguration_cmd
);
13983 install_element (BGP_IPV6M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
13984 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
13985 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
13987 /* "neighbor attribute-unchanged" commands. */
13988 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
13989 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
13990 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
13991 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
13992 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
13993 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
13994 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
13995 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
13996 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
13997 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
13998 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
13999 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
14000 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14001 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14002 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14003 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14004 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14005 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14006 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14007 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14008 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14009 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14010 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
14011 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
14012 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
14013 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
14014 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
14015 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
14016 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
14017 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
14018 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
14019 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
14020 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
14021 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
14022 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14023 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14024 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14025 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14026 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14027 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14028 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14029 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14030 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14031 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14032 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
14033 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
14034 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
14035 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
14036 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
14037 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
14038 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
14039 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
14040 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
14041 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
14042 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
14043 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
14044 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14045 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14046 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14047 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14048 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14049 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14050 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14051 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14052 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14053 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14054 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
14055 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
14056 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
14057 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
14058 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
14059 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
14060 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
14061 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
14062 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
14063 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
14064 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
14065 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
14066 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14067 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14068 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14069 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14070 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14071 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14072 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14073 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14074 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14075 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14076 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged_cmd
);
14077 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged1_cmd
);
14078 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged2_cmd
);
14079 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged3_cmd
);
14080 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged4_cmd
);
14081 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged5_cmd
);
14082 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged6_cmd
);
14083 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged7_cmd
);
14084 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged8_cmd
);
14085 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged9_cmd
);
14086 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged10_cmd
);
14087 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged_cmd
);
14088 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14089 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14090 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14091 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14092 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14093 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14094 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14095 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14096 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14097 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14098 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
14099 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
14100 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
14101 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
14102 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
14103 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
14104 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
14105 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
14106 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
14107 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
14108 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
14109 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
14110 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14111 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14112 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14113 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14114 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14115 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14116 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14117 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14118 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14119 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14121 /* "nexthop-local unchanged" commands */
14122 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_local_unchanged_cmd
);
14123 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_local_unchanged_cmd
);
14125 /* "neighbor next-hop-self" commands. */
14126 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
14127 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
14128 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
14129 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
14130 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
14131 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
14132 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
14133 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
14134 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_cmd
);
14135 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_cmd
);
14136 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
14137 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
14139 /* "neighbor next-hop-self force" commands. */
14140 install_element (BGP_NODE
, &neighbor_nexthop_self_force_cmd
);
14141 install_element (BGP_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14142 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_force_cmd
);
14143 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14144 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_force_cmd
);
14145 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14146 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_force_cmd
);
14147 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14148 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_force_cmd
);
14149 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14150 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_force_cmd
);
14151 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14153 /* "neighbor as-override" commands. */
14154 install_element (BGP_NODE
, &neighbor_as_override_cmd
);
14155 install_element (BGP_NODE
, &no_neighbor_as_override_cmd
);
14156 install_element (BGP_IPV4_NODE
, &neighbor_as_override_cmd
);
14157 install_element (BGP_IPV4_NODE
, &no_neighbor_as_override_cmd
);
14158 install_element (BGP_IPV4M_NODE
, &neighbor_as_override_cmd
);
14159 install_element (BGP_IPV4M_NODE
, &no_neighbor_as_override_cmd
);
14160 install_element (BGP_IPV6_NODE
, &neighbor_as_override_cmd
);
14161 install_element (BGP_IPV6_NODE
, &no_neighbor_as_override_cmd
);
14162 install_element (BGP_IPV6M_NODE
, &neighbor_as_override_cmd
);
14163 install_element (BGP_IPV6M_NODE
, &no_neighbor_as_override_cmd
);
14164 install_element (BGP_VPNV4_NODE
, &neighbor_as_override_cmd
);
14165 install_element (BGP_VPNV4_NODE
, &no_neighbor_as_override_cmd
);
14167 /* "neighbor remove-private-AS" commands. */
14168 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
14169 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
14170 install_element (BGP_NODE
, &neighbor_remove_private_as_all_cmd
);
14171 install_element (BGP_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14172 install_element (BGP_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14173 install_element (BGP_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14174 install_element (BGP_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14175 install_element (BGP_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14176 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
14177 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
14178 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_all_cmd
);
14179 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14180 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14181 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14182 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14183 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14184 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
14185 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
14186 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_all_cmd
);
14187 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14188 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14189 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14190 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14191 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14192 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
14193 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
14194 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_all_cmd
);
14195 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14196 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14197 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14198 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14199 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14200 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_cmd
);
14201 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_cmd
);
14202 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_all_cmd
);
14203 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14204 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14205 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14206 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14207 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14208 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
14209 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
14210 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_all_cmd
);
14211 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14212 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14213 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14214 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14215 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14217 /* "neighbor send-community" commands.*/
14218 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
14219 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
14220 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
14221 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
14222 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
14223 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
14224 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
14225 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
14226 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
14227 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
14228 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
14229 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
14230 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
14231 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
14232 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
14233 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
14234 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_cmd
);
14235 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_type_cmd
);
14236 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_cmd
);
14237 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_type_cmd
);
14238 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
14239 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
14240 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
14241 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
14243 /* "neighbor route-reflector" commands.*/
14244 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
14245 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
14246 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
14247 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
14248 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
14249 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
14250 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
14251 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
14252 install_element (BGP_IPV6M_NODE
, &neighbor_route_reflector_client_cmd
);
14253 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_reflector_client_cmd
);
14254 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
14255 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
14257 /* "neighbor route-server" commands.*/
14258 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
14259 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
14260 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
14261 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
14262 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
14263 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
14264 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
14265 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
14266 install_element (BGP_IPV6M_NODE
, &neighbor_route_server_client_cmd
);
14267 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_server_client_cmd
);
14268 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
14269 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
14271 /* "neighbor addpath-tx-all-paths" commands.*/
14272 install_element (BGP_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14273 install_element (BGP_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14274 install_element (BGP_IPV4_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14275 install_element (BGP_IPV4_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14276 install_element (BGP_IPV4M_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14277 install_element (BGP_IPV4M_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14278 install_element (BGP_IPV6_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14279 install_element (BGP_IPV6_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14280 install_element (BGP_IPV6M_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14281 install_element (BGP_IPV6M_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14282 install_element (BGP_VPNV4_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14283 install_element (BGP_VPNV4_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14285 /* "neighbor addpath-tx-bestpath-per-AS" commands.*/
14286 install_element (BGP_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14287 install_element (BGP_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14288 install_element (BGP_IPV4_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14289 install_element (BGP_IPV4_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14290 install_element (BGP_IPV4M_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14291 install_element (BGP_IPV4M_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14292 install_element (BGP_IPV6_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14293 install_element (BGP_IPV6_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14294 install_element (BGP_IPV6M_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14295 install_element (BGP_IPV6M_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14296 install_element (BGP_VPNV4_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14297 install_element (BGP_VPNV4_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14299 /* "neighbor passive" commands. */
14300 install_element (BGP_NODE
, &neighbor_passive_cmd
);
14301 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
14304 /* "neighbor shutdown" commands. */
14305 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
14306 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
14308 /* "neighbor capability extended-nexthop" commands.*/
14309 install_element (BGP_NODE
, &neighbor_capability_enhe_cmd
);
14310 install_element (BGP_NODE
, &no_neighbor_capability_enhe_cmd
);
14312 /* "neighbor capability orf prefix-list" commands.*/
14313 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
14314 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
14315 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
14316 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
14317 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
14318 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
14319 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
14320 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
14321 install_element (BGP_IPV6M_NODE
, &neighbor_capability_orf_prefix_cmd
);
14322 install_element (BGP_IPV6M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
14324 /* "neighbor capability dynamic" commands.*/
14325 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
14326 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
14328 /* "neighbor dont-capability-negotiate" commands. */
14329 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
14330 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
14332 /* "neighbor ebgp-multihop" commands. */
14333 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
14334 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
14335 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
14336 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
14338 /* "neighbor disable-connected-check" commands. */
14339 install_element (BGP_NODE
, &neighbor_disable_connected_check_cmd
);
14340 install_element (BGP_NODE
, &no_neighbor_disable_connected_check_cmd
);
14341 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
14342 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
14344 /* "neighbor description" commands. */
14345 install_element (BGP_NODE
, &neighbor_description_cmd
);
14346 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
14347 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
14349 /* "neighbor update-source" commands. "*/
14350 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
14351 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
14353 /* "neighbor default-originate" commands. */
14354 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
14355 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
14356 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
14357 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
14358 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
14359 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
14360 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
14361 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
14362 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
14363 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
14364 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
14365 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
14366 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
14367 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
14368 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
14369 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
14370 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_cmd
);
14371 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_rmap_cmd
);
14372 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_cmd
);
14373 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
14375 /* "neighbor port" commands. */
14376 install_element (BGP_NODE
, &neighbor_port_cmd
);
14377 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
14378 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
14380 /* "neighbor weight" commands. */
14381 install_element (BGP_NODE
, &neighbor_weight_cmd
);
14382 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
14383 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
14385 /* "neighbor override-capability" commands. */
14386 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
14387 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
14389 /* "neighbor strict-capability-match" commands. */
14390 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
14391 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
14393 /* "neighbor timers" commands. */
14394 install_element (BGP_NODE
, &neighbor_timers_cmd
);
14395 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
14396 install_element (BGP_NODE
, &no_neighbor_timers_val_cmd
);
14398 /* "neighbor timers connect" commands. */
14399 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
14400 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
14401 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
14403 /* "neighbor advertisement-interval" commands. */
14404 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
14405 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
14406 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
14408 /* "neighbor interface" commands. */
14409 install_element (BGP_NODE
, &neighbor_interface_cmd
);
14410 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
14412 /* "neighbor distribute" commands. */
14413 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
14414 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
14415 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
14416 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
14417 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
14418 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
14419 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
14420 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
14421 install_element (BGP_IPV6M_NODE
, &neighbor_distribute_list_cmd
);
14422 install_element (BGP_IPV6M_NODE
, &no_neighbor_distribute_list_cmd
);
14423 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
14424 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
14426 /* "neighbor prefix-list" commands. */
14427 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
14428 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
14429 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
14430 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
14431 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
14432 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
14433 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
14434 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
14435 install_element (BGP_IPV6M_NODE
, &neighbor_prefix_list_cmd
);
14436 install_element (BGP_IPV6M_NODE
, &no_neighbor_prefix_list_cmd
);
14437 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
14438 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
14440 /* "neighbor filter-list" commands. */
14441 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
14442 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
14443 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
14444 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
14445 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
14446 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
14447 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
14448 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
14449 install_element (BGP_IPV6M_NODE
, &neighbor_filter_list_cmd
);
14450 install_element (BGP_IPV6M_NODE
, &no_neighbor_filter_list_cmd
);
14451 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
14452 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
14454 /* "neighbor route-map" commands. */
14455 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
14456 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
14457 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
14458 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
14459 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
14460 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
14461 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
14462 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
14463 install_element (BGP_IPV6M_NODE
, &neighbor_route_map_cmd
);
14464 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_map_cmd
);
14465 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
14466 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
14468 /* "neighbor unsuppress-map" commands. */
14469 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
14470 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
14471 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
14472 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
14473 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
14474 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
14475 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
14476 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
14477 install_element (BGP_IPV6M_NODE
, &neighbor_unsuppress_map_cmd
);
14478 install_element (BGP_IPV6M_NODE
, &no_neighbor_unsuppress_map_cmd
);
14479 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
14480 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
14482 /* "neighbor maximum-prefix" commands. */
14483 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
14484 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
14485 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
14486 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
14487 install_element (BGP_NODE
, &neighbor_maximum_prefix_restart_cmd
);
14488 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
14489 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
14490 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
14491 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
14492 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
14493 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
14494 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
14495 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
14496 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
14497 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
14498 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
14499 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
14500 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
14501 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
14502 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
14503 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
14504 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
14505 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
14506 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
14507 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
14508 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
14509 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
14510 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
14511 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
14512 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
14513 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
14514 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
14515 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
14516 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
14517 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
14518 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
14519 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
14520 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
14521 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
14522 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
14523 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
14524 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
14525 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
14526 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
14527 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
14528 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
14529 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
14530 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
14531 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
14532 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
14533 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
14534 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
14535 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_cmd
);
14536 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
14537 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
14538 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
14539 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
14540 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
14541 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_cmd
);
14542 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
14543 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
14544 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
14545 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
14546 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
14547 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
14548 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
14549 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
14550 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
14551 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
14552 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
14553 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
14554 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
14555 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
14556 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
14557 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
14558 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
14559 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
14560 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
14562 /* "neighbor allowas-in" */
14563 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
14564 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
14565 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
14566 install_element (BGP_NODE
, &no_neighbor_allowas_in_val_cmd
);
14567 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
14568 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
14569 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
14570 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_val_cmd
);
14571 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
14572 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
14573 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
14574 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_val_cmd
);
14575 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
14576 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
14577 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
14578 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_val_cmd
);
14579 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_cmd
);
14580 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_arg_cmd
);
14581 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_cmd
);
14582 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_val_cmd
);
14583 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
14584 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
14585 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
14586 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_val_cmd
);
14588 /* address-family commands. */
14589 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
14590 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
14592 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
14593 install_element (BGP_NODE
, &address_family_ipv6_safi_cmd
);
14594 #endif /* HAVE_IPV6 */
14595 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
14596 install_element (BGP_NODE
, &address_family_vpnv4_unicast_cmd
);
14598 /* "exit-address-family" command. */
14599 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
14600 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
14601 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
14602 install_element (BGP_IPV6M_NODE
, &exit_address_family_cmd
);
14603 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
14605 /* "clear ip bgp commands" */
14606 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
14607 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
14608 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
14609 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_cmd
);
14610 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
14611 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_cmd
);
14612 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
14613 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_cmd
);
14614 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
14615 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_cmd
);
14617 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
14618 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
14619 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
14620 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_cmd
);
14621 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
14622 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_cmd
);
14623 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
14624 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_cmd
);
14625 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
14626 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_cmd
);
14627 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
14628 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_cmd
);
14629 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
14630 install_element (ENABLE_NODE
, &clear_bgp_instance_external_cmd
);
14631 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
14632 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_cmd
);
14633 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
14634 install_element (ENABLE_NODE
, &clear_bgp_instance_as_cmd
);
14635 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
14636 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_cmd
);
14638 /* "clear ip bgp neighbor soft in" */
14639 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
14640 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
14641 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
14642 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_cmd
);
14643 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
14644 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
14645 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_soft_in_cmd
);
14646 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
14647 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_in_cmd
);
14648 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
14649 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
14650 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_soft_in_cmd
);
14651 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
14652 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_in_cmd
);
14653 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
14654 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
14655 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_soft_in_cmd
);
14656 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
14657 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_in_cmd
);
14658 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
14659 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
14660 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_soft_in_cmd
);
14661 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
14662 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_in_cmd
);
14663 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
14664 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
14665 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
14666 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
14667 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_cmd
);
14668 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
14669 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
14670 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_ipv4_soft_in_cmd
);
14671 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
14672 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_ipv4_in_cmd
);
14673 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
14674 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
14675 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_ipv4_soft_in_cmd
);
14676 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
14677 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_ipv4_in_cmd
);
14678 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
14679 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
14680 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_ipv4_soft_in_cmd
);
14681 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
14682 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_ipv4_in_cmd
);
14683 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
14684 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
14685 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_ipv4_soft_in_cmd
);
14686 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
14687 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_ipv4_in_cmd
);
14688 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
14689 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_in_cmd
);
14690 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_in_cmd
);
14691 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_in_cmd
);
14692 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_in_cmd
);
14693 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_in_cmd
);
14694 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_in_cmd
);
14696 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
14697 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
14698 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
14699 install_element (ENABLE_NODE
, &clear_bgp_instance_all_in_cmd
);
14700 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
14701 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
14702 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_soft_in_cmd
);
14703 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
14704 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_in_cmd
);
14705 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
14706 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
14707 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_soft_in_cmd
);
14708 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
14709 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_in_cmd
);
14710 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
14711 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
14712 install_element (ENABLE_NODE
, &clear_bgp_instance_external_soft_in_cmd
);
14713 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
14714 install_element (ENABLE_NODE
, &clear_bgp_instance_external_in_cmd
);
14715 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
14716 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
14717 install_element (ENABLE_NODE
, &clear_bgp_instance_as_soft_in_cmd
);
14718 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
14719 install_element (ENABLE_NODE
, &clear_bgp_instance_as_in_cmd
);
14720 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
14721 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
14722 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_soft_in_cmd
);
14723 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
14724 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_in_cmd
);
14725 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
14726 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
14727 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_soft_in_cmd
);
14728 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
14729 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_in_cmd
);
14730 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
14731 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
14732 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_soft_in_cmd
);
14733 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
14734 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_in_cmd
);
14735 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
14736 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
14737 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_soft_in_cmd
);
14738 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
14739 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_in_cmd
);
14740 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
14741 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
14742 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_soft_in_cmd
);
14743 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
14744 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_in_cmd
);
14745 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
14747 /* clear ip bgp prefix */
14748 install_element (ENABLE_NODE
, &clear_ip_bgp_prefix_cmd
);
14749 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_prefix_cmd
);
14750 install_element (ENABLE_NODE
, &clear_bgp_ipv6_safi_prefix_cmd
);
14751 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_safi_prefix_cmd
);
14753 /* "clear ip bgp neighbor soft out" */
14754 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
14755 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
14756 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
14757 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_out_cmd
);
14758 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
14759 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_soft_out_cmd
);
14760 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
14761 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_out_cmd
);
14762 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
14763 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_soft_out_cmd
);
14764 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
14765 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_out_cmd
);
14766 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
14767 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_soft_out_cmd
);
14768 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
14769 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_out_cmd
);
14770 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
14771 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_soft_out_cmd
);
14772 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
14773 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_out_cmd
);
14774 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
14775 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
14776 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
14777 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_out_cmd
);
14778 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
14779 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_ipv4_soft_out_cmd
);
14780 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
14781 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_ipv4_out_cmd
);
14782 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
14783 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_ipv4_soft_out_cmd
);
14784 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
14785 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_ipv4_out_cmd
);
14786 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
14787 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_ipv4_soft_out_cmd
);
14788 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
14789 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_ipv4_out_cmd
);
14790 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
14791 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_ipv4_soft_out_cmd
);
14792 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
14793 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_ipv4_out_cmd
);
14794 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_out_cmd
);
14795 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_out_cmd
);
14796 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_out_cmd
);
14797 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_out_cmd
);
14798 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_out_cmd
);
14799 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_out_cmd
);
14801 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
14802 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
14803 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
14804 install_element (ENABLE_NODE
, &clear_bgp_instance_all_out_cmd
);
14805 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
14806 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_soft_out_cmd
);
14807 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
14808 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_out_cmd
);
14809 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
14810 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_soft_out_cmd
);
14811 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
14812 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_out_cmd
);
14813 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
14814 install_element (ENABLE_NODE
, &clear_bgp_instance_external_soft_out_cmd
);
14815 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
14816 install_element (ENABLE_NODE
, &clear_bgp_instance_external_out_cmd
);
14817 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
14818 install_element (ENABLE_NODE
, &clear_bgp_instance_as_soft_out_cmd
);
14819 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
14820 install_element (ENABLE_NODE
, &clear_bgp_instance_as_out_cmd
);
14821 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
14822 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_soft_out_cmd
);
14823 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
14824 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_out_cmd
);
14825 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
14826 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_soft_out_cmd
);
14827 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
14828 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_out_cmd
);
14829 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
14830 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_soft_out_cmd
);
14831 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
14832 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_out_cmd
);
14833 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
14834 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_soft_out_cmd
);
14835 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
14836 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_out_cmd
);
14837 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
14838 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_soft_out_cmd
);
14839 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
14840 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_out_cmd
);
14842 /* "clear ip bgp neighbor soft" */
14843 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
14844 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
14845 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
14846 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_soft_cmd
);
14847 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
14848 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_soft_cmd
);
14849 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
14850 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_soft_cmd
);
14851 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
14852 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_soft_cmd
);
14853 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
14854 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
14855 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
14856 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_ipv4_soft_cmd
);
14857 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
14858 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_ipv4_soft_cmd
);
14859 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
14860 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_ipv4_soft_cmd
);
14861 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
14862 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_ipv4_soft_cmd
);
14863 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_cmd
);
14864 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_cmd
);
14865 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_cmd
);
14867 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
14868 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
14869 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
14870 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_soft_cmd
);
14871 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
14872 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_soft_cmd
);
14873 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
14874 install_element (ENABLE_NODE
, &clear_bgp_instance_external_soft_cmd
);
14875 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
14876 install_element (ENABLE_NODE
, &clear_bgp_instance_as_soft_cmd
);
14877 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
14878 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_soft_cmd
);
14879 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
14880 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_soft_cmd
);
14881 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
14882 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_soft_cmd
);
14883 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
14884 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_soft_cmd
);
14885 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
14886 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_soft_cmd
);
14888 /* "show ip bgp summary" commands. */
14889 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
14890 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_cmd
);
14891 install_element (VIEW_NODE
, &show_ip_bgp_instance_updgrps_cmd
);
14892 install_element (VIEW_NODE
, &show_bgp_updgrps_cmd
);
14893 install_element (VIEW_NODE
, &show_bgp_ipv6_updgrps_cmd
);
14894 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_updgrps_cmd
);
14895 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_s_cmd
);
14896 install_element (VIEW_NODE
, &show_ip_bgp_instance_updgrps_s_cmd
);
14897 install_element (VIEW_NODE
, &show_bgp_updgrps_s_cmd
);
14898 install_element (VIEW_NODE
, &show_bgp_ipv6_updgrps_s_cmd
);
14899 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_updgrps_s_cmd
);
14900 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_adj_cmd
);
14901 install_element (VIEW_NODE
, &show_ip_bgp_instance_updgrps_adj_cmd
);
14902 install_element (VIEW_NODE
, &show_bgp_updgrps_adj_cmd
);
14903 install_element (VIEW_NODE
, &show_bgp_instance_updgrps_adj_cmd
);
14904 install_element (VIEW_NODE
, &show_bgp_updgrps_afi_adj_cmd
);
14905 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_adj_s_cmd
);
14906 install_element (VIEW_NODE
, &show_ip_bgp_instance_updgrps_adj_s_cmd
);
14907 install_element (VIEW_NODE
, &show_bgp_updgrps_adj_s_cmd
);
14908 install_element (VIEW_NODE
, &show_bgp_instance_updgrps_adj_s_cmd
);
14909 install_element (VIEW_NODE
, &show_bgp_updgrps_afi_adj_s_cmd
);
14910 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
14911 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
14912 install_element (VIEW_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
14913 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
14914 install_element (VIEW_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
14915 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
14916 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
14918 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
14919 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
14920 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
14921 install_element (VIEW_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
14922 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
14923 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
14924 #endif /* HAVE_IPV6 */
14925 install_element (RESTRICTED_NODE
, &show_ip_bgp_summary_cmd
);
14926 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_cmd
);
14927 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_updgrps_cmd
);
14928 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_cmd
);
14929 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_updgrps_cmd
);
14930 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_updgrps_cmd
);
14931 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_s_cmd
);
14932 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_updgrps_s_cmd
);
14933 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_s_cmd
);
14934 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_updgrps_s_cmd
);
14935 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_updgrps_s_cmd
);
14936 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_adj_cmd
);
14937 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_updgrps_adj_cmd
);
14938 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_adj_cmd
);
14939 install_element (RESTRICTED_NODE
, &show_bgp_instance_updgrps_adj_cmd
);
14940 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_afi_adj_cmd
);
14941 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_adj_s_cmd
);
14942 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_updgrps_adj_s_cmd
);
14943 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_adj_s_cmd
);
14944 install_element (RESTRICTED_NODE
, &show_bgp_instance_updgrps_adj_s_cmd
);
14945 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_afi_adj_s_cmd
);
14946 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_summary_cmd
);
14947 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
14948 install_element (RESTRICTED_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
14949 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
14950 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
14951 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
14952 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
14954 install_element (RESTRICTED_NODE
, &show_bgp_summary_cmd
);
14955 install_element (RESTRICTED_NODE
, &show_bgp_instance_summary_cmd
);
14956 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_summary_cmd
);
14957 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
14958 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
14959 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
14960 #endif /* HAVE_IPV6 */
14961 install_element (ENABLE_NODE
, &show_ip_bgp_summary_cmd
);
14962 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_cmd
);
14963 install_element (ENABLE_NODE
, &show_ip_bgp_instance_updgrps_cmd
);
14964 install_element (ENABLE_NODE
, &show_bgp_updgrps_cmd
);
14965 install_element (ENABLE_NODE
, &show_bgp_ipv6_updgrps_cmd
);
14966 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_updgrps_cmd
);
14967 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_s_cmd
);
14968 install_element (ENABLE_NODE
, &show_ip_bgp_instance_updgrps_s_cmd
);
14969 install_element (ENABLE_NODE
, &show_bgp_updgrps_s_cmd
);
14970 install_element (ENABLE_NODE
, &show_bgp_ipv6_updgrps_s_cmd
);
14971 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_updgrps_s_cmd
);
14972 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_adj_cmd
);
14973 install_element (ENABLE_NODE
, &show_ip_bgp_instance_updgrps_adj_cmd
);
14974 install_element (ENABLE_NODE
, &show_bgp_updgrps_adj_cmd
);
14975 install_element (ENABLE_NODE
, &show_bgp_instance_updgrps_adj_cmd
);
14976 install_element (ENABLE_NODE
, &show_bgp_updgrps_afi_adj_cmd
);
14977 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_adj_s_cmd
);
14978 install_element (ENABLE_NODE
, &show_ip_bgp_instance_updgrps_adj_s_cmd
);
14979 install_element (ENABLE_NODE
, &show_bgp_updgrps_adj_s_cmd
);
14980 install_element (ENABLE_NODE
, &show_bgp_instance_updgrps_adj_s_cmd
);
14981 install_element (ENABLE_NODE
, &show_bgp_updgrps_afi_adj_s_cmd
);
14982 install_element (ENABLE_NODE
, &show_ip_bgp_instance_summary_cmd
);
14983 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
14984 install_element (ENABLE_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
14985 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
14986 install_element (ENABLE_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
14987 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
14988 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
14990 install_element (ENABLE_NODE
, &show_bgp_summary_cmd
);
14991 install_element (ENABLE_NODE
, &show_bgp_instance_summary_cmd
);
14992 install_element (ENABLE_NODE
, &show_bgp_ipv6_summary_cmd
);
14993 install_element (ENABLE_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
14994 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
14995 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
14996 #endif /* HAVE_IPV6 */
14998 /* "show ip bgp neighbors" commands. */
14999 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
15000 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
15001 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
15002 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
15003 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
15004 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
15005 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
15006 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
15007 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
15008 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
15009 install_element (RESTRICTED_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
15010 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
15011 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
15012 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
15013 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
15014 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_cmd
);
15015 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
15016 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
15017 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
15018 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
15019 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
15020 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
15021 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
15022 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
15023 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
15026 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
15027 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
15028 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
15029 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
15030 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
15031 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
15032 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
15033 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
15034 install_element (RESTRICTED_NODE
, &show_bgp_neighbors_peer_cmd
);
15035 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
15036 install_element (RESTRICTED_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
15037 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
15038 install_element (ENABLE_NODE
, &show_bgp_neighbors_cmd
);
15039 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_cmd
);
15040 install_element (ENABLE_NODE
, &show_bgp_neighbors_peer_cmd
);
15041 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
15042 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_cmd
);
15043 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
15044 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
15045 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
15047 /* Old commands. */
15048 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
15049 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
15050 install_element (ENABLE_NODE
, &show_ipv6_bgp_summary_cmd
);
15051 install_element (ENABLE_NODE
, &show_ipv6_mbgp_summary_cmd
);
15052 #endif /* HAVE_IPV6 */
15054 /* "show ip bgp peer-group" commands. */
15055 install_element (VIEW_NODE
, &show_ip_bgp_peer_groups_cmd
);
15056 install_element (VIEW_NODE
, &show_ip_bgp_instance_peer_groups_cmd
);
15057 install_element (VIEW_NODE
, &show_ip_bgp_peer_group_cmd
);
15058 install_element (VIEW_NODE
, &show_ip_bgp_instance_peer_group_cmd
);
15059 install_element (ENABLE_NODE
, &show_ip_bgp_peer_groups_cmd
);
15060 install_element (ENABLE_NODE
, &show_ip_bgp_instance_peer_groups_cmd
);
15061 install_element (ENABLE_NODE
, &show_ip_bgp_peer_group_cmd
);
15062 install_element (ENABLE_NODE
, &show_ip_bgp_instance_peer_group_cmd
);
15064 /* "show ip bgp paths" commands. */
15065 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
15066 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
15067 install_element (ENABLE_NODE
, &show_ip_bgp_paths_cmd
);
15068 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
15070 /* "show ip bgp community" commands. */
15071 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
15072 install_element (ENABLE_NODE
, &show_ip_bgp_community_info_cmd
);
15074 /* "show ip bgp attribute-info" commands. */
15075 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
15076 install_element (ENABLE_NODE
, &show_ip_bgp_attr_info_cmd
);
15078 /* "redistribute" commands. */
15079 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
15080 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
15081 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
15082 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
15083 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
15084 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
15085 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
15086 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
15087 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
15088 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
15089 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_cmd
);
15090 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_cmd
);
15091 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_rmap_cmd
);
15092 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_cmd
);
15093 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_metric_cmd
);
15094 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_cmd
);
15095 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
15096 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
15097 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
15098 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
15099 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_cmd
);
15100 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_cmd
);
15101 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
15102 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
15103 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
15104 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
15105 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
15106 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
15107 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
15108 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
15109 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_ospf_cmd
);
15110 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_ospf_cmd
);
15111 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_ospf_rmap_cmd
);
15112 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_cmd
);
15113 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_ospf_metric_cmd
);
15114 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_cmd
);
15115 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
15116 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
15117 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
15118 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
15120 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
15121 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
15122 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
15123 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
15124 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
15125 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
15126 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
15127 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
15128 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
15129 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
15130 #endif /* HAVE_IPV6 */
15132 /* ttl_security commands */
15133 install_element (BGP_NODE
, &neighbor_ttl_security_cmd
);
15134 install_element (BGP_NODE
, &no_neighbor_ttl_security_cmd
);
15136 /* "show bgp memory" commands. */
15137 install_element (VIEW_NODE
, &show_bgp_memory_cmd
);
15138 install_element (RESTRICTED_NODE
, &show_bgp_memory_cmd
);
15139 install_element (ENABLE_NODE
, &show_bgp_memory_cmd
);
15141 /* "show bgp views" commands. */
15142 install_element (VIEW_NODE
, &show_bgp_views_cmd
);
15143 install_element (RESTRICTED_NODE
, &show_bgp_views_cmd
);
15144 install_element (ENABLE_NODE
, &show_bgp_views_cmd
);
15146 /* "show bgp vrfs" commands. */
15147 install_element (VIEW_NODE
, &show_bgp_vrfs_cmd
);
15148 install_element (RESTRICTED_NODE
, &show_bgp_vrfs_cmd
);
15149 install_element (ENABLE_NODE
, &show_bgp_vrfs_cmd
);
15151 /* Community-list. */
15152 community_list_vty ();
15155 #include "memory.h"
15156 #include "bgp_regex.h"
15157 #include "bgp_clist.h"
15158 #include "bgp_ecommunity.h"
15160 /* VTY functions. */
15162 /* Direction value to string conversion. */
15163 static const char *
15164 community_direct_str (int direct
)
15168 case COMMUNITY_DENY
:
15170 case COMMUNITY_PERMIT
:
15177 /* Display error string. */
15179 community_list_perror (struct vty
*vty
, int ret
)
15183 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
15184 vty_out (vty
, "%% Can't find community-list%s", VTY_NEWLINE
);
15186 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
15187 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
15189 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
15190 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
15192 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
15193 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
15198 /* VTY interface for community_set() function. */
15200 community_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
15201 int style
, int reject_all_digit_name
)
15207 /* Check the list type. */
15208 if (strncmp (argv
[1], "p", 1) == 0)
15209 direct
= COMMUNITY_PERMIT
;
15210 else if (strncmp (argv
[1], "d", 1) == 0)
15211 direct
= COMMUNITY_DENY
;
15214 vty_out (vty
, "%% Matching condition must be permit or deny%s",
15216 return CMD_WARNING
;
15219 /* All digit name check. */
15220 if (reject_all_digit_name
&& all_digit (argv
[0]))
15222 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
15223 return CMD_WARNING
;
15226 /* Concat community string argument. */
15228 str
= argv_concat (argv
, argc
, 2);
15232 /* When community_list_set() return nevetive value, it means
15233 malformed community string. */
15234 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
15236 /* Free temporary community list string allocated by
15239 XFREE (MTYPE_TMP
, str
);
15243 /* Display error string. */
15244 community_list_perror (vty
, ret
);
15245 return CMD_WARNING
;
15248 return CMD_SUCCESS
;
15251 /* Communiyt-list entry delete. */
15253 community_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
15254 int style
, int delete_all
)
15262 /* Check the list direct. */
15263 if (strncmp (argv
[1], "p", 1) == 0)
15264 direct
= COMMUNITY_PERMIT
;
15265 else if (strncmp (argv
[1], "d", 1) == 0)
15266 direct
= COMMUNITY_DENY
;
15269 vty_out (vty
, "%% Matching condition must be permit or deny%s",
15271 return CMD_WARNING
;
15274 /* Concat community string argument. */
15275 str
= argv_concat (argv
, argc
, 2);
15278 /* Unset community list. */
15279 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
, delete_all
);
15281 /* Free temporary community list string allocated by
15284 XFREE (MTYPE_TMP
, str
);
15288 community_list_perror (vty
, ret
);
15289 return CMD_WARNING
;
15292 return CMD_SUCCESS
;
15295 /* "community-list" keyword help string. */
15296 #define COMMUNITY_LIST_STR "Add a community list entry\n"
15297 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
15299 DEFUN (ip_community_list_standard
,
15300 ip_community_list_standard_cmd
,
15301 "ip community-list <1-99> (deny|permit) .AA:NN",
15304 "Community list number (standard)\n"
15305 "Specify community to reject\n"
15306 "Specify community to accept\n"
15309 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
15312 ALIAS (ip_community_list_standard
,
15313 ip_community_list_standard2_cmd
,
15314 "ip community-list <1-99> (deny|permit)",
15317 "Community list number (standard)\n"
15318 "Specify community to reject\n"
15319 "Specify community to accept\n")
15321 DEFUN (ip_community_list_expanded
,
15322 ip_community_list_expanded_cmd
,
15323 "ip community-list <100-500> (deny|permit) .LINE",
15326 "Community list number (expanded)\n"
15327 "Specify community to reject\n"
15328 "Specify community to accept\n"
15329 "An ordered list as a regular-expression\n")
15331 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
15334 DEFUN (ip_community_list_name_standard
,
15335 ip_community_list_name_standard_cmd
,
15336 "ip community-list standard WORD (deny|permit) .AA:NN",
15339 "Add a standard community-list entry\n"
15340 "Community list name\n"
15341 "Specify community to reject\n"
15342 "Specify community to accept\n"
15345 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
15348 ALIAS (ip_community_list_name_standard
,
15349 ip_community_list_name_standard2_cmd
,
15350 "ip community-list standard WORD (deny|permit)",
15353 "Add a standard community-list entry\n"
15354 "Community list name\n"
15355 "Specify community to reject\n"
15356 "Specify community to accept\n")
15358 DEFUN (ip_community_list_name_expanded
,
15359 ip_community_list_name_expanded_cmd
,
15360 "ip community-list expanded WORD (deny|permit) .LINE",
15363 "Add an expanded community-list entry\n"
15364 "Community list name\n"
15365 "Specify community to reject\n"
15366 "Specify community to accept\n"
15367 "An ordered list as a regular-expression\n")
15369 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
15372 DEFUN (no_ip_community_list_standard_all
,
15373 no_ip_community_list_standard_all_cmd
,
15374 "no ip community-list <1-99>",
15378 "Community list number (standard)\n")
15380 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
15383 DEFUN (no_ip_community_list_standard_direction
,
15384 no_ip_community_list_standard_direction_cmd
,
15385 "no ip community-list <1-99> (deny|permit)",
15389 "Community list number (standard)\n"
15390 "Specify community to reject\n"
15391 "Specify community to accept\n")
15393 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
15397 DEFUN (no_ip_community_list_expanded_all
,
15398 no_ip_community_list_expanded_all_cmd
,
15399 "no ip community-list <100-500>",
15403 "Community list number (expanded)\n")
15405 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
15408 DEFUN (no_ip_community_list_name_standard_all
,
15409 no_ip_community_list_name_standard_all_cmd
,
15410 "no ip community-list standard WORD",
15414 "Add a standard community-list entry\n"
15415 "Community list name\n")
15417 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
15420 DEFUN (no_ip_community_list_name_expanded_all
,
15421 no_ip_community_list_name_expanded_all_cmd
,
15422 "no ip community-list expanded WORD",
15426 "Add an expanded community-list entry\n"
15427 "Community list name\n")
15429 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
15432 DEFUN (no_ip_community_list_standard
,
15433 no_ip_community_list_standard_cmd
,
15434 "no ip community-list <1-99> (deny|permit) .AA:NN",
15438 "Community list number (standard)\n"
15439 "Specify community to reject\n"
15440 "Specify community to accept\n"
15443 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
15446 DEFUN (no_ip_community_list_expanded
,
15447 no_ip_community_list_expanded_cmd
,
15448 "no ip community-list <100-500> (deny|permit) .LINE",
15452 "Community list number (expanded)\n"
15453 "Specify community to reject\n"
15454 "Specify community to accept\n"
15455 "An ordered list as a regular-expression\n")
15457 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
15460 DEFUN (no_ip_community_list_name_standard
,
15461 no_ip_community_list_name_standard_cmd
,
15462 "no ip community-list standard WORD (deny|permit) .AA:NN",
15466 "Specify a standard community-list\n"
15467 "Community list name\n"
15468 "Specify community to reject\n"
15469 "Specify community to accept\n"
15472 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
15475 DEFUN (no_ip_community_list_name_standard_brief
,
15476 no_ip_community_list_name_standard_brief_cmd
,
15477 "no ip community-list standard WORD (deny|permit)",
15481 "Specify a standard community-list\n"
15482 "Community list name\n"
15483 "Specify community to reject\n"
15484 "Specify community to accept\n")
15486 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
15489 DEFUN (no_ip_community_list_name_expanded
,
15490 no_ip_community_list_name_expanded_cmd
,
15491 "no ip community-list expanded WORD (deny|permit) .LINE",
15495 "Specify an expanded community-list\n"
15496 "Community list name\n"
15497 "Specify community to reject\n"
15498 "Specify community to accept\n"
15499 "An ordered list as a regular-expression\n")
15501 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
15505 community_list_show (struct vty
*vty
, struct community_list
*list
)
15507 struct community_entry
*entry
;
15509 for (entry
= list
->head
; entry
; entry
= entry
->next
)
15511 if (entry
== list
->head
)
15513 if (all_digit (list
->name
))
15514 vty_out (vty
, "Community %s list %s%s",
15515 entry
->style
== COMMUNITY_LIST_STANDARD
?
15516 "standard" : "(expanded) access",
15517 list
->name
, VTY_NEWLINE
);
15519 vty_out (vty
, "Named Community %s list %s%s",
15520 entry
->style
== COMMUNITY_LIST_STANDARD
?
15521 "standard" : "expanded",
15522 list
->name
, VTY_NEWLINE
);
15525 vty_out (vty
, " %s%s",
15526 community_direct_str (entry
->direct
), VTY_NEWLINE
);
15528 vty_out (vty
, " %s %s%s",
15529 community_direct_str (entry
->direct
),
15530 entry
->style
== COMMUNITY_LIST_STANDARD
15531 ? community_str (entry
->u
.com
) : entry
->config
,
15536 DEFUN (show_ip_community_list
,
15537 show_ip_community_list_cmd
,
15538 "show ip community-list",
15541 "List community-list\n")
15543 struct community_list
*list
;
15544 struct community_list_master
*cm
;
15546 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
15548 return CMD_SUCCESS
;
15550 for (list
= cm
->num
.head
; list
; list
= list
->next
)
15551 community_list_show (vty
, list
);
15553 for (list
= cm
->str
.head
; list
; list
= list
->next
)
15554 community_list_show (vty
, list
);
15556 return CMD_SUCCESS
;
15559 DEFUN (show_ip_community_list_arg
,
15560 show_ip_community_list_arg_cmd
,
15561 "show ip community-list (<1-500>|WORD)",
15564 "List community-list\n"
15565 "Community-list number\n"
15566 "Community-list name\n")
15568 struct community_list
*list
;
15570 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_MASTER
);
15573 vty_out (vty
, "%% Can't find community-list%s", VTY_NEWLINE
);
15574 return CMD_WARNING
;
15577 community_list_show (vty
, list
);
15579 return CMD_SUCCESS
;
15583 extcommunity_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
15584 int style
, int reject_all_digit_name
)
15590 /* Check the list type. */
15591 if (strncmp (argv
[1], "p", 1) == 0)
15592 direct
= COMMUNITY_PERMIT
;
15593 else if (strncmp (argv
[1], "d", 1) == 0)
15594 direct
= COMMUNITY_DENY
;
15597 vty_out (vty
, "%% Matching condition must be permit or deny%s",
15599 return CMD_WARNING
;
15602 /* All digit name check. */
15603 if (reject_all_digit_name
&& all_digit (argv
[0]))
15605 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
15606 return CMD_WARNING
;
15609 /* Concat community string argument. */
15611 str
= argv_concat (argv
, argc
, 2);
15615 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
15617 /* Free temporary community list string allocated by
15620 XFREE (MTYPE_TMP
, str
);
15624 community_list_perror (vty
, ret
);
15625 return CMD_WARNING
;
15627 return CMD_SUCCESS
;
15631 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
15632 int style
, int delete_all
)
15640 /* Check the list direct. */
15641 if (strncmp (argv
[1], "p", 1) == 0)
15642 direct
= COMMUNITY_PERMIT
;
15643 else if (strncmp (argv
[1], "d", 1) == 0)
15644 direct
= COMMUNITY_DENY
;
15647 vty_out (vty
, "%% Matching condition must be permit or deny%s",
15649 return CMD_WARNING
;
15652 /* Concat community string argument. */
15653 str
= argv_concat (argv
, argc
, 2);
15656 /* Unset community list. */
15657 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
, delete_all
);
15659 /* Free temporary community list string allocated by
15662 XFREE (MTYPE_TMP
, str
);
15666 community_list_perror (vty
, ret
);
15667 return CMD_WARNING
;
15670 return CMD_SUCCESS
;
15673 /* "extcommunity-list" keyword help string. */
15674 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
15675 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
15677 DEFUN (ip_extcommunity_list_standard
,
15678 ip_extcommunity_list_standard_cmd
,
15679 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
15681 EXTCOMMUNITY_LIST_STR
15682 "Extended Community list number (standard)\n"
15683 "Specify community to reject\n"
15684 "Specify community to accept\n"
15685 EXTCOMMUNITY_VAL_STR
)
15687 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
15690 ALIAS (ip_extcommunity_list_standard
,
15691 ip_extcommunity_list_standard2_cmd
,
15692 "ip extcommunity-list <1-99> (deny|permit)",
15694 EXTCOMMUNITY_LIST_STR
15695 "Extended Community list number (standard)\n"
15696 "Specify community to reject\n"
15697 "Specify community to accept\n")
15699 DEFUN (ip_extcommunity_list_expanded
,
15700 ip_extcommunity_list_expanded_cmd
,
15701 "ip extcommunity-list <100-500> (deny|permit) .LINE",
15703 EXTCOMMUNITY_LIST_STR
15704 "Extended Community list number (expanded)\n"
15705 "Specify community to reject\n"
15706 "Specify community to accept\n"
15707 "An ordered list as a regular-expression\n")
15709 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
15712 DEFUN (ip_extcommunity_list_name_standard
,
15713 ip_extcommunity_list_name_standard_cmd
,
15714 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
15716 EXTCOMMUNITY_LIST_STR
15717 "Specify standard extcommunity-list\n"
15718 "Extended Community list name\n"
15719 "Specify community to reject\n"
15720 "Specify community to accept\n"
15721 EXTCOMMUNITY_VAL_STR
)
15723 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
15726 ALIAS (ip_extcommunity_list_name_standard
,
15727 ip_extcommunity_list_name_standard2_cmd
,
15728 "ip extcommunity-list standard WORD (deny|permit)",
15730 EXTCOMMUNITY_LIST_STR
15731 "Specify standard extcommunity-list\n"
15732 "Extended Community list name\n"
15733 "Specify community to reject\n"
15734 "Specify community to accept\n")
15736 DEFUN (ip_extcommunity_list_name_expanded
,
15737 ip_extcommunity_list_name_expanded_cmd
,
15738 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
15740 EXTCOMMUNITY_LIST_STR
15741 "Specify expanded extcommunity-list\n"
15742 "Extended Community list name\n"
15743 "Specify community to reject\n"
15744 "Specify community to accept\n"
15745 "An ordered list as a regular-expression\n")
15747 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
15750 DEFUN (no_ip_extcommunity_list_standard_all
,
15751 no_ip_extcommunity_list_standard_all_cmd
,
15752 "no ip extcommunity-list <1-99>",
15755 EXTCOMMUNITY_LIST_STR
15756 "Extended Community list number (standard)\n")
15758 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
15761 DEFUN (no_ip_extcommunity_list_standard_direction
,
15762 no_ip_extcommunity_list_standard_direction_cmd
,
15763 "no ip extcommunity-list <1-99> (deny|permit)",
15766 EXTCOMMUNITY_LIST_STR
15767 "Extended Community list number (standard)\n"
15768 "Specify community to reject\n"
15769 "Specify community to accept\n")
15771 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
15774 DEFUN (no_ip_extcommunity_list_expanded_all
,
15775 no_ip_extcommunity_list_expanded_all_cmd
,
15776 "no ip extcommunity-list <100-500>",
15779 EXTCOMMUNITY_LIST_STR
15780 "Extended Community list number (expanded)\n")
15782 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
15785 DEFUN (no_ip_extcommunity_list_name_standard_all
,
15786 no_ip_extcommunity_list_name_standard_all_cmd
,
15787 "no ip extcommunity-list standard WORD",
15790 EXTCOMMUNITY_LIST_STR
15791 "Specify standard extcommunity-list\n"
15792 "Extended Community list name\n")
15794 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
15797 DEFUN (no_ip_extcommunity_list_name_expanded_all
,
15798 no_ip_extcommunity_list_name_expanded_all_cmd
,
15799 "no ip extcommunity-list expanded WORD",
15802 EXTCOMMUNITY_LIST_STR
15803 "Specify expanded extcommunity-list\n"
15804 "Extended Community list name\n")
15806 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
15809 DEFUN (no_ip_extcommunity_list_standard
,
15810 no_ip_extcommunity_list_standard_cmd
,
15811 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
15814 EXTCOMMUNITY_LIST_STR
15815 "Extended Community list number (standard)\n"
15816 "Specify community to reject\n"
15817 "Specify community to accept\n"
15818 EXTCOMMUNITY_VAL_STR
)
15820 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
15823 DEFUN (no_ip_extcommunity_list_expanded
,
15824 no_ip_extcommunity_list_expanded_cmd
,
15825 "no ip extcommunity-list <100-500> (deny|permit) .LINE",
15828 EXTCOMMUNITY_LIST_STR
15829 "Extended Community list number (expanded)\n"
15830 "Specify community to reject\n"
15831 "Specify community to accept\n"
15832 "An ordered list as a regular-expression\n")
15834 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
15837 DEFUN (no_ip_extcommunity_list_name_standard
,
15838 no_ip_extcommunity_list_name_standard_cmd
,
15839 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
15842 EXTCOMMUNITY_LIST_STR
15843 "Specify standard extcommunity-list\n"
15844 "Extended Community list name\n"
15845 "Specify community to reject\n"
15846 "Specify community to accept\n"
15847 EXTCOMMUNITY_VAL_STR
)
15849 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
15852 DEFUN (no_ip_extcommunity_list_name_standard_brief
,
15853 no_ip_extcommunity_list_name_standard_brief_cmd
,
15854 "no ip extcommunity-list standard WORD (deny|permit)",
15857 EXTCOMMUNITY_LIST_STR
15858 "Specify standard extcommunity-list\n"
15859 "Extended Community list name\n"
15860 "Specify community to reject\n"
15861 "Specify community to accept\n")
15863 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
15866 DEFUN (no_ip_extcommunity_list_name_expanded
,
15867 no_ip_extcommunity_list_name_expanded_cmd
,
15868 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
15871 EXTCOMMUNITY_LIST_STR
15872 "Specify expanded extcommunity-list\n"
15873 "Community list name\n"
15874 "Specify community to reject\n"
15875 "Specify community to accept\n"
15876 "An ordered list as a regular-expression\n")
15878 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
15882 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
15884 struct community_entry
*entry
;
15886 for (entry
= list
->head
; entry
; entry
= entry
->next
)
15888 if (entry
== list
->head
)
15890 if (all_digit (list
->name
))
15891 vty_out (vty
, "Extended community %s list %s%s",
15892 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
15893 "standard" : "(expanded) access",
15894 list
->name
, VTY_NEWLINE
);
15896 vty_out (vty
, "Named extended community %s list %s%s",
15897 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
15898 "standard" : "expanded",
15899 list
->name
, VTY_NEWLINE
);
15902 vty_out (vty
, " %s%s",
15903 community_direct_str (entry
->direct
), VTY_NEWLINE
);
15905 vty_out (vty
, " %s %s%s",
15906 community_direct_str (entry
->direct
),
15907 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
15908 entry
->u
.ecom
->str
: entry
->config
,
15913 DEFUN (show_ip_extcommunity_list
,
15914 show_ip_extcommunity_list_cmd
,
15915 "show ip extcommunity-list",
15918 "List extended-community list\n")
15920 struct community_list
*list
;
15921 struct community_list_master
*cm
;
15923 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
15925 return CMD_SUCCESS
;
15927 for (list
= cm
->num
.head
; list
; list
= list
->next
)
15928 extcommunity_list_show (vty
, list
);
15930 for (list
= cm
->str
.head
; list
; list
= list
->next
)
15931 extcommunity_list_show (vty
, list
);
15933 return CMD_SUCCESS
;
15936 DEFUN (show_ip_extcommunity_list_arg
,
15937 show_ip_extcommunity_list_arg_cmd
,
15938 "show ip extcommunity-list (<1-500>|WORD)",
15941 "List extended-community list\n"
15942 "Extcommunity-list number\n"
15943 "Extcommunity-list name\n")
15945 struct community_list
*list
;
15947 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_MASTER
);
15950 vty_out (vty
, "%% Can't find extcommunity-list%s", VTY_NEWLINE
);
15951 return CMD_WARNING
;
15954 extcommunity_list_show (vty
, list
);
15956 return CMD_SUCCESS
;
15959 /* Return configuration string of community-list entry. */
15960 static const char *
15961 community_list_config_str (struct community_entry
*entry
)
15969 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
15970 str
= community_str (entry
->u
.com
);
15972 str
= entry
->config
;
15977 /* Display community-list and extcommunity-list configuration. */
15979 community_list_config_write (struct vty
*vty
)
15981 struct community_list
*list
;
15982 struct community_entry
*entry
;
15983 struct community_list_master
*cm
;
15986 /* Community-list. */
15987 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
15989 for (list
= cm
->num
.head
; list
; list
= list
->next
)
15990 for (entry
= list
->head
; entry
; entry
= entry
->next
)
15992 vty_out (vty
, "ip community-list %s %s %s%s",
15993 list
->name
, community_direct_str (entry
->direct
),
15994 community_list_config_str (entry
),
15998 for (list
= cm
->str
.head
; list
; list
= list
->next
)
15999 for (entry
= list
->head
; entry
; entry
= entry
->next
)
16001 vty_out (vty
, "ip community-list %s %s %s %s%s",
16002 entry
->style
== COMMUNITY_LIST_STANDARD
16003 ? "standard" : "expanded",
16004 list
->name
, community_direct_str (entry
->direct
),
16005 community_list_config_str (entry
),
16010 /* Extcommunity-list. */
16011 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
16013 for (list
= cm
->num
.head
; list
; list
= list
->next
)
16014 for (entry
= list
->head
; entry
; entry
= entry
->next
)
16016 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
16017 list
->name
, community_direct_str (entry
->direct
),
16018 community_list_config_str (entry
), VTY_NEWLINE
);
16021 for (list
= cm
->str
.head
; list
; list
= list
->next
)
16022 for (entry
= list
->head
; entry
; entry
= entry
->next
)
16024 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
16025 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
16026 ? "standard" : "expanded",
16027 list
->name
, community_direct_str (entry
->direct
),
16028 community_list_config_str (entry
), VTY_NEWLINE
);
16034 static struct cmd_node community_list_node
=
16036 COMMUNITY_LIST_NODE
,
16038 1 /* Export to vtysh. */
16042 community_list_vty (void)
16044 install_node (&community_list_node
, community_list_config_write
);
16046 /* Community-list. */
16047 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
16048 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
16049 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
16050 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
16051 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
16052 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
16053 install_element (CONFIG_NODE
, &no_ip_community_list_standard_all_cmd
);
16054 install_element (CONFIG_NODE
, &no_ip_community_list_standard_direction_cmd
);
16055 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_all_cmd
);
16056 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_all_cmd
);
16057 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_all_cmd
);
16058 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
16059 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
16060 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
16061 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_brief_cmd
);
16062 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
16063 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
16064 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
16065 install_element (ENABLE_NODE
, &show_ip_community_list_cmd
);
16066 install_element (ENABLE_NODE
, &show_ip_community_list_arg_cmd
);
16068 /* Extcommunity-list. */
16069 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
16070 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
16071 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
16072 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
16073 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
16074 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
16075 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_all_cmd
);
16076 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_direction_cmd
);
16077 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_all_cmd
);
16078 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_all_cmd
);
16079 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_all_cmd
);
16080 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
16081 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
16082 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
16083 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_brief_cmd
);
16084 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
16085 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
16086 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);
16087 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_cmd
);
16088 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_arg_cmd
);