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
33 #include "memory_vty.h"
38 #include "bgpd/bgpd.h"
39 #include "bgpd/bgp_advertise.h"
40 #include "bgpd/bgp_attr.h"
41 #include "bgpd/bgp_aspath.h"
42 #include "bgpd/bgp_community.h"
43 #include "bgpd/bgp_ecommunity.h"
44 #include "bgpd/bgp_damp.h"
45 #include "bgpd/bgp_debug.h"
46 #include "bgpd/bgp_fsm.h"
47 #include "bgpd/bgp_mplsvpn.h"
48 #include "bgpd/bgp_nexthop.h"
49 #include "bgpd/bgp_open.h"
50 #include "bgpd/bgp_regex.h"
51 #include "bgpd/bgp_route.h"
52 #include "bgpd/bgp_zebra.h"
53 #include "bgpd/bgp_table.h"
54 #include "bgpd/bgp_vty.h"
55 #include "bgpd/bgp_mpath.h"
56 #include "bgpd/bgp_packet.h"
57 #include "bgpd/bgp_updgrp.h"
58 #include "bgpd/bgp_bfd.h"
60 static struct peer_group
*
61 listen_range_exists (struct bgp
*bgp
, struct prefix
*range
, int exact
);
63 /* Utility function to get address family from current node. */
65 bgp_node_afi (struct vty
*vty
)
73 case BGP_ENCAPV6_NODE
:
83 /* Utility function to get subsequent address family from current
86 bgp_node_safi (struct vty
*vty
)
92 case BGP_ENCAPV6_NODE
:
101 safi
= SAFI_MULTICAST
;
110 /* supports (ipv4|ipv6) */
112 bgp_vty_afi_from_arg(const char *afi_str
)
114 afi_t afi
= AFI_MAX
; /* unknown */
115 if (!strcmp(afi_str
, "ipv4")) {
118 else if (!strcmp(afi_str
, "ipv6")) {
125 bgp_parse_afi(const char *str
, afi_t
*afi
)
127 *afi
= bgp_vty_afi_from_arg(str
);
135 /* supports (unicast|multicast|vpn|encap) */
137 bgp_vty_safi_from_arg(const char *safi_str
)
139 safi_t safi
= SAFI_MAX
; /* unknown */
140 if (strncmp (safi_str
, "m", 1) == 0)
141 safi
= SAFI_MULTICAST
;
142 else if (strncmp (safi_str
, "u", 1) == 0)
144 else if (strncmp (safi_str
, "e", 1) == 0)
146 else if (strncmp (safi_str
, "v", 1) == 0)
147 safi
= SAFI_MPLS_VPN
;
152 bgp_parse_safi(const char *str
, safi_t
*safi
)
154 *safi
= bgp_vty_safi_from_arg(str
);
155 if (*safi
!= SAFI_MAX
)
162 peer_address_self_check (struct bgp
*bgp
, union sockunion
*su
)
164 struct interface
*ifp
= NULL
;
166 if (su
->sa
.sa_family
== AF_INET
)
167 ifp
= if_lookup_by_ipv4_exact (&su
->sin
.sin_addr
, bgp
->vrf_id
);
168 else if (su
->sa
.sa_family
== AF_INET6
)
169 ifp
= if_lookup_by_ipv6_exact (&su
->sin6
.sin6_addr
,
170 su
->sin6
.sin6_scope_id
, bgp
->vrf_id
);
178 /* Utility function for looking up peer from VTY. */
179 /* This is used only for configuration, so disallow if attempted on
180 * a dynamic neighbor.
183 peer_lookup_vty (struct vty
*vty
, const char *ip_str
)
192 ret
= str2sockunion (ip_str
, &su
);
195 peer
= peer_lookup_by_conf_if (bgp
, ip_str
);
198 if ((peer
= peer_lookup_by_hostname(bgp
, ip_str
)) == NULL
)
200 vty_out (vty
, "%% Malformed address or name: %s%s", ip_str
, VTY_NEWLINE
);
207 peer
= peer_lookup (bgp
, &su
);
210 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
214 if (peer_dynamic_neighbor (peer
))
216 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
225 /* Utility function for looking up peer or peer group. */
226 /* This is used only for configuration, so disallow if attempted on
227 * a dynamic neighbor.
230 peer_and_group_lookup_vty (struct vty
*vty
, const char *peer_str
)
235 struct peer
*peer
= NULL
;
236 struct peer_group
*group
= NULL
;
240 ret
= str2sockunion (peer_str
, &su
);
243 /* IP address, locate peer. */
244 peer
= peer_lookup (bgp
, &su
);
248 /* Not IP, could match either peer configured on interface or a group. */
249 peer
= peer_lookup_by_conf_if (bgp
, peer_str
);
251 group
= peer_group_lookup (bgp
, peer_str
);
256 if (peer_dynamic_neighbor (peer
))
258 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
269 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
276 bgp_vty_return (struct vty
*vty
, int ret
)
278 const char *str
= NULL
;
282 case BGP_ERR_INVALID_VALUE
:
283 str
= "Invalid value";
285 case BGP_ERR_INVALID_FLAG
:
286 str
= "Invalid flag";
288 case BGP_ERR_PEER_GROUP_SHUTDOWN
:
289 str
= "Peer-group has been shutdown. Activate the peer-group first";
291 case BGP_ERR_PEER_FLAG_CONFLICT
:
292 str
= "Can't set override-capability and strict-capability-match at the same time";
294 case BGP_ERR_PEER_GROUP_NO_REMOTE_AS
:
295 str
= "Specify remote-as or peer-group remote AS first";
297 case BGP_ERR_PEER_GROUP_CANT_CHANGE
:
298 str
= "Cannot change the peer-group. Deconfigure first";
300 case BGP_ERR_PEER_GROUP_MISMATCH
:
301 str
= "Peer is not a member of this peer-group";
303 case BGP_ERR_PEER_FILTER_CONFLICT
:
304 str
= "Prefix/distribute list can not co-exist";
306 case BGP_ERR_NOT_INTERNAL_PEER
:
307 str
= "Invalid command. Not an internal neighbor";
309 case BGP_ERR_REMOVE_PRIVATE_AS
:
310 str
= "remove-private-AS cannot be configured for IBGP peers";
312 case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP
:
313 str
= "Local-AS allowed only for EBGP peers";
315 case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS
:
316 str
= "Cannot have local-as same as BGP AS number";
318 case BGP_ERR_TCPSIG_FAILED
:
319 str
= "Error while applying TCP-Sig to session(s)";
321 case BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK
:
322 str
= "ebgp-multihop and ttl-security cannot be configured together";
324 case BGP_ERR_NO_IBGP_WITH_TTLHACK
:
325 str
= "ttl-security only allowed for EBGP peers";
327 case BGP_ERR_AS_OVERRIDE
:
328 str
= "as-override cannot be configured for IBGP peers";
330 case BGP_ERR_INVALID_DYNAMIC_NEIGHBORS_LIMIT
:
331 str
= "Invalid limit for number of dynamic neighbors";
333 case BGP_ERR_DYNAMIC_NEIGHBORS_RANGE_EXISTS
:
334 str
= "Dynamic neighbor listen range already exists";
336 case BGP_ERR_INVALID_FOR_DYNAMIC_PEER
:
337 str
= "Operation not allowed on a dynamic neighbor";
339 case BGP_ERR_INVALID_FOR_DIRECT_PEER
:
340 str
= "Operation not allowed on a directly connected neighbor";
345 vty_out (vty
, "%% %s%s", str
, VTY_NEWLINE
);
351 /* BGP clear sort. */
362 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
363 safi_t safi
, int error
)
367 case BGP_ERR_AF_UNCONFIGURED
:
369 "%%BGP: Enable %s address family for the neighbor %s%s",
370 afi_safi_print(afi
, safi
), peer
->host
, VTY_NEWLINE
);
372 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
373 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
);
380 /* `clear ip bgp' functions. */
382 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
383 enum clear_sort sort
,enum bgp_clear_type stype
, const char *arg
)
387 struct listnode
*node
, *nnode
;
389 /* Clear all neighbors. */
391 * Pass along pointer to next node to peer_clear() when walking all nodes
392 * on the BGP instance as that may get freed if it is a doppelganger
394 if (sort
== clear_all
)
396 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
398 if (stype
== BGP_CLEAR_SOFT_NONE
)
399 ret
= peer_clear (peer
, &nnode
);
400 else if (peer
->afc
[afi
][safi
])
401 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
406 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
409 /* This is to apply read-only mode on this clear. */
410 if (stype
== BGP_CLEAR_SOFT_NONE
)
411 bgp
->update_delay_over
= 0;
416 /* Clear specified neighbors. */
417 if (sort
== clear_peer
)
422 /* Make sockunion for lookup. */
423 ret
= str2sockunion (arg
, &su
);
426 peer
= peer_lookup_by_conf_if (bgp
, arg
);
429 peer
= peer_lookup_by_hostname(bgp
, arg
);
432 vty_out (vty
, "Malformed address or name: %s%s", arg
, VTY_NEWLINE
);
439 peer
= peer_lookup (bgp
, &su
);
442 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
447 if (stype
== BGP_CLEAR_SOFT_NONE
)
448 ret
= peer_clear (peer
, NULL
);
450 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
453 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
458 /* Clear all peer-group members. */
459 if (sort
== clear_group
)
461 struct peer_group
*group
;
463 group
= peer_group_lookup (bgp
, arg
);
466 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
470 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
472 if (stype
== BGP_CLEAR_SOFT_NONE
)
474 peer_clear (peer
, NULL
);
478 if (! peer
->afc
[afi
][safi
])
481 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
484 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
489 if (sort
== clear_external
)
491 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
493 if (peer
->sort
== BGP_PEER_IBGP
)
496 if (stype
== BGP_CLEAR_SOFT_NONE
)
497 ret
= peer_clear (peer
, &nnode
);
499 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
502 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
507 if (sort
== clear_as
)
512 VTY_GET_INTEGER_RANGE ("AS", as
, arg
, 1, BGP_AS4_MAX
);
514 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
520 if (stype
== BGP_CLEAR_SOFT_NONE
)
521 ret
= peer_clear (peer
, &nnode
);
523 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
526 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
529 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
538 bgp_clear_vty (struct vty
*vty
, const char *name
, afi_t afi
, safi_t safi
,
539 enum clear_sort sort
, enum bgp_clear_type stype
,
544 /* BGP structure lookup. */
547 bgp
= bgp_lookup_by_name (name
);
550 vty_out (vty
, "Can't find BGP instance %s%s", name
, VTY_NEWLINE
);
556 bgp
= bgp_get_default ();
559 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
564 return bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
567 /* clear soft inbound */
569 bgp_clear_star_soft_in (struct vty
*vty
, const char *name
)
571 bgp_clear_vty (vty
,name
, AFI_IP
, SAFI_UNICAST
, clear_all
,
572 BGP_CLEAR_SOFT_IN
, NULL
);
573 bgp_clear_vty (vty
, name
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
574 BGP_CLEAR_SOFT_IN
, NULL
);
577 /* clear soft outbound */
579 bgp_clear_star_soft_out (struct vty
*vty
, const char *name
)
581 bgp_clear_vty (vty
, name
, AFI_IP
, SAFI_UNICAST
, clear_all
,
582 BGP_CLEAR_SOFT_OUT
, NULL
);
583 bgp_clear_vty (vty
, name
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
584 BGP_CLEAR_SOFT_OUT
, NULL
);
588 /* BGP global configuration. */
590 DEFUN (bgp_multiple_instance_func
,
591 bgp_multiple_instance_cmd
,
592 "bgp multiple-instance",
594 "Enable bgp multiple instance\n")
596 bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE
);
600 DEFUN (no_bgp_multiple_instance
,
601 no_bgp_multiple_instance_cmd
,
602 "no bgp multiple-instance",
605 "BGP multiple instance\n")
609 ret
= bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE
);
612 vty_out (vty
, "%% There are more than two BGP instances%s", VTY_NEWLINE
);
618 DEFUN (bgp_config_type
,
620 "bgp config-type (cisco|zebra)",
622 "Configuration type\n"
626 if (strncmp (argv
[0], "c", 1) == 0)
627 bgp_option_set (BGP_OPT_CONFIG_CISCO
);
629 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
634 DEFUN (no_bgp_config_type
,
635 no_bgp_config_type_cmd
,
636 "no bgp config-type",
639 "Display configuration type\n")
641 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
645 ALIAS (no_bgp_config_type
,
646 no_bgp_config_type_val_cmd
,
647 "no bgp config-type (cisco|zebra)",
650 "Configuration type\n"
654 DEFUN (no_synchronization
,
655 no_synchronization_cmd
,
656 "no synchronization",
658 "Perform IGP synchronization\n")
663 DEFUN (no_auto_summary
,
667 "Enable automatic network number summarization\n")
672 /* "router bgp" commands. */
675 "router bgp " CMD_AS_RANGE
,
683 const char *name
= NULL
;
684 enum bgp_instance_type inst_type
;
686 // "router bgp" without an ASN
689 //Pending: Make VRF option available for ASN less config
690 bgp
= bgp_get_default();
694 vty_out (vty
, "%% No BGP process is configured%s", VTY_NEWLINE
);
698 if (listcount(bm
->bgp
) > 1)
700 vty_out (vty
, "%% Multiple BGP processes are configured%s", VTY_NEWLINE
);
708 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
710 inst_type
= BGP_INSTANCE_TYPE_DEFAULT
;
714 if (!strcmp(argv
[1], "vrf"))
715 inst_type
= BGP_INSTANCE_TYPE_VRF
;
716 else if (!strcmp(argv
[1], "view"))
717 inst_type
= BGP_INSTANCE_TYPE_VIEW
;
720 ret
= bgp_get (&bgp
, &as
, name
, inst_type
);
723 case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET
:
724 vty_out (vty
, "Please specify 'bgp multiple-instance' first%s",
727 case BGP_ERR_AS_MISMATCH
:
728 vty_out (vty
, "BGP is already running; AS is %u%s", as
, VTY_NEWLINE
);
730 case BGP_ERR_INSTANCE_MISMATCH
:
731 vty_out (vty
, "BGP instance name and AS number mismatch%s", VTY_NEWLINE
);
732 vty_out (vty
, "BGP instance is already running; AS is %u%s",
737 /* Pending: handle when user tries to change a view to vrf n vv. */
740 vty
->node
= BGP_NODE
;
747 router_bgp_instance_cmd
,
748 "router bgp " CMD_AS_RANGE
" (view|vrf) WORD",
752 "BGP view\nBGP VRF\n"
756 router_bgp_noasn_cmd
,
761 /* "no router bgp" commands. */
762 DEFUN (no_router_bgp
,
764 "no router bgp " CMD_AS_RANGE
,
772 const char *name
= NULL
;
775 // "no router bgp" without an ASN
778 //Pending: Make VRF option available for ASN less config
779 bgp
= bgp_get_default();
783 vty_out (vty
, "%% No BGP process is configured%s", VTY_NEWLINE
);
787 if (listcount(bm
->bgp
) > 1)
789 vty_out (vty
, "%% Multiple BGP processes are configured%s", VTY_NEWLINE
);
795 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
800 /* Lookup bgp structure. */
801 bgp
= bgp_lookup (as
, name
);
804 vty_out (vty
, "%% Can't find BGP instance%s", VTY_NEWLINE
);
814 ALIAS (no_router_bgp
,
815 no_router_bgp_instance_cmd
,
816 "no router bgp " CMD_AS_RANGE
" (view|vrf) WORD",
821 "BGP view\nBGP VRF\n"
824 ALIAS (no_router_bgp
,
825 no_router_bgp_noasn_cmd
,
833 DEFUN (bgp_router_id
,
835 "bgp router-id A.B.C.D",
837 "Override configured router identifier\n"
838 "Manually configured router identifier\n")
846 ret
= inet_aton (argv
[0], &id
);
849 vty_out (vty
, "%% Malformed bgp router identifier%s", VTY_NEWLINE
);
853 bgp_router_id_static_set (bgp
, id
);
858 DEFUN (no_bgp_router_id
,
859 no_bgp_router_id_cmd
,
863 "Override configured router identifier\n")
873 ret
= inet_aton (argv
[0], &id
);
876 vty_out (vty
, "%% Malformed BGP router identifier%s", VTY_NEWLINE
);
880 if (! IPV4_ADDR_SAME (&bgp
->router_id_static
, &id
))
882 vty_out (vty
, "%% BGP router-id doesn't match%s", VTY_NEWLINE
);
888 bgp_router_id_static_set (bgp
, id
);
893 ALIAS (no_bgp_router_id
,
894 no_bgp_router_id_val_cmd
,
895 "no bgp router-id A.B.C.D",
898 "Override configured router identifier\n"
899 "Manually configured router identifier\n")
901 /* BGP Cluster ID. */
903 DEFUN (bgp_cluster_id
,
905 "bgp cluster-id A.B.C.D",
907 "Configure Route-Reflector Cluster-id\n"
908 "Route-Reflector Cluster-id in IP address format\n")
912 struct in_addr cluster
;
916 ret
= inet_aton (argv
[0], &cluster
);
919 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
923 bgp_cluster_id_set (bgp
, &cluster
);
924 bgp_clear_star_soft_out (vty
, bgp
->name
);
929 ALIAS (bgp_cluster_id
,
930 bgp_cluster_id32_cmd
,
931 "bgp cluster-id <1-4294967295>",
933 "Configure Route-Reflector Cluster-id\n"
934 "Route-Reflector Cluster-id as 32 bit quantity\n")
936 DEFUN (no_bgp_cluster_id
,
937 no_bgp_cluster_id_cmd
,
941 "Configure Route-Reflector Cluster-id\n")
945 struct in_addr cluster
;
951 ret
= inet_aton (argv
[0], &cluster
);
954 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
959 bgp_cluster_id_unset (bgp
);
960 bgp_clear_star_soft_out (vty
, bgp
->name
);
965 ALIAS (no_bgp_cluster_id
,
966 no_bgp_cluster_id_ip_cmd
,
967 "no bgp cluster-id A.B.C.D",
970 "Configure Route-Reflector Cluster-id\n"
971 "Route-Reflector Cluster-id in IP address format\n")
973 ALIAS (no_bgp_cluster_id
,
974 no_bgp_cluster_id_decimal_cmd
,
975 "no bgp cluster-id <1-4294967295>",
978 "Configure Route-Reflector Cluster-id\n"
979 "Route-Reflector Cluster-id as 32 bit quantity\n")
981 DEFUN (bgp_confederation_identifier
,
982 bgp_confederation_identifier_cmd
,
983 "bgp confederation identifier " CMD_AS_RANGE
,
984 "BGP specific commands\n"
985 "AS confederation parameters\n"
987 "Set routing domain confederation AS\n")
994 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
996 bgp_confederation_id_set (bgp
, as
);
1001 DEFUN (no_bgp_confederation_identifier
,
1002 no_bgp_confederation_identifier_cmd
,
1003 "no bgp confederation identifier",
1005 "BGP specific commands\n"
1006 "AS confederation parameters\n"
1013 bgp_confederation_id_unset (bgp
);
1018 ALIAS (no_bgp_confederation_identifier
,
1019 no_bgp_confederation_identifier_arg_cmd
,
1020 "no bgp confederation identifier " CMD_AS_RANGE
,
1022 "BGP specific commands\n"
1023 "AS confederation parameters\n"
1025 "Set routing domain confederation AS\n")
1027 DEFUN (bgp_confederation_peers
,
1028 bgp_confederation_peers_cmd
,
1029 "bgp confederation peers ." CMD_AS_RANGE
,
1030 "BGP specific commands\n"
1031 "AS confederation parameters\n"
1032 "Peer ASs in BGP confederation\n"
1041 for (i
= 0; i
< argc
; i
++)
1043 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
1047 vty_out (vty
, "%% Local member-AS not allowed in confed peer list%s",
1052 bgp_confederation_peers_add (bgp
, as
);
1057 DEFUN (no_bgp_confederation_peers
,
1058 no_bgp_confederation_peers_cmd
,
1059 "no bgp confederation peers ." CMD_AS_RANGE
,
1061 "BGP specific commands\n"
1062 "AS confederation parameters\n"
1063 "Peer ASs in BGP confederation\n"
1072 for (i
= 0; i
< argc
; i
++)
1074 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
1076 bgp_confederation_peers_remove (bgp
, as
);
1082 * Central routine for maximum-paths configuration.
1083 * @peer_type: BGP_PEER_EBGP or BGP_PEER_IBGP
1084 * @set: 1 for setting values, 0 for removing the max-paths config.
1087 bgp_maxpaths_config_vty (struct vty
*vty
, int peer_type
, const char *mpaths
,
1088 u_int16_t options
, int set
)
1091 u_int16_t maxpaths
= 0;
1097 afi
= bgp_node_afi (vty
);
1098 safi
= bgp_node_safi (vty
);
1102 VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths
, mpaths
, 1,
1104 ret
= bgp_maximum_paths_set (bgp
, afi
, safi
, peer_type
, maxpaths
,
1108 ret
= bgp_maximum_paths_unset (bgp
, afi
, safi
, peer_type
);
1113 "%% Failed to %sset maximum-paths %s %u for afi %u, safi %u%s",
1114 (set
== 1) ? "" : "un",
1115 (peer_type
== BGP_PEER_EBGP
) ? "ebgp" : "ibgp",
1116 maxpaths
, afi
, safi
, VTY_NEWLINE
);
1120 bgp_recalculate_all_bestpaths (bgp
);
1125 DEFUN (bgp_maxmed_admin
,
1126 bgp_maxmed_admin_cmd
,
1127 "bgp max-med administrative ",
1129 "Advertise routes with max-med\n"
1130 "Administratively applied, for an indefinite period\n")
1136 bgp
->v_maxmed_admin
= 1;
1137 bgp
->maxmed_admin_value
= BGP_MAXMED_VALUE_DEFAULT
;
1139 bgp_maxmed_update(bgp
);
1144 DEFUN (bgp_maxmed_admin_medv
,
1145 bgp_maxmed_admin_medv_cmd
,
1146 "bgp max-med administrative <0-4294967294>",
1148 "Advertise routes with max-med\n"
1149 "Administratively applied, for an indefinite period\n"
1150 "Max MED value to be used\n")
1156 bgp
->v_maxmed_admin
= 1;
1157 VTY_GET_INTEGER ("max-med admin med-value", bgp
->maxmed_admin_value
, argv
[0]);
1159 bgp_maxmed_update(bgp
);
1164 DEFUN (no_bgp_maxmed_admin
,
1165 no_bgp_maxmed_admin_cmd
,
1166 "no bgp max-med administrative",
1169 "Advertise routes with max-med\n"
1170 "Administratively applied, for an indefinite period\n")
1176 bgp
->v_maxmed_admin
= BGP_MAXMED_ADMIN_UNCONFIGURED
;
1177 bgp
->maxmed_admin_value
= BGP_MAXMED_VALUE_DEFAULT
;
1179 bgp_maxmed_update(bgp
);
1184 ALIAS (no_bgp_maxmed_admin
,
1185 no_bgp_maxmed_admin_medv_cmd
,
1186 "no bgp max-med administrative <0-4294967294>",
1189 "Advertise routes with max-med\n"
1190 "Administratively applied, for an indefinite period\n"
1191 "Max MED value to be used\n")
1194 DEFUN (bgp_maxmed_onstartup
,
1195 bgp_maxmed_onstartup_cmd
,
1196 "bgp max-med on-startup <5-86400>",
1198 "Advertise routes with max-med\n"
1199 "Effective on a startup\n"
1200 "Time (seconds) period for max-med\n")
1208 vty_out (vty
, "%% Must supply max-med on-startup period");
1212 VTY_GET_INTEGER ("max-med on-startup period", bgp
->v_maxmed_onstartup
, argv
[0]);
1213 bgp
->maxmed_onstartup_value
= BGP_MAXMED_VALUE_DEFAULT
;
1215 bgp_maxmed_update(bgp
);
1220 DEFUN (bgp_maxmed_onstartup_medv
,
1221 bgp_maxmed_onstartup_medv_cmd
,
1222 "bgp max-med on-startup <5-86400> <0-4294967294>",
1224 "Advertise routes with max-med\n"
1225 "Effective on a startup\n"
1226 "Time (seconds) period for max-med\n"
1227 "Max MED value to be used\n")
1235 vty_out (vty
, "%% Must supply max-med on-startup period and med value");
1239 VTY_GET_INTEGER ("max-med on-startup period", bgp
->v_maxmed_onstartup
, argv
[0]);
1240 VTY_GET_INTEGER ("max-med on-startup med-value", bgp
->maxmed_onstartup_value
, argv
[1]);
1242 bgp_maxmed_update(bgp
);
1247 DEFUN (no_bgp_maxmed_onstartup
,
1248 no_bgp_maxmed_onstartup_cmd
,
1249 "no bgp max-med on-startup",
1252 "Advertise routes with max-med\n"
1253 "Effective on a startup\n")
1259 /* Cancel max-med onstartup if its on */
1260 if (bgp
->t_maxmed_onstartup
)
1262 THREAD_TIMER_OFF (bgp
->t_maxmed_onstartup
);
1263 bgp
->maxmed_onstartup_over
= 1;
1266 bgp
->v_maxmed_onstartup
= BGP_MAXMED_ONSTARTUP_UNCONFIGURED
;
1267 bgp
->maxmed_onstartup_value
= BGP_MAXMED_VALUE_DEFAULT
;
1269 bgp_maxmed_update(bgp
);
1274 ALIAS (no_bgp_maxmed_onstartup
,
1275 no_bgp_maxmed_onstartup_period_cmd
,
1276 "no bgp max-med on-startup <5-86400>",
1279 "Advertise routes with max-med\n"
1280 "Effective on a startup\n"
1281 "Time (seconds) period for max-med\n")
1283 ALIAS (no_bgp_maxmed_onstartup
,
1284 no_bgp_maxmed_onstartup_period_medv_cmd
,
1285 "no bgp max-med on-startup <5-86400> <0-4294967294>",
1288 "Advertise routes with max-med\n"
1289 "Effective on a startup\n"
1290 "Time (seconds) period for max-med\n"
1291 "Max MED value to be used\n")
1294 bgp_update_delay_config_vty (struct vty
*vty
, const char *delay
,
1298 u_int16_t update_delay
;
1299 u_int16_t establish_wait
;
1304 VTY_GET_INTEGER_RANGE ("update-delay", update_delay
, delay
,
1305 BGP_UPDATE_DELAY_MIN
, BGP_UPDATE_DELAY_MAX
);
1307 if (!wait
) /* update-delay <delay> */
1309 bgp
->v_update_delay
= update_delay
;
1310 bgp
->v_establish_wait
= bgp
->v_update_delay
;
1314 /* update-delay <delay> <establish-wait> */
1315 establish_wait
= atoi (wait
);
1316 if (update_delay
< establish_wait
)
1318 vty_out (vty
, "%%Failed: update-delay less than the establish-wait!%s",
1323 bgp
->v_update_delay
= update_delay
;
1324 bgp
->v_establish_wait
= establish_wait
;
1330 bgp_update_delay_deconfig_vty (struct vty
*vty
)
1336 bgp
->v_update_delay
= BGP_UPDATE_DELAY_DEF
;
1337 bgp
->v_establish_wait
= bgp
->v_update_delay
;
1343 bgp_config_write_update_delay (struct vty
*vty
, struct bgp
*bgp
)
1345 if (bgp
->v_update_delay
!= BGP_UPDATE_DELAY_DEF
)
1347 vty_out (vty
, " update-delay %d", bgp
->v_update_delay
);
1348 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
1349 vty_out (vty
, " %d", bgp
->v_establish_wait
);
1350 vty_out (vty
, "%s", VTY_NEWLINE
);
1357 /* Update-delay configuration */
1358 DEFUN (bgp_update_delay
,
1359 bgp_update_delay_cmd
,
1360 "update-delay <0-3600>",
1361 "Force initial delay for best-path and updates\n"
1364 return bgp_update_delay_config_vty(vty
, argv
[0], NULL
);
1367 DEFUN (bgp_update_delay_establish_wait
,
1368 bgp_update_delay_establish_wait_cmd
,
1369 "update-delay <0-3600> <1-3600>",
1370 "Force initial delay for best-path and updates\n"
1372 "Wait for peers to be established\n"
1375 return bgp_update_delay_config_vty(vty
, argv
[0], argv
[1]);
1378 /* Update-delay deconfiguration */
1379 DEFUN (no_bgp_update_delay
,
1380 no_bgp_update_delay_cmd
,
1381 "no update-delay <0-3600>",
1382 "Force initial delay for best-path and updates\n"
1385 return bgp_update_delay_deconfig_vty(vty
);
1388 ALIAS (no_bgp_update_delay
,
1389 no_bgp_update_delay_establish_wait_cmd
,
1390 "no update-delay <0-3600> <1-3600>",
1391 "Force initial delay for best-path and updates\n"
1393 "Wait for peers to be established\n"
1397 bgp_wpkt_quanta_config_vty (struct vty
*vty
, const char *num
, char set
)
1404 VTY_GET_INTEGER_RANGE ("write-quanta", bgp
->wpkt_quanta
, num
,
1407 bgp
->wpkt_quanta
= BGP_WRITE_PACKET_MAX
;
1413 bgp_config_write_wpkt_quanta (struct vty
*vty
, struct bgp
*bgp
)
1415 if (bgp
->wpkt_quanta
!= BGP_WRITE_PACKET_MAX
)
1416 vty_out (vty
, " write-quanta %d%s",
1417 bgp
->wpkt_quanta
, VTY_NEWLINE
);
1423 /* Update-delay configuration */
1424 DEFUN (bgp_wpkt_quanta
,
1425 bgp_wpkt_quanta_cmd
,
1426 "write-quanta <1-10000>",
1427 "How many packets to write to peer socket per run\n"
1428 "Number of packets\n")
1430 return bgp_wpkt_quanta_config_vty(vty
, argv
[0], 1);
1433 /* Update-delay deconfiguration */
1434 DEFUN (no_bgp_wpkt_quanta
,
1435 no_bgp_wpkt_quanta_cmd
,
1436 "no write-quanta <1-10000>",
1437 "How many packets to write to peer socket per run\n"
1438 "Number of packets\n")
1440 return bgp_wpkt_quanta_config_vty(vty
, argv
[0], 0);
1444 bgp_coalesce_config_vty (struct vty
*vty
, const char *num
, char set
)
1451 VTY_GET_INTEGER_RANGE ("coalesce-time", bgp
->coalesce_time
, num
,
1454 bgp
->coalesce_time
= BGP_DEFAULT_SUBGROUP_COALESCE_TIME
;
1460 bgp_config_write_coalesce_time (struct vty
*vty
, struct bgp
*bgp
)
1462 if (bgp
->coalesce_time
!= BGP_DEFAULT_SUBGROUP_COALESCE_TIME
)
1463 vty_out (vty
, " coalesce-time %d%s",
1464 bgp
->coalesce_time
, VTY_NEWLINE
);
1470 DEFUN (bgp_coalesce_time
,
1471 bgp_coalesce_time_cmd
,
1472 "coalesce-time <0-4294967295>",
1473 "Subgroup coalesce timer\n"
1474 "Subgroup coalesce timer value (in ms)\n")
1476 return bgp_coalesce_config_vty(vty
, argv
[0], 1);
1479 DEFUN (no_bgp_coalesce_time
,
1480 no_bgp_coalesce_time_cmd
,
1481 "no coalesce-time <0-4294967295>",
1482 "Subgroup coalesce timer\n"
1483 "Subgroup coalesce timer value (in ms)\n")
1485 return bgp_coalesce_config_vty(vty
, argv
[0], 0);
1488 /* Maximum-paths configuration */
1489 DEFUN (bgp_maxpaths
,
1491 "maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM
),
1492 "Forward packets over multiple paths\n"
1493 "Number of paths\n")
1495 return bgp_maxpaths_config_vty(vty
, BGP_PEER_EBGP
, argv
[0], 0, 1);
1498 DEFUN (bgp_maxpaths_ibgp
,
1499 bgp_maxpaths_ibgp_cmd
,
1500 "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM
),
1501 "Forward packets over multiple paths\n"
1503 "Number of paths\n")
1505 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, argv
[0], 0, 1);
1508 DEFUN (bgp_maxpaths_ibgp_cluster
,
1509 bgp_maxpaths_ibgp_cluster_cmd
,
1510 "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM
) " equal-cluster-length",
1511 "Forward packets over multiple paths\n"
1514 "Match the cluster length\n")
1516 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, argv
[0],
1517 BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN
, 1);
1520 DEFUN (no_bgp_maxpaths
,
1521 no_bgp_maxpaths_cmd
,
1524 "Forward packets over multiple paths\n"
1525 "Number of paths\n")
1527 return bgp_maxpaths_config_vty(vty
, BGP_PEER_EBGP
, NULL
, 0, 0);
1530 ALIAS (no_bgp_maxpaths
,
1531 no_bgp_maxpaths_arg_cmd
,
1532 "no maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM
),
1534 "Forward packets over multiple paths\n"
1535 "Number of paths\n")
1537 DEFUN (no_bgp_maxpaths_ibgp
,
1538 no_bgp_maxpaths_ibgp_cmd
,
1539 "no maximum-paths ibgp",
1541 "Forward packets over multiple paths\n"
1543 "Number of paths\n")
1545 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, NULL
, 0, 0);
1548 ALIAS (no_bgp_maxpaths_ibgp
,
1549 no_bgp_maxpaths_ibgp_arg_cmd
,
1550 "no maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM
),
1552 "Forward packets over multiple paths\n"
1554 "Number of paths\n")
1556 ALIAS (no_bgp_maxpaths_ibgp
,
1557 no_bgp_maxpaths_ibgp_cluster_cmd
,
1558 "no maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM
) " equal-cluster-length",
1560 "Forward packets over multiple paths\n"
1563 "Match the cluster length\n")
1566 bgp_config_write_maxpaths (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
1567 safi_t safi
, int *write
)
1569 if (bgp
->maxpaths
[afi
][safi
].maxpaths_ebgp
!= MULTIPATH_NUM
)
1571 bgp_config_write_family_header (vty
, afi
, safi
, write
);
1572 vty_out (vty
, " maximum-paths %d%s",
1573 bgp
->maxpaths
[afi
][safi
].maxpaths_ebgp
, VTY_NEWLINE
);
1576 if (bgp
->maxpaths
[afi
][safi
].maxpaths_ibgp
!= MULTIPATH_NUM
)
1578 bgp_config_write_family_header (vty
, afi
, safi
, write
);
1579 vty_out (vty
, " maximum-paths ibgp %d",
1580 bgp
->maxpaths
[afi
][safi
].maxpaths_ibgp
);
1581 if (CHECK_FLAG (bgp
->maxpaths
[afi
][safi
].ibgp_flags
,
1582 BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN
))
1583 vty_out (vty
, " equal-cluster-length");
1584 vty_out (vty
, "%s", VTY_NEWLINE
);
1594 "timers bgp <0-65535> <0-65535>",
1595 "Adjust routing timers\n"
1597 "Keepalive interval\n"
1601 unsigned long keepalive
= 0;
1602 unsigned long holdtime
= 0;
1606 VTY_GET_INTEGER ("keepalive", keepalive
, argv
[0]);
1607 VTY_GET_INTEGER ("holdtime", holdtime
, argv
[1]);
1609 /* Holdtime value check. */
1610 if (holdtime
< 3 && holdtime
!= 0)
1612 vty_out (vty
, "%% hold time value must be either 0 or greater than 3%s",
1617 bgp_timers_set (bgp
, keepalive
, holdtime
);
1622 DEFUN (no_bgp_timers
,
1626 "Adjust routing timers\n"
1632 bgp_timers_unset (bgp
);
1637 ALIAS (no_bgp_timers
,
1638 no_bgp_timers_arg_cmd
,
1639 "no timers bgp <0-65535> <0-65535>",
1641 "Adjust routing timers\n"
1643 "Keepalive interval\n"
1646 DEFUN (bgp_client_to_client_reflection
,
1647 bgp_client_to_client_reflection_cmd
,
1648 "bgp client-to-client reflection",
1649 "BGP specific commands\n"
1650 "Configure client to client route reflection\n"
1651 "reflection of routes allowed\n")
1656 bgp_flag_unset (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
1657 bgp_clear_star_soft_out (vty
, bgp
->name
);
1662 DEFUN (no_bgp_client_to_client_reflection
,
1663 no_bgp_client_to_client_reflection_cmd
,
1664 "no bgp client-to-client reflection",
1666 "BGP specific commands\n"
1667 "Configure client to client route reflection\n"
1668 "reflection of routes allowed\n")
1673 bgp_flag_set (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
1674 bgp_clear_star_soft_out (vty
, bgp
->name
);
1679 /* "bgp always-compare-med" configuration. */
1680 DEFUN (bgp_always_compare_med
,
1681 bgp_always_compare_med_cmd
,
1682 "bgp always-compare-med",
1683 "BGP specific commands\n"
1684 "Allow comparing MED from different neighbors\n")
1689 bgp_flag_set (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
1690 bgp_recalculate_all_bestpaths (bgp
);
1695 DEFUN (no_bgp_always_compare_med
,
1696 no_bgp_always_compare_med_cmd
,
1697 "no bgp always-compare-med",
1699 "BGP specific commands\n"
1700 "Allow comparing MED from different neighbors\n")
1705 bgp_flag_unset (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
1706 bgp_recalculate_all_bestpaths (bgp
);
1711 /* "bgp deterministic-med" configuration. */
1712 DEFUN (bgp_deterministic_med
,
1713 bgp_deterministic_med_cmd
,
1714 "bgp deterministic-med",
1715 "BGP specific commands\n"
1716 "Pick the best-MED path among paths advertised from the neighboring AS\n")
1722 if (!bgp_flag_check(bgp
, BGP_FLAG_DETERMINISTIC_MED
))
1724 bgp_flag_set (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
1725 bgp_recalculate_all_bestpaths (bgp
);
1731 DEFUN (no_bgp_deterministic_med
,
1732 no_bgp_deterministic_med_cmd
,
1733 "no bgp deterministic-med",
1735 "BGP specific commands\n"
1736 "Pick the best-MED path among paths advertised from the neighboring AS\n")
1739 int bestpath_per_as_used
;
1743 struct listnode
*node
, *nnode
;
1747 if (bgp_flag_check(bgp
, BGP_FLAG_DETERMINISTIC_MED
))
1749 bestpath_per_as_used
= 0;
1751 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
1753 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
1754 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
1755 if (CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS
))
1757 bestpath_per_as_used
= 1;
1761 if (bestpath_per_as_used
)
1765 if (bestpath_per_as_used
)
1767 vty_out (vty
, "bgp deterministic-med cannot be disabled while addpath-tx-bestpath-per-AS is in use%s",
1773 bgp_flag_unset (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
1774 bgp_recalculate_all_bestpaths (bgp
);
1781 /* "bgp graceful-restart" configuration. */
1782 DEFUN (bgp_graceful_restart
,
1783 bgp_graceful_restart_cmd
,
1784 "bgp graceful-restart",
1785 "BGP specific commands\n"
1786 "Graceful restart capability parameters\n")
1791 bgp_flag_set (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
1795 DEFUN (no_bgp_graceful_restart
,
1796 no_bgp_graceful_restart_cmd
,
1797 "no bgp graceful-restart",
1799 "BGP specific commands\n"
1800 "Graceful restart capability parameters\n")
1805 bgp_flag_unset (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
1809 DEFUN (bgp_graceful_restart_stalepath_time
,
1810 bgp_graceful_restart_stalepath_time_cmd
,
1811 "bgp graceful-restart stalepath-time <1-3600>",
1812 "BGP specific commands\n"
1813 "Graceful restart capability parameters\n"
1814 "Set the max time to hold onto restarting peer's stale paths\n"
1815 "Delay value (seconds)\n")
1818 u_int32_t stalepath
;
1824 VTY_GET_INTEGER_RANGE ("stalepath-time", stalepath
, argv
[0], 1, 3600);
1825 bgp
->stalepath_time
= stalepath
;
1829 DEFUN (bgp_graceful_restart_restart_time
,
1830 bgp_graceful_restart_restart_time_cmd
,
1831 "bgp graceful-restart restart-time <1-3600>",
1832 "BGP specific commands\n"
1833 "Graceful restart capability parameters\n"
1834 "Set the time to wait to delete stale routes before a BGP open message is received\n"
1835 "Delay value (seconds)\n")
1844 VTY_GET_INTEGER_RANGE ("restart-time", restart
, argv
[0], 1, 3600);
1845 bgp
->restart_time
= restart
;
1849 DEFUN (no_bgp_graceful_restart_stalepath_time
,
1850 no_bgp_graceful_restart_stalepath_time_cmd
,
1851 "no bgp graceful-restart stalepath-time",
1853 "BGP specific commands\n"
1854 "Graceful restart capability parameters\n"
1855 "Set the max time to hold onto restarting peer's stale paths\n")
1863 bgp
->stalepath_time
= BGP_DEFAULT_STALEPATH_TIME
;
1867 DEFUN (no_bgp_graceful_restart_restart_time
,
1868 no_bgp_graceful_restart_restart_time_cmd
,
1869 "no bgp graceful-restart restart-time",
1871 "BGP specific commands\n"
1872 "Graceful restart capability parameters\n"
1873 "Set the time to wait to delete stale routes before a BGP open message is received\n")
1881 bgp
->restart_time
= BGP_DEFAULT_RESTART_TIME
;
1885 ALIAS (no_bgp_graceful_restart_stalepath_time
,
1886 no_bgp_graceful_restart_stalepath_time_val_cmd
,
1887 "no bgp graceful-restart stalepath-time <1-3600>",
1889 "BGP specific commands\n"
1890 "Graceful restart capability parameters\n"
1891 "Set the max time to hold onto restarting peer's stale paths\n"
1892 "Delay value (seconds)\n")
1894 ALIAS (no_bgp_graceful_restart_restart_time
,
1895 no_bgp_graceful_restart_restart_time_val_cmd
,
1896 "no bgp graceful-restart restart-time <1-3600>",
1898 "BGP specific commands\n"
1899 "Graceful restart capability parameters\n"
1900 "Set the time to wait to delete stale routes before a BGP open message is received\n"
1901 "Delay value (seconds)\n")
1903 /* "bgp fast-external-failover" configuration. */
1904 DEFUN (bgp_fast_external_failover
,
1905 bgp_fast_external_failover_cmd
,
1906 "bgp fast-external-failover",
1908 "Immediately reset session if a link to a directly connected external peer goes down\n")
1913 bgp_flag_unset (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
1917 DEFUN (no_bgp_fast_external_failover
,
1918 no_bgp_fast_external_failover_cmd
,
1919 "no bgp fast-external-failover",
1922 "Immediately reset session if a link to a directly connected external peer goes down\n")
1927 bgp_flag_set (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
1931 /* "bgp enforce-first-as" configuration. */
1932 DEFUN (bgp_enforce_first_as
,
1933 bgp_enforce_first_as_cmd
,
1934 "bgp enforce-first-as",
1936 "Enforce the first AS for EBGP routes\n")
1941 bgp_flag_set (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
1942 bgp_clear_star_soft_in (vty
, bgp
->name
);
1947 DEFUN (no_bgp_enforce_first_as
,
1948 no_bgp_enforce_first_as_cmd
,
1949 "no bgp enforce-first-as",
1952 "Enforce the first AS for EBGP routes\n")
1957 bgp_flag_unset (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
1958 bgp_clear_star_soft_in (vty
, bgp
->name
);
1963 /* "bgp bestpath compare-routerid" configuration. */
1964 DEFUN (bgp_bestpath_compare_router_id
,
1965 bgp_bestpath_compare_router_id_cmd
,
1966 "bgp bestpath compare-routerid",
1967 "BGP specific commands\n"
1968 "Change the default bestpath selection\n"
1969 "Compare router-id for identical EBGP paths\n")
1974 bgp_flag_set (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
1975 bgp_recalculate_all_bestpaths (bgp
);
1980 DEFUN (no_bgp_bestpath_compare_router_id
,
1981 no_bgp_bestpath_compare_router_id_cmd
,
1982 "no bgp bestpath compare-routerid",
1984 "BGP specific commands\n"
1985 "Change the default bestpath selection\n"
1986 "Compare router-id for identical EBGP paths\n")
1991 bgp_flag_unset (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
1992 bgp_recalculate_all_bestpaths (bgp
);
1997 /* "bgp bestpath as-path ignore" configuration. */
1998 DEFUN (bgp_bestpath_aspath_ignore
,
1999 bgp_bestpath_aspath_ignore_cmd
,
2000 "bgp bestpath as-path ignore",
2001 "BGP specific commands\n"
2002 "Change the default bestpath selection\n"
2003 "AS-path attribute\n"
2004 "Ignore as-path length in selecting a route\n")
2009 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_IGNORE
);
2010 bgp_recalculate_all_bestpaths (bgp
);
2015 DEFUN (no_bgp_bestpath_aspath_ignore
,
2016 no_bgp_bestpath_aspath_ignore_cmd
,
2017 "no bgp bestpath as-path ignore",
2019 "BGP specific commands\n"
2020 "Change the default bestpath selection\n"
2021 "AS-path attribute\n"
2022 "Ignore as-path length in selecting a route\n")
2027 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_IGNORE
);
2028 bgp_recalculate_all_bestpaths (bgp
);
2033 /* "bgp bestpath as-path confed" configuration. */
2034 DEFUN (bgp_bestpath_aspath_confed
,
2035 bgp_bestpath_aspath_confed_cmd
,
2036 "bgp bestpath as-path confed",
2037 "BGP specific commands\n"
2038 "Change the default bestpath selection\n"
2039 "AS-path attribute\n"
2040 "Compare path lengths including confederation sets & sequences in selecting a route\n")
2045 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_CONFED
);
2046 bgp_recalculate_all_bestpaths (bgp
);
2051 DEFUN (no_bgp_bestpath_aspath_confed
,
2052 no_bgp_bestpath_aspath_confed_cmd
,
2053 "no bgp bestpath as-path confed",
2055 "BGP specific commands\n"
2056 "Change the default bestpath selection\n"
2057 "AS-path attribute\n"
2058 "Compare path lengths including confederation sets & sequences in selecting a route\n")
2063 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_CONFED
);
2064 bgp_recalculate_all_bestpaths (bgp
);
2069 /* "bgp bestpath as-path multipath-relax" configuration. */
2070 DEFUN (bgp_bestpath_aspath_multipath_relax
,
2071 bgp_bestpath_aspath_multipath_relax_cmd
,
2072 "bgp bestpath as-path multipath-relax {as-set|no-as-set}",
2073 "BGP specific commands\n"
2074 "Change the default bestpath selection\n"
2075 "AS-path attribute\n"
2076 "Allow load sharing across routes that have different AS paths (but same length)\n"
2077 "Generate an AS_SET\n"
2078 "Do not generate an AS_SET\n")
2083 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
2085 /* no-as-set is now the default behavior so we can silently
2087 if (argv
[0] != NULL
&& strncmp (argv
[0], "a", 1) == 0)
2088 bgp_flag_set (bgp
, BGP_FLAG_MULTIPATH_RELAX_AS_SET
);
2090 bgp_flag_unset (bgp
, BGP_FLAG_MULTIPATH_RELAX_AS_SET
) ;
2092 bgp_recalculate_all_bestpaths (bgp
);
2097 DEFUN (no_bgp_bestpath_aspath_multipath_relax
,
2098 no_bgp_bestpath_aspath_multipath_relax_cmd
,
2099 "no bgp bestpath as-path multipath-relax {as-set|no-as-set}",
2101 "BGP specific commands\n"
2102 "Change the default bestpath selection\n"
2103 "AS-path attribute\n"
2104 "Allow load sharing across routes that have different AS paths (but same length)\n"
2105 "Generate an AS_SET\n"
2106 "Do not generate an AS_SET\n")
2111 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
2112 bgp_flag_unset (bgp
, BGP_FLAG_MULTIPATH_RELAX_AS_SET
);
2113 bgp_recalculate_all_bestpaths (bgp
);
2118 /* "bgp log-neighbor-changes" configuration. */
2119 DEFUN (bgp_log_neighbor_changes
,
2120 bgp_log_neighbor_changes_cmd
,
2121 "bgp log-neighbor-changes",
2122 "BGP specific commands\n"
2123 "Log neighbor up/down and reset reason\n")
2128 bgp_flag_set (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
2132 DEFUN (no_bgp_log_neighbor_changes
,
2133 no_bgp_log_neighbor_changes_cmd
,
2134 "no bgp log-neighbor-changes",
2136 "BGP specific commands\n"
2137 "Log neighbor up/down and reset reason\n")
2142 bgp_flag_unset (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
2146 /* "bgp bestpath med" configuration. */
2147 DEFUN (bgp_bestpath_med
,
2148 bgp_bestpath_med_cmd
,
2149 "bgp bestpath med (confed|missing-as-worst)",
2150 "BGP specific commands\n"
2151 "Change the default bestpath selection\n"
2153 "Compare MED among confederation paths\n"
2154 "Treat missing MED as the least preferred one\n")
2160 if (strncmp (argv
[0], "confed", 1) == 0)
2161 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
2163 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2165 bgp_recalculate_all_bestpaths (bgp
);
2170 DEFUN (bgp_bestpath_med2
,
2171 bgp_bestpath_med2_cmd
,
2172 "bgp bestpath med confed missing-as-worst",
2173 "BGP specific commands\n"
2174 "Change the default bestpath selection\n"
2176 "Compare MED among confederation paths\n"
2177 "Treat missing MED as the least preferred one\n")
2182 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
2183 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2184 bgp_recalculate_all_bestpaths (bgp
);
2189 ALIAS (bgp_bestpath_med2
,
2190 bgp_bestpath_med3_cmd
,
2191 "bgp bestpath med missing-as-worst confed",
2192 "BGP specific commands\n"
2193 "Change the default bestpath selection\n"
2195 "Treat missing MED as the least preferred one\n"
2196 "Compare MED among confederation paths\n")
2198 DEFUN (no_bgp_bestpath_med
,
2199 no_bgp_bestpath_med_cmd
,
2200 "no bgp bestpath med (confed|missing-as-worst)",
2202 "BGP specific commands\n"
2203 "Change the default bestpath selection\n"
2205 "Compare MED among confederation paths\n"
2206 "Treat missing MED as the least preferred one\n")
2212 if (strncmp (argv
[0], "confed", 1) == 0)
2213 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
2215 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2217 bgp_recalculate_all_bestpaths (bgp
);
2222 DEFUN (no_bgp_bestpath_med2
,
2223 no_bgp_bestpath_med2_cmd
,
2224 "no bgp bestpath med confed missing-as-worst",
2226 "BGP specific commands\n"
2227 "Change the default bestpath selection\n"
2229 "Compare MED among confederation paths\n"
2230 "Treat missing MED as the least preferred one\n")
2235 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
2236 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2237 bgp_recalculate_all_bestpaths (bgp
);
2242 ALIAS (no_bgp_bestpath_med2
,
2243 no_bgp_bestpath_med3_cmd
,
2244 "no bgp bestpath med missing-as-worst confed",
2246 "BGP specific commands\n"
2247 "Change the default bestpath selection\n"
2249 "Treat missing MED as the least preferred one\n"
2250 "Compare MED among confederation paths\n")
2252 /* "no bgp default ipv4-unicast". */
2253 DEFUN (no_bgp_default_ipv4_unicast
,
2254 no_bgp_default_ipv4_unicast_cmd
,
2255 "no bgp default ipv4-unicast",
2257 "BGP specific commands\n"
2258 "Configure BGP defaults\n"
2259 "Activate ipv4-unicast for a peer by default\n")
2264 bgp_flag_set (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
2268 DEFUN (bgp_default_ipv4_unicast
,
2269 bgp_default_ipv4_unicast_cmd
,
2270 "bgp default ipv4-unicast",
2271 "BGP specific commands\n"
2272 "Configure BGP defaults\n"
2273 "Activate ipv4-unicast for a peer by default\n")
2278 bgp_flag_unset (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
2282 /* Display hostname in certain command outputs */
2283 DEFUN (bgp_default_show_hostname
,
2284 bgp_default_show_hostname_cmd
,
2285 "bgp default show-hostname",
2286 "BGP specific commands\n"
2287 "Configure BGP defaults\n"
2288 "Show hostname in certain command ouputs\n")
2293 bgp_flag_set (bgp
, BGP_FLAG_SHOW_HOSTNAME
);
2297 DEFUN (no_bgp_default_show_hostname
,
2298 no_bgp_default_show_hostname_cmd
,
2299 "no bgp default show-hostname",
2301 "BGP specific commands\n"
2302 "Configure BGP defaults\n"
2303 "Show hostname in certain command ouputs\n")
2308 bgp_flag_unset (bgp
, BGP_FLAG_SHOW_HOSTNAME
);
2312 /* "bgp network import-check" configuration. */
2313 DEFUN (bgp_network_import_check
,
2314 bgp_network_import_check_cmd
,
2315 "bgp network import-check",
2316 "BGP specific commands\n"
2317 "BGP network command\n"
2318 "Check BGP network route exists in IGP\n")
2323 if (!bgp_flag_check(bgp
, BGP_FLAG_IMPORT_CHECK
))
2325 bgp_flag_set (bgp
, BGP_FLAG_IMPORT_CHECK
);
2326 bgp_static_redo_import_check(bgp
);
2332 ALIAS_HIDDEN (bgp_network_import_check
,
2333 bgp_network_import_check_exact_cmd
,
2334 "bgp network import-check exact",
2335 "BGP specific commands\n"
2336 "BGP network command\n"
2337 "Check BGP network route exists in IGP\n"
2338 "Match route precisely\n")
2340 DEFUN (no_bgp_network_import_check
,
2341 no_bgp_network_import_check_cmd
,
2342 "no bgp network import-check",
2344 "BGP specific commands\n"
2345 "BGP network command\n"
2346 "Check BGP network route exists in IGP\n")
2351 if (bgp_flag_check(bgp
, BGP_FLAG_IMPORT_CHECK
))
2353 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK
);
2354 bgp_static_redo_import_check(bgp
);
2360 DEFUN (bgp_default_local_preference
,
2361 bgp_default_local_preference_cmd
,
2362 "bgp default local-preference <0-4294967295>",
2363 "BGP specific commands\n"
2364 "Configure BGP defaults\n"
2365 "local preference (higher=more preferred)\n"
2366 "Configure default local preference value\n")
2369 u_int32_t local_pref
;
2373 VTY_GET_INTEGER ("local preference", local_pref
, argv
[0]);
2375 bgp_default_local_preference_set (bgp
, local_pref
);
2376 bgp_clear_star_soft_in (vty
, bgp
->name
);
2381 DEFUN (no_bgp_default_local_preference
,
2382 no_bgp_default_local_preference_cmd
,
2383 "no bgp default local-preference",
2385 "BGP specific commands\n"
2386 "Configure BGP defaults\n"
2387 "local preference (higher=more preferred)\n")
2392 bgp_default_local_preference_unset (bgp
);
2393 bgp_clear_star_soft_in (vty
, bgp
->name
);
2398 ALIAS (no_bgp_default_local_preference
,
2399 no_bgp_default_local_preference_val_cmd
,
2400 "no bgp default local-preference <0-4294967295>",
2402 "BGP specific commands\n"
2403 "Configure BGP defaults\n"
2404 "local preference (higher=more preferred)\n"
2405 "Configure default local preference value\n")
2407 DEFUN (bgp_default_subgroup_pkt_queue_max
,
2408 bgp_default_subgroup_pkt_queue_max_cmd
,
2409 "bgp default subgroup-pkt-queue-max <20-100>",
2410 "BGP specific commands\n"
2411 "Configure BGP defaults\n"
2412 "subgroup-pkt-queue-max\n"
2413 "Configure subgroup packet queue max\n")
2420 VTY_GET_INTEGER ("subgroup packet queue max", max_size
, argv
[0]);
2422 bgp_default_subgroup_pkt_queue_max_set (bgp
, max_size
);
2427 DEFUN (no_bgp_default_subgroup_pkt_queue_max
,
2428 no_bgp_default_subgroup_pkt_queue_max_cmd
,
2429 "no bgp default subgroup-pkt-queue-max",
2431 "BGP specific commands\n"
2432 "Configure BGP defaults\n"
2433 "subgroup-pkt-queue-max\n")
2438 bgp_default_subgroup_pkt_queue_max_unset (bgp
);
2442 ALIAS (no_bgp_default_subgroup_pkt_queue_max
,
2443 no_bgp_default_subgroup_pkt_queue_max_val_cmd
,
2444 "no bgp default subgroup-pkt-queue-max <20-100>",
2446 "BGP specific commands\n"
2447 "Configure BGP defaults\n"
2448 "subgroup-pkt-queue-max\n"
2449 "Configure subgroup packet queue max\n")
2451 DEFUN (bgp_rr_allow_outbound_policy
,
2452 bgp_rr_allow_outbound_policy_cmd
,
2453 "bgp route-reflector allow-outbound-policy",
2454 "BGP specific commands\n"
2455 "Allow modifications made by out route-map\n"
2456 "on ibgp neighbors\n")
2462 if (!bgp_flag_check(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
))
2464 bgp_flag_set(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
);
2465 update_group_announce_rrclients(bgp
);
2466 bgp_clear_star_soft_out (vty
, bgp
->name
);
2472 DEFUN (no_bgp_rr_allow_outbound_policy
,
2473 no_bgp_rr_allow_outbound_policy_cmd
,
2474 "no bgp route-reflector allow-outbound-policy",
2476 "BGP specific commands\n"
2477 "Allow modifications made by out route-map\n"
2478 "on ibgp neighbors\n")
2484 if (bgp_flag_check(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
))
2486 bgp_flag_unset(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
);
2487 update_group_announce_rrclients(bgp
);
2488 bgp_clear_star_soft_out (vty
, bgp
->name
);
2494 DEFUN (bgp_listen_limit
,
2495 bgp_listen_limit_cmd
,
2496 "bgp listen limit " DYNAMIC_NEIGHBOR_LIMIT_RANGE
,
2497 "BGP specific commands\n"
2498 "Configure BGP defaults\n"
2499 "maximum number of BGP Dynamic Neighbors that can be created\n"
2500 "Configure Dynamic Neighbors listen limit value\n")
2507 VTY_GET_INTEGER_RANGE ("listen limit", listen_limit
, argv
[0],
2508 BGP_DYNAMIC_NEIGHBORS_LIMIT_MIN
,
2509 BGP_DYNAMIC_NEIGHBORS_LIMIT_MAX
);
2511 bgp_listen_limit_set (bgp
, listen_limit
);
2516 DEFUN (no_bgp_listen_limit
,
2517 no_bgp_listen_limit_cmd
,
2518 "no bgp listen limit",
2519 "BGP specific commands\n"
2520 "Configure BGP defaults\n"
2521 "unset maximum number of BGP Dynamic Neighbors that can be created\n"
2522 "Configure Dynamic Neighbors listen limit value to default\n")
2527 bgp_listen_limit_unset (bgp
);
2531 ALIAS (no_bgp_listen_limit
,
2532 no_bgp_listen_limit_val_cmd
,
2533 "no bgp listen limit " DYNAMIC_NEIGHBOR_LIMIT_RANGE
,
2535 "BGP specific commands\n"
2536 "Configure BGP defaults\n"
2537 "maximum number of BGP Dynamic Neighbors that can be created\n"
2538 "Configure Dynamic Neighbors listen limit value\n")
2541 * Check if this listen range is already configured. Check for exact
2542 * match or overlap based on input.
2544 static struct peer_group
*
2545 listen_range_exists (struct bgp
*bgp
, struct prefix
*range
, int exact
)
2547 struct listnode
*node
, *nnode
;
2548 struct listnode
*node1
, *nnode1
;
2549 struct peer_group
*group
;
2554 afi
= family2afi(range
->family
);
2555 for (ALL_LIST_ELEMENTS (bgp
->group
, node
, nnode
, group
))
2557 for (ALL_LIST_ELEMENTS (group
->listen_range
[afi
], node1
,
2561 match
= prefix_same (range
, lr
);
2563 match
= (prefix_match (range
, lr
) || prefix_match (lr
, range
));
2572 DEFUN (bgp_listen_range
,
2573 bgp_listen_range_cmd
,
2574 LISTEN_RANGE_CMD
"peer-group WORD" ,
2575 "BGP specific commands\n"
2576 "Configure BGP Dynamic Neighbors\n"
2577 "add a listening range for Dynamic Neighbors\n"
2578 LISTEN_RANGE_ADDR_STR
)
2581 struct prefix range
;
2582 struct peer_group
*group
, *existing_group
;
2588 //VTY_GET_IPV4_PREFIX ("listen range", range, argv[0]);
2590 /* Convert IP prefix string to struct prefix. */
2591 ret
= str2prefix (argv
[0], &range
);
2594 vty_out (vty
, "%% Malformed listen range%s", VTY_NEWLINE
);
2598 afi
= family2afi(range
.family
);
2600 if (afi
== AFI_IP6
&& IN6_IS_ADDR_LINKLOCAL (&range
.u
.prefix6
))
2602 vty_out (vty
, "%% Malformed listen range (link-local address)%s",
2607 apply_mask (&range
);
2609 /* Check if same listen range is already configured. */
2610 existing_group
= listen_range_exists (bgp
, &range
, 1);
2613 if (strcmp (existing_group
->name
, argv
[1]) == 0)
2617 vty_out (vty
, "%% Same listen range is attached to peer-group %s%s",
2618 existing_group
->name
, VTY_NEWLINE
);
2623 /* Check if an overlapping listen range exists. */
2624 if (listen_range_exists (bgp
, &range
, 0))
2626 vty_out (vty
, "%% Listen range overlaps with existing listen range%s",
2631 group
= peer_group_lookup (bgp
, argv
[1]);
2634 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
2638 ret
= peer_group_listen_range_add(group
, &range
);
2639 return bgp_vty_return (vty
, ret
);
2642 DEFUN (no_bgp_listen_range
,
2643 no_bgp_listen_range_cmd
,
2644 "no bgp listen range A.B.C.D/M peer-group WORD" ,
2645 "BGP specific commands\n"
2646 "Configure BGP defaults\n"
2647 "delete a listening range for Dynamic Neighbors\n"
2648 "Remove Dynamic Neighbors listening range\n")
2651 struct prefix range
;
2652 struct peer_group
*group
;
2658 // VTY_GET_IPV4_PREFIX ("listen range", range, argv[0]);
2660 /* Convert IP prefix string to struct prefix. */
2661 ret
= str2prefix (argv
[0], &range
);
2664 vty_out (vty
, "%% Malformed listen range%s", VTY_NEWLINE
);
2668 afi
= family2afi(range
.family
);
2670 if (afi
== AFI_IP6
&& IN6_IS_ADDR_LINKLOCAL (&range
.u
.prefix6
))
2672 vty_out (vty
, "%% Malformed listen range (link-local address)%s",
2677 apply_mask (&range
);
2680 group
= peer_group_lookup (bgp
, argv
[1]);
2683 vty_out (vty
, "%% Peer-group does not exist%s", VTY_NEWLINE
);
2687 ret
= peer_group_listen_range_del(group
, &range
);
2688 return bgp_vty_return (vty
, ret
);
2692 bgp_config_write_listen (struct vty
*vty
, struct bgp
*bgp
)
2694 struct peer_group
*group
;
2695 struct listnode
*node
, *nnode
, *rnode
, *nrnode
;
2696 struct prefix
*range
;
2698 char buf
[PREFIX2STR_BUFFER
];
2700 if (bgp
->dynamic_neighbors_limit
!= BGP_DYNAMIC_NEIGHBORS_LIMIT_DEFAULT
)
2701 vty_out (vty
, " bgp listen limit %d%s",
2702 bgp
->dynamic_neighbors_limit
, VTY_NEWLINE
);
2704 for (ALL_LIST_ELEMENTS (bgp
->group
, node
, nnode
, group
))
2706 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
2708 for (ALL_LIST_ELEMENTS (group
->listen_range
[afi
], rnode
, nrnode
, range
))
2710 prefix2str(range
, buf
, sizeof(buf
));
2711 vty_out(vty
, " bgp listen range %s peer-group %s%s",
2712 buf
, group
->name
, VTY_NEWLINE
);
2721 DEFUN (bgp_disable_connected_route_check
,
2722 bgp_disable_connected_route_check_cmd
,
2723 "bgp disable-ebgp-connected-route-check",
2724 "BGP specific commands\n"
2725 "Disable checking if nexthop is connected on ebgp sessions\n")
2730 bgp_flag_set (bgp
, BGP_FLAG_DISABLE_NH_CONNECTED_CHK
);
2731 bgp_clear_star_soft_in (vty
, bgp
->name
);
2736 DEFUN (no_bgp_disable_connected_route_check
,
2737 no_bgp_disable_connected_route_check_cmd
,
2738 "no bgp disable-ebgp-connected-route-check",
2740 "BGP specific commands\n"
2741 "Disable checking if nexthop is connected on ebgp sessions\n")
2746 bgp_flag_unset (bgp
, BGP_FLAG_DISABLE_NH_CONNECTED_CHK
);
2747 bgp_clear_star_soft_in (vty
, bgp
->name
);
2754 peer_remote_as_vty (struct vty
*vty
, const char *peer_str
,
2755 const char *as_str
, afi_t afi
, safi_t safi
)
2760 int as_type
= AS_SPECIFIED
;
2765 if (strncmp(as_str
, "internal", strlen("internal")) == 0)
2768 as_type
= AS_INTERNAL
;
2770 else if (strncmp(as_str
, "external", strlen("external")) == 0)
2773 as_type
= AS_EXTERNAL
;
2777 /* Get AS number. */
2778 VTY_GET_INTEGER_RANGE ("AS", as
, as_str
, 1, BGP_AS4_MAX
);
2781 /* If peer is peer group, call proper function. */
2782 ret
= str2sockunion (peer_str
, &su
);
2785 /* Check for peer by interface */
2786 ret
= peer_remote_as (bgp
, NULL
, peer_str
, &as
, as_type
, afi
, safi
);
2789 ret
= peer_group_remote_as (bgp
, peer_str
, &as
, as_type
);
2792 vty_out (vty
, "%% Create the peer-group or interface first%s",
2801 if (peer_address_self_check (bgp
, &su
))
2803 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
2807 ret
= peer_remote_as (bgp
, &su
, NULL
, &as
, as_type
, afi
, safi
);
2810 /* This peer belongs to peer group. */
2813 case BGP_ERR_PEER_GROUP_MEMBER
:
2814 vty_out (vty
, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as
, VTY_NEWLINE
);
2816 case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
:
2817 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
);
2820 return bgp_vty_return (vty
, ret
);
2823 DEFUN (neighbor_remote_as
,
2824 neighbor_remote_as_cmd
,
2825 NEIGHBOR_CMD2
"remote-as (" CMD_AS_RANGE
"|external|internal)",
2828 "Specify a BGP neighbor\n"
2831 return peer_remote_as_vty (vty
, argv
[0], argv
[1], AFI_IP
, SAFI_UNICAST
);
2835 peer_conf_interface_get (struct vty
*vty
, const char *conf_if
, afi_t afi
,
2836 safi_t safi
, int v6only
, const char *peer_group_name
,
2840 int as_type
= AS_UNSPECIFIED
;
2843 struct peer_group
*group
;
2848 group
= peer_group_lookup (bgp
, conf_if
);
2852 vty_out (vty
, "%% Name conflict with peer-group %s", VTY_NEWLINE
);
2858 if (strncmp(as_str
, "internal", strlen("internal")) == 0)
2860 as_type
= AS_INTERNAL
;
2862 else if (strncmp(as_str
, "external", strlen("external")) == 0)
2864 as_type
= AS_EXTERNAL
;
2868 /* Get AS number. */
2869 VTY_GET_INTEGER_RANGE ("AS", as
, as_str
, 1, BGP_AS4_MAX
);
2870 as_type
= AS_SPECIFIED
;
2874 peer
= peer_lookup_by_conf_if (bgp
, conf_if
);
2877 if (bgp_flag_check (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
)
2878 && afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
2879 peer
= peer_create (NULL
, conf_if
, bgp
, bgp
->as
, as
, as_type
, 0, 0,
2882 peer
= peer_create (NULL
, conf_if
, bgp
, bgp
->as
, as
, as_type
, afi
, safi
,
2886 SET_FLAG(peer
->flags
, PEER_FLAG_IFPEER_V6ONLY
);
2888 /* Request zebra to initiate IPv6 RAs on this interface. We do this
2889 * any unnumbered peer in order to not worry about run-time transitions
2890 * (e.g., peering is initially IPv4, but the IPv4 /30 or /31 address
2891 * gets deleted later etc.)
2895 bgp_zebra_initiate_radv (bgp
, peer
);
2897 peer_flag_set (peer
, PEER_FLAG_CAPABILITY_ENHE
);
2899 else if ((v6only
&& !CHECK_FLAG(peer
->flags
, PEER_FLAG_IFPEER_V6ONLY
)) ||
2900 (!v6only
&& CHECK_FLAG(peer
->flags
, PEER_FLAG_IFPEER_V6ONLY
)))
2903 SET_FLAG(peer
->flags
, PEER_FLAG_IFPEER_V6ONLY
);
2905 UNSET_FLAG(peer
->flags
, PEER_FLAG_IFPEER_V6ONLY
);
2907 /* v6only flag changed. Reset bgp seesion */
2908 if (BGP_IS_VALID_STATE_FOR_NOTIF(peer
->status
))
2910 peer
->last_reset
= PEER_DOWN_V6ONLY_CHANGE
;
2911 bgp_notify_send (peer
, BGP_NOTIFY_CEASE
,
2912 BGP_NOTIFY_CEASE_CONFIG_CHANGE
);
2915 bgp_session_reset(peer
);
2921 if (peer_group_name
)
2923 group
= peer_group_lookup (bgp
, peer_group_name
);
2926 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
2930 ret
= peer_group_bind (bgp
, &su
, peer
, group
, &as
);
2933 return bgp_vty_return (vty
, ret
);
2936 DEFUN (neighbor_interface_config
,
2937 neighbor_interface_config_cmd
,
2938 "neighbor WORD interface",
2940 "Interface name or neighbor tag\n"
2941 "Enable BGP on interface\n")
2944 return peer_conf_interface_get (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, 0,
2947 return peer_conf_interface_get (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, 0,
2951 ALIAS (neighbor_interface_config
,
2952 neighbor_interface_config_peergroup_cmd
,
2953 "neighbor WORD interface peer-group WORD",
2955 "Interface name or neighbor tag\n"
2956 "Enable BGP on interface\n"
2957 "Member of the peer-group\n"
2958 "peer-group name\n")
2960 DEFUN (neighbor_interface_config_v6only
,
2961 neighbor_interface_config_v6only_cmd
,
2962 "neighbor WORD interface v6only",
2964 "Interface name or neighbor tag\n"
2965 "Enable BGP on interface\n"
2966 "Enable BGP with v6 link-local only\n")
2969 return peer_conf_interface_get (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, 1,
2972 return peer_conf_interface_get (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, 1,
2976 ALIAS (neighbor_interface_config_v6only
,
2977 neighbor_interface_config_v6only_peergroup_cmd
,
2978 "neighbor WORD interface v6only peer-group WORD",
2980 "Interface name or neighbor tag\n"
2981 "Enable BGP on interface\n"
2982 "Enable BGP with v6 link-local only\n"
2983 "Member of the peer-group\n"
2984 "peer-group name\n")
2986 DEFUN (neighbor_interface_config_remote_as
,
2987 neighbor_interface_config_remote_as_cmd
,
2988 "neighbor WORD interface remote-as (" CMD_AS_RANGE
"|external|internal)",
2990 "Interface name or neighbor tag\n"
2991 "Enable BGP on interface\n"
2994 return peer_conf_interface_get (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, 0,
2998 DEFUN (neighbor_interface_v6only_config_remote_as
,
2999 neighbor_interface_v6only_config_remote_as_cmd
,
3000 "neighbor WORD interface v6only remote-as (" CMD_AS_RANGE
"|external|internal)",
3002 "Interface name or neighbor tag\n"
3003 "Enable BGP on interface\n"
3006 return peer_conf_interface_get (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, 1,
3010 DEFUN (neighbor_peer_group
,
3011 neighbor_peer_group_cmd
,
3012 "neighbor WORD peer-group",
3014 "Interface name or neighbor tag\n"
3015 "Configure peer-group\n")
3019 struct peer_group
*group
;
3022 peer
= peer_lookup_by_conf_if (bgp
, argv
[0]);
3025 vty_out (vty
, "%% Name conflict with interface: %s", VTY_NEWLINE
);
3029 group
= peer_group_get (bgp
, argv
[0]);
3045 struct peer_group
*group
;
3049 ret
= str2sockunion (argv
[0], &su
);
3052 /* look up for neighbor by interface name config. */
3053 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
3056 /* Request zebra to terminate IPv6 RAs on this interface. */
3058 bgp_zebra_terminate_radv (peer
->bgp
, peer
);
3063 group
= peer_group_lookup (vty
->index
, argv
[0]);
3065 peer_group_delete (group
);
3068 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
3074 peer
= peer_lookup (vty
->index
, &su
);
3077 if (peer_dynamic_neighbor (peer
))
3079 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
3084 other
= peer
->doppelganger
;
3086 if (other
&& other
->status
!= Deleted
)
3095 no_neighbor_remote_as_cmd
,
3096 NO_NEIGHBOR_CMD
"remote-as (" CMD_AS_RANGE
"|internal|external)",
3100 "Specify a BGP neighbor\n"
3103 DEFUN (no_neighbor_interface_config
,
3104 no_neighbor_interface_config_cmd
,
3105 "no neighbor WORD interface",
3109 "Configure BGP on interface\n")
3113 /* look up for neighbor by interface name config. */
3114 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
3117 /* Request zebra to terminate IPv6 RAs on this interface. */
3119 bgp_zebra_terminate_radv (peer
->bgp
, peer
);
3124 vty_out (vty
, "%% Create the bgp interface first%s", VTY_NEWLINE
);
3130 ALIAS (no_neighbor_interface_config
,
3131 no_neighbor_interface_config_peergroup_cmd
,
3132 "no neighbor WORD interface peer-group WORD",
3136 "Configure BGP on interface\n"
3137 "Member of the peer-group\n"
3138 "peer-group name\n")
3140 ALIAS (no_neighbor_interface_config
,
3141 no_neighbor_interface_config_v6only_cmd
,
3142 "no neighbor WORD interface v6only",
3146 "Configure BGP on interface\n"
3147 "Enable BGP with v6 link-local only\n")
3149 ALIAS (no_neighbor_interface_config
,
3150 no_neighbor_interface_config_v6only_peergroup_cmd
,
3151 "no neighbor WORD interface v6only peer-group WORD",
3155 "Configure BGP on interface\n"
3156 "Enable BGP with v6 link-local only\n"
3157 "Member of the peer-group\n"
3158 "peer-group name\n")
3160 ALIAS (no_neighbor_interface_config
,
3161 no_neighbor_interface_config_remote_as_cmd
,
3162 "no neighbor WORD interface remote-as (" CMD_AS_RANGE
"|internal|external)",
3166 "Configure BGP on interface\n"
3169 ALIAS (no_neighbor_interface_config
,
3170 no_neighbor_interface_config_v6only_remote_as_cmd
,
3171 "no neighbor WORD interface v6only remote-as (" CMD_AS_RANGE
"|internal|external)",
3175 "Configure BGP on interface\n"
3176 "Enable BGP with v6 link-local only\n"
3179 DEFUN (no_neighbor_peer_group
,
3180 no_neighbor_peer_group_cmd
,
3181 "no neighbor WORD peer-group",
3185 "Configure peer-group\n")
3187 struct peer_group
*group
;
3189 group
= peer_group_lookup (vty
->index
, argv
[0]);
3191 peer_group_delete (group
);
3194 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
3200 DEFUN (no_neighbor_interface_peer_group_remote_as
,
3201 no_neighbor_interface_peer_group_remote_as_cmd
,
3202 "no neighbor WORD remote-as (" CMD_AS_RANGE
"|internal|external)",
3205 "Interface name or neighbor tag\n"
3206 "Specify a BGP neighbor\n"
3209 struct peer_group
*group
;
3212 /* look up for neighbor by interface name config. */
3213 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
3216 peer_as_change (peer
, 0, AS_SPECIFIED
);
3220 group
= peer_group_lookup (vty
->index
, argv
[0]);
3222 peer_group_remote_as_delete (group
);
3225 vty_out (vty
, "%% Create the peer-group or interface first%s", VTY_NEWLINE
);
3231 DEFUN (neighbor_local_as
,
3232 neighbor_local_as_cmd
,
3233 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
3236 "Specify a local-as number\n"
3237 "AS number used as local AS\n")
3242 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3246 VTY_GET_INTEGER_RANGE ("Local AS", as
, argv
[1], 1, BGP_AS4_MAX
);
3247 ret
= peer_local_as_set (peer
, as
, 0, 0);
3248 return bgp_vty_return (vty
, ret
);
3251 DEFUN (neighbor_local_as_no_prepend
,
3252 neighbor_local_as_no_prepend_cmd
,
3253 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
3256 "Specify a local-as number\n"
3257 "AS number used as local AS\n"
3258 "Do not prepend local-as to updates from ebgp peers\n")
3264 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3268 VTY_GET_INTEGER_RANGE ("Local AS", as
, argv
[1], 1, BGP_AS4_MAX
);
3269 ret
= peer_local_as_set (peer
, as
, 1, 0);
3270 return bgp_vty_return (vty
, ret
);
3273 DEFUN (neighbor_local_as_no_prepend_replace_as
,
3274 neighbor_local_as_no_prepend_replace_as_cmd
,
3275 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend replace-as",
3278 "Specify a local-as number\n"
3279 "AS number used as local AS\n"
3280 "Do not prepend local-as to updates from ebgp peers\n"
3281 "Do not prepend local-as to updates from ibgp peers\n")
3287 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3291 VTY_GET_INTEGER_RANGE ("Local AS", as
, argv
[1], 1, BGP_AS4_MAX
);
3292 ret
= peer_local_as_set (peer
, as
, 1, 1);
3293 return bgp_vty_return (vty
, ret
);
3297 DEFUN (no_neighbor_local_as
,
3298 no_neighbor_local_as_cmd
,
3299 NO_NEIGHBOR_CMD2
"local-as",
3303 "Specify a local-as number\n")
3308 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3312 ret
= peer_local_as_unset (peer
);
3313 return bgp_vty_return (vty
, ret
);
3316 ALIAS (no_neighbor_local_as
,
3317 no_neighbor_local_as_val_cmd
,
3318 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
3322 "Specify a local-as number\n"
3323 "AS number used as local AS\n")
3325 ALIAS (no_neighbor_local_as
,
3326 no_neighbor_local_as_val2_cmd
,
3327 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
3331 "Specify a local-as number\n"
3332 "AS number used as local AS\n"
3333 "Do not prepend local-as to updates from ebgp peers\n")
3335 ALIAS (no_neighbor_local_as
,
3336 no_neighbor_local_as_val3_cmd
,
3337 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend replace-as",
3341 "Specify a local-as number\n"
3342 "AS number used as local AS\n"
3343 "Do not prepend local-as to updates from ebgp peers\n"
3344 "Do not prepend local-as to updates from ibgp peers\n")
3346 DEFUN (neighbor_solo
,
3348 NEIGHBOR_CMD2
"solo",
3351 "Solo peer - part of its own update group\n")
3356 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3360 ret
= update_group_adjust_soloness(peer
, 1);
3361 return bgp_vty_return (vty
, ret
);
3364 DEFUN (no_neighbor_solo
,
3365 no_neighbor_solo_cmd
,
3366 NO_NEIGHBOR_CMD2
"solo",
3370 "Solo peer - part of its own update group\n")
3375 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3379 ret
= update_group_adjust_soloness(peer
, 0);
3380 return bgp_vty_return (vty
, ret
);
3383 DEFUN (neighbor_password
,
3384 neighbor_password_cmd
,
3385 NEIGHBOR_CMD2
"password LINE",
3394 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3398 ret
= peer_password_set (peer
, argv
[1]);
3399 return bgp_vty_return (vty
, ret
);
3402 DEFUN (no_neighbor_password
,
3403 no_neighbor_password_cmd
,
3404 NO_NEIGHBOR_CMD2
"password",
3413 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3417 ret
= peer_password_unset (peer
);
3418 return bgp_vty_return (vty
, ret
);
3421 ALIAS (no_neighbor_password
,
3422 no_neighbor_password_val_cmd
,
3423 NO_NEIGHBOR_CMD2
"password LINE",
3430 DEFUN (neighbor_activate
,
3431 neighbor_activate_cmd
,
3432 NEIGHBOR_CMD2
"activate",
3435 "Enable the Address Family for this Neighbor\n")
3440 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3444 ret
= peer_activate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3451 DEFUN (no_neighbor_activate
,
3452 no_neighbor_activate_cmd
,
3453 NO_NEIGHBOR_CMD2
"activate",
3457 "Enable the Address Family for this Neighbor\n")
3463 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3467 ret
= peer_deactivate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3474 DEFUN (neighbor_set_peer_group
,
3475 neighbor_set_peer_group_cmd
,
3476 NEIGHBOR_CMD2
"peer-group WORD",
3479 "Member of the peer-group\n"
3480 "peer-group name\n")
3487 struct peer_group
*group
;
3492 ret
= str2sockunion (argv
[0], &su
);
3495 peer
= peer_lookup_by_conf_if (bgp
, argv
[0]);
3498 vty_out (vty
, "%% Malformed address or name: %s%s", argv
[0], VTY_NEWLINE
);
3504 if (peer_address_self_check (bgp
, &su
))
3506 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
3511 /* Disallow for dynamic neighbor. */
3512 peer
= peer_lookup (bgp
, &su
);
3513 if (peer
&& peer_dynamic_neighbor (peer
))
3515 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
3521 group
= peer_group_lookup (bgp
, argv
[1]);
3524 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
3528 ret
= peer_group_bind (bgp
, &su
, peer
, group
, &as
);
3530 if (ret
== BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
)
3532 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
);
3536 return bgp_vty_return (vty
, ret
);
3539 DEFUN (no_neighbor_set_peer_group
,
3540 no_neighbor_set_peer_group_cmd
,
3541 NO_NEIGHBOR_CMD2
"peer-group WORD",
3545 "Member of the peer-group\n"
3546 "peer-group name\n")
3551 struct peer_group
*group
;
3555 peer
= peer_lookup_vty (vty
, argv
[0]);
3559 group
= peer_group_lookup (bgp
, argv
[1]);
3562 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
3566 ret
= peer_group_unbind (bgp
, peer
, group
);
3568 return bgp_vty_return (vty
, ret
);
3572 peer_flag_modify_vty (struct vty
*vty
, const char *ip_str
,
3573 u_int16_t flag
, int set
)
3578 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3583 * If 'neighbor <interface>', then this is for directly connected peers,
3584 * we should not accept disable-connected-check.
3586 if (peer
->conf_if
&& (flag
== PEER_FLAG_DISABLE_CONNECTED_CHECK
)) {
3587 vty_out (vty
, "%s is directly connected peer, cannot accept disable-"
3588 "connected-check%s", ip_str
, VTY_NEWLINE
);
3593 ret
= peer_flag_set (peer
, flag
);
3595 ret
= peer_flag_unset (peer
, flag
);
3597 return bgp_vty_return (vty
, ret
);
3601 peer_flag_set_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
3603 return peer_flag_modify_vty (vty
, ip_str
, flag
, 1);
3607 peer_flag_unset_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
3609 return peer_flag_modify_vty (vty
, ip_str
, flag
, 0);
3612 /* neighbor passive. */
3613 DEFUN (neighbor_passive
,
3614 neighbor_passive_cmd
,
3615 NEIGHBOR_CMD2
"passive",
3618 "Don't send open messages to this neighbor\n")
3620 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
3623 DEFUN (no_neighbor_passive
,
3624 no_neighbor_passive_cmd
,
3625 NO_NEIGHBOR_CMD2
"passive",
3629 "Don't send open messages to this neighbor\n")
3631 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
3634 /* neighbor shutdown. */
3635 DEFUN (neighbor_shutdown
,
3636 neighbor_shutdown_cmd
,
3637 NEIGHBOR_CMD2
"shutdown",
3640 "Administratively shut down this neighbor\n")
3642 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
3645 DEFUN (no_neighbor_shutdown
,
3646 no_neighbor_shutdown_cmd
,
3647 NO_NEIGHBOR_CMD2
"shutdown",
3651 "Administratively shut down this neighbor\n")
3653 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
3656 /* neighbor capability dynamic. */
3657 DEFUN (neighbor_capability_dynamic
,
3658 neighbor_capability_dynamic_cmd
,
3659 NEIGHBOR_CMD2
"capability dynamic",
3662 "Advertise capability to the peer\n"
3663 "Advertise dynamic capability to this neighbor\n")
3665 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
3668 DEFUN (no_neighbor_capability_dynamic
,
3669 no_neighbor_capability_dynamic_cmd
,
3670 NO_NEIGHBOR_CMD2
"capability dynamic",
3674 "Advertise capability to the peer\n"
3675 "Advertise dynamic capability to this neighbor\n")
3677 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
3680 /* neighbor dont-capability-negotiate */
3681 DEFUN (neighbor_dont_capability_negotiate
,
3682 neighbor_dont_capability_negotiate_cmd
,
3683 NEIGHBOR_CMD2
"dont-capability-negotiate",
3686 "Do not perform capability negotiation\n")
3688 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
3691 DEFUN (no_neighbor_dont_capability_negotiate
,
3692 no_neighbor_dont_capability_negotiate_cmd
,
3693 NO_NEIGHBOR_CMD2
"dont-capability-negotiate",
3697 "Do not perform capability negotiation\n")
3699 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
3702 /* neighbor capability extended next hop encoding */
3703 DEFUN (neighbor_capability_enhe
,
3704 neighbor_capability_enhe_cmd
,
3705 NEIGHBOR_CMD2
"capability extended-nexthop",
3708 "Advertise capability to the peer\n"
3709 "Advertise extended next-hop capability to the peer\n")
3711 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_CAPABILITY_ENHE
);
3714 DEFUN (no_neighbor_capability_enhe
,
3715 no_neighbor_capability_enhe_cmd
,
3716 NO_NEIGHBOR_CMD2
"capability extended-nexthop",
3720 "Advertise capability to the peer\n"
3721 "Advertise extended next-hop capability to the peer\n")
3723 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_CAPABILITY_ENHE
);
3727 peer_af_flag_modify_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
3728 safi_t safi
, u_int32_t flag
, int set
)
3733 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3738 ret
= peer_af_flag_set (peer
, afi
, safi
, flag
);
3740 ret
= peer_af_flag_unset (peer
, afi
, safi
, flag
);
3742 return bgp_vty_return (vty
, ret
);
3746 peer_af_flag_set_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
3747 safi_t safi
, u_int32_t flag
)
3749 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 1);
3753 peer_af_flag_unset_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
3754 safi_t safi
, u_int32_t flag
)
3756 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 0);
3759 /* neighbor capability orf prefix-list. */
3760 DEFUN (neighbor_capability_orf_prefix
,
3761 neighbor_capability_orf_prefix_cmd
,
3762 NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
3765 "Advertise capability to the peer\n"
3766 "Advertise ORF capability to the peer\n"
3767 "Advertise prefixlist ORF capability to this neighbor\n"
3768 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
3769 "Capability to RECEIVE the ORF from this neighbor\n"
3770 "Capability to SEND the ORF to this neighbor\n")
3774 if (strncmp (argv
[1], "s", 1) == 0)
3775 flag
= PEER_FLAG_ORF_PREFIX_SM
;
3776 else if (strncmp (argv
[1], "r", 1) == 0)
3777 flag
= PEER_FLAG_ORF_PREFIX_RM
;
3778 else if (strncmp (argv
[1], "b", 1) == 0)
3779 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
3783 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3784 bgp_node_safi (vty
), flag
);
3787 DEFUN (no_neighbor_capability_orf_prefix
,
3788 no_neighbor_capability_orf_prefix_cmd
,
3789 NO_NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
3793 "Advertise capability to the peer\n"
3794 "Advertise ORF capability to the peer\n"
3795 "Advertise prefixlist ORF capability to this neighbor\n"
3796 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
3797 "Capability to RECEIVE the ORF from this neighbor\n"
3798 "Capability to SEND the ORF to this neighbor\n")
3802 if (strncmp (argv
[1], "s", 1) == 0)
3803 flag
= PEER_FLAG_ORF_PREFIX_SM
;
3804 else if (strncmp (argv
[1], "r", 1) == 0)
3805 flag
= PEER_FLAG_ORF_PREFIX_RM
;
3806 else if (strncmp (argv
[1], "b", 1) == 0)
3807 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
3811 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3812 bgp_node_safi (vty
), flag
);
3815 /* neighbor next-hop-self. */
3816 DEFUN (neighbor_nexthop_self
,
3817 neighbor_nexthop_self_cmd
,
3818 NEIGHBOR_CMD2
"next-hop-self",
3821 "Disable the next hop calculation for this neighbor\n")
3823 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3824 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
3827 /* neighbor next-hop-self. */
3828 DEFUN (neighbor_nexthop_self_force
,
3829 neighbor_nexthop_self_force_cmd
,
3830 NEIGHBOR_CMD2
"next-hop-self force",
3833 "Disable the next hop calculation for this neighbor\n"
3834 "Set the next hop to self for reflected routes\n")
3836 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3837 bgp_node_safi (vty
),
3838 PEER_FLAG_FORCE_NEXTHOP_SELF
);
3841 DEFUN (no_neighbor_nexthop_self
,
3842 no_neighbor_nexthop_self_cmd
,
3843 NO_NEIGHBOR_CMD2
"next-hop-self",
3847 "Disable the next hop calculation for this neighbor\n")
3849 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3850 bgp_node_safi (vty
),
3851 PEER_FLAG_NEXTHOP_SELF
);
3854 DEFUN (no_neighbor_nexthop_self_force
,
3855 no_neighbor_nexthop_self_force_cmd
,
3856 NO_NEIGHBOR_CMD2
"next-hop-self force",
3860 "Disable the next hop calculation for this neighbor\n"
3861 "Set the next hop to self for reflected routes\n")
3863 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3864 bgp_node_safi (vty
),
3865 PEER_FLAG_FORCE_NEXTHOP_SELF
);
3868 /* neighbor as-override */
3869 DEFUN (neighbor_as_override
,
3870 neighbor_as_override_cmd
,
3871 NEIGHBOR_CMD2
"as-override",
3874 "Override ASNs in outbound updates if aspath equals remote-as\n")
3876 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3877 bgp_node_safi (vty
),
3878 PEER_FLAG_AS_OVERRIDE
);
3881 DEFUN (no_neighbor_as_override
,
3882 no_neighbor_as_override_cmd
,
3883 NO_NEIGHBOR_CMD2
"as-override",
3887 "Override ASNs in outbound updates if aspath equals remote-as\n")
3889 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3890 bgp_node_safi (vty
),
3891 PEER_FLAG_AS_OVERRIDE
);
3894 /* neighbor remove-private-AS. */
3895 DEFUN (neighbor_remove_private_as
,
3896 neighbor_remove_private_as_cmd
,
3897 NEIGHBOR_CMD2
"remove-private-AS",
3900 "Remove private ASNs in outbound updates\n")
3902 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3903 bgp_node_safi (vty
),
3904 PEER_FLAG_REMOVE_PRIVATE_AS
);
3907 DEFUN (neighbor_remove_private_as_all
,
3908 neighbor_remove_private_as_all_cmd
,
3909 NEIGHBOR_CMD2
"remove-private-AS all",
3912 "Remove private ASNs in outbound updates\n"
3913 "Apply to all AS numbers")
3915 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3916 bgp_node_safi (vty
),
3917 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
);
3920 DEFUN (neighbor_remove_private_as_replace_as
,
3921 neighbor_remove_private_as_replace_as_cmd
,
3922 NEIGHBOR_CMD2
"remove-private-AS replace-AS",
3925 "Remove private ASNs in outbound updates\n"
3926 "Replace private ASNs with our ASN in outbound updates\n")
3928 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3929 bgp_node_safi (vty
),
3930 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
3933 DEFUN (neighbor_remove_private_as_all_replace_as
,
3934 neighbor_remove_private_as_all_replace_as_cmd
,
3935 NEIGHBOR_CMD2
"remove-private-AS all replace-AS",
3938 "Remove private ASNs in outbound updates\n"
3939 "Apply to all AS numbers"
3940 "Replace private ASNs with our ASN in outbound updates\n")
3942 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3943 bgp_node_safi (vty
),
3944 PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE
);
3947 DEFUN (no_neighbor_remove_private_as
,
3948 no_neighbor_remove_private_as_cmd
,
3949 NO_NEIGHBOR_CMD2
"remove-private-AS",
3953 "Remove private ASNs in outbound updates\n")
3955 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3956 bgp_node_safi (vty
),
3957 PEER_FLAG_REMOVE_PRIVATE_AS
);
3960 DEFUN (no_neighbor_remove_private_as_all
,
3961 no_neighbor_remove_private_as_all_cmd
,
3962 NO_NEIGHBOR_CMD2
"remove-private-AS all",
3966 "Remove private ASNs in outbound updates\n"
3967 "Apply to all AS numbers")
3969 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3970 bgp_node_safi (vty
),
3971 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
);
3974 DEFUN (no_neighbor_remove_private_as_replace_as
,
3975 no_neighbor_remove_private_as_replace_as_cmd
,
3976 NO_NEIGHBOR_CMD2
"remove-private-AS replace-AS",
3980 "Remove private ASNs in outbound updates\n"
3981 "Replace private ASNs with our ASN in outbound updates\n")
3983 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3984 bgp_node_safi (vty
),
3985 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
3988 DEFUN (no_neighbor_remove_private_as_all_replace_as
,
3989 no_neighbor_remove_private_as_all_replace_as_cmd
,
3990 NO_NEIGHBOR_CMD2
"remove-private-AS all replace-AS",
3994 "Remove private ASNs in outbound updates\n"
3995 "Apply to all AS numbers"
3996 "Replace private ASNs with our ASN in outbound updates\n")
3998 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3999 bgp_node_safi (vty
),
4000 PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE
);
4004 /* neighbor send-community. */
4005 DEFUN (neighbor_send_community
,
4006 neighbor_send_community_cmd
,
4007 NEIGHBOR_CMD2
"send-community",
4010 "Send Community attribute to this neighbor\n")
4012 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4013 bgp_node_safi (vty
),
4014 PEER_FLAG_SEND_COMMUNITY
);
4017 DEFUN (no_neighbor_send_community
,
4018 no_neighbor_send_community_cmd
,
4019 NO_NEIGHBOR_CMD2
"send-community",
4023 "Send Community attribute to this neighbor\n")
4025 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4026 bgp_node_safi (vty
),
4027 PEER_FLAG_SEND_COMMUNITY
);
4030 /* neighbor send-community extended. */
4031 DEFUN (neighbor_send_community_type
,
4032 neighbor_send_community_type_cmd
,
4033 NEIGHBOR_CMD2
"send-community (both|extended|standard)",
4036 "Send Community attribute to this neighbor\n"
4037 "Send Standard and Extended Community attributes\n"
4038 "Send Extended Community attributes\n"
4039 "Send Standard Community attributes\n")
4041 if (strncmp (argv
[1], "s", 1) == 0)
4042 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4043 bgp_node_safi (vty
),
4044 PEER_FLAG_SEND_COMMUNITY
);
4045 if (strncmp (argv
[1], "e", 1) == 0)
4046 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4047 bgp_node_safi (vty
),
4048 PEER_FLAG_SEND_EXT_COMMUNITY
);
4050 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4051 bgp_node_safi (vty
),
4052 (PEER_FLAG_SEND_COMMUNITY
|
4053 PEER_FLAG_SEND_EXT_COMMUNITY
));
4056 DEFUN (no_neighbor_send_community_type
,
4057 no_neighbor_send_community_type_cmd
,
4058 NO_NEIGHBOR_CMD2
"send-community (both|extended|standard)",
4062 "Send Community attribute to this neighbor\n"
4063 "Send Standard and Extended Community attributes\n"
4064 "Send Extended Community attributes\n"
4065 "Send Standard Community attributes\n")
4067 if (strncmp (argv
[1], "s", 1) == 0)
4068 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4069 bgp_node_safi (vty
),
4070 PEER_FLAG_SEND_COMMUNITY
);
4071 if (strncmp (argv
[1], "e", 1) == 0)
4072 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4073 bgp_node_safi (vty
),
4074 PEER_FLAG_SEND_EXT_COMMUNITY
);
4076 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4077 bgp_node_safi (vty
),
4078 (PEER_FLAG_SEND_COMMUNITY
|
4079 PEER_FLAG_SEND_EXT_COMMUNITY
));
4082 /* neighbor soft-reconfig. */
4083 DEFUN (neighbor_soft_reconfiguration
,
4084 neighbor_soft_reconfiguration_cmd
,
4085 NEIGHBOR_CMD2
"soft-reconfiguration inbound",
4088 "Per neighbor soft reconfiguration\n"
4089 "Allow inbound soft reconfiguration for this neighbor\n")
4091 return peer_af_flag_set_vty (vty
, argv
[0],
4092 bgp_node_afi (vty
), bgp_node_safi (vty
),
4093 PEER_FLAG_SOFT_RECONFIG
);
4096 DEFUN (no_neighbor_soft_reconfiguration
,
4097 no_neighbor_soft_reconfiguration_cmd
,
4098 NO_NEIGHBOR_CMD2
"soft-reconfiguration inbound",
4102 "Per neighbor soft reconfiguration\n"
4103 "Allow inbound soft reconfiguration for this neighbor\n")
4105 return peer_af_flag_unset_vty (vty
, argv
[0],
4106 bgp_node_afi (vty
), bgp_node_safi (vty
),
4107 PEER_FLAG_SOFT_RECONFIG
);
4110 DEFUN (neighbor_route_reflector_client
,
4111 neighbor_route_reflector_client_cmd
,
4112 NEIGHBOR_CMD2
"route-reflector-client",
4115 "Configure a neighbor as Route Reflector client\n")
4120 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4124 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4125 bgp_node_safi (vty
),
4126 PEER_FLAG_REFLECTOR_CLIENT
);
4129 DEFUN (no_neighbor_route_reflector_client
,
4130 no_neighbor_route_reflector_client_cmd
,
4131 NO_NEIGHBOR_CMD2
"route-reflector-client",
4135 "Configure a neighbor as Route Reflector client\n")
4137 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4138 bgp_node_safi (vty
),
4139 PEER_FLAG_REFLECTOR_CLIENT
);
4142 /* neighbor route-server-client. */
4143 DEFUN (neighbor_route_server_client
,
4144 neighbor_route_server_client_cmd
,
4145 NEIGHBOR_CMD2
"route-server-client",
4148 "Configure a neighbor as Route Server client\n")
4152 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4155 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4156 bgp_node_safi (vty
),
4157 PEER_FLAG_RSERVER_CLIENT
);
4160 DEFUN (no_neighbor_route_server_client
,
4161 no_neighbor_route_server_client_cmd
,
4162 NO_NEIGHBOR_CMD2
"route-server-client",
4166 "Configure a neighbor as Route Server client\n")
4168 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4169 bgp_node_safi (vty
),
4170 PEER_FLAG_RSERVER_CLIENT
);
4173 DEFUN (neighbor_nexthop_local_unchanged
,
4174 neighbor_nexthop_local_unchanged_cmd
,
4175 NEIGHBOR_CMD2
"nexthop-local unchanged",
4178 "Configure treatment of outgoing link-local nexthop attribute\n"
4179 "Leave link-local nexthop unchanged for this peer\n")
4181 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4182 bgp_node_safi (vty
),
4183 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
4186 DEFUN (no_neighbor_nexthop_local_unchanged
,
4187 no_neighbor_nexthop_local_unchanged_cmd
,
4188 NO_NEIGHBOR_CMD2
"nexthop-local unchanged",
4192 "Configure treatment of outgoing link-local-nexthop attribute\n"
4193 "Leave link-local nexthop unchanged for this peer\n")
4195 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4196 bgp_node_safi (vty
),
4197 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
4200 DEFUN (neighbor_attr_unchanged
,
4201 neighbor_attr_unchanged_cmd
,
4202 NEIGHBOR_CMD2
"attribute-unchanged",
4205 "BGP attribute is propagated unchanged to this neighbor\n")
4207 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4208 bgp_node_safi (vty
),
4209 (PEER_FLAG_AS_PATH_UNCHANGED
|
4210 PEER_FLAG_NEXTHOP_UNCHANGED
|
4211 PEER_FLAG_MED_UNCHANGED
));
4214 DEFUN (neighbor_attr_unchanged1
,
4215 neighbor_attr_unchanged1_cmd
,
4216 NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
4219 "BGP attribute is propagated unchanged to this neighbor\n"
4220 "As-path attribute\n"
4221 "Nexthop attribute\n"
4224 u_int16_t flags
= 0;
4226 if (strncmp (argv
[1], "as-path", 1) == 0)
4227 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4228 else if (strncmp (argv
[1], "next-hop", 1) == 0)
4229 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4230 else if (strncmp (argv
[1], "med", 1) == 0)
4231 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4233 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4234 bgp_node_safi (vty
), flags
);
4237 DEFUN (neighbor_attr_unchanged2
,
4238 neighbor_attr_unchanged2_cmd
,
4239 NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
4242 "BGP attribute is propagated unchanged to this neighbor\n"
4243 "As-path attribute\n"
4244 "Nexthop attribute\n"
4247 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
4249 if (strncmp (argv
[1], "next-hop", 1) == 0)
4250 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4251 else if (strncmp (argv
[1], "med", 1) == 0)
4252 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4254 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4255 bgp_node_safi (vty
), flags
);
4259 DEFUN (neighbor_attr_unchanged3
,
4260 neighbor_attr_unchanged3_cmd
,
4261 NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
4264 "BGP attribute is propagated unchanged to this neighbor\n"
4265 "Nexthop attribute\n"
4266 "As-path attribute\n"
4269 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
4271 if (strncmp (argv
[1], "as-path", 1) == 0)
4272 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4273 else if (strncmp (argv
[1], "med", 1) == 0)
4274 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4276 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4277 bgp_node_safi (vty
), flags
);
4280 DEFUN (neighbor_attr_unchanged4
,
4281 neighbor_attr_unchanged4_cmd
,
4282 NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
4285 "BGP attribute is propagated unchanged to this neighbor\n"
4287 "As-path attribute\n"
4288 "Nexthop attribute\n")
4290 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
4292 if (strncmp (argv
[1], "as-path", 1) == 0)
4293 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4294 else if (strncmp (argv
[1], "next-hop", 1) == 0)
4295 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4297 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4298 bgp_node_safi (vty
), flags
);
4301 ALIAS (neighbor_attr_unchanged
,
4302 neighbor_attr_unchanged5_cmd
,
4303 NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
4306 "BGP attribute is propagated unchanged to this neighbor\n"
4307 "As-path attribute\n"
4308 "Nexthop attribute\n"
4311 ALIAS (neighbor_attr_unchanged
,
4312 neighbor_attr_unchanged6_cmd
,
4313 NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
4316 "BGP attribute is propagated unchanged to this neighbor\n"
4317 "As-path attribute\n"
4319 "Nexthop attribute\n")
4321 ALIAS (neighbor_attr_unchanged
,
4322 neighbor_attr_unchanged7_cmd
,
4323 NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
4326 "BGP attribute is propagated unchanged to this neighbor\n"
4327 "Nexthop attribute\n"
4329 "As-path attribute\n")
4331 ALIAS (neighbor_attr_unchanged
,
4332 neighbor_attr_unchanged8_cmd
,
4333 NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
4336 "BGP attribute is propagated unchanged to this neighbor\n"
4337 "Nexthop attribute\n"
4338 "As-path attribute\n"
4341 ALIAS (neighbor_attr_unchanged
,
4342 neighbor_attr_unchanged9_cmd
,
4343 NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
4346 "BGP attribute is propagated unchanged to this neighbor\n"
4348 "Nexthop attribute\n"
4349 "As-path attribute\n")
4351 ALIAS (neighbor_attr_unchanged
,
4352 neighbor_attr_unchanged10_cmd
,
4353 NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
4356 "BGP attribute is propagated unchanged to this neighbor\n"
4358 "As-path attribute\n"
4359 "Nexthop attribute\n")
4361 DEFUN (no_neighbor_attr_unchanged
,
4362 no_neighbor_attr_unchanged_cmd
,
4363 NO_NEIGHBOR_CMD2
"attribute-unchanged",
4367 "BGP attribute is propagated unchanged to this neighbor\n")
4369 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4370 bgp_node_safi (vty
),
4371 (PEER_FLAG_AS_PATH_UNCHANGED
|
4372 PEER_FLAG_NEXTHOP_UNCHANGED
|
4373 PEER_FLAG_MED_UNCHANGED
));
4376 DEFUN (no_neighbor_attr_unchanged1
,
4377 no_neighbor_attr_unchanged1_cmd
,
4378 NO_NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
4382 "BGP attribute is propagated unchanged to this neighbor\n"
4383 "As-path attribute\n"
4384 "Nexthop attribute\n"
4387 u_int16_t flags
= 0;
4389 if (strncmp (argv
[1], "as-path", 1) == 0)
4390 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4391 else if (strncmp (argv
[1], "next-hop", 1) == 0)
4392 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4393 else if (strncmp (argv
[1], "med", 1) == 0)
4394 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4396 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4397 bgp_node_safi (vty
), flags
);
4400 DEFUN (no_neighbor_attr_unchanged2
,
4401 no_neighbor_attr_unchanged2_cmd
,
4402 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
4406 "BGP attribute is propagated unchanged to this neighbor\n"
4407 "As-path attribute\n"
4408 "Nexthop attribute\n"
4411 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
4413 if (strncmp (argv
[1], "next-hop", 1) == 0)
4414 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4415 else if (strncmp (argv
[1], "med", 1) == 0)
4416 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4418 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4419 bgp_node_safi (vty
), flags
);
4422 DEFUN (no_neighbor_attr_unchanged3
,
4423 no_neighbor_attr_unchanged3_cmd
,
4424 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
4428 "BGP attribute is propagated unchanged to this neighbor\n"
4429 "Nexthop attribute\n"
4430 "As-path attribute\n"
4433 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
4435 if (strncmp (argv
[1], "as-path", 1) == 0)
4436 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4437 else if (strncmp (argv
[1], "med", 1) == 0)
4438 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4440 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4441 bgp_node_safi (vty
), flags
);
4444 DEFUN (no_neighbor_attr_unchanged4
,
4445 no_neighbor_attr_unchanged4_cmd
,
4446 NO_NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
4450 "BGP attribute is propagated unchanged to this neighbor\n"
4452 "As-path attribute\n"
4453 "Nexthop attribute\n")
4455 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
4457 if (strncmp (argv
[1], "as-path", 1) == 0)
4458 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4459 else if (strncmp (argv
[1], "next-hop", 1) == 0)
4460 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4462 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4463 bgp_node_safi (vty
), flags
);
4466 ALIAS (no_neighbor_attr_unchanged
,
4467 no_neighbor_attr_unchanged5_cmd
,
4468 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
4472 "BGP attribute is propagated unchanged to this neighbor\n"
4473 "As-path attribute\n"
4474 "Nexthop attribute\n"
4477 ALIAS (no_neighbor_attr_unchanged
,
4478 no_neighbor_attr_unchanged6_cmd
,
4479 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
4483 "BGP attribute is propagated unchanged to this neighbor\n"
4484 "As-path attribute\n"
4486 "Nexthop attribute\n")
4488 ALIAS (no_neighbor_attr_unchanged
,
4489 no_neighbor_attr_unchanged7_cmd
,
4490 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
4494 "BGP attribute is propagated unchanged to this neighbor\n"
4495 "Nexthop attribute\n"
4497 "As-path attribute\n")
4499 ALIAS (no_neighbor_attr_unchanged
,
4500 no_neighbor_attr_unchanged8_cmd
,
4501 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
4505 "BGP attribute is propagated unchanged to this neighbor\n"
4506 "Nexthop attribute\n"
4507 "As-path attribute\n"
4510 ALIAS (no_neighbor_attr_unchanged
,
4511 no_neighbor_attr_unchanged9_cmd
,
4512 NO_NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
4516 "BGP attribute is propagated unchanged to this neighbor\n"
4518 "Nexthop attribute\n"
4519 "As-path attribute\n")
4521 ALIAS (no_neighbor_attr_unchanged
,
4522 no_neighbor_attr_unchanged10_cmd
,
4523 NO_NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
4527 "BGP attribute is propagated unchanged to this neighbor\n"
4529 "As-path attribute\n"
4530 "Nexthop attribute\n")
4532 /* EBGP multihop configuration. */
4534 peer_ebgp_multihop_set_vty (struct vty
*vty
, const char *ip_str
,
4535 const char *ttl_str
)
4540 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4545 return bgp_vty_return (vty
, BGP_ERR_INVALID_FOR_DIRECT_PEER
);
4550 VTY_GET_INTEGER_RANGE ("TTL", ttl
, ttl_str
, 1, MAXTTL
);
4552 return bgp_vty_return (vty
, peer_ebgp_multihop_set (peer
, ttl
));
4556 peer_ebgp_multihop_unset_vty (struct vty
*vty
, const char *ip_str
)
4560 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4564 return bgp_vty_return (vty
, peer_ebgp_multihop_unset (peer
));
4567 /* neighbor ebgp-multihop. */
4568 DEFUN (neighbor_ebgp_multihop
,
4569 neighbor_ebgp_multihop_cmd
,
4570 NEIGHBOR_CMD2
"ebgp-multihop",
4573 "Allow EBGP neighbors not on directly connected networks\n")
4575 return peer_ebgp_multihop_set_vty (vty
, argv
[0], NULL
);
4578 DEFUN (neighbor_ebgp_multihop_ttl
,
4579 neighbor_ebgp_multihop_ttl_cmd
,
4580 NEIGHBOR_CMD2
"ebgp-multihop " CMD_RANGE_STR(1, MAXTTL
),
4583 "Allow EBGP neighbors not on directly connected networks\n"
4584 "maximum hop count\n")
4586 return peer_ebgp_multihop_set_vty (vty
, argv
[0], argv
[1]);
4589 DEFUN (no_neighbor_ebgp_multihop
,
4590 no_neighbor_ebgp_multihop_cmd
,
4591 NO_NEIGHBOR_CMD2
"ebgp-multihop",
4595 "Allow EBGP neighbors not on directly connected networks\n")
4597 return peer_ebgp_multihop_unset_vty (vty
, argv
[0]);
4600 ALIAS (no_neighbor_ebgp_multihop
,
4601 no_neighbor_ebgp_multihop_ttl_cmd
,
4602 NO_NEIGHBOR_CMD2
"ebgp-multihop " CMD_RANGE_STR(1, MAXTTL
),
4606 "Allow EBGP neighbors not on directly connected networks\n"
4607 "maximum hop count\n")
4609 /* disable-connected-check */
4610 DEFUN (neighbor_disable_connected_check
,
4611 neighbor_disable_connected_check_cmd
,
4612 NEIGHBOR_CMD2
"disable-connected-check",
4615 "one-hop away EBGP peer using loopback address\n")
4617 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
4620 DEFUN (no_neighbor_disable_connected_check
,
4621 no_neighbor_disable_connected_check_cmd
,
4622 NO_NEIGHBOR_CMD2
"disable-connected-check",
4626 "one-hop away EBGP peer using loopback address\n")
4628 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
4631 /* Enforce multihop. */
4632 ALIAS (neighbor_disable_connected_check
,
4633 neighbor_enforce_multihop_cmd
,
4634 NEIGHBOR_CMD2
"enforce-multihop",
4637 "Enforce EBGP neighbors perform multihop\n")
4639 /* Enforce multihop. */
4640 ALIAS (no_neighbor_disable_connected_check
,
4641 no_neighbor_enforce_multihop_cmd
,
4642 NO_NEIGHBOR_CMD2
"enforce-multihop",
4646 "Enforce EBGP neighbors perform multihop\n")
4648 DEFUN (neighbor_description
,
4649 neighbor_description_cmd
,
4650 NEIGHBOR_CMD2
"description .LINE",
4653 "Neighbor specific description\n"
4654 "Up to 80 characters describing this neighbor\n")
4659 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4666 str
= argv_concat(argv
, argc
, 1);
4668 peer_description_set (peer
, str
);
4670 XFREE (MTYPE_TMP
, str
);
4675 DEFUN (no_neighbor_description
,
4676 no_neighbor_description_cmd
,
4677 NO_NEIGHBOR_CMD2
"description",
4681 "Neighbor specific description\n")
4685 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4689 peer_description_unset (peer
);
4694 ALIAS (no_neighbor_description
,
4695 no_neighbor_description_val_cmd
,
4696 NO_NEIGHBOR_CMD2
"description .LINE",
4700 "Neighbor specific description\n"
4701 "Up to 80 characters describing this neighbor\n")
4703 /* Neighbor update-source. */
4705 peer_update_source_vty (struct vty
*vty
, const char *peer_str
,
4706 const char *source_str
)
4711 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
4721 int ret
= str2sockunion (source_str
, &su
);
4724 peer_update_source_addr_set (peer
, &su
);
4727 if (str2prefix (source_str
, &p
))
4729 vty_out (vty
, "%% Invalid update-source, remove prefix length %s",
4734 peer_update_source_if_set (peer
, source_str
);
4738 peer_update_source_unset (peer
);
4743 #define BGP_UPDATE_SOURCE_STR "A.B.C.D|X:X::X:X|WORD"
4744 #define BGP_UPDATE_SOURCE_REQ_STR "(" BGP_UPDATE_SOURCE_STR ")"
4745 #define BGP_UPDATE_SOURCE_OPT_STR "{" BGP_UPDATE_SOURCE_STR "}"
4746 #define BGP_UPDATE_SOURCE_HELP_STR \
4749 "Interface name (requires zebra to be running)\n"
4751 DEFUN (neighbor_update_source
,
4752 neighbor_update_source_cmd
,
4753 NEIGHBOR_CMD2
"update-source " BGP_UPDATE_SOURCE_REQ_STR
,
4756 "Source of routing updates\n"
4757 BGP_UPDATE_SOURCE_HELP_STR
)
4759 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
4762 DEFUN (no_neighbor_update_source
,
4763 no_neighbor_update_source_cmd
,
4764 NO_NEIGHBOR_CMD2
"update-source " BGP_UPDATE_SOURCE_OPT_STR
,
4768 "Source of routing updates\n"
4769 BGP_UPDATE_SOURCE_HELP_STR
)
4771 return peer_update_source_vty (vty
, argv
[0], NULL
);
4775 peer_default_originate_set_vty (struct vty
*vty
, const char *peer_str
,
4776 afi_t afi
, safi_t safi
,
4777 const char *rmap
, int set
)
4782 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
4787 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
4789 ret
= peer_default_originate_unset (peer
, afi
, safi
);
4791 return bgp_vty_return (vty
, ret
);
4794 /* neighbor default-originate. */
4795 DEFUN (neighbor_default_originate
,
4796 neighbor_default_originate_cmd
,
4797 NEIGHBOR_CMD2
"default-originate",
4800 "Originate default route to this neighbor\n")
4802 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4803 bgp_node_safi (vty
), NULL
, 1);
4806 DEFUN (neighbor_default_originate_rmap
,
4807 neighbor_default_originate_rmap_cmd
,
4808 NEIGHBOR_CMD2
"default-originate route-map WORD",
4811 "Originate default route to this neighbor\n"
4812 "Route-map to specify criteria to originate default\n"
4815 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4816 bgp_node_safi (vty
), argv
[1], 1);
4819 DEFUN (no_neighbor_default_originate
,
4820 no_neighbor_default_originate_cmd
,
4821 NO_NEIGHBOR_CMD2
"default-originate",
4825 "Originate default route to this neighbor\n")
4827 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4828 bgp_node_safi (vty
), NULL
, 0);
4831 ALIAS (no_neighbor_default_originate
,
4832 no_neighbor_default_originate_rmap_cmd
,
4833 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
4837 "Originate default route to this neighbor\n"
4838 "Route-map to specify criteria to originate default\n"
4841 /* Set neighbor's BGP port. */
4843 peer_port_vty (struct vty
*vty
, const char *ip_str
, int afi
,
4844 const char *port_str
)
4850 peer
= peer_lookup_vty (vty
, ip_str
);
4856 sp
= getservbyname ("bgp", "tcp");
4857 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
4861 VTY_GET_INTEGER("port", port
, port_str
);
4864 peer_port_set (peer
, port
);
4869 /* Set specified peer's BGP port. */
4870 DEFUN (neighbor_port
,
4872 NEIGHBOR_CMD
"port <0-65535>",
4875 "Neighbor's BGP port\n"
4876 "TCP port number\n")
4878 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
4881 DEFUN (no_neighbor_port
,
4882 no_neighbor_port_cmd
,
4883 NO_NEIGHBOR_CMD
"port",
4887 "Neighbor's BGP port\n")
4889 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
4892 ALIAS (no_neighbor_port
,
4893 no_neighbor_port_val_cmd
,
4894 NO_NEIGHBOR_CMD
"port <0-65535>",
4898 "Neighbor's BGP port\n"
4899 "TCP port number\n")
4901 /* neighbor weight. */
4903 peer_weight_set_vty (struct vty
*vty
, const char *ip_str
,
4904 afi_t afi
, safi_t safi
,
4905 const char *weight_str
)
4909 unsigned long weight
;
4911 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4915 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
4917 ret
= peer_weight_set (peer
, afi
, safi
, weight
);
4918 return bgp_vty_return (vty
, ret
);
4922 peer_weight_unset_vty (struct vty
*vty
, const char *ip_str
,
4923 afi_t afi
, safi_t safi
)
4928 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4932 ret
= peer_weight_unset (peer
, afi
, safi
);
4933 return bgp_vty_return (vty
, ret
);
4936 DEFUN (neighbor_weight
,
4937 neighbor_weight_cmd
,
4938 NEIGHBOR_CMD2
"weight <0-65535>",
4941 "Set default weight for routes from this neighbor\n"
4944 return peer_weight_set_vty (vty
, argv
[0], bgp_node_afi (vty
), bgp_node_safi (vty
), argv
[1]);
4947 DEFUN (no_neighbor_weight
,
4948 no_neighbor_weight_cmd
,
4949 NO_NEIGHBOR_CMD2
"weight",
4953 "Set default weight for routes from this neighbor\n")
4955 return peer_weight_unset_vty (vty
, argv
[0], bgp_node_afi (vty
), bgp_node_safi (vty
));
4958 ALIAS (no_neighbor_weight
,
4959 no_neighbor_weight_val_cmd
,
4960 NO_NEIGHBOR_CMD2
"weight <0-65535>",
4964 "Set default weight for routes from this neighbor\n"
4967 /* Override capability negotiation. */
4968 DEFUN (neighbor_override_capability
,
4969 neighbor_override_capability_cmd
,
4970 NEIGHBOR_CMD2
"override-capability",
4973 "Override capability negotiation result\n")
4975 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
4978 DEFUN (no_neighbor_override_capability
,
4979 no_neighbor_override_capability_cmd
,
4980 NO_NEIGHBOR_CMD2
"override-capability",
4984 "Override capability negotiation result\n")
4986 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
4989 DEFUN (neighbor_strict_capability
,
4990 neighbor_strict_capability_cmd
,
4991 NEIGHBOR_CMD
"strict-capability-match",
4994 "Strict capability negotiation match\n")
4996 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
4999 DEFUN (no_neighbor_strict_capability
,
5000 no_neighbor_strict_capability_cmd
,
5001 NO_NEIGHBOR_CMD
"strict-capability-match",
5005 "Strict capability negotiation match\n")
5007 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
5011 peer_timers_set_vty (struct vty
*vty
, const char *ip_str
,
5012 const char *keep_str
, const char *hold_str
)
5016 u_int32_t keepalive
;
5019 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5023 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
5024 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
5026 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
5028 return bgp_vty_return (vty
, ret
);
5032 peer_timers_unset_vty (struct vty
*vty
, const char *ip_str
)
5037 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5041 ret
= peer_timers_unset (peer
);
5043 return bgp_vty_return (vty
, ret
);
5046 DEFUN (neighbor_timers
,
5047 neighbor_timers_cmd
,
5048 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
5051 "BGP per neighbor timers\n"
5052 "Keepalive interval\n"
5055 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
5058 DEFUN (no_neighbor_timers
,
5059 no_neighbor_timers_cmd
,
5060 NO_NEIGHBOR_CMD2
"timers",
5064 "BGP per neighbor timers\n")
5066 return peer_timers_unset_vty (vty
, argv
[0]);
5069 ALIAS (no_neighbor_timers
,
5070 no_neighbor_timers_val_cmd
,
5071 NO_NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
5075 "BGP per neighbor timers\n"
5076 "Keepalive interval\n"
5080 peer_timers_connect_set_vty (struct vty
*vty
, const char *ip_str
,
5081 const char *time_str
)
5087 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5091 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
5093 ret
= peer_timers_connect_set (peer
, connect
);
5095 return bgp_vty_return (vty
, ret
);
5099 peer_timers_connect_unset_vty (struct vty
*vty
, const char *ip_str
)
5104 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5108 ret
= peer_timers_connect_unset (peer
);
5110 return bgp_vty_return (vty
, ret
);
5113 DEFUN (neighbor_timers_connect
,
5114 neighbor_timers_connect_cmd
,
5115 NEIGHBOR_CMD2
"timers connect <1-65535>",
5118 "BGP per neighbor timers\n"
5119 "BGP connect timer\n"
5122 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
5125 DEFUN (no_neighbor_timers_connect
,
5126 no_neighbor_timers_connect_cmd
,
5127 NO_NEIGHBOR_CMD2
"timers connect",
5131 "BGP per neighbor timers\n"
5132 "BGP connect timer\n")
5134 return peer_timers_connect_unset_vty (vty
, argv
[0]);
5137 ALIAS (no_neighbor_timers_connect
,
5138 no_neighbor_timers_connect_val_cmd
,
5139 NO_NEIGHBOR_CMD2
"timers connect <1-65535>",
5143 "BGP per neighbor timers\n"
5144 "BGP connect timer\n"
5148 peer_advertise_interval_vty (struct vty
*vty
, const char *ip_str
,
5149 const char *time_str
, int set
)
5153 u_int32_t routeadv
= 0;
5155 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5160 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
5163 ret
= peer_advertise_interval_set (peer
, routeadv
);
5165 ret
= peer_advertise_interval_unset (peer
);
5167 return bgp_vty_return (vty
, ret
);
5170 DEFUN (neighbor_advertise_interval
,
5171 neighbor_advertise_interval_cmd
,
5172 NEIGHBOR_CMD2
"advertisement-interval <0-600>",
5175 "Minimum interval between sending BGP routing updates\n"
5176 "time in seconds\n")
5178 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
5181 DEFUN (no_neighbor_advertise_interval
,
5182 no_neighbor_advertise_interval_cmd
,
5183 NO_NEIGHBOR_CMD2
"advertisement-interval",
5187 "Minimum interval between sending BGP routing updates\n")
5189 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
5192 ALIAS (no_neighbor_advertise_interval
,
5193 no_neighbor_advertise_interval_val_cmd
,
5194 NO_NEIGHBOR_CMD2
"advertisement-interval <0-600>",
5198 "Minimum interval between sending BGP routing updates\n"
5199 "time in seconds\n")
5201 /* Time to wait before processing route-map updates */
5202 DEFUN (bgp_set_route_map_delay_timer
,
5203 bgp_set_route_map_delay_timer_cmd
,
5204 "bgp route-map delay-timer <0-600>",
5206 "BGP route-map delay timer\n"
5207 "Time in secs to wait before processing route-map changes\n"
5208 "0 disables the timer, no route updates happen when route-maps change\n")
5210 u_int32_t rmap_delay_timer
;
5214 VTY_GET_INTEGER_RANGE ("delay-timer", rmap_delay_timer
, argv
[0], 0, 600);
5215 bm
->rmap_update_timer
= rmap_delay_timer
;
5217 /* if the dynamic update handling is being disabled, and a timer is
5218 * running, stop the timer and act as if the timer has already fired.
5220 if (!rmap_delay_timer
&& bm
->t_rmap_update
)
5222 BGP_TIMER_OFF(bm
->t_rmap_update
);
5223 thread_execute (bm
->master
, bgp_route_map_update_timer
, NULL
, 0);
5231 DEFUN (no_bgp_set_route_map_delay_timer
,
5232 no_bgp_set_route_map_delay_timer_cmd
,
5233 "no bgp route-map delay-timer",
5235 "Default BGP route-map delay timer\n"
5236 "Reset to default time to wait for processing route-map changes\n")
5239 bm
->rmap_update_timer
= RMAP_DEFAULT_UPDATE_TIMER
;
5244 ALIAS (no_bgp_set_route_map_delay_timer
,
5245 no_bgp_set_route_map_delay_timer_val_cmd
,
5246 "no bgp route-map delay-timer <0-600>",
5248 "Default BGP route-map delay timer\n"
5249 "Reset to default time to wait for processing route-map changes\n"
5250 "0 disables the timer, no route updates happen when route-maps change\n")
5252 /* neighbor interface */
5254 peer_interface_vty (struct vty
*vty
, const char *ip_str
, const char *str
)
5258 peer
= peer_lookup_vty (vty
, ip_str
);
5259 if (! peer
|| peer
->conf_if
)
5263 peer_interface_set (peer
, str
);
5265 peer_interface_unset (peer
);
5270 DEFUN (neighbor_interface
,
5271 neighbor_interface_cmd
,
5272 NEIGHBOR_CMD
"interface WORD",
5279 return peer_interface_vty (vty
, argv
[0], argv
[1]);
5281 return peer_interface_vty (vty
, argv
[0], argv
[1]);
5284 DEFUN (no_neighbor_interface
,
5285 no_neighbor_interface_cmd
,
5286 NO_NEIGHBOR_CMD2
"interface WORD",
5293 return peer_interface_vty (vty
, argv
[0], NULL
);
5296 /* Set distribute list to the peer. */
5298 peer_distribute_set_vty (struct vty
*vty
, const char *ip_str
,
5299 afi_t afi
, safi_t safi
,
5300 const char *name_str
, const char *direct_str
)
5304 int direct
= FILTER_IN
;
5306 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5310 /* Check filter direction. */
5311 if (strncmp (direct_str
, "i", 1) == 0)
5313 else if (strncmp (direct_str
, "o", 1) == 0)
5314 direct
= FILTER_OUT
;
5316 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
5318 return bgp_vty_return (vty
, ret
);
5322 peer_distribute_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5323 safi_t safi
, const char *direct_str
)
5327 int direct
= FILTER_IN
;
5329 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5333 /* Check filter direction. */
5334 if (strncmp (direct_str
, "i", 1) == 0)
5336 else if (strncmp (direct_str
, "o", 1) == 0)
5337 direct
= FILTER_OUT
;
5339 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
5341 return bgp_vty_return (vty
, ret
);
5344 DEFUN (neighbor_distribute_list
,
5345 neighbor_distribute_list_cmd
,
5346 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
5349 "Filter updates to/from this neighbor\n"
5350 "IP access-list number\n"
5351 "IP access-list number (expanded range)\n"
5352 "IP Access-list name\n"
5353 "Filter incoming updates\n"
5354 "Filter outgoing updates\n")
5356 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5357 bgp_node_safi (vty
), argv
[1], argv
[2]);
5360 DEFUN (no_neighbor_distribute_list
,
5361 no_neighbor_distribute_list_cmd
,
5362 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
5366 "Filter updates to/from this neighbor\n"
5367 "IP access-list number\n"
5368 "IP access-list number (expanded range)\n"
5369 "IP Access-list name\n"
5370 "Filter incoming updates\n"
5371 "Filter outgoing updates\n")
5373 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5374 bgp_node_safi (vty
), argv
[2]);
5377 /* Set prefix list to the peer. */
5379 peer_prefix_list_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5380 safi_t safi
, const char *name_str
,
5381 const char *direct_str
)
5385 int direct
= FILTER_IN
;
5387 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5391 /* Check filter direction. */
5392 if (strncmp (direct_str
, "i", 1) == 0)
5394 else if (strncmp (direct_str
, "o", 1) == 0)
5395 direct
= FILTER_OUT
;
5397 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
5399 return bgp_vty_return (vty
, ret
);
5403 peer_prefix_list_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5404 safi_t safi
, const char *direct_str
)
5408 int direct
= FILTER_IN
;
5410 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5414 /* Check filter direction. */
5415 if (strncmp (direct_str
, "i", 1) == 0)
5417 else if (strncmp (direct_str
, "o", 1) == 0)
5418 direct
= FILTER_OUT
;
5420 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
5422 return bgp_vty_return (vty
, ret
);
5425 DEFUN (neighbor_prefix_list
,
5426 neighbor_prefix_list_cmd
,
5427 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
5430 "Filter updates to/from this neighbor\n"
5431 "Name of a prefix list\n"
5432 "Filter incoming updates\n"
5433 "Filter outgoing updates\n")
5435 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5436 bgp_node_safi (vty
), argv
[1], argv
[2]);
5439 DEFUN (no_neighbor_prefix_list
,
5440 no_neighbor_prefix_list_cmd
,
5441 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
5445 "Filter updates to/from this neighbor\n"
5446 "Name of a prefix list\n"
5447 "Filter incoming updates\n"
5448 "Filter outgoing updates\n")
5450 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5451 bgp_node_safi (vty
), argv
[2]);
5455 peer_aslist_set_vty (struct vty
*vty
, const char *ip_str
,
5456 afi_t afi
, safi_t safi
,
5457 const char *name_str
, const char *direct_str
)
5461 int direct
= FILTER_IN
;
5463 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5467 /* Check filter direction. */
5468 if (strncmp (direct_str
, "i", 1) == 0)
5470 else if (strncmp (direct_str
, "o", 1) == 0)
5471 direct
= FILTER_OUT
;
5473 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
5475 return bgp_vty_return (vty
, ret
);
5479 peer_aslist_unset_vty (struct vty
*vty
, const char *ip_str
,
5480 afi_t afi
, safi_t safi
,
5481 const char *direct_str
)
5485 int direct
= FILTER_IN
;
5487 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5491 /* Check filter direction. */
5492 if (strncmp (direct_str
, "i", 1) == 0)
5494 else if (strncmp (direct_str
, "o", 1) == 0)
5495 direct
= FILTER_OUT
;
5497 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
5499 return bgp_vty_return (vty
, ret
);
5502 DEFUN (neighbor_filter_list
,
5503 neighbor_filter_list_cmd
,
5504 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
5507 "Establish BGP filters\n"
5508 "AS path access-list name\n"
5509 "Filter incoming routes\n"
5510 "Filter outgoing routes\n")
5512 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5513 bgp_node_safi (vty
), argv
[1], argv
[2]);
5516 DEFUN (no_neighbor_filter_list
,
5517 no_neighbor_filter_list_cmd
,
5518 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
5522 "Establish BGP filters\n"
5523 "AS path access-list name\n"
5524 "Filter incoming routes\n"
5525 "Filter outgoing routes\n")
5527 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5528 bgp_node_safi (vty
), argv
[2]);
5531 /* Set route-map to the peer. */
5533 peer_route_map_set_vty (struct vty
*vty
, const char *ip_str
,
5534 afi_t afi
, safi_t safi
,
5535 const char *name_str
, const char *direct_str
)
5539 int direct
= RMAP_IN
;
5541 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5545 /* Check filter direction. */
5546 if (strncmp (direct_str
, "in", 2) == 0)
5548 else if (strncmp (direct_str
, "o", 1) == 0)
5551 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
5553 return bgp_vty_return (vty
, ret
);
5557 peer_route_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5558 safi_t safi
, const char *direct_str
)
5562 int direct
= RMAP_IN
;
5564 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5568 /* Check filter direction. */
5569 if (strncmp (direct_str
, "in", 2) == 0)
5571 else if (strncmp (direct_str
, "o", 1) == 0)
5574 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
5576 return bgp_vty_return (vty
, ret
);
5579 DEFUN (neighbor_route_map
,
5580 neighbor_route_map_cmd
,
5581 NEIGHBOR_CMD2
"route-map WORD (in|out)",
5584 "Apply route map to neighbor\n"
5585 "Name of route map\n"
5586 "Apply map to incoming routes\n"
5587 "Apply map to outbound routes\n")
5589 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5590 bgp_node_safi (vty
), argv
[1], argv
[2]);
5593 DEFUN (no_neighbor_route_map
,
5594 no_neighbor_route_map_cmd
,
5595 NO_NEIGHBOR_CMD2
"route-map WORD (in|out)",
5599 "Apply route map to neighbor\n"
5600 "Name of route map\n"
5601 "Apply map to incoming routes\n"
5602 "Apply map to outbound routes\n")
5604 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5605 bgp_node_safi (vty
), argv
[2]);
5608 /* Set unsuppress-map to the peer. */
5610 peer_unsuppress_map_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5611 safi_t safi
, const char *name_str
)
5616 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5620 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
5622 return bgp_vty_return (vty
, ret
);
5625 /* Unset route-map from the peer. */
5627 peer_unsuppress_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5633 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5637 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
5639 return bgp_vty_return (vty
, ret
);
5642 DEFUN (neighbor_unsuppress_map
,
5643 neighbor_unsuppress_map_cmd
,
5644 NEIGHBOR_CMD2
"unsuppress-map WORD",
5647 "Route-map to selectively unsuppress suppressed routes\n"
5648 "Name of route map\n")
5650 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5651 bgp_node_safi (vty
), argv
[1]);
5654 DEFUN (no_neighbor_unsuppress_map
,
5655 no_neighbor_unsuppress_map_cmd
,
5656 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
5660 "Route-map to selectively unsuppress suppressed routes\n"
5661 "Name of route map\n")
5663 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5664 bgp_node_safi (vty
));
5668 peer_maximum_prefix_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5669 safi_t safi
, const char *num_str
,
5670 const char *threshold_str
, int warning
,
5671 const char *restart_str
)
5679 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5683 VTY_GET_INTEGER ("maximum number", max
, num_str
);
5685 threshold
= atoi (threshold_str
);
5687 threshold
= MAXIMUM_PREFIX_THRESHOLD_DEFAULT
;
5690 restart
= atoi (restart_str
);
5694 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, threshold
, warning
, restart
);
5696 return bgp_vty_return (vty
, ret
);
5700 peer_maximum_prefix_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5706 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5710 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
5712 return bgp_vty_return (vty
, ret
);
5715 /* Maximum number of prefix configuration. prefix count is different
5716 for each peer configuration. So this configuration can be set for
5717 each peer configuration. */
5718 DEFUN (neighbor_maximum_prefix
,
5719 neighbor_maximum_prefix_cmd
,
5720 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
5723 "Maximum number of prefix accept from this peer\n"
5724 "maximum no. of prefix limit\n")
5726 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5727 bgp_node_safi (vty
), argv
[1], NULL
, 0,
5731 DEFUN (neighbor_maximum_prefix_threshold
,
5732 neighbor_maximum_prefix_threshold_cmd
,
5733 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
5736 "Maximum number of prefix accept from this peer\n"
5737 "maximum no. of prefix limit\n"
5738 "Threshold value (%) at which to generate a warning msg\n")
5740 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5741 bgp_node_safi (vty
), argv
[1], argv
[2], 0,
5745 DEFUN (neighbor_maximum_prefix_warning
,
5746 neighbor_maximum_prefix_warning_cmd
,
5747 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
5750 "Maximum number of prefix accept from this peer\n"
5751 "maximum no. of prefix limit\n"
5752 "Only give warning message when limit is exceeded\n")
5754 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5755 bgp_node_safi (vty
), argv
[1], NULL
, 1,
5759 DEFUN (neighbor_maximum_prefix_threshold_warning
,
5760 neighbor_maximum_prefix_threshold_warning_cmd
,
5761 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
5764 "Maximum number of prefix accept from this peer\n"
5765 "maximum no. of prefix limit\n"
5766 "Threshold value (%) at which to generate a warning msg\n"
5767 "Only give warning message when limit is exceeded\n")
5769 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5770 bgp_node_safi (vty
), argv
[1], argv
[2], 1, NULL
);
5773 DEFUN (neighbor_maximum_prefix_restart
,
5774 neighbor_maximum_prefix_restart_cmd
,
5775 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
5778 "Maximum number of prefix accept from this peer\n"
5779 "maximum no. of prefix limit\n"
5780 "Restart bgp connection after limit is exceeded\n"
5781 "Restart interval in minutes")
5783 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5784 bgp_node_safi (vty
), argv
[1], NULL
, 0, argv
[2]);
5787 DEFUN (neighbor_maximum_prefix_threshold_restart
,
5788 neighbor_maximum_prefix_threshold_restart_cmd
,
5789 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
5792 "Maximum number of prefix accept from this peer\n"
5793 "maximum no. of prefix limit\n"
5794 "Threshold value (%) at which to generate a warning msg\n"
5795 "Restart bgp connection after limit is exceeded\n"
5796 "Restart interval in minutes")
5798 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5799 bgp_node_safi (vty
), argv
[1], argv
[2], 0, argv
[3]);
5802 DEFUN (no_neighbor_maximum_prefix
,
5803 no_neighbor_maximum_prefix_cmd
,
5804 NO_NEIGHBOR_CMD2
"maximum-prefix",
5808 "Maximum number of prefix accept from this peer\n")
5810 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5811 bgp_node_safi (vty
));
5814 ALIAS (no_neighbor_maximum_prefix
,
5815 no_neighbor_maximum_prefix_val_cmd
,
5816 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
5820 "Maximum number of prefix accept from this peer\n"
5821 "maximum no. of prefix limit\n")
5823 ALIAS (no_neighbor_maximum_prefix
,
5824 no_neighbor_maximum_prefix_threshold_cmd
,
5825 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
5829 "Maximum number of prefix accept from this peer\n"
5830 "maximum no. of prefix limit\n"
5831 "Threshold value (%) at which to generate a warning msg\n")
5833 ALIAS (no_neighbor_maximum_prefix
,
5834 no_neighbor_maximum_prefix_warning_cmd
,
5835 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
5839 "Maximum number of prefix accept from this peer\n"
5840 "maximum no. of prefix limit\n"
5841 "Only give warning message when limit is exceeded\n")
5843 ALIAS (no_neighbor_maximum_prefix
,
5844 no_neighbor_maximum_prefix_threshold_warning_cmd
,
5845 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
5849 "Maximum number of prefix accept from this peer\n"
5850 "maximum no. of prefix limit\n"
5851 "Threshold value (%) at which to generate a warning msg\n"
5852 "Only give warning message when limit is exceeded\n")
5854 ALIAS (no_neighbor_maximum_prefix
,
5855 no_neighbor_maximum_prefix_restart_cmd
,
5856 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
5860 "Maximum number of prefix accept from this peer\n"
5861 "maximum no. of prefix limit\n"
5862 "Restart bgp connection after limit is exceeded\n"
5863 "Restart interval in minutes")
5865 ALIAS (no_neighbor_maximum_prefix
,
5866 no_neighbor_maximum_prefix_threshold_restart_cmd
,
5867 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
5871 "Maximum number of prefix accept from this peer\n"
5872 "maximum no. of prefix limit\n"
5873 "Threshold value (%) at which to generate a warning msg\n"
5874 "Restart bgp connection after limit is exceeded\n"
5875 "Restart interval in minutes")
5877 /* "neighbor allowas-in" */
5878 DEFUN (neighbor_allowas_in
,
5879 neighbor_allowas_in_cmd
,
5880 NEIGHBOR_CMD2
"allowas-in",
5883 "Accept as-path with my AS present in it\n")
5890 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5898 if (strncmp (argv
[1], "o", 1) == 0)
5901 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
5904 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
5907 return bgp_vty_return (vty
, ret
);
5910 ALIAS (neighbor_allowas_in
,
5911 neighbor_allowas_in_arg_cmd
,
5912 NEIGHBOR_CMD2
"allowas-in (<1-10>|origin)",
5915 "Accept as-path with my AS present in it\n"
5916 "Number of occurances of AS number\n"
5917 "Only accept my AS in the as-path if the route was originated in my AS\n")
5919 DEFUN (no_neighbor_allowas_in
,
5920 no_neighbor_allowas_in_cmd
,
5921 NO_NEIGHBOR_CMD2
"allowas-in",
5925 "allow local ASN appears in aspath attribute\n")
5930 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5934 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
5936 return bgp_vty_return (vty
, ret
);
5939 ALIAS (no_neighbor_allowas_in
,
5940 no_neighbor_allowas_in_val_cmd
,
5941 NO_NEIGHBOR_CMD2
"allowas-in (<1-10>|origin)",
5945 "allow local ASN appears in aspath attribute\n"
5946 "Number of occurances of AS number\n"
5947 "Only accept my AS in the as-path if the route was originated in my AS\n")
5949 DEFUN (neighbor_ttl_security
,
5950 neighbor_ttl_security_cmd
,
5951 NEIGHBOR_CMD2
"ttl-security hops <1-254>",
5954 "Specify the maximum number of hops to the BGP peer\n")
5959 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5963 VTY_GET_INTEGER_RANGE ("", gtsm_hops
, argv
[1], 1, 254);
5966 * If 'neighbor swpX', then this is for directly connected peers,
5967 * we should not accept a ttl-security hops value greater than 1.
5969 if (peer
->conf_if
&& (gtsm_hops
> 1)) {
5970 vty_out (vty
, "%s is directly connected peer, hops cannot exceed 1%s",
5971 argv
[0], VTY_NEWLINE
);
5975 return bgp_vty_return (vty
, peer_ttl_security_hops_set (peer
, gtsm_hops
));
5978 DEFUN (no_neighbor_ttl_security
,
5979 no_neighbor_ttl_security_cmd
,
5980 NO_NEIGHBOR_CMD2
"ttl-security hops <1-254>",
5984 "Specify the maximum number of hops to the BGP peer\n")
5988 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5992 return bgp_vty_return (vty
, peer_ttl_security_hops_unset (peer
));
5995 DEFUN (neighbor_addpath_tx_all_paths
,
5996 neighbor_addpath_tx_all_paths_cmd
,
5997 NEIGHBOR_CMD2
"addpath-tx-all-paths",
6000 "Use addpath to advertise all paths to a neighbor\n")
6004 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
6008 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
6009 bgp_node_safi (vty
),
6010 PEER_FLAG_ADDPATH_TX_ALL_PATHS
);
6013 DEFUN (no_neighbor_addpath_tx_all_paths
,
6014 no_neighbor_addpath_tx_all_paths_cmd
,
6015 NO_NEIGHBOR_CMD2
"addpath-tx-all-paths",
6019 "Use addpath to advertise all paths to a neighbor\n")
6021 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
6022 bgp_node_safi (vty
),
6023 PEER_FLAG_ADDPATH_TX_ALL_PATHS
);
6026 DEFUN (neighbor_addpath_tx_bestpath_per_as
,
6027 neighbor_addpath_tx_bestpath_per_as_cmd
,
6028 NEIGHBOR_CMD2
"addpath-tx-bestpath-per-AS",
6031 "Use addpath to advertise the bestpath per each neighboring AS\n")
6035 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
6039 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
6040 bgp_node_safi (vty
),
6041 PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS
);
6044 DEFUN (no_neighbor_addpath_tx_bestpath_per_as
,
6045 no_neighbor_addpath_tx_bestpath_per_as_cmd
,
6046 NO_NEIGHBOR_CMD2
"addpath-tx-bestpath-per-AS",
6050 "Use addpath to advertise the bestpath per each neighboring AS\n")
6052 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
6053 bgp_node_safi (vty
),
6054 PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS
);
6058 /* Address family configuration. */
6059 DEFUN (address_family_ipv4
,
6060 address_family_ipv4_cmd
,
6061 "address-family ipv4",
6062 "Enter Address Family command mode\n"
6065 vty
->node
= BGP_IPV4_NODE
;
6069 DEFUN (address_family_ipv4_safi
,
6070 address_family_ipv4_safi_cmd
,
6071 "address-family ipv4 (unicast|multicast|vpn|encap)",
6072 "Enter Address Family command mode\n"
6076 switch (bgp_vty_safi_from_arg(argv
[0]))
6078 case SAFI_MULTICAST
:
6079 vty
->node
= BGP_IPV4M_NODE
;
6082 vty
->node
= BGP_ENCAP_NODE
;
6085 vty
->node
= BGP_VPNV4_NODE
;
6089 vty
->node
= BGP_IPV4_NODE
;
6096 DEFUN (address_family_ipv6
,
6097 address_family_ipv6_cmd
,
6098 "address-family ipv6",
6099 "Enter Address Family command mode\n"
6102 vty
->node
= BGP_IPV6_NODE
;
6106 DEFUN (address_family_ipv6_safi
,
6107 address_family_ipv6_safi_cmd
,
6108 "address-family ipv6 (unicast|multicast|vpn|encap)",
6109 "Enter Address Family command mode\n"
6114 switch (bgp_vty_safi_from_arg(argv
[idx_safi
]))
6116 case SAFI_MULTICAST
:
6117 vty
->node
= BGP_IPV6M_NODE
;
6120 vty
->node
= BGP_ENCAPV6_NODE
;
6123 vty
->node
= BGP_VPNV6_NODE
;
6127 vty
->node
= BGP_IPV6_NODE
;
6134 DEFUN (address_family_vpnv4
,
6135 address_family_vpnv4_cmd
,
6136 "address-family vpnv4",
6137 "Enter Address Family command mode\n"
6140 vty
->node
= BGP_VPNV4_NODE
;
6144 DEFUN (address_family_vpnv6
,
6145 address_family_vpnv6_cmd
,
6146 "address-family vpnv6",
6147 "Enter Address Family command mode\n"
6150 vty
->node
= BGP_VPNV6_NODE
;
6154 DEFUN (address_family_encap
,
6155 address_family_encap_cmd
,
6156 "address-family encap",
6157 "Enter Address Family command mode\n"
6160 vty
->node
= BGP_ENCAP_NODE
;
6164 ALIAS (address_family_encap
,
6165 address_family_encapv4_cmd
,
6166 "address-family encapv4",
6167 "Enter Address Family command mode\n"
6170 DEFUN (address_family_encapv6
,
6171 address_family_encapv6_cmd
,
6172 "address-family encapv6",
6173 "Enter Address Family command mode\n"
6176 vty
->node
= BGP_ENCAPV6_NODE
;
6180 DEFUN (exit_address_family
,
6181 exit_address_family_cmd
,
6182 "exit-address-family",
6183 "Exit from Address Family configuration mode\n")
6185 if (vty
->node
== BGP_IPV4_NODE
6186 || vty
->node
== BGP_IPV4M_NODE
6187 || vty
->node
== BGP_VPNV4_NODE
6188 || vty
->node
== BGP_IPV6_NODE
6189 || vty
->node
== BGP_IPV6M_NODE
6190 || vty
->node
== BGP_VPNV6_NODE
6191 || vty
->node
== BGP_ENCAP_NODE
6192 || vty
->node
== BGP_ENCAPV6_NODE
)
6193 vty
->node
= BGP_NODE
;
6197 /* Recalculate bestpath and re-advertise a prefix */
6199 bgp_clear_prefix (struct vty
*vty
, const char *view_name
, const char *ip_str
,
6200 afi_t afi
, safi_t safi
, struct prefix_rd
*prd
)
6203 struct prefix match
;
6204 struct bgp_node
*rn
;
6205 struct bgp_node
*rm
;
6207 struct bgp_table
*table
;
6208 struct bgp_table
*rib
;
6210 /* BGP structure lookup. */
6213 bgp
= bgp_lookup_by_name (view_name
);
6216 vty_out (vty
, "%% Can't find BGP instance %s%s", view_name
, VTY_NEWLINE
);
6222 bgp
= bgp_get_default ();
6225 vty_out (vty
, "%% No BGP process is configured%s", VTY_NEWLINE
);
6230 /* Check IP address argument. */
6231 ret
= str2prefix (ip_str
, &match
);
6234 vty_out (vty
, "%% address is malformed%s", VTY_NEWLINE
);
6238 match
.family
= afi2family (afi
);
6239 rib
= bgp
->rib
[afi
][safi
];
6241 if (safi
== SAFI_MPLS_VPN
)
6243 for (rn
= bgp_table_top (rib
); rn
; rn
= bgp_route_next (rn
))
6245 if (prd
&& memcmp (rn
->p
.u
.val
, prd
->val
, 8) != 0)
6248 if ((table
= rn
->info
) != NULL
)
6250 if ((rm
= bgp_node_match (table
, &match
)) != NULL
)
6252 if (rm
->p
.prefixlen
== match
.prefixlen
)
6254 SET_FLAG (rn
->flags
, BGP_NODE_USER_CLEAR
);
6255 bgp_process (bgp
, rm
, afi
, safi
);
6257 bgp_unlock_node (rm
);
6264 if ((rn
= bgp_node_match (rib
, &match
)) != NULL
)
6266 if (rn
->p
.prefixlen
== match
.prefixlen
)
6268 SET_FLAG (rn
->flags
, BGP_NODE_USER_CLEAR
);
6269 bgp_process (bgp
, rn
, afi
, safi
);
6271 bgp_unlock_node (rn
);
6278 DEFUN (clear_ip_bgp_all
,
6279 clear_ip_bgp_all_cmd
,
6284 "Clear all peers\n")
6287 return bgp_clear_vty (vty
, argv
[1], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
6289 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
6292 ALIAS (clear_ip_bgp_all
,
6293 clear_ip_bgp_instance_all_cmd
,
6294 "clear ip bgp " BGP_INSTANCE_CMD
" *",
6298 BGP_INSTANCE_HELP_STR
6299 "Clear all peers\n")
6301 ALIAS (clear_ip_bgp_all
,
6306 "Clear all peers\n")
6308 ALIAS (clear_ip_bgp_all
,
6309 clear_bgp_instance_all_cmd
,
6310 "clear bgp " BGP_INSTANCE_CMD
" *",
6313 BGP_INSTANCE_HELP_STR
6314 "Clear all peers\n")
6316 ALIAS (clear_ip_bgp_all
,
6317 clear_bgp_ipv6_all_cmd
,
6322 "Clear all peers\n")
6324 ALIAS (clear_ip_bgp_all
,
6325 clear_bgp_instance_ipv6_all_cmd
,
6326 "clear bgp " BGP_INSTANCE_CMD
" ipv6 *",
6329 BGP_INSTANCE_HELP_STR
6331 "Clear all peers\n")
6333 DEFUN (clear_ip_bgp_peer
,
6334 clear_ip_bgp_peer_cmd
,
6335 "clear ip bgp (A.B.C.D|X:X::X:X|WORD)",
6339 "BGP neighbor IP address to clear\n"
6340 "BGP IPv6 neighbor to clear\n"
6341 "BGP neighbor on interface to clear\n")
6344 return bgp_clear_vty (vty
, argv
[1], 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[2]);
6346 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
6349 ALIAS (clear_ip_bgp_peer
,
6350 clear_ip_bgp_instance_peer_cmd
,
6351 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD)",
6355 BGP_INSTANCE_HELP_STR
6356 "BGP neighbor IP address to clear\n"
6357 "BGP IPv6 neighbor to clear\n"
6358 "BGP neighbor on interface to clear\n")
6360 ALIAS (clear_ip_bgp_peer
,
6362 "clear bgp (A.B.C.D|X:X::X:X|WORD)",
6365 "BGP neighbor address to clear\n"
6366 "BGP IPv6 neighbor to clear\n"
6367 "BGP neighbor on interface to clear\n")
6369 ALIAS (clear_ip_bgp_peer
,
6370 clear_bgp_instance_peer_cmd
,
6371 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD)",
6374 BGP_INSTANCE_HELP_STR
6375 "BGP neighbor IP address to clear\n"
6376 "BGP IPv6 neighbor to clear\n"
6377 "BGP neighbor on interface to clear\n")
6379 ALIAS (clear_ip_bgp_peer
,
6380 clear_bgp_ipv6_peer_cmd
,
6381 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD)",
6385 "BGP neighbor address to clear\n"
6386 "BGP IPv6 neighbor to clear\n"
6387 "BGP neighbor on interface to clear\n")
6389 ALIAS (clear_ip_bgp_peer
,
6390 clear_bgp_instance_ipv6_peer_cmd
,
6391 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD)",
6394 BGP_INSTANCE_HELP_STR
6396 "BGP neighbor IP address to clear\n"
6397 "BGP IPv6 neighbor to clear\n"
6398 "BGP neighbor on interface to clear\n")
6400 DEFUN (clear_ip_bgp_peer_group
,
6401 clear_ip_bgp_peer_group_cmd
,
6402 "clear ip bgp peer-group WORD",
6406 "Clear all members of peer-group\n"
6407 "BGP peer-group name\n")
6410 return bgp_clear_vty (vty
, argv
[1], 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[2]);
6412 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
6415 ALIAS (clear_ip_bgp_peer_group
,
6416 clear_ip_bgp_instance_peer_group_cmd
,
6417 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD",
6421 BGP_INSTANCE_HELP_STR
6422 "Clear all members of peer-group\n"
6423 "BGP peer-group name\n")
6425 ALIAS (clear_ip_bgp_peer_group
,
6426 clear_bgp_peer_group_cmd
,
6427 "clear bgp peer-group WORD",
6430 "Clear all members of peer-group\n"
6431 "BGP peer-group name\n")
6433 ALIAS (clear_ip_bgp_peer_group
,
6434 clear_bgp_instance_peer_group_cmd
,
6435 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD",
6438 BGP_INSTANCE_HELP_STR
6439 "Clear all members of peer-group\n"
6440 "BGP peer-group name\n")
6442 ALIAS (clear_ip_bgp_peer_group
,
6443 clear_bgp_ipv6_peer_group_cmd
,
6444 "clear bgp ipv6 peer-group WORD",
6448 "Clear all members of peer-group\n"
6449 "BGP peer-group name\n")
6451 ALIAS (clear_ip_bgp_peer_group
,
6452 clear_bgp_instance_ipv6_peer_group_cmd
,
6453 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD",
6456 BGP_INSTANCE_HELP_STR
6458 "Clear all members of peer-group\n"
6459 "BGP peer-group name\n")
6461 DEFUN (clear_ip_bgp_external
,
6462 clear_ip_bgp_external_cmd
,
6463 "clear ip bgp external",
6467 "Clear all external peers\n")
6470 return bgp_clear_vty (vty
, argv
[1], 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
6472 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
6475 ALIAS (clear_ip_bgp_external
,
6476 clear_ip_bgp_instance_external_cmd
,
6477 "clear ip bgp " BGP_INSTANCE_CMD
" external",
6481 BGP_INSTANCE_HELP_STR
6482 "Clear all external peers\n")
6484 ALIAS (clear_ip_bgp_external
,
6485 clear_bgp_external_cmd
,
6486 "clear bgp external",
6489 "Clear all external peers\n")
6491 ALIAS (clear_ip_bgp_external
,
6492 clear_bgp_instance_external_cmd
,
6493 "clear bgp " BGP_INSTANCE_CMD
" external",
6496 BGP_INSTANCE_HELP_STR
6497 "Clear all external peers\n")
6499 ALIAS (clear_ip_bgp_external
,
6500 clear_bgp_ipv6_external_cmd
,
6501 "clear bgp ipv6 external",
6505 "Clear all external peers\n")
6507 ALIAS (clear_ip_bgp_external
,
6508 clear_bgp_instance_ipv6_external_cmd
,
6509 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external",
6512 BGP_INSTANCE_HELP_STR
6514 "Clear all external peers\n")
6516 DEFUN (clear_ip_bgp_prefix
,
6517 clear_ip_bgp_prefix_cmd
,
6518 "clear ip bgp prefix A.B.C.D/M",
6522 "Clear bestpath and re-advertise\n"
6523 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
6526 return bgp_clear_prefix (vty
, argv
[1], argv
[2], AFI_IP
, SAFI_UNICAST
, NULL
);
6528 return bgp_clear_prefix (vty
, NULL
, argv
[0], AFI_IP
, SAFI_UNICAST
, NULL
);
6531 ALIAS (clear_ip_bgp_prefix
,
6532 clear_ip_bgp_instance_prefix_cmd
,
6533 "clear ip bgp " BGP_INSTANCE_CMD
" prefix A.B.C.D/M",
6537 BGP_INSTANCE_HELP_STR
6538 "Clear bestpath and re-advertise\n"
6539 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
6541 ALIAS (clear_ip_bgp_prefix
,
6542 clear_bgp_prefix_cmd
,
6543 "clear bgp prefix A.B.C.D/M",
6546 "Clear bestpath and re-advertise\n"
6547 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
6549 ALIAS (clear_ip_bgp_prefix
,
6550 clear_bgp_instance_prefix_cmd
,
6551 "clear bgp " BGP_INSTANCE_CMD
" prefix A.B.C.D/M",
6554 BGP_INSTANCE_HELP_STR
6555 "Clear bestpath and re-advertise\n"
6556 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
6558 DEFUN (clear_ip_bgp_as
,
6559 clear_ip_bgp_as_cmd
,
6560 "clear ip bgp " CMD_AS_RANGE
,
6564 "Clear peers with the AS number\n")
6567 return bgp_clear_vty (vty
, argv
[1], 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[2]);
6569 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
6572 ALIAS (clear_ip_bgp_as
,
6573 clear_ip_bgp_instance_as_cmd
,
6574 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
,
6578 BGP_INSTANCE_HELP_STR
6579 "Clear peers with the AS number\n")
6581 ALIAS (clear_ip_bgp_as
,
6583 "clear bgp " CMD_AS_RANGE
,
6586 "Clear peers with the AS number\n")
6588 ALIAS (clear_ip_bgp_as
,
6589 clear_bgp_instance_as_cmd
,
6590 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
,
6593 BGP_INSTANCE_HELP_STR
6594 "Clear peers with the AS number\n")
6596 ALIAS (clear_ip_bgp_as
,
6597 clear_bgp_ipv6_as_cmd
,
6598 "clear bgp ipv6 " CMD_AS_RANGE
,
6602 "Clear peers with the AS number\n")
6604 ALIAS (clear_ip_bgp_as
,
6605 clear_bgp_instance_ipv6_as_cmd
,
6606 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
,
6609 BGP_INSTANCE_HELP_STR
6611 "Clear peers with the AS number\n")
6613 /* Outbound soft-reconfiguration */
6614 DEFUN (clear_ip_bgp_all_soft_out
,
6615 clear_ip_bgp_all_soft_out_cmd
,
6616 "clear ip bgp * soft out",
6625 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_all
,
6626 BGP_CLEAR_SOFT_OUT
, NULL
);
6628 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6629 BGP_CLEAR_SOFT_OUT
, NULL
);
6632 ALIAS (clear_ip_bgp_all_soft_out
,
6633 clear_ip_bgp_instance_all_soft_out_cmd
,
6634 "clear ip bgp " BGP_INSTANCE_CMD
" * soft out",
6638 BGP_INSTANCE_HELP_STR
6643 ALIAS (clear_ip_bgp_all_soft_out
,
6644 clear_ip_bgp_all_out_cmd
,
6645 "clear ip bgp * out",
6652 ALIAS (clear_ip_bgp_all_soft_out
,
6653 clear_ip_bgp_instance_all_out_cmd
,
6654 "clear ip bgp " BGP_INSTANCE_CMD
" * out",
6658 BGP_INSTANCE_HELP_STR
6662 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
6663 clear_ip_bgp_all_ipv4_soft_out_cmd
,
6664 "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR
" soft out",
6675 safi
= bgp_vty_safi_from_arg(argv
[0]);
6676 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_all
,
6677 BGP_CLEAR_SOFT_OUT
, NULL
);
6680 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
6681 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
6682 "clear ip bgp " BGP_INSTANCE_CMD
" * ipv4 "BGP_SAFI_CMD_STR
" soft out",
6686 BGP_INSTANCE_HELP_STR
6693 safi
= bgp_vty_safi_from_arg(argv
[2]);
6694 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_all
,
6695 BGP_CLEAR_SOFT_OUT
, NULL
);
6698 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
6699 clear_ip_bgp_all_ipv4_out_cmd
,
6700 "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR
" out",
6709 ALIAS (clear_ip_bgp_instance_all_ipv4_soft_out
,
6710 clear_ip_bgp_instance_all_ipv4_out_cmd
,
6711 "clear ip bgp " BGP_INSTANCE_CMD
" * ipv4 "BGP_SAFI_CMD_STR
" out",
6715 BGP_INSTANCE_HELP_STR
6721 DEFUN (clear_bgp_all_soft_out
,
6722 clear_bgp_all_soft_out_cmd
,
6723 "clear bgp * soft out",
6731 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6732 BGP_CLEAR_SOFT_OUT
, NULL
);
6734 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6735 BGP_CLEAR_SOFT_OUT
, NULL
);
6738 ALIAS (clear_bgp_all_soft_out
,
6739 clear_bgp_instance_all_soft_out_cmd
,
6740 "clear bgp " BGP_INSTANCE_CMD
" * soft out",
6743 BGP_INSTANCE_HELP_STR
6748 ALIAS (clear_bgp_all_soft_out
,
6749 clear_bgp_all_out_cmd
,
6756 ALIAS (clear_bgp_all_soft_out
,
6757 clear_bgp_instance_all_out_cmd
,
6758 "clear bgp " BGP_INSTANCE_CMD
" * out",
6761 BGP_INSTANCE_HELP_STR
6765 ALIAS (clear_bgp_all_soft_out
,
6766 clear_bgp_ipv6_all_soft_out_cmd
,
6767 "clear bgp ipv6 * soft out",
6775 ALIAS (clear_bgp_all_soft_out
,
6776 clear_bgp_instance_ipv6_all_soft_out_cmd
,
6777 "clear bgp " BGP_INSTANCE_CMD
" ipv6 * soft out",
6780 BGP_INSTANCE_HELP_STR
6786 ALIAS (clear_bgp_all_soft_out
,
6787 clear_bgp_ipv6_all_out_cmd
,
6788 "clear bgp ipv6 * out",
6795 ALIAS (clear_bgp_all_soft_out
,
6796 clear_bgp_instance_ipv6_all_out_cmd
,
6797 "clear bgp " BGP_INSTANCE_CMD
" ipv6 * out",
6800 BGP_INSTANCE_HELP_STR
6805 DEFUN (clear_bgp_ipv6_safi_prefix
,
6806 clear_bgp_ipv6_safi_prefix_cmd
,
6807 "clear bgp ipv6 "BGP_SAFI_CMD_STR
" prefix X:X::X:X/M",
6811 "Address Family Modifier\n"
6812 "Clear bestpath and re-advertise\n"
6813 "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
6816 safi
= bgp_vty_safi_from_arg(argv
[0]);
6817 return bgp_clear_prefix (vty
, NULL
, argv
[1], AFI_IP6
, safi
, NULL
);
6820 DEFUN (clear_bgp_instance_ipv6_safi_prefix
,
6821 clear_bgp_instance_ipv6_safi_prefix_cmd
,
6822 "clear bgp " BGP_INSTANCE_CMD
" ipv6 "BGP_SAFI_CMD_STR
" prefix X:X::X:X/M",
6825 BGP_INSTANCE_HELP_STR
6827 "Address Family Modifier\n"
6828 "Clear bestpath and re-advertise\n"
6829 "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
6832 safi
= bgp_vty_safi_from_arg(argv
[2]);
6833 return bgp_clear_prefix (vty
, argv
[1], argv
[3], AFI_IP6
, safi
, NULL
);
6836 DEFUN (clear_ip_bgp_peer_soft_out
,
6837 clear_ip_bgp_peer_soft_out_cmd
,
6838 "clear ip bgp (A.B.C.D|WORD) soft out",
6842 "BGP neighbor address to clear\n"
6843 "BGP neighbor on interface to clear\n"
6848 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_peer
,
6849 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6851 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6852 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6855 ALIAS (clear_ip_bgp_peer_soft_out
,
6856 clear_ip_bgp_instance_peer_soft_out_cmd
,
6857 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) soft out",
6861 BGP_INSTANCE_HELP_STR
6862 "BGP neighbor address to clear\n"
6863 "BGP neighbor on interface to clear\n"
6867 ALIAS (clear_ip_bgp_peer_soft_out
,
6868 clear_ip_bgp_peer_out_cmd
,
6869 "clear ip bgp (A.B.C.D|WORD) out",
6873 "BGP neighbor address to clear\n"
6874 "BGP neighbor on interface to clear\n"
6877 ALIAS (clear_ip_bgp_peer_soft_out
,
6878 clear_ip_bgp_instance_peer_out_cmd
,
6879 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) out",
6883 BGP_INSTANCE_HELP_STR
6884 "BGP neighbor address to clear\n"
6885 "BGP neighbor on interface to clear\n"
6888 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
6889 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
6890 "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" soft out",
6894 "BGP neighbor address to clear\n"
6895 "BGP neighbor on interface to clear\n"
6902 safi
= bgp_vty_safi_from_arg(argv
[1]);
6903 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_peer
,
6904 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6907 DEFUN (clear_ip_bgp_instance_peer_ipv4_soft_out
,
6908 clear_ip_bgp_instance_peer_ipv4_soft_out_cmd
,
6909 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" soft out",
6913 BGP_INSTANCE_HELP_STR
6914 "BGP neighbor address to clear\n"
6915 "BGP neighbor on interface to clear\n"
6922 safi
= bgp_vty_safi_from_arg(argv
[3]);
6923 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_peer
,
6924 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6927 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
6928 clear_ip_bgp_peer_ipv4_out_cmd
,
6929 "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" out",
6933 "BGP neighbor address to clear\n"
6934 "BGP neighbor on interface to clear\n"
6939 ALIAS (clear_ip_bgp_instance_peer_ipv4_soft_out
,
6940 clear_ip_bgp_instance_peer_ipv4_out_cmd
,
6941 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" out",
6945 BGP_INSTANCE_HELP_STR
6946 "BGP neighbor address to clear\n"
6947 "BGP neighbor on interface to clear\n"
6952 DEFUN (clear_bgp_peer_soft_out
,
6953 clear_bgp_peer_soft_out_cmd
,
6954 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft out",
6957 "BGP neighbor address to clear\n"
6958 "BGP IPv6 neighbor to clear\n"
6959 "BGP neighbor on interface to clear\n"
6964 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6965 BGP_CLEAR_SOFT_OUT
, argv
[2]);
6967 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6968 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6971 ALIAS (clear_bgp_peer_soft_out
,
6972 clear_bgp_instance_peer_soft_out_cmd
,
6973 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD) soft out",
6976 BGP_INSTANCE_HELP_STR
6977 "BGP neighbor address to clear\n"
6978 "BGP IPv6 neighbor to clear\n"
6979 "BGP neighbor on interface to clear\n"
6983 ALIAS (clear_bgp_peer_soft_out
,
6984 clear_bgp_ipv6_peer_soft_out_cmd
,
6985 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft out",
6989 "BGP neighbor address to clear\n"
6990 "BGP IPv6 neighbor to clear\n"
6991 "BGP neighbor on interface to clear\n"
6995 ALIAS (clear_bgp_peer_soft_out
,
6996 clear_bgp_instance_ipv6_peer_soft_out_cmd
,
6997 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD) soft out",
7000 BGP_INSTANCE_HELP_STR
7002 "BGP neighbor address to clear\n"
7003 "BGP IPv6 neighbor to clear\n"
7004 "BGP neighbor on interface to clear\n"
7008 ALIAS (clear_bgp_peer_soft_out
,
7009 clear_bgp_peer_out_cmd
,
7010 "clear bgp (A.B.C.D|X:X::X:X|WORD) out",
7013 "BGP neighbor address to clear\n"
7014 "BGP IPv6 neighbor to clear\n"
7015 "BGP neighbor on interface to clear\n"
7018 ALIAS (clear_bgp_peer_soft_out
,
7019 clear_bgp_instance_peer_out_cmd
,
7020 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD) out",
7023 BGP_INSTANCE_HELP_STR
7024 "BGP neighbor address to clear\n"
7025 "BGP IPv6 neighbor to clear\n"
7026 "BGP neighbor on interface to clear\n"
7029 ALIAS (clear_bgp_peer_soft_out
,
7030 clear_bgp_ipv6_peer_out_cmd
,
7031 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) out",
7035 "BGP neighbor address to clear\n"
7036 "BGP IPv6 neighbor to clear\n"
7037 "BGP neighbor on interface to clear\n"
7040 ALIAS (clear_bgp_peer_soft_out
,
7041 clear_bgp_instance_ipv6_peer_out_cmd
,
7042 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD) out",
7045 BGP_INSTANCE_HELP_STR
7047 "BGP neighbor address to clear\n"
7048 "BGP IPv6 neighbor to clear\n"
7049 "BGP neighbor on interface to clear\n"
7052 DEFUN (clear_ip_bgp_peer_group_soft_out
,
7053 clear_ip_bgp_peer_group_soft_out_cmd
,
7054 "clear ip bgp peer-group WORD soft out",
7058 "Clear all members of peer-group\n"
7059 "BGP peer-group name\n"
7064 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_group
,
7065 BGP_CLEAR_SOFT_OUT
, argv
[2]);
7067 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
7068 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7071 ALIAS (clear_ip_bgp_peer_group_soft_out
,
7072 clear_ip_bgp_instance_peer_group_soft_out_cmd
,
7073 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD soft out",
7077 BGP_INSTANCE_HELP_STR
7078 "Clear all members of peer-group\n"
7079 "BGP peer-group name\n"
7083 ALIAS (clear_ip_bgp_peer_group_soft_out
,
7084 clear_ip_bgp_peer_group_out_cmd
,
7085 "clear ip bgp peer-group WORD out",
7089 "Clear all members of peer-group\n"
7090 "BGP peer-group name\n"
7093 ALIAS (clear_ip_bgp_peer_group_soft_out
,
7094 clear_ip_bgp_instance_peer_group_out_cmd
,
7095 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD out",
7099 BGP_INSTANCE_HELP_STR
7100 "Clear all members of peer-group\n"
7101 "BGP peer-group name\n"
7104 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
7105 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
7106 "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" soft out",
7110 "Clear all members of peer-group\n"
7111 "BGP peer-group name\n"
7118 safi
= bgp_vty_safi_from_arg(argv
[1]);
7119 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_group
,
7120 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7123 DEFUN (clear_ip_bgp_instance_peer_group_ipv4_soft_out
,
7124 clear_ip_bgp_instance_peer_group_ipv4_soft_out_cmd
,
7125 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" soft out",
7129 BGP_INSTANCE_HELP_STR
7130 "Clear all members of peer-group\n"
7131 "BGP peer-group name\n"
7138 safi
= bgp_vty_safi_from_arg(argv
[3]);
7139 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_group
,
7140 BGP_CLEAR_SOFT_OUT
, argv
[2]);
7143 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
7144 clear_ip_bgp_peer_group_ipv4_out_cmd
,
7145 "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" out",
7149 "Clear all members of peer-group\n"
7150 "BGP peer-group name\n"
7155 ALIAS (clear_ip_bgp_instance_peer_group_ipv4_soft_out
,
7156 clear_ip_bgp_instance_peer_group_ipv4_out_cmd
,
7157 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" out",
7161 BGP_INSTANCE_HELP_STR
7162 "Clear all members of peer-group\n"
7163 "BGP peer-group name\n"
7168 DEFUN (clear_bgp_peer_group_soft_out
,
7169 clear_bgp_peer_group_soft_out_cmd
,
7170 "clear bgp peer-group WORD soft out",
7173 "Clear all members of peer-group\n"
7174 "BGP peer-group name\n"
7179 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_group
,
7180 BGP_CLEAR_SOFT_OUT
, argv
[2]);
7182 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
7183 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7186 ALIAS (clear_bgp_peer_group_soft_out
,
7187 clear_bgp_instance_peer_group_soft_out_cmd
,
7188 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD soft out",
7191 BGP_INSTANCE_HELP_STR
7192 "Clear all members of peer-group\n"
7193 "BGP peer-group name\n"
7197 ALIAS (clear_bgp_peer_group_soft_out
,
7198 clear_bgp_ipv6_peer_group_soft_out_cmd
,
7199 "clear bgp ipv6 peer-group WORD soft out",
7203 "Clear all members of peer-group\n"
7204 "BGP peer-group name\n"
7208 ALIAS (clear_bgp_peer_group_soft_out
,
7209 clear_bgp_instance_ipv6_peer_group_soft_out_cmd
,
7210 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD soft out",
7213 BGP_INSTANCE_HELP_STR
7215 "Clear all members of peer-group\n"
7216 "BGP peer-group name\n"
7220 ALIAS (clear_bgp_peer_group_soft_out
,
7221 clear_bgp_peer_group_out_cmd
,
7222 "clear bgp peer-group WORD out",
7225 "Clear all members of peer-group\n"
7226 "BGP peer-group name\n"
7229 ALIAS (clear_bgp_peer_group_soft_out
,
7230 clear_bgp_instance_peer_group_out_cmd
,
7231 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD out",
7234 BGP_INSTANCE_HELP_STR
7235 "Clear all members of peer-group\n"
7236 "BGP peer-group name\n"
7239 ALIAS (clear_bgp_peer_group_soft_out
,
7240 clear_bgp_ipv6_peer_group_out_cmd
,
7241 "clear bgp ipv6 peer-group WORD out",
7245 "Clear all members of peer-group\n"
7246 "BGP peer-group name\n"
7249 ALIAS (clear_bgp_peer_group_soft_out
,
7250 clear_bgp_instance_ipv6_peer_group_out_cmd
,
7251 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD out",
7254 BGP_INSTANCE_HELP_STR
7256 "Clear all members of peer-group\n"
7257 "BGP peer-group name\n"
7260 DEFUN (clear_ip_bgp_external_soft_out
,
7261 clear_ip_bgp_external_soft_out_cmd
,
7262 "clear ip bgp external soft out",
7266 "Clear all external peers\n"
7271 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_external
,
7272 BGP_CLEAR_SOFT_OUT
, NULL
);
7274 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7275 BGP_CLEAR_SOFT_OUT
, NULL
);
7278 ALIAS (clear_ip_bgp_external_soft_out
,
7279 clear_ip_bgp_instance_external_soft_out_cmd
,
7280 "clear ip bgp " BGP_INSTANCE_CMD
" external soft out",
7284 BGP_INSTANCE_HELP_STR
7285 "Clear all external peers\n"
7289 ALIAS (clear_ip_bgp_external_soft_out
,
7290 clear_ip_bgp_external_out_cmd
,
7291 "clear ip bgp external out",
7295 "Clear all external peers\n"
7298 ALIAS (clear_ip_bgp_external_soft_out
,
7299 clear_ip_bgp_instance_external_out_cmd
,
7300 "clear ip bgp " BGP_INSTANCE_CMD
" external out",
7304 BGP_INSTANCE_HELP_STR
7305 "Clear all external peers\n"
7308 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
7309 clear_ip_bgp_external_ipv4_soft_out_cmd
,
7310 "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR
" soft out",
7314 "Clear all external peers\n"
7321 safi
= bgp_vty_safi_from_arg(argv
[0]);
7322 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_external
,
7323 BGP_CLEAR_SOFT_OUT
, NULL
);
7326 DEFUN (clear_ip_bgp_instance_external_ipv4_soft_out
,
7327 clear_ip_bgp_instance_external_ipv4_soft_out_cmd
,
7328 "clear ip bgp " BGP_INSTANCE_CMD
" external ipv4 "BGP_SAFI_CMD_STR
" soft out",
7332 BGP_INSTANCE_HELP_STR
7333 "Clear all external peers\n"
7340 safi
= bgp_vty_safi_from_arg(argv
[2]);
7341 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_external
,
7342 BGP_CLEAR_SOFT_OUT
, NULL
);
7345 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
7346 clear_ip_bgp_external_ipv4_out_cmd
,
7347 "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR
" out",
7351 "Clear all external peers\n"
7356 ALIAS (clear_ip_bgp_instance_external_ipv4_soft_out
,
7357 clear_ip_bgp_instance_external_ipv4_out_cmd
,
7358 "clear ip bgp " BGP_INSTANCE_CMD
" external ipv4 "BGP_SAFI_CMD_STR
" out",
7362 BGP_INSTANCE_HELP_STR
7363 "Clear all external peers\n"
7368 DEFUN (clear_bgp_external_soft_out
,
7369 clear_bgp_external_soft_out_cmd
,
7370 "clear bgp external soft out",
7373 "Clear all external peers\n"
7378 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_external
,
7379 BGP_CLEAR_SOFT_OUT
, NULL
);
7381 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
7382 BGP_CLEAR_SOFT_OUT
, NULL
);
7385 ALIAS (clear_bgp_external_soft_out
,
7386 clear_bgp_instance_external_soft_out_cmd
,
7387 "clear bgp " BGP_INSTANCE_CMD
" external soft out",
7390 BGP_INSTANCE_HELP_STR
7391 "Clear all external peers\n"
7395 ALIAS (clear_bgp_external_soft_out
,
7396 clear_bgp_ipv6_external_soft_out_cmd
,
7397 "clear bgp ipv6 external soft out",
7401 "Clear all external peers\n"
7405 ALIAS (clear_bgp_external_soft_out
,
7406 clear_bgp_instance_ipv6_external_soft_out_cmd
,
7407 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external soft out",
7410 BGP_INSTANCE_HELP_STR
7412 "Clear all external peers\n"
7416 ALIAS (clear_bgp_external_soft_out
,
7417 clear_bgp_external_out_cmd
,
7418 "clear bgp external out",
7421 "Clear all external peers\n"
7424 ALIAS (clear_bgp_external_soft_out
,
7425 clear_bgp_instance_external_out_cmd
,
7426 "clear bgp " BGP_INSTANCE_CMD
" external out",
7429 BGP_INSTANCE_HELP_STR
7430 "Clear all external peers\n"
7433 ALIAS (clear_bgp_external_soft_out
,
7434 clear_bgp_ipv6_external_out_cmd
,
7435 "clear bgp ipv6 external WORD out",
7439 "Clear all external peers\n"
7442 ALIAS (clear_bgp_external_soft_out
,
7443 clear_bgp_instance_ipv6_external_out_cmd
,
7444 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external WORD out",
7447 BGP_INSTANCE_HELP_STR
7449 "Clear all external peers\n"
7452 DEFUN (clear_ip_bgp_as_soft_out
,
7453 clear_ip_bgp_as_soft_out_cmd
,
7454 "clear ip bgp " CMD_AS_RANGE
" soft out",
7458 "Clear peers with the AS number\n"
7463 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_as
,
7464 BGP_CLEAR_SOFT_OUT
, argv
[2]);
7466 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7467 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7470 ALIAS (clear_ip_bgp_as_soft_out
,
7471 clear_ip_bgp_instance_as_soft_out_cmd
,
7472 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft out",
7476 BGP_INSTANCE_HELP_STR
7477 "Clear peers with the AS number\n"
7481 ALIAS (clear_ip_bgp_as_soft_out
,
7482 clear_ip_bgp_as_out_cmd
,
7483 "clear ip bgp " CMD_AS_RANGE
" out",
7487 "Clear peers with the AS number\n"
7490 ALIAS (clear_ip_bgp_as_soft_out
,
7491 clear_ip_bgp_instance_as_out_cmd
,
7492 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" out",
7496 BGP_INSTANCE_HELP_STR
7497 "Clear peers with the AS number\n"
7500 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
7501 clear_ip_bgp_as_ipv4_soft_out_cmd
,
7502 "clear ip bgp " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" soft out",
7506 "Clear peers with the AS number\n"
7513 safi
= bgp_vty_safi_from_arg(argv
[1]);
7514 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_as
,
7515 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7518 DEFUN (clear_ip_bgp_instance_as_ipv4_soft_out
,
7519 clear_ip_bgp_instance_as_ipv4_soft_out_cmd
,
7520 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" soft out",
7524 BGP_INSTANCE_HELP_STR
7525 "Clear peers with the AS number\n"
7532 safi
= bgp_vty_safi_from_arg(argv
[3]);
7533 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_as
,
7534 BGP_CLEAR_SOFT_OUT
, argv
[2]);
7537 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
7538 clear_ip_bgp_as_ipv4_out_cmd
,
7539 "clear ip bgp " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" out",
7543 "Clear peers with the AS number\n"
7548 ALIAS (clear_ip_bgp_instance_as_ipv4_soft_out
,
7549 clear_ip_bgp_instance_as_ipv4_out_cmd
,
7550 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" out",
7554 BGP_INSTANCE_HELP_STR
7555 "Clear peers with the AS number\n"
7560 DEFUN (clear_bgp_as_soft_out
,
7561 clear_bgp_as_soft_out_cmd
,
7562 "clear bgp " CMD_AS_RANGE
" soft out",
7565 "Clear peers with the AS number\n"
7570 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_as
,
7571 BGP_CLEAR_SOFT_OUT
, argv
[2]);
7573 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
7574 BGP_CLEAR_SOFT_OUT
, argv
[0]);
7577 ALIAS (clear_bgp_as_soft_out
,
7578 clear_bgp_instance_as_soft_out_cmd
,
7579 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft out",
7582 BGP_INSTANCE_HELP_STR
7583 "Clear peers with the AS number\n"
7587 ALIAS (clear_bgp_as_soft_out
,
7588 clear_bgp_ipv6_as_soft_out_cmd
,
7589 "clear bgp ipv6 " CMD_AS_RANGE
" soft out",
7593 "Clear peers with the AS number\n"
7597 ALIAS (clear_bgp_as_soft_out
,
7598 clear_bgp_instance_ipv6_as_soft_out_cmd
,
7599 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
" soft out",
7602 BGP_INSTANCE_HELP_STR
7604 "Clear peers with the AS number\n"
7608 ALIAS (clear_bgp_as_soft_out
,
7609 clear_bgp_as_out_cmd
,
7610 "clear bgp " CMD_AS_RANGE
" out",
7613 "Clear peers with the AS number\n"
7616 ALIAS (clear_bgp_as_soft_out
,
7617 clear_bgp_instance_as_out_cmd
,
7618 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" out",
7621 BGP_INSTANCE_HELP_STR
7622 "Clear peers with the AS number\n"
7625 ALIAS (clear_bgp_as_soft_out
,
7626 clear_bgp_ipv6_as_out_cmd
,
7627 "clear bgp ipv6 " CMD_AS_RANGE
" out",
7631 "Clear peers with the AS number\n"
7634 ALIAS (clear_bgp_as_soft_out
,
7635 clear_bgp_instance_ipv6_as_out_cmd
,
7636 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
" out",
7639 BGP_INSTANCE_HELP_STR
7641 "Clear peers with the AS number\n"
7644 /* Inbound soft-reconfiguration */
7645 DEFUN (clear_ip_bgp_all_soft_in
,
7646 clear_ip_bgp_all_soft_in_cmd
,
7647 "clear ip bgp * soft in",
7656 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_all
,
7657 BGP_CLEAR_SOFT_IN
, NULL
);
7659 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7660 BGP_CLEAR_SOFT_IN
, NULL
);
7663 ALIAS (clear_ip_bgp_all_soft_in
,
7664 clear_ip_bgp_instance_all_soft_in_cmd
,
7665 "clear ip bgp " BGP_INSTANCE_CMD
" * soft in",
7669 BGP_INSTANCE_HELP_STR
7674 ALIAS (clear_ip_bgp_all_soft_in
,
7675 clear_ip_bgp_all_in_cmd
,
7676 "clear ip bgp * in",
7683 ALIAS (clear_ip_bgp_all_soft_in
,
7684 clear_ip_bgp_instance_all_in_cmd
,
7685 "clear ip bgp " BGP_INSTANCE_CMD
" * in",
7689 BGP_INSTANCE_HELP_STR
7693 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
7694 clear_ip_bgp_all_in_prefix_filter_cmd
,
7695 "clear ip bgp * in prefix-filter",
7701 "Push out prefix-list ORF and do inbound soft reconfig\n")
7704 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_all
,
7705 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7707 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7708 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7711 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
7712 clear_ip_bgp_all_ipv4_soft_in_cmd
,
7713 "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR
" soft in",
7724 safi
= bgp_vty_safi_from_arg(argv
[0]);
7725 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_all
,
7726 BGP_CLEAR_SOFT_IN
, NULL
);
7729 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
7730 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
7731 "clear ip bgp " BGP_INSTANCE_CMD
" * ipv4 "BGP_SAFI_CMD_STR
" soft in",
7735 BGP_INSTANCE_HELP_STR
7743 safi
= bgp_vty_safi_from_arg(argv
[2]);
7744 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_all
,
7745 BGP_CLEAR_SOFT_IN
, NULL
);
7748 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
7749 clear_ip_bgp_all_ipv4_in_cmd
,
7750 "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR
" in",
7759 ALIAS (clear_ip_bgp_instance_all_ipv4_soft_in
,
7760 clear_ip_bgp_instance_all_ipv4_in_cmd
,
7761 "clear ip bgp " BGP_INSTANCE_CMD
" * ipv4 "BGP_SAFI_CMD_STR
" in",
7765 BGP_INSTANCE_HELP_STR
7771 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
7772 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
7773 "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR
" in prefix-filter",
7781 "Push out prefix-list ORF and do inbound soft reconfig\n")
7784 safi
= bgp_vty_safi_from_arg(argv
[0]);
7785 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_all
,
7786 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7789 DEFUN (clear_bgp_all_soft_in
,
7790 clear_bgp_all_soft_in_cmd
,
7791 "clear bgp * soft in",
7799 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_all
,
7800 BGP_CLEAR_SOFT_IN
, NULL
);
7802 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
7803 BGP_CLEAR_SOFT_IN
, NULL
);
7806 ALIAS (clear_bgp_all_soft_in
,
7807 clear_bgp_instance_all_soft_in_cmd
,
7808 "clear bgp " BGP_INSTANCE_CMD
" * soft in",
7811 BGP_INSTANCE_HELP_STR
7816 ALIAS (clear_bgp_all_soft_in
,
7817 clear_bgp_ipv6_all_soft_in_cmd
,
7818 "clear bgp ipv6 * soft in",
7826 ALIAS (clear_bgp_all_soft_in
,
7827 clear_bgp_instance_ipv6_all_soft_in_cmd
,
7828 "clear bgp " BGP_INSTANCE_CMD
" ipv6 * soft in",
7831 BGP_INSTANCE_HELP_STR
7837 ALIAS (clear_bgp_all_soft_in
,
7838 clear_bgp_all_in_cmd
,
7845 ALIAS (clear_bgp_all_soft_in
,
7846 clear_bgp_instance_all_in_cmd
,
7847 "clear bgp " BGP_INSTANCE_CMD
" * in",
7850 BGP_INSTANCE_HELP_STR
7854 ALIAS (clear_bgp_all_soft_in
,
7855 clear_bgp_ipv6_all_in_cmd
,
7856 "clear bgp ipv6 * in",
7863 ALIAS (clear_bgp_all_soft_in
,
7864 clear_bgp_instance_ipv6_all_in_cmd
,
7865 "clear bgp " BGP_INSTANCE_CMD
" ipv6 * in",
7868 BGP_INSTANCE_HELP_STR
7873 DEFUN (clear_bgp_all_in_prefix_filter
,
7874 clear_bgp_all_in_prefix_filter_cmd
,
7875 "clear bgp * in prefix-filter",
7880 "Push out prefix-list ORF and do inbound soft reconfig\n")
7882 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
7883 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7886 ALIAS (clear_bgp_all_in_prefix_filter
,
7887 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
7888 "clear bgp ipv6 * in prefix-filter",
7894 "Push out prefix-list ORF and do inbound soft reconfig\n")
7896 DEFUN (clear_ip_bgp_peer_soft_in
,
7897 clear_ip_bgp_peer_soft_in_cmd
,
7898 "clear ip bgp (A.B.C.D|WORD) soft in",
7902 "BGP neighbor address to clear\n"
7903 "BGP neighbor on interface to clear\n"
7908 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_peer
,
7909 BGP_CLEAR_SOFT_IN
, argv
[2]);
7911 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7912 BGP_CLEAR_SOFT_IN
, argv
[0]);
7915 ALIAS (clear_ip_bgp_peer_soft_in
,
7916 clear_ip_bgp_instance_peer_soft_in_cmd
,
7917 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) soft in",
7921 BGP_INSTANCE_HELP_STR
7922 "BGP neighbor address to clear\n"
7923 "BGP neighbor on interface to clear\n"
7927 ALIAS (clear_ip_bgp_peer_soft_in
,
7928 clear_ip_bgp_peer_in_cmd
,
7929 "clear ip bgp (A.B.C.D|WORD) in",
7933 "BGP neighbor address to clear\n"
7934 "BGP neighbor on interface to clear\n"
7937 ALIAS (clear_ip_bgp_peer_soft_in
,
7938 clear_ip_bgp_instance_peer_in_cmd
,
7939 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) in",
7943 BGP_INSTANCE_HELP_STR
7944 "BGP neighbor address to clear\n"
7945 "BGP neighbor on interface to clear\n"
7948 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
7949 clear_ip_bgp_peer_in_prefix_filter_cmd
,
7950 "clear ip bgp (A.B.C.D|WORD) in prefix-filter",
7954 "BGP neighbor address to clear\n"
7955 "BGP neighbor on interface to clear\n"
7957 "Push out the existing ORF prefix-list\n")
7959 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7960 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7963 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
7964 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
7965 "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" soft in",
7969 "BGP neighbor address to clear\n"
7970 "BGP neighbor on interface to clear\n"
7977 safi
= bgp_vty_safi_from_arg(argv
[1]);
7978 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_peer
,
7979 BGP_CLEAR_SOFT_IN
, argv
[0]);
7982 DEFUN (clear_ip_bgp_instance_peer_ipv4_soft_in
,
7983 clear_ip_bgp_instance_peer_ipv4_soft_in_cmd
,
7984 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" soft in",
7988 BGP_INSTANCE_HELP_STR
7989 "BGP neighbor address to clear\n"
7990 "BGP neighbor on interface to clear\n"
7997 safi
= bgp_vty_safi_from_arg(argv
[3]);
7998 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_peer
,
7999 BGP_CLEAR_SOFT_IN
, argv
[2]);
8002 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
8003 clear_ip_bgp_peer_ipv4_in_cmd
,
8004 "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" in",
8008 "BGP neighbor address to clear\n"
8009 "BGP neighbor on interface to clear\n"
8014 ALIAS (clear_ip_bgp_instance_peer_ipv4_soft_in
,
8015 clear_ip_bgp_instance_peer_ipv4_in_cmd
,
8016 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" in",
8020 BGP_INSTANCE_HELP_STR
8021 "BGP neighbor address to clear\n"
8022 "BGP neighbor on interface to clear\n"
8027 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
8028 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
8029 "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" in prefix-filter",
8033 "BGP neighbor address to clear\n"
8034 "BGP neighbor on interface to clear\n"
8038 "Push out the existing ORF prefix-list\n")
8041 safi
= bgp_vty_safi_from_arg(argv
[1]);
8042 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_peer
,
8043 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8046 DEFUN (clear_bgp_peer_soft_in
,
8047 clear_bgp_peer_soft_in_cmd
,
8048 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft in",
8051 "BGP neighbor address to clear\n"
8052 "BGP IPv6 neighbor to clear\n"
8053 "BGP neighbor on interface to clear\n"
8058 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
8059 BGP_CLEAR_SOFT_IN
, argv
[2]);
8061 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
8062 BGP_CLEAR_SOFT_IN
, argv
[0]);
8065 ALIAS (clear_bgp_peer_soft_in
,
8066 clear_bgp_instance_peer_soft_in_cmd
,
8067 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD) soft in",
8070 BGP_INSTANCE_HELP_STR
8071 "BGP neighbor address to clear\n"
8072 "BGP IPv6 neighbor to clear\n"
8073 "BGP neighbor on interface to clear\n"
8077 ALIAS (clear_bgp_peer_soft_in
,
8078 clear_bgp_ipv6_peer_soft_in_cmd
,
8079 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft in",
8083 "BGP neighbor address to clear\n"
8084 "BGP IPv6 neighbor to clear\n"
8085 "BGP neighbor on interface to clear\n"
8089 ALIAS (clear_bgp_peer_soft_in
,
8090 clear_bgp_instance_ipv6_peer_soft_in_cmd
,
8091 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD) soft in",
8094 BGP_INSTANCE_HELP_STR
8096 "BGP neighbor address to clear\n"
8097 "BGP IPv6 neighbor to clear\n"
8098 "BGP neighbor on interface to clear\n"
8102 ALIAS (clear_bgp_peer_soft_in
,
8103 clear_bgp_peer_in_cmd
,
8104 "clear bgp (A.B.C.D|X:X::X:X|WORD) in",
8107 "BGP neighbor address to clear\n"
8108 "BGP IPv6 neighbor to clear\n"
8109 "BGP neighbor on interface to clear\n"
8112 ALIAS (clear_bgp_peer_soft_in
,
8113 clear_bgp_instance_peer_in_cmd
,
8114 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD) in",
8117 BGP_INSTANCE_HELP_STR
8118 "BGP neighbor address to clear\n"
8119 "BGP IPv6 neighbor to clear\n"
8120 "BGP neighbor on interface to clear\n"
8123 ALIAS (clear_bgp_peer_soft_in
,
8124 clear_bgp_ipv6_peer_in_cmd
,
8125 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) in",
8129 "BGP neighbor address to clear\n"
8130 "BGP IPv6 neighbor to clear\n"
8131 "BGP neighbor on interface to clear\n"
8134 ALIAS (clear_bgp_peer_soft_in
,
8135 clear_bgp_instance_ipv6_peer_in_cmd
,
8136 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD) in",
8139 BGP_INSTANCE_HELP_STR
8141 "BGP neighbor address to clear\n"
8142 "BGP IPv6 neighbor to clear\n"
8143 "BGP neighbor on interface to clear\n"
8146 DEFUN (clear_bgp_peer_in_prefix_filter
,
8147 clear_bgp_peer_in_prefix_filter_cmd
,
8148 "clear bgp (A.B.C.D|X:X::X:X|WORD) in prefix-filter",
8151 "BGP neighbor address to clear\n"
8152 "BGP IPv6 neighbor to clear\n"
8153 "BGP neighbor on interface to clear\n"
8155 "Push out the existing ORF prefix-list\n")
8157 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
8158 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8161 ALIAS (clear_bgp_peer_in_prefix_filter
,
8162 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
8163 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) in prefix-filter",
8167 "BGP neighbor address to clear\n"
8168 "BGP IPv6 neighbor to clear\n"
8169 "BGP neighbor on interface to clear\n"
8171 "Push out the existing ORF prefix-list\n")
8173 DEFUN (clear_ip_bgp_peer_group_soft_in
,
8174 clear_ip_bgp_peer_group_soft_in_cmd
,
8175 "clear ip bgp peer-group WORD soft in",
8179 "Clear all members of peer-group\n"
8180 "BGP peer-group name\n"
8185 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_group
,
8186 BGP_CLEAR_SOFT_IN
, argv
[2]);
8188 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
8189 BGP_CLEAR_SOFT_IN
, argv
[0]);
8192 ALIAS (clear_ip_bgp_peer_group_soft_in
,
8193 clear_ip_bgp_instance_peer_group_soft_in_cmd
,
8194 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD soft in",
8198 BGP_INSTANCE_HELP_STR
8199 "Clear all members of peer-group\n"
8200 "BGP peer-group name\n"
8204 ALIAS (clear_ip_bgp_peer_group_soft_in
,
8205 clear_ip_bgp_peer_group_in_cmd
,
8206 "clear ip bgp peer-group WORD in",
8210 "Clear all members of peer-group\n"
8211 "BGP peer-group name\n"
8214 ALIAS (clear_ip_bgp_peer_group_soft_in
,
8215 clear_ip_bgp_instance_peer_group_in_cmd
,
8216 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD in",
8220 BGP_INSTANCE_HELP_STR
8221 "Clear all members of peer-group\n"
8222 "BGP peer-group name\n"
8225 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
8226 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
8227 "clear ip bgp peer-group WORD in prefix-filter",
8231 "Clear all members of peer-group\n"
8232 "BGP peer-group name\n"
8234 "Push out prefix-list ORF and do inbound soft reconfig\n")
8236 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
8237 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8240 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
8241 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
8242 "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" soft in",
8246 "Clear all members of peer-group\n"
8247 "BGP peer-group name\n"
8254 safi
= bgp_vty_safi_from_arg(argv
[1]);
8255 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_group
,
8256 BGP_CLEAR_SOFT_IN
, argv
[0]);
8259 DEFUN (clear_ip_bgp_instance_peer_group_ipv4_soft_in
,
8260 clear_ip_bgp_instance_peer_group_ipv4_soft_in_cmd
,
8261 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" soft in",
8265 BGP_INSTANCE_HELP_STR
8266 "Clear all members of peer-group\n"
8267 "BGP peer-group name\n"
8274 safi
= bgp_vty_safi_from_arg(argv
[3]);
8275 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_group
,
8276 BGP_CLEAR_SOFT_IN
, argv
[2]);
8279 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
8280 clear_ip_bgp_peer_group_ipv4_in_cmd
,
8281 "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" in",
8285 "Clear all members of peer-group\n"
8286 "BGP peer-group name\n"
8291 ALIAS (clear_ip_bgp_instance_peer_group_ipv4_soft_in
,
8292 clear_ip_bgp_instance_peer_group_ipv4_in_cmd
,
8293 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" in",
8297 BGP_INSTANCE_HELP_STR
8298 "Clear all members of peer-group\n"
8299 "BGP peer-group name\n"
8304 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
8305 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
8306 "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" in prefix-filter",
8310 "Clear all members of peer-group\n"
8311 "BGP peer-group name\n"
8315 "Push out prefix-list ORF and do inbound soft reconfig\n")
8318 safi
= bgp_vty_safi_from_arg(argv
[1]);
8319 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_group
,
8320 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8323 DEFUN (clear_bgp_peer_group_soft_in
,
8324 clear_bgp_peer_group_soft_in_cmd
,
8325 "clear bgp peer-group WORD soft in",
8328 "Clear all members of peer-group\n"
8329 "BGP peer-group name\n"
8334 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_group
,
8335 BGP_CLEAR_SOFT_IN
, argv
[2]);
8337 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
8338 BGP_CLEAR_SOFT_IN
, argv
[0]);
8341 ALIAS (clear_bgp_peer_group_soft_in
,
8342 clear_bgp_instance_peer_group_soft_in_cmd
,
8343 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD soft in",
8346 BGP_INSTANCE_HELP_STR
8347 "Clear all members of peer-group\n"
8348 "BGP peer-group name\n"
8352 ALIAS (clear_bgp_peer_group_soft_in
,
8353 clear_bgp_ipv6_peer_group_soft_in_cmd
,
8354 "clear bgp ipv6 peer-group WORD soft in",
8358 "Clear all members of peer-group\n"
8359 "BGP peer-group name\n"
8363 ALIAS (clear_bgp_peer_group_soft_in
,
8364 clear_bgp_instance_ipv6_peer_group_soft_in_cmd
,
8365 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD soft in",
8368 BGP_INSTANCE_HELP_STR
8370 "Clear all members of peer-group\n"
8371 "BGP peer-group name\n"
8375 ALIAS (clear_bgp_peer_group_soft_in
,
8376 clear_bgp_peer_group_in_cmd
,
8377 "clear bgp peer-group WORD in",
8380 "Clear all members of peer-group\n"
8381 "BGP peer-group name\n"
8384 ALIAS (clear_bgp_peer_group_soft_in
,
8385 clear_bgp_instance_peer_group_in_cmd
,
8386 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD in",
8389 BGP_INSTANCE_HELP_STR
8390 "Clear all members of peer-group\n"
8391 "BGP peer-group name\n"
8394 ALIAS (clear_bgp_peer_group_soft_in
,
8395 clear_bgp_ipv6_peer_group_in_cmd
,
8396 "clear bgp ipv6 peer-group WORD in",
8400 "Clear all members of peer-group\n"
8401 "BGP peer-group name\n"
8404 ALIAS (clear_bgp_peer_group_soft_in
,
8405 clear_bgp_instance_ipv6_peer_group_in_cmd
,
8406 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD in",
8409 BGP_INSTANCE_HELP_STR
8411 "Clear all members of peer-group\n"
8412 "BGP peer-group name\n"
8415 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
8416 clear_bgp_peer_group_in_prefix_filter_cmd
,
8417 "clear bgp peer-group WORD in prefix-filter",
8420 "Clear all members of peer-group\n"
8421 "BGP peer-group name\n"
8423 "Push out prefix-list ORF and do inbound soft reconfig\n")
8425 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
8426 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8429 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
8430 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
8431 "clear bgp ipv6 peer-group WORD in prefix-filter",
8435 "Clear all members of peer-group\n"
8436 "BGP peer-group name\n"
8438 "Push out prefix-list ORF and do inbound soft reconfig\n")
8440 DEFUN (clear_ip_bgp_external_soft_in
,
8441 clear_ip_bgp_external_soft_in_cmd
,
8442 "clear ip bgp external soft in",
8446 "Clear all external peers\n"
8451 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_external
,
8452 BGP_CLEAR_SOFT_IN
, NULL
);
8454 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
8455 BGP_CLEAR_SOFT_IN
, NULL
);
8458 ALIAS (clear_ip_bgp_external_soft_in
,
8459 clear_ip_bgp_instance_external_soft_in_cmd
,
8460 "clear ip bgp " BGP_INSTANCE_CMD
" external soft in",
8464 BGP_INSTANCE_HELP_STR
8465 "Clear all external peers\n"
8469 ALIAS (clear_ip_bgp_external_soft_in
,
8470 clear_ip_bgp_external_in_cmd
,
8471 "clear ip bgp external in",
8475 "Clear all external peers\n"
8478 ALIAS (clear_ip_bgp_external_soft_in
,
8479 clear_ip_bgp_instance_external_in_cmd
,
8480 "clear ip bgp " BGP_INSTANCE_CMD
" external in",
8484 BGP_INSTANCE_HELP_STR
8485 "Clear all external peers\n"
8488 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
8489 clear_ip_bgp_external_in_prefix_filter_cmd
,
8490 "clear ip bgp external in prefix-filter",
8494 "Clear all external peers\n"
8496 "Push out prefix-list ORF and do inbound soft reconfig\n")
8498 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
8499 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
8502 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
8503 clear_ip_bgp_external_ipv4_soft_in_cmd
,
8504 "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR
" soft in",
8508 "Clear all external peers\n"
8515 safi
= bgp_vty_safi_from_arg(argv
[0]);
8516 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_external
,
8517 BGP_CLEAR_SOFT_IN
, NULL
);
8520 DEFUN (clear_ip_bgp_instance_external_ipv4_soft_in
,
8521 clear_ip_bgp_instance_external_ipv4_soft_in_cmd
,
8522 "clear ip bgp " BGP_INSTANCE_CMD
" external ipv4 "BGP_SAFI_CMD_STR
" soft in",
8526 BGP_INSTANCE_HELP_STR
8527 "Clear all external peers\n"
8534 safi
= bgp_vty_safi_from_arg(argv
[2]);
8535 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_external
,
8536 BGP_CLEAR_SOFT_IN
, NULL
);
8539 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
8540 clear_ip_bgp_external_ipv4_in_cmd
,
8541 "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR
" in",
8545 "Clear all external peers\n"
8550 ALIAS (clear_ip_bgp_instance_external_ipv4_soft_in
,
8551 clear_ip_bgp_instance_external_ipv4_in_cmd
,
8552 "clear ip bgp " BGP_INSTANCE_CMD
" external ipv4 "BGP_SAFI_CMD_STR
" in",
8556 BGP_INSTANCE_HELP_STR
8557 "Clear all external peers\n"
8562 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
8563 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
8564 "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR
" in prefix-filter",
8568 "Clear all external peers\n"
8572 "Push out prefix-list ORF and do inbound soft reconfig\n")
8575 safi
= bgp_vty_safi_from_arg(argv
[0]);
8576 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_external
,
8577 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
8580 DEFUN (clear_bgp_external_soft_in
,
8581 clear_bgp_external_soft_in_cmd
,
8582 "clear bgp external soft in",
8585 "Clear all external peers\n"
8590 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_external
,
8591 BGP_CLEAR_SOFT_IN
, NULL
);
8593 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
8594 BGP_CLEAR_SOFT_IN
, NULL
);
8597 ALIAS (clear_bgp_external_soft_in
,
8598 clear_bgp_instance_external_soft_in_cmd
,
8599 "clear bgp " BGP_INSTANCE_CMD
" external soft in",
8602 BGP_INSTANCE_HELP_STR
8603 "Clear all external peers\n"
8607 ALIAS (clear_bgp_external_soft_in
,
8608 clear_bgp_ipv6_external_soft_in_cmd
,
8609 "clear bgp ipv6 external soft in",
8613 "Clear all external peers\n"
8617 ALIAS (clear_bgp_external_soft_in
,
8618 clear_bgp_instance_ipv6_external_soft_in_cmd
,
8619 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external soft in",
8622 BGP_INSTANCE_HELP_STR
8624 "Clear all external peers\n"
8628 ALIAS (clear_bgp_external_soft_in
,
8629 clear_bgp_external_in_cmd
,
8630 "clear bgp external in",
8633 "Clear all external peers\n"
8636 ALIAS (clear_bgp_external_soft_in
,
8637 clear_bgp_instance_external_in_cmd
,
8638 "clear bgp " BGP_INSTANCE_CMD
" external in",
8641 BGP_INSTANCE_HELP_STR
8642 "Clear all external peers\n"
8645 ALIAS (clear_bgp_external_soft_in
,
8646 clear_bgp_ipv6_external_in_cmd
,
8647 "clear bgp ipv6 external WORD in",
8651 "Clear all external peers\n"
8654 ALIAS (clear_bgp_external_soft_in
,
8655 clear_bgp_instance_ipv6_external_in_cmd
,
8656 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external WORD in",
8659 BGP_INSTANCE_HELP_STR
8661 "Clear all external peers\n"
8664 DEFUN (clear_bgp_external_in_prefix_filter
,
8665 clear_bgp_external_in_prefix_filter_cmd
,
8666 "clear bgp external in prefix-filter",
8669 "Clear all external peers\n"
8671 "Push out prefix-list ORF and do inbound soft reconfig\n")
8673 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
8674 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
8677 ALIAS (clear_bgp_external_in_prefix_filter
,
8678 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
8679 "clear bgp ipv6 external in prefix-filter",
8683 "Clear all external peers\n"
8685 "Push out prefix-list ORF and do inbound soft reconfig\n")
8687 DEFUN (clear_ip_bgp_as_soft_in
,
8688 clear_ip_bgp_as_soft_in_cmd
,
8689 "clear ip bgp " CMD_AS_RANGE
" soft in",
8693 "Clear peers with the AS number\n"
8698 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_as
,
8699 BGP_CLEAR_SOFT_IN
, argv
[2]);
8701 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
8702 BGP_CLEAR_SOFT_IN
, argv
[0]);
8705 ALIAS (clear_ip_bgp_as_soft_in
,
8706 clear_ip_bgp_instance_as_soft_in_cmd
,
8707 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft in",
8711 BGP_INSTANCE_HELP_STR
8712 "Clear peers with the AS number\n"
8716 ALIAS (clear_ip_bgp_as_soft_in
,
8717 clear_ip_bgp_as_in_cmd
,
8718 "clear ip bgp " CMD_AS_RANGE
" in",
8722 "Clear peers with the AS number\n"
8725 ALIAS (clear_ip_bgp_as_soft_in
,
8726 clear_ip_bgp_instance_as_in_cmd
,
8727 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" in",
8731 BGP_INSTANCE_HELP_STR
8732 "Clear peers with the AS number\n"
8735 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
8736 clear_ip_bgp_as_in_prefix_filter_cmd
,
8737 "clear ip bgp " CMD_AS_RANGE
" in prefix-filter",
8741 "Clear peers with the AS number\n"
8743 "Push out prefix-list ORF and do inbound soft reconfig\n")
8745 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
8746 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8749 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
8750 clear_ip_bgp_as_ipv4_soft_in_cmd
,
8751 "clear ip bgp " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" soft in",
8755 "Clear peers with the AS number\n"
8762 safi
= bgp_vty_safi_from_arg(argv
[1]);
8763 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_as
,
8764 BGP_CLEAR_SOFT_IN
, argv
[0]);
8767 DEFUN (clear_ip_bgp_instance_as_ipv4_soft_in
,
8768 clear_ip_bgp_instance_as_ipv4_soft_in_cmd
,
8769 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" soft in",
8773 BGP_INSTANCE_HELP_STR
8774 "Clear peers with the AS number\n"
8781 safi
= bgp_vty_safi_from_arg(argv
[3]);
8782 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_as
,
8783 BGP_CLEAR_SOFT_IN
, argv
[2]);
8786 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
8787 clear_ip_bgp_as_ipv4_in_cmd
,
8788 "clear ip bgp " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" in",
8792 "Clear peers with the AS number\n"
8797 ALIAS (clear_ip_bgp_instance_as_ipv4_soft_in
,
8798 clear_ip_bgp_instance_as_ipv4_in_cmd
,
8799 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" in",
8803 BGP_INSTANCE_HELP_STR
8804 "Clear peers with the AS number\n"
8809 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
8810 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
8811 "clear ip bgp " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" in prefix-filter",
8815 "Clear peers with the AS number\n"
8819 "Push out prefix-list ORF and do inbound soft reconfig\n")
8822 safi
= bgp_vty_safi_from_arg(argv
[1]);
8823 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_as
,
8824 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8827 DEFUN (clear_bgp_as_soft_in
,
8828 clear_bgp_as_soft_in_cmd
,
8829 "clear bgp " CMD_AS_RANGE
" soft in",
8832 "Clear peers with the AS number\n"
8837 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_as
,
8838 BGP_CLEAR_SOFT_IN
, argv
[2]);
8840 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
8841 BGP_CLEAR_SOFT_IN
, argv
[0]);
8844 ALIAS (clear_bgp_as_soft_in
,
8845 clear_bgp_instance_as_soft_in_cmd
,
8846 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft in",
8849 BGP_INSTANCE_HELP_STR
8850 "Clear peers with the AS number\n"
8854 ALIAS (clear_bgp_as_soft_in
,
8855 clear_bgp_ipv6_as_soft_in_cmd
,
8856 "clear bgp ipv6 " CMD_AS_RANGE
" soft in",
8860 "Clear peers with the AS number\n"
8864 ALIAS (clear_bgp_as_soft_in
,
8865 clear_bgp_instance_ipv6_as_soft_in_cmd
,
8866 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
" soft in",
8869 BGP_INSTANCE_HELP_STR
8871 "Clear peers with the AS number\n"
8875 ALIAS (clear_bgp_as_soft_in
,
8876 clear_bgp_as_in_cmd
,
8877 "clear bgp " CMD_AS_RANGE
" in",
8880 "Clear peers with the AS number\n"
8883 ALIAS (clear_bgp_as_soft_in
,
8884 clear_bgp_instance_as_in_cmd
,
8885 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" in",
8888 BGP_INSTANCE_HELP_STR
8889 "Clear peers with the AS number\n"
8892 ALIAS (clear_bgp_as_soft_in
,
8893 clear_bgp_ipv6_as_in_cmd
,
8894 "clear bgp ipv6 " CMD_AS_RANGE
" in",
8898 "Clear peers with the AS number\n"
8901 ALIAS (clear_bgp_as_soft_in
,
8902 clear_bgp_instance_ipv6_as_in_cmd
,
8903 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
" in",
8906 BGP_INSTANCE_HELP_STR
8908 "Clear peers with the AS number\n"
8911 DEFUN (clear_bgp_as_in_prefix_filter
,
8912 clear_bgp_as_in_prefix_filter_cmd
,
8913 "clear bgp " CMD_AS_RANGE
" in prefix-filter",
8916 "Clear peers with the AS number\n"
8918 "Push out prefix-list ORF and do inbound soft reconfig\n")
8920 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
8921 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
8924 ALIAS (clear_bgp_as_in_prefix_filter
,
8925 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
8926 "clear bgp ipv6 " CMD_AS_RANGE
" in prefix-filter",
8930 "Clear peers with the AS number\n"
8932 "Push out prefix-list ORF and do inbound soft reconfig\n")
8934 /* Both soft-reconfiguration */
8935 DEFUN (clear_ip_bgp_all_soft
,
8936 clear_ip_bgp_all_soft_cmd
,
8937 "clear ip bgp * soft",
8945 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_all
,
8946 BGP_CLEAR_SOFT_BOTH
, NULL
);
8948 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
8949 BGP_CLEAR_SOFT_BOTH
, NULL
);
8952 ALIAS (clear_ip_bgp_all_soft
,
8953 clear_ip_bgp_instance_all_soft_cmd
,
8954 "clear ip bgp " BGP_INSTANCE_CMD
" * soft",
8958 BGP_INSTANCE_HELP_STR
8963 DEFUN (clear_ip_bgp_all_ipv4_soft
,
8964 clear_ip_bgp_all_ipv4_soft_cmd
,
8965 "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR
" soft",
8971 "Address Family Modifier\n"
8972 "Address Family Modifier\n"
8976 safi
= bgp_vty_safi_from_arg(argv
[0]);
8977 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_all
,
8978 BGP_CLEAR_SOFT_BOTH
, NULL
);
8981 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
8982 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
8983 "clear ip bgp " BGP_INSTANCE_CMD
" * ipv4 "BGP_SAFI_CMD_STR
" soft",
8987 BGP_INSTANCE_HELP_STR
8990 "Address Family Modifier\n"
8991 "Address Family Modifier\n"
8995 safi
= bgp_vty_safi_from_arg(argv
[2]);
8996 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_all
,
8997 BGP_CLEAR_SOFT_BOTH
, NULL
);
9000 DEFUN (clear_bgp_all_soft
,
9001 clear_bgp_all_soft_cmd
,
9009 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_all
,
9010 BGP_CLEAR_SOFT_BOTH
, NULL
);
9012 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
9013 BGP_CLEAR_SOFT_BOTH
, NULL
);
9016 ALIAS (clear_bgp_all_soft
,
9017 clear_bgp_instance_all_soft_cmd
,
9018 "clear bgp " BGP_INSTANCE_CMD
" * soft",
9021 BGP_INSTANCE_HELP_STR
9025 ALIAS (clear_bgp_all_soft
,
9026 clear_bgp_ipv6_all_soft_cmd
,
9027 "clear bgp ipv6 * soft",
9034 ALIAS (clear_bgp_all_soft
,
9035 clear_bgp_instance_ipv6_all_soft_cmd
,
9036 "clear bgp " BGP_INSTANCE_CMD
" ipv6 * soft",
9039 BGP_INSTANCE_HELP_STR
9044 DEFUN (clear_ip_bgp_peer_soft
,
9045 clear_ip_bgp_peer_soft_cmd
,
9046 "clear ip bgp (A.B.C.D|WORD) soft",
9050 "BGP neighbor address to clear\n"
9051 "BGP neighbor on interface to clear\n"
9055 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_peer
,
9056 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9058 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
9059 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9062 ALIAS (clear_ip_bgp_peer_soft
,
9063 clear_ip_bgp_instance_peer_soft_cmd
,
9064 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) soft",
9068 BGP_INSTANCE_HELP_STR
9069 "BGP neighbor address to clear\n"
9070 "BGP neighbor on interface to clear\n"
9073 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
9074 clear_ip_bgp_peer_ipv4_soft_cmd
,
9075 "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" soft",
9079 "BGP neighbor address to clear\n"
9080 "BGP neighbor on interface to clear\n"
9082 "Address Family Modifier\n"
9083 "Address Family Modifier\n"
9087 safi
= bgp_vty_safi_from_arg(argv
[1]);
9088 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_peer
,
9089 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9092 DEFUN (clear_ip_bgp_instance_peer_ipv4_soft
,
9093 clear_ip_bgp_instance_peer_ipv4_soft_cmd
,
9094 "clear ip bgp " BGP_INSTANCE_CMD
" (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR
" soft",
9098 BGP_INSTANCE_HELP_STR
9099 "BGP neighbor address to clear\n"
9100 "BGP neighbor on interface to clear\n"
9102 "Address Family Modifier\n"
9103 "Address Family Modifier\n"
9107 safi
= bgp_vty_safi_from_arg(argv
[3]);
9108 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_peer
,
9109 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9112 DEFUN (clear_bgp_peer_soft
,
9113 clear_bgp_peer_soft_cmd
,
9114 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft",
9117 "BGP neighbor address to clear\n"
9118 "BGP IPv6 neighbor to clear\n"
9119 "BGP neighbor on interface to clear\n"
9123 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
9124 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9126 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
9127 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9130 ALIAS (clear_bgp_peer_soft
,
9131 clear_bgp_instance_peer_soft_cmd
,
9132 "clear bgp " BGP_INSTANCE_CMD
" (A.B.C.D|X:X::X:X|WORD) soft",
9135 BGP_INSTANCE_HELP_STR
9136 "BGP neighbor address to clear\n"
9137 "BGP IPv6 neighbor to clear\n"
9138 "BGP neighbor on interface to clear\n"
9141 ALIAS (clear_bgp_peer_soft
,
9142 clear_bgp_ipv6_peer_soft_cmd
,
9143 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft",
9147 "BGP neighbor address to clear\n"
9148 "BGP IPv6 neighbor to clear\n"
9149 "BGP neighbor on interface to clear\n"
9152 ALIAS (clear_bgp_peer_soft
,
9153 clear_bgp_instance_ipv6_peer_soft_cmd
,
9154 "clear bgp " BGP_INSTANCE_CMD
" ipv6 (A.B.C.D|X:X::X:X|WORD) soft",
9157 BGP_INSTANCE_HELP_STR
9159 "BGP neighbor address to clear\n"
9160 "BGP IPv6 neighbor to clear\n"
9161 "BGP neighbor on interface to clear\n"
9164 DEFUN (clear_ip_bgp_peer_group_soft
,
9165 clear_ip_bgp_peer_group_soft_cmd
,
9166 "clear ip bgp peer-group WORD soft",
9170 "Clear all members of peer-group\n"
9171 "BGP peer-group name\n"
9175 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_group
,
9176 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9178 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
9179 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9182 ALIAS (clear_ip_bgp_peer_group_soft
,
9183 clear_ip_bgp_instance_peer_group_soft_cmd
,
9184 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD soft",
9188 BGP_INSTANCE_HELP_STR
9189 "Clear all members of peer-group\n"
9190 "BGP peer-group name\n"
9193 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
9194 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
9195 "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" soft",
9199 "Clear all members of peer-group\n"
9200 "BGP peer-group name\n"
9206 safi
= bgp_vty_safi_from_arg(argv
[1]);
9207 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_group
,
9208 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9211 DEFUN (clear_ip_bgp_instance_peer_group_ipv4_soft
,
9212 clear_ip_bgp_instance_peer_group_ipv4_soft_cmd
,
9213 "clear ip bgp " BGP_INSTANCE_CMD
" peer-group WORD ipv4 "BGP_SAFI_CMD_STR
" soft",
9217 BGP_INSTANCE_HELP_STR
9218 "Clear all members of peer-group\n"
9219 "BGP peer-group name\n"
9225 safi
= bgp_vty_safi_from_arg(argv
[3]);
9226 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_group
,
9227 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9230 DEFUN (clear_bgp_peer_group_soft
,
9231 clear_bgp_peer_group_soft_cmd
,
9232 "clear bgp peer-group WORD soft",
9235 "Clear all members of peer-group\n"
9236 "BGP peer-group name\n"
9240 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_group
,
9241 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9243 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
9244 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9247 ALIAS (clear_bgp_peer_group_soft
,
9248 clear_bgp_instance_peer_group_soft_cmd
,
9249 "clear bgp " BGP_INSTANCE_CMD
" peer-group WORD soft",
9252 BGP_INSTANCE_HELP_STR
9253 "Clear all members of peer-group\n"
9254 "BGP peer-group name\n"
9257 ALIAS (clear_bgp_peer_group_soft
,
9258 clear_bgp_ipv6_peer_group_soft_cmd
,
9259 "clear bgp ipv6 peer-group WORD soft",
9263 "Clear all members of peer-group\n"
9264 "BGP peer-group name\n"
9267 ALIAS (clear_bgp_peer_group_soft
,
9268 clear_bgp_instance_ipv6_peer_group_soft_cmd
,
9269 "clear bgp " BGP_INSTANCE_CMD
" ipv6 peer-group WORD soft",
9272 BGP_INSTANCE_HELP_STR
9274 "Clear all members of peer-group\n"
9275 "BGP peer-group name\n"
9278 DEFUN (clear_ip_bgp_external_soft
,
9279 clear_ip_bgp_external_soft_cmd
,
9280 "clear ip bgp external soft",
9284 "Clear all external peers\n"
9288 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_external
,
9289 BGP_CLEAR_SOFT_BOTH
, NULL
);
9291 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
9292 BGP_CLEAR_SOFT_BOTH
, NULL
);
9295 ALIAS (clear_ip_bgp_external_soft
,
9296 clear_ip_bgp_instance_external_soft_cmd
,
9297 "clear ip bgp " BGP_INSTANCE_CMD
" external soft",
9301 BGP_INSTANCE_HELP_STR
9302 "Clear all external peers\n"
9305 DEFUN (clear_ip_bgp_external_ipv4_soft
,
9306 clear_ip_bgp_external_ipv4_soft_cmd
,
9307 "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR
" soft",
9311 "Clear all external peers\n"
9317 safi
= bgp_vty_safi_from_arg(argv
[0]);
9318 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_external
,
9319 BGP_CLEAR_SOFT_BOTH
, NULL
);
9322 DEFUN (clear_ip_bgp_instance_external_ipv4_soft
,
9323 clear_ip_bgp_instance_external_ipv4_soft_cmd
,
9324 "clear ip bgp " BGP_INSTANCE_CMD
" external ipv4 "BGP_SAFI_CMD_STR
" soft",
9328 BGP_INSTANCE_HELP_STR
9329 "Clear all external peers\n"
9335 safi
= bgp_vty_safi_from_arg(argv
[2]);
9336 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_external
,
9337 BGP_CLEAR_SOFT_BOTH
, NULL
);
9340 DEFUN (clear_bgp_external_soft
,
9341 clear_bgp_external_soft_cmd
,
9342 "clear bgp external soft",
9345 "Clear all external peers\n"
9349 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_external
,
9350 BGP_CLEAR_SOFT_BOTH
, NULL
);
9352 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
9353 BGP_CLEAR_SOFT_BOTH
, NULL
);
9356 ALIAS (clear_bgp_external_soft
,
9357 clear_bgp_instance_external_soft_cmd
,
9358 "clear bgp " BGP_INSTANCE_CMD
" external soft",
9361 BGP_INSTANCE_HELP_STR
9362 "Clear all external peers\n"
9365 ALIAS (clear_bgp_external_soft
,
9366 clear_bgp_ipv6_external_soft_cmd
,
9367 "clear bgp ipv6 external soft",
9371 "Clear all external peers\n"
9374 ALIAS (clear_bgp_external_soft
,
9375 clear_bgp_instance_ipv6_external_soft_cmd
,
9376 "clear bgp " BGP_INSTANCE_CMD
" ipv6 external soft",
9379 BGP_INSTANCE_HELP_STR
9381 "Clear all external peers\n"
9384 DEFUN (clear_ip_bgp_as_soft
,
9385 clear_ip_bgp_as_soft_cmd
,
9386 "clear ip bgp " CMD_AS_RANGE
" soft",
9390 "Clear peers with the AS number\n"
9394 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, clear_as
,
9395 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9397 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
9398 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9401 ALIAS (clear_ip_bgp_as_soft
,
9402 clear_ip_bgp_instance_as_soft_cmd
,
9403 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft",
9407 BGP_INSTANCE_HELP_STR
9408 "Clear peers with the AS number\n"
9411 DEFUN (clear_ip_bgp_as_ipv4_soft
,
9412 clear_ip_bgp_as_ipv4_soft_cmd
,
9413 "clear ip bgp " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" soft",
9417 "Clear peers with the AS number\n"
9419 "Address Family Modifier\n"
9420 "Address Family Modifier\n"
9424 safi
= bgp_vty_safi_from_arg(argv
[1]);
9425 return bgp_clear_vty (vty
, NULL
, AFI_IP
, safi
, clear_as
,
9426 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9429 DEFUN (clear_ip_bgp_instance_as_ipv4_soft
,
9430 clear_ip_bgp_instance_as_ipv4_soft_cmd
,
9431 "clear ip bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" ipv4 "BGP_SAFI_CMD_STR
" soft",
9435 BGP_INSTANCE_HELP_STR
9436 "Clear peers with the AS number\n"
9438 "Address Family Modifier\n"
9439 "Address Family Modifier\n"
9443 safi
= bgp_vty_safi_from_arg(argv
[3]);
9444 return bgp_clear_vty (vty
, argv
[1], AFI_IP
, safi
, clear_as
,
9445 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9448 DEFUN (clear_bgp_as_soft
,
9449 clear_bgp_as_soft_cmd
,
9450 "clear bgp " CMD_AS_RANGE
" soft",
9453 "Clear peers with the AS number\n"
9457 return bgp_clear_vty (vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, clear_as
,
9458 BGP_CLEAR_SOFT_BOTH
, argv
[2]);
9460 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
9461 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
9464 ALIAS (clear_bgp_as_soft
,
9465 clear_bgp_instance_as_soft_cmd
,
9466 "clear bgp " BGP_INSTANCE_CMD
" " CMD_AS_RANGE
" soft",
9469 BGP_INSTANCE_HELP_STR
9470 "Clear peers with the AS number\n"
9473 ALIAS (clear_bgp_as_soft
,
9474 clear_bgp_ipv6_as_soft_cmd
,
9475 "clear bgp ipv6 " CMD_AS_RANGE
" soft",
9479 "Clear peers with the AS number\n"
9482 ALIAS (clear_bgp_as_soft
,
9483 clear_bgp_instance_ipv6_as_soft_cmd
,
9484 "clear bgp " BGP_INSTANCE_CMD
" ipv6 " CMD_AS_RANGE
" soft",
9487 BGP_INSTANCE_HELP_STR
9489 "Clear peers with the AS number\n"
9492 DEFUN (show_bgp_views
,
9497 "Show the defined BGP views\n")
9499 struct list
*inst
= bm
->bgp
;
9500 struct listnode
*node
;
9503 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE
))
9505 vty_out (vty
, "BGP Multiple Instance is not enabled%s", VTY_NEWLINE
);
9509 vty_out (vty
, "Defined BGP views:%s", VTY_NEWLINE
);
9510 for (ALL_LIST_ELEMENTS_RO(inst
, node
, bgp
))
9513 if (bgp
->inst_type
== BGP_INSTANCE_TYPE_VRF
)
9515 vty_out (vty
, "\t%s (AS%u)%s",
9516 bgp
->name
? bgp
->name
: "(null)",
9517 bgp
->as
, VTY_NEWLINE
);
9523 DEFUN (show_bgp_vrfs
,
9525 "show bgp vrfs {json}",
9529 "JavaScript Object Notation\n")
9531 struct list
*inst
= bm
->bgp
;
9532 struct listnode
*node
;
9534 u_char uj
= use_json(argc
, argv
);
9535 json_object
*json
= NULL
;
9536 json_object
*json_vrfs
= NULL
;
9538 static char header
[] = "Type Id RouterId #PeersCfg #PeersEstb Name";
9540 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE
))
9542 vty_out (vty
, "BGP Multiple Instance is not enabled%s", VTY_NEWLINE
);
9548 json
= json_object_new_object();
9549 json_vrfs
= json_object_new_object();
9552 for (ALL_LIST_ELEMENTS_RO(inst
, node
, bgp
))
9554 const char *name
, *type
;
9556 struct listnode
*node
, *nnode
;
9557 int peers_cfg
, peers_estb
;
9558 json_object
*json_vrf
= NULL
;
9562 if (bgp
->inst_type
== BGP_INSTANCE_TYPE_VIEW
)
9566 if (!uj
&& count
== 1)
9567 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
9569 peers_cfg
= peers_estb
= 0;
9571 json_vrf
= json_object_new_object();
9574 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
9576 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
9579 if (peer
->status
== Established
)
9583 if (bgp
->inst_type
== BGP_INSTANCE_TYPE_DEFAULT
)
9594 vrf_id_ui
= (bgp
->vrf_id
== VRF_UNKNOWN
) ? -1 : bgp
->vrf_id
;
9597 json_object_string_add(json_vrf
, "type", type
);
9598 json_object_int_add(json_vrf
, "vrfId", vrf_id_ui
);
9599 json_object_string_add(json_vrf
, "routerId", inet_ntoa (bgp
->router_id
));
9600 json_object_int_add(json_vrf
, "numConfiguredPeers", peers_cfg
);
9601 json_object_int_add(json_vrf
, "numEstablishedPeers", peers_estb
);
9603 json_object_object_add(json_vrfs
, name
, json_vrf
);
9606 vty_out (vty
, "%4s %-5d %-16s %9u %10u %s%s",
9607 type
, vrf_id_ui
, inet_ntoa (bgp
->router_id
),
9608 peers_cfg
, peers_estb
, name
,
9614 json_object_object_add(json
, "vrfs", json_vrfs
);
9616 json_object_int_add(json
, "totalVrfs", count
);
9618 vty_out (vty
, "%s%s", json_object_to_json_string_ext(json
, JSON_C_TO_STRING_PRETTY
), VTY_NEWLINE
);
9619 json_object_free(json
);
9624 vty_out (vty
, "%sTotal number of VRFs (including default): %d%s",
9625 VTY_NEWLINE
, count
, VTY_NEWLINE
);
9631 DEFUN (show_bgp_memory
,
9632 show_bgp_memory_cmd
,
9636 "Global BGP memory statistics\n")
9638 char memstrbuf
[MTYPE_MEMSTR_LEN
];
9639 unsigned long count
;
9641 /* RIB related usage stats */
9642 count
= mtype_stats_alloc (MTYPE_BGP_NODE
);
9643 vty_out (vty
, "%ld RIB nodes, using %s of memory%s", count
,
9644 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9645 count
* sizeof (struct bgp_node
)),
9648 count
= mtype_stats_alloc (MTYPE_BGP_ROUTE
);
9649 vty_out (vty
, "%ld BGP routes, using %s of memory%s", count
,
9650 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9651 count
* sizeof (struct bgp_info
)),
9653 if ((count
= mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA
)))
9654 vty_out (vty
, "%ld BGP route ancillaries, using %s of memory%s", count
,
9655 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9656 count
* sizeof (struct bgp_info_extra
)),
9659 if ((count
= mtype_stats_alloc (MTYPE_BGP_STATIC
)))
9660 vty_out (vty
, "%ld Static routes, using %s of memory%s", count
,
9661 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9662 count
* sizeof (struct bgp_static
)),
9665 if ((count
= mtype_stats_alloc (MTYPE_BGP_PACKET
)))
9666 vty_out (vty
, "%ld Packets, using %s of memory%s", count
,
9667 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9668 count
* sizeof (struct bpacket
)),
9672 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_IN
)))
9673 vty_out (vty
, "%ld Adj-In entries, using %s of memory%s", count
,
9674 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9675 count
* sizeof (struct bgp_adj_in
)),
9677 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_OUT
)))
9678 vty_out (vty
, "%ld Adj-Out entries, using %s of memory%s", count
,
9679 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9680 count
* sizeof (struct bgp_adj_out
)),
9683 if ((count
= mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE
)))
9684 vty_out (vty
, "%ld Nexthop cache entries, using %s of memory%s", count
,
9685 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9686 count
* sizeof (struct bgp_nexthop_cache
)),
9689 if ((count
= mtype_stats_alloc (MTYPE_BGP_DAMP_INFO
)))
9690 vty_out (vty
, "%ld Dampening entries, using %s of memory%s", count
,
9691 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9692 count
* sizeof (struct bgp_damp_info
)),
9696 count
= attr_count();
9697 vty_out (vty
, "%ld BGP attributes, using %s of memory%s", count
,
9698 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9699 count
* sizeof(struct attr
)),
9701 if ((count
= mtype_stats_alloc (MTYPE_ATTR_EXTRA
)))
9702 vty_out (vty
, "%ld BGP extra attributes, using %s of memory%s", count
,
9703 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9704 count
* sizeof(struct attr_extra
)),
9707 if ((count
= attr_unknown_count()))
9708 vty_out (vty
, "%ld unknown attributes%s", count
, VTY_NEWLINE
);
9710 /* AS_PATH attributes */
9711 count
= aspath_count ();
9712 vty_out (vty
, "%ld BGP AS-PATH entries, using %s of memory%s", count
,
9713 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9714 count
* sizeof (struct aspath
)),
9717 count
= mtype_stats_alloc (MTYPE_AS_SEG
);
9718 vty_out (vty
, "%ld BGP AS-PATH segments, using %s of memory%s", count
,
9719 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9720 count
* sizeof (struct assegment
)),
9723 /* Other attributes */
9724 if ((count
= community_count ()))
9725 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
9726 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9727 count
* sizeof (struct community
)),
9729 if ((count
= mtype_stats_alloc (MTYPE_ECOMMUNITY
)))
9730 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
9731 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9732 count
* sizeof (struct ecommunity
)),
9735 if ((count
= mtype_stats_alloc (MTYPE_CLUSTER
)))
9736 vty_out (vty
, "%ld Cluster lists, using %s of memory%s", count
,
9737 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9738 count
* sizeof (struct cluster_list
)),
9741 /* Peer related usage */
9742 count
= mtype_stats_alloc (MTYPE_BGP_PEER
);
9743 vty_out (vty
, "%ld peers, using %s of memory%s", count
,
9744 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9745 count
* sizeof (struct peer
)),
9748 if ((count
= mtype_stats_alloc (MTYPE_PEER_GROUP
)))
9749 vty_out (vty
, "%ld peer groups, using %s of memory%s", count
,
9750 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9751 count
* sizeof (struct peer_group
)),
9755 if ((count
= mtype_stats_alloc (MTYPE_HASH
)))
9756 vty_out (vty
, "%ld hash tables, using %s of memory%s", count
,
9757 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9758 count
* sizeof (struct hash
)),
9760 if ((count
= mtype_stats_alloc (MTYPE_HASH_BACKET
)))
9761 vty_out (vty
, "%ld hash buckets, using %s of memory%s", count
,
9762 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9763 count
* sizeof (struct hash_backet
)),
9765 if ((count
= mtype_stats_alloc (MTYPE_BGP_REGEXP
)))
9766 vty_out (vty
, "%ld compiled regexes, using %s of memory%s", count
,
9767 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9768 count
* sizeof (regex_t
)),
9773 /* Show BGP peer's summary information. */
9775 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
,
9776 u_char use_json
, json_object
*json
)
9779 struct listnode
*node
, *nnode
;
9780 unsigned int count
= 0, dn_count
= 0;
9781 char timebuf
[BGP_UPTIME_LEN
], dn_flag
[2];
9782 char neighbor_buf
[VTY_BUFSIZ
];
9783 int neighbor_col_default_width
= 16;
9785 int max_neighbor_width
= 0;
9786 json_object
*json_peer
= NULL
;
9787 json_object
*json_peers
= NULL
;
9792 json
= json_object_new_object();
9794 json_peers
= json_object_new_object();
9798 /* Loop over all neighbors that will be displayed to determine how many
9799 * characters are needed for the Neighbor column
9801 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
9803 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
9806 if (peer
->afc
[afi
][safi
])
9808 memset(dn_flag
, '\0', sizeof(dn_flag
));
9809 if (peer_dynamic_neighbor(peer
))
9812 if (peer
->hostname
&& bgp_flag_check(bgp
, BGP_FLAG_SHOW_HOSTNAME
))
9813 sprintf(neighbor_buf
, "%s%s(%s) ", dn_flag
, peer
->hostname
, peer
->host
);
9815 sprintf(neighbor_buf
, "%s%s ", dn_flag
, peer
->host
);
9817 len
= strlen(neighbor_buf
);
9819 if (len
> max_neighbor_width
)
9820 max_neighbor_width
= len
;
9824 /* Originally we displayed the Neighbor column as 16
9825 * characters wide so make that the default
9827 if (max_neighbor_width
< neighbor_col_default_width
)
9828 max_neighbor_width
= neighbor_col_default_width
;
9831 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
9833 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
9836 if (peer
->afc
[afi
][safi
])
9841 char memstrbuf
[MTYPE_MEMSTR_LEN
];
9844 vrf_id_ui
= (bgp
->vrf_id
== VRF_UNKNOWN
) ? -1 : bgp
->vrf_id
;
9846 /* Usage summary and header */
9849 json_object_string_add(json
, "routerId", inet_ntoa (bgp
->router_id
));
9850 json_object_int_add(json
, "as", bgp
->as
);
9851 json_object_int_add(json
, "vrfId", vrf_id_ui
);
9852 json_object_string_add(json
, "vrfName",
9853 (bgp
->inst_type
== BGP_INSTANCE_TYPE_DEFAULT
)
9854 ? "Default" : bgp
->name
);
9859 "BGP router identifier %s, local AS number %u vrf-id %d",
9860 inet_ntoa (bgp
->router_id
), bgp
->as
, vrf_id_ui
);
9861 vty_out (vty
, "%s", VTY_NEWLINE
);
9864 if (bgp_update_delay_configured(bgp
))
9868 json_object_int_add(json
, "updateDelayLimit", bgp
->v_update_delay
);
9870 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
9871 json_object_int_add(json
, "updateDelayEstablishWait", bgp
->v_establish_wait
);
9873 if (bgp_update_delay_active(bgp
))
9875 json_object_string_add(json
, "updateDelayFirstNeighbor", bgp
->update_delay_begin_time
);
9876 json_object_boolean_true_add(json
, "updateDelayInProgress");
9880 if (bgp
->update_delay_over
)
9882 json_object_string_add(json
, "updateDelayFirstNeighbor",
9883 bgp
->update_delay_begin_time
);
9884 json_object_string_add(json
, "updateDelayBestpathResumed",
9885 bgp
->update_delay_end_time
);
9886 json_object_string_add(json
, "updateDelayZebraUpdateResume",
9887 bgp
->update_delay_zebra_resume_time
);
9888 json_object_string_add(json
, "updateDelayPeerUpdateResume",
9889 bgp
->update_delay_peers_resume_time
);
9895 vty_out (vty
, "Read-only mode update-delay limit: %d seconds%s",
9896 bgp
->v_update_delay
, VTY_NEWLINE
);
9897 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
9898 vty_out (vty
, " Establish wait: %d seconds%s",
9899 bgp
->v_establish_wait
, VTY_NEWLINE
);
9901 if (bgp_update_delay_active(bgp
))
9903 vty_out (vty
, " First neighbor established: %s%s",
9904 bgp
->update_delay_begin_time
, VTY_NEWLINE
);
9905 vty_out (vty
, " Delay in progress%s", VTY_NEWLINE
);
9909 if (bgp
->update_delay_over
)
9911 vty_out (vty
, " First neighbor established: %s%s",
9912 bgp
->update_delay_begin_time
, VTY_NEWLINE
);
9913 vty_out (vty
, " Best-paths resumed: %s%s",
9914 bgp
->update_delay_end_time
, VTY_NEWLINE
);
9915 vty_out (vty
, " zebra update resumed: %s%s",
9916 bgp
->update_delay_zebra_resume_time
, VTY_NEWLINE
);
9917 vty_out (vty
, " peers update resumed: %s%s",
9918 bgp
->update_delay_peers_resume_time
, VTY_NEWLINE
);
9926 if (bgp_maxmed_onstartup_configured(bgp
) && bgp
->maxmed_active
)
9927 json_object_boolean_true_add(json
, "maxMedOnStartup");
9928 if (bgp
->v_maxmed_admin
)
9929 json_object_boolean_true_add(json
, "maxMedAdministrative");
9931 json_object_int_add(json
, "tableVersion", bgp_table_version(bgp
->rib
[afi
][safi
]));
9933 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
9934 json_object_int_add(json
, "ribCount", ents
);
9935 json_object_int_add(json
, "ribMemory", ents
* sizeof (struct bgp_node
));
9937 ents
= listcount (bgp
->peer
);
9938 json_object_int_add(json
, "peerCount", ents
);
9939 json_object_int_add(json
, "peerMemory", ents
* sizeof (struct peer
));
9941 if ((ents
= listcount (bgp
->group
)))
9943 json_object_int_add(json
, "peerGroupCount", ents
);
9944 json_object_int_add(json
, "peerGroupMemory", ents
* sizeof (struct peer_group
));
9947 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
9948 json_object_boolean_true_add(json
, "dampeningEnabled");
9952 if (bgp_maxmed_onstartup_configured(bgp
) && bgp
->maxmed_active
)
9953 vty_out (vty
, "Max-med on-startup active%s", VTY_NEWLINE
);
9954 if (bgp
->v_maxmed_admin
)
9955 vty_out (vty
, "Max-med administrative active%s", VTY_NEWLINE
);
9957 vty_out(vty
, "BGP table version %" PRIu64
"%s",
9958 bgp_table_version(bgp
->rib
[afi
][safi
]), VTY_NEWLINE
);
9960 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
9961 vty_out (vty
, "RIB entries %ld, using %s of memory%s", ents
,
9962 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9963 ents
* sizeof (struct bgp_node
)),
9966 /* Peer related usage */
9967 ents
= listcount (bgp
->peer
);
9968 vty_out (vty
, "Peers %ld, using %s of memory%s",
9970 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9971 ents
* sizeof (struct peer
)),
9974 if ((ents
= listcount (bgp
->group
)))
9975 vty_out (vty
, "Peer groups %ld, using %s of memory%s", ents
,
9976 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
9977 ents
* sizeof (struct peer_group
)),
9980 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
9981 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
9982 vty_out (vty
, "%s", VTY_NEWLINE
);
9984 /* Subtract 8 here because 'Neighbor' is 8 characters */
9985 vty_out (vty
, "Neighbor");
9986 vty_out (vty
, "%*s", max_neighbor_width
- 8, " ");
9987 vty_out (vty
, "V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd%s", VTY_NEWLINE
);
9995 json_peer
= json_object_new_object();
9997 if (peer_dynamic_neighbor(peer
))
9998 json_object_boolean_true_add(json_peer
, "dynamicPeer");
10000 if (peer
->hostname
)
10001 json_object_string_add(json_peer
, "hostname", peer
->hostname
);
10003 if (peer
->domainname
)
10004 json_object_string_add(json_peer
, "domainname", peer
->domainname
);
10006 json_object_int_add(json_peer
, "remoteAs", peer
->as
);
10007 json_object_int_add(json_peer
, "version", 4);
10008 json_object_int_add(json_peer
, "msgRcvd",
10009 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
10010 + peer
->notify_in
+ peer
->refresh_in
10011 + peer
->dynamic_cap_in
);
10012 json_object_int_add(json_peer
, "msgSent",
10013 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
10014 + peer
->notify_out
+ peer
->refresh_out
10015 + peer
->dynamic_cap_out
);
10017 json_object_int_add(json_peer
, "tableVersion", peer
->version
[afi
][safi
]);
10018 json_object_int_add(json_peer
, "outq", peer
->obuf
->count
);
10019 json_object_int_add(json_peer
, "inq", 0);
10020 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
, use_json
, json_peer
);
10021 json_object_int_add(json_peer
, "prefixReceivedCount", peer
->pcount
[afi
][safi
]);
10023 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
10024 json_object_string_add(json_peer
, "state", "Idle (Admin)");
10025 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
10026 json_object_string_add(json_peer
, "state", "Idle (PfxCt)");
10028 json_object_string_add(json_peer
, "state", LOOKUP(bgp_status_msg
, peer
->status
));
10031 json_object_string_add(json_peer
, "idType", "interface");
10032 else if (peer
->su
.sa
.sa_family
== AF_INET
)
10033 json_object_string_add(json_peer
, "idType", "ipv4");
10034 else if (peer
->su
.sa
.sa_family
== AF_INET6
)
10035 json_object_string_add(json_peer
, "idType", "ipv6");
10037 json_object_object_add(json_peers
, peer
->host
, json_peer
);
10041 memset(dn_flag
, '\0', sizeof(dn_flag
));
10042 if (peer_dynamic_neighbor(peer
))
10048 if (peer
->hostname
&& bgp_flag_check(bgp
, BGP_FLAG_SHOW_HOSTNAME
))
10049 len
= vty_out (vty
, "%s%s(%s) ", dn_flag
, peer
->hostname
,
10052 len
= vty_out (vty
, "%s%s ", dn_flag
, peer
->host
);
10054 /* pad the neighbor column with spaces */
10055 if (len
< max_neighbor_width
)
10056 vty_out (vty
, "%*s", max_neighbor_width
- len
, " ");
10058 vty_out (vty
, "4 %10u %7d %7d %8" PRIu64
" %4d %4zd %8s",
10060 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
10061 + peer
->notify_in
+ peer
->refresh_in
10062 + peer
->dynamic_cap_in
,
10063 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
10064 + peer
->notify_out
+ peer
->refresh_out
10065 + peer
->dynamic_cap_out
,
10066 peer
->version
[afi
][safi
],
10069 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
, 0, NULL
));
10071 if (peer
->status
== Established
)
10072 vty_out (vty
, " %12ld", peer
->pcount
[afi
][safi
]);
10075 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
10076 vty_out (vty
, " Idle (Admin)");
10077 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
10078 vty_out (vty
, " Idle (PfxCt)");
10080 vty_out (vty
, " %12s", LOOKUP(bgp_status_msg
, peer
->status
));
10082 vty_out (vty
, "%s", VTY_NEWLINE
);
10089 json_object_object_add(json
, "peers", json_peers
);
10091 json_object_int_add(json
, "totalPeers", count
);
10092 json_object_int_add(json
, "dynamicPeers", dn_count
);
10094 vty_out (vty
, "%s%s", json_object_to_json_string_ext(json
, JSON_C_TO_STRING_PRETTY
), VTY_NEWLINE
);
10095 json_object_free(json
);
10100 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
10101 count
, VTY_NEWLINE
);
10105 vty_out(vty
, "{\"error\": {\"message\": \"No %s neighbor configured\"}}%s",
10106 afi_safi_print(afi
, safi
), VTY_NEWLINE
);
10108 vty_out (vty
, "No %s neighbor is configured%s",
10109 afi_safi_print(afi
, safi
), VTY_NEWLINE
);
10112 if (dn_count
&& ! use_json
)
10114 vty_out(vty
, "* - dynamic neighbor%s", VTY_NEWLINE
);
10116 "%d dynamic neighbor(s), limit %d%s",
10117 dn_count
, bgp
->dynamic_neighbors_limit
, VTY_NEWLINE
);
10121 return CMD_SUCCESS
;
10125 bgp_show_summary_afi_safi (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
,
10126 u_char use_json
, json_object
*json
)
10129 int afi_wildcard
= (afi
== AFI_MAX
);
10130 int safi_wildcard
= (safi
== SAFI_MAX
);
10131 int is_wildcard
= (afi_wildcard
|| safi_wildcard
);
10132 if (use_json
&& is_wildcard
)
10133 vty_out (vty
, "{%s", VTY_NEWLINE
);
10135 afi
= 1; /* AFI_IP */
10136 while (afi
< AFI_MAX
)
10139 safi
= 1; /* SAFI_UNICAST */
10140 while (safi
< SAFI_MAX
)
10146 json
= json_object_new_object();
10149 vty_out (vty
, ",%s", VTY_NEWLINE
);
10153 vty_out(vty
, "\"%s\":", afi_safi_json(afi
, safi
));
10157 vty_out (vty
, "%s%s Summary:%s",
10158 VTY_NEWLINE
, afi_safi_print(afi
, safi
), VTY_NEWLINE
);
10161 bgp_show_summary (vty
, bgp
, afi
, safi
, use_json
, json
);
10162 if (safi
== SAFI_MPLS_VPN
) /* handle special cases to match zebra.h */
10166 if (safi
== SAFI_RESERVED_3
) /* handle special cases to match zebra.h */
10168 if (! safi_wildcard
)
10172 if (! afi_wildcard
||
10173 afi
== AFI_ETHER
) /* special case, not handled yet */
10177 if (use_json
&& is_wildcard
)
10178 vty_out (vty
, "}%s", VTY_NEWLINE
);
10183 bgp_show_summary_vty (struct vty
*vty
, const char *name
,
10184 afi_t afi
, safi_t safi
, u_char use_json
)
10190 bgp
= bgp_lookup_by_name (name
);
10194 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
10195 return CMD_WARNING
;
10198 bgp_show_summary_afi_safi (vty
, bgp
, afi
, safi
, use_json
, NULL
);
10199 return CMD_SUCCESS
;
10202 bgp
= bgp_get_default ();
10205 bgp_show_summary_afi_safi (vty
, bgp
, afi
, safi
, use_json
, NULL
);
10207 return CMD_SUCCESS
;
10211 bgp_show_all_instances_summary_vty (struct vty
*vty
, afi_t afi
, safi_t safi
,
10214 struct listnode
*node
, *nnode
;
10216 json_object
*json
= NULL
;
10220 vty_out (vty
, "{%s", VTY_NEWLINE
);
10222 for (ALL_LIST_ELEMENTS (bm
->bgp
, node
, nnode
, bgp
))
10226 if (!(json
= json_object_new_object()))
10228 zlog_err("Unable to allocate memory for JSON object");
10230 "{\"error\": {\"message:\": \"Unable to allocate memory for JSON object\"}}}%s",
10236 vty_out (vty
, ",%s", VTY_NEWLINE
);
10240 vty_out(vty
, "\"%s\":", (bgp
->inst_type
== BGP_INSTANCE_TYPE_DEFAULT
)
10241 ? "Default" : bgp
->name
);
10245 vty_out (vty
, "%sInstance %s:%s",
10247 (bgp
->inst_type
== BGP_INSTANCE_TYPE_DEFAULT
)
10248 ? "Default" : bgp
->name
, VTY_NEWLINE
);
10250 bgp_show_summary_afi_safi (vty
, bgp
, afi
, safi
, use_json
, json
);
10254 vty_out (vty
, "}%s", VTY_NEWLINE
);
10258 /* `show ip bgp summary' commands. */
10259 DEFUN (show_ip_bgp_summary
,
10260 show_ip_bgp_summary_cmd
,
10261 "show ip bgp summary {json}",
10265 "Summary of BGP neighbor status\n"
10266 "JavaScript Object Notation\n")
10268 u_char uj
= use_json(argc
, argv
);
10269 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, uj
);
10272 DEFUN (show_ip_bgp_instance_summary
,
10273 show_ip_bgp_instance_summary_cmd
,
10274 "show ip bgp " BGP_INSTANCE_CMD
" summary {json}",
10278 BGP_INSTANCE_HELP_STR
10279 "Summary of BGP neighbor status\n"
10280 "JavaScript Object Notation\n")
10282 u_char uj
= use_json(argc
, argv
);
10283 return bgp_show_summary_vty (vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, uj
);
10286 DEFUN (show_ip_bgp_instance_all_summary
,
10287 show_ip_bgp_instance_all_summary_cmd
,
10288 "show ip bgp " BGP_INSTANCE_ALL_CMD
" summary {json}",
10292 BGP_INSTANCE_ALL_HELP_STR
10293 "Summary of BGP neighbor status\n"
10294 "JavaScript Object Notation\n")
10296 u_char uj
= use_json(argc
, argv
);
10298 bgp_show_all_instances_summary_vty (vty
, AFI_IP
, SAFI_UNICAST
, uj
);
10299 return CMD_SUCCESS
;
10302 DEFUN (show_ip_bgp_ipv4_summary
,
10303 show_ip_bgp_ipv4_summary_cmd
,
10304 "show ip bgp ipv4 "BGP_SAFI_CMD_STR
" summary {json}",
10310 "Summary of BGP neighbor status\n"
10311 "JavaScript Object Notation\n")
10313 u_char uj
= use_json(argc
, argv
);
10315 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, bgp_vty_safi_from_arg(argv
[0]), uj
);
10318 ALIAS (show_ip_bgp_ipv4_summary
,
10319 show_bgp_ipv4_safi_summary_cmd
,
10320 "show bgp ipv4 "BGP_SAFI_CMD_STR
" summary {json}",
10325 "Summary of BGP neighbor status\n"
10326 "JavaScript Object Notation\n")
10328 DEFUN (show_ip_bgp_instance_ipv4_summary
,
10329 show_ip_bgp_instance_ipv4_summary_cmd
,
10330 "show ip bgp view WORD ipv4 "BGP_SAFI_CMD_STR
" summary {json}",
10338 "Summary of BGP neighbor status\n"
10339 "JavaScript Object Notation\n")
10341 u_char uj
= use_json(argc
, argv
);
10343 safi
= bgp_vty_safi_from_arg(argv
[1]);
10344 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, safi
, uj
);
10347 ALIAS (show_ip_bgp_instance_ipv4_summary
,
10348 show_bgp_instance_ipv4_safi_summary_cmd
,
10349 "show bgp view WORD ipv4 "BGP_SAFI_CMD_STR
" summary {json}",
10354 BGP_AFI_SAFI_HELP_STR
10355 "Summary of BGP neighbor status\n")
10357 DEFUN (show_bgp_summary
,
10358 show_bgp_summary_cmd
,
10359 "show bgp summary {json}",
10362 "Summary of BGP neighbor status\n"
10363 "JavaScript Object Notation\n")
10365 return bgp_show_summary_vty (vty
, NULL
, AFI_MAX
, SAFI_MAX
, use_json(argc
, argv
));
10368 DEFUN (show_bgp_instance_summary
,
10369 show_bgp_instance_summary_cmd
,
10370 "show bgp " BGP_INSTANCE_CMD
" summary {json}",
10373 BGP_INSTANCE_HELP_STR
10374 "Summary of BGP neighbor status\n"
10375 "JavaScript Object Notation\n")
10377 return bgp_show_summary_vty (vty
, argv
[1], AFI_MAX
, SAFI_MAX
, use_json(argc
, argv
));
10380 DEFUN (show_bgp_instance_all_summary
,
10381 show_bgp_instance_all_summary_cmd
,
10382 "show bgp " BGP_INSTANCE_ALL_CMD
" summary {json}",
10385 BGP_INSTANCE_ALL_HELP_STR
10386 "Summary of BGP neighbor status\n"
10387 "JavaScript Object Notation\n")
10389 u_char uj
= use_json(argc
, argv
);
10391 bgp_show_all_instances_summary_vty (vty
, AFI_MAX
, SAFI_MAX
, uj
);
10392 return CMD_SUCCESS
;
10395 DEFUN (show_bgp_ipv4_summary
,
10396 show_bgp_ipv4_summary_cmd
,
10397 "show bgp ipv4 summary {json}",
10401 "Summary of BGP neighbor status\n"
10402 "JavaScript Object Notation\n")
10404 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MAX
, use_json(argc
, argv
));
10407 DEFUN (show_bgp_instance_ipv4_summary
,
10408 show_bgp_instance_ipv4_summary_cmd
,
10409 "show bgp " BGP_INSTANCE_CMD
" ipv4 summary {json}",
10412 BGP_INSTANCE_HELP_STR
10414 "Summary of BGP neighbor status\n"
10415 "JavaScript Object Notation\n")
10417 return bgp_show_summary_vty (vty
, argv
[1], AFI_IP
, SAFI_MAX
, use_json(argc
, argv
));
10420 DEFUN (show_bgp_instance_ipv4_all_summary
,
10421 show_bgp_instance_ipv4_all_summary_cmd
,
10422 "show bgp " BGP_INSTANCE_ALL_CMD
" ipv4 summary {json}",
10425 BGP_INSTANCE_ALL_HELP_STR
10427 "Summary of BGP neighbor status\n"
10428 "JavaScript Object Notation\n")
10430 return bgp_show_summary_vty (vty
, argv
[1], AFI_IP
, SAFI_MAX
, use_json(argc
, argv
));
10433 DEFUN (show_bgp_ipv6_summary
,
10434 show_bgp_ipv6_summary_cmd
,
10435 "show bgp ipv6 summary {json}",
10439 "Summary of BGP neighbor status\n"
10440 "JavaScript Object Notation\n")
10442 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MAX
, use_json(argc
, argv
));
10445 DEFUN (show_bgp_instance_ipv6_summary
,
10446 show_bgp_instance_ipv6_summary_cmd
,
10447 "show bgp " BGP_INSTANCE_CMD
" ipv6 summary {json}",
10450 BGP_INSTANCE_HELP_STR
10452 "Summary of BGP neighbor status\n"
10453 "JavaScript Object Notation\n")
10455 return bgp_show_summary_vty (vty
, argv
[1], AFI_IP6
, SAFI_MAX
, use_json(argc
, argv
));
10458 DEFUN (show_bgp_instance_ipv6_all_summary
,
10459 show_bgp_instance_ipv6_all_summary_cmd
,
10460 "show bgp " BGP_INSTANCE_ALL_CMD
" ipv6 summary {json}",
10463 BGP_INSTANCE_ALL_HELP_STR
10465 "Summary of BGP neighbor status\n"
10466 "JavaScript Object Notation\n")
10468 return bgp_show_summary_vty (vty
, argv
[1], AFI_IP6
, SAFI_MAX
, use_json(argc
, argv
));
10471 DEFUN (show_bgp_ipv6_safi_summary
,
10472 show_bgp_ipv6_safi_summary_cmd
,
10473 "show bgp ipv6 "BGP_SAFI_CMD_STR
" summary {json}",
10478 "Summary of BGP neighbor status\n"
10479 "JavaScript Object Notation\n")
10481 u_char uj
= use_json(argc
, argv
);
10483 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, bgp_vty_safi_from_arg(argv
[0]), uj
);
10486 DEFUN (show_bgp_instance_ipv6_safi_summary
,
10487 show_bgp_instance_ipv6_safi_summary_cmd
,
10488 "show bgp " BGP_INSTANCE_CMD
" ipv6 "BGP_SAFI_CMD_STR
" summary {json}",
10491 BGP_INSTANCE_HELP_STR
10492 BGP_AFI_SAFI_HELP_STR
10493 "Summary of BGP neighbor status\n"
10494 "JavaScript Object Notation\n")
10496 u_char uj
= use_json(argc
, argv
);
10498 safi
= bgp_vty_safi_from_arg(argv
[2]);
10499 return bgp_show_summary_vty (vty
, argv
[1], AFI_IP6
, safi
, uj
);
10503 DEFUN (show_ipv6_bgp_summary
,
10504 show_ipv6_bgp_summary_cmd
,
10505 "show ipv6 bgp summary {json}",
10509 "Summary of BGP neighbor status\n"
10510 "JavaScript Object Notation\n")
10512 u_char uj
= use_json(argc
, argv
);
10513 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, uj
);
10517 DEFUN (show_ipv6_mbgp_summary
,
10518 show_ipv6_mbgp_summary_cmd
,
10519 "show ipv6 mbgp summary {json}",
10523 "Summary of BGP neighbor status\n"
10524 "JavaScript Object Notation\n")
10526 u_char uj
= use_json(argc
, argv
);
10527 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
, uj
);
10531 afi_safi_print (afi_t afi
, safi_t safi
)
10533 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
10534 return "IPv4 Unicast";
10535 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
10536 return "IPv4 Multicast";
10537 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
10539 else if (afi
== AFI_IP
&& safi
== SAFI_ENCAP
)
10540 return "IPv4 Encap";
10541 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
10542 return "IPv6 Unicast";
10543 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
10544 return "IPv6 Multicast";
10545 else if (afi
== AFI_IP6
&& safi
== SAFI_MPLS_VPN
)
10547 else if (afi
== AFI_IP6
&& safi
== SAFI_ENCAP
)
10548 return "IPv6 Encap";
10554 afi_safi_json (afi_t afi
, safi_t safi
)
10556 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
10557 return "IPv4Unicast";
10558 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
10559 return "IPv4Multicast";
10560 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
10562 else if (afi
== AFI_IP
&& safi
== SAFI_ENCAP
)
10563 return "IPv4Encap";
10564 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
10565 return "IPv6Unicast";
10566 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
10567 return "IPv6Multicast";
10568 else if (afi
== AFI_IP6
&& safi
== SAFI_MPLS_VPN
)
10570 else if (afi
== AFI_IP6
&& safi
== SAFI_ENCAP
)
10571 return "IPv6Encap";
10576 /* Show BGP peer's information. */
10584 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
,
10585 u_int16_t adv_smcap
, u_int16_t adv_rmcap
, u_int16_t rcv_smcap
,
10586 u_int16_t rcv_rmcap
, u_char use_json
, json_object
*json_pref
)
10589 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
10590 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
10594 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) && CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
10595 json_object_string_add(json_pref
, "sendMode", "advertisedAndReceived");
10596 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
10597 json_object_string_add(json_pref
, "sendMode", "advertised");
10598 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
10599 json_object_string_add(json_pref
, "sendMode", "received");
10603 vty_out (vty
, " Send-mode: ");
10604 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
10605 vty_out (vty
, "advertised");
10606 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
10607 vty_out (vty
, "%sreceived",
10608 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
10610 vty_out (vty
, "%s", VTY_NEWLINE
);
10615 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
10616 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
10620 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) && CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
10621 json_object_string_add(json_pref
, "recvMode", "advertisedAndReceived");
10622 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
10623 json_object_string_add(json_pref
, "recvMode", "advertised");
10624 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
10625 json_object_string_add(json_pref
, "recvMode", "received");
10629 vty_out (vty
, " Receive-mode: ");
10630 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
10631 vty_out (vty
, "advertised");
10632 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
10633 vty_out (vty
, "%sreceived",
10634 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
10636 vty_out (vty
, "%s", VTY_NEWLINE
);
10642 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
,
10643 u_char use_json
, json_object
*json_neigh
)
10645 struct bgp_filter
*filter
;
10646 struct peer_af
*paf
;
10647 char orf_pfx_name
[BUFSIZ
];
10649 json_object
*json_af
= NULL
;
10650 json_object
*json_prefA
= NULL
;
10651 json_object
*json_prefB
= NULL
;
10652 json_object
*json_addr
= NULL
;
10656 json_addr
= json_object_new_object();
10657 json_af
= json_object_new_object();
10658 filter
= &p
->filter
[afi
][safi
];
10660 if (peer_group_active(p
))
10661 json_object_string_add(json_addr
, "peerGroupMember", p
->group
->name
);
10663 paf
= peer_af_find(p
, afi
, safi
);
10664 if (paf
&& PAF_SUBGRP(paf
))
10666 json_object_int_add(json_addr
, "updateGroupId", PAF_UPDGRP(paf
)->id
);
10667 json_object_int_add(json_addr
, "subGroupId", PAF_SUBGRP(paf
)->id
);
10668 json_object_int_add(json_addr
, "packetQueueLength", bpacket_queue_virtual_length(paf
));
10671 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10672 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
10673 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10674 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
10676 json_object_int_add(json_af
, "orfType", ORF_TYPE_PREFIX
);
10677 json_prefA
= json_object_new_object();
10678 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
10679 PEER_CAP_ORF_PREFIX_SM_ADV
,
10680 PEER_CAP_ORF_PREFIX_RM_ADV
,
10681 PEER_CAP_ORF_PREFIX_SM_RCV
,
10682 PEER_CAP_ORF_PREFIX_RM_RCV
, use_json
, json_prefA
);
10683 json_object_object_add(json_af
, "orfPrefixList", json_prefA
);
10686 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10687 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
10688 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10689 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
10691 json_object_int_add(json_af
, "orfOldType", ORF_TYPE_PREFIX_OLD
);
10692 json_prefB
= json_object_new_object();
10693 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
10694 PEER_CAP_ORF_PREFIX_SM_ADV
,
10695 PEER_CAP_ORF_PREFIX_RM_ADV
,
10696 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
10697 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
, use_json
, json_prefB
);
10698 json_object_object_add(json_af
, "orfOldPrefixList", json_prefB
);
10701 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10702 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
10703 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
10704 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10705 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
10706 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
10707 json_object_object_add(json_addr
, "afDependentCap", json_af
);
10709 json_object_free(json_af
);
10711 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
10712 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
, use_json
);
10714 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
10717 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
10718 json_object_boolean_true_add(json_neigh
, "orfSent");
10720 json_object_int_add(json_addr
, "orfRecvCounter", orf_pfx_count
);
10722 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
10723 json_object_string_add(json_addr
, "orfFirstUpdate", "deferredUntilORFOrRouteRefreshRecvd");
10725 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
10726 json_object_boolean_true_add(json_addr
, "routeReflectorClient");
10727 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
10728 json_object_boolean_true_add(json_addr
, "routeServerClient");
10729 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
10730 json_object_boolean_true_add(json_addr
, "inboundSoftConfigPermit");
10732 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE
))
10733 json_object_boolean_true_add(json_addr
, "privateAsNumsAllReplacedInUpdatesToNbr");
10734 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
))
10735 json_object_boolean_true_add(json_addr
, "privateAsNumsReplacedInUpdatesToNbr");
10736 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_ALL
))
10737 json_object_boolean_true_add(json_addr
, "privateAsNumsAllRemovedInUpdatesToNbr");
10738 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
10739 json_object_boolean_true_add(json_addr
, "privateAsNumsRemovedInUpdatesToNbr");
10741 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_ADDPATH_TX_ALL_PATHS
))
10742 json_object_boolean_true_add(json_addr
, "addpathTxAllPaths");
10744 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS
))
10745 json_object_boolean_true_add(json_addr
, "addpathTxBestpathPerAS");
10747 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_OVERRIDE
))
10748 json_object_string_add(json_addr
, "overrideASNsInOutboundUpdates", "ifAspathEqualRemoteAs");
10750 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
) ||
10751 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_FORCE_NEXTHOP_SELF
))
10752 json_object_boolean_true_add(json_addr
, "routerAlwaysNextHop");
10753 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
10754 json_object_boolean_true_add(json_addr
, "unchangedAsPathPropogatedToNbr");
10755 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
10756 json_object_boolean_true_add(json_addr
, "unchangedNextHopPropogatedToNbr");
10757 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
10758 json_object_boolean_true_add(json_addr
, "unchangedMedPropogatedToNbr");
10759 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
10760 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10762 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
10763 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10764 json_object_string_add(json_addr
, "commAttriSentToNbr", "extendedAndStandard");
10765 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10766 json_object_string_add(json_addr
, "commAttriSentToNbr", "extended");
10768 json_object_string_add(json_addr
, "commAttriSentToNbr", "standard");
10770 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
10772 if (p
->default_rmap
[afi
][safi
].name
)
10773 json_object_string_add(json_addr
, "defaultRouteMap", p
->default_rmap
[afi
][safi
].name
);
10775 if (paf
&& PAF_SUBGRP(paf
) && CHECK_FLAG(PAF_SUBGRP(paf
)->sflags
, SUBGRP_STATUS_DEFAULT_ORIGINATE
))
10776 json_object_boolean_true_add(json_addr
, "defaultSent");
10778 json_object_boolean_true_add(json_addr
, "defaultNotSent");
10781 if (filter
->plist
[FILTER_IN
].name
10782 || filter
->dlist
[FILTER_IN
].name
10783 || filter
->aslist
[FILTER_IN
].name
10784 || filter
->map
[RMAP_IN
].name
)
10785 json_object_boolean_true_add(json_addr
, "inboundPathPolicyConfig");
10786 if (filter
->plist
[FILTER_OUT
].name
10787 || filter
->dlist
[FILTER_OUT
].name
10788 || filter
->aslist
[FILTER_OUT
].name
10789 || filter
->map
[RMAP_OUT
].name
10790 || filter
->usmap
.name
)
10791 json_object_boolean_true_add(json_addr
, "outboundPathPolicyConfig");
10794 if (filter
->plist
[FILTER_IN
].name
)
10795 json_object_string_add(json_addr
, "incomingUpdatePrefixFilterList", filter
->plist
[FILTER_IN
].name
);
10796 if (filter
->plist
[FILTER_OUT
].name
)
10797 json_object_string_add(json_addr
, "outgoingUpdatePrefixFilterList", filter
->plist
[FILTER_OUT
].name
);
10799 /* distribute-list */
10800 if (filter
->dlist
[FILTER_IN
].name
)
10801 json_object_string_add(json_addr
, "incomingUpdateNetworkFilterList", filter
->dlist
[FILTER_IN
].name
);
10802 if (filter
->dlist
[FILTER_OUT
].name
)
10803 json_object_string_add(json_addr
, "outgoingUpdateNetworkFilterList", filter
->dlist
[FILTER_OUT
].name
);
10806 if (filter
->aslist
[FILTER_IN
].name
)
10807 json_object_string_add(json_addr
, "incomingUpdateAsPathFilterList", filter
->aslist
[FILTER_IN
].name
);
10808 if (filter
->aslist
[FILTER_OUT
].name
)
10809 json_object_string_add(json_addr
, "outgoingUpdateAsPathFilterList", filter
->aslist
[FILTER_OUT
].name
);
10812 if (filter
->map
[RMAP_IN
].name
)
10813 json_object_string_add(json_addr
, "routeMapForIncomingAdvertisements", filter
->map
[RMAP_IN
].name
);
10814 if (filter
->map
[RMAP_OUT
].name
)
10815 json_object_string_add(json_addr
, "routeMapForOutgoingAdvertisements", filter
->map
[RMAP_OUT
].name
);
10817 /* unsuppress-map */
10818 if (filter
->usmap
.name
)
10819 json_object_string_add(json_addr
, "selectiveUnsuppressRouteMap", filter
->usmap
.name
);
10821 /* Receive prefix count */
10822 json_object_int_add(json_addr
, "acceptedPrefixCounter", p
->pcount
[afi
][safi
]);
10824 /* Maximum prefix */
10825 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
10827 json_object_int_add(json_addr
, "prefixAllowedMax", p
->pmax
[afi
][safi
]);
10828 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
))
10829 json_object_boolean_true_add(json_addr
, "prefixAllowedMaxWarning");
10830 json_object_int_add(json_addr
, "prefixAllowedWarningThresh", p
->pmax_threshold
[afi
][safi
]);
10831 if (p
->pmax_restart
[afi
][safi
])
10832 json_object_int_add(json_addr
, "prefixAllowedRestartIntervalMsecs", p
->pmax_restart
[afi
][safi
] * 60000);
10834 json_object_object_add(json_neigh
, afi_safi_print (afi
, safi
), json_addr
);
10839 filter
= &p
->filter
[afi
][safi
];
10841 vty_out (vty
, " For address family: %s%s", afi_safi_print (afi
, safi
),
10844 if (peer_group_active(p
))
10845 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
10847 paf
= peer_af_find(p
, afi
, safi
);
10848 if (paf
&& PAF_SUBGRP(paf
))
10850 vty_out (vty
, " Update group %" PRIu64
", subgroup %" PRIu64
"%s",
10851 PAF_UPDGRP(paf
)->id
, PAF_SUBGRP(paf
)->id
, VTY_NEWLINE
);
10852 vty_out (vty
, " Packet Queue length %d%s",
10853 bpacket_queue_virtual_length(paf
), VTY_NEWLINE
);
10857 vty_out(vty
, " Not part of any update group%s", VTY_NEWLINE
);
10859 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10860 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
10861 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
10862 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10863 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
10864 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
10865 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
10867 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10868 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
10869 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10870 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
10872 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
10873 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
10874 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
10875 PEER_CAP_ORF_PREFIX_SM_ADV
,
10876 PEER_CAP_ORF_PREFIX_RM_ADV
,
10877 PEER_CAP_ORF_PREFIX_SM_RCV
,
10878 PEER_CAP_ORF_PREFIX_RM_RCV
, use_json
, NULL
);
10880 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
10881 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
10882 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
10883 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
10885 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
10886 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
10887 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
10888 PEER_CAP_ORF_PREFIX_SM_ADV
,
10889 PEER_CAP_ORF_PREFIX_RM_ADV
,
10890 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
10891 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
, use_json
, NULL
);
10894 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
10895 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
, use_json
);
10897 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
10900 vty_out (vty
, " Outbound Route Filter (ORF):");
10901 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
10902 vty_out (vty
, " sent;");
10904 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
10905 vty_out (vty
, "%s", VTY_NEWLINE
);
10907 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
10908 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
10910 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
10911 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
10912 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
10913 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
10914 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
10915 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
10917 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_ALL_REPLACE
))
10918 vty_out (vty
, " Private AS numbers (all) replaced in updates to this neighbor%s", VTY_NEWLINE
);
10919 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
))
10920 vty_out (vty
, " Private AS numbers replaced in updates to this neighbor%s", VTY_NEWLINE
);
10921 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_ALL
))
10922 vty_out (vty
, " Private AS numbers (all) removed in updates to this neighbor%s", VTY_NEWLINE
);
10923 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
10924 vty_out (vty
, " Private AS numbers removed in updates to this neighbor%s", VTY_NEWLINE
);
10926 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_ADDPATH_TX_ALL_PATHS
))
10927 vty_out (vty
, " Advertise all paths via addpath%s", VTY_NEWLINE
);
10929 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS
))
10930 vty_out (vty
, " Advertise bestpath per AS via addpath%s", VTY_NEWLINE
);
10932 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_OVERRIDE
))
10933 vty_out (vty
, " Override ASNs in outbound updates if aspath equals remote-as%s", VTY_NEWLINE
);
10935 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
) ||
10936 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_FORCE_NEXTHOP_SELF
))
10937 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
10938 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
10939 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
10940 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
10941 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
10942 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
10943 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
10944 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
10945 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10947 vty_out (vty
, " Community attribute sent to this neighbor");
10948 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
10949 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10950 vty_out (vty
, "(both)%s", VTY_NEWLINE
);
10951 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
10952 vty_out (vty
, "(extended)%s", VTY_NEWLINE
);
10954 vty_out (vty
, "(standard)%s", VTY_NEWLINE
);
10956 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
10958 vty_out (vty
, " Default information originate,");
10960 if (p
->default_rmap
[afi
][safi
].name
)
10961 vty_out (vty
, " default route-map %s%s,",
10962 p
->default_rmap
[afi
][safi
].map
? "*" : "",
10963 p
->default_rmap
[afi
][safi
].name
);
10964 if (paf
&& PAF_SUBGRP(paf
) && CHECK_FLAG(PAF_SUBGRP(paf
)->sflags
, SUBGRP_STATUS_DEFAULT_ORIGINATE
))
10965 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
10967 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
10970 if (filter
->plist
[FILTER_IN
].name
10971 || filter
->dlist
[FILTER_IN
].name
10972 || filter
->aslist
[FILTER_IN
].name
10973 || filter
->map
[RMAP_IN
].name
)
10974 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
10975 if (filter
->plist
[FILTER_OUT
].name
10976 || filter
->dlist
[FILTER_OUT
].name
10977 || filter
->aslist
[FILTER_OUT
].name
10978 || filter
->map
[RMAP_OUT
].name
10979 || filter
->usmap
.name
)
10980 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
10983 if (filter
->plist
[FILTER_IN
].name
)
10984 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
10985 filter
->plist
[FILTER_IN
].plist
? "*" : "",
10986 filter
->plist
[FILTER_IN
].name
,
10988 if (filter
->plist
[FILTER_OUT
].name
)
10989 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
10990 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
10991 filter
->plist
[FILTER_OUT
].name
,
10994 /* distribute-list */
10995 if (filter
->dlist
[FILTER_IN
].name
)
10996 vty_out (vty
, " Incoming update network filter list is %s%s%s",
10997 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
10998 filter
->dlist
[FILTER_IN
].name
,
11000 if (filter
->dlist
[FILTER_OUT
].name
)
11001 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
11002 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
11003 filter
->dlist
[FILTER_OUT
].name
,
11007 if (filter
->aslist
[FILTER_IN
].name
)
11008 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
11009 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
11010 filter
->aslist
[FILTER_IN
].name
,
11012 if (filter
->aslist
[FILTER_OUT
].name
)
11013 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
11014 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
11015 filter
->aslist
[FILTER_OUT
].name
,
11019 if (filter
->map
[RMAP_IN
].name
)
11020 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
11021 filter
->map
[RMAP_IN
].map
? "*" : "",
11022 filter
->map
[RMAP_IN
].name
,
11024 if (filter
->map
[RMAP_OUT
].name
)
11025 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
11026 filter
->map
[RMAP_OUT
].map
? "*" : "",
11027 filter
->map
[RMAP_OUT
].name
,
11030 /* unsuppress-map */
11031 if (filter
->usmap
.name
)
11032 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
11033 filter
->usmap
.map
? "*" : "",
11034 filter
->usmap
.name
, VTY_NEWLINE
);
11036 /* Receive prefix count */
11037 vty_out (vty
, " %ld accepted prefixes%s", p
->pcount
[afi
][safi
], VTY_NEWLINE
);
11039 /* Maximum prefix */
11040 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
11042 vty_out (vty
, " Maximum prefixes allowed %ld%s%s", p
->pmax
[afi
][safi
],
11043 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
11044 ? " (warning-only)" : "", VTY_NEWLINE
);
11045 vty_out (vty
, " Threshold for warning message %d%%",
11046 p
->pmax_threshold
[afi
][safi
]);
11047 if (p
->pmax_restart
[afi
][safi
])
11048 vty_out (vty
, ", restart interval %d min", p
->pmax_restart
[afi
][safi
]);
11049 vty_out (vty
, "%s", VTY_NEWLINE
);
11052 vty_out (vty
, "%s", VTY_NEWLINE
);
11057 bgp_show_peer (struct vty
*vty
, struct peer
*p
, u_char use_json
, json_object
*json
)
11060 char buf1
[PREFIX2STR_BUFFER
], buf
[SU_ADDRSTRLEN
];
11061 char timebuf
[BGP_UPTIME_LEN
];
11063 const char *subcode_str
;
11064 const char *code_str
;
11069 json_object
*json_neigh
= NULL
;
11074 json_neigh
= json_object_new_object();
11078 if (p
->conf_if
) /* Configured interface name. */
11079 vty_out (vty
, "BGP neighbor on %s: %s, ", p
->conf_if
,
11080 BGP_PEER_SU_UNSPEC(p
) ? "None" :
11081 sockunion2str (&p
->su
, buf
, SU_ADDRSTRLEN
));
11082 else /* Configured IP address. */
11084 memset(dn_flag
, '\0', sizeof(dn_flag
));
11085 if (peer_dynamic_neighbor(p
))
11088 vty_out (vty
, "BGP neighbor is %s%s, ", dn_flag
, p
->host
);
11094 if (p
->conf_if
&& BGP_PEER_SU_UNSPEC(p
))
11095 json_object_string_add(json_neigh
, "bgpNeighborAddr", "none");
11096 else if (p
->conf_if
&& !BGP_PEER_SU_UNSPEC(p
))
11097 json_object_string_add(json_neigh
, "bgpNeighborAddr", sockunion2str (&p
->su
, buf
, SU_ADDRSTRLEN
));
11099 json_object_int_add(json_neigh
, "remoteAs", p
->as
);
11101 if (p
->change_local_as
)
11102 json_object_int_add(json_neigh
, "localAs", p
->change_local_as
);
11104 json_object_int_add(json_neigh
, "localAs", p
->local_as
);
11106 if (CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
))
11107 json_object_boolean_true_add(json_neigh
, "localAsNoPrepend");
11109 if (CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_REPLACE_AS
))
11110 json_object_boolean_true_add(json_neigh
, "localAsReplaceAs");
11114 if ((p
->as_type
== AS_SPECIFIED
) ||
11115 (p
->as_type
== AS_EXTERNAL
) ||
11116 (p
->as_type
== AS_INTERNAL
))
11117 vty_out (vty
, "remote AS %u, ", p
->as
);
11119 vty_out (vty
, "remote AS Unspecified, ");
11120 vty_out (vty
, "local AS %u%s%s, ",
11121 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
11122 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
11123 " no-prepend" : "",
11124 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_REPLACE_AS
) ?
11125 " replace-as" : "");
11127 /* peer type internal, external, confed-internal or confed-external */
11128 if (p
->as
== p
->local_as
)
11132 if (CHECK_FLAG(bgp
->config
, BGP_CONFIG_CONFEDERATION
))
11133 json_object_boolean_true_add(json_neigh
, "nbrConfedInternalLink");
11135 json_object_boolean_true_add(json_neigh
, "nbrInternalLink");
11139 if (CHECK_FLAG(bgp
->config
, BGP_CONFIG_CONFEDERATION
))
11140 vty_out (vty
, "confed-internal link%s", VTY_NEWLINE
);
11142 vty_out (vty
, "internal link%s", VTY_NEWLINE
);
11149 if (CHECK_FLAG(bgp
->config
, BGP_CONFIG_CONFEDERATION
))
11150 json_object_boolean_true_add(json_neigh
, "nbrConfedExternalLink");
11152 json_object_boolean_true_add(json_neigh
, "nbrExternalLink");
11156 if (bgp_confederation_peers_check(bgp
, p
->as
))
11157 vty_out (vty
, "confed-external link%s", VTY_NEWLINE
);
11159 vty_out (vty
, "external link%s", VTY_NEWLINE
);
11167 json_object_string_add(json_neigh
, "nbrDesc", p
->desc
);
11169 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
11177 json_object_string_add(json_neigh
, "hostname", p
->hostname
);
11180 json_object_string_add(json_neigh
, "domainname", p
->domainname
);
11184 if (p
->domainname
&& (p
->domainname
[0] != '\0'))
11185 vty_out(vty
, "Hostname: %s.%s%s", p
->hostname
, p
->domainname
,
11188 vty_out(vty
, "Hostname: %s%s", p
->hostname
, VTY_NEWLINE
);
11198 json_object_string_add(json_neigh
, "peerGroup", p
->group
->name
);
11202 struct prefix prefix
, *range
= NULL
;
11204 sockunion2hostprefix(&(p
->su
), &prefix
);
11205 range
= peer_group_lookup_dynamic_neighbor_range (p
->group
, &prefix
);
11209 prefix2str(range
, buf1
, sizeof(buf1
));
11210 json_object_string_add(json_neigh
, "peerSubnetRangeGroup", buf1
);
11216 vty_out (vty
, " Member of peer-group %s for session parameters%s",
11217 p
->group
->name
, VTY_NEWLINE
);
11221 struct prefix prefix
, *range
= NULL
;
11223 sockunion2hostprefix(&(p
->su
), &prefix
);
11224 range
= peer_group_lookup_dynamic_neighbor_range (p
->group
, &prefix
);
11228 prefix2str(range
, buf1
, sizeof(buf1
));
11229 vty_out (vty
, " Belongs to the subnet range group: %s%s", buf1
, VTY_NEWLINE
);
11237 /* Administrative shutdown. */
11238 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
11239 json_object_boolean_true_add(json_neigh
, "adminShutDown");
11242 json_object_int_add(json_neigh
, "bgpVersion", 4);
11243 json_object_string_add(json_neigh
, "remoteRouterId", inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
));
11245 /* Confederation */
11246 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
) && bgp_confederation_peers_check (bgp
, p
->as
))
11247 json_object_boolean_true_add(json_neigh
, "nbrCommonAdmin");
11250 json_object_string_add(json_neigh
, "bgpState", LOOKUP (bgp_status_msg
, p
->status
));
11252 if (p
->status
== Established
)
11257 uptime
= bgp_clock();
11258 uptime
-= p
->uptime
;
11259 tm
= gmtime(&uptime
);
11261 json_object_int_add(json_neigh
, "bgpTimerUp", (tm
->tm_sec
* 1000) + (tm
->tm_min
* 60000) + (tm
->tm_hour
* 3600000));
11264 else if (p
->status
== Active
)
11266 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
11267 json_object_string_add(json_neigh
, "bgpStateIs", "passive");
11268 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
11269 json_object_string_add(json_neigh
, "bgpStateIs", "passiveNSF");
11276 uptime
= bgp_clock();
11277 uptime
-= p
->readtime
;
11278 tm
= gmtime(&uptime
);
11279 json_object_int_add(json_neigh
, "bgpTimerLastRead", (tm
->tm_sec
* 1000) + (tm
->tm_min
* 60000) + (tm
->tm_hour
* 3600000));
11281 uptime
= bgp_clock();
11282 uptime
-= p
->last_write
;
11283 tm
= gmtime(&uptime
);
11284 json_object_int_add(json_neigh
, "bgpTimerLastWrite", (tm
->tm_sec
* 1000) + (tm
->tm_min
* 60000) + (tm
->tm_hour
* 3600000));
11286 uptime
= bgp_clock();
11287 uptime
-= p
->update_time
;
11288 tm
= gmtime(&uptime
);
11289 json_object_int_add(json_neigh
, "bgpInUpdateElapsedTimeMsecs",
11290 (tm
->tm_sec
* 1000) + (tm
->tm_min
* 60000) + (tm
->tm_hour
* 3600000));
11292 /* Configured timer values. */
11293 json_object_int_add(json_neigh
, "bgpTimerHoldTimeMsecs", p
->v_holdtime
* 1000);
11294 json_object_int_add(json_neigh
, "bgpTimerKeepAliveIntervalMsecs", p
->v_keepalive
* 1000);
11296 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
11298 json_object_int_add(json_neigh
, "bgpTimerConfiguredHoldTimeMsecs", p
->holdtime
* 1000);
11299 json_object_int_add(json_neigh
, "bgpTimerConfiguredKeepAliveIntervalMsecs", p
->keepalive
* 1000);
11304 /* Administrative shutdown. */
11305 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
11306 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
11309 vty_out (vty
, " BGP version 4");
11310 vty_out (vty
, ", remote router ID %s%s", inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
11313 /* Confederation */
11314 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
)
11315 && bgp_confederation_peers_check (bgp
, p
->as
))
11316 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
11319 vty_out (vty
, " BGP state = %s", LOOKUP (bgp_status_msg
, p
->status
));
11321 if (p
->status
== Established
)
11322 vty_out (vty
, ", up for %8s", peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
, 0, NULL
));
11324 else if (p
->status
== Active
)
11326 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
11327 vty_out (vty
, " (passive)");
11328 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
11329 vty_out (vty
, " (NSF passive)");
11331 vty_out (vty
, "%s", VTY_NEWLINE
);
11334 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
, 0, NULL
));
11335 vty_out (vty
, ", Last write %s%s",
11336 peer_uptime (p
->last_write
, timebuf
, BGP_UPTIME_LEN
, 0, NULL
), VTY_NEWLINE
);
11338 /* Configured timer values. */
11339 vty_out (vty
, " Hold time is %d, keepalive interval is %d seconds%s",
11340 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
11341 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
11343 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
11344 vty_out (vty
, ", keepalive interval is %d seconds%s",
11345 p
->keepalive
, VTY_NEWLINE
);
11349 if (p
->status
== Established
)
11352 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
11353 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
11354 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
11355 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
11356 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
11357 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
11358 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
11359 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
11360 || p
->afc_adv
[AFI_IP6
][SAFI_MPLS_VPN
]
11361 || p
->afc_recv
[AFI_IP6
][SAFI_MPLS_VPN
]
11362 || p
->afc_adv
[AFI_IP6
][SAFI_ENCAP
]
11363 || p
->afc_recv
[AFI_IP6
][SAFI_ENCAP
]
11364 || p
->afc_adv
[AFI_IP
][SAFI_ENCAP
]
11365 || p
->afc_recv
[AFI_IP
][SAFI_ENCAP
]
11366 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
11367 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
11371 json_object
*json_cap
= NULL
;
11373 json_cap
= json_object_new_object();
11376 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
)
11377 || CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
11379 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
) && CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
11380 json_object_string_add(json_cap
, "4byteAs", "advertisedAndReceived");
11381 else if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
11382 json_object_string_add(json_cap
, "4byteAs", "advertised");
11383 else if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
11384 json_object_string_add(json_cap
, "4byteAs", "received");
11388 if (CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_RCV
)
11389 || CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_ADV
))
11391 json_object
*json_add
= NULL
;
11392 const char *print_store
;
11394 json_add
= json_object_new_object();
11396 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11397 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11399 json_object
*json_sub
= NULL
;
11400 json_sub
= json_object_new_object();
11401 print_store
= afi_safi_print (afi
, safi
);
11403 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ||
11404 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
11406 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
))
11407 json_object_boolean_true_add(json_sub
, "txAdvertisedAndReceived");
11408 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
))
11409 json_object_boolean_true_add(json_sub
, "txAdvertised");
11410 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
11411 json_object_boolean_true_add(json_sub
, "txReceived");
11414 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ||
11415 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11417 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
))
11418 json_object_boolean_true_add(json_sub
, "rxAdvertisedAndReceived");
11419 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
))
11420 json_object_boolean_true_add(json_sub
, "rxAdvertised");
11421 else if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11422 json_object_boolean_true_add(json_sub
, "rxReceived");
11425 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ||
11426 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
) ||
11427 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ||
11428 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11429 json_object_object_add(json_add
, print_store
, json_sub
);
11431 json_object_free(json_sub
);
11434 json_object_object_add(json_cap
, "addPath", json_add
);
11438 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
11439 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
11441 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) && CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
11442 json_object_string_add(json_cap
, "dynamic", "advertisedAndReceived");
11443 else if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
11444 json_object_string_add(json_cap
, "dynamic", "advertised");
11445 else if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
11446 json_object_string_add(json_cap
, "dynamic", "received");
11449 /* Extended nexthop */
11450 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
)
11451 || CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
))
11453 json_object
*json_nxt
= NULL
;
11454 const char *print_store
;
11457 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
) && CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
11458 json_object_string_add(json_cap
, "extendedNexthop", "advertisedAndReceived");
11459 else if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
))
11460 json_object_string_add(json_cap
, "extendedNexthop", "advertised");
11461 else if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
11462 json_object_string_add(json_cap
, "extendedNexthop", "received");
11464 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
11466 json_nxt
= json_object_new_object();
11468 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11470 if (CHECK_FLAG (p
->af_cap
[AFI_IP
][safi
], PEER_CAP_ENHE_AF_RCV
))
11472 print_store
= afi_safi_print (AFI_IP
, safi
);
11473 json_object_string_add(json_nxt
, print_store
, "recieved");
11476 json_object_object_add(json_cap
, "extendedNexthopFamililesByPeer", json_nxt
);
11480 /* Route Refresh */
11481 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
11482 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
11483 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
11485 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
)))
11487 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
))
11488 json_object_string_add(json_cap
, "routeRefresh", "advertisedAndReceivedOldNew");
11491 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
11492 json_object_string_add(json_cap
, "routeRefresh", "advertisedAndReceivedOld");
11494 json_object_string_add(json_cap
, "routeRefresh", "advertisedAndReceivedNew");
11497 else if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
11498 json_object_string_add(json_cap
, "routeRefresh", "advertised");
11499 else if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
) || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
11500 json_object_string_add(json_cap
, "routeRefresh", "received");
11503 /* Multiprotocol Extensions */
11504 json_object
*json_multi
= NULL
;
11505 json_multi
= json_object_new_object();
11507 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11509 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11511 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
11513 json_object
*json_exten
= NULL
;
11514 json_exten
= json_object_new_object();
11516 if (p
->afc_adv
[afi
][safi
] && p
->afc_recv
[afi
][safi
])
11517 json_object_boolean_true_add(json_exten
, "advertisedAndReceived");
11518 else if (p
->afc_adv
[afi
][safi
])
11519 json_object_boolean_true_add(json_exten
, "advertised");
11520 else if (p
->afc_recv
[afi
][safi
])
11521 json_object_boolean_true_add(json_exten
, "received");
11523 json_object_object_add(json_multi
, afi_safi_print (afi
, safi
), json_exten
);
11527 json_object_object_add(json_cap
, "multiprotocolExtensions", json_multi
);
11529 /* Gracefull Restart */
11530 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
11531 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
11533 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) && CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
11534 json_object_string_add(json_cap
, "gracefulRestart", "advertisedAndReceived");
11535 else if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
11536 json_object_string_add(json_cap
, "gracefulRestartCapability", "advertised");
11537 else if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
11538 json_object_string_add(json_cap
, "gracefulRestartCapability", "received");
11540 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
11542 int restart_af_count
= 0;
11543 json_object
*json_restart
= NULL
;
11544 json_restart
= json_object_new_object();
11546 json_object_int_add(json_cap
, "gracefulRestartRemoteTimerMsecs", p
->v_gr_restart
* 1000);
11548 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11550 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11552 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
11554 json_object
*json_sub
= NULL
;
11555 json_sub
= json_object_new_object();
11557 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
))
11558 json_object_boolean_true_add(json_sub
, "preserved");
11559 restart_af_count
++;
11560 json_object_object_add(json_restart
, afi_safi_print (afi
, safi
), json_sub
);
11564 if (! restart_af_count
)
11566 json_object_string_add(json_cap
, "addressFamiliesByPeer", "none");
11567 json_object_free(json_restart
);
11570 json_object_object_add(json_cap
, "addressFamiliesByPeer", json_restart
);
11573 json_object_object_add(json_neigh
, "neighborCapabilities", json_cap
);
11577 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
11580 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
)
11581 || CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
11583 vty_out (vty
, " 4 Byte AS:");
11584 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
11585 vty_out (vty
, " advertised");
11586 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
11587 vty_out (vty
, " %sreceived",
11588 CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
) ? "and " : "");
11589 vty_out (vty
, "%s", VTY_NEWLINE
);
11593 if (CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_RCV
)
11594 || CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_ADV
))
11596 vty_out (vty
, " AddPath:%s", VTY_NEWLINE
);
11598 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11599 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11601 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ||
11602 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
11604 vty_out (vty
, " %s: TX ", afi_safi_print (afi
, safi
));
11606 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
))
11607 vty_out (vty
, "advertised %s", afi_safi_print (afi
, safi
));
11609 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
11610 vty_out (vty
, "%sreceived", CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ? " and " : "" );
11612 vty_out (vty
, "%s", VTY_NEWLINE
);
11615 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ||
11616 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11618 vty_out (vty
, " %s: RX ", afi_safi_print (afi
, safi
));
11620 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
))
11621 vty_out (vty
, "advertised %s", afi_safi_print (afi
, safi
));
11623 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
11624 vty_out (vty
, "%sreceived", CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ? " and " : "" );
11626 vty_out (vty
, "%s", VTY_NEWLINE
);
11632 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
11633 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
11635 vty_out (vty
, " Dynamic:");
11636 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
11637 vty_out (vty
, " advertised");
11638 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
11639 vty_out (vty
, " %sreceived",
11640 CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) ? "and " : "");
11641 vty_out (vty
, "%s", VTY_NEWLINE
);
11644 /* Extended nexthop */
11645 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
)
11646 || CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
))
11648 vty_out (vty
, " Extended nexthop:");
11649 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
))
11650 vty_out (vty
, " advertised");
11651 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
11652 vty_out (vty
, " %sreceived",
11653 CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
) ? "and " : "");
11654 vty_out (vty
, "%s", VTY_NEWLINE
);
11656 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
11658 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
11659 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11660 if (CHECK_FLAG (p
->af_cap
[AFI_IP
][safi
], PEER_CAP_ENHE_AF_RCV
))
11661 vty_out (vty
, " %s%s",
11662 afi_safi_print (AFI_IP
, safi
), VTY_NEWLINE
);
11666 /* Route Refresh */
11667 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
11668 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
11669 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
11671 vty_out (vty
, " Route refresh:");
11672 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
11673 vty_out (vty
, " advertised");
11674 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
11675 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
11676 vty_out (vty
, " %sreceived(%s)",
11677 CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) ? "and " : "",
11678 (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
11679 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)) ?
11680 "old & new" : CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) ? "old" : "new");
11682 vty_out (vty
, "%s", VTY_NEWLINE
);
11685 /* Multiprotocol Extensions */
11686 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11687 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11688 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
11690 vty_out (vty
, " Address family %s:", afi_safi_print (afi
, safi
));
11691 if (p
->afc_adv
[afi
][safi
])
11692 vty_out (vty
, " advertised");
11693 if (p
->afc_recv
[afi
][safi
])
11694 vty_out (vty
, " %sreceived", p
->afc_adv
[afi
][safi
] ? "and " : "");
11695 vty_out (vty
, "%s", VTY_NEWLINE
);
11698 /* Hostname capability */
11699 if (CHECK_FLAG(p
->cap
, PEER_CAP_HOSTNAME_ADV
) ||
11700 CHECK_FLAG(p
->cap
, PEER_CAP_HOSTNAME_RCV
))
11702 vty_out (vty
, " Hostname Capability:");
11703 if (CHECK_FLAG (p
->cap
, PEER_CAP_HOSTNAME_ADV
))
11704 vty_out (vty
, " advertised");
11705 if (CHECK_FLAG (p
->cap
, PEER_CAP_HOSTNAME_RCV
))
11706 vty_out (vty
, " %sreceived",
11707 CHECK_FLAG (p
->cap
, PEER_CAP_HOSTNAME_ADV
) ? "and " : "");
11708 vty_out (vty
, "%s", VTY_NEWLINE
);
11711 /* Gracefull Restart */
11712 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
11713 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
11715 vty_out (vty
, " Graceful Restart Capabilty:");
11716 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
11717 vty_out (vty
, " advertised");
11718 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
11719 vty_out (vty
, " %sreceived",
11720 CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) ? "and " : "");
11721 vty_out (vty
, "%s", VTY_NEWLINE
);
11723 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
11725 int restart_af_count
= 0;
11727 vty_out (vty
, " Remote Restart timer is %d seconds%s",
11728 p
->v_gr_restart
, VTY_NEWLINE
);
11729 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
11731 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11732 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11733 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
11735 vty_out (vty
, "%s%s(%s)", restart_af_count
? ", " : "",
11736 afi_safi_print (afi
, safi
),
11737 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
) ?
11738 "preserved" : "not preserved");
11739 restart_af_count
++;
11741 if (! restart_af_count
)
11742 vty_out (vty
, "none");
11743 vty_out (vty
, "%s", VTY_NEWLINE
);
11750 /* graceful restart information */
11751 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
11755 json_object
*json_grace
= NULL
;
11756 json_object
*json_grace_send
= NULL
;
11757 json_object
*json_grace_recv
= NULL
;
11758 int eor_send_af_count
= 0;
11759 int eor_receive_af_count
= 0;
11763 json_grace
= json_object_new_object();
11764 json_grace_send
= json_object_new_object();
11765 json_grace_recv
= json_object_new_object();
11767 if (p
->status
== Established
)
11769 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11771 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11773 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
11775 json_object_boolean_true_add(json_grace_send
, afi_safi_print (afi
, safi
));
11776 eor_send_af_count
++;
11780 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11782 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11784 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
11786 json_object_boolean_true_add(json_grace_recv
, afi_safi_print (afi
, safi
));
11787 eor_receive_af_count
++;
11793 json_object_object_add(json_grace
, "endOfRibSend", json_grace_send
);
11794 json_object_object_add(json_grace
, "endOfRibRecv", json_grace_recv
);
11796 if (p
->t_gr_restart
)
11797 json_object_int_add(json_grace
, "gracefulRestartTimerMsecs", thread_timer_remain_second (p
->t_gr_restart
) * 1000);
11800 json_object_int_add(json_grace
, "gracefulStalepathTimerMsecs", thread_timer_remain_second (p
->t_gr_stale
) * 1000);
11802 json_object_object_add(json_neigh
, "gracefulRestartInfo", json_grace
);
11806 vty_out (vty
, " Graceful restart informations:%s", VTY_NEWLINE
);
11807 if (p
->status
== Established
)
11809 vty_out (vty
, " End-of-RIB send: ");
11810 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11812 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11814 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
11816 vty_out (vty
, "%s%s", eor_send_af_count
? ", " : "",
11817 afi_safi_print (afi
, safi
));
11818 eor_send_af_count
++;
11822 vty_out (vty
, "%s", VTY_NEWLINE
);
11823 vty_out (vty
, " End-of-RIB received: ");
11824 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11826 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11828 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
11830 vty_out (vty
, "%s%s", eor_receive_af_count
? ", " : "",
11831 afi_safi_print (afi
, safi
));
11832 eor_receive_af_count
++;
11836 vty_out (vty
, "%s", VTY_NEWLINE
);
11839 if (p
->t_gr_restart
)
11840 vty_out (vty
, " The remaining time of restart timer is %ld%s",
11841 thread_timer_remain_second (p
->t_gr_restart
), VTY_NEWLINE
);
11844 vty_out (vty
, " The remaining time of stalepath timer is %ld%s",
11845 thread_timer_remain_second (p
->t_gr_stale
), VTY_NEWLINE
);
11850 json_object
*json_stat
= NULL
;
11851 json_stat
= json_object_new_object();
11852 /* Packet counts. */
11853 json_object_int_add(json_stat
, "depthInq", 0);
11854 json_object_int_add(json_stat
, "depthOutq", (unsigned long) p
->obuf
->count
);
11855 json_object_int_add(json_stat
, "opensSent", p
->open_out
);
11856 json_object_int_add(json_stat
, "opensRecv", p
->open_in
);
11857 json_object_int_add(json_stat
, "notificationsSent", p
->notify_out
);
11858 json_object_int_add(json_stat
, "notificationsRecv", p
->notify_in
);
11859 json_object_int_add(json_stat
, "updatesSent", p
->update_out
);
11860 json_object_int_add(json_stat
, "updatesRecv", p
->update_in
);
11861 json_object_int_add(json_stat
, "keepalivesSent", p
->keepalive_out
);
11862 json_object_int_add(json_stat
, "keepalivesRecv", p
->keepalive_in
);
11863 json_object_int_add(json_stat
, "routeRefreshSent", p
->refresh_out
);
11864 json_object_int_add(json_stat
, "routeRefreshRecv", p
->refresh_in
);
11865 json_object_int_add(json_stat
, "capabilitySent", p
->dynamic_cap_out
);
11866 json_object_int_add(json_stat
, "capabilityRecv", p
->dynamic_cap_in
);
11867 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
);
11868 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
);
11869 json_object_object_add(json_neigh
, "messageStats", json_stat
);
11873 /* Packet counts. */
11874 vty_out (vty
, " Message statistics:%s", VTY_NEWLINE
);
11875 vty_out (vty
, " Inq depth is 0%s", VTY_NEWLINE
);
11876 vty_out (vty
, " Outq depth is %lu%s", (unsigned long) p
->obuf
->count
, VTY_NEWLINE
);
11877 vty_out (vty
, " Sent Rcvd%s", VTY_NEWLINE
);
11878 vty_out (vty
, " Opens: %10d %10d%s", p
->open_out
, p
->open_in
, VTY_NEWLINE
);
11879 vty_out (vty
, " Notifications: %10d %10d%s", p
->notify_out
, p
->notify_in
, VTY_NEWLINE
);
11880 vty_out (vty
, " Updates: %10d %10d%s", p
->update_out
, p
->update_in
, VTY_NEWLINE
);
11881 vty_out (vty
, " Keepalives: %10d %10d%s", p
->keepalive_out
, p
->keepalive_in
, VTY_NEWLINE
);
11882 vty_out (vty
, " Route Refresh: %10d %10d%s", p
->refresh_out
, p
->refresh_in
, VTY_NEWLINE
);
11883 vty_out (vty
, " Capability: %10d %10d%s", p
->dynamic_cap_out
, p
->dynamic_cap_in
, VTY_NEWLINE
);
11884 vty_out (vty
, " Total: %10d %10d%s", p
->open_out
+ p
->notify_out
+
11885 p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
+ p
->dynamic_cap_out
,
11886 p
->open_in
+ p
->notify_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
+
11887 p
->dynamic_cap_in
, VTY_NEWLINE
);
11892 /* advertisement-interval */
11893 json_object_int_add(json_neigh
, "minBtwnAdvertisementRunsTimerMsecs", p
->v_routeadv
* 1000);
11895 /* Update-source. */
11896 if (p
->update_if
|| p
->update_source
)
11899 json_object_string_add(json_neigh
, "updateSource", p
->update_if
);
11900 else if (p
->update_source
)
11901 json_object_string_add(json_neigh
, "updateSource", sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
11906 /* advertisement-interval */
11907 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
11908 p
->v_routeadv
, VTY_NEWLINE
);
11910 /* Update-source. */
11911 if (p
->update_if
|| p
->update_source
)
11913 vty_out (vty
, " Update source is ");
11915 vty_out (vty
, "%s", p
->update_if
);
11916 else if (p
->update_source
)
11917 vty_out (vty
, "%s", sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
11918 vty_out (vty
, "%s", VTY_NEWLINE
);
11921 vty_out (vty
, "%s", VTY_NEWLINE
);
11924 /* Address Family Information */
11925 json_object
*json_hold
= NULL
;
11928 json_hold
= json_object_new_object();
11930 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
11931 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
11932 if (p
->afc
[afi
][safi
])
11933 bgp_show_peer_afi (vty
, p
, afi
, safi
, use_json
, json_hold
);
11937 json_object_object_add(json_neigh
, "addressFamilyInfo", json_hold
);
11938 json_object_int_add(json_neigh
, "connectionsEstablished", p
->established
);
11939 json_object_int_add(json_neigh
, "connectionsDropped", p
->dropped
);
11942 vty_out (vty
, " Connections established %d; dropped %d%s", p
->established
, p
->dropped
,
11945 if (! p
->last_reset
)
11948 json_object_string_add(json_neigh
, "lastReset", "never");
11950 vty_out (vty
, " Last reset never%s", VTY_NEWLINE
);
11959 uptime
= bgp_clock();
11960 uptime
-= p
->resettime
;
11961 tm
= gmtime(&uptime
);
11962 json_object_int_add(json_neigh
, "lastResetTimerMsecs", (tm
->tm_sec
* 1000) + (tm
->tm_min
* 60000) + (tm
->tm_hour
* 3600000));
11963 json_object_string_add(json_neigh
, "lastResetDueTo", peer_down_str
[(int) p
->last_reset
]);
11964 if (p
->last_reset
== PEER_DOWN_NOTIFY_SEND
||
11965 p
->last_reset
== PEER_DOWN_NOTIFY_RECEIVED
)
11967 char errorcodesubcode_hexstr
[5];
11968 char errorcodesubcode_str
[256];
11970 code_str
= bgp_notify_code_str(p
->notify
.code
);
11971 subcode_str
= bgp_notify_subcode_str(p
->notify
.code
, p
->notify
.subcode
);
11973 sprintf(errorcodesubcode_hexstr
, "%02X%02X", p
->notify
.code
, p
->notify
.subcode
);
11974 json_object_string_add(json_neigh
, "lastErrorCodeSubcode", errorcodesubcode_hexstr
);
11975 snprintf(errorcodesubcode_str
, 255, "%s%s", code_str
, subcode_str
);
11976 json_object_string_add(json_neigh
, "lastNotificationReason", errorcodesubcode_str
);
11981 vty_out (vty
, " Last reset %s, ",
11982 peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
, 0, NULL
));
11984 if (p
->last_reset
== PEER_DOWN_NOTIFY_SEND
||
11985 p
->last_reset
== PEER_DOWN_NOTIFY_RECEIVED
)
11987 code_str
= bgp_notify_code_str(p
->notify
.code
);
11988 subcode_str
= bgp_notify_subcode_str(p
->notify
.code
, p
->notify
.subcode
);
11989 vty_out (vty
, "due to NOTIFICATION %s (%s%s)%s",
11990 p
->last_reset
== PEER_DOWN_NOTIFY_SEND
? "sent" : "received",
11991 code_str
, subcode_str
, VTY_NEWLINE
);
11995 vty_out (vty
, "due to %s%s",
11996 peer_down_str
[(int) p
->last_reset
], VTY_NEWLINE
);
11999 if (p
->last_reset_cause_size
)
12001 msg
= p
->last_reset_cause
;
12002 vty_out(vty
, " Message received that caused BGP to send a NOTIFICATION:%s ", VTY_NEWLINE
);
12003 for (i
= 1; i
<= p
->last_reset_cause_size
; i
++)
12005 vty_out(vty
, "%02X", *msg
++);
12007 if (i
!= p
->last_reset_cause_size
)
12011 vty_out(vty
, "%s ", VTY_NEWLINE
);
12013 else if (i
% 4 == 0)
12019 vty_out(vty
, "%s", VTY_NEWLINE
);
12024 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
12027 json_object_boolean_true_add(json_neigh
, "prefixesConfigExceedMax");
12029 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
12031 if (p
->t_pmax_restart
)
12035 json_object_boolean_true_add(json_neigh
, "reducePrefixNumFrom");
12036 json_object_int_add(json_neigh
, "restartInTimerMsec", thread_timer_remain_second (p
->t_pmax_restart
) * 1000);
12039 vty_out (vty
, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
12040 p
->host
, thread_timer_remain_second (p
->t_pmax_restart
),
12046 json_object_boolean_true_add(json_neigh
, "reducePrefixNumAndClearIpBgp");
12048 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
12049 p
->host
, VTY_NEWLINE
);
12053 /* EBGP Multihop and GTSM */
12054 if (p
->sort
!= BGP_PEER_IBGP
)
12058 if (p
->gtsm_hops
> 0)
12059 json_object_int_add(json_neigh
, "externalBgpNbrMaxHopsAway", p
->gtsm_hops
);
12060 else if (p
->ttl
> 1)
12061 json_object_int_add(json_neigh
, "externalBgpNbrMaxHopsAway", p
->ttl
);
12065 if (p
->gtsm_hops
> 0)
12066 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
12067 p
->gtsm_hops
, VTY_NEWLINE
);
12068 else if (p
->ttl
> 1)
12069 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
12070 p
->ttl
, VTY_NEWLINE
);
12075 if (p
->gtsm_hops
> 0)
12078 json_object_int_add(json_neigh
, "internalBgpNbrMaxHopsAway", p
->gtsm_hops
);
12080 vty_out (vty
, " Internal BGP neighbor may be up to %d hops away.%s",
12081 p
->gtsm_hops
, VTY_NEWLINE
);
12085 /* Local address. */
12090 json_object_string_add(json_neigh
, "hostLocal", sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
));
12091 json_object_int_add(json_neigh
, "portLocal", ntohs (p
->su_local
->sin
.sin_port
));
12094 vty_out (vty
, "Local host: %s, Local port: %d%s",
12095 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
12096 ntohs (p
->su_local
->sin
.sin_port
),
12100 /* Remote address. */
12105 json_object_string_add(json_neigh
, "hostForeign", sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
));
12106 json_object_int_add(json_neigh
, "portForeign", ntohs (p
->su_remote
->sin
.sin_port
));
12109 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
12110 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
12111 ntohs (p
->su_remote
->sin
.sin_port
),
12115 /* Nexthop display. */
12120 json_object_string_add(json_neigh
, "nexthop", inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
));
12121 json_object_string_add(json_neigh
, "nexthopGlobal", inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
));
12122 json_object_string_add(json_neigh
, "nexthopLocal", inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
));
12123 if (p
->shared_network
)
12124 json_object_string_add(json_neigh
, "bgpConnection", "sharedNetwork");
12126 json_object_string_add(json_neigh
, "bgpConnection", "nonSharedNetwork");
12130 vty_out (vty
, "Nexthop: %s%s",
12131 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
12133 vty_out (vty
, "Nexthop global: %s%s",
12134 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
12136 vty_out (vty
, "Nexthop local: %s%s",
12137 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
12139 vty_out (vty
, "BGP connection: %s%s",
12140 p
->shared_network
? "shared network" : "non shared network",
12145 /* Timer information. */
12148 json_object_int_add(json_neigh
, "connectRetryTimer", p
->v_connect
);
12149 if (p
->status
== Established
&& p
->rtt
)
12150 json_object_int_add(json_neigh
, "estimatedRttInMsecs", p
->rtt
);
12152 json_object_int_add(json_neigh
, "nextStartTimerDueInMsecs", thread_timer_remain_second (p
->t_start
) * 1000);
12154 json_object_int_add(json_neigh
, "nextConnectTimerDueInMsecs", thread_timer_remain_second (p
->t_connect
) * 1000);
12157 json_object_int_add(json_neigh
, "mraiInterval", p
->v_routeadv
);
12158 json_object_int_add(json_neigh
, "mraiTimerExpireInMsecs", thread_timer_remain_second (p
->t_routeadv
) * 1000);
12162 json_object_string_add(json_neigh
, "readThread", "on");
12164 json_object_string_add(json_neigh
, "readThread", "off");
12166 json_object_string_add(json_neigh
, "writeThread", "on");
12168 json_object_string_add(json_neigh
, "writeThread", "off");
12172 vty_out (vty
, "BGP Connect Retry Timer in Seconds: %d%s",
12173 p
->v_connect
, VTY_NEWLINE
);
12174 if (p
->status
== Established
&& p
->rtt
)
12175 vty_out (vty
, "Estimated round trip time: %d ms%s",
12176 p
->rtt
, VTY_NEWLINE
);
12178 vty_out (vty
, "Next start timer due in %ld seconds%s",
12179 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
12181 vty_out (vty
, "Next connect timer due in %ld seconds%s",
12182 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
12184 vty_out (vty
, "MRAI (interval %u) timer expires in %ld seconds%s",
12185 p
->v_routeadv
, thread_timer_remain_second (p
->t_routeadv
),
12188 vty_out (vty
, "Read thread: %s Write thread: %s%s",
12189 p
->t_read
? "on" : "off",
12190 p
->t_write
? "on" : "off",
12194 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
12195 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
12196 bgp_capability_vty_out (vty
, p
, use_json
, json_neigh
);
12199 vty_out (vty
, "%s", VTY_NEWLINE
);
12201 /* BFD information. */
12202 bgp_bfd_show_info(vty
, p
, use_json
, json_neigh
);
12206 if (p
->conf_if
) /* Configured interface name. */
12207 json_object_object_add(json
, p
->conf_if
, json_neigh
);
12208 else /* Configured IP address. */
12209 json_object_object_add(json
, p
->host
, json_neigh
);
12214 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
, enum show_type type
,
12215 union sockunion
*su
, const char *conf_if
, u_char use_json
, json_object
*json
)
12217 struct listnode
*node
, *nnode
;
12221 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
12223 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
12229 bgp_show_peer (vty
, peer
, use_json
, json
);
12234 if ((peer
->conf_if
&& !strcmp(peer
->conf_if
, conf_if
)) ||
12235 (peer
->hostname
&& !strcmp(peer
->hostname
, conf_if
)))
12238 bgp_show_peer (vty
, peer
, use_json
, json
);
12243 if (sockunion_same (&peer
->su
, su
))
12246 bgp_show_peer (vty
, peer
, use_json
, json
);
12253 if (type
== show_peer
&& ! find
)
12256 json_object_boolean_true_add(json
, "bgpNoSuchNeighbor");
12258 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
12263 vty_out (vty
, "%s%s", json_object_to_json_string_ext(json
, JSON_C_TO_STRING_PRETTY
), VTY_NEWLINE
);
12264 json_object_free(json
);
12268 vty_out (vty
, "%s", VTY_NEWLINE
);
12271 return CMD_SUCCESS
;
12275 bgp_show_neighbor_vty (struct vty
*vty
, const char *name
,
12276 enum show_type type
, const char *ip_str
, u_char use_json
,
12281 union sockunion su
;
12283 if (use_json
&& (json
== NULL
))
12284 json
= json_object_new_object();
12288 bgp
= bgp_lookup_by_name (name
);
12293 json_object_boolean_true_add(json
, "bgpNoSuchInstance");
12294 vty_out (vty
, "%s%s", json_object_to_json_string_ext(json
, JSON_C_TO_STRING_PRETTY
), VTY_NEWLINE
);
12295 json_object_free(json
);
12298 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
12300 return CMD_WARNING
;
12305 bgp
= bgp_get_default ();
12312 ret
= str2sockunion (ip_str
, &su
);
12314 bgp_show_neighbor (vty
, bgp
, type
, NULL
, ip_str
, use_json
, json
);
12316 bgp_show_neighbor (vty
, bgp
, type
, &su
, NULL
, use_json
, json
);
12320 bgp_show_neighbor (vty
, bgp
, type
, NULL
, NULL
, use_json
, json
);
12324 return CMD_SUCCESS
;
12328 bgp_show_all_instances_neighbors_vty (struct vty
*vty
, u_char use_json
)
12330 struct listnode
*node
, *nnode
;
12332 json_object
*json
= NULL
;
12336 vty_out (vty
, "{%s", VTY_NEWLINE
);
12338 for (ALL_LIST_ELEMENTS (bm
->bgp
, node
, nnode
, bgp
))
12342 if (!(json
= json_object_new_object()))
12344 zlog_err("Unable to allocate memory for JSON object");
12346 "{\"error\": {\"message:\": \"Unable to allocate memory for JSON object\"}}}%s",
12351 json_object_int_add(json
, "vrfId",
12352 (bgp
->vrf_id
== VRF_UNKNOWN
)
12353 ? -1 : bgp
->vrf_id
);
12354 json_object_string_add(json
, "vrfName",
12355 (bgp
->inst_type
== BGP_INSTANCE_TYPE_DEFAULT
)
12356 ? "Default" : bgp
->name
);
12359 vty_out (vty
, ",%s", VTY_NEWLINE
);
12363 vty_out(vty
, "\"%s\":", (bgp
->inst_type
== BGP_INSTANCE_TYPE_DEFAULT
)
12364 ? "Default" : bgp
->name
);
12368 vty_out (vty
, "%sInstance %s:%s",
12370 (bgp
->inst_type
== BGP_INSTANCE_TYPE_DEFAULT
)
12371 ? "Default" : bgp
->name
,
12374 bgp_show_neighbor (vty
, bgp
, show_all
, NULL
, NULL
, use_json
, json
);
12378 vty_out (vty
, "}%s", VTY_NEWLINE
);
12381 /* "show ip bgp neighbors" commands. */
12382 DEFUN (show_ip_bgp_neighbors
,
12383 show_ip_bgp_neighbors_cmd
,
12384 "show ip bgp neighbors {json}",
12388 "Detailed information on TCP and BGP neighbor connections\n"
12389 "JavaScript Object Notation\n")
12391 u_char uj
= use_json(argc
, argv
);
12393 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
, uj
, NULL
);
12396 ALIAS (show_ip_bgp_neighbors
,
12397 show_ip_bgp_ipv4_neighbors_cmd
,
12398 "show ip bgp ipv4 "BGP_SAFI_CMD_STR
" neighbors {json}",
12404 "Detailed information on TCP and BGP neighbor connections\n"
12405 "JavaScript Object Notation\n")
12407 ALIAS (show_ip_bgp_neighbors
,
12408 show_bgp_neighbors_cmd
,
12409 "show bgp neighbors {json}",
12412 "Detailed information on TCP and BGP neighbor connections\n"
12413 "JavaScript Object Notation\n")
12415 ALIAS (show_ip_bgp_neighbors
,
12416 show_bgp_ipv6_neighbors_cmd
,
12417 "show bgp ipv6 neighbors {json}",
12421 "Detailed information on TCP and BGP neighbor connections\n"
12422 "JavaScript Object Notation\n")
12424 DEFUN (show_ip_bgp_neighbors_peer
,
12425 show_ip_bgp_neighbors_peer_cmd
,
12426 "show ip bgp neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12430 "Detailed information on TCP and BGP neighbor connections\n"
12431 "Neighbor to display information about\n"
12432 "Neighbor to display information about\n"
12433 "Neighbor on bgp configured interface\n"
12434 "JavaScript Object Notation\n")
12436 u_char uj
= use_json(argc
, argv
);
12438 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 2], uj
, NULL
);
12441 ALIAS (show_ip_bgp_neighbors_peer
,
12442 show_ip_bgp_ipv4_neighbors_peer_cmd
,
12443 "show ip bgp ipv4 "BGP_SAFI_CMD_STR
" neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12449 "Detailed information on TCP and BGP neighbor connections\n"
12450 "Neighbor to display information about\n"
12451 "Neighbor to display information about\n"
12452 "Neighbor on bgp configured interface\n"
12453 "JavaScript Object Notation\n")
12455 ALIAS (show_ip_bgp_neighbors_peer
,
12456 show_bgp_neighbors_peer_cmd
,
12457 "show bgp neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12460 "Detailed information on TCP and BGP neighbor connections\n"
12461 "Neighbor to display information about\n"
12462 "Neighbor to display information about\n"
12463 "Neighbor on bgp configured interface\n"
12464 "JavaScript Object Notation\n")
12466 ALIAS (show_ip_bgp_neighbors_peer
,
12467 show_bgp_ipv6_neighbors_peer_cmd
,
12468 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12472 "Detailed information on TCP and BGP neighbor connections\n"
12473 "Neighbor to display information about\n"
12474 "Neighbor to display information about\n"
12475 "Neighbor on bgp configured interface\n"
12476 "JavaScript Object Notation\n")
12478 DEFUN (show_ip_bgp_instance_neighbors
,
12479 show_ip_bgp_instance_neighbors_cmd
,
12480 "show ip bgp " BGP_INSTANCE_CMD
" neighbors {json}",
12484 BGP_INSTANCE_HELP_STR
12485 "Detailed information on TCP and BGP neighbor connections\n"
12486 "JavaScript Object Notation\n")
12488 u_char uj
= use_json(argc
, argv
);
12490 return bgp_show_neighbor_vty (vty
, argv
[1], show_all
, NULL
, uj
, NULL
);
12493 DEFUN (show_ip_bgp_instance_all_neighbors
,
12494 show_ip_bgp_instance_all_neighbors_cmd
,
12495 "show ip bgp " BGP_INSTANCE_ALL_CMD
" neighbors {json}",
12499 BGP_INSTANCE_ALL_HELP_STR
12500 "Detailed information on TCP and BGP neighbor connections\n"
12501 "JavaScript Object Notation\n")
12503 u_char uj
= use_json(argc
, argv
);
12505 bgp_show_all_instances_neighbors_vty (vty
, uj
);
12506 return CMD_SUCCESS
;
12509 ALIAS (show_ip_bgp_instance_neighbors
,
12510 show_bgp_instance_neighbors_cmd
,
12511 "show bgp " BGP_INSTANCE_CMD
" neighbors {json}",
12514 BGP_INSTANCE_HELP_STR
12515 "Detailed information on TCP and BGP neighbor connections\n"
12516 "JavaScript Object Notation\n")
12518 ALIAS (show_ip_bgp_instance_neighbors
,
12519 show_bgp_instance_ipv6_neighbors_cmd
,
12520 "show bgp " BGP_INSTANCE_CMD
" ipv6 neighbors {json}",
12523 BGP_INSTANCE_HELP_STR
12525 "Detailed information on TCP and BGP neighbor connections\n"
12526 "JavaScript Object Notation\n")
12528 DEFUN (show_ip_bgp_instance_neighbors_peer
,
12529 show_ip_bgp_instance_neighbors_peer_cmd
,
12530 "show ip bgp " BGP_INSTANCE_CMD
" neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12534 BGP_INSTANCE_HELP_STR
12535 "Detailed information on TCP and BGP neighbor connections\n"
12536 "Neighbor to display information about\n"
12537 "Neighbor to display information about\n"
12538 "Neighbor on bgp configured interface\n"
12539 "JavaScript Object Notation\n")
12541 u_char uj
= use_json(argc
, argv
);
12543 return bgp_show_neighbor_vty (vty
, argv
[1], show_peer
, argv
[2], uj
, NULL
);
12546 ALIAS (show_ip_bgp_instance_neighbors_peer
,
12547 show_bgp_instance_neighbors_peer_cmd
,
12548 "show bgp " BGP_INSTANCE_CMD
" neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12551 BGP_INSTANCE_HELP_STR
12552 "Detailed information on TCP and BGP neighbor connections\n"
12553 "Neighbor to display information about\n"
12554 "Neighbor to display information about\n"
12555 "Neighbor on bgp configured interface\n"
12556 "JavaScript Object Notation\n")
12558 ALIAS (show_ip_bgp_instance_neighbors_peer
,
12559 show_bgp_instance_ipv6_neighbors_peer_cmd
,
12560 "show bgp " BGP_INSTANCE_CMD
" ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
12563 BGP_INSTANCE_HELP_STR
12565 "Detailed information on TCP and BGP neighbor connections\n"
12566 "Neighbor to display information about\n"
12567 "Neighbor to display information about\n"
12568 "Neighbor on bgp configured interface\n"
12569 "JavaScript Object Notation\n")
12571 /* Show BGP's AS paths internal data. There are both `show ip bgp
12572 paths' and `show ip mbgp paths'. Those functions results are the
12574 DEFUN (show_ip_bgp_paths
,
12575 show_ip_bgp_paths_cmd
,
12576 "show ip bgp paths",
12580 "Path information\n")
12582 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
12583 aspath_print_all_vty (vty
);
12584 return CMD_SUCCESS
;
12587 DEFUN (show_ip_bgp_ipv4_paths
,
12588 show_ip_bgp_ipv4_paths_cmd
,
12589 "show ip bgp ipv4 "BGP_SAFI_CMD_STR
" paths",
12595 "Path information\n")
12597 vty_out (vty
, "Address Refcnt Path\r\n");
12598 aspath_print_all_vty (vty
);
12600 return CMD_SUCCESS
;
12606 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
12608 struct community
*com
;
12610 com
= (struct community
*) backet
->data
;
12611 vty_out (vty
, "[%p] (%ld) %s%s", (void *)backet
, com
->refcnt
,
12612 community_str (com
), VTY_NEWLINE
);
12615 /* Show BGP's community internal data. */
12616 DEFUN (show_ip_bgp_community_info
,
12617 show_ip_bgp_community_info_cmd
,
12618 "show ip bgp community-info",
12622 "List all bgp community information\n")
12624 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
12626 hash_iterate (community_hash (),
12627 (void (*) (struct hash_backet
*, void *))
12628 community_show_all_iterator
,
12631 return CMD_SUCCESS
;
12634 DEFUN (show_ip_bgp_attr_info
,
12635 show_ip_bgp_attr_info_cmd
,
12636 "show ip bgp attribute-info",
12640 "List all bgp attribute information\n")
12642 attr_show_all (vty
);
12643 return CMD_SUCCESS
;
12646 static int bgp_show_update_groups(struct vty
*vty
, const char *name
,
12648 uint64_t subgrp_id
)
12653 bgp
= bgp_lookup_by_name (name
);
12655 bgp
= bgp_get_default ();
12658 update_group_show(bgp
, afi
, safi
, vty
, subgrp_id
);
12659 return CMD_SUCCESS
;
12663 bgp_show_all_instances_updgrps_vty (struct vty
*vty
, afi_t afi
, safi_t safi
)
12665 struct listnode
*node
, *nnode
;
12668 for (ALL_LIST_ELEMENTS (bm
->bgp
, node
, nnode
, bgp
))
12670 vty_out (vty
, "%sInstance %s:%s",
12672 (bgp
->inst_type
== BGP_INSTANCE_TYPE_DEFAULT
) ? "Default" : bgp
->name
,
12674 update_group_show(bgp
, afi
, safi
, vty
, 0);
12678 DEFUN (show_ip_bgp_updgrps
,
12679 show_ip_bgp_updgrps_cmd
,
12680 "show ip bgp update-groups",
12684 "Detailed info about dynamic update groups\n")
12686 return (bgp_show_update_groups(vty
, NULL
, AFI_IP
, SAFI_UNICAST
, 0));
12689 DEFUN (show_ip_bgp_instance_updgrps
,
12690 show_ip_bgp_instance_updgrps_cmd
,
12691 "show ip bgp " BGP_INSTANCE_CMD
" update-groups",
12695 BGP_INSTANCE_HELP_STR
12696 "Detailed info about dynamic update groups\n")
12698 return (bgp_show_update_groups(vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, 0));
12701 DEFUN (show_ip_bgp_instance_all_updgrps
,
12702 show_ip_bgp_instance_all_updgrps_cmd
,
12703 "show ip bgp " BGP_INSTANCE_ALL_CMD
" update-groups",
12707 BGP_INSTANCE_ALL_HELP_STR
12708 "Detailed info about dynamic update groups\n")
12710 bgp_show_all_instances_updgrps_vty (vty
, AFI_IP
, SAFI_UNICAST
);
12711 return CMD_SUCCESS
;
12714 DEFUN (show_bgp_ipv6_updgrps
,
12715 show_bgp_ipv6_updgrps_cmd
,
12716 "show bgp update-groups",
12719 "Detailed info about v6 dynamic update groups\n")
12721 return (bgp_show_update_groups(vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, 0));
12724 DEFUN (show_bgp_instance_ipv6_updgrps
,
12725 show_bgp_instance_ipv6_updgrps_cmd
,
12726 "show bgp " BGP_INSTANCE_CMD
" update-groups",
12729 BGP_INSTANCE_HELP_STR
12730 "Detailed info about v6 dynamic update groups\n")
12732 return (bgp_show_update_groups(vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, 0));
12735 DEFUN (show_bgp_instance_all_ipv6_updgrps
,
12736 show_bgp_instance_all_ipv6_updgrps_cmd
,
12737 "show bgp " BGP_INSTANCE_ALL_CMD
" update-groups",
12740 BGP_INSTANCE_ALL_HELP_STR
12741 "Detailed info about v6 dynamic update groups\n")
12743 bgp_show_all_instances_updgrps_vty (vty
, AFI_IP6
, SAFI_UNICAST
);
12744 return CMD_SUCCESS
;
12747 DEFUN (show_bgp_updgrps
,
12748 show_bgp_updgrps_cmd
,
12749 "show bgp "BGP_AFI_SAFI_CMD_STR
" update-groups",
12754 "Detailed info about dynamic update groups\n")
12759 afi
= bgp_vty_safi_from_arg(argv
[0]);
12760 safi
= bgp_vty_safi_from_arg(argv
[1]);
12761 return (bgp_show_update_groups(vty
, NULL
, afi
, safi
, 0));
12764 DEFUN (show_ip_bgp_updgrps_s
,
12765 show_ip_bgp_updgrps_s_cmd
,
12766 "show ip bgp update-groups SUBGROUP-ID",
12770 "Detailed info about dynamic update groups\n"
12771 "Specific subgroup to display detailed info for\n")
12773 uint64_t subgrp_id
;
12775 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
12776 return (bgp_show_update_groups(vty
, NULL
, AFI_IP
, SAFI_UNICAST
, subgrp_id
));
12779 DEFUN (show_ip_bgp_instance_updgrps_s
,
12780 show_ip_bgp_instance_updgrps_s_cmd
,
12781 "show ip bgp " BGP_INSTANCE_CMD
" update-groups SUBGROUP-ID",
12785 BGP_INSTANCE_HELP_STR
12786 "Detailed info about dynamic update groups\n"
12787 "Specific subgroup to display detailed info for\n")
12789 uint64_t subgrp_id
;
12791 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
12792 return (bgp_show_update_groups(vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, subgrp_id
));
12795 DEFUN (show_bgp_ipv6_updgrps_s
,
12796 show_bgp_ipv6_updgrps_s_cmd
,
12797 "show bgp update-groups SUBGROUP-ID",
12800 "Detailed info about v6 dynamic update groups\n"
12801 "Specific subgroup to display detailed info for\n")
12803 uint64_t subgrp_id
;
12805 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
12806 return(bgp_show_update_groups(vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, subgrp_id
));
12809 DEFUN (show_bgp_instance_ipv6_updgrps_s
,
12810 show_bgp_instance_ipv6_updgrps_s_cmd
,
12811 "show bgp " BGP_INSTANCE_CMD
" update-groups SUBGROUP-ID",
12814 "Detailed info about v6 dynamic update groups\n"
12815 "Specific subgroup to display detailed info for\n")
12817 uint64_t subgrp_id
;
12819 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
12820 return(bgp_show_update_groups(vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, subgrp_id
));
12823 DEFUN (show_bgp_updgrps_s
,
12824 show_bgp_updgrps_s_cmd
,
12825 "show bgp "BGP_AFI_SAFI_CMD_STR
" update-groups SUBGROUP-ID",
12829 BGP_AFI_SAFI_HELP_STR
12830 "Detailed info about v6 dynamic update groups\n"
12831 "Specific subgroup to display detailed info for")
12835 uint64_t subgrp_id
;
12837 afi
= bgp_vty_safi_from_arg(argv
[0]);
12838 safi
= bgp_vty_safi_from_arg(argv
[1]);
12839 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
12840 return(bgp_show_update_groups(vty
, NULL
, afi
, safi
, subgrp_id
));
12843 DEFUN (show_bgp_updgrps_stats
,
12844 show_bgp_updgrps_stats_cmd
,
12845 "show bgp update-groups statistics",
12848 "BGP update groups\n"
12853 bgp
= bgp_get_default();
12855 update_group_show_stats(bgp
, vty
);
12857 return CMD_SUCCESS
;
12860 DEFUN (show_bgp_instance_updgrps_stats
,
12861 show_bgp_instance_updgrps_stats_cmd
,
12862 "show bgp " BGP_INSTANCE_CMD
" update-groups statistics",
12865 BGP_INSTANCE_HELP_STR
12866 "BGP update groups\n"
12871 bgp
= bgp_lookup_by_name (argv
[1]);
12873 update_group_show_stats(bgp
, vty
);
12875 return CMD_SUCCESS
;
12879 show_bgp_updgrps_adj_info_aux (struct vty
*vty
, const char *name
,
12880 afi_t afi
, safi_t safi
,
12881 const char *what
, uint64_t subgrp_id
)
12886 bgp
= bgp_lookup_by_name (name
);
12888 bgp
= bgp_get_default ();
12892 if (!strcmp(what
, "advertise-queue"))
12893 update_group_show_adj_queue(bgp
, afi
, safi
, vty
, subgrp_id
);
12894 else if (!strcmp(what
, "advertised-routes"))
12895 update_group_show_advertised(bgp
, afi
, safi
, vty
, subgrp_id
);
12896 else if (!strcmp(what
, "packet-queue"))
12897 update_group_show_packet_queue(bgp
, afi
, safi
, vty
, subgrp_id
);
12901 DEFUN (show_ip_bgp_updgrps_adj
,
12902 show_ip_bgp_updgrps_adj_cmd
,
12903 "show ip bgp update-groups (advertise-queue|advertised-routes|packet-queue)",
12907 "BGP update groups\n"
12908 "Advertisement queue\n"
12909 "Announced routes\n"
12913 show_bgp_updgrps_adj_info_aux(vty
, NULL
, AFI_IP
, SAFI_UNICAST
, argv
[0], 0);
12914 return CMD_SUCCESS
;
12917 DEFUN (show_ip_bgp_instance_updgrps_adj
,
12918 show_ip_bgp_instance_updgrps_adj_cmd
,
12919 "show ip bgp " BGP_INSTANCE_CMD
" update-groups (advertise-queue|advertised-routes|packet-queue)",
12923 BGP_INSTANCE_HELP_STR
12924 "BGP update groups\n"
12925 "Advertisement queue\n"
12926 "Announced routes\n"
12930 show_bgp_updgrps_adj_info_aux(vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, argv
[2], 0);
12931 return CMD_SUCCESS
;
12934 DEFUN (show_bgp_updgrps_afi_adj
,
12935 show_bgp_updgrps_afi_adj_cmd
,
12936 "show bgp "BGP_AFI_SAFI_CMD_STR
" update-groups (advertise-queue|advertised-routes|packet-queue)",
12941 "BGP update groups\n"
12942 "Advertisement queue\n"
12943 "Announced routes\n"
12945 "Specific subgroup info wanted for\n")
12950 afi
= bgp_vty_safi_from_arg(argv
[0]);
12951 safi
= bgp_vty_safi_from_arg(argv
[1]);
12952 show_bgp_updgrps_adj_info_aux(vty
, NULL
, afi
, safi
, argv
[2], 0);
12953 return CMD_SUCCESS
;
12956 DEFUN (show_bgp_updgrps_adj
,
12957 show_bgp_updgrps_adj_cmd
,
12958 "show bgp update-groups (advertise-queue|advertised-routes|packet-queue)",
12961 "BGP update groups\n"
12962 "Advertisement queue\n"
12963 "Announced routes\n"
12966 show_bgp_updgrps_adj_info_aux(vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, argv
[0], 0);
12967 return CMD_SUCCESS
;
12970 DEFUN (show_bgp_instance_updgrps_adj
,
12971 show_bgp_instance_updgrps_adj_cmd
,
12972 "show bgp " BGP_INSTANCE_CMD
" update-groups (advertise-queue|advertised-routes|packet-queue)",
12975 BGP_INSTANCE_HELP_STR
12976 "BGP update groups\n"
12977 "Advertisement queue\n"
12978 "Announced routes\n"
12981 show_bgp_updgrps_adj_info_aux(vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, argv
[2], 0);
12982 return CMD_SUCCESS
;
12985 DEFUN (show_ip_bgp_updgrps_adj_s
,
12986 show_ip_bgp_updgrps_adj_s_cmd
,
12987 "show ip bgp update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
12991 "BGP update groups\n"
12992 "Specific subgroup to display info for\n"
12993 "Advertisement queue\n"
12994 "Announced routes\n"
12998 uint64_t subgrp_id
;
13000 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
13002 show_bgp_updgrps_adj_info_aux(vty
, NULL
, AFI_IP
, SAFI_UNICAST
, argv
[1], subgrp_id
);
13003 return CMD_SUCCESS
;
13006 DEFUN (show_ip_bgp_instance_updgrps_adj_s
,
13007 show_ip_bgp_instance_updgrps_adj_s_cmd
,
13008 "show ip bgp " BGP_INSTANCE_CMD
" update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
13012 BGP_INSTANCE_HELP_STR
13013 "BGP update groups\n"
13014 "Specific subgroup to display info for\n"
13015 "Advertisement queue\n"
13016 "Announced routes\n"
13020 uint64_t subgrp_id
;
13022 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
13024 show_bgp_updgrps_adj_info_aux(vty
, argv
[1], AFI_IP
, SAFI_UNICAST
, argv
[3], subgrp_id
);
13025 return CMD_SUCCESS
;
13028 DEFUN (show_bgp_updgrps_afi_adj_s
,
13029 show_bgp_updgrps_afi_adj_s_cmd
,
13030 "show bgp "BGP_AFI_SAFI_CMD_STR
" update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
13035 "BGP update groups\n"
13036 "Specific subgroup to display info for\n"
13037 "Advertisement queue\n"
13038 "Announced routes\n"
13040 "Specific subgroup info wanted for\n")
13044 uint64_t subgrp_id
;
13046 afi
= bgp_vty_safi_from_arg(argv
[0]);
13047 safi
= bgp_vty_safi_from_arg(argv
[1]);
13048 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
13050 show_bgp_updgrps_adj_info_aux(vty
, NULL
, afi
, safi
, argv
[3], subgrp_id
);
13051 return CMD_SUCCESS
;
13054 DEFUN (show_bgp_updgrps_adj_s
,
13055 show_bgp_updgrps_adj_s_cmd
,
13056 "show bgp update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
13059 "BGP update groups\n"
13060 "Specific subgroup to display info for\n"
13061 "Advertisement queue\n"
13062 "Announced routes\n"
13065 uint64_t subgrp_id
;
13067 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
13069 show_bgp_updgrps_adj_info_aux(vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, argv
[1], subgrp_id
);
13070 return CMD_SUCCESS
;
13073 DEFUN (show_bgp_instance_updgrps_adj_s
,
13074 show_bgp_instance_updgrps_adj_s_cmd
,
13075 "show bgp " BGP_INSTANCE_CMD
" update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
13078 BGP_INSTANCE_HELP_STR
13079 "BGP update groups\n"
13080 "Specific subgroup to display info for\n"
13081 "Advertisement queue\n"
13082 "Announced routes\n"
13085 uint64_t subgrp_id
;
13087 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
13089 show_bgp_updgrps_adj_info_aux(vty
, argv
[1], AFI_IP6
, SAFI_UNICAST
, argv
[3], subgrp_id
);
13090 return CMD_SUCCESS
;
13096 bgp_show_one_peer_group (struct vty
*vty
, struct peer_group
*group
)
13098 struct listnode
*node
, *nnode
;
13099 struct prefix
*range
;
13102 char buf
[PREFIX2STR_BUFFER
];
13105 const char *peer_status
;
13106 const char *af_str
;
13111 conf
= group
->conf
;
13113 if (conf
->as_type
== AS_SPECIFIED
||
13114 conf
->as_type
== AS_EXTERNAL
) {
13115 vty_out (vty
, "%sBGP peer-group %s, remote AS %d%s",
13116 VTY_NEWLINE
, group
->name
, conf
->as
, VTY_NEWLINE
);
13117 } else if (conf
->as_type
== AS_INTERNAL
) {
13118 vty_out (vty
, "%sBGP peer-group %s, remote AS %d%s",
13119 VTY_NEWLINE
, group
->name
, group
->bgp
->as
, VTY_NEWLINE
);
13121 vty_out (vty
, "%sBGP peer-group %s%s",
13122 VTY_NEWLINE
, group
->name
, VTY_NEWLINE
);
13125 if ((group
->bgp
->as
== conf
->as
) || (conf
->as_type
== AS_INTERNAL
))
13126 vty_out (vty
, " Peer-group type is internal%s", VTY_NEWLINE
);
13128 vty_out (vty
, " Peer-group type is external%s", VTY_NEWLINE
);
13130 /* Display AFs configured. */
13131 vty_out (vty
, " Configured address-families:");
13132 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
13133 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
13135 if (conf
->afc
[afi
][safi
])
13138 vty_out (vty
, " %s;", afi_safi_print(afi
, safi
));
13142 vty_out (vty
, " none%s", VTY_NEWLINE
);
13144 vty_out (vty
, "%s", VTY_NEWLINE
);
13146 /* Display listen ranges (for dynamic neighbors), if any */
13147 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
13151 else if (afi
== AFI_IP6
)
13155 lr_count
= listcount(group
->listen_range
[afi
]);
13159 " %d %s listen range(s)%s",
13160 lr_count
, af_str
, VTY_NEWLINE
);
13163 for (ALL_LIST_ELEMENTS (group
->listen_range
[afi
], node
,
13166 prefix2str(range
, buf
, sizeof(buf
));
13167 vty_out(vty
, " %s%s", buf
, VTY_NEWLINE
);
13172 /* Display group members and their status */
13173 if (listcount(group
->peer
))
13175 vty_out (vty
, " Peer-group members:%s", VTY_NEWLINE
);
13176 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
13178 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
13179 peer_status
= "Idle (Admin)";
13180 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
13181 peer_status
= "Idle (PfxCt)";
13183 peer_status
= LOOKUP(bgp_status_msg
, peer
->status
);
13185 dynamic
= peer_dynamic_neighbor(peer
);
13186 vty_out (vty
, " %s %s %s %s",
13187 peer
->host
, dynamic
? "(dynamic)" : "",
13188 peer_status
, VTY_NEWLINE
);
13192 return CMD_SUCCESS
;
13195 /* Show BGP peer group's information. */
13196 enum show_group_type
13203 bgp_show_peer_group (struct vty
*vty
, struct bgp
*bgp
,
13204 enum show_group_type type
, const char *group_name
)
13206 struct listnode
*node
, *nnode
;
13207 struct peer_group
*group
;
13210 for (ALL_LIST_ELEMENTS (bgp
->group
, node
, nnode
, group
))
13214 case show_all_groups
:
13215 bgp_show_one_peer_group (vty
, group
);
13217 case show_peer_group
:
13218 if (group_name
&& (strcmp(group
->name
, group_name
) == 0))
13221 bgp_show_one_peer_group (vty
, group
);
13227 if (type
== show_peer_group
&& ! find
)
13228 vty_out (vty
, "%% No such peer-group%s", VTY_NEWLINE
);
13230 return CMD_SUCCESS
;
13234 bgp_show_peer_group_vty (struct vty
*vty
, const char *name
,
13235 enum show_group_type type
, const char *group_name
)
13238 int ret
= CMD_SUCCESS
;
13241 bgp
= bgp_lookup_by_name (name
);
13243 bgp
= bgp_get_default ();
13247 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
13248 return CMD_WARNING
;
13251 ret
= bgp_show_peer_group (vty
, bgp
, type
, group_name
);
13256 DEFUN (show_ip_bgp_peer_groups
,
13257 show_ip_bgp_peer_groups_cmd
,
13258 "show ip bgp peer-group",
13262 "Detailed information on all BGP peer groups\n")
13264 return bgp_show_peer_group_vty (vty
, NULL
, show_all_groups
, NULL
);
13267 DEFUN (show_ip_bgp_instance_peer_groups
,
13268 show_ip_bgp_instance_peer_groups_cmd
,
13269 "show ip bgp " BGP_INSTANCE_CMD
" peer-group",
13273 BGP_INSTANCE_HELP_STR
13274 "Detailed information on all BGP peer groups\n")
13276 return bgp_show_peer_group_vty (vty
, argv
[1], show_all_groups
, NULL
);
13279 DEFUN (show_ip_bgp_peer_group
,
13280 show_ip_bgp_peer_group_cmd
,
13281 "show ip bgp peer-group WORD",
13285 "BGP peer-group name\n"
13286 "Detailed information on a BGP peer group\n")
13288 return bgp_show_peer_group_vty (vty
, NULL
, show_peer_group
, argv
[0]);
13291 DEFUN (show_ip_bgp_instance_peer_group
,
13292 show_ip_bgp_instance_peer_group_cmd
,
13293 "show ip bgp " BGP_INSTANCE_CMD
" peer-group WORD",
13297 BGP_INSTANCE_HELP_STR
13298 "BGP peer-group name\n"
13299 "Detailed information on a BGP peer group\n")
13301 return bgp_show_peer_group_vty (vty
, argv
[1], show_peer_group
, argv
[2]);
13304 /* Redistribute VTY commands. */
13306 DEFUN (bgp_redistribute_ipv4
,
13307 bgp_redistribute_ipv4_cmd
,
13308 "redistribute " FRR_IP_REDIST_STR_BGPD
,
13309 "Redistribute information from another routing protocol\n"
13310 FRR_IP_REDIST_HELP_STR_BGPD
)
13314 type
= proto_redistnum (AFI_IP
, argv
[0]);
13315 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13317 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13318 return CMD_WARNING
;
13320 bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
13321 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
, 0);
13324 DEFUN (bgp_redistribute_ipv4_rmap
,
13325 bgp_redistribute_ipv4_rmap_cmd
,
13326 "redistribute " FRR_IP_REDIST_STR_BGPD
" route-map WORD",
13327 "Redistribute information from another routing protocol\n"
13328 FRR_IP_REDIST_HELP_STR_BGPD
13329 "Route map reference\n"
13330 "Pointer to route-map entries\n")
13333 struct bgp_redist
*red
;
13335 type
= proto_redistnum (AFI_IP
, argv
[0]);
13336 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13338 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13339 return CMD_WARNING
;
13342 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
13343 bgp_redistribute_rmap_set (red
, argv
[1]);
13344 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
, 0);
13347 DEFUN (bgp_redistribute_ipv4_metric
,
13348 bgp_redistribute_ipv4_metric_cmd
,
13349 "redistribute " FRR_IP_REDIST_STR_BGPD
" metric <0-4294967295>",
13350 "Redistribute information from another routing protocol\n"
13351 FRR_IP_REDIST_HELP_STR_BGPD
13352 "Metric for redistributed routes\n"
13353 "Default metric\n")
13357 struct bgp_redist
*red
;
13359 type
= proto_redistnum (AFI_IP
, argv
[0]);
13360 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13362 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13363 return CMD_WARNING
;
13365 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
13367 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
13368 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, type
, metric
);
13369 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
, 0);
13372 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
13373 bgp_redistribute_ipv4_rmap_metric_cmd
,
13374 "redistribute " FRR_IP_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
13375 "Redistribute information from another routing protocol\n"
13376 FRR_IP_REDIST_HELP_STR_BGPD
13377 "Route map reference\n"
13378 "Pointer to route-map entries\n"
13379 "Metric for redistributed routes\n"
13380 "Default metric\n")
13384 struct bgp_redist
*red
;
13386 type
= proto_redistnum (AFI_IP
, argv
[0]);
13387 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13389 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13390 return CMD_WARNING
;
13392 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
13394 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
13395 bgp_redistribute_rmap_set (red
, argv
[1]);
13396 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, type
, metric
);
13397 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
, 0);
13400 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
13401 bgp_redistribute_ipv4_metric_rmap_cmd
,
13402 "redistribute " FRR_IP_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
13403 "Redistribute information from another routing protocol\n"
13404 FRR_IP_REDIST_HELP_STR_BGPD
13405 "Metric for redistributed routes\n"
13407 "Route map reference\n"
13408 "Pointer to route-map entries\n")
13412 struct bgp_redist
*red
;
13414 type
= proto_redistnum (AFI_IP
, argv
[0]);
13415 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13417 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13418 return CMD_WARNING
;
13420 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
13422 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
13423 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, type
, metric
);
13424 bgp_redistribute_rmap_set (red
, argv
[2]);
13425 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
, 0);
13428 DEFUN (bgp_redistribute_ipv4_ospf
,
13429 bgp_redistribute_ipv4_ospf_cmd
,
13430 "redistribute (ospf|table) <1-65535>",
13431 "Redistribute information from another routing protocol\n"
13432 "Open Shortest Path First (OSPFv2)\n"
13433 "Non-main Kernel Routing Table\n"
13434 "Instance ID/Table ID\n")
13439 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13441 if (strncmp(argv
[0], "o", 1) == 0)
13442 protocol
= ZEBRA_ROUTE_OSPF
;
13444 protocol
= ZEBRA_ROUTE_TABLE
;
13446 bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
13447 return bgp_redistribute_set (vty
->index
, AFI_IP
, protocol
, instance
);
13450 DEFUN (bgp_redistribute_ipv4_ospf_rmap
,
13451 bgp_redistribute_ipv4_ospf_rmap_cmd
,
13452 "redistribute (ospf|table) <1-65535> route-map WORD",
13453 "Redistribute information from another routing protocol\n"
13454 "Open Shortest Path First (OSPFv2)\n"
13455 "Non-main Kernel Routing Table\n"
13456 "Instance ID/Table ID\n"
13457 "Route map reference\n"
13458 "Pointer to route-map entries\n")
13460 struct bgp_redist
*red
;
13464 if (strncmp(argv
[0], "o", 1) == 0)
13465 protocol
= ZEBRA_ROUTE_OSPF
;
13467 protocol
= ZEBRA_ROUTE_TABLE
;
13469 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13470 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
13471 bgp_redistribute_rmap_set (red
, argv
[2]);
13472 return bgp_redistribute_set (vty
->index
, AFI_IP
, protocol
, instance
);
13475 DEFUN (bgp_redistribute_ipv4_ospf_metric
,
13476 bgp_redistribute_ipv4_ospf_metric_cmd
,
13477 "redistribute (ospf|table) <1-65535> metric <0-4294967295>",
13478 "Redistribute information from another routing protocol\n"
13479 "Open Shortest Path First (OSPFv2)\n"
13480 "Non-main Kernel Routing Table\n"
13481 "Instance ID/Table ID\n"
13482 "Metric for redistributed routes\n"
13483 "Default metric\n")
13486 struct bgp_redist
*red
;
13490 if (strncmp(argv
[0], "o", 1) == 0)
13491 protocol
= ZEBRA_ROUTE_OSPF
;
13493 protocol
= ZEBRA_ROUTE_TABLE
;
13495 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13496 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
13498 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
13499 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, protocol
, metric
);
13500 return bgp_redistribute_set (vty
->index
, AFI_IP
, protocol
, instance
);
13503 DEFUN (bgp_redistribute_ipv4_ospf_rmap_metric
,
13504 bgp_redistribute_ipv4_ospf_rmap_metric_cmd
,
13505 "redistribute (ospf|table) <1-65535> route-map WORD metric <0-4294967295>",
13506 "Redistribute information from another routing protocol\n"
13507 "Open Shortest Path First (OSPFv2)\n"
13508 "Non-main Kernel Routing Table\n"
13509 "Instance ID/Table ID\n"
13510 "Route map reference\n"
13511 "Pointer to route-map entries\n"
13512 "Metric for redistributed routes\n"
13513 "Default metric\n")
13516 struct bgp_redist
*red
;
13520 if (strncmp(argv
[0], "o", 1) == 0)
13521 protocol
= ZEBRA_ROUTE_OSPF
;
13523 protocol
= ZEBRA_ROUTE_TABLE
;
13525 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13526 VTY_GET_INTEGER ("metric", metric
, argv
[3]);
13528 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
13529 bgp_redistribute_rmap_set (red
, argv
[2]);
13530 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, protocol
, metric
);
13531 return bgp_redistribute_set (vty
->index
, AFI_IP
, protocol
, instance
);
13534 DEFUN (bgp_redistribute_ipv4_ospf_metric_rmap
,
13535 bgp_redistribute_ipv4_ospf_metric_rmap_cmd
,
13536 "redistribute (ospf|table) <1-65535> metric <0-4294967295> route-map WORD",
13537 "Redistribute information from another routing protocol\n"
13538 "Open Shortest Path First (OSPFv2)\n"
13539 "Non-main Kernel Routing Table\n"
13540 "Instance ID/Table ID\n"
13541 "Metric for redistributed routes\n"
13543 "Route map reference\n"
13544 "Pointer to route-map entries\n")
13547 struct bgp_redist
*red
;
13551 if (strncmp(argv
[0], "o", 1) == 0)
13552 protocol
= ZEBRA_ROUTE_OSPF
;
13554 protocol
= ZEBRA_ROUTE_TABLE
;
13556 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13557 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
13559 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
13560 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP
, protocol
, metric
);
13561 bgp_redistribute_rmap_set (red
, argv
[3]);
13562 return bgp_redistribute_set (vty
->index
, AFI_IP
, protocol
, instance
);
13565 DEFUN (no_bgp_redistribute_ipv4_ospf
,
13566 no_bgp_redistribute_ipv4_ospf_cmd
,
13567 "no redistribute (ospf|table) <1-65535>",
13569 "Redistribute information from another routing protocol\n"
13570 "Open Shortest Path First (OSPFv2)\n"
13571 "Non-main Kernel Routing Table\n"
13572 "Instance ID/Table ID\n")
13577 if (strncmp(argv
[0], "o", 1) == 0)
13578 protocol
= ZEBRA_ROUTE_OSPF
;
13580 protocol
= ZEBRA_ROUTE_TABLE
;
13582 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
13583 return bgp_redistribute_unset (vty
->index
, AFI_IP
, protocol
, instance
);
13586 ALIAS (no_bgp_redistribute_ipv4_ospf
,
13587 no_bgp_redistribute_ipv4_ospf_rmap_cmd
,
13588 "no redistribute (ospf|table) <1-65535> route-map WORD",
13590 "Redistribute information from another routing protocol\n"
13591 "Open Shortest Path First (OSPFv2)\n"
13592 "Non-main Kernel Routing Table\n"
13593 "Instance ID/Table ID\n"
13594 "Route map reference\n"
13595 "Pointer to route-map entries\n")
13597 ALIAS (no_bgp_redistribute_ipv4_ospf
,
13598 no_bgp_redistribute_ipv4_ospf_metric_cmd
,
13599 "no redistribute (ospf|table) <1-65535> metric <0-4294967295>",
13601 "Redistribute information from another routing protocol\n"
13602 "Open Shortest Path First (OSPFv2)\n"
13603 "Non-main Kernel Routing Table\n"
13604 "Instance ID/Table ID\n"
13605 "Metric for redistributed routes\n"
13606 "Default metric\n")
13608 ALIAS (no_bgp_redistribute_ipv4_ospf
,
13609 no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd
,
13610 "no redistribute (ospf|table) <1-65535> route-map WORD metric <0-4294967295>",
13612 "Redistribute information from another routing protocol\n"
13613 "Open Shortest Path First (OSPFv2)\n"
13614 "Non-main Kernel Routing Table\n"
13615 "Instance ID/Table ID\n"
13616 "Route map reference\n"
13617 "Pointer to route-map entries\n"
13618 "Metric for redistributed routes\n"
13619 "Default metric\n")
13621 ALIAS (no_bgp_redistribute_ipv4_ospf
,
13622 no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd
,
13623 "no redistribute (ospf|table) <1-65535> metric <0-4294967295> route-map WORD",
13625 "Redistribute information from another routing protocol\n"
13626 "Open Shortest Path First (OSPFv2)\n"
13627 "Non-main Kernel Routing Table\n"
13628 "Instance ID/Table ID\n"
13629 "Metric for redistributed routes\n"
13631 "Route map reference\n"
13632 "Pointer to route-map entries\n")
13634 DEFUN (no_bgp_redistribute_ipv4
,
13635 no_bgp_redistribute_ipv4_cmd
,
13636 "no redistribute " FRR_IP_REDIST_STR_BGPD
,
13638 "Redistribute information from another routing protocol\n"
13639 FRR_IP_REDIST_HELP_STR_BGPD
)
13643 type
= proto_redistnum (AFI_IP
, argv
[0]);
13644 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13646 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13647 return CMD_WARNING
;
13649 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
, 0);
13652 ALIAS (no_bgp_redistribute_ipv4
,
13653 no_bgp_redistribute_ipv4_rmap_cmd
,
13654 "no redistribute " FRR_IP_REDIST_STR_BGPD
" route-map WORD",
13656 "Redistribute information from another routing protocol\n"
13657 FRR_IP_REDIST_HELP_STR_BGPD
13658 "Route map reference\n"
13659 "Pointer to route-map entries\n")
13661 ALIAS (no_bgp_redistribute_ipv4
,
13662 no_bgp_redistribute_ipv4_metric_cmd
,
13663 "no redistribute " FRR_IP_REDIST_STR_BGPD
" metric <0-4294967295>",
13665 "Redistribute information from another routing protocol\n"
13666 FRR_IP_REDIST_HELP_STR_BGPD
13667 "Metric for redistributed routes\n"
13668 "Default metric\n")
13670 ALIAS (no_bgp_redistribute_ipv4
,
13671 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
13672 "no redistribute " FRR_IP_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
13674 "Redistribute information from another routing protocol\n"
13675 FRR_IP_REDIST_HELP_STR_BGPD
13676 "Route map reference\n"
13677 "Pointer to route-map entries\n"
13678 "Metric for redistributed routes\n"
13679 "Default metric\n")
13681 ALIAS (no_bgp_redistribute_ipv4
,
13682 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
13683 "no redistribute " FRR_IP_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
13685 "Redistribute information from another routing protocol\n"
13686 FRR_IP_REDIST_HELP_STR_BGPD
13687 "Metric for redistributed routes\n"
13689 "Route map reference\n"
13690 "Pointer to route-map entries\n")
13692 DEFUN (bgp_redistribute_ipv6
,
13693 bgp_redistribute_ipv6_cmd
,
13694 "redistribute " FRR_IP6_REDIST_STR_BGPD
,
13695 "Redistribute information from another routing protocol\n"
13696 FRR_IP6_REDIST_HELP_STR_BGPD
)
13700 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13701 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13703 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13704 return CMD_WARNING
;
13707 bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
13708 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
, 0);
13711 DEFUN (bgp_redistribute_ipv6_rmap
,
13712 bgp_redistribute_ipv6_rmap_cmd
,
13713 "redistribute " FRR_IP6_REDIST_STR_BGPD
" route-map WORD",
13714 "Redistribute information from another routing protocol\n"
13715 FRR_IP6_REDIST_HELP_STR_BGPD
13716 "Route map reference\n"
13717 "Pointer to route-map entries\n")
13720 struct bgp_redist
*red
;
13722 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13723 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13725 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13726 return CMD_WARNING
;
13729 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
13730 bgp_redistribute_rmap_set (red
, argv
[1]);
13731 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
, 0);
13734 DEFUN (bgp_redistribute_ipv6_metric
,
13735 bgp_redistribute_ipv6_metric_cmd
,
13736 "redistribute " FRR_IP6_REDIST_STR_BGPD
" metric <0-4294967295>",
13737 "Redistribute information from another routing protocol\n"
13738 FRR_IP6_REDIST_HELP_STR_BGPD
13739 "Metric for redistributed routes\n"
13740 "Default metric\n")
13744 struct bgp_redist
*red
;
13746 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13747 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13749 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13750 return CMD_WARNING
;
13752 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
13754 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
13755 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP6
, type
, metric
);
13756 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
, 0);
13759 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
13760 bgp_redistribute_ipv6_rmap_metric_cmd
,
13761 "redistribute " FRR_IP6_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
13762 "Redistribute information from another routing protocol\n"
13763 FRR_IP6_REDIST_HELP_STR_BGPD
13764 "Route map reference\n"
13765 "Pointer to route-map entries\n"
13766 "Metric for redistributed routes\n"
13767 "Default metric\n")
13771 struct bgp_redist
*red
;
13773 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13774 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13776 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13777 return CMD_WARNING
;
13779 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
13781 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
13782 bgp_redistribute_rmap_set (red
, argv
[1]);
13783 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP6
, type
, metric
);
13784 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
, 0);
13787 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
13788 bgp_redistribute_ipv6_metric_rmap_cmd
,
13789 "redistribute " FRR_IP6_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
13790 "Redistribute information from another routing protocol\n"
13791 FRR_IP6_REDIST_HELP_STR_BGPD
13792 "Metric for redistributed routes\n"
13794 "Route map reference\n"
13795 "Pointer to route-map entries\n")
13799 struct bgp_redist
*red
;
13801 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13802 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13804 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13805 return CMD_WARNING
;
13807 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
13809 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
13810 bgp_redistribute_metric_set(vty
->index
, red
, AFI_IP6
, SAFI_UNICAST
, metric
);
13811 bgp_redistribute_rmap_set (red
, argv
[2]);
13812 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
, 0);
13815 DEFUN (no_bgp_redistribute_ipv6
,
13816 no_bgp_redistribute_ipv6_cmd
,
13817 "no redistribute " FRR_IP6_REDIST_STR_BGPD
,
13819 "Redistribute information from another routing protocol\n"
13820 FRR_IP6_REDIST_HELP_STR_BGPD
)
13824 type
= proto_redistnum (AFI_IP6
, argv
[0]);
13825 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
13827 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
13828 return CMD_WARNING
;
13831 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
, 0);
13834 ALIAS (no_bgp_redistribute_ipv6
,
13835 no_bgp_redistribute_ipv6_rmap_cmd
,
13836 "no redistribute " FRR_IP6_REDIST_STR_BGPD
" route-map WORD",
13838 "Redistribute information from another routing protocol\n"
13839 FRR_IP6_REDIST_HELP_STR_BGPD
13840 "Route map reference\n"
13841 "Pointer to route-map entries\n")
13843 ALIAS (no_bgp_redistribute_ipv6
,
13844 no_bgp_redistribute_ipv6_metric_cmd
,
13845 "no redistribute " FRR_IP6_REDIST_STR_BGPD
" metric <0-4294967295>",
13847 "Redistribute information from another routing protocol\n"
13848 FRR_IP6_REDIST_HELP_STR_BGPD
13849 "Metric for redistributed routes\n"
13850 "Default metric\n")
13852 ALIAS (no_bgp_redistribute_ipv6
,
13853 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
13854 "no redistribute " FRR_IP6_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
13856 "Redistribute information from another routing protocol\n"
13857 FRR_IP6_REDIST_HELP_STR_BGPD
13858 "Route map reference\n"
13859 "Pointer to route-map entries\n"
13860 "Metric for redistributed routes\n"
13861 "Default metric\n")
13863 ALIAS (no_bgp_redistribute_ipv6
,
13864 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
13865 "no redistribute " FRR_IP6_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
13867 "Redistribute information from another routing protocol\n"
13868 FRR_IP6_REDIST_HELP_STR_BGPD
13869 "Metric for redistributed routes\n"
13871 "Route map reference\n"
13872 "Pointer to route-map entries\n")
13875 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
13876 safi_t safi
, int *write
)
13880 /* Unicast redistribution only. */
13881 if (safi
!= SAFI_UNICAST
)
13884 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
13886 /* Redistribute BGP does not make sense. */
13887 if (i
!= ZEBRA_ROUTE_BGP
)
13889 struct list
*red_list
;
13890 struct listnode
*node
;
13891 struct bgp_redist
*red
;
13893 red_list
= bgp
->redist
[afi
][i
];
13897 for (ALL_LIST_ELEMENTS_RO(red_list
, node
, red
))
13899 /* Display "address-family" when it is not yet diplayed. */
13900 bgp_config_write_family_header (vty
, afi
, safi
, write
);
13902 /* "redistribute" configuration. */
13903 vty_out (vty
, " redistribute %s", zebra_route_string(i
));
13905 vty_out (vty
, " %d", red
->instance
);
13906 if (red
->redist_metric_flag
)
13907 vty_out (vty
, " metric %u", red
->redist_metric
);
13908 if (red
->rmap
.name
)
13909 vty_out (vty
, " route-map %s", red
->rmap
.name
);
13910 vty_out (vty
, "%s", VTY_NEWLINE
);
13917 /* BGP node structure. */
13918 static struct cmd_node bgp_node
=
13921 "%s(config-router)# ",
13925 static struct cmd_node bgp_ipv4_unicast_node
=
13928 "%s(config-router-af)# ",
13932 static struct cmd_node bgp_ipv4_multicast_node
=
13935 "%s(config-router-af)# ",
13939 static struct cmd_node bgp_ipv6_unicast_node
=
13942 "%s(config-router-af)# ",
13946 static struct cmd_node bgp_ipv6_multicast_node
=
13949 "%s(config-router-af)# ",
13953 static struct cmd_node bgp_vpnv4_node
=
13956 "%s(config-router-af)# ",
13960 static struct cmd_node bgp_vpnv6_node
=
13963 "%s(config-router-af-vpnv6)# ",
13967 static struct cmd_node bgp_encap_node
=
13970 "%s(config-router-af-encap)# ",
13974 static struct cmd_node bgp_encapv6_node
=
13977 "%s(config-router-af-encapv6)# ",
13981 static void community_list_vty (void);
13984 bgp_vty_init (void)
13986 /* Install bgp top node. */
13987 install_node (&bgp_node
, bgp_config_write
);
13988 install_node (&bgp_ipv4_unicast_node
, NULL
);
13989 install_node (&bgp_ipv4_multicast_node
, NULL
);
13990 install_node (&bgp_ipv6_unicast_node
, NULL
);
13991 install_node (&bgp_ipv6_multicast_node
, NULL
);
13992 install_node (&bgp_vpnv4_node
, NULL
);
13993 install_node (&bgp_vpnv6_node
, NULL
);
13994 install_node (&bgp_encap_node
, NULL
);
13995 install_node (&bgp_encapv6_node
, NULL
);
13997 /* Install default VTY commands to new nodes. */
13998 install_default (BGP_NODE
);
13999 install_default (BGP_IPV4_NODE
);
14000 install_default (BGP_IPV4M_NODE
);
14001 install_default (BGP_IPV6_NODE
);
14002 install_default (BGP_IPV6M_NODE
);
14003 install_default (BGP_VPNV4_NODE
);
14004 install_default (BGP_VPNV6_NODE
);
14005 install_default (BGP_ENCAP_NODE
);
14006 install_default (BGP_ENCAPV6_NODE
);
14008 /* "bgp multiple-instance" commands. */
14009 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
14010 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
14012 /* "bgp config-type" commands. */
14013 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
14014 install_element (CONFIG_NODE
, &no_bgp_config_type_val_cmd
);
14016 /* bgp route-map delay-timer commands. */
14017 install_element (CONFIG_NODE
, &bgp_set_route_map_delay_timer_cmd
);
14018 install_element (CONFIG_NODE
, &no_bgp_set_route_map_delay_timer_cmd
);
14019 install_element (CONFIG_NODE
, &no_bgp_set_route_map_delay_timer_val_cmd
);
14021 /* Dummy commands (Currently not supported) */
14022 install_element (BGP_NODE
, &no_synchronization_cmd
);
14023 install_element (BGP_NODE
, &no_auto_summary_cmd
);
14025 /* "router bgp" commands. */
14026 install_element (CONFIG_NODE
, &router_bgp_cmd
);
14027 install_element (CONFIG_NODE
, &router_bgp_instance_cmd
);
14028 install_element (CONFIG_NODE
, &router_bgp_noasn_cmd
);
14030 /* "no router bgp" commands. */
14031 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
14032 install_element (CONFIG_NODE
, &no_router_bgp_instance_cmd
);
14033 install_element (CONFIG_NODE
, &no_router_bgp_noasn_cmd
);
14035 /* "bgp router-id" commands. */
14036 install_element (BGP_NODE
, &bgp_router_id_cmd
);
14037 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
14038 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
14040 /* "bgp cluster-id" commands. */
14041 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
14042 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
14043 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
14044 install_element (BGP_NODE
, &no_bgp_cluster_id_ip_cmd
);
14045 install_element (BGP_NODE
, &no_bgp_cluster_id_decimal_cmd
);
14047 /* "bgp confederation" commands. */
14048 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
14049 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
14050 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
14052 /* "bgp confederation peers" commands. */
14053 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
14054 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
14056 /* bgp max-med command */
14057 install_element (BGP_NODE
, &bgp_maxmed_admin_cmd
);
14058 install_element (BGP_NODE
, &no_bgp_maxmed_admin_cmd
);
14059 install_element (BGP_NODE
, &bgp_maxmed_admin_medv_cmd
);
14060 install_element (BGP_NODE
, &no_bgp_maxmed_admin_medv_cmd
);
14061 install_element (BGP_NODE
, &bgp_maxmed_onstartup_cmd
);
14062 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_cmd
);
14063 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_period_cmd
);
14064 install_element (BGP_NODE
, &bgp_maxmed_onstartup_medv_cmd
);
14065 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_period_medv_cmd
);
14067 /* bgp disable-ebgp-connected-nh-check */
14068 install_element (BGP_NODE
, &bgp_disable_connected_route_check_cmd
);
14069 install_element (BGP_NODE
, &no_bgp_disable_connected_route_check_cmd
);
14071 /* bgp update-delay command */
14072 install_element (BGP_NODE
, &bgp_update_delay_cmd
);
14073 install_element (BGP_NODE
, &no_bgp_update_delay_cmd
);
14074 install_element (BGP_NODE
, &bgp_update_delay_establish_wait_cmd
);
14075 install_element (BGP_NODE
, &no_bgp_update_delay_establish_wait_cmd
);
14077 install_element (BGP_NODE
, &bgp_wpkt_quanta_cmd
);
14078 install_element (BGP_NODE
, &no_bgp_wpkt_quanta_cmd
);
14080 install_element (BGP_NODE
, &bgp_coalesce_time_cmd
);
14081 install_element (BGP_NODE
, &no_bgp_coalesce_time_cmd
);
14083 /* "maximum-paths" commands. */
14084 install_element (BGP_NODE
, &bgp_maxpaths_cmd
);
14085 install_element (BGP_NODE
, &no_bgp_maxpaths_cmd
);
14086 install_element (BGP_NODE
, &no_bgp_maxpaths_arg_cmd
);
14087 install_element (BGP_IPV4_NODE
, &bgp_maxpaths_cmd
);
14088 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_cmd
);
14089 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_arg_cmd
);
14090 install_element (BGP_IPV6_NODE
, &bgp_maxpaths_cmd
);
14091 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_cmd
);
14092 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_arg_cmd
);
14093 install_element (BGP_NODE
, &bgp_maxpaths_ibgp_cmd
);
14094 install_element(BGP_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
14095 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
14096 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
14097 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
14098 install_element (BGP_IPV4_NODE
, &bgp_maxpaths_ibgp_cmd
);
14099 install_element(BGP_IPV4_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
14100 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
14101 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
14102 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
14103 install_element (BGP_IPV6_NODE
, &bgp_maxpaths_ibgp_cmd
);
14104 install_element(BGP_IPV6_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
14105 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
14106 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
14107 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
14109 /* "timers bgp" commands. */
14110 install_element (BGP_NODE
, &bgp_timers_cmd
);
14111 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
14112 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
14114 /* route-map delay-timer commands - per instance for backwards compat. */
14115 install_element (BGP_NODE
, &bgp_set_route_map_delay_timer_cmd
);
14116 install_element (BGP_NODE
, &no_bgp_set_route_map_delay_timer_cmd
);
14117 install_element (BGP_NODE
, &no_bgp_set_route_map_delay_timer_val_cmd
);
14119 /* "bgp client-to-client reflection" commands */
14120 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
14121 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
14123 /* "bgp always-compare-med" commands */
14124 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
14125 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
14127 /* "bgp deterministic-med" commands */
14128 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
14129 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
14131 /* "bgp graceful-restart" commands */
14132 install_element (BGP_NODE
, &bgp_graceful_restart_cmd
);
14133 install_element (BGP_NODE
, &no_bgp_graceful_restart_cmd
);
14134 install_element (BGP_NODE
, &bgp_graceful_restart_stalepath_time_cmd
);
14135 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_cmd
);
14136 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_val_cmd
);
14137 install_element (BGP_NODE
, &bgp_graceful_restart_restart_time_cmd
);
14138 install_element (BGP_NODE
, &no_bgp_graceful_restart_restart_time_cmd
);
14139 install_element (BGP_NODE
, &no_bgp_graceful_restart_restart_time_val_cmd
);
14141 /* "bgp fast-external-failover" commands */
14142 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
14143 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
14145 /* "bgp enforce-first-as" commands */
14146 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
14147 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
14149 /* "bgp bestpath compare-routerid" commands */
14150 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
14151 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
14153 /* "bgp bestpath as-path ignore" commands */
14154 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
14155 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
14157 /* "bgp bestpath as-path confed" commands */
14158 install_element (BGP_NODE
, &bgp_bestpath_aspath_confed_cmd
);
14159 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_confed_cmd
);
14161 /* "bgp bestpath as-path multipath-relax" commands */
14162 install_element (BGP_NODE
, &bgp_bestpath_aspath_multipath_relax_cmd
);
14163 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_multipath_relax_cmd
);
14165 /* "bgp log-neighbor-changes" commands */
14166 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
14167 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
14169 /* "bgp bestpath med" commands */
14170 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
14171 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
14172 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
14173 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
14174 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
14175 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
14177 /* "no bgp default ipv4-unicast" commands. */
14178 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
14179 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
14181 /* "bgp network import-check" commands. */
14182 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
14183 install_element (BGP_NODE
, &bgp_network_import_check_exact_cmd
);
14184 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
14186 /* "bgp default local-preference" commands. */
14187 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
14188 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
14189 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
14191 /* bgp default show-hostname */
14192 install_element (BGP_NODE
, &bgp_default_show_hostname_cmd
);
14193 install_element (BGP_NODE
, &no_bgp_default_show_hostname_cmd
);
14195 /* "bgp default subgroup-pkt-queue-max" commands. */
14196 install_element (BGP_NODE
, &bgp_default_subgroup_pkt_queue_max_cmd
);
14197 install_element (BGP_NODE
, &no_bgp_default_subgroup_pkt_queue_max_cmd
);
14198 install_element (BGP_NODE
, &no_bgp_default_subgroup_pkt_queue_max_val_cmd
);
14200 /* bgp ibgp-allow-policy-mods command */
14201 install_element (BGP_NODE
, &bgp_rr_allow_outbound_policy_cmd
);
14202 install_element (BGP_NODE
, &no_bgp_rr_allow_outbound_policy_cmd
);
14204 /* "bgp listen limit" commands. */
14205 install_element (BGP_NODE
, &bgp_listen_limit_cmd
);
14206 install_element (BGP_NODE
, &no_bgp_listen_limit_cmd
);
14207 install_element (BGP_NODE
, &no_bgp_listen_limit_val_cmd
);
14209 /* "bgp listen range" commands. */
14210 install_element (BGP_NODE
, &bgp_listen_range_cmd
);
14211 install_element (BGP_NODE
, &no_bgp_listen_range_cmd
);
14213 /* "neighbor remote-as" commands. */
14214 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
14215 install_element (BGP_NODE
, &neighbor_interface_config_cmd
);
14216 install_element (BGP_NODE
, &neighbor_interface_config_v6only_cmd
);
14217 install_element (BGP_NODE
, &neighbor_interface_config_peergroup_cmd
);
14218 install_element (BGP_NODE
, &neighbor_interface_config_v6only_peergroup_cmd
);
14219 install_element (BGP_NODE
, &neighbor_interface_config_remote_as_cmd
);
14220 install_element (BGP_NODE
, &neighbor_interface_v6only_config_remote_as_cmd
);
14221 install_element (BGP_NODE
, &no_neighbor_cmd
);
14222 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
14223 install_element (BGP_NODE
, &no_neighbor_interface_config_cmd
);
14224 install_element (BGP_NODE
, &no_neighbor_interface_config_v6only_cmd
);
14225 install_element (BGP_NODE
, &no_neighbor_interface_config_peergroup_cmd
);
14226 install_element (BGP_NODE
, &no_neighbor_interface_config_v6only_peergroup_cmd
);
14227 install_element (BGP_NODE
, &no_neighbor_interface_config_remote_as_cmd
);
14228 install_element (BGP_NODE
, &no_neighbor_interface_config_v6only_remote_as_cmd
);
14230 /* "neighbor peer-group" commands. */
14231 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
14232 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
14233 install_element (BGP_NODE
, &no_neighbor_interface_peer_group_remote_as_cmd
);
14235 /* "neighbor local-as" commands. */
14236 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
14237 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
14238 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_replace_as_cmd
);
14239 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
14240 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
14241 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
14242 install_element (BGP_NODE
, &no_neighbor_local_as_val3_cmd
);
14244 /* "neighbor solo" commands. */
14245 install_element (BGP_NODE
, &neighbor_solo_cmd
);
14246 install_element (BGP_NODE
, &no_neighbor_solo_cmd
);
14248 /* "neighbor password" commands. */
14249 install_element (BGP_NODE
, &neighbor_password_cmd
);
14250 install_element (BGP_NODE
, &no_neighbor_password_cmd
);
14251 install_element (BGP_NODE
, &no_neighbor_password_val_cmd
);
14253 /* "neighbor activate" commands. */
14254 install_element (BGP_NODE
, &neighbor_activate_cmd
);
14255 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
14256 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
14257 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
14258 install_element (BGP_IPV6M_NODE
, &neighbor_activate_cmd
);
14259 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
14260 install_element (BGP_VPNV6_NODE
, &neighbor_activate_cmd
);
14261 install_element (BGP_ENCAP_NODE
, &neighbor_activate_cmd
);
14262 install_element (BGP_ENCAPV6_NODE
, &neighbor_activate_cmd
);
14264 /* "no neighbor activate" commands. */
14265 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
14266 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
14267 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
14268 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
14269 install_element (BGP_IPV6M_NODE
, &no_neighbor_activate_cmd
);
14270 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
14271 install_element (BGP_VPNV6_NODE
, &no_neighbor_activate_cmd
);
14272 install_element (BGP_ENCAP_NODE
, &no_neighbor_activate_cmd
);
14273 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_activate_cmd
);
14275 /* "neighbor peer-group" set commands.
14276 * Long term we should only accept this command under BGP_NODE and not all of
14277 * the afi/safi sub-contexts. For now though we need to accept it for backwards
14278 * compatibility. This changed when we stopped requiring that peers be assigned
14279 * to their peer-group under each address-family sub-context.
14281 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
14282 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
14283 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
14284 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
14285 install_element (BGP_IPV6M_NODE
, &neighbor_set_peer_group_cmd
);
14286 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
14287 install_element (BGP_VPNV6_NODE
, &neighbor_set_peer_group_cmd
);
14288 install_element (BGP_ENCAP_NODE
, &neighbor_set_peer_group_cmd
);
14289 install_element (BGP_ENCAPV6_NODE
, &neighbor_set_peer_group_cmd
);
14291 /* "no neighbor peer-group unset" commands. */
14292 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
14293 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
14294 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
14295 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
14296 install_element (BGP_IPV6M_NODE
, &no_neighbor_set_peer_group_cmd
);
14297 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
14298 install_element (BGP_VPNV6_NODE
, &no_neighbor_set_peer_group_cmd
);
14299 install_element (BGP_ENCAP_NODE
, &no_neighbor_set_peer_group_cmd
);
14300 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
14302 /* "neighbor softreconfiguration inbound" commands.*/
14303 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
14304 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
14305 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
14306 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
14307 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
14308 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
14309 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
14310 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
14311 install_element (BGP_IPV6M_NODE
, &neighbor_soft_reconfiguration_cmd
);
14312 install_element (BGP_IPV6M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
14313 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
14314 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
14315 install_element (BGP_VPNV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
14316 install_element (BGP_VPNV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
14317 install_element (BGP_ENCAP_NODE
, &neighbor_soft_reconfiguration_cmd
);
14318 install_element (BGP_ENCAP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
14319 install_element (BGP_ENCAPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
14320 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
14322 /* "neighbor attribute-unchanged" commands. */
14323 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
14324 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
14325 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
14326 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
14327 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
14328 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
14329 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
14330 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
14331 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
14332 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
14333 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
14334 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
14335 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14336 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14337 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14338 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14339 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14340 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14341 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14342 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14343 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14344 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14345 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
14346 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
14347 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
14348 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
14349 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
14350 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
14351 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
14352 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
14353 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
14354 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
14355 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
14356 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
14357 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14358 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14359 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14360 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14361 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14362 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14363 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14364 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14365 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14366 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14367 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
14368 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
14369 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
14370 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
14371 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
14372 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
14373 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
14374 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
14375 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
14376 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
14377 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
14378 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
14379 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14380 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14381 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14382 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14383 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14384 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14385 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14386 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14387 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14388 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14389 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
14390 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
14391 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
14392 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
14393 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
14394 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
14395 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
14396 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
14397 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
14398 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
14399 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
14400 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
14401 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14402 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14403 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14404 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14405 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14406 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14407 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14408 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14409 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14410 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14411 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged_cmd
);
14412 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged1_cmd
);
14413 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged2_cmd
);
14414 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged3_cmd
);
14415 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged4_cmd
);
14416 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged5_cmd
);
14417 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged6_cmd
);
14418 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged7_cmd
);
14419 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged8_cmd
);
14420 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged9_cmd
);
14421 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged10_cmd
);
14422 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged_cmd
);
14423 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14424 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14425 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14426 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14427 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14428 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14429 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14430 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14431 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14432 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14433 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
14434 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
14435 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
14436 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
14437 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
14438 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
14439 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
14440 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
14441 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
14442 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
14443 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
14444 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
14445 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14446 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14447 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14448 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14449 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14450 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14451 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14452 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14453 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14454 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14455 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged_cmd
);
14456 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged1_cmd
);
14457 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged2_cmd
);
14458 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged3_cmd
);
14459 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged4_cmd
);
14460 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged5_cmd
);
14461 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged6_cmd
);
14462 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged7_cmd
);
14463 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged8_cmd
);
14464 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged9_cmd
);
14465 install_element (BGP_VPNV6_NODE
, &neighbor_attr_unchanged10_cmd
);
14466 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
14467 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14468 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14469 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14470 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14471 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14472 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14473 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14474 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14475 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14476 install_element (BGP_VPNV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14478 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged_cmd
);
14479 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged1_cmd
);
14480 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged2_cmd
);
14481 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged3_cmd
);
14482 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged4_cmd
);
14483 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged5_cmd
);
14484 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged6_cmd
);
14485 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged7_cmd
);
14486 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged8_cmd
);
14487 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged9_cmd
);
14488 install_element (BGP_ENCAP_NODE
, &neighbor_attr_unchanged10_cmd
);
14489 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged_cmd
);
14490 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14491 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14492 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14493 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14494 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14495 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14496 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14497 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14498 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14499 install_element (BGP_ENCAP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14501 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged_cmd
);
14502 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
14503 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
14504 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
14505 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
14506 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
14507 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
14508 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
14509 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
14510 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
14511 install_element (BGP_ENCAPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
14512 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
14513 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
14514 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
14515 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
14516 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
14517 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
14518 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
14519 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
14520 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
14521 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
14522 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
14524 /* "nexthop-local unchanged" commands */
14525 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_local_unchanged_cmd
);
14526 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_local_unchanged_cmd
);
14528 /* "neighbor next-hop-self" commands. */
14529 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
14530 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
14531 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
14532 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
14533 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
14534 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
14535 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
14536 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
14537 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_cmd
);
14538 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_cmd
);
14539 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
14540 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
14541 install_element (BGP_VPNV6_NODE
, &neighbor_nexthop_self_cmd
);
14542 install_element (BGP_VPNV6_NODE
, &no_neighbor_nexthop_self_cmd
);
14543 install_element (BGP_ENCAP_NODE
, &neighbor_nexthop_self_cmd
);
14544 install_element (BGP_ENCAP_NODE
, &no_neighbor_nexthop_self_cmd
);
14545 install_element (BGP_ENCAPV6_NODE
, &neighbor_nexthop_self_cmd
);
14546 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
14548 /* "neighbor next-hop-self force" commands. */
14549 install_element (BGP_NODE
, &neighbor_nexthop_self_force_cmd
);
14550 install_element (BGP_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14551 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_force_cmd
);
14552 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14553 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_force_cmd
);
14554 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14555 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_force_cmd
);
14556 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14557 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_force_cmd
);
14558 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14559 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_force_cmd
);
14560 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14561 install_element (BGP_VPNV6_NODE
, &neighbor_nexthop_self_force_cmd
);
14562 install_element (BGP_VPNV6_NODE
, &no_neighbor_nexthop_self_force_cmd
);
14564 /* "neighbor as-override" commands. */
14565 install_element (BGP_NODE
, &neighbor_as_override_cmd
);
14566 install_element (BGP_NODE
, &no_neighbor_as_override_cmd
);
14567 install_element (BGP_IPV4_NODE
, &neighbor_as_override_cmd
);
14568 install_element (BGP_IPV4_NODE
, &no_neighbor_as_override_cmd
);
14569 install_element (BGP_IPV4M_NODE
, &neighbor_as_override_cmd
);
14570 install_element (BGP_IPV4M_NODE
, &no_neighbor_as_override_cmd
);
14571 install_element (BGP_IPV6_NODE
, &neighbor_as_override_cmd
);
14572 install_element (BGP_IPV6_NODE
, &no_neighbor_as_override_cmd
);
14573 install_element (BGP_IPV6M_NODE
, &neighbor_as_override_cmd
);
14574 install_element (BGP_IPV6M_NODE
, &no_neighbor_as_override_cmd
);
14575 install_element (BGP_VPNV4_NODE
, &neighbor_as_override_cmd
);
14576 install_element (BGP_VPNV4_NODE
, &no_neighbor_as_override_cmd
);
14577 install_element (BGP_VPNV6_NODE
, &neighbor_as_override_cmd
);
14578 install_element (BGP_VPNV6_NODE
, &no_neighbor_as_override_cmd
);
14580 /* "neighbor remove-private-AS" commands. */
14581 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
14582 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
14583 install_element (BGP_NODE
, &neighbor_remove_private_as_all_cmd
);
14584 install_element (BGP_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14585 install_element (BGP_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14586 install_element (BGP_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14587 install_element (BGP_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14588 install_element (BGP_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14589 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
14590 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
14591 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_all_cmd
);
14592 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14593 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14594 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14595 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14596 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14597 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
14598 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
14599 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_all_cmd
);
14600 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14601 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14602 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14603 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14604 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14605 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
14606 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
14607 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_all_cmd
);
14608 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14609 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14610 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14611 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14612 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14613 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_cmd
);
14614 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_cmd
);
14615 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_all_cmd
);
14616 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14617 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14618 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14619 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14620 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14621 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
14622 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
14623 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_all_cmd
);
14624 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14625 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14626 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14627 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14628 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14629 install_element (BGP_VPNV6_NODE
, &neighbor_remove_private_as_cmd
);
14630 install_element (BGP_VPNV6_NODE
, &no_neighbor_remove_private_as_cmd
);
14631 install_element (BGP_VPNV6_NODE
, &neighbor_remove_private_as_all_cmd
);
14632 install_element (BGP_VPNV6_NODE
, &no_neighbor_remove_private_as_all_cmd
);
14633 install_element (BGP_VPNV6_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
14634 install_element (BGP_VPNV6_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
14635 install_element (BGP_VPNV6_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
14636 install_element (BGP_VPNV6_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
14637 install_element (BGP_ENCAP_NODE
, &neighbor_remove_private_as_cmd
);
14638 install_element (BGP_ENCAP_NODE
, &no_neighbor_remove_private_as_cmd
);
14639 install_element (BGP_ENCAPV6_NODE
, &neighbor_remove_private_as_cmd
);
14640 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
14642 /* "neighbor send-community" commands.*/
14643 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
14644 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
14645 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
14646 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
14647 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
14648 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
14649 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
14650 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
14651 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
14652 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
14653 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
14654 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
14655 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
14656 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
14657 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
14658 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
14659 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_cmd
);
14660 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_type_cmd
);
14661 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_cmd
);
14662 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_type_cmd
);
14663 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
14664 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
14665 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
14666 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
14667 install_element (BGP_VPNV6_NODE
, &neighbor_send_community_cmd
);
14668 install_element (BGP_VPNV6_NODE
, &neighbor_send_community_type_cmd
);
14669 install_element (BGP_VPNV6_NODE
, &no_neighbor_send_community_cmd
);
14670 install_element (BGP_VPNV6_NODE
, &no_neighbor_send_community_type_cmd
);
14671 install_element (BGP_ENCAP_NODE
, &neighbor_send_community_cmd
);
14672 install_element (BGP_ENCAP_NODE
, &neighbor_send_community_type_cmd
);
14673 install_element (BGP_ENCAP_NODE
, &no_neighbor_send_community_cmd
);
14674 install_element (BGP_ENCAP_NODE
, &no_neighbor_send_community_type_cmd
);
14675 install_element (BGP_ENCAPV6_NODE
, &neighbor_send_community_cmd
);
14676 install_element (BGP_ENCAPV6_NODE
, &neighbor_send_community_type_cmd
);
14677 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_send_community_cmd
);
14678 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_send_community_type_cmd
);
14680 /* "neighbor route-reflector" commands.*/
14681 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
14682 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
14683 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
14684 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
14685 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
14686 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
14687 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
14688 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
14689 install_element (BGP_IPV6M_NODE
, &neighbor_route_reflector_client_cmd
);
14690 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_reflector_client_cmd
);
14691 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
14692 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
14693 install_element (BGP_VPNV6_NODE
, &neighbor_route_reflector_client_cmd
);
14694 install_element (BGP_VPNV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
14695 install_element (BGP_ENCAP_NODE
, &neighbor_route_reflector_client_cmd
);
14696 install_element (BGP_ENCAP_NODE
, &no_neighbor_route_reflector_client_cmd
);
14697 install_element (BGP_ENCAPV6_NODE
, &neighbor_route_reflector_client_cmd
);
14698 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
14700 /* "neighbor route-server" commands.*/
14701 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
14702 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
14703 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
14704 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
14705 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
14706 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
14707 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
14708 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
14709 install_element (BGP_IPV6M_NODE
, &neighbor_route_server_client_cmd
);
14710 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_server_client_cmd
);
14711 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
14712 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
14713 install_element (BGP_VPNV6_NODE
, &neighbor_route_server_client_cmd
);
14714 install_element (BGP_VPNV6_NODE
, &no_neighbor_route_server_client_cmd
);
14715 install_element (BGP_ENCAP_NODE
, &neighbor_route_server_client_cmd
);
14716 install_element (BGP_ENCAP_NODE
, &no_neighbor_route_server_client_cmd
);
14717 install_element (BGP_ENCAPV6_NODE
, &neighbor_route_server_client_cmd
);
14718 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_route_server_client_cmd
);
14720 /* "neighbor addpath-tx-all-paths" commands.*/
14721 install_element (BGP_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14722 install_element (BGP_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14723 install_element (BGP_IPV4_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14724 install_element (BGP_IPV4_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14725 install_element (BGP_IPV4M_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14726 install_element (BGP_IPV4M_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14727 install_element (BGP_IPV6_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14728 install_element (BGP_IPV6_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14729 install_element (BGP_IPV6M_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14730 install_element (BGP_IPV6M_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14731 install_element (BGP_VPNV4_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14732 install_element (BGP_VPNV4_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14733 install_element (BGP_VPNV6_NODE
, &neighbor_addpath_tx_all_paths_cmd
);
14734 install_element (BGP_VPNV6_NODE
, &no_neighbor_addpath_tx_all_paths_cmd
);
14736 /* "neighbor addpath-tx-bestpath-per-AS" commands.*/
14737 install_element (BGP_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14738 install_element (BGP_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14739 install_element (BGP_IPV4_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14740 install_element (BGP_IPV4_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14741 install_element (BGP_IPV4M_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14742 install_element (BGP_IPV4M_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14743 install_element (BGP_IPV6_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14744 install_element (BGP_IPV6_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14745 install_element (BGP_IPV6M_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14746 install_element (BGP_IPV6M_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14747 install_element (BGP_VPNV4_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14748 install_element (BGP_VPNV4_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14749 install_element (BGP_VPNV6_NODE
, &neighbor_addpath_tx_bestpath_per_as_cmd
);
14750 install_element (BGP_VPNV6_NODE
, &no_neighbor_addpath_tx_bestpath_per_as_cmd
);
14752 /* "neighbor passive" commands. */
14753 install_element (BGP_NODE
, &neighbor_passive_cmd
);
14754 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
14757 /* "neighbor shutdown" commands. */
14758 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
14759 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
14761 /* "neighbor capability extended-nexthop" commands.*/
14762 install_element (BGP_NODE
, &neighbor_capability_enhe_cmd
);
14763 install_element (BGP_NODE
, &no_neighbor_capability_enhe_cmd
);
14765 /* "neighbor capability orf prefix-list" commands.*/
14766 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
14767 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
14768 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
14769 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
14770 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
14771 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
14772 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
14773 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
14774 install_element (BGP_IPV6M_NODE
, &neighbor_capability_orf_prefix_cmd
);
14775 install_element (BGP_IPV6M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
14777 /* "neighbor capability dynamic" commands.*/
14778 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
14779 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
14781 /* "neighbor dont-capability-negotiate" commands. */
14782 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
14783 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
14785 /* "neighbor ebgp-multihop" commands. */
14786 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
14787 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
14788 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
14789 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
14791 /* "neighbor disable-connected-check" commands. */
14792 install_element (BGP_NODE
, &neighbor_disable_connected_check_cmd
);
14793 install_element (BGP_NODE
, &no_neighbor_disable_connected_check_cmd
);
14794 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
14795 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
14797 /* "neighbor description" commands. */
14798 install_element (BGP_NODE
, &neighbor_description_cmd
);
14799 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
14800 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
14802 /* "neighbor update-source" commands. "*/
14803 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
14804 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
14806 /* "neighbor default-originate" commands. */
14807 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
14808 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
14809 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
14810 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
14811 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
14812 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
14813 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
14814 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
14815 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
14816 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
14817 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
14818 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
14819 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
14820 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
14821 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
14822 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
14823 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_cmd
);
14824 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_rmap_cmd
);
14825 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_cmd
);
14826 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
14828 /* "neighbor port" commands. */
14829 install_element (BGP_NODE
, &neighbor_port_cmd
);
14830 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
14831 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
14833 /* "neighbor weight" commands. */
14834 install_element (BGP_NODE
, &neighbor_weight_cmd
);
14835 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
14836 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
14837 install_element (BGP_IPV4_NODE
, &neighbor_weight_cmd
);
14838 install_element (BGP_IPV4_NODE
, &no_neighbor_weight_cmd
);
14839 install_element (BGP_IPV4_NODE
, &no_neighbor_weight_val_cmd
);
14840 install_element (BGP_IPV4M_NODE
, &neighbor_weight_cmd
);
14841 install_element (BGP_IPV4M_NODE
, &no_neighbor_weight_cmd
);
14842 install_element (BGP_IPV4M_NODE
, &no_neighbor_weight_val_cmd
);
14843 install_element (BGP_IPV6_NODE
, &neighbor_weight_cmd
);
14844 install_element (BGP_IPV6_NODE
, &no_neighbor_weight_cmd
);
14845 install_element (BGP_IPV6_NODE
, &no_neighbor_weight_val_cmd
);
14846 install_element (BGP_IPV6M_NODE
, &neighbor_weight_cmd
);
14847 install_element (BGP_IPV6M_NODE
, &no_neighbor_weight_cmd
);
14848 install_element (BGP_IPV6M_NODE
, &no_neighbor_weight_val_cmd
);
14849 install_element (BGP_VPNV4_NODE
, &neighbor_weight_cmd
);
14850 install_element (BGP_VPNV4_NODE
, &no_neighbor_weight_cmd
);
14851 install_element (BGP_VPNV4_NODE
, &no_neighbor_weight_val_cmd
);
14852 install_element (BGP_VPNV6_NODE
, &neighbor_weight_cmd
);
14853 install_element (BGP_VPNV6_NODE
, &no_neighbor_weight_cmd
);
14854 install_element (BGP_VPNV6_NODE
, &no_neighbor_weight_val_cmd
);
14855 install_element (BGP_ENCAP_NODE
, &neighbor_weight_cmd
);
14856 install_element (BGP_ENCAP_NODE
, &no_neighbor_weight_cmd
);
14857 install_element (BGP_ENCAP_NODE
, &no_neighbor_weight_val_cmd
);
14858 install_element (BGP_ENCAPV6_NODE
, &neighbor_weight_cmd
);
14859 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_weight_cmd
);
14860 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_weight_val_cmd
);
14862 /* "neighbor override-capability" commands. */
14863 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
14864 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
14866 /* "neighbor strict-capability-match" commands. */
14867 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
14868 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
14870 /* "neighbor timers" commands. */
14871 install_element (BGP_NODE
, &neighbor_timers_cmd
);
14872 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
14873 install_element (BGP_NODE
, &no_neighbor_timers_val_cmd
);
14875 /* "neighbor timers connect" commands. */
14876 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
14877 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
14878 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
14880 /* "neighbor advertisement-interval" commands. */
14881 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
14882 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
14883 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
14885 /* "neighbor interface" commands. */
14886 install_element (BGP_NODE
, &neighbor_interface_cmd
);
14887 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
14889 /* "neighbor distribute" commands. */
14890 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
14891 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
14892 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
14893 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
14894 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
14895 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
14896 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
14897 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
14898 install_element (BGP_IPV6M_NODE
, &neighbor_distribute_list_cmd
);
14899 install_element (BGP_IPV6M_NODE
, &no_neighbor_distribute_list_cmd
);
14900 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
14901 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
14902 install_element (BGP_VPNV6_NODE
, &neighbor_distribute_list_cmd
);
14903 install_element (BGP_VPNV6_NODE
, &no_neighbor_distribute_list_cmd
);
14904 install_element (BGP_ENCAP_NODE
, &neighbor_distribute_list_cmd
);
14905 install_element (BGP_ENCAP_NODE
, &no_neighbor_distribute_list_cmd
);
14906 install_element (BGP_ENCAPV6_NODE
, &neighbor_distribute_list_cmd
);
14907 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_distribute_list_cmd
);
14909 /* "neighbor prefix-list" commands. */
14910 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
14911 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
14912 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
14913 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
14914 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
14915 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
14916 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
14917 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
14918 install_element (BGP_IPV6M_NODE
, &neighbor_prefix_list_cmd
);
14919 install_element (BGP_IPV6M_NODE
, &no_neighbor_prefix_list_cmd
);
14920 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
14921 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
14922 install_element (BGP_VPNV6_NODE
, &neighbor_prefix_list_cmd
);
14923 install_element (BGP_VPNV6_NODE
, &no_neighbor_prefix_list_cmd
);
14924 install_element (BGP_ENCAP_NODE
, &neighbor_prefix_list_cmd
);
14925 install_element (BGP_ENCAP_NODE
, &no_neighbor_prefix_list_cmd
);
14926 install_element (BGP_ENCAPV6_NODE
, &neighbor_prefix_list_cmd
);
14927 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_prefix_list_cmd
);
14929 /* "neighbor filter-list" commands. */
14930 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
14931 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
14932 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
14933 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
14934 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
14935 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
14936 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
14937 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
14938 install_element (BGP_IPV6M_NODE
, &neighbor_filter_list_cmd
);
14939 install_element (BGP_IPV6M_NODE
, &no_neighbor_filter_list_cmd
);
14940 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
14941 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
14942 install_element (BGP_VPNV6_NODE
, &neighbor_filter_list_cmd
);
14943 install_element (BGP_VPNV6_NODE
, &no_neighbor_filter_list_cmd
);
14944 install_element (BGP_ENCAP_NODE
, &neighbor_filter_list_cmd
);
14945 install_element (BGP_ENCAP_NODE
, &no_neighbor_filter_list_cmd
);
14946 install_element (BGP_ENCAPV6_NODE
, &neighbor_filter_list_cmd
);
14947 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_filter_list_cmd
);
14949 /* "neighbor route-map" commands. */
14950 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
14951 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
14952 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
14953 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
14954 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
14955 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
14956 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
14957 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
14958 install_element (BGP_IPV6M_NODE
, &neighbor_route_map_cmd
);
14959 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_map_cmd
);
14960 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
14961 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
14962 install_element (BGP_VPNV6_NODE
, &neighbor_route_map_cmd
);
14963 install_element (BGP_VPNV6_NODE
, &no_neighbor_route_map_cmd
);
14964 install_element (BGP_ENCAP_NODE
, &neighbor_route_map_cmd
);
14965 install_element (BGP_ENCAP_NODE
, &no_neighbor_route_map_cmd
);
14966 install_element (BGP_ENCAPV6_NODE
, &neighbor_route_map_cmd
);
14967 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_route_map_cmd
);
14969 /* "neighbor unsuppress-map" commands. */
14970 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
14971 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
14972 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
14973 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
14974 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
14975 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
14976 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
14977 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
14978 install_element (BGP_IPV6M_NODE
, &neighbor_unsuppress_map_cmd
);
14979 install_element (BGP_IPV6M_NODE
, &no_neighbor_unsuppress_map_cmd
);
14980 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
14981 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
14982 install_element (BGP_VPNV6_NODE
, &neighbor_unsuppress_map_cmd
);
14983 install_element (BGP_VPNV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
14984 install_element (BGP_ENCAP_NODE
, &neighbor_unsuppress_map_cmd
);
14985 install_element (BGP_ENCAP_NODE
, &no_neighbor_unsuppress_map_cmd
);
14986 install_element (BGP_ENCAPV6_NODE
, &neighbor_unsuppress_map_cmd
);
14987 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
14989 /* "neighbor maximum-prefix" commands. */
14990 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
14991 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
14992 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
14993 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
14994 install_element (BGP_NODE
, &neighbor_maximum_prefix_restart_cmd
);
14995 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
14996 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
14997 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
14998 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
14999 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
15000 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
15001 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
15002 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
15003 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
15004 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
15005 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
15006 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
15007 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
15008 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
15009 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
15010 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
15011 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
15012 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
15013 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
15014 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
15015 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
15016 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
15017 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
15018 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
15019 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
15020 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
15021 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
15022 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
15023 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
15024 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
15025 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
15026 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
15027 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
15028 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
15029 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
15030 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
15031 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
15032 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
15033 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
15034 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
15035 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
15036 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
15037 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
15038 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
15039 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
15040 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
15041 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
15042 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_cmd
);
15043 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
15044 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
15045 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
15046 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
15047 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
15048 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_cmd
);
15049 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
15050 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
15051 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
15052 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
15053 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
15054 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
15055 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
15056 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
15057 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
15058 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
15059 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
15060 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
15061 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
15062 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
15063 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
15064 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
15065 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
15066 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
15067 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
15068 install_element (BGP_VPNV6_NODE
, &neighbor_maximum_prefix_cmd
);
15069 install_element (BGP_VPNV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
15070 install_element (BGP_VPNV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
15071 install_element (BGP_VPNV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
15072 install_element (BGP_VPNV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
15073 install_element (BGP_VPNV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
15074 install_element (BGP_VPNV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
15075 install_element (BGP_VPNV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
15076 install_element (BGP_VPNV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
15077 install_element (BGP_VPNV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
15078 install_element (BGP_VPNV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
15079 install_element (BGP_VPNV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
15080 install_element (BGP_VPNV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
15082 install_element (BGP_ENCAP_NODE
, &neighbor_maximum_prefix_cmd
);
15083 install_element (BGP_ENCAP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
15084 install_element (BGP_ENCAP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
15085 install_element (BGP_ENCAP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
15086 install_element (BGP_ENCAP_NODE
, &neighbor_maximum_prefix_restart_cmd
);
15087 install_element (BGP_ENCAP_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
15088 install_element (BGP_ENCAP_NODE
, &no_neighbor_maximum_prefix_cmd
);
15089 install_element (BGP_ENCAP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
15090 install_element (BGP_ENCAP_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
15091 install_element (BGP_ENCAP_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
15092 install_element (BGP_ENCAP_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
15093 install_element (BGP_ENCAP_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
15094 install_element (BGP_ENCAP_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
15096 install_element (BGP_ENCAPV6_NODE
, &neighbor_maximum_prefix_cmd
);
15097 install_element (BGP_ENCAPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
15098 install_element (BGP_ENCAPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
15099 install_element (BGP_ENCAPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
15100 install_element (BGP_ENCAPV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
15101 install_element (BGP_ENCAPV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
15102 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
15103 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
15104 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
15105 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
15106 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
15107 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
15108 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
15110 /* "neighbor allowas-in" */
15111 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
15112 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
15113 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
15114 install_element (BGP_NODE
, &no_neighbor_allowas_in_val_cmd
);
15115 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
15116 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
15117 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
15118 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_val_cmd
);
15119 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
15120 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
15121 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
15122 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_val_cmd
);
15123 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
15124 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
15125 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
15126 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_val_cmd
);
15127 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_cmd
);
15128 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_arg_cmd
);
15129 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_cmd
);
15130 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_val_cmd
);
15131 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
15132 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
15133 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
15134 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_val_cmd
);
15135 install_element (BGP_VPNV6_NODE
, &neighbor_allowas_in_cmd
);
15136 install_element (BGP_VPNV6_NODE
, &neighbor_allowas_in_arg_cmd
);
15137 install_element (BGP_VPNV6_NODE
, &no_neighbor_allowas_in_cmd
);
15138 install_element (BGP_VPNV6_NODE
, &no_neighbor_allowas_in_val_cmd
);
15139 install_element (BGP_ENCAP_NODE
, &neighbor_allowas_in_cmd
);
15140 install_element (BGP_ENCAP_NODE
, &neighbor_allowas_in_arg_cmd
);
15141 install_element (BGP_ENCAP_NODE
, &no_neighbor_allowas_in_cmd
);
15142 install_element (BGP_ENCAPV6_NODE
, &neighbor_allowas_in_cmd
);
15143 install_element (BGP_ENCAPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
15144 install_element (BGP_ENCAPV6_NODE
, &no_neighbor_allowas_in_cmd
);
15146 /* address-family commands. */
15147 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
15148 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
15149 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
15150 install_element (BGP_NODE
, &address_family_ipv6_safi_cmd
);
15151 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
15152 install_element (BGP_NODE
, &address_family_vpnv6_cmd
);
15153 install_element (BGP_NODE
, &address_family_encap_cmd
);
15154 install_element (BGP_NODE
, &address_family_encapv4_cmd
);
15155 install_element (BGP_NODE
, &address_family_encapv6_cmd
);
15157 /* "exit-address-family" command. */
15158 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
15159 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
15160 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
15161 install_element (BGP_IPV6M_NODE
, &exit_address_family_cmd
);
15162 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
15163 install_element (BGP_VPNV6_NODE
, &exit_address_family_cmd
);
15164 install_element (BGP_ENCAP_NODE
, &exit_address_family_cmd
);
15165 install_element (BGP_ENCAPV6_NODE
, &exit_address_family_cmd
);
15167 /* "clear ip bgp commands" */
15168 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
15169 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
15170 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
15171 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_cmd
);
15172 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
15173 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_cmd
);
15174 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
15175 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_cmd
);
15176 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
15177 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_cmd
);
15179 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
15180 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
15181 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
15182 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_cmd
);
15183 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
15184 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_cmd
);
15185 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
15186 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_cmd
);
15187 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
15188 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_cmd
);
15189 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
15190 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_cmd
);
15191 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
15192 install_element (ENABLE_NODE
, &clear_bgp_instance_external_cmd
);
15193 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
15194 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_cmd
);
15195 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
15196 install_element (ENABLE_NODE
, &clear_bgp_instance_as_cmd
);
15197 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
15198 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_cmd
);
15200 /* "clear ip bgp neighbor soft in" */
15201 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
15202 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
15203 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
15204 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_cmd
);
15205 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
15206 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
15207 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_soft_in_cmd
);
15208 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
15209 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_in_cmd
);
15210 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
15211 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
15212 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_soft_in_cmd
);
15213 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
15214 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_in_cmd
);
15215 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
15216 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
15217 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_soft_in_cmd
);
15218 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
15219 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_in_cmd
);
15220 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
15221 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
15222 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_soft_in_cmd
);
15223 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
15224 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_in_cmd
);
15225 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
15226 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
15227 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
15228 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
15229 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_cmd
);
15230 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
15231 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
15232 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_ipv4_soft_in_cmd
);
15233 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
15234 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_ipv4_in_cmd
);
15235 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
15236 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
15237 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_ipv4_soft_in_cmd
);
15238 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
15239 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_ipv4_in_cmd
);
15240 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
15241 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
15242 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_ipv4_soft_in_cmd
);
15243 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
15244 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_ipv4_in_cmd
);
15245 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
15246 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
15247 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_ipv4_soft_in_cmd
);
15248 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
15249 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_ipv4_in_cmd
);
15250 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
15251 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
15252 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
15253 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
15254 install_element (ENABLE_NODE
, &clear_bgp_instance_all_in_cmd
);
15255 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
15256 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
15257 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_soft_in_cmd
);
15258 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
15259 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_in_cmd
);
15260 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
15261 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
15262 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_soft_in_cmd
);
15263 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
15264 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_in_cmd
);
15265 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
15266 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
15267 install_element (ENABLE_NODE
, &clear_bgp_instance_external_soft_in_cmd
);
15268 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
15269 install_element (ENABLE_NODE
, &clear_bgp_instance_external_in_cmd
);
15270 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
15271 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
15272 install_element (ENABLE_NODE
, &clear_bgp_instance_as_soft_in_cmd
);
15273 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
15274 install_element (ENABLE_NODE
, &clear_bgp_instance_as_in_cmd
);
15275 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
15276 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
15277 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_soft_in_cmd
);
15278 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
15279 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_in_cmd
);
15280 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
15281 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
15282 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_soft_in_cmd
);
15283 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
15284 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_in_cmd
);
15285 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
15286 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
15287 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_soft_in_cmd
);
15288 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
15289 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_in_cmd
);
15290 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
15291 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
15292 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_soft_in_cmd
);
15293 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
15294 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_in_cmd
);
15295 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
15296 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
15297 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_soft_in_cmd
);
15298 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
15299 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_in_cmd
);
15300 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
15302 /* clear ip bgp prefix */
15303 install_element (ENABLE_NODE
, &clear_ip_bgp_prefix_cmd
);
15304 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_prefix_cmd
);
15305 install_element (ENABLE_NODE
, &clear_bgp_ipv6_safi_prefix_cmd
);
15306 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_safi_prefix_cmd
);
15308 /* "clear ip bgp neighbor soft out" */
15309 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
15310 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
15311 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
15312 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_out_cmd
);
15313 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
15314 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_soft_out_cmd
);
15315 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
15316 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_out_cmd
);
15317 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
15318 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_soft_out_cmd
);
15319 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
15320 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_out_cmd
);
15321 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
15322 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_soft_out_cmd
);
15323 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
15324 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_out_cmd
);
15325 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
15326 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_soft_out_cmd
);
15327 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
15328 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_out_cmd
);
15329 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
15330 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
15331 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
15332 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_out_cmd
);
15333 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
15334 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_ipv4_soft_out_cmd
);
15335 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
15336 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_ipv4_out_cmd
);
15337 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
15338 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_ipv4_soft_out_cmd
);
15339 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
15340 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_ipv4_out_cmd
);
15341 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
15342 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_ipv4_soft_out_cmd
);
15343 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
15344 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_ipv4_out_cmd
);
15345 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
15346 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_ipv4_soft_out_cmd
);
15347 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
15348 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_ipv4_out_cmd
);
15349 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
15350 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
15351 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
15352 install_element (ENABLE_NODE
, &clear_bgp_instance_all_out_cmd
);
15353 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
15354 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_soft_out_cmd
);
15355 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
15356 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_out_cmd
);
15357 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
15358 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_soft_out_cmd
);
15359 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
15360 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_out_cmd
);
15361 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
15362 install_element (ENABLE_NODE
, &clear_bgp_instance_external_soft_out_cmd
);
15363 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
15364 install_element (ENABLE_NODE
, &clear_bgp_instance_external_out_cmd
);
15365 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
15366 install_element (ENABLE_NODE
, &clear_bgp_instance_as_soft_out_cmd
);
15367 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
15368 install_element (ENABLE_NODE
, &clear_bgp_instance_as_out_cmd
);
15369 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
15370 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_soft_out_cmd
);
15371 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
15372 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_out_cmd
);
15373 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
15374 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_soft_out_cmd
);
15375 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
15376 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_out_cmd
);
15377 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
15378 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_soft_out_cmd
);
15379 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
15380 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_out_cmd
);
15381 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
15382 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_soft_out_cmd
);
15383 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
15384 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_out_cmd
);
15385 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
15386 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_soft_out_cmd
);
15387 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
15388 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_out_cmd
);
15390 /* "clear ip bgp neighbor soft" */
15391 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
15392 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
15393 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
15394 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_soft_cmd
);
15395 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
15396 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_soft_cmd
);
15397 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
15398 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_soft_cmd
);
15399 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
15400 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_soft_cmd
);
15401 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
15402 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
15403 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
15404 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_ipv4_soft_cmd
);
15405 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
15406 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_group_ipv4_soft_cmd
);
15407 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
15408 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_external_ipv4_soft_cmd
);
15409 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
15410 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_as_ipv4_soft_cmd
);
15411 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
15412 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
15413 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
15414 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_soft_cmd
);
15415 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
15416 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_group_soft_cmd
);
15417 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
15418 install_element (ENABLE_NODE
, &clear_bgp_instance_external_soft_cmd
);
15419 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
15420 install_element (ENABLE_NODE
, &clear_bgp_instance_as_soft_cmd
);
15421 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
15422 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_all_soft_cmd
);
15423 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
15424 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_soft_cmd
);
15425 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
15426 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_peer_group_soft_cmd
);
15427 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
15428 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_external_soft_cmd
);
15429 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
15430 install_element (ENABLE_NODE
, &clear_bgp_instance_ipv6_as_soft_cmd
);
15432 /* "show ip bgp summary" commands. */
15433 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
15434 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_cmd
);
15435 install_element (VIEW_NODE
, &show_ip_bgp_instance_updgrps_cmd
);
15436 install_element (VIEW_NODE
, &show_ip_bgp_instance_all_updgrps_cmd
);
15437 install_element (VIEW_NODE
, &show_bgp_updgrps_cmd
);
15438 install_element (VIEW_NODE
, &show_bgp_ipv6_updgrps_cmd
);
15439 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_updgrps_cmd
);
15440 install_element (VIEW_NODE
, &show_bgp_instance_all_ipv6_updgrps_cmd
);
15441 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_s_cmd
);
15442 install_element (VIEW_NODE
, &show_ip_bgp_instance_updgrps_s_cmd
);
15443 install_element (VIEW_NODE
, &show_bgp_updgrps_s_cmd
);
15444 install_element (VIEW_NODE
, &show_bgp_ipv6_updgrps_s_cmd
);
15445 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_updgrps_s_cmd
);
15446 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_adj_cmd
);
15447 install_element (VIEW_NODE
, &show_ip_bgp_instance_updgrps_adj_cmd
);
15448 install_element (VIEW_NODE
, &show_bgp_updgrps_adj_cmd
);
15449 install_element (VIEW_NODE
, &show_bgp_instance_updgrps_adj_cmd
);
15450 install_element (VIEW_NODE
, &show_bgp_updgrps_afi_adj_cmd
);
15451 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_adj_s_cmd
);
15452 install_element (VIEW_NODE
, &show_ip_bgp_instance_updgrps_adj_s_cmd
);
15453 install_element (VIEW_NODE
, &show_bgp_updgrps_adj_s_cmd
);
15454 install_element (VIEW_NODE
, &show_bgp_instance_updgrps_adj_s_cmd
);
15455 install_element (VIEW_NODE
, &show_bgp_updgrps_afi_adj_s_cmd
);
15456 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
15457 install_element (VIEW_NODE
, &show_ip_bgp_instance_all_summary_cmd
);
15458 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
15459 install_element (VIEW_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
15460 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
15461 install_element (VIEW_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
15462 install_element (VIEW_NODE
, &show_bgp_ipv4_summary_cmd
);
15463 install_element (VIEW_NODE
, &show_bgp_instance_ipv4_summary_cmd
);
15464 install_element (VIEW_NODE
, &show_bgp_instance_ipv4_all_summary_cmd
);
15465 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
15466 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
15467 install_element (VIEW_NODE
, &show_bgp_instance_all_summary_cmd
);
15468 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
15469 install_element (VIEW_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
15470 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
15471 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_all_summary_cmd
);
15472 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
15474 /* "show ip bgp neighbors" commands. */
15475 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
15476 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
15477 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
15478 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
15479 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
15480 install_element (VIEW_NODE
, &show_ip_bgp_instance_all_neighbors_cmd
);
15481 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
15483 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
15484 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
15485 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
15486 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
15487 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
15488 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
15489 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
15490 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
15492 /* Old commands. */
15493 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
15494 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
15496 /* "show ip bgp peer-group" commands. */
15497 install_element (VIEW_NODE
, &show_ip_bgp_peer_groups_cmd
);
15498 install_element (VIEW_NODE
, &show_ip_bgp_instance_peer_groups_cmd
);
15499 install_element (VIEW_NODE
, &show_ip_bgp_peer_group_cmd
);
15500 install_element (VIEW_NODE
, &show_ip_bgp_instance_peer_group_cmd
);
15502 /* "show ip bgp paths" commands. */
15503 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
15504 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
15506 /* "show ip bgp community" commands. */
15507 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
15509 /* "show ip bgp attribute-info" commands. */
15510 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
15512 /* "redistribute" commands. */
15513 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
15514 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
15515 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
15516 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
15517 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
15518 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
15519 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
15520 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
15521 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
15522 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
15523 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_cmd
);
15524 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_cmd
);
15525 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_rmap_cmd
);
15526 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_cmd
);
15527 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_metric_cmd
);
15528 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_cmd
);
15529 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
15530 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
15531 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
15532 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
15533 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_cmd
);
15534 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_cmd
);
15535 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
15536 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
15537 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
15538 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
15539 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
15540 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
15541 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
15542 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
15543 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_ospf_cmd
);
15544 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_ospf_cmd
);
15545 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_ospf_rmap_cmd
);
15546 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_cmd
);
15547 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_ospf_metric_cmd
);
15548 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_cmd
);
15549 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
15550 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
15551 install_element (BGP_IPV4_NODE
, &bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
15552 install_element (BGP_IPV4_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
15553 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
15554 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
15555 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
15556 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
15557 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
15558 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
15559 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
15560 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
15561 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
15562 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
15564 /* ttl_security commands */
15565 install_element (BGP_NODE
, &neighbor_ttl_security_cmd
);
15566 install_element (BGP_NODE
, &no_neighbor_ttl_security_cmd
);
15568 /* "show bgp memory" commands. */
15569 install_element (VIEW_NODE
, &show_bgp_memory_cmd
);
15571 /* "show bgp views" commands. */
15572 install_element (VIEW_NODE
, &show_bgp_views_cmd
);
15574 /* "show bgp vrfs" commands. */
15575 install_element (VIEW_NODE
, &show_bgp_vrfs_cmd
);
15577 /* Community-list. */
15578 community_list_vty ();
15581 #include "memory.h"
15582 #include "bgp_regex.h"
15583 #include "bgp_clist.h"
15584 #include "bgp_ecommunity.h"
15586 /* VTY functions. */
15588 /* Direction value to string conversion. */
15589 static const char *
15590 community_direct_str (int direct
)
15594 case COMMUNITY_DENY
:
15596 case COMMUNITY_PERMIT
:
15603 /* Display error string. */
15605 community_list_perror (struct vty
*vty
, int ret
)
15609 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
15610 vty_out (vty
, "%% Can't find community-list%s", VTY_NEWLINE
);
15612 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
15613 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
15615 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
15616 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
15618 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
15619 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
15624 /* VTY interface for community_set() function. */
15626 community_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
15627 int style
, int reject_all_digit_name
)
15633 /* Check the list type. */
15634 if (strncmp (argv
[1], "p", 1) == 0)
15635 direct
= COMMUNITY_PERMIT
;
15636 else if (strncmp (argv
[1], "d", 1) == 0)
15637 direct
= COMMUNITY_DENY
;
15640 vty_out (vty
, "%% Matching condition must be permit or deny%s",
15642 return CMD_WARNING
;
15645 /* All digit name check. */
15646 if (reject_all_digit_name
&& all_digit (argv
[0]))
15648 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
15649 return CMD_WARNING
;
15652 /* Concat community string argument. */
15654 str
= argv_concat (argv
, argc
, 2);
15658 /* When community_list_set() return nevetive value, it means
15659 malformed community string. */
15660 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
15662 /* Free temporary community list string allocated by
15665 XFREE (MTYPE_TMP
, str
);
15669 /* Display error string. */
15670 community_list_perror (vty
, ret
);
15671 return CMD_WARNING
;
15674 return CMD_SUCCESS
;
15677 /* Communiyt-list entry delete. */
15679 community_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
15680 int style
, int delete_all
)
15688 /* Check the list direct. */
15689 if (strncmp (argv
[1], "p", 1) == 0)
15690 direct
= COMMUNITY_PERMIT
;
15691 else if (strncmp (argv
[1], "d", 1) == 0)
15692 direct
= COMMUNITY_DENY
;
15695 vty_out (vty
, "%% Matching condition must be permit or deny%s",
15697 return CMD_WARNING
;
15700 /* Concat community string argument. */
15701 str
= argv_concat (argv
, argc
, 2);
15704 /* Unset community list. */
15705 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
, delete_all
);
15707 /* Free temporary community list string allocated by
15710 XFREE (MTYPE_TMP
, str
);
15714 community_list_perror (vty
, ret
);
15715 return CMD_WARNING
;
15718 return CMD_SUCCESS
;
15721 /* "community-list" keyword help string. */
15722 #define COMMUNITY_LIST_STR "Add a community list entry\n"
15724 DEFUN (ip_community_list_standard
,
15725 ip_community_list_standard_cmd
,
15726 "ip community-list <1-99> (deny|permit) .AA:NN",
15729 "Community list number (standard)\n"
15730 "Specify community to reject\n"
15731 "Specify community to accept\n"
15734 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
15737 ALIAS (ip_community_list_standard
,
15738 ip_community_list_standard2_cmd
,
15739 "ip community-list <1-99> (deny|permit)",
15742 "Community list number (standard)\n"
15743 "Specify community to reject\n"
15744 "Specify community to accept\n")
15746 DEFUN (ip_community_list_expanded
,
15747 ip_community_list_expanded_cmd
,
15748 "ip community-list <100-500> (deny|permit) .LINE",
15751 "Community list number (expanded)\n"
15752 "Specify community to reject\n"
15753 "Specify community to accept\n"
15754 "An ordered list as a regular-expression\n")
15756 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
15759 DEFUN (ip_community_list_name_standard
,
15760 ip_community_list_name_standard_cmd
,
15761 "ip community-list standard WORD (deny|permit) .AA:NN",
15764 "Add a standard community-list entry\n"
15765 "Community list name\n"
15766 "Specify community to reject\n"
15767 "Specify community to accept\n"
15770 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
15773 ALIAS (ip_community_list_name_standard
,
15774 ip_community_list_name_standard2_cmd
,
15775 "ip community-list standard WORD (deny|permit)",
15778 "Add a standard community-list entry\n"
15779 "Community list name\n"
15780 "Specify community to reject\n"
15781 "Specify community to accept\n")
15783 DEFUN (ip_community_list_name_expanded
,
15784 ip_community_list_name_expanded_cmd
,
15785 "ip community-list expanded WORD (deny|permit) .LINE",
15788 "Add an expanded community-list entry\n"
15789 "Community list name\n"
15790 "Specify community to reject\n"
15791 "Specify community to accept\n"
15792 "An ordered list as a regular-expression\n")
15794 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
15797 DEFUN (no_ip_community_list_standard_all
,
15798 no_ip_community_list_standard_all_cmd
,
15799 "no ip community-list <1-99>",
15803 "Community list number (standard)\n")
15805 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
15808 DEFUN (no_ip_community_list_standard_direction
,
15809 no_ip_community_list_standard_direction_cmd
,
15810 "no ip community-list <1-99> (deny|permit)",
15814 "Community list number (standard)\n"
15815 "Specify community to reject\n"
15816 "Specify community to accept\n")
15818 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
15822 DEFUN (no_ip_community_list_expanded_all
,
15823 no_ip_community_list_expanded_all_cmd
,
15824 "no ip community-list <100-500>",
15828 "Community list number (expanded)\n")
15830 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
15833 DEFUN (no_ip_community_list_name_standard_all
,
15834 no_ip_community_list_name_standard_all_cmd
,
15835 "no ip community-list standard WORD",
15839 "Add a standard community-list entry\n"
15840 "Community list name\n")
15842 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
15845 DEFUN (no_ip_community_list_name_expanded_all
,
15846 no_ip_community_list_name_expanded_all_cmd
,
15847 "no ip community-list expanded WORD",
15851 "Add an expanded community-list entry\n"
15852 "Community list name\n")
15854 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
15857 DEFUN (no_ip_community_list_standard
,
15858 no_ip_community_list_standard_cmd
,
15859 "no ip community-list <1-99> (deny|permit) .AA:NN",
15863 "Community list number (standard)\n"
15864 "Specify community to reject\n"
15865 "Specify community to accept\n"
15868 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
15871 DEFUN (no_ip_community_list_expanded
,
15872 no_ip_community_list_expanded_cmd
,
15873 "no ip community-list <100-500> (deny|permit) .LINE",
15877 "Community list number (expanded)\n"
15878 "Specify community to reject\n"
15879 "Specify community to accept\n"
15880 "An ordered list as a regular-expression\n")
15882 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
15885 DEFUN (no_ip_community_list_name_standard
,
15886 no_ip_community_list_name_standard_cmd
,
15887 "no ip community-list standard WORD (deny|permit) .AA:NN",
15891 "Specify a standard community-list\n"
15892 "Community list name\n"
15893 "Specify community to reject\n"
15894 "Specify community to accept\n"
15897 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
15900 DEFUN (no_ip_community_list_name_standard_brief
,
15901 no_ip_community_list_name_standard_brief_cmd
,
15902 "no ip community-list standard WORD (deny|permit)",
15906 "Specify a standard community-list\n"
15907 "Community list name\n"
15908 "Specify community to reject\n"
15909 "Specify community to accept\n")
15911 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
15914 DEFUN (no_ip_community_list_name_expanded
,
15915 no_ip_community_list_name_expanded_cmd
,
15916 "no ip community-list expanded WORD (deny|permit) .LINE",
15920 "Specify an expanded community-list\n"
15921 "Community list name\n"
15922 "Specify community to reject\n"
15923 "Specify community to accept\n"
15924 "An ordered list as a regular-expression\n")
15926 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
15930 community_list_show (struct vty
*vty
, struct community_list
*list
)
15932 struct community_entry
*entry
;
15934 for (entry
= list
->head
; entry
; entry
= entry
->next
)
15936 if (entry
== list
->head
)
15938 if (all_digit (list
->name
))
15939 vty_out (vty
, "Community %s list %s%s",
15940 entry
->style
== COMMUNITY_LIST_STANDARD
?
15941 "standard" : "(expanded) access",
15942 list
->name
, VTY_NEWLINE
);
15944 vty_out (vty
, "Named Community %s list %s%s",
15945 entry
->style
== COMMUNITY_LIST_STANDARD
?
15946 "standard" : "expanded",
15947 list
->name
, VTY_NEWLINE
);
15950 vty_out (vty
, " %s%s",
15951 community_direct_str (entry
->direct
), VTY_NEWLINE
);
15953 vty_out (vty
, " %s %s%s",
15954 community_direct_str (entry
->direct
),
15955 entry
->style
== COMMUNITY_LIST_STANDARD
15956 ? community_str (entry
->u
.com
) : entry
->config
,
15961 DEFUN (show_ip_community_list
,
15962 show_ip_community_list_cmd
,
15963 "show ip community-list",
15966 "List community-list\n")
15968 struct community_list
*list
;
15969 struct community_list_master
*cm
;
15971 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
15973 return CMD_SUCCESS
;
15975 for (list
= cm
->num
.head
; list
; list
= list
->next
)
15976 community_list_show (vty
, list
);
15978 for (list
= cm
->str
.head
; list
; list
= list
->next
)
15979 community_list_show (vty
, list
);
15981 return CMD_SUCCESS
;
15984 DEFUN (show_ip_community_list_arg
,
15985 show_ip_community_list_arg_cmd
,
15986 "show ip community-list (<1-500>|WORD)",
15989 "List community-list\n"
15990 "Community-list number\n"
15991 "Community-list name\n")
15993 struct community_list
*list
;
15995 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_MASTER
);
15998 vty_out (vty
, "%% Can't find community-list%s", VTY_NEWLINE
);
15999 return CMD_WARNING
;
16002 community_list_show (vty
, list
);
16004 return CMD_SUCCESS
;
16008 extcommunity_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
16009 int style
, int reject_all_digit_name
)
16015 /* Check the list type. */
16016 if (strncmp (argv
[1], "p", 1) == 0)
16017 direct
= COMMUNITY_PERMIT
;
16018 else if (strncmp (argv
[1], "d", 1) == 0)
16019 direct
= COMMUNITY_DENY
;
16022 vty_out (vty
, "%% Matching condition must be permit or deny%s",
16024 return CMD_WARNING
;
16027 /* All digit name check. */
16028 if (reject_all_digit_name
&& all_digit (argv
[0]))
16030 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
16031 return CMD_WARNING
;
16034 /* Concat community string argument. */
16036 str
= argv_concat (argv
, argc
, 2);
16040 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
16042 /* Free temporary community list string allocated by
16045 XFREE (MTYPE_TMP
, str
);
16049 community_list_perror (vty
, ret
);
16050 return CMD_WARNING
;
16052 return CMD_SUCCESS
;
16056 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
16057 int style
, int delete_all
)
16065 /* Check the list direct. */
16066 if (strncmp (argv
[1], "p", 1) == 0)
16067 direct
= COMMUNITY_PERMIT
;
16068 else if (strncmp (argv
[1], "d", 1) == 0)
16069 direct
= COMMUNITY_DENY
;
16072 vty_out (vty
, "%% Matching condition must be permit or deny%s",
16074 return CMD_WARNING
;
16077 /* Concat community string argument. */
16078 str
= argv_concat (argv
, argc
, 2);
16081 /* Unset community list. */
16082 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
, delete_all
);
16084 /* Free temporary community list string allocated by
16087 XFREE (MTYPE_TMP
, str
);
16091 community_list_perror (vty
, ret
);
16092 return CMD_WARNING
;
16095 return CMD_SUCCESS
;
16098 /* "extcommunity-list" keyword help string. */
16099 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
16100 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
16102 DEFUN (ip_extcommunity_list_standard
,
16103 ip_extcommunity_list_standard_cmd
,
16104 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
16106 EXTCOMMUNITY_LIST_STR
16107 "Extended Community list number (standard)\n"
16108 "Specify community to reject\n"
16109 "Specify community to accept\n"
16110 EXTCOMMUNITY_VAL_STR
)
16112 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
16115 ALIAS (ip_extcommunity_list_standard
,
16116 ip_extcommunity_list_standard2_cmd
,
16117 "ip extcommunity-list <1-99> (deny|permit)",
16119 EXTCOMMUNITY_LIST_STR
16120 "Extended Community list number (standard)\n"
16121 "Specify community to reject\n"
16122 "Specify community to accept\n")
16124 DEFUN (ip_extcommunity_list_expanded
,
16125 ip_extcommunity_list_expanded_cmd
,
16126 "ip extcommunity-list <100-500> (deny|permit) .LINE",
16128 EXTCOMMUNITY_LIST_STR
16129 "Extended Community list number (expanded)\n"
16130 "Specify community to reject\n"
16131 "Specify community to accept\n"
16132 "An ordered list as a regular-expression\n")
16134 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
16137 DEFUN (ip_extcommunity_list_name_standard
,
16138 ip_extcommunity_list_name_standard_cmd
,
16139 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
16141 EXTCOMMUNITY_LIST_STR
16142 "Specify standard extcommunity-list\n"
16143 "Extended Community list name\n"
16144 "Specify community to reject\n"
16145 "Specify community to accept\n"
16146 EXTCOMMUNITY_VAL_STR
)
16148 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
16151 ALIAS (ip_extcommunity_list_name_standard
,
16152 ip_extcommunity_list_name_standard2_cmd
,
16153 "ip extcommunity-list standard WORD (deny|permit)",
16155 EXTCOMMUNITY_LIST_STR
16156 "Specify standard extcommunity-list\n"
16157 "Extended Community list name\n"
16158 "Specify community to reject\n"
16159 "Specify community to accept\n")
16161 DEFUN (ip_extcommunity_list_name_expanded
,
16162 ip_extcommunity_list_name_expanded_cmd
,
16163 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
16165 EXTCOMMUNITY_LIST_STR
16166 "Specify expanded extcommunity-list\n"
16167 "Extended Community list name\n"
16168 "Specify community to reject\n"
16169 "Specify community to accept\n"
16170 "An ordered list as a regular-expression\n")
16172 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
16175 DEFUN (no_ip_extcommunity_list_standard_all
,
16176 no_ip_extcommunity_list_standard_all_cmd
,
16177 "no ip extcommunity-list <1-99>",
16180 EXTCOMMUNITY_LIST_STR
16181 "Extended Community list number (standard)\n")
16183 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
16186 DEFUN (no_ip_extcommunity_list_standard_direction
,
16187 no_ip_extcommunity_list_standard_direction_cmd
,
16188 "no ip extcommunity-list <1-99> (deny|permit)",
16191 EXTCOMMUNITY_LIST_STR
16192 "Extended Community list number (standard)\n"
16193 "Specify community to reject\n"
16194 "Specify community to accept\n")
16196 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
16199 DEFUN (no_ip_extcommunity_list_expanded_all
,
16200 no_ip_extcommunity_list_expanded_all_cmd
,
16201 "no ip extcommunity-list <100-500>",
16204 EXTCOMMUNITY_LIST_STR
16205 "Extended Community list number (expanded)\n")
16207 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
16210 DEFUN (no_ip_extcommunity_list_name_standard_all
,
16211 no_ip_extcommunity_list_name_standard_all_cmd
,
16212 "no ip extcommunity-list standard WORD",
16215 EXTCOMMUNITY_LIST_STR
16216 "Specify standard extcommunity-list\n"
16217 "Extended Community list name\n")
16219 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
16222 DEFUN (no_ip_extcommunity_list_name_expanded_all
,
16223 no_ip_extcommunity_list_name_expanded_all_cmd
,
16224 "no ip extcommunity-list expanded WORD",
16227 EXTCOMMUNITY_LIST_STR
16228 "Specify expanded extcommunity-list\n"
16229 "Extended Community list name\n")
16231 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
16234 DEFUN (no_ip_extcommunity_list_standard
,
16235 no_ip_extcommunity_list_standard_cmd
,
16236 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
16239 EXTCOMMUNITY_LIST_STR
16240 "Extended Community list number (standard)\n"
16241 "Specify community to reject\n"
16242 "Specify community to accept\n"
16243 EXTCOMMUNITY_VAL_STR
)
16245 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
16248 DEFUN (no_ip_extcommunity_list_expanded
,
16249 no_ip_extcommunity_list_expanded_cmd
,
16250 "no ip extcommunity-list <100-500> (deny|permit) .LINE",
16253 EXTCOMMUNITY_LIST_STR
16254 "Extended Community list number (expanded)\n"
16255 "Specify community to reject\n"
16256 "Specify community to accept\n"
16257 "An ordered list as a regular-expression\n")
16259 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
16262 DEFUN (no_ip_extcommunity_list_name_standard
,
16263 no_ip_extcommunity_list_name_standard_cmd
,
16264 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
16267 EXTCOMMUNITY_LIST_STR
16268 "Specify standard extcommunity-list\n"
16269 "Extended Community list name\n"
16270 "Specify community to reject\n"
16271 "Specify community to accept\n"
16272 EXTCOMMUNITY_VAL_STR
)
16274 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
16277 DEFUN (no_ip_extcommunity_list_name_standard_brief
,
16278 no_ip_extcommunity_list_name_standard_brief_cmd
,
16279 "no ip extcommunity-list standard WORD (deny|permit)",
16282 EXTCOMMUNITY_LIST_STR
16283 "Specify standard extcommunity-list\n"
16284 "Extended Community list name\n"
16285 "Specify community to reject\n"
16286 "Specify community to accept\n")
16288 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
16291 DEFUN (no_ip_extcommunity_list_name_expanded
,
16292 no_ip_extcommunity_list_name_expanded_cmd
,
16293 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
16296 EXTCOMMUNITY_LIST_STR
16297 "Specify expanded extcommunity-list\n"
16298 "Community list name\n"
16299 "Specify community to reject\n"
16300 "Specify community to accept\n"
16301 "An ordered list as a regular-expression\n")
16303 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
16307 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
16309 struct community_entry
*entry
;
16311 for (entry
= list
->head
; entry
; entry
= entry
->next
)
16313 if (entry
== list
->head
)
16315 if (all_digit (list
->name
))
16316 vty_out (vty
, "Extended community %s list %s%s",
16317 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
16318 "standard" : "(expanded) access",
16319 list
->name
, VTY_NEWLINE
);
16321 vty_out (vty
, "Named extended community %s list %s%s",
16322 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
16323 "standard" : "expanded",
16324 list
->name
, VTY_NEWLINE
);
16327 vty_out (vty
, " %s%s",
16328 community_direct_str (entry
->direct
), VTY_NEWLINE
);
16330 vty_out (vty
, " %s %s%s",
16331 community_direct_str (entry
->direct
),
16332 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
16333 entry
->u
.ecom
->str
: entry
->config
,
16338 DEFUN (show_ip_extcommunity_list
,
16339 show_ip_extcommunity_list_cmd
,
16340 "show ip extcommunity-list",
16343 "List extended-community list\n")
16345 struct community_list
*list
;
16346 struct community_list_master
*cm
;
16348 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
16350 return CMD_SUCCESS
;
16352 for (list
= cm
->num
.head
; list
; list
= list
->next
)
16353 extcommunity_list_show (vty
, list
);
16355 for (list
= cm
->str
.head
; list
; list
= list
->next
)
16356 extcommunity_list_show (vty
, list
);
16358 return CMD_SUCCESS
;
16361 DEFUN (show_ip_extcommunity_list_arg
,
16362 show_ip_extcommunity_list_arg_cmd
,
16363 "show ip extcommunity-list (<1-500>|WORD)",
16366 "List extended-community list\n"
16367 "Extcommunity-list number\n"
16368 "Extcommunity-list name\n")
16370 struct community_list
*list
;
16372 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_MASTER
);
16375 vty_out (vty
, "%% Can't find extcommunity-list%s", VTY_NEWLINE
);
16376 return CMD_WARNING
;
16379 extcommunity_list_show (vty
, list
);
16381 return CMD_SUCCESS
;
16384 /* Return configuration string of community-list entry. */
16385 static const char *
16386 community_list_config_str (struct community_entry
*entry
)
16394 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
16395 str
= community_str (entry
->u
.com
);
16397 str
= entry
->config
;
16402 /* Display community-list and extcommunity-list configuration. */
16404 community_list_config_write (struct vty
*vty
)
16406 struct community_list
*list
;
16407 struct community_entry
*entry
;
16408 struct community_list_master
*cm
;
16411 /* Community-list. */
16412 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
16414 for (list
= cm
->num
.head
; list
; list
= list
->next
)
16415 for (entry
= list
->head
; entry
; entry
= entry
->next
)
16417 vty_out (vty
, "ip community-list %s %s %s%s",
16418 list
->name
, community_direct_str (entry
->direct
),
16419 community_list_config_str (entry
),
16423 for (list
= cm
->str
.head
; list
; list
= list
->next
)
16424 for (entry
= list
->head
; entry
; entry
= entry
->next
)
16426 vty_out (vty
, "ip community-list %s %s %s %s%s",
16427 entry
->style
== COMMUNITY_LIST_STANDARD
16428 ? "standard" : "expanded",
16429 list
->name
, community_direct_str (entry
->direct
),
16430 community_list_config_str (entry
),
16435 /* Extcommunity-list. */
16436 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
16438 for (list
= cm
->num
.head
; list
; list
= list
->next
)
16439 for (entry
= list
->head
; entry
; entry
= entry
->next
)
16441 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
16442 list
->name
, community_direct_str (entry
->direct
),
16443 community_list_config_str (entry
), VTY_NEWLINE
);
16446 for (list
= cm
->str
.head
; list
; list
= list
->next
)
16447 for (entry
= list
->head
; entry
; entry
= entry
->next
)
16449 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
16450 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
16451 ? "standard" : "expanded",
16452 list
->name
, community_direct_str (entry
->direct
),
16453 community_list_config_str (entry
), VTY_NEWLINE
);
16459 static struct cmd_node community_list_node
=
16461 COMMUNITY_LIST_NODE
,
16463 1 /* Export to vtysh. */
16467 community_list_vty (void)
16469 install_node (&community_list_node
, community_list_config_write
);
16471 /* Community-list. */
16472 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
16473 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
16474 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
16475 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
16476 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
16477 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
16478 install_element (CONFIG_NODE
, &no_ip_community_list_standard_all_cmd
);
16479 install_element (CONFIG_NODE
, &no_ip_community_list_standard_direction_cmd
);
16480 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_all_cmd
);
16481 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_all_cmd
);
16482 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_all_cmd
);
16483 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
16484 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
16485 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
16486 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_brief_cmd
);
16487 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
16488 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
16489 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
16491 /* Extcommunity-list. */
16492 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
16493 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
16494 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
16495 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
16496 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
16497 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
16498 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_all_cmd
);
16499 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_direction_cmd
);
16500 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_all_cmd
);
16501 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_all_cmd
);
16502 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_all_cmd
);
16503 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
16504 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
16505 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
16506 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_brief_cmd
);
16507 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
16508 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
16509 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);