2 Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
4 This file is part of GNU Zebra.
6 GNU Zebra is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 GNU Zebra is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Zebra; see the file COPYING. If not, write to the Free
18 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
35 #include "bgpd/bgpd.h"
36 #include "bgpd/bgp_advertise.h"
37 #include "bgpd/bgp_attr.h"
38 #include "bgpd/bgp_aspath.h"
39 #include "bgpd/bgp_community.h"
40 #include "bgpd/bgp_ecommunity.h"
41 #include "bgpd/bgp_damp.h"
42 #include "bgpd/bgp_debug.h"
43 #include "bgpd/bgp_fsm.h"
44 #include "bgpd/bgp_mplsvpn.h"
45 #include "bgpd/bgp_nexthop.h"
46 #include "bgpd/bgp_open.h"
47 #include "bgpd/bgp_regex.h"
48 #include "bgpd/bgp_route.h"
49 #include "bgpd/bgp_zebra.h"
50 #include "bgpd/bgp_table.h"
51 #include "bgpd/bgp_vty.h"
52 #include "bgpd/bgp_mpath.h"
53 #include "bgpd/bgp_packet.h"
54 #include "bgpd/bgp_updgrp.h"
56 extern struct in_addr router_id_zebra
;
58 /* Intentional re-definition of the auto-generated macros, without table */
59 #define QUAGGA_REDIST_STR_BGPD \
60 "(kernel|connected|static|rip|ripng|ospf|ospf6|isis|babel)"
61 #define QUAGGA_REDIST_HELP_STR_BGPD \
62 "Kernel routes (not installed via the zebra RIB)\n" \
63 "Connected routes (directly attached subnet or host)\n" \
64 "Statically configured routes\n" \
65 "Routing Information Protocol (RIP)\n" \
66 "Routing Information Protocol next-generation (IPv6) (RIPng)\n" \
67 "Open Shortest Path First (OSPFv2)\n" \
68 "Open Shortest Path First (IPv6) (OSPFv3)\n" \
69 "Intermediate System to Intermediate System (IS-IS)\n" \
70 "Babel routing protocol (Babel)\n"
71 #define QUAGGA_IP_REDIST_STR_BGPD \
72 "(kernel|connected|static|rip|ospf|isis|babel)"
73 #define QUAGGA_IP_REDIST_HELP_STR_BGPD \
74 "Kernel routes (not installed via the zebra RIB)\n" \
75 "Connected routes (directly attached subnet or host)\n" \
76 "Statically configured routes\n" \
77 "Routing Information Protocol (RIP)\n" \
78 "Open Shortest Path First (OSPFv2)\n" \
79 "Intermediate System to Intermediate System (IS-IS)\n" \
80 "Babel routing protocol (Babel)\n"
81 #define QUAGGA_IP6_REDIST_STR_BGPD \
82 "(kernel|connected|static|ripng|ospf6|isis|babel)"
83 #define QUAGGA_IP6_REDIST_HELP_STR_BGPD \
84 "Kernel routes (not installed via the zebra RIB)\n" \
85 "Connected routes (directly attached subnet or host)\n" \
86 "Statically configured routes\n" \
87 "Routing Information Protocol next-generation (IPv6) (RIPng)\n" \
88 "Open Shortest Path First (IPv6) (OSPFv3)\n" \
89 "Intermediate System to Intermediate System (IS-IS)\n" \
90 "Babel routing protocol (Babel)\n"
93 /* Utility function to get address family from current node. */
95 bgp_node_afi (struct vty
*vty
)
97 if (vty
->node
== BGP_IPV6_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
102 /* Utility function to get subsequent address family from current
105 bgp_node_safi (struct vty
*vty
)
107 if (vty
->node
== BGP_VPNV4_NODE
)
108 return SAFI_MPLS_VPN
;
109 if (vty
->node
== BGP_IPV4M_NODE
|| vty
->node
== BGP_IPV6M_NODE
)
110 return SAFI_MULTICAST
;
115 peer_address_self_check (union sockunion
*su
)
117 struct interface
*ifp
= NULL
;
119 if (su
->sa
.sa_family
== AF_INET
)
120 ifp
= if_lookup_by_ipv4_exact (&su
->sin
.sin_addr
);
122 else if (su
->sa
.sa_family
== AF_INET6
)
123 ifp
= if_lookup_by_ipv6_exact (&su
->sin6
.sin6_addr
,
124 su
->sin6
.sin6_scope_id
);
125 #endif /* HAVE IPV6 */
133 /* Utility function for looking up peer from VTY. */
134 /* This is used only for configuration, so disallow if attempted on
135 * a dynamic neighbor.
138 peer_lookup_vty (struct vty
*vty
, const char *ip_str
)
147 ret
= str2sockunion (ip_str
, &su
);
150 peer
= peer_lookup_by_conf_if (bgp
, ip_str
);
153 if ((peer
= peer_lookup_by_hostname(bgp
, ip_str
)) == NULL
)
155 vty_out (vty
, "%% Malformed address or name: %s%s", ip_str
, VTY_NEWLINE
);
162 peer
= peer_lookup (bgp
, &su
);
165 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
169 if (peer_dynamic_neighbor (peer
))
171 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
180 /* Utility function for looking up peer or peer group. */
181 /* This is used only for configuration, so disallow if attempted on
182 * a dynamic neighbor.
185 peer_and_group_lookup_vty (struct vty
*vty
, const char *peer_str
)
190 struct peer
*peer
= NULL
;
191 struct peer_group
*group
= NULL
;
195 ret
= str2sockunion (peer_str
, &su
);
198 /* IP address, locate peer. */
199 peer
= peer_lookup (bgp
, &su
);
203 /* Not IP, could match either peer configured on interface or a group. */
204 peer
= peer_lookup_by_conf_if (bgp
, peer_str
);
206 group
= peer_group_lookup (bgp
, peer_str
);
211 if (peer_dynamic_neighbor (peer
))
213 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
224 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
231 bgp_vty_return (struct vty
*vty
, int ret
)
233 const char *str
= NULL
;
237 case BGP_ERR_INVALID_VALUE
:
238 str
= "Invalid value";
240 case BGP_ERR_INVALID_FLAG
:
241 str
= "Invalid flag";
243 case BGP_ERR_PEER_INACTIVE
:
244 str
= "Activate the neighbor for the address family first";
246 case BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER
:
247 str
= "Invalid command for a peer-group member";
249 case BGP_ERR_PEER_GROUP_SHUTDOWN
:
250 str
= "Peer-group has been shutdown. Activate the peer-group first";
252 case BGP_ERR_PEER_GROUP_HAS_THE_FLAG
:
253 str
= "This peer is a peer-group member. Please change peer-group configuration";
255 case BGP_ERR_PEER_FLAG_CONFLICT
:
256 str
= "Can't set override-capability and strict-capability-match at the same time";
258 case BGP_ERR_PEER_GROUP_MEMBER_EXISTS
:
259 str
= "No activate for peergroup can be given only if peer-group has no members";
261 case BGP_ERR_PEER_BELONGS_TO_GROUP
:
262 str
= "No activate for an individual peer-group member is invalid";
264 case BGP_ERR_PEER_GROUP_AF_UNCONFIGURED
:
265 str
= "Activate the peer-group for the address family first";
267 case BGP_ERR_PEER_GROUP_NO_REMOTE_AS
:
268 str
= "Specify remote-as or peer-group remote AS first";
270 case BGP_ERR_PEER_GROUP_CANT_CHANGE
:
271 str
= "Cannot change the peer-group. Deconfigure first";
273 case BGP_ERR_PEER_GROUP_MISMATCH
:
274 str
= "Cannot have different peer-group for the neighbor";
276 case BGP_ERR_PEER_FILTER_CONFLICT
:
277 str
= "Prefix/distribute list can not co-exist";
279 case BGP_ERR_NOT_INTERNAL_PEER
:
280 str
= "Invalid command. Not an internal neighbor";
282 case BGP_ERR_REMOVE_PRIVATE_AS
:
283 str
= "remove-private-AS cannot be configured for IBGP peers";
285 case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP
:
286 str
= "Local-AS allowed only for EBGP peers";
288 case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS
:
289 str
= "Cannot have local-as same as BGP AS number";
291 case BGP_ERR_TCPSIG_FAILED
:
292 str
= "Error while applying TCP-Sig to session(s)";
294 case BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK
:
295 str
= "ebgp-multihop and ttl-security cannot be configured together";
297 case BGP_ERR_NO_IBGP_WITH_TTLHACK
:
298 str
= "ttl-security only allowed for EBGP peers";
300 case BGP_ERR_AS_OVERRIDE
:
301 str
= "as-override cannot be configured for IBGP peers";
303 case BGP_ERR_INVALID_DYNAMIC_NEIGHBORS_LIMIT
:
304 str
= "Invalid limit for number of dynamic neighbors";
306 case BGP_ERR_DYNAMIC_NEIGHBORS_RANGE_EXISTS
:
307 str
= "Dynamic neighbor listen range already exists";
309 case BGP_ERR_INVALID_FOR_DYNAMIC_PEER
:
310 str
= "Operation not allowed on a dynamic neighbor";
315 vty_out (vty
, "%% %s%s", str
, VTY_NEWLINE
);
321 /* BGP clear sort. */
331 /* Force a bestpath recalculation for all prefixes. This is used
332 * when 'bgp bestpath' commands are entered.
335 bgp_recalculate_all_bestpaths (struct bgp
*bgp
)
341 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
343 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
345 for (rn
= bgp_table_top (bgp
->rib
[afi
][safi
]); rn
; rn
= bgp_route_next (rn
))
347 bgp_process (bgp
, rn
, afi
, safi
);
354 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
355 safi_t safi
, int error
)
359 case BGP_ERR_AF_UNCONFIGURED
:
361 "%%BGP: Enable %s %s address family for the neighbor %s%s",
362 afi
== AFI_IP6
? "IPv6" : safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
363 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
364 peer
->host
, VTY_NEWLINE
);
366 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
367 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
);
374 /* `clear ip bgp' functions. */
376 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
377 enum clear_sort sort
,enum bgp_clear_type stype
, const char *arg
)
381 struct listnode
*node
, *nnode
;
383 /* Clear all neighbors. */
385 * Pass along pointer to next node to peer_clear() when walking all nodes
386 * on the BGP instance as that may get freed if it is a doppelganger
388 if (sort
== clear_all
)
390 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
392 if (stype
== BGP_CLEAR_SOFT_NONE
)
393 ret
= peer_clear (peer
, &nnode
);
394 else if (peer
->afc
[afi
][safi
])
395 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
400 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
403 /* This is to apply read-only mode on this clear. */
404 if (stype
== BGP_CLEAR_SOFT_NONE
)
405 bgp
->update_delay_over
= 0;
410 /* Clear specified neighbors. */
411 if (sort
== clear_peer
)
416 /* Make sockunion for lookup. */
417 ret
= str2sockunion (arg
, &su
);
420 peer
= peer_lookup_by_conf_if (bgp
, arg
);
423 peer
= peer_lookup_by_hostname(bgp
, arg
);
426 vty_out (vty
, "Malformed address or name: %s%s", arg
, VTY_NEWLINE
);
433 peer
= peer_lookup (bgp
, &su
);
436 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
441 if (stype
== BGP_CLEAR_SOFT_NONE
)
442 ret
= peer_clear (peer
, NULL
);
444 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
447 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
452 /* Clear all peer-group members. */
453 if (sort
== clear_group
)
455 struct peer_group
*group
;
457 group
= peer_group_lookup (bgp
, arg
);
460 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
464 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
466 if (stype
== BGP_CLEAR_SOFT_NONE
)
468 ret
= peer_clear (peer
, NULL
);
472 if (! peer
->af_group
[afi
][safi
])
475 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
478 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
483 if (sort
== clear_external
)
485 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
487 if (peer
->sort
== BGP_PEER_IBGP
)
490 if (stype
== BGP_CLEAR_SOFT_NONE
)
491 ret
= peer_clear (peer
, &nnode
);
493 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
496 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
501 if (sort
== clear_as
)
506 VTY_GET_INTEGER_RANGE ("AS", as
, arg
, 1, BGP_AS4_MAX
);
508 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
514 if (stype
== BGP_CLEAR_SOFT_NONE
)
515 ret
= peer_clear (peer
, &nnode
);
517 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
520 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
523 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
532 bgp_clear_vty (struct vty
*vty
, const char *name
, afi_t afi
, safi_t safi
,
533 enum clear_sort sort
, enum bgp_clear_type stype
,
538 /* BGP structure lookup. */
541 bgp
= bgp_lookup_by_name (name
);
544 vty_out (vty
, "Can't find BGP view %s%s", name
, VTY_NEWLINE
);
550 bgp
= bgp_get_default ();
553 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
558 return bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
561 /* clear soft inbound */
563 bgp_clear_star_soft_in (struct vty
*vty
)
565 bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
566 BGP_CLEAR_SOFT_IN
, NULL
);
568 bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
569 BGP_CLEAR_SOFT_IN
, NULL
);
570 #endif /* HAVE_IPV6 */
573 /* clear soft outbound */
575 bgp_clear_star_soft_out (struct vty
*vty
)
577 bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
578 BGP_CLEAR_SOFT_OUT
, NULL
);
580 bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
581 BGP_CLEAR_SOFT_OUT
, NULL
);
582 #endif /* HAVE_IPV6 */
586 /* BGP global configuration. */
588 DEFUN (bgp_multiple_instance_func
,
589 bgp_multiple_instance_cmd
,
590 "bgp multiple-instance",
592 "Enable bgp multiple instance\n")
594 bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE
);
598 DEFUN (no_bgp_multiple_instance
,
599 no_bgp_multiple_instance_cmd
,
600 "no bgp multiple-instance",
603 "BGP multiple instance\n")
607 ret
= bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE
);
610 vty_out (vty
, "%% There are more than two BGP instances%s", VTY_NEWLINE
);
616 DEFUN (bgp_config_type
,
618 "bgp config-type (cisco|zebra)",
620 "Configuration type\n"
624 if (strncmp (argv
[0], "c", 1) == 0)
625 bgp_option_set (BGP_OPT_CONFIG_CISCO
);
627 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
632 DEFUN (no_bgp_config_type
,
633 no_bgp_config_type_cmd
,
634 "no bgp config-type",
637 "Display configuration type\n")
639 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
643 DEFUN (no_synchronization
,
644 no_synchronization_cmd
,
645 "no synchronization",
647 "Perform IGP synchronization\n")
652 DEFUN (no_auto_summary
,
656 "Enable automatic network number summarization\n")
661 DEFUN_DEPRECATED (neighbor_version
,
662 neighbor_version_cmd
,
663 NEIGHBOR_CMD
"version (4|4-)",
666 "Set the BGP version to match a neighbor\n"
667 "Neighbor's BGP version\n")
672 /* "router bgp" commands. */
675 "router bgp " CMD_AS_RANGE
,
683 const char *name
= NULL
;
685 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
690 ret
= bgp_get (&bgp
, &as
, name
);
693 case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET
:
694 vty_out (vty
, "Please specify 'bgp multiple-instance' first%s",
697 case BGP_ERR_AS_MISMATCH
:
698 vty_out (vty
, "BGP is already running; AS is %u%s", as
, VTY_NEWLINE
);
700 case BGP_ERR_INSTANCE_MISMATCH
:
701 vty_out (vty
, "BGP view name and AS number mismatch%s", VTY_NEWLINE
);
702 vty_out (vty
, "BGP instance is already running; AS is %u%s",
707 vty
->node
= BGP_NODE
;
715 "router bgp " CMD_AS_RANGE
" view WORD",
722 /* "no router bgp" commands. */
723 DEFUN (no_router_bgp
,
725 "no router bgp " CMD_AS_RANGE
,
733 const char *name
= NULL
;
735 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
740 /* Lookup bgp structure. */
741 bgp
= bgp_lookup (as
, name
);
744 vty_out (vty
, "%% Can't find BGP instance%s", VTY_NEWLINE
);
753 ALIAS (no_router_bgp
,
754 no_router_bgp_view_cmd
,
755 "no router bgp " CMD_AS_RANGE
" view WORD",
765 DEFUN (bgp_router_id
,
767 "bgp router-id A.B.C.D",
769 "Override configured router identifier\n"
770 "Manually configured router identifier\n")
778 ret
= inet_aton (argv
[0], &id
);
781 vty_out (vty
, "%% Malformed bgp router identifier%s", VTY_NEWLINE
);
785 bgp
->router_id_static
= id
;
786 bgp_router_id_set (bgp
, &id
);
791 DEFUN (no_bgp_router_id
,
792 no_bgp_router_id_cmd
,
796 "Override configured router identifier\n")
806 ret
= inet_aton (argv
[0], &id
);
809 vty_out (vty
, "%% Malformed BGP router identifier%s", VTY_NEWLINE
);
813 if (! IPV4_ADDR_SAME (&bgp
->router_id_static
, &id
))
815 vty_out (vty
, "%% BGP router-id doesn't match%s", VTY_NEWLINE
);
820 bgp
->router_id_static
.s_addr
= 0;
821 bgp_router_id_set (bgp
, &router_id_zebra
);
826 ALIAS (no_bgp_router_id
,
827 no_bgp_router_id_val_cmd
,
828 "no bgp router-id A.B.C.D",
831 "Override configured router identifier\n"
832 "Manually configured router identifier\n")
834 /* BGP Cluster ID. */
836 DEFUN (bgp_cluster_id
,
838 "bgp cluster-id A.B.C.D",
840 "Configure Route-Reflector Cluster-id\n"
841 "Route-Reflector Cluster-id in IP address format\n")
845 struct in_addr cluster
;
849 ret
= inet_aton (argv
[0], &cluster
);
852 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
856 bgp_cluster_id_set (bgp
, &cluster
);
857 bgp_clear_star_soft_out (vty
);
862 ALIAS (bgp_cluster_id
,
863 bgp_cluster_id32_cmd
,
864 "bgp cluster-id <1-4294967295>",
866 "Configure Route-Reflector Cluster-id\n"
867 "Route-Reflector Cluster-id as 32 bit quantity\n")
869 DEFUN (no_bgp_cluster_id
,
870 no_bgp_cluster_id_cmd
,
874 "Configure Route-Reflector Cluster-id\n")
878 struct in_addr cluster
;
884 ret
= inet_aton (argv
[0], &cluster
);
887 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
892 bgp_cluster_id_unset (bgp
);
893 bgp_clear_star_soft_out (vty
);
898 ALIAS (no_bgp_cluster_id
,
899 no_bgp_cluster_id_arg_cmd
,
900 "no bgp cluster-id A.B.C.D",
903 "Configure Route-Reflector Cluster-id\n"
904 "Route-Reflector Cluster-id in IP address format\n")
906 DEFUN (bgp_confederation_identifier
,
907 bgp_confederation_identifier_cmd
,
908 "bgp confederation identifier " CMD_AS_RANGE
,
909 "BGP specific commands\n"
910 "AS confederation parameters\n"
912 "Set routing domain confederation AS\n")
919 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, BGP_AS4_MAX
);
921 bgp_confederation_id_set (bgp
, as
);
926 DEFUN (no_bgp_confederation_identifier
,
927 no_bgp_confederation_identifier_cmd
,
928 "no bgp confederation identifier",
930 "BGP specific commands\n"
931 "AS confederation parameters\n"
938 bgp_confederation_id_unset (bgp
);
943 ALIAS (no_bgp_confederation_identifier
,
944 no_bgp_confederation_identifier_arg_cmd
,
945 "no bgp confederation identifier " CMD_AS_RANGE
,
947 "BGP specific commands\n"
948 "AS confederation parameters\n"
950 "Set routing domain confederation AS\n")
952 DEFUN (bgp_confederation_peers
,
953 bgp_confederation_peers_cmd
,
954 "bgp confederation peers ." CMD_AS_RANGE
,
955 "BGP specific commands\n"
956 "AS confederation parameters\n"
957 "Peer ASs in BGP confederation\n"
966 for (i
= 0; i
< argc
; i
++)
968 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
972 vty_out (vty
, "%% Local member-AS not allowed in confed peer list%s",
977 bgp_confederation_peers_add (bgp
, as
);
982 DEFUN (no_bgp_confederation_peers
,
983 no_bgp_confederation_peers_cmd
,
984 "no bgp confederation peers ." CMD_AS_RANGE
,
986 "BGP specific commands\n"
987 "AS confederation parameters\n"
988 "Peer ASs in BGP confederation\n"
997 for (i
= 0; i
< argc
; i
++)
999 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, BGP_AS4_MAX
);
1001 bgp_confederation_peers_remove (bgp
, as
);
1007 * Central routine for maximum-paths configuration.
1008 * @peer_type: BGP_PEER_EBGP or BGP_PEER_IBGP
1009 * @set: 1 for setting values, 0 for removing the max-paths config.
1012 bgp_maxpaths_config_vty (struct vty
*vty
, int peer_type
, const char *mpaths
,
1013 u_int16_t options
, int set
)
1016 u_int16_t maxpaths
= 0;
1022 afi
= bgp_node_afi (vty
);
1023 safi
= bgp_node_safi (vty
);
1027 VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths
, mpaths
, 1,
1028 BGP_MAXIMUM_MAXPATHS
);
1029 ret
= bgp_maximum_paths_set (bgp
, afi
, safi
, peer_type
, maxpaths
,
1033 ret
= bgp_maximum_paths_unset (bgp
, afi
, safi
, peer_type
);
1038 "%% Failed to %sset maximum-paths %s %u for afi %u, safi %u%s",
1039 (set
== 1) ? "" : "un",
1040 (peer_type
== BGP_PEER_EBGP
) ? "ebgp" : "ibgp",
1041 maxpaths
, afi
, safi
, VTY_NEWLINE
);
1045 bgp_recalculate_all_bestpaths (bgp
);
1050 DEFUN (bgp_maxmed_admin
,
1051 bgp_maxmed_admin_cmd
,
1052 "bgp max-med administrative ",
1054 "Advertise routes with max-med\n"
1055 "Administratively applied, for an indefinite period\n")
1061 bgp
->v_maxmed_admin
= 1;
1062 bgp
->maxmed_admin_value
= BGP_MAXMED_VALUE_DEFAULT
;
1064 bgp_maxmed_update(bgp
);
1069 DEFUN (bgp_maxmed_admin_medv
,
1070 bgp_maxmed_admin_medv_cmd
,
1071 "bgp max-med administrative <0-4294967294>",
1073 "Advertise routes with max-med\n"
1074 "Administratively applied, for an indefinite period\n"
1075 "Max MED value to be used\n")
1081 bgp
->v_maxmed_admin
= 1;
1082 VTY_GET_INTEGER ("max-med admin med-value", bgp
->maxmed_admin_value
, argv
[0]);
1084 bgp_maxmed_update(bgp
);
1089 DEFUN (no_bgp_maxmed_admin
,
1090 no_bgp_maxmed_admin_cmd
,
1091 "no bgp max-med administrative",
1094 "Advertise routes with max-med\n"
1095 "Administratively applied, for an indefinite period\n")
1101 bgp
->v_maxmed_admin
= BGP_MAXMED_ADMIN_UNCONFIGURED
;
1102 bgp
->maxmed_admin_value
= BGP_MAXMED_VALUE_DEFAULT
;
1104 bgp_maxmed_update(bgp
);
1109 ALIAS (no_bgp_maxmed_admin
,
1110 no_bgp_maxmed_admin_medv_cmd
,
1111 "no bgp max-med administrative <0-4294967294>",
1114 "Advertise routes with max-med\n"
1115 "Administratively applied, for an indefinite period\n"
1116 "Max MED value to be used\n")
1119 DEFUN (bgp_maxmed_onstartup
,
1120 bgp_maxmed_onstartup_cmd
,
1121 "bgp max-med on-startup <5-86400>",
1123 "Advertise routes with max-med\n"
1124 "Effective on a startup\n"
1125 "Time (seconds) period for max-med\n")
1133 vty_out (vty
, "%% Must supply max-med on-startup period");
1137 VTY_GET_INTEGER ("max-med on-startup period", bgp
->v_maxmed_onstartup
, argv
[0]);
1138 bgp
->maxmed_onstartup_value
= BGP_MAXMED_VALUE_DEFAULT
;
1140 bgp_maxmed_update(bgp
);
1145 DEFUN (bgp_maxmed_onstartup_medv
,
1146 bgp_maxmed_onstartup_medv_cmd
,
1147 "bgp max-med on-startup <5-86400> <0-4294967294>",
1149 "Advertise routes with max-med\n"
1150 "Effective on a startup\n"
1151 "Time (seconds) period for max-med\n"
1152 "Max MED value to be used\n")
1160 vty_out (vty
, "%% Must supply max-med on-startup period and med value");
1164 VTY_GET_INTEGER ("max-med on-startup period", bgp
->v_maxmed_onstartup
, argv
[0]);
1165 VTY_GET_INTEGER ("max-med on-startup med-value", bgp
->maxmed_onstartup_value
, argv
[1]);
1167 bgp_maxmed_update(bgp
);
1172 DEFUN (no_bgp_maxmed_onstartup
,
1173 no_bgp_maxmed_onstartup_cmd
,
1174 "no bgp max-med on-startup",
1177 "Advertise routes with max-med\n"
1178 "Effective on a startup\n")
1184 /* Cancel max-med onstartup if its on */
1185 if (bgp
->t_maxmed_onstartup
)
1187 THREAD_TIMER_OFF (bgp
->t_maxmed_onstartup
);
1188 bgp
->maxmed_onstartup_over
= 1;
1191 bgp
->v_maxmed_onstartup
= BGP_MAXMED_ONSTARTUP_UNCONFIGURED
;
1192 bgp
->maxmed_onstartup_value
= BGP_MAXMED_VALUE_DEFAULT
;
1194 bgp_maxmed_update(bgp
);
1199 ALIAS (no_bgp_maxmed_onstartup
,
1200 no_bgp_maxmed_onstartup_period_cmd
,
1201 "no bgp max-med on-startup <5-86400>",
1204 "Advertise routes with max-med\n"
1205 "Effective on a startup\n"
1206 "Time (seconds) period for max-med\n")
1208 ALIAS (no_bgp_maxmed_onstartup
,
1209 no_bgp_maxmed_onstartup_period_medv_cmd
,
1210 "no bgp max-med on-startup <5-86400> <0-4294967294>",
1213 "Advertise routes with max-med\n"
1214 "Effective on a startup\n"
1215 "Time (seconds) period for max-med\n"
1216 "Max MED value to be used\n")
1219 bgp_update_delay_config_vty (struct vty
*vty
, const char *delay
,
1223 u_int16_t update_delay
;
1224 u_int16_t establish_wait
;
1229 VTY_GET_INTEGER_RANGE ("update-delay", update_delay
, delay
,
1230 BGP_UPDATE_DELAY_MIN
, BGP_UPDATE_DELAY_MAX
);
1232 if (!wait
) /* update-delay <delay> */
1234 bgp
->v_update_delay
= update_delay
;
1235 bgp
->v_establish_wait
= bgp
->v_update_delay
;
1239 /* update-delay <delay> <establish-wait> */
1240 establish_wait
= atoi (wait
);
1241 if (update_delay
< establish_wait
)
1243 vty_out (vty
, "%%Failed: update-delay less than the establish-wait!%s",
1248 bgp
->v_update_delay
= update_delay
;
1249 bgp
->v_establish_wait
= establish_wait
;
1255 bgp_update_delay_deconfig_vty (struct vty
*vty
)
1261 bgp
->v_update_delay
= BGP_UPDATE_DELAY_DEF
;
1262 bgp
->v_establish_wait
= bgp
->v_update_delay
;
1268 bgp_config_write_update_delay (struct vty
*vty
, struct bgp
*bgp
)
1270 if (bgp
->v_update_delay
!= BGP_UPDATE_DELAY_DEF
)
1272 vty_out (vty
, " update-delay %d", bgp
->v_update_delay
);
1273 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
1274 vty_out (vty
, " %d", bgp
->v_establish_wait
);
1275 vty_out (vty
, "%s", VTY_NEWLINE
);
1282 /* Update-delay configuration */
1283 DEFUN (bgp_update_delay
,
1284 bgp_update_delay_cmd
,
1285 "update-delay <0-3600>",
1286 "Force initial delay for best-path and updates\n"
1289 return bgp_update_delay_config_vty(vty
, argv
[0], NULL
);
1292 DEFUN (bgp_update_delay_establish_wait
,
1293 bgp_update_delay_establish_wait_cmd
,
1294 "update-delay <0-3600> <1-3600>",
1295 "Force initial delay for best-path and updates\n"
1297 "Wait for peers to be established\n"
1300 return bgp_update_delay_config_vty(vty
, argv
[0], argv
[1]);
1303 /* Update-delay deconfiguration */
1304 DEFUN (no_bgp_update_delay
,
1305 no_bgp_update_delay_cmd
,
1306 "no update-delay <0-3600>",
1307 "Force initial delay for best-path and updates\n"
1310 return bgp_update_delay_deconfig_vty(vty
);
1313 ALIAS (no_bgp_update_delay
,
1314 no_bgp_update_delay_establish_wait_cmd
,
1315 "no update-delay <0-3600> <1-3600>",
1316 "Force initial delay for best-path and updates\n"
1318 "Wait for peers to be established\n"
1322 bgp_wpkt_quanta_config_vty (struct vty
*vty
, const char *num
, char set
)
1329 VTY_GET_INTEGER_RANGE ("write-quanta", bgp
->wpkt_quanta
, num
,
1332 bgp
->wpkt_quanta
= BGP_WRITE_PACKET_MAX
;
1338 bgp_config_write_wpkt_quanta (struct vty
*vty
, struct bgp
*bgp
)
1340 if (bgp
->wpkt_quanta
!= BGP_WRITE_PACKET_MAX
)
1341 vty_out (vty
, " write-quanta %d%s",
1342 bgp
->wpkt_quanta
, VTY_NEWLINE
);
1348 /* Update-delay configuration */
1349 DEFUN (bgp_wpkt_quanta
,
1350 bgp_wpkt_quanta_cmd
,
1351 "write-quanta <1-4294967295>",
1352 "How many packets to write to peer socket per run\n"
1353 "Number of packets\n")
1355 return bgp_wpkt_quanta_config_vty(vty
, argv
[0], 1);
1358 /* Update-delay deconfiguration */
1359 DEFUN (no_bgp_wpkt_quanta
,
1360 no_bgp_wpkt_quanta_cmd
,
1361 "no write-quanta <1-4294967295>",
1362 "How many packets to write to peer socket per run\n"
1363 "Number of packets\n")
1365 return bgp_wpkt_quanta_config_vty(vty
, argv
[0], 0);
1369 bgp_coalesce_config_vty (struct vty
*vty
, const char *num
, char set
)
1376 VTY_GET_INTEGER_RANGE ("coalesce-time", bgp
->coalesce_time
, num
,
1379 bgp
->coalesce_time
= BGP_DEFAULT_SUBGROUP_COALESCE_TIME
;
1385 bgp_config_write_coalesce_time (struct vty
*vty
, struct bgp
*bgp
)
1387 if (bgp
->coalesce_time
!= BGP_DEFAULT_SUBGROUP_COALESCE_TIME
)
1388 vty_out (vty
, " coalesce-time %d%s",
1389 bgp
->coalesce_time
, VTY_NEWLINE
);
1395 DEFUN (bgp_coalesce_time
,
1396 bgp_coalesce_time_cmd
,
1397 "coalesce-time <0-4294967295>",
1398 "Subgroup coalesce timer\n"
1399 "Subgroup coalesce timer value (in ms)\n")
1401 return bgp_coalesce_config_vty(vty
, argv
[0], 1);
1404 DEFUN (no_bgp_coalesce_time
,
1405 no_bgp_coalesce_time_cmd
,
1406 "no coalesce-time <0-4294967295>",
1407 "Subgroup coalesce timer\n"
1408 "Subgroup coalesce timer value (in ms)\n")
1410 return bgp_coalesce_config_vty(vty
, argv
[0], 0);
1413 /* Maximum-paths configuration */
1414 DEFUN (bgp_maxpaths
,
1416 "maximum-paths <1-255>",
1417 "Forward packets over multiple paths\n"
1418 "Number of paths\n")
1420 return bgp_maxpaths_config_vty(vty
, BGP_PEER_EBGP
, argv
[0], 0, 1);
1423 DEFUN (bgp_maxpaths_ibgp
,
1424 bgp_maxpaths_ibgp_cmd
,
1425 "maximum-paths ibgp <1-255>",
1426 "Forward packets over multiple paths\n"
1428 "Number of paths\n")
1430 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, argv
[0], 0, 1);
1433 DEFUN (bgp_maxpaths_ibgp_cluster
,
1434 bgp_maxpaths_ibgp_cluster_cmd
,
1435 "maximum-paths ibgp <1-255> equal-cluster-length",
1436 "Forward packets over multiple paths\n"
1439 "Match the cluster length\n")
1441 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, argv
[0],
1442 BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN
, 1);
1445 DEFUN (no_bgp_maxpaths
,
1446 no_bgp_maxpaths_cmd
,
1449 "Forward packets over multiple paths\n"
1450 "Number of paths\n")
1452 return bgp_maxpaths_config_vty(vty
, BGP_PEER_EBGP
, NULL
, 0, 0);
1455 ALIAS (no_bgp_maxpaths
,
1456 no_bgp_maxpaths_arg_cmd
,
1457 "no maximum-paths <1-255>",
1459 "Forward packets over multiple paths\n"
1460 "Number of paths\n")
1462 DEFUN (no_bgp_maxpaths_ibgp
,
1463 no_bgp_maxpaths_ibgp_cmd
,
1464 "no maximum-paths ibgp",
1466 "Forward packets over multiple paths\n"
1468 "Number of paths\n")
1470 return bgp_maxpaths_config_vty(vty
, BGP_PEER_IBGP
, NULL
, 0, 0);
1473 ALIAS (no_bgp_maxpaths_ibgp
,
1474 no_bgp_maxpaths_ibgp_arg_cmd
,
1475 "no maximum-paths ibgp <1-255>",
1477 "Forward packets over multiple paths\n"
1479 "Number of paths\n")
1481 ALIAS (no_bgp_maxpaths_ibgp
,
1482 no_bgp_maxpaths_ibgp_cluster_cmd
,
1483 "no maximum-paths ibgp <1-255> equal-cluster-length",
1485 "Forward packets over multiple paths\n"
1488 "Match the cluster length\n")
1491 bgp_config_write_maxpaths (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
1492 safi_t safi
, int *write
)
1494 if (bgp
->maxpaths
[afi
][safi
].maxpaths_ebgp
!= BGP_DEFAULT_MAXPATHS
)
1496 bgp_config_write_family_header (vty
, afi
, safi
, write
);
1497 vty_out (vty
, " maximum-paths %d%s",
1498 bgp
->maxpaths
[afi
][safi
].maxpaths_ebgp
, VTY_NEWLINE
);
1501 if (bgp
->maxpaths
[afi
][safi
].maxpaths_ibgp
!= BGP_DEFAULT_MAXPATHS
)
1503 bgp_config_write_family_header (vty
, afi
, safi
, write
);
1504 vty_out (vty
, " maximum-paths ibgp %d",
1505 bgp
->maxpaths
[afi
][safi
].maxpaths_ibgp
);
1506 if (CHECK_FLAG (bgp
->maxpaths
[afi
][safi
].ibgp_flags
,
1507 BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN
))
1508 vty_out (vty
, " equal-cluster-length");
1509 vty_out (vty
, "%s", VTY_NEWLINE
);
1519 "timers bgp <0-65535> <0-65535>",
1520 "Adjust routing timers\n"
1522 "Keepalive interval\n"
1526 unsigned long keepalive
= 0;
1527 unsigned long holdtime
= 0;
1531 VTY_GET_INTEGER ("keepalive", keepalive
, argv
[0]);
1532 VTY_GET_INTEGER ("holdtime", holdtime
, argv
[1]);
1534 /* Holdtime value check. */
1535 if (holdtime
< 3 && holdtime
!= 0)
1537 vty_out (vty
, "%% hold time value must be either 0 or greater than 3%s",
1542 bgp_timers_set (bgp
, keepalive
, holdtime
);
1547 DEFUN (no_bgp_timers
,
1551 "Adjust routing timers\n"
1557 bgp_timers_unset (bgp
);
1562 ALIAS (no_bgp_timers
,
1563 no_bgp_timers_arg_cmd
,
1564 "no timers bgp <0-65535> <0-65535>",
1566 "Adjust routing timers\n"
1568 "Keepalive interval\n"
1571 DEFUN (bgp_client_to_client_reflection
,
1572 bgp_client_to_client_reflection_cmd
,
1573 "bgp client-to-client reflection",
1574 "BGP specific commands\n"
1575 "Configure client to client route reflection\n"
1576 "reflection of routes allowed\n")
1581 bgp_flag_unset (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
1582 bgp_clear_star_soft_out (vty
);
1587 DEFUN (no_bgp_client_to_client_reflection
,
1588 no_bgp_client_to_client_reflection_cmd
,
1589 "no bgp client-to-client reflection",
1591 "BGP specific commands\n"
1592 "Configure client to client route reflection\n"
1593 "reflection of routes allowed\n")
1598 bgp_flag_set (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
1599 bgp_clear_star_soft_out (vty
);
1604 /* "bgp always-compare-med" configuration. */
1605 DEFUN (bgp_always_compare_med
,
1606 bgp_always_compare_med_cmd
,
1607 "bgp always-compare-med",
1608 "BGP specific commands\n"
1609 "Allow comparing MED from different neighbors\n")
1614 bgp_flag_set (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
1615 bgp_recalculate_all_bestpaths (bgp
);
1620 DEFUN (no_bgp_always_compare_med
,
1621 no_bgp_always_compare_med_cmd
,
1622 "no bgp always-compare-med",
1624 "BGP specific commands\n"
1625 "Allow comparing MED from different neighbors\n")
1630 bgp_flag_unset (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
1631 bgp_recalculate_all_bestpaths (bgp
);
1636 /* "bgp deterministic-med" configuration. */
1637 DEFUN (bgp_deterministic_med
,
1638 bgp_deterministic_med_cmd
,
1639 "bgp deterministic-med",
1640 "BGP specific commands\n"
1641 "Pick the best-MED path among paths advertised from the neighboring AS\n")
1646 bgp_flag_set (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
1647 bgp_recalculate_all_bestpaths (bgp
);
1652 DEFUN (no_bgp_deterministic_med
,
1653 no_bgp_deterministic_med_cmd
,
1654 "no bgp deterministic-med",
1656 "BGP specific commands\n"
1657 "Pick the best-MED path among paths advertised from the neighboring AS\n")
1662 bgp_flag_unset (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
1663 bgp_recalculate_all_bestpaths (bgp
);
1668 /* "bgp graceful-restart" configuration. */
1669 DEFUN (bgp_graceful_restart
,
1670 bgp_graceful_restart_cmd
,
1671 "bgp graceful-restart",
1672 "BGP specific commands\n"
1673 "Graceful restart capability parameters\n")
1678 bgp_flag_set (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
1682 DEFUN (no_bgp_graceful_restart
,
1683 no_bgp_graceful_restart_cmd
,
1684 "no bgp graceful-restart",
1686 "BGP specific commands\n"
1687 "Graceful restart capability parameters\n")
1692 bgp_flag_unset (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
1696 DEFUN (bgp_graceful_restart_stalepath_time
,
1697 bgp_graceful_restart_stalepath_time_cmd
,
1698 "bgp graceful-restart stalepath-time <1-3600>",
1699 "BGP specific commands\n"
1700 "Graceful restart capability parameters\n"
1701 "Set the max time to hold onto restarting peer's stale paths\n"
1702 "Delay value (seconds)\n")
1705 u_int32_t stalepath
;
1711 VTY_GET_INTEGER_RANGE ("stalepath-time", stalepath
, argv
[0], 1, 3600);
1712 bgp
->stalepath_time
= stalepath
;
1716 DEFUN (no_bgp_graceful_restart_stalepath_time
,
1717 no_bgp_graceful_restart_stalepath_time_cmd
,
1718 "no bgp graceful-restart stalepath-time",
1720 "BGP specific commands\n"
1721 "Graceful restart capability parameters\n"
1722 "Set the max time to hold onto restarting peer's stale paths\n")
1730 bgp
->stalepath_time
= BGP_DEFAULT_STALEPATH_TIME
;
1734 ALIAS (no_bgp_graceful_restart_stalepath_time
,
1735 no_bgp_graceful_restart_stalepath_time_val_cmd
,
1736 "no bgp graceful-restart stalepath-time <1-3600>",
1738 "BGP specific commands\n"
1739 "Graceful restart capability parameters\n"
1740 "Set the max time to hold onto restarting peer's stale paths\n"
1741 "Delay value (seconds)\n")
1743 /* "bgp fast-external-failover" configuration. */
1744 DEFUN (bgp_fast_external_failover
,
1745 bgp_fast_external_failover_cmd
,
1746 "bgp fast-external-failover",
1748 "Immediately reset session if a link to a directly connected external peer goes down\n")
1753 bgp_flag_unset (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
1757 DEFUN (no_bgp_fast_external_failover
,
1758 no_bgp_fast_external_failover_cmd
,
1759 "no bgp fast-external-failover",
1762 "Immediately reset session if a link to a directly connected external peer goes down\n")
1767 bgp_flag_set (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
1771 /* "bgp enforce-first-as" configuration. */
1772 DEFUN (bgp_enforce_first_as
,
1773 bgp_enforce_first_as_cmd
,
1774 "bgp enforce-first-as",
1776 "Enforce the first AS for EBGP routes\n")
1781 bgp_flag_set (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
1782 bgp_clear_star_soft_in (vty
);
1787 DEFUN (no_bgp_enforce_first_as
,
1788 no_bgp_enforce_first_as_cmd
,
1789 "no bgp enforce-first-as",
1792 "Enforce the first AS for EBGP routes\n")
1797 bgp_flag_unset (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
1798 bgp_clear_star_soft_in (vty
);
1803 /* "bgp bestpath compare-routerid" configuration. */
1804 DEFUN (bgp_bestpath_compare_router_id
,
1805 bgp_bestpath_compare_router_id_cmd
,
1806 "bgp bestpath compare-routerid",
1807 "BGP specific commands\n"
1808 "Change the default bestpath selection\n"
1809 "Compare router-id for identical EBGP paths\n")
1814 bgp_flag_set (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
1815 bgp_recalculate_all_bestpaths (bgp
);
1820 DEFUN (no_bgp_bestpath_compare_router_id
,
1821 no_bgp_bestpath_compare_router_id_cmd
,
1822 "no bgp bestpath compare-routerid",
1824 "BGP specific commands\n"
1825 "Change the default bestpath selection\n"
1826 "Compare router-id for identical EBGP paths\n")
1831 bgp_flag_unset (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
1832 bgp_recalculate_all_bestpaths (bgp
);
1837 /* "bgp bestpath as-path ignore" configuration. */
1838 DEFUN (bgp_bestpath_aspath_ignore
,
1839 bgp_bestpath_aspath_ignore_cmd
,
1840 "bgp bestpath as-path ignore",
1841 "BGP specific commands\n"
1842 "Change the default bestpath selection\n"
1843 "AS-path attribute\n"
1844 "Ignore as-path length in selecting a route\n")
1849 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_IGNORE
);
1850 bgp_recalculate_all_bestpaths (bgp
);
1855 DEFUN (no_bgp_bestpath_aspath_ignore
,
1856 no_bgp_bestpath_aspath_ignore_cmd
,
1857 "no bgp bestpath as-path ignore",
1859 "BGP specific commands\n"
1860 "Change the default bestpath selection\n"
1861 "AS-path attribute\n"
1862 "Ignore as-path length in selecting a route\n")
1867 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_IGNORE
);
1868 bgp_recalculate_all_bestpaths (bgp
);
1873 /* "bgp bestpath as-path confed" configuration. */
1874 DEFUN (bgp_bestpath_aspath_confed
,
1875 bgp_bestpath_aspath_confed_cmd
,
1876 "bgp bestpath as-path confed",
1877 "BGP specific commands\n"
1878 "Change the default bestpath selection\n"
1879 "AS-path attribute\n"
1880 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1885 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_CONFED
);
1886 bgp_recalculate_all_bestpaths (bgp
);
1891 DEFUN (no_bgp_bestpath_aspath_confed
,
1892 no_bgp_bestpath_aspath_confed_cmd
,
1893 "no bgp bestpath as-path confed",
1895 "BGP specific commands\n"
1896 "Change the default bestpath selection\n"
1897 "AS-path attribute\n"
1898 "Compare path lengths including confederation sets & sequences in selecting a route\n")
1903 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_CONFED
);
1904 bgp_recalculate_all_bestpaths (bgp
);
1909 /* "bgp bestpath as-path multipath-relax" configuration. */
1910 DEFUN (bgp_bestpath_aspath_multipath_relax
,
1911 bgp_bestpath_aspath_multipath_relax_cmd
,
1912 "bgp bestpath as-path multipath-relax",
1913 "BGP specific commands\n"
1914 "Change the default bestpath selection\n"
1915 "AS-path attribute\n"
1916 "Allow load sharing across routes that have different AS paths (but same length)\n")
1921 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
1922 bgp_flag_unset (bgp
, BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET
);
1923 bgp_recalculate_all_bestpaths (bgp
);
1928 DEFUN (no_bgp_bestpath_aspath_multipath_relax
,
1929 no_bgp_bestpath_aspath_multipath_relax_cmd
,
1930 "no bgp bestpath as-path multipath-relax",
1932 "BGP specific commands\n"
1933 "Change the default bestpath selection\n"
1934 "AS-path attribute\n"
1935 "Allow load sharing across routes that have different AS paths (but same length)\n")
1940 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
1941 bgp_flag_unset (bgp
, BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET
);
1942 bgp_recalculate_all_bestpaths (bgp
);
1947 /* "bgp bestpath as-path multipath-relax no-as-set" configuration. */
1948 DEFUN (bgp_bestpath_aspath_multipath_relax_no_as_set
,
1949 bgp_bestpath_aspath_multipath_relax_no_as_set_cmd
,
1950 "bgp bestpath as-path multipath-relax no-as-set",
1951 "BGP specific commands\n"
1952 "Change the default bestpath selection\n"
1953 "AS-path attribute\n"
1954 "Allow load sharing across routes that have different AS paths (but same length)\n"
1955 "Do not generate an AS_SET\n")
1960 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
1961 bgp_flag_set (bgp
, BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET
);
1962 bgp_recalculate_all_bestpaths (bgp
);
1967 DEFUN (no_bgp_bestpath_aspath_multipath_relax_no_as_set
,
1968 no_bgp_bestpath_aspath_multipath_relax_no_as_set_cmd
,
1969 "no bgp bestpath as-path multipath-relax no-as-set",
1971 "BGP specific commands\n"
1972 "Change the default bestpath selection\n"
1973 "AS-path attribute\n"
1974 "Allow load sharing across routes that have different AS paths (but same length)\n"
1975 "Do not generate an AS_SET\n")
1980 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_MULTIPATH_RELAX
);
1981 bgp_flag_unset (bgp
, BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET
);
1982 bgp_recalculate_all_bestpaths (bgp
);
1987 /* "bgp log-neighbor-changes" configuration. */
1988 DEFUN (bgp_log_neighbor_changes
,
1989 bgp_log_neighbor_changes_cmd
,
1990 "bgp log-neighbor-changes",
1991 "BGP specific commands\n"
1992 "Log neighbor up/down and reset reason\n")
1997 bgp_flag_set (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
2001 DEFUN (no_bgp_log_neighbor_changes
,
2002 no_bgp_log_neighbor_changes_cmd
,
2003 "no bgp log-neighbor-changes",
2005 "BGP specific commands\n"
2006 "Log neighbor up/down and reset reason\n")
2011 bgp_flag_unset (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
2015 /* "bgp bestpath med" configuration. */
2016 DEFUN (bgp_bestpath_med
,
2017 bgp_bestpath_med_cmd
,
2018 "bgp bestpath med (confed|missing-as-worst)",
2019 "BGP specific commands\n"
2020 "Change the default bestpath selection\n"
2022 "Compare MED among confederation paths\n"
2023 "Treat missing MED as the least preferred one\n")
2029 if (strncmp (argv
[0], "confed", 1) == 0)
2030 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
2032 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2034 bgp_recalculate_all_bestpaths (bgp
);
2039 DEFUN (bgp_bestpath_med2
,
2040 bgp_bestpath_med2_cmd
,
2041 "bgp bestpath med confed missing-as-worst",
2042 "BGP specific commands\n"
2043 "Change the default bestpath selection\n"
2045 "Compare MED among confederation paths\n"
2046 "Treat missing MED as the least preferred one\n")
2051 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
2052 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2053 bgp_recalculate_all_bestpaths (bgp
);
2058 ALIAS (bgp_bestpath_med2
,
2059 bgp_bestpath_med3_cmd
,
2060 "bgp bestpath med missing-as-worst confed",
2061 "BGP specific commands\n"
2062 "Change the default bestpath selection\n"
2064 "Treat missing MED as the least preferred one\n"
2065 "Compare MED among confederation paths\n")
2067 DEFUN (no_bgp_bestpath_med
,
2068 no_bgp_bestpath_med_cmd
,
2069 "no bgp bestpath med (confed|missing-as-worst)",
2071 "BGP specific commands\n"
2072 "Change the default bestpath selection\n"
2074 "Compare MED among confederation paths\n"
2075 "Treat missing MED as the least preferred one\n")
2081 if (strncmp (argv
[0], "confed", 1) == 0)
2082 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
2084 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2086 bgp_recalculate_all_bestpaths (bgp
);
2091 DEFUN (no_bgp_bestpath_med2
,
2092 no_bgp_bestpath_med2_cmd
,
2093 "no bgp bestpath med confed missing-as-worst",
2095 "BGP specific commands\n"
2096 "Change the default bestpath selection\n"
2098 "Compare MED among confederation paths\n"
2099 "Treat missing MED as the least preferred one\n")
2104 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
2105 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
2106 bgp_recalculate_all_bestpaths (bgp
);
2111 ALIAS (no_bgp_bestpath_med2
,
2112 no_bgp_bestpath_med3_cmd
,
2113 "no bgp bestpath med missing-as-worst confed",
2115 "BGP specific commands\n"
2116 "Change the default bestpath selection\n"
2118 "Treat missing MED as the least preferred one\n"
2119 "Compare MED among confederation paths\n")
2121 /* "no bgp default ipv4-unicast". */
2122 DEFUN (no_bgp_default_ipv4_unicast
,
2123 no_bgp_default_ipv4_unicast_cmd
,
2124 "no bgp default ipv4-unicast",
2126 "BGP specific commands\n"
2127 "Configure BGP defaults\n"
2128 "Activate ipv4-unicast for a peer by default\n")
2133 bgp_flag_set (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
2137 DEFUN (bgp_default_ipv4_unicast
,
2138 bgp_default_ipv4_unicast_cmd
,
2139 "bgp default ipv4-unicast",
2140 "BGP specific commands\n"
2141 "Configure BGP defaults\n"
2142 "Activate ipv4-unicast for a peer by default\n")
2147 bgp_flag_unset (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
2151 /* Display hostname in certain command outputs */
2152 DEFUN (bgp_default_show_hostname
,
2153 bgp_default_show_hostname_cmd
,
2154 "bgp default show-hostname",
2155 "BGP specific commands\n"
2156 "Configure BGP defaults\n"
2157 "Show hostname in certain command ouputs\n")
2162 bgp_flag_set (bgp
, BGP_FLAG_SHOW_HOSTNAME
);
2166 DEFUN (no_bgp_default_show_hostname
,
2167 no_bgp_default_show_hostname_cmd
,
2168 "no bgp default show-hostname",
2170 "BGP specific commands\n"
2171 "Configure BGP defaults\n"
2172 "Show hostname in certain command ouputs\n")
2177 bgp_flag_unset (bgp
, BGP_FLAG_SHOW_HOSTNAME
);
2181 /* "bgp import-check" configuration. */
2182 DEFUN (bgp_network_import_check
,
2183 bgp_network_import_check_cmd
,
2184 "bgp network import-check {exact}",
2185 "BGP specific commands\n"
2186 "BGP network command\n"
2187 "Check BGP network route exists in IGP\n"
2188 "Match route precisely")
2194 if (!bgp_flag_check(bgp
, BGP_FLAG_IMPORT_CHECK
))
2196 bgp_flag_set (bgp
, BGP_FLAG_IMPORT_CHECK
);
2200 if (argv
[0] != NULL
)
2202 if (!bgp_flag_check(bgp
, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH
))
2204 bgp_flag_set (bgp
, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH
);
2208 else if (bgp_flag_check(bgp
, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH
))
2210 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH
);
2215 bgp_static_redo_import_check(bgp
);
2220 DEFUN (no_bgp_network_import_check
,
2221 no_bgp_network_import_check_cmd
,
2222 "no bgp network import-check {exact}",
2224 "BGP specific commands\n"
2225 "BGP network command\n"
2226 "Check BGP network route exists in IGP\n")
2231 if (bgp_flag_check(bgp
, BGP_FLAG_IMPORT_CHECK
))
2233 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK
);
2234 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH
);
2235 bgp_static_redo_import_check(bgp
);
2240 DEFUN (bgp_default_local_preference
,
2241 bgp_default_local_preference_cmd
,
2242 "bgp default local-preference <0-4294967295>",
2243 "BGP specific commands\n"
2244 "Configure BGP defaults\n"
2245 "local preference (higher=more preferred)\n"
2246 "Configure default local preference value\n")
2249 u_int32_t local_pref
;
2253 VTY_GET_INTEGER ("local preference", local_pref
, argv
[0]);
2255 bgp_default_local_preference_set (bgp
, local_pref
);
2256 bgp_clear_star_soft_in (vty
);
2261 DEFUN (no_bgp_default_local_preference
,
2262 no_bgp_default_local_preference_cmd
,
2263 "no bgp default local-preference",
2265 "BGP specific commands\n"
2266 "Configure BGP defaults\n"
2267 "local preference (higher=more preferred)\n")
2272 bgp_default_local_preference_unset (bgp
);
2273 bgp_clear_star_soft_in (vty
);
2278 ALIAS (no_bgp_default_local_preference
,
2279 no_bgp_default_local_preference_val_cmd
,
2280 "no bgp default local-preference <0-4294967295>",
2282 "BGP specific commands\n"
2283 "Configure BGP defaults\n"
2284 "local preference (higher=more preferred)\n"
2285 "Configure default local preference value\n")
2287 DEFUN (bgp_default_subgroup_pkt_queue_max
,
2288 bgp_default_subgroup_pkt_queue_max_cmd
,
2289 "bgp default subgroup-pkt-queue-max <20-100>",
2290 "BGP specific commands\n"
2291 "Configure BGP defaults\n"
2292 "subgroup-pkt-queue-max\n"
2293 "Configure subgroup packet queue max\n")
2300 VTY_GET_INTEGER ("subgroup packet queue max", max_size
, argv
[0]);
2302 bgp_default_subgroup_pkt_queue_max_set (bgp
, max_size
);
2307 DEFUN (no_bgp_default_subgroup_pkt_queue_max
,
2308 no_bgp_default_subgroup_pkt_queue_max_cmd
,
2309 "no bgp default subgroup-pkt-queue-max",
2311 "BGP specific commands\n"
2312 "Configure BGP defaults\n"
2313 "subgroup-pkt-queue-max\n")
2318 bgp_default_subgroup_pkt_queue_max_unset (bgp
);
2322 DEFUN (bgp_rr_allow_outbound_policy
,
2323 bgp_rr_allow_outbound_policy_cmd
,
2324 "bgp route-reflector allow-outbound-policy",
2325 "BGP specific commands\n"
2326 "Allow modifications made by out route-map\n"
2327 "on ibgp neighbors\n")
2333 if (!bgp_flag_check(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
))
2335 bgp_flag_set(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
);
2336 update_group_announce_rrclients(bgp
);
2337 bgp_clear_star_soft_out (vty
);
2343 DEFUN (no_bgp_rr_allow_outbound_policy
,
2344 no_bgp_rr_allow_outbound_policy_cmd
,
2345 "no bgp route-reflector allow-outbound-policy",
2347 "BGP specific commands\n"
2348 "Allow modifications made by out route-map\n"
2349 "on ibgp neighbors\n")
2355 if (bgp_flag_check(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
))
2357 bgp_flag_unset(bgp
, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY
);
2358 update_group_announce_rrclients(bgp
);
2359 bgp_clear_star_soft_out (vty
);
2365 DEFUN (bgp_listen_limit
,
2366 bgp_listen_limit_cmd
,
2367 "bgp listen limit " DYNAMIC_NEIGHBOR_LIMIT_RANGE
,
2368 "BGP specific commands\n"
2369 "Configure BGP defaults\n"
2370 "maximum number of BGP Dynamic Neighbors that can be created\n"
2371 "Configure Dynamic Neighbors listen limit value\n")
2378 VTY_GET_INTEGER_RANGE ("listen limit", listen_limit
, argv
[0],
2379 BGP_DYNAMIC_NEIGHBORS_LIMIT_MIN
,
2380 BGP_DYNAMIC_NEIGHBORS_LIMIT_MAX
);
2382 bgp_listen_limit_set (bgp
, listen_limit
);
2387 DEFUN (no_bgp_listen_limit
,
2388 no_bgp_listen_limit_cmd
,
2389 "no bgp listen limit",
2390 "BGP specific commands\n"
2391 "Configure BGP defaults\n"
2392 "unset maximum number of BGP Dynamic Neighbors that can be created\n"
2393 "Configure Dynamic Neighbors listen limit value to default\n")
2398 bgp_listen_limit_unset (bgp
);
2403 DEFUN (bgp_listen_range
,
2404 bgp_listen_range_cmd
,
2405 LISTEN_RANGE_CMD
"peer-group WORD" ,
2406 "BGP specific commands\n"
2407 "Configure BGP Dynamic Neighbors\n"
2408 "add a listening range for Dynamic Neighbors\n"
2409 LISTEN_RANGE_ADDR_STR
)
2412 struct prefix range
;
2413 struct peer_group
*group
;
2419 //VTY_GET_IPV4_PREFIX ("listen range", range, argv[0]);
2421 /* Convert IP prefix string to struct prefix. */
2422 ret
= str2prefix (argv
[0], &range
);
2425 vty_out (vty
, "%% Malformed listen range%s", VTY_NEWLINE
);
2429 afi
= family2afi(range
.family
);
2432 if (afi
== AFI_IP6
&& IN6_IS_ADDR_LINKLOCAL (&range
.u
.prefix6
))
2434 vty_out (vty
, "%% Malformed listen range (link-local address)%s",
2438 #endif /* HAVE_IPV6 */
2440 apply_mask (&range
);
2443 group
= peer_group_lookup (bgp
, argv
[1]);
2446 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
2450 ret
= peer_group_listen_range_add(group
, &range
);
2451 return bgp_vty_return (vty
, ret
);
2454 DEFUN (no_bgp_listen_range
,
2455 no_bgp_listen_range_cmd
,
2456 "no bgp listen range A.B.C.D/M peer-group WORD" ,
2457 "BGP specific commands\n"
2458 "Configure BGP defaults\n"
2459 "delete a listening range for Dynamic Neighbors\n"
2460 "Remove Dynamic Neighbors listening range\n")
2463 struct prefix range
;
2464 struct peer_group
*group
;
2470 // VTY_GET_IPV4_PREFIX ("listen range", range, argv[0]);
2472 /* Convert IP prefix string to struct prefix. */
2473 ret
= str2prefix (argv
[0], &range
);
2476 vty_out (vty
, "%% Malformed listen range%s", VTY_NEWLINE
);
2480 afi
= family2afi(range
.family
);
2483 if (afi
== AFI_IP6
&& IN6_IS_ADDR_LINKLOCAL (&range
.u
.prefix6
))
2485 vty_out (vty
, "%% Malformed listen range (link-local address)%s",
2489 #endif /* HAVE_IPV6 */
2491 apply_mask (&range
);
2494 group
= peer_group_lookup (bgp
, argv
[1]);
2497 vty_out (vty
, "%% Peer-group does not exist%s", VTY_NEWLINE
);
2501 ret
= peer_group_listen_range_del(group
, &range
);
2502 return bgp_vty_return (vty
, ret
);
2506 bgp_config_write_listen (struct vty
*vty
, struct bgp
*bgp
)
2508 struct peer_group
*group
;
2509 struct listnode
*node
, *nnode
, *rnode
, *nrnode
;
2510 struct prefix
*range
;
2514 if (bgp
->dynamic_neighbors_limit
!= BGP_DYNAMIC_NEIGHBORS_LIMIT_DEFAULT
)
2515 vty_out (vty
, " bgp listen limit %d%s",
2516 bgp
->dynamic_neighbors_limit
, VTY_NEWLINE
);
2518 for (ALL_LIST_ELEMENTS (bgp
->group
, node
, nnode
, group
))
2520 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
2522 for (ALL_LIST_ELEMENTS (group
->listen_range
[afi
], rnode
, nrnode
, range
))
2524 prefix2str(range
, buf
, sizeof(buf
));
2525 vty_out(vty
, " bgp listen range %s peer-group %s%s",
2526 buf
, group
->name
, VTY_NEWLINE
);
2535 DEFUN (bgp_disable_connected_route_check
,
2536 bgp_disable_connected_route_check_cmd
,
2537 "bgp disable-ebgp-connected-route-check",
2538 "BGP specific commands\n"
2539 "Disable checking if nexthop is connected on ebgp sessions\n")
2544 bgp_flag_set (bgp
, BGP_FLAG_DISABLE_NH_CONNECTED_CHK
);
2545 bgp_clear_star_soft_in (vty
);
2550 DEFUN (no_bgp_disable_connected_route_check
,
2551 no_bgp_disable_connected_route_check_cmd
,
2552 "no bgp disable-ebgp-connected-route-check",
2554 "BGP specific commands\n"
2555 "Disable checking if nexthop is connected on ebgp sessions\n")
2560 bgp_flag_unset (bgp
, BGP_FLAG_DISABLE_NH_CONNECTED_CHK
);
2561 bgp_clear_star_soft_in (vty
);
2568 peer_remote_as_vty (struct vty
*vty
, const char *peer_str
,
2569 const char *as_str
, afi_t afi
, safi_t safi
)
2574 int as_type
= AS_SPECIFIED
;
2579 if (strncmp(as_str
, "internal", strlen("internal")) == 0)
2582 as_type
= AS_INTERNAL
;
2584 else if (strncmp(as_str
, "external", strlen("external")) == 0)
2587 as_type
= AS_EXTERNAL
;
2591 /* Get AS number. */
2592 VTY_GET_INTEGER_RANGE ("AS", as
, as_str
, 1, BGP_AS4_MAX
);
2595 /* If peer is peer group, call proper function. */
2596 ret
= str2sockunion (peer_str
, &su
);
2599 /* Check for peer by interface */
2600 ret
= peer_remote_as (bgp
, NULL
, peer_str
, &as
, as_type
, afi
, safi
);
2603 ret
= peer_group_remote_as (bgp
, peer_str
, &as
, as_type
);
2606 vty_out (vty
, "%% Create the peer-group or interface first%s",
2615 if (peer_address_self_check (&su
))
2617 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
2621 ret
= peer_remote_as (bgp
, &su
, NULL
, &as
, as_type
, afi
, safi
);
2624 /* This peer belongs to peer group. */
2627 case BGP_ERR_PEER_GROUP_MEMBER
:
2628 vty_out (vty
, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as
, VTY_NEWLINE
);
2630 case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
:
2631 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
);
2634 return bgp_vty_return (vty
, ret
);
2637 DEFUN (neighbor_remote_as
,
2638 neighbor_remote_as_cmd
,
2639 NEIGHBOR_CMD2
"remote-as (" CMD_AS_RANGE
"|external|internal)",
2642 "Specify a BGP neighbor\n"
2645 return peer_remote_as_vty (vty
, argv
[0], argv
[1], AFI_IP
, SAFI_UNICAST
);
2648 DEFUN (neighbor_interface_config
,
2649 neighbor_interface_config_cmd
,
2650 "neighbor WORD interface",
2652 "Interface name or neighbor tag\n"
2653 "Enable BGP on interface\n")
2657 struct peer_group
*group
;
2660 group
= peer_group_lookup (bgp
, argv
[0]);
2663 vty_out (vty
, "%% Name conflict with peer-group %s", VTY_NEWLINE
);
2667 peer
= peer_conf_interface_get (bgp
, argv
[0], AFI_IP
, SAFI_UNICAST
);
2675 DEFUN (neighbor_peer_group
,
2676 neighbor_peer_group_cmd
,
2677 "neighbor WORD peer-group",
2679 "Interface name or neighbor tag\n"
2680 "Configure peer-group\n")
2684 struct peer_group
*group
;
2687 peer
= peer_lookup_by_conf_if (bgp
, argv
[0]);
2690 vty_out (vty
, "%% Name conflict with interface: %s", VTY_NEWLINE
);
2694 group
= peer_group_get (bgp
, argv
[0]);
2710 struct peer_group
*group
;
2714 ret
= str2sockunion (argv
[0], &su
);
2717 /* look up for neighbor by interface name config. */
2718 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
2725 group
= peer_group_lookup (vty
->index
, argv
[0]);
2727 peer_group_delete (group
);
2730 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
2736 peer
= peer_lookup (vty
->index
, &su
);
2739 if (peer_dynamic_neighbor (peer
))
2741 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
2746 other
= peer
->doppelganger
;
2748 if (other
&& other
->status
!= Deleted
)
2757 no_neighbor_remote_as_cmd
,
2758 NO_NEIGHBOR_CMD
"remote-as (" CMD_AS_RANGE
"|internal|external)",
2762 "Specify a BGP neighbor\n"
2765 DEFUN (no_neighbor_interface_config
,
2766 no_neighbor_interface_config_cmd
,
2767 "no neighbor WORD interface",
2771 "Configure BGP on interface\n")
2775 /* look up for neighbor by interface name config. */
2776 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
2783 vty_out (vty
, "%% Create the bgp interface first%s", VTY_NEWLINE
);
2789 DEFUN (no_neighbor_peer_group
,
2790 no_neighbor_peer_group_cmd
,
2791 "no neighbor WORD peer-group",
2795 "Configure peer-group\n")
2797 struct peer_group
*group
;
2799 group
= peer_group_lookup (vty
->index
, argv
[0]);
2801 peer_group_delete (group
);
2804 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
2810 DEFUN (no_neighbor_interface_peer_group_remote_as
,
2811 no_neighbor_interface_peer_group_remote_as_cmd
,
2812 "no neighbor WORD remote-as (" CMD_AS_RANGE
"|internal|external)",
2815 "Interface name or neighbor tag\n"
2816 "Specify a BGP neighbor\n"
2819 struct peer_group
*group
;
2822 /* look up for neighbor by interface name config. */
2823 peer
= peer_lookup_by_conf_if (vty
->index
, argv
[0]);
2826 peer_as_change (peer
, 0, AS_SPECIFIED
);
2830 group
= peer_group_lookup (vty
->index
, argv
[0]);
2832 peer_group_remote_as_delete (group
);
2835 vty_out (vty
, "%% Create the peer-group or interface first%s", VTY_NEWLINE
);
2841 DEFUN (neighbor_local_as
,
2842 neighbor_local_as_cmd
,
2843 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
2846 "Specify a local-as number\n"
2847 "AS number used as local AS\n")
2852 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2856 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 0, 0);
2857 return bgp_vty_return (vty
, ret
);
2860 DEFUN (neighbor_local_as_no_prepend
,
2861 neighbor_local_as_no_prepend_cmd
,
2862 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
2865 "Specify a local-as number\n"
2866 "AS number used as local AS\n"
2867 "Do not prepend local-as to updates from ebgp peers\n")
2872 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2876 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1, 0);
2877 return bgp_vty_return (vty
, ret
);
2880 DEFUN (neighbor_local_as_no_prepend_replace_as
,
2881 neighbor_local_as_no_prepend_replace_as_cmd
,
2882 NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend replace-as",
2885 "Specify a local-as number\n"
2886 "AS number used as local AS\n"
2887 "Do not prepend local-as to updates from ebgp peers\n"
2888 "Do not prepend local-as to updates from ibgp peers\n")
2893 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2897 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1, 1);
2898 return bgp_vty_return (vty
, ret
);
2902 DEFUN (no_neighbor_local_as
,
2903 no_neighbor_local_as_cmd
,
2904 NO_NEIGHBOR_CMD2
"local-as",
2908 "Specify a local-as number\n")
2913 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2917 ret
= peer_local_as_unset (peer
);
2918 return bgp_vty_return (vty
, ret
);
2921 ALIAS (no_neighbor_local_as
,
2922 no_neighbor_local_as_val_cmd
,
2923 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
,
2927 "Specify a local-as number\n"
2928 "AS number used as local AS\n")
2930 ALIAS (no_neighbor_local_as
,
2931 no_neighbor_local_as_val2_cmd
,
2932 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend",
2936 "Specify a local-as number\n"
2937 "AS number used as local AS\n"
2938 "Do not prepend local-as to updates from ebgp peers\n")
2940 ALIAS (no_neighbor_local_as
,
2941 no_neighbor_local_as_val3_cmd
,
2942 NO_NEIGHBOR_CMD2
"local-as " CMD_AS_RANGE
" no-prepend replace-as",
2946 "Specify a local-as number\n"
2947 "AS number used as local AS\n"
2948 "Do not prepend local-as to updates from ebgp peers\n"
2949 "Do not prepend local-as to updates from ibgp peers\n")
2951 DEFUN (neighbor_solo
,
2953 NEIGHBOR_CMD2
"solo",
2956 "Solo peer - part of its own update group\n")
2961 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2965 ret
= update_group_adjust_soloness(peer
, 1);
2966 return bgp_vty_return (vty
, ret
);
2969 DEFUN (no_neighbor_solo
,
2970 no_neighbor_solo_cmd
,
2971 NO_NEIGHBOR_CMD2
"solo",
2975 "Solo peer - part of its own update group\n")
2980 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2984 ret
= update_group_adjust_soloness(peer
, 0);
2985 return bgp_vty_return (vty
, ret
);
2988 DEFUN (neighbor_password
,
2989 neighbor_password_cmd
,
2990 NEIGHBOR_CMD2
"password LINE",
2999 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3003 ret
= peer_password_set (peer
, argv
[1]);
3004 return bgp_vty_return (vty
, ret
);
3007 DEFUN (no_neighbor_password
,
3008 no_neighbor_password_cmd
,
3009 NO_NEIGHBOR_CMD2
"password",
3018 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3022 ret
= peer_password_unset (peer
);
3023 return bgp_vty_return (vty
, ret
);
3026 DEFUN (neighbor_activate
,
3027 neighbor_activate_cmd
,
3028 NEIGHBOR_CMD2
"activate",
3031 "Enable the Address Family for this Neighbor\n")
3035 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3039 peer_activate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3044 DEFUN (no_neighbor_activate
,
3045 no_neighbor_activate_cmd
,
3046 NO_NEIGHBOR_CMD2
"activate",
3050 "Enable the Address Family for this Neighbor\n")
3056 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3060 ret
= peer_deactivate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3062 return bgp_vty_return (vty
, ret
);
3065 DEFUN (neighbor_set_peer_group
,
3066 neighbor_set_peer_group_cmd
,
3067 NEIGHBOR_CMD2
"peer-group WORD",
3070 "Member of the peer-group\n"
3071 "peer-group name\n")
3078 struct peer_group
*group
;
3083 ret
= str2sockunion (argv
[0], &su
);
3086 peer
= peer_lookup_by_conf_if (bgp
, argv
[0]);
3089 vty_out (vty
, "%% Malformed address or name: %s%s", argv
[0], VTY_NEWLINE
);
3095 if (peer_address_self_check (&su
))
3097 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
3102 /* Disallow for dynamic neighbor. */
3103 peer
= peer_lookup (bgp
, &su
);
3104 if (peer
&& peer_dynamic_neighbor (peer
))
3106 vty_out (vty
, "%% Operation not allowed on a dynamic neighbor%s",
3112 group
= peer_group_lookup (bgp
, argv
[1]);
3115 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
3119 ret
= peer_group_bind (bgp
, &su
, peer
, group
, bgp_node_afi (vty
),
3120 bgp_node_safi (vty
), &as
);
3122 if (ret
== BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
)
3124 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
);
3128 return bgp_vty_return (vty
, ret
);
3131 DEFUN (no_neighbor_set_peer_group
,
3132 no_neighbor_set_peer_group_cmd
,
3133 NO_NEIGHBOR_CMD2
"peer-group WORD",
3137 "Member of the peer-group\n"
3138 "peer-group name\n")
3143 struct peer_group
*group
;
3147 peer
= peer_lookup_vty (vty
, argv
[0]);
3151 group
= peer_group_lookup (bgp
, argv
[1]);
3154 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
3158 ret
= peer_group_unbind (bgp
, peer
, group
, bgp_node_afi (vty
),
3159 bgp_node_safi (vty
));
3161 return bgp_vty_return (vty
, ret
);
3165 peer_flag_modify_vty (struct vty
*vty
, const char *ip_str
,
3166 u_int16_t flag
, int set
)
3171 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3176 ret
= peer_flag_set (peer
, flag
);
3178 ret
= peer_flag_unset (peer
, flag
);
3180 return bgp_vty_return (vty
, ret
);
3184 peer_flag_set_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
3186 return peer_flag_modify_vty (vty
, ip_str
, flag
, 1);
3190 peer_flag_unset_vty (struct vty
*vty
, const char *ip_str
, u_int16_t flag
)
3192 return peer_flag_modify_vty (vty
, ip_str
, flag
, 0);
3195 /* neighbor passive. */
3196 DEFUN (neighbor_passive
,
3197 neighbor_passive_cmd
,
3198 NEIGHBOR_CMD2
"passive",
3201 "Don't send open messages to this neighbor\n")
3203 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
3206 DEFUN (no_neighbor_passive
,
3207 no_neighbor_passive_cmd
,
3208 NO_NEIGHBOR_CMD2
"passive",
3212 "Don't send open messages to this neighbor\n")
3214 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
3217 /* neighbor shutdown. */
3218 DEFUN (neighbor_shutdown
,
3219 neighbor_shutdown_cmd
,
3220 NEIGHBOR_CMD2
"shutdown",
3223 "Administratively shut down this neighbor\n")
3225 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
3228 DEFUN (no_neighbor_shutdown
,
3229 no_neighbor_shutdown_cmd
,
3230 NO_NEIGHBOR_CMD2
"shutdown",
3234 "Administratively shut down this neighbor\n")
3236 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
3240 DEFUN (neighbor_bfd
,
3242 NEIGHBOR_CMD2
"bfd",
3245 "Respond to BFD session event\n")
3247 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_BFD
);
3250 DEFUN (no_neighbor_bfd
,
3251 no_neighbor_bfd_cmd
,
3252 NO_NEIGHBOR_CMD2
"bfd",
3256 "Respond to BFD session event\n")
3258 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_BFD
);
3261 /* Deprecated neighbor capability route-refresh. */
3262 DEFUN_DEPRECATED (neighbor_capability_route_refresh
,
3263 neighbor_capability_route_refresh_cmd
,
3264 NEIGHBOR_CMD2
"capability route-refresh",
3267 "Advertise capability to the peer\n"
3268 "Advertise route-refresh capability to this neighbor\n")
3273 DEFUN_DEPRECATED (no_neighbor_capability_route_refresh
,
3274 no_neighbor_capability_route_refresh_cmd
,
3275 NO_NEIGHBOR_CMD2
"capability route-refresh",
3279 "Advertise capability to the peer\n"
3280 "Advertise route-refresh capability to this neighbor\n")
3285 /* neighbor capability dynamic. */
3286 DEFUN (neighbor_capability_dynamic
,
3287 neighbor_capability_dynamic_cmd
,
3288 NEIGHBOR_CMD2
"capability dynamic",
3291 "Advertise capability to the peer\n"
3292 "Advertise dynamic capability to this neighbor\n")
3294 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
3297 DEFUN (no_neighbor_capability_dynamic
,
3298 no_neighbor_capability_dynamic_cmd
,
3299 NO_NEIGHBOR_CMD2
"capability dynamic",
3303 "Advertise capability to the peer\n"
3304 "Advertise dynamic capability to this neighbor\n")
3306 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
3309 /* neighbor dont-capability-negotiate */
3310 DEFUN (neighbor_dont_capability_negotiate
,
3311 neighbor_dont_capability_negotiate_cmd
,
3312 NEIGHBOR_CMD2
"dont-capability-negotiate",
3315 "Do not perform capability negotiation\n")
3317 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
3320 DEFUN (no_neighbor_dont_capability_negotiate
,
3321 no_neighbor_dont_capability_negotiate_cmd
,
3322 NO_NEIGHBOR_CMD2
"dont-capability-negotiate",
3326 "Do not perform capability negotiation\n")
3328 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
3331 /* neighbor capability extended next hop encoding */
3332 DEFUN (neighbor_capability_enhe
,
3333 neighbor_capability_enhe_cmd
,
3334 NEIGHBOR_CMD2
"capability extended-nexthop",
3337 "Advertise capability to the peer\n"
3338 "Advertise extended next-hop capability to the peer\n")
3340 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_CAPABILITY_ENHE
);
3343 DEFUN (no_neighbor_capability_enhe
,
3344 no_neighbor_capability_enhe_cmd
,
3345 NO_NEIGHBOR_CMD2
"capability extended-nexthop",
3349 "Advertise capability to the peer\n"
3350 "Advertise extended next-hop capability to the peer\n")
3352 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_CAPABILITY_ENHE
);
3356 peer_af_flag_modify_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
3357 safi_t safi
, u_int32_t flag
, int set
)
3362 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3367 ret
= peer_af_flag_set (peer
, afi
, safi
, flag
);
3369 ret
= peer_af_flag_unset (peer
, afi
, safi
, flag
);
3371 return bgp_vty_return (vty
, ret
);
3375 peer_af_flag_set_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
3376 safi_t safi
, u_int32_t flag
)
3378 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 1);
3382 peer_af_flag_unset_vty (struct vty
*vty
, const char *peer_str
, afi_t afi
,
3383 safi_t safi
, u_int32_t flag
)
3385 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 0);
3388 /* neighbor capability orf prefix-list. */
3389 DEFUN (neighbor_capability_orf_prefix
,
3390 neighbor_capability_orf_prefix_cmd
,
3391 NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
3394 "Advertise capability to the peer\n"
3395 "Advertise ORF capability to the peer\n"
3396 "Advertise prefixlist ORF capability to this neighbor\n"
3397 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
3398 "Capability to RECEIVE the ORF from this neighbor\n"
3399 "Capability to SEND the ORF to this neighbor\n")
3403 if (strncmp (argv
[1], "s", 1) == 0)
3404 flag
= PEER_FLAG_ORF_PREFIX_SM
;
3405 else if (strncmp (argv
[1], "r", 1) == 0)
3406 flag
= PEER_FLAG_ORF_PREFIX_RM
;
3407 else if (strncmp (argv
[1], "b", 1) == 0)
3408 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
3412 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3413 bgp_node_safi (vty
), flag
);
3416 DEFUN (no_neighbor_capability_orf_prefix
,
3417 no_neighbor_capability_orf_prefix_cmd
,
3418 NO_NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
3422 "Advertise capability to the peer\n"
3423 "Advertise ORF capability to the peer\n"
3424 "Advertise prefixlist ORF capability to this neighbor\n"
3425 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
3426 "Capability to RECEIVE the ORF from this neighbor\n"
3427 "Capability to SEND the ORF to this neighbor\n")
3431 if (strncmp (argv
[1], "s", 1) == 0)
3432 flag
= PEER_FLAG_ORF_PREFIX_SM
;
3433 else if (strncmp (argv
[1], "r", 1) == 0)
3434 flag
= PEER_FLAG_ORF_PREFIX_RM
;
3435 else if (strncmp (argv
[1], "b", 1) == 0)
3436 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
3440 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3441 bgp_node_safi (vty
), flag
);
3444 /* neighbor next-hop-self. */
3445 DEFUN (neighbor_nexthop_self
,
3446 neighbor_nexthop_self_cmd
,
3447 NEIGHBOR_CMD2
"next-hop-self {all}",
3450 "Disable the next hop calculation for this neighbor\n"
3451 "Apply also to ibgp-learned routes when acting as a route reflector\n")
3453 u_int32_t flags
= PEER_FLAG_NEXTHOP_SELF
, unset
= 0;
3456 /* Check if "all" is specified */
3457 if (argv
[1] != NULL
)
3458 flags
|= PEER_FLAG_NEXTHOP_SELF_ALL
;
3460 unset
|= PEER_FLAG_NEXTHOP_SELF_ALL
;
3462 rc
= peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3463 bgp_node_safi (vty
), flags
);
3464 if ( rc
== CMD_SUCCESS
&& unset
)
3465 rc
= peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3466 bgp_node_safi (vty
), unset
);
3470 DEFUN (no_neighbor_nexthop_self
,
3471 no_neighbor_nexthop_self_cmd
,
3472 NO_NEIGHBOR_CMD2
"next-hop-self {all}",
3476 "Disable the next hop calculation for this neighbor\n"
3477 "Apply also to ibgp-learned routes when acting as a route reflector\n")
3479 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3480 bgp_node_safi (vty
),
3481 PEER_FLAG_NEXTHOP_SELF
|PEER_FLAG_NEXTHOP_SELF_ALL
);
3484 /* neighbor as-override */
3485 DEFUN (neighbor_as_override
,
3486 neighbor_as_override_cmd
,
3487 NEIGHBOR_CMD2
"as-override",
3490 "Override ASNs in outbound updates if aspath equals remote-as\n")
3492 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3493 bgp_node_safi (vty
),
3494 PEER_FLAG_AS_OVERRIDE
);
3497 DEFUN (no_neighbor_as_override
,
3498 no_neighbor_as_override_cmd
,
3499 NO_NEIGHBOR_CMD2
"as-override",
3503 "Override ASNs in outbound updates if aspath equals remote-as\n")
3505 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3506 bgp_node_safi (vty
),
3507 PEER_FLAG_AS_OVERRIDE
);
3510 /* neighbor remove-private-AS. */
3511 DEFUN (neighbor_remove_private_as
,
3512 neighbor_remove_private_as_cmd
,
3513 NEIGHBOR_CMD2
"remove-private-AS",
3516 "Remove private ASNs in outbound updates\n")
3518 peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3519 bgp_node_safi (vty
),
3520 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
|
3521 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
3522 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3523 bgp_node_safi (vty
),
3524 PEER_FLAG_REMOVE_PRIVATE_AS
);
3527 DEFUN (neighbor_remove_private_as_all
,
3528 neighbor_remove_private_as_all_cmd
,
3529 NEIGHBOR_CMD2
"remove-private-AS all",
3532 "Remove private ASNs in outbound updates\n"
3533 "Apply to all AS numbers")
3535 peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3536 bgp_node_safi (vty
),
3537 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
3538 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3539 bgp_node_safi (vty
),
3540 PEER_FLAG_REMOVE_PRIVATE_AS
|
3541 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
);
3544 DEFUN (neighbor_remove_private_as_replace_as
,
3545 neighbor_remove_private_as_replace_as_cmd
,
3546 NEIGHBOR_CMD2
"remove-private-AS replace-AS",
3549 "Remove private ASNs in outbound updates\n"
3550 "Replace private ASNs with our ASN in outbound updates\n")
3552 peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3553 bgp_node_safi (vty
),
3554 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
);
3555 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3556 bgp_node_safi (vty
),
3557 PEER_FLAG_REMOVE_PRIVATE_AS
|
3558 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
3561 DEFUN (neighbor_remove_private_as_all_replace_as
,
3562 neighbor_remove_private_as_all_replace_as_cmd
,
3563 NEIGHBOR_CMD2
"remove-private-AS all replace-AS",
3566 "Remove private ASNs in outbound updates\n"
3567 "Apply to all AS numbers"
3568 "Replace private ASNs with our ASN in outbound updates\n")
3570 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3571 bgp_node_safi (vty
),
3572 PEER_FLAG_REMOVE_PRIVATE_AS
|
3573 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
|
3574 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
3577 DEFUN (no_neighbor_remove_private_as
,
3578 no_neighbor_remove_private_as_cmd
,
3579 NO_NEIGHBOR_CMD2
"remove-private-AS",
3583 "Remove private ASNs in outbound updates\n")
3585 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3586 bgp_node_safi (vty
),
3587 PEER_FLAG_REMOVE_PRIVATE_AS
|
3588 PEER_FLAG_REMOVE_PRIVATE_AS_ALL
|
3589 PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
);
3592 ALIAS (no_neighbor_remove_private_as
,
3593 no_neighbor_remove_private_as_all_cmd
,
3594 NO_NEIGHBOR_CMD2
"remove-private-AS all",
3598 "Remove private ASNs in outbound updates\n"
3599 "Apply to all AS numbers")
3601 ALIAS (no_neighbor_remove_private_as
,
3602 no_neighbor_remove_private_as_replace_as_cmd
,
3603 NO_NEIGHBOR_CMD2
"remove-private-AS replace-AS",
3607 "Remove private ASNs in outbound updates\n"
3608 "Replace private ASNs with our ASN in outbound updates\n")
3610 ALIAS (no_neighbor_remove_private_as
,
3611 no_neighbor_remove_private_as_all_replace_as_cmd
,
3612 NO_NEIGHBOR_CMD2
"remove-private-AS all replace-AS",
3616 "Remove private ASNs in outbound updates\n"
3617 "Apply to all AS numbers"
3618 "Replace private ASNs with our ASN in outbound updates\n")
3621 /* neighbor send-community. */
3622 DEFUN (neighbor_send_community
,
3623 neighbor_send_community_cmd
,
3624 NEIGHBOR_CMD2
"send-community",
3627 "Send Community attribute to this neighbor\n")
3629 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3630 bgp_node_safi (vty
),
3631 PEER_FLAG_SEND_COMMUNITY
);
3634 DEFUN (no_neighbor_send_community
,
3635 no_neighbor_send_community_cmd
,
3636 NO_NEIGHBOR_CMD2
"send-community",
3640 "Send Community attribute to this neighbor\n")
3642 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3643 bgp_node_safi (vty
),
3644 PEER_FLAG_SEND_COMMUNITY
);
3647 /* neighbor send-community extended. */
3648 DEFUN (neighbor_send_community_type
,
3649 neighbor_send_community_type_cmd
,
3650 NEIGHBOR_CMD2
"send-community (both|extended|standard)",
3653 "Send Community attribute to this neighbor\n"
3654 "Send Standard and Extended Community attributes\n"
3655 "Send Extended Community attributes\n"
3656 "Send Standard Community attributes\n")
3658 if (strncmp (argv
[1], "s", 1) == 0)
3659 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3660 bgp_node_safi (vty
),
3661 PEER_FLAG_SEND_COMMUNITY
);
3662 if (strncmp (argv
[1], "e", 1) == 0)
3663 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3664 bgp_node_safi (vty
),
3665 PEER_FLAG_SEND_EXT_COMMUNITY
);
3667 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3668 bgp_node_safi (vty
),
3669 (PEER_FLAG_SEND_COMMUNITY
|
3670 PEER_FLAG_SEND_EXT_COMMUNITY
));
3673 DEFUN (no_neighbor_send_community_type
,
3674 no_neighbor_send_community_type_cmd
,
3675 NO_NEIGHBOR_CMD2
"send-community (both|extended|standard)",
3679 "Send Community attribute to this neighbor\n"
3680 "Send Standard and Extended Community attributes\n"
3681 "Send Extended Community attributes\n"
3682 "Send Standard Community attributes\n")
3684 if (strncmp (argv
[1], "s", 1) == 0)
3685 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3686 bgp_node_safi (vty
),
3687 PEER_FLAG_SEND_COMMUNITY
);
3688 if (strncmp (argv
[1], "e", 1) == 0)
3689 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3690 bgp_node_safi (vty
),
3691 PEER_FLAG_SEND_EXT_COMMUNITY
);
3693 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3694 bgp_node_safi (vty
),
3695 (PEER_FLAG_SEND_COMMUNITY
|
3696 PEER_FLAG_SEND_EXT_COMMUNITY
));
3699 /* neighbor soft-reconfig. */
3700 DEFUN (neighbor_soft_reconfiguration
,
3701 neighbor_soft_reconfiguration_cmd
,
3702 NEIGHBOR_CMD2
"soft-reconfiguration inbound",
3705 "Per neighbor soft reconfiguration\n"
3706 "Allow inbound soft reconfiguration for this neighbor\n")
3708 return peer_af_flag_set_vty (vty
, argv
[0],
3709 bgp_node_afi (vty
), bgp_node_safi (vty
),
3710 PEER_FLAG_SOFT_RECONFIG
);
3713 DEFUN (no_neighbor_soft_reconfiguration
,
3714 no_neighbor_soft_reconfiguration_cmd
,
3715 NO_NEIGHBOR_CMD2
"soft-reconfiguration inbound",
3719 "Per neighbor soft reconfiguration\n"
3720 "Allow inbound soft reconfiguration for this neighbor\n")
3722 return peer_af_flag_unset_vty (vty
, argv
[0],
3723 bgp_node_afi (vty
), bgp_node_safi (vty
),
3724 PEER_FLAG_SOFT_RECONFIG
);
3727 DEFUN (neighbor_route_reflector_client
,
3728 neighbor_route_reflector_client_cmd
,
3729 NEIGHBOR_CMD2
"route-reflector-client",
3732 "Configure a neighbor as Route Reflector client\n")
3737 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3741 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3742 bgp_node_safi (vty
),
3743 PEER_FLAG_REFLECTOR_CLIENT
);
3746 DEFUN (no_neighbor_route_reflector_client
,
3747 no_neighbor_route_reflector_client_cmd
,
3748 NO_NEIGHBOR_CMD2
"route-reflector-client",
3752 "Configure a neighbor as Route Reflector client\n")
3754 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3755 bgp_node_safi (vty
),
3756 PEER_FLAG_REFLECTOR_CLIENT
);
3760 peer_rsclient_set_vty (struct vty
*vty
, const char *peer_str
,
3766 struct peer_group
*group
;
3767 struct listnode
*node
, *nnode
;
3768 struct bgp_filter
*pfilter
;
3769 struct bgp_filter
*gfilter
;
3770 int locked_and_added
= 0;
3774 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3778 /* If it is already a RS-Client, don't do anything. */
3779 if ( CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
3782 if ( ! peer_rsclient_active (peer
) )
3784 peer
= peer_lock (peer
); /* rsclient peer list reference */
3785 listnode_add_sort (bgp
->rsclient
, peer
);
3786 locked_and_added
= 1;
3789 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
3792 if (locked_and_added
)
3794 listnode_delete (bgp
->rsclient
, peer
);
3795 peer_unlock (peer
); /* rsclient peer list reference */
3798 return bgp_vty_return (vty
, ret
);
3801 peer
->rib
[afi
][safi
] = bgp_table_init (afi
, safi
);
3802 peer
->rib
[afi
][safi
]->type
= BGP_TABLE_RSCLIENT
;
3803 /* RIB peer reference. Released when table is free'd in bgp_table_free. */
3804 peer
->rib
[afi
][safi
]->owner
= peer_lock (peer
);
3806 /* Check for existing 'network' and 'redistribute' routes. */
3807 bgp_check_local_routes_rsclient (peer
, afi
, safi
);
3809 /* Check for routes for peers configured with 'soft-reconfiguration'. */
3810 bgp_soft_reconfig_rsclient (peer
, afi
, safi
);
3812 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
3814 group
= peer
->group
;
3815 gfilter
= &peer
->filter
[afi
][safi
];
3817 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
3819 pfilter
= &peer
->filter
[afi
][safi
];
3821 /* Members of a non-RS-Client group should not be RS-Clients, as that
3822 is checked when the become part of the peer-group */
3823 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
3825 return bgp_vty_return (vty
, ret
);
3827 /* Make peer's RIB point to group's RIB. */
3828 peer
->rib
[afi
][safi
] = group
->conf
->rib
[afi
][safi
];
3830 /* Import policy. */
3831 if (pfilter
->map
[RMAP_IMPORT
].name
)
3832 free (pfilter
->map
[RMAP_IMPORT
].name
);
3833 if (gfilter
->map
[RMAP_IMPORT
].name
)
3835 pfilter
->map
[RMAP_IMPORT
].name
= strdup (gfilter
->map
[RMAP_IMPORT
].name
);
3836 pfilter
->map
[RMAP_IMPORT
].map
= gfilter
->map
[RMAP_IMPORT
].map
;
3840 pfilter
->map
[RMAP_IMPORT
].name
= NULL
;
3841 pfilter
->map
[RMAP_IMPORT
].map
=NULL
;
3844 /* Export policy. */
3845 if (gfilter
->map
[RMAP_EXPORT
].name
&& ! pfilter
->map
[RMAP_EXPORT
].name
)
3847 pfilter
->map
[RMAP_EXPORT
].name
= strdup (gfilter
->map
[RMAP_EXPORT
].name
);
3848 pfilter
->map
[RMAP_EXPORT
].map
= gfilter
->map
[RMAP_EXPORT
].map
;
3856 peer_rsclient_unset_vty (struct vty
*vty
, const char *peer_str
,
3862 struct peer_group
*group
;
3863 struct listnode
*node
, *nnode
;
3867 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
3871 /* If it is not a RS-Client, don't do anything. */
3872 if ( ! CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
3875 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
3877 group
= peer
->group
;
3879 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
3881 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
3883 return bgp_vty_return (vty
, ret
);
3885 peer
->rib
[afi
][safi
] = NULL
;
3891 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
3893 return bgp_vty_return (vty
, ret
);
3895 if ( ! peer_rsclient_active (peer
) )
3897 bgp_clear_route (peer
, afi
, safi
, BGP_CLEAR_ROUTE_MY_RSCLIENT
);
3898 listnode_delete (bgp
->rsclient
, peer
);
3899 peer_unlock (peer
); /* peer bgp rsclient reference */
3902 bgp_table_finish (&peer
->rib
[bgp_node_afi(vty
)][bgp_node_safi(vty
)]);
3907 /* neighbor route-server-client. */
3908 DEFUN (neighbor_route_server_client
,
3909 neighbor_route_server_client_cmd
,
3910 NEIGHBOR_CMD2
"route-server-client",
3913 "Configure a neighbor as Route Server client\n")
3915 return peer_rsclient_set_vty (vty
, argv
[0], bgp_node_afi(vty
),
3916 bgp_node_safi(vty
));
3919 DEFUN (no_neighbor_route_server_client
,
3920 no_neighbor_route_server_client_cmd
,
3921 NO_NEIGHBOR_CMD2
"route-server-client",
3925 "Configure a neighbor as Route Server client\n")
3927 return peer_rsclient_unset_vty (vty
, argv
[0], bgp_node_afi(vty
),
3928 bgp_node_safi(vty
));
3931 DEFUN (neighbor_nexthop_local_unchanged
,
3932 neighbor_nexthop_local_unchanged_cmd
,
3933 NEIGHBOR_CMD2
"nexthop-local unchanged",
3936 "Configure treatment of outgoing link-local nexthop attribute\n"
3937 "Leave link-local nexthop unchanged for this peer\n")
3939 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3940 bgp_node_safi (vty
),
3941 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
3944 DEFUN (no_neighbor_nexthop_local_unchanged
,
3945 no_neighbor_nexthop_local_unchanged_cmd
,
3946 NO_NEIGHBOR_CMD2
"nexthop-local unchanged",
3950 "Configure treatment of outgoing link-local-nexthop attribute\n"
3951 "Leave link-local nexthop unchanged for this peer\n")
3953 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3954 bgp_node_safi (vty
),
3955 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
3958 DEFUN (neighbor_attr_unchanged
,
3959 neighbor_attr_unchanged_cmd
,
3960 NEIGHBOR_CMD2
"attribute-unchanged",
3963 "BGP attribute is propagated unchanged to this neighbor\n")
3965 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3966 bgp_node_safi (vty
),
3967 (PEER_FLAG_AS_PATH_UNCHANGED
|
3968 PEER_FLAG_NEXTHOP_UNCHANGED
|
3969 PEER_FLAG_MED_UNCHANGED
));
3972 DEFUN (neighbor_attr_unchanged1
,
3973 neighbor_attr_unchanged1_cmd
,
3974 NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
3977 "BGP attribute is propagated unchanged to this neighbor\n"
3978 "As-path attribute\n"
3979 "Nexthop attribute\n"
3982 u_int16_t flags
= 0;
3984 if (strncmp (argv
[1], "as-path", 1) == 0)
3985 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
3986 else if (strncmp (argv
[1], "next-hop", 1) == 0)
3987 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
3988 else if (strncmp (argv
[1], "med", 1) == 0)
3989 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
3991 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3992 bgp_node_safi (vty
), flags
);
3995 DEFUN (neighbor_attr_unchanged2
,
3996 neighbor_attr_unchanged2_cmd
,
3997 NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
4000 "BGP attribute is propagated unchanged to this neighbor\n"
4001 "As-path attribute\n"
4002 "Nexthop attribute\n"
4005 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
4007 if (strncmp (argv
[1], "next-hop", 1) == 0)
4008 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4009 else if (strncmp (argv
[1], "med", 1) == 0)
4010 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4012 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4013 bgp_node_safi (vty
), flags
);
4017 DEFUN (neighbor_attr_unchanged3
,
4018 neighbor_attr_unchanged3_cmd
,
4019 NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
4022 "BGP attribute is propagated unchanged to this neighbor\n"
4023 "Nexthop attribute\n"
4024 "As-path attribute\n"
4027 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
4029 if (strncmp (argv
[1], "as-path", 1) == 0)
4030 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4031 else if (strncmp (argv
[1], "med", 1) == 0)
4032 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4034 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4035 bgp_node_safi (vty
), flags
);
4038 DEFUN (neighbor_attr_unchanged4
,
4039 neighbor_attr_unchanged4_cmd
,
4040 NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
4043 "BGP attribute is propagated unchanged to this neighbor\n"
4045 "As-path attribute\n"
4046 "Nexthop attribute\n")
4048 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
4050 if (strncmp (argv
[1], "as-path", 1) == 0)
4051 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4052 else if (strncmp (argv
[1], "next-hop", 1) == 0)
4053 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4055 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4056 bgp_node_safi (vty
), flags
);
4059 ALIAS (neighbor_attr_unchanged
,
4060 neighbor_attr_unchanged5_cmd
,
4061 NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
4064 "BGP attribute is propagated unchanged to this neighbor\n"
4065 "As-path attribute\n"
4066 "Nexthop attribute\n"
4069 ALIAS (neighbor_attr_unchanged
,
4070 neighbor_attr_unchanged6_cmd
,
4071 NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
4074 "BGP attribute is propagated unchanged to this neighbor\n"
4075 "As-path attribute\n"
4077 "Nexthop attribute\n")
4079 ALIAS (neighbor_attr_unchanged
,
4080 neighbor_attr_unchanged7_cmd
,
4081 NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
4084 "BGP attribute is propagated unchanged to this neighbor\n"
4085 "Nexthop attribute\n"
4087 "As-path attribute\n")
4089 ALIAS (neighbor_attr_unchanged
,
4090 neighbor_attr_unchanged8_cmd
,
4091 NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
4094 "BGP attribute is propagated unchanged to this neighbor\n"
4095 "Nexthop attribute\n"
4096 "As-path attribute\n"
4099 ALIAS (neighbor_attr_unchanged
,
4100 neighbor_attr_unchanged9_cmd
,
4101 NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
4104 "BGP attribute is propagated unchanged to this neighbor\n"
4106 "Nexthop attribute\n"
4107 "As-path attribute\n")
4109 ALIAS (neighbor_attr_unchanged
,
4110 neighbor_attr_unchanged10_cmd
,
4111 NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
4114 "BGP attribute is propagated unchanged to this neighbor\n"
4116 "As-path attribute\n"
4117 "Nexthop attribute\n")
4119 DEFUN (no_neighbor_attr_unchanged
,
4120 no_neighbor_attr_unchanged_cmd
,
4121 NO_NEIGHBOR_CMD2
"attribute-unchanged",
4125 "BGP attribute is propagated unchanged to this neighbor\n")
4127 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4128 bgp_node_safi (vty
),
4129 (PEER_FLAG_AS_PATH_UNCHANGED
|
4130 PEER_FLAG_NEXTHOP_UNCHANGED
|
4131 PEER_FLAG_MED_UNCHANGED
));
4134 DEFUN (no_neighbor_attr_unchanged1
,
4135 no_neighbor_attr_unchanged1_cmd
,
4136 NO_NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
4140 "BGP attribute is propagated unchanged to this neighbor\n"
4141 "As-path attribute\n"
4142 "Nexthop attribute\n"
4145 u_int16_t flags
= 0;
4147 if (strncmp (argv
[1], "as-path", 1) == 0)
4148 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4149 else if (strncmp (argv
[1], "next-hop", 1) == 0)
4150 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4151 else if (strncmp (argv
[1], "med", 1) == 0)
4152 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4154 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4155 bgp_node_safi (vty
), flags
);
4158 DEFUN (no_neighbor_attr_unchanged2
,
4159 no_neighbor_attr_unchanged2_cmd
,
4160 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
4164 "BGP attribute is propagated unchanged to this neighbor\n"
4165 "As-path attribute\n"
4166 "Nexthop attribute\n"
4169 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
4171 if (strncmp (argv
[1], "next-hop", 1) == 0)
4172 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4173 else if (strncmp (argv
[1], "med", 1) == 0)
4174 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4176 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4177 bgp_node_safi (vty
), flags
);
4180 DEFUN (no_neighbor_attr_unchanged3
,
4181 no_neighbor_attr_unchanged3_cmd
,
4182 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
4186 "BGP attribute is propagated unchanged to this neighbor\n"
4187 "Nexthop attribute\n"
4188 "As-path attribute\n"
4191 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
4193 if (strncmp (argv
[1], "as-path", 1) == 0)
4194 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4195 else if (strncmp (argv
[1], "med", 1) == 0)
4196 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
4198 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4199 bgp_node_safi (vty
), flags
);
4202 DEFUN (no_neighbor_attr_unchanged4
,
4203 no_neighbor_attr_unchanged4_cmd
,
4204 NO_NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
4208 "BGP attribute is propagated unchanged to this neighbor\n"
4210 "As-path attribute\n"
4211 "Nexthop attribute\n")
4213 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
4215 if (strncmp (argv
[1], "as-path", 1) == 0)
4216 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
4217 else if (strncmp (argv
[1], "next-hop", 1) == 0)
4218 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
4220 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
4221 bgp_node_safi (vty
), flags
);
4224 ALIAS (no_neighbor_attr_unchanged
,
4225 no_neighbor_attr_unchanged5_cmd
,
4226 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
4230 "BGP attribute is propagated unchanged to this neighbor\n"
4231 "As-path attribute\n"
4232 "Nexthop attribute\n"
4235 ALIAS (no_neighbor_attr_unchanged
,
4236 no_neighbor_attr_unchanged6_cmd
,
4237 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
4241 "BGP attribute is propagated unchanged to this neighbor\n"
4242 "As-path attribute\n"
4244 "Nexthop attribute\n")
4246 ALIAS (no_neighbor_attr_unchanged
,
4247 no_neighbor_attr_unchanged7_cmd
,
4248 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
4252 "BGP attribute is propagated unchanged to this neighbor\n"
4253 "Nexthop attribute\n"
4255 "As-path attribute\n")
4257 ALIAS (no_neighbor_attr_unchanged
,
4258 no_neighbor_attr_unchanged8_cmd
,
4259 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
4263 "BGP attribute is propagated unchanged to this neighbor\n"
4264 "Nexthop attribute\n"
4265 "As-path attribute\n"
4268 ALIAS (no_neighbor_attr_unchanged
,
4269 no_neighbor_attr_unchanged9_cmd
,
4270 NO_NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
4274 "BGP attribute is propagated unchanged to this neighbor\n"
4276 "Nexthop attribute\n"
4277 "As-path attribute\n")
4279 ALIAS (no_neighbor_attr_unchanged
,
4280 no_neighbor_attr_unchanged10_cmd
,
4281 NO_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 /* For old version Zebra compatibility. */
4291 DEFUN_DEPRECATED (neighbor_transparent_as
,
4292 neighbor_transparent_as_cmd
,
4293 NEIGHBOR_CMD
"transparent-as",
4296 "Do not append my AS number even peer is EBGP peer\n")
4298 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4299 bgp_node_safi (vty
),
4300 PEER_FLAG_AS_PATH_UNCHANGED
);
4303 DEFUN_DEPRECATED (neighbor_transparent_nexthop
,
4304 neighbor_transparent_nexthop_cmd
,
4305 NEIGHBOR_CMD
"transparent-nexthop",
4308 "Do not change nexthop even peer is EBGP peer\n")
4310 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4311 bgp_node_safi (vty
),
4312 PEER_FLAG_NEXTHOP_UNCHANGED
);
4315 /* EBGP multihop configuration. */
4317 peer_ebgp_multihop_set_vty (struct vty
*vty
, const char *ip_str
,
4318 const char *ttl_str
)
4323 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4330 VTY_GET_INTEGER_RANGE ("TTL", ttl
, ttl_str
, 1, 255);
4332 return bgp_vty_return (vty
, peer_ebgp_multihop_set (peer
, ttl
));
4336 peer_ebgp_multihop_unset_vty (struct vty
*vty
, const char *ip_str
)
4340 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4344 return bgp_vty_return (vty
, peer_ebgp_multihop_unset (peer
));
4347 /* neighbor ebgp-multihop. */
4348 DEFUN (neighbor_ebgp_multihop
,
4349 neighbor_ebgp_multihop_cmd
,
4350 NEIGHBOR_CMD2
"ebgp-multihop",
4353 "Allow EBGP neighbors not on directly connected networks\n")
4355 return peer_ebgp_multihop_set_vty (vty
, argv
[0], NULL
);
4358 DEFUN (neighbor_ebgp_multihop_ttl
,
4359 neighbor_ebgp_multihop_ttl_cmd
,
4360 NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
4363 "Allow EBGP neighbors not on directly connected networks\n"
4364 "maximum hop count\n")
4366 return peer_ebgp_multihop_set_vty (vty
, argv
[0], argv
[1]);
4369 DEFUN (no_neighbor_ebgp_multihop
,
4370 no_neighbor_ebgp_multihop_cmd
,
4371 NO_NEIGHBOR_CMD2
"ebgp-multihop",
4375 "Allow EBGP neighbors not on directly connected networks\n")
4377 return peer_ebgp_multihop_unset_vty (vty
, argv
[0]);
4380 ALIAS (no_neighbor_ebgp_multihop
,
4381 no_neighbor_ebgp_multihop_ttl_cmd
,
4382 NO_NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
4386 "Allow EBGP neighbors not on directly connected networks\n"
4387 "maximum hop count\n")
4389 /* disable-connected-check */
4390 DEFUN (neighbor_disable_connected_check
,
4391 neighbor_disable_connected_check_cmd
,
4392 NEIGHBOR_CMD2
"disable-connected-check",
4395 "one-hop away EBGP peer using loopback address\n")
4397 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
4400 DEFUN (no_neighbor_disable_connected_check
,
4401 no_neighbor_disable_connected_check_cmd
,
4402 NO_NEIGHBOR_CMD2
"disable-connected-check",
4406 "one-hop away EBGP peer using loopback address\n")
4408 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DISABLE_CONNECTED_CHECK
);
4411 /* Enforce multihop. */
4412 ALIAS (neighbor_disable_connected_check
,
4413 neighbor_enforce_multihop_cmd
,
4414 NEIGHBOR_CMD2
"enforce-multihop",
4417 "Enforce EBGP neighbors perform multihop\n")
4419 /* Enforce multihop. */
4420 ALIAS (no_neighbor_disable_connected_check
,
4421 no_neighbor_enforce_multihop_cmd
,
4422 NO_NEIGHBOR_CMD2
"enforce-multihop",
4426 "Enforce EBGP neighbors perform multihop\n")
4428 DEFUN (neighbor_description
,
4429 neighbor_description_cmd
,
4430 NEIGHBOR_CMD2
"description .LINE",
4433 "Neighbor specific description\n"
4434 "Up to 80 characters describing this neighbor\n")
4439 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4446 str
= argv_concat(argv
, argc
, 1);
4448 peer_description_set (peer
, str
);
4450 XFREE (MTYPE_TMP
, str
);
4455 DEFUN (no_neighbor_description
,
4456 no_neighbor_description_cmd
,
4457 NO_NEIGHBOR_CMD2
"description",
4461 "Neighbor specific description\n")
4465 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
4469 peer_description_unset (peer
);
4474 ALIAS (no_neighbor_description
,
4475 no_neighbor_description_val_cmd
,
4476 NO_NEIGHBOR_CMD2
"description .LINE",
4480 "Neighbor specific description\n"
4481 "Up to 80 characters describing this neighbor\n")
4483 /* Neighbor update-source. */
4485 peer_update_source_vty (struct vty
*vty
, const char *peer_str
,
4486 const char *source_str
)
4490 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
4500 int ret
= str2sockunion (source_str
, &su
);
4503 peer_update_source_addr_set (peer
, &su
);
4505 peer_update_source_if_set (peer
, source_str
);
4508 peer_update_source_unset (peer
);
4513 #define BGP_UPDATE_SOURCE_STR "(A.B.C.D|X:X::X:X|WORD)"
4514 #define BGP_UPDATE_SOURCE_HELP_STR \
4517 "Interface name (requires zebra to be running)\n"
4519 DEFUN (neighbor_update_source
,
4520 neighbor_update_source_cmd
,
4521 NEIGHBOR_CMD2
"update-source " BGP_UPDATE_SOURCE_STR
,
4524 "Source of routing updates\n"
4525 BGP_UPDATE_SOURCE_HELP_STR
)
4527 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
4530 DEFUN (no_neighbor_update_source
,
4531 no_neighbor_update_source_cmd
,
4532 NO_NEIGHBOR_CMD2
"update-source",
4536 "Source of routing updates\n")
4538 return peer_update_source_vty (vty
, argv
[0], NULL
);
4542 peer_default_originate_set_vty (struct vty
*vty
, const char *peer_str
,
4543 afi_t afi
, safi_t safi
,
4544 const char *rmap
, int set
)
4549 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
4554 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
4556 ret
= peer_default_originate_unset (peer
, afi
, safi
);
4558 return bgp_vty_return (vty
, ret
);
4561 /* neighbor default-originate. */
4562 DEFUN (neighbor_default_originate
,
4563 neighbor_default_originate_cmd
,
4564 NEIGHBOR_CMD2
"default-originate",
4567 "Originate default route to this neighbor\n")
4569 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4570 bgp_node_safi (vty
), NULL
, 1);
4573 DEFUN (neighbor_default_originate_rmap
,
4574 neighbor_default_originate_rmap_cmd
,
4575 NEIGHBOR_CMD2
"default-originate route-map WORD",
4578 "Originate default route to this neighbor\n"
4579 "Route-map to specify criteria to originate default\n"
4582 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4583 bgp_node_safi (vty
), argv
[1], 1);
4586 DEFUN (no_neighbor_default_originate
,
4587 no_neighbor_default_originate_cmd
,
4588 NO_NEIGHBOR_CMD2
"default-originate",
4592 "Originate default route to this neighbor\n")
4594 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
4595 bgp_node_safi (vty
), NULL
, 0);
4598 ALIAS (no_neighbor_default_originate
,
4599 no_neighbor_default_originate_rmap_cmd
,
4600 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
4604 "Originate default route to this neighbor\n"
4605 "Route-map to specify criteria to originate default\n"
4608 /* Set neighbor's BGP port. */
4610 peer_port_vty (struct vty
*vty
, const char *ip_str
, int afi
,
4611 const char *port_str
)
4617 peer
= peer_lookup_vty (vty
, ip_str
);
4623 sp
= getservbyname ("bgp", "tcp");
4624 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
4628 VTY_GET_INTEGER("port", port
, port_str
);
4631 peer_port_set (peer
, port
);
4636 /* Set specified peer's BGP port. */
4637 DEFUN (neighbor_port
,
4639 NEIGHBOR_CMD
"port <0-65535>",
4642 "Neighbor's BGP port\n"
4643 "TCP port number\n")
4645 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
4648 DEFUN (no_neighbor_port
,
4649 no_neighbor_port_cmd
,
4650 NO_NEIGHBOR_CMD
"port",
4654 "Neighbor's BGP port\n")
4656 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
4659 ALIAS (no_neighbor_port
,
4660 no_neighbor_port_val_cmd
,
4661 NO_NEIGHBOR_CMD
"port <0-65535>",
4665 "Neighbor's BGP port\n"
4666 "TCP port number\n")
4668 /* neighbor weight. */
4670 peer_weight_set_vty (struct vty
*vty
, const char *ip_str
,
4671 const char *weight_str
)
4674 unsigned long weight
;
4676 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4680 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
4682 peer_weight_set (peer
, weight
);
4688 peer_weight_unset_vty (struct vty
*vty
, const char *ip_str
)
4692 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4696 peer_weight_unset (peer
);
4701 DEFUN (neighbor_weight
,
4702 neighbor_weight_cmd
,
4703 NEIGHBOR_CMD2
"weight <0-65535>",
4706 "Set default weight for routes from this neighbor\n"
4709 return peer_weight_set_vty (vty
, argv
[0], argv
[1]);
4712 DEFUN (no_neighbor_weight
,
4713 no_neighbor_weight_cmd
,
4714 NO_NEIGHBOR_CMD2
"weight",
4718 "Set default weight for routes from this neighbor\n")
4720 return peer_weight_unset_vty (vty
, argv
[0]);
4723 ALIAS (no_neighbor_weight
,
4724 no_neighbor_weight_val_cmd
,
4725 NO_NEIGHBOR_CMD2
"weight <0-65535>",
4729 "Set default weight for routes from this neighbor\n"
4732 /* Override capability negotiation. */
4733 DEFUN (neighbor_override_capability
,
4734 neighbor_override_capability_cmd
,
4735 NEIGHBOR_CMD2
"override-capability",
4738 "Override capability negotiation result\n")
4740 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
4743 DEFUN (no_neighbor_override_capability
,
4744 no_neighbor_override_capability_cmd
,
4745 NO_NEIGHBOR_CMD2
"override-capability",
4749 "Override capability negotiation result\n")
4751 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
4754 DEFUN (neighbor_strict_capability
,
4755 neighbor_strict_capability_cmd
,
4756 NEIGHBOR_CMD
"strict-capability-match",
4759 "Strict capability negotiation match\n")
4761 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
4764 DEFUN (no_neighbor_strict_capability
,
4765 no_neighbor_strict_capability_cmd
,
4766 NO_NEIGHBOR_CMD
"strict-capability-match",
4770 "Strict capability negotiation match\n")
4772 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
4776 peer_timers_set_vty (struct vty
*vty
, const char *ip_str
,
4777 const char *keep_str
, const char *hold_str
)
4781 u_int32_t keepalive
;
4784 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4788 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
4789 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
4791 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
4793 return bgp_vty_return (vty
, ret
);
4797 peer_timers_unset_vty (struct vty
*vty
, const char *ip_str
)
4802 peer
= peer_lookup_vty (vty
, ip_str
);
4806 ret
= peer_timers_unset (peer
);
4808 return bgp_vty_return (vty
, ret
);
4811 DEFUN (neighbor_timers
,
4812 neighbor_timers_cmd
,
4813 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
4816 "BGP per neighbor timers\n"
4817 "Keepalive interval\n"
4820 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
4823 DEFUN (no_neighbor_timers
,
4824 no_neighbor_timers_cmd
,
4825 NO_NEIGHBOR_CMD2
"timers",
4829 "BGP per neighbor timers\n")
4831 return peer_timers_unset_vty (vty
, argv
[0]);
4835 peer_timers_connect_set_vty (struct vty
*vty
, const char *ip_str
,
4836 const char *time_str
)
4842 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4846 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
4848 ret
= peer_timers_connect_set (peer
, connect
);
4850 return bgp_vty_return (vty
, ret
);
4854 peer_timers_connect_unset_vty (struct vty
*vty
, const char *ip_str
)
4859 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4863 ret
= peer_timers_connect_unset (peer
);
4865 return bgp_vty_return (vty
, ret
);
4868 DEFUN (neighbor_timers_connect
,
4869 neighbor_timers_connect_cmd
,
4870 NEIGHBOR_CMD2
"timers connect <0-65535>",
4873 "BGP per neighbor timers\n"
4874 "BGP connect timer\n"
4877 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
4880 DEFUN (no_neighbor_timers_connect
,
4881 no_neighbor_timers_connect_cmd
,
4882 NO_NEIGHBOR_CMD2
"timers connect",
4886 "BGP per neighbor timers\n"
4887 "BGP connect timer\n")
4889 return peer_timers_connect_unset_vty (vty
, argv
[0]);
4892 ALIAS (no_neighbor_timers_connect
,
4893 no_neighbor_timers_connect_val_cmd
,
4894 NO_NEIGHBOR_CMD2
"timers connect <0-65535>",
4898 "BGP per neighbor timers\n"
4899 "BGP connect timer\n"
4903 peer_advertise_interval_vty (struct vty
*vty
, const char *ip_str
,
4904 const char *time_str
, int set
)
4908 u_int32_t routeadv
= 0;
4910 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
4915 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
4918 ret
= peer_advertise_interval_set (peer
, routeadv
);
4920 ret
= peer_advertise_interval_unset (peer
);
4922 return bgp_vty_return (vty
, ret
);
4925 DEFUN (neighbor_advertise_interval
,
4926 neighbor_advertise_interval_cmd
,
4927 NEIGHBOR_CMD2
"advertisement-interval <0-600>",
4930 "Minimum interval between sending BGP routing updates\n"
4931 "time in seconds\n")
4933 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
4936 DEFUN (no_neighbor_advertise_interval
,
4937 no_neighbor_advertise_interval_cmd
,
4938 NO_NEIGHBOR_CMD2
"advertisement-interval",
4942 "Minimum interval between sending BGP routing updates\n")
4944 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
4947 ALIAS (no_neighbor_advertise_interval
,
4948 no_neighbor_advertise_interval_val_cmd
,
4949 NO_NEIGHBOR_CMD2
"advertisement-interval <0-600>",
4953 "Minimum interval between sending BGP routing updates\n"
4954 "time in seconds\n")
4956 /* Time to wait before processing route-map updates */
4957 DEFUN (bgp_set_route_map_delay_timer
,
4958 bgp_set_route_map_delay_timer_cmd
,
4959 "bgp route-map delay-timer <0-600>",
4961 "BGP route-map delay timer\n"
4962 "Time in secs to wait before processing route-map changes\n"
4963 "0 disables the timer, no route updates happen when route-maps change\n")
4965 u_int32_t rmap_delay_timer
;
4971 VTY_GET_INTEGER_RANGE ("delay-timer", rmap_delay_timer
, argv
[0], 0, 600);
4972 bgp
->rmap_update_timer
= rmap_delay_timer
;
4974 /* if the dynamic update handling is being disabled, and a timer is
4975 * running, stop the timer and act as if the timer has already fired.
4977 if (!rmap_delay_timer
&& bgp
->t_rmap_update
)
4979 BGP_TIMER_OFF(bgp
->t_rmap_update
);
4980 thread_execute (bm
->master
, bgp_route_map_update_timer
, &bgp
, 0);
4988 DEFUN (no_bgp_set_route_map_delay_timer
,
4989 no_bgp_set_route_map_delay_timer_cmd
,
4990 "no bgp route-map delay-timer",
4992 "Default BGP route-map delay timer\n"
4993 "Reset to default time to wait for processing route-map changes\n")
4998 bgp
->rmap_update_timer
= RMAP_DEFAULT_UPDATE_TIMER
;
5003 ALIAS (no_bgp_set_route_map_delay_timer
,
5004 no_bgp_set_route_map_delay_timer_val_cmd
,
5005 "no bgp route-map delay-timer <0-600>",
5007 "Default BGP route-map delay timer\n"
5008 "Reset to default time to wait for processing route-map changes\n"
5009 "0 disables the timer, no route updates happen when route-maps change\n")
5011 /* neighbor interface */
5013 peer_interface_vty (struct vty
*vty
, const char *ip_str
, const char *str
)
5017 peer
= peer_lookup_vty (vty
, ip_str
);
5018 if (! peer
|| peer
->conf_if
)
5022 peer_interface_set (peer
, str
);
5024 peer_interface_unset (peer
);
5029 DEFUN (neighbor_interface
,
5030 neighbor_interface_cmd
,
5031 NEIGHBOR_CMD
"interface WORD",
5037 return peer_interface_vty (vty
, argv
[0], argv
[1]);
5040 DEFUN (no_neighbor_interface
,
5041 no_neighbor_interface_cmd
,
5042 NO_NEIGHBOR_CMD
"interface WORD",
5049 return peer_interface_vty (vty
, argv
[0], NULL
);
5052 /* Set distribute list to the peer. */
5054 peer_distribute_set_vty (struct vty
*vty
, const char *ip_str
,
5055 afi_t afi
, safi_t safi
,
5056 const char *name_str
, const char *direct_str
)
5060 int direct
= FILTER_IN
;
5062 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5066 /* Check filter direction. */
5067 if (strncmp (direct_str
, "i", 1) == 0)
5069 else if (strncmp (direct_str
, "o", 1) == 0)
5070 direct
= FILTER_OUT
;
5072 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
5074 return bgp_vty_return (vty
, ret
);
5078 peer_distribute_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5079 safi_t safi
, const char *direct_str
)
5083 int direct
= FILTER_IN
;
5085 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5089 /* Check filter direction. */
5090 if (strncmp (direct_str
, "i", 1) == 0)
5092 else if (strncmp (direct_str
, "o", 1) == 0)
5093 direct
= FILTER_OUT
;
5095 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
5097 return bgp_vty_return (vty
, ret
);
5100 DEFUN (neighbor_distribute_list
,
5101 neighbor_distribute_list_cmd
,
5102 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
5105 "Filter updates to/from this neighbor\n"
5106 "IP access-list number\n"
5107 "IP access-list number (expanded range)\n"
5108 "IP Access-list name\n"
5109 "Filter incoming updates\n"
5110 "Filter outgoing updates\n")
5112 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5113 bgp_node_safi (vty
), argv
[1], argv
[2]);
5116 DEFUN (no_neighbor_distribute_list
,
5117 no_neighbor_distribute_list_cmd
,
5118 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
5122 "Filter updates to/from this neighbor\n"
5123 "IP access-list number\n"
5124 "IP access-list number (expanded range)\n"
5125 "IP Access-list name\n"
5126 "Filter incoming updates\n"
5127 "Filter outgoing updates\n")
5129 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5130 bgp_node_safi (vty
), argv
[2]);
5133 /* Set prefix list to the peer. */
5135 peer_prefix_list_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5136 safi_t safi
, const char *name_str
,
5137 const char *direct_str
)
5141 int direct
= FILTER_IN
;
5143 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5147 /* Check filter direction. */
5148 if (strncmp (direct_str
, "i", 1) == 0)
5150 else if (strncmp (direct_str
, "o", 1) == 0)
5151 direct
= FILTER_OUT
;
5153 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
5155 return bgp_vty_return (vty
, ret
);
5159 peer_prefix_list_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5160 safi_t safi
, const char *direct_str
)
5164 int direct
= FILTER_IN
;
5166 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5170 /* Check filter direction. */
5171 if (strncmp (direct_str
, "i", 1) == 0)
5173 else if (strncmp (direct_str
, "o", 1) == 0)
5174 direct
= FILTER_OUT
;
5176 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
5178 return bgp_vty_return (vty
, ret
);
5181 DEFUN (neighbor_prefix_list
,
5182 neighbor_prefix_list_cmd
,
5183 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
5186 "Filter updates to/from this neighbor\n"
5187 "Name of a prefix list\n"
5188 "Filter incoming updates\n"
5189 "Filter outgoing updates\n")
5191 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5192 bgp_node_safi (vty
), argv
[1], argv
[2]);
5195 DEFUN (no_neighbor_prefix_list
,
5196 no_neighbor_prefix_list_cmd
,
5197 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
5201 "Filter updates to/from this neighbor\n"
5202 "Name of a prefix list\n"
5203 "Filter incoming updates\n"
5204 "Filter outgoing updates\n")
5206 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5207 bgp_node_safi (vty
), argv
[2]);
5211 peer_aslist_set_vty (struct vty
*vty
, const char *ip_str
,
5212 afi_t afi
, safi_t safi
,
5213 const char *name_str
, const char *direct_str
)
5217 int direct
= FILTER_IN
;
5219 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5223 /* Check filter direction. */
5224 if (strncmp (direct_str
, "i", 1) == 0)
5226 else if (strncmp (direct_str
, "o", 1) == 0)
5227 direct
= FILTER_OUT
;
5229 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
5231 return bgp_vty_return (vty
, ret
);
5235 peer_aslist_unset_vty (struct vty
*vty
, const char *ip_str
,
5236 afi_t afi
, safi_t safi
,
5237 const char *direct_str
)
5241 int direct
= FILTER_IN
;
5243 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5247 /* Check filter direction. */
5248 if (strncmp (direct_str
, "i", 1) == 0)
5250 else if (strncmp (direct_str
, "o", 1) == 0)
5251 direct
= FILTER_OUT
;
5253 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
5255 return bgp_vty_return (vty
, ret
);
5258 DEFUN (neighbor_filter_list
,
5259 neighbor_filter_list_cmd
,
5260 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
5263 "Establish BGP filters\n"
5264 "AS path access-list name\n"
5265 "Filter incoming routes\n"
5266 "Filter outgoing routes\n")
5268 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5269 bgp_node_safi (vty
), argv
[1], argv
[2]);
5272 DEFUN (no_neighbor_filter_list
,
5273 no_neighbor_filter_list_cmd
,
5274 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
5278 "Establish BGP filters\n"
5279 "AS path access-list name\n"
5280 "Filter incoming routes\n"
5281 "Filter outgoing routes\n")
5283 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5284 bgp_node_safi (vty
), argv
[2]);
5287 /* Set route-map to the peer. */
5289 peer_route_map_set_vty (struct vty
*vty
, const char *ip_str
,
5290 afi_t afi
, safi_t safi
,
5291 const char *name_str
, const char *direct_str
)
5295 int direct
= RMAP_IN
;
5297 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5301 /* Check filter direction. */
5302 if (strncmp (direct_str
, "in", 2) == 0)
5304 else if (strncmp (direct_str
, "o", 1) == 0)
5306 else if (strncmp (direct_str
, "im", 2) == 0)
5307 direct
= RMAP_IMPORT
;
5308 else if (strncmp (direct_str
, "e", 1) == 0)
5309 direct
= RMAP_EXPORT
;
5311 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
5313 return bgp_vty_return (vty
, ret
);
5317 peer_route_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5318 safi_t safi
, const char *direct_str
)
5322 int direct
= RMAP_IN
;
5324 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5328 /* Check filter direction. */
5329 if (strncmp (direct_str
, "in", 2) == 0)
5331 else if (strncmp (direct_str
, "o", 1) == 0)
5333 else if (strncmp (direct_str
, "im", 2) == 0)
5334 direct
= RMAP_IMPORT
;
5335 else if (strncmp (direct_str
, "e", 1) == 0)
5336 direct
= RMAP_EXPORT
;
5338 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
5340 return bgp_vty_return (vty
, ret
);
5343 DEFUN (neighbor_route_map
,
5344 neighbor_route_map_cmd
,
5345 NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
5348 "Apply route map to neighbor\n"
5349 "Name of route map\n"
5350 "Apply map to incoming routes\n"
5351 "Apply map to outbound routes\n"
5352 "Apply map to routes going into a Route-Server client's table\n"
5353 "Apply map to routes coming from a Route-Server client")
5355 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5356 bgp_node_safi (vty
), argv
[1], argv
[2]);
5359 DEFUN (no_neighbor_route_map
,
5360 no_neighbor_route_map_cmd
,
5361 NO_NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
5365 "Apply route map to neighbor\n"
5366 "Name of route map\n"
5367 "Apply map to incoming routes\n"
5368 "Apply map to outbound routes\n"
5369 "Apply map to routes going into a Route-Server client's table\n"
5370 "Apply map to routes coming from a Route-Server client")
5372 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5373 bgp_node_safi (vty
), argv
[2]);
5376 /* Set unsuppress-map to the peer. */
5378 peer_unsuppress_map_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5379 safi_t safi
, const char *name_str
)
5384 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5388 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
5390 return bgp_vty_return (vty
, ret
);
5393 /* Unset route-map from the peer. */
5395 peer_unsuppress_map_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5401 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5405 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
5407 return bgp_vty_return (vty
, ret
);
5410 DEFUN (neighbor_unsuppress_map
,
5411 neighbor_unsuppress_map_cmd
,
5412 NEIGHBOR_CMD2
"unsuppress-map WORD",
5415 "Route-map to selectively unsuppress suppressed routes\n"
5416 "Name of route map\n")
5418 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5419 bgp_node_safi (vty
), argv
[1]);
5422 DEFUN (no_neighbor_unsuppress_map
,
5423 no_neighbor_unsuppress_map_cmd
,
5424 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
5428 "Route-map to selectively unsuppress suppressed routes\n"
5429 "Name of route map\n")
5431 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5432 bgp_node_safi (vty
));
5436 peer_maximum_prefix_set_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5437 safi_t safi
, const char *num_str
,
5438 const char *threshold_str
, int warning
,
5439 const char *restart_str
)
5447 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5451 VTY_GET_INTEGER ("maximum number", max
, num_str
);
5453 threshold
= atoi (threshold_str
);
5455 threshold
= MAXIMUM_PREFIX_THRESHOLD_DEFAULT
;
5458 restart
= atoi (restart_str
);
5462 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, threshold
, warning
, restart
);
5464 return bgp_vty_return (vty
, ret
);
5468 peer_maximum_prefix_unset_vty (struct vty
*vty
, const char *ip_str
, afi_t afi
,
5474 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
5478 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
5480 return bgp_vty_return (vty
, ret
);
5483 /* Maximum number of prefix configuration. prefix count is different
5484 for each peer configuration. So this configuration can be set for
5485 each peer configuration. */
5486 DEFUN (neighbor_maximum_prefix
,
5487 neighbor_maximum_prefix_cmd
,
5488 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
5491 "Maximum number of prefix accept from this peer\n"
5492 "maximum no. of prefix limit\n")
5494 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5495 bgp_node_safi (vty
), argv
[1], NULL
, 0,
5499 DEFUN (neighbor_maximum_prefix_threshold
,
5500 neighbor_maximum_prefix_threshold_cmd
,
5501 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
5504 "Maximum number of prefix accept from this peer\n"
5505 "maximum no. of prefix limit\n"
5506 "Threshold value (%) at which to generate a warning msg\n")
5508 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5509 bgp_node_safi (vty
), argv
[1], argv
[2], 0,
5513 DEFUN (neighbor_maximum_prefix_warning
,
5514 neighbor_maximum_prefix_warning_cmd
,
5515 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
5518 "Maximum number of prefix accept from this peer\n"
5519 "maximum no. of prefix limit\n"
5520 "Only give warning message when limit is exceeded\n")
5522 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5523 bgp_node_safi (vty
), argv
[1], NULL
, 1,
5527 DEFUN (neighbor_maximum_prefix_threshold_warning
,
5528 neighbor_maximum_prefix_threshold_warning_cmd
,
5529 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
5532 "Maximum number of prefix accept from this peer\n"
5533 "maximum no. of prefix limit\n"
5534 "Threshold value (%) at which to generate a warning msg\n"
5535 "Only give warning message when limit is exceeded\n")
5537 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5538 bgp_node_safi (vty
), argv
[1], argv
[2], 1, NULL
);
5541 DEFUN (neighbor_maximum_prefix_restart
,
5542 neighbor_maximum_prefix_restart_cmd
,
5543 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
5546 "Maximum number of prefix accept from this peer\n"
5547 "maximum no. of prefix limit\n"
5548 "Restart bgp connection after limit is exceeded\n"
5549 "Restart interval in minutes")
5551 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5552 bgp_node_safi (vty
), argv
[1], NULL
, 0, argv
[2]);
5555 DEFUN (neighbor_maximum_prefix_threshold_restart
,
5556 neighbor_maximum_prefix_threshold_restart_cmd
,
5557 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
5560 "Maximum number of prefix accept from this peer\n"
5561 "maximum no. of prefix limit\n"
5562 "Threshold value (%) at which to generate a warning msg\n"
5563 "Restart bgp connection after limit is exceeded\n"
5564 "Restart interval in minutes")
5566 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
5567 bgp_node_safi (vty
), argv
[1], argv
[2], 0, argv
[3]);
5570 DEFUN (no_neighbor_maximum_prefix
,
5571 no_neighbor_maximum_prefix_cmd
,
5572 NO_NEIGHBOR_CMD2
"maximum-prefix",
5576 "Maximum number of prefix accept from this peer\n")
5578 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
5579 bgp_node_safi (vty
));
5582 ALIAS (no_neighbor_maximum_prefix
,
5583 no_neighbor_maximum_prefix_val_cmd
,
5584 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
5588 "Maximum number of prefix accept from this peer\n"
5589 "maximum no. of prefix limit\n")
5591 ALIAS (no_neighbor_maximum_prefix
,
5592 no_neighbor_maximum_prefix_threshold_cmd
,
5593 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
5597 "Maximum number of prefix accept from this peer\n"
5598 "maximum no. of prefix limit\n"
5599 "Threshold value (%) at which to generate a warning msg\n")
5601 ALIAS (no_neighbor_maximum_prefix
,
5602 no_neighbor_maximum_prefix_warning_cmd
,
5603 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
5607 "Maximum number of prefix accept from this peer\n"
5608 "maximum no. of prefix limit\n"
5609 "Only give warning message when limit is exceeded\n")
5611 ALIAS (no_neighbor_maximum_prefix
,
5612 no_neighbor_maximum_prefix_threshold_warning_cmd
,
5613 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
5617 "Maximum number of prefix accept from this peer\n"
5618 "maximum no. of prefix limit\n"
5619 "Threshold value (%) at which to generate a warning msg\n"
5620 "Only give warning message when limit is exceeded\n")
5622 ALIAS (no_neighbor_maximum_prefix
,
5623 no_neighbor_maximum_prefix_restart_cmd
,
5624 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> restart <1-65535>",
5628 "Maximum number of prefix accept from this peer\n"
5629 "maximum no. of prefix limit\n"
5630 "Restart bgp connection after limit is exceeded\n"
5631 "Restart interval in minutes")
5633 ALIAS (no_neighbor_maximum_prefix
,
5634 no_neighbor_maximum_prefix_threshold_restart_cmd
,
5635 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
5639 "Maximum number of prefix accept from this peer\n"
5640 "maximum no. of prefix limit\n"
5641 "Threshold value (%) at which to generate a warning msg\n"
5642 "Restart bgp connection after limit is exceeded\n"
5643 "Restart interval in minutes")
5645 /* "neighbor allowas-in" */
5646 DEFUN (neighbor_allowas_in
,
5647 neighbor_allowas_in_cmd
,
5648 NEIGHBOR_CMD2
"allowas-in",
5651 "Accept as-path with my AS present in it\n")
5655 unsigned int allow_num
;
5657 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5664 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
5666 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
5669 return bgp_vty_return (vty
, ret
);
5672 ALIAS (neighbor_allowas_in
,
5673 neighbor_allowas_in_arg_cmd
,
5674 NEIGHBOR_CMD2
"allowas-in <1-10>",
5677 "Accept as-path with my AS present in it\n"
5678 "Number of occurances of AS number\n")
5680 DEFUN (no_neighbor_allowas_in
,
5681 no_neighbor_allowas_in_cmd
,
5682 NO_NEIGHBOR_CMD2
"allowas-in",
5686 "allow local ASN appears in aspath attribute\n")
5691 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5695 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
5697 return bgp_vty_return (vty
, ret
);
5700 DEFUN (neighbor_ttl_security
,
5701 neighbor_ttl_security_cmd
,
5702 NEIGHBOR_CMD2
"ttl-security hops <1-254>",
5705 "Specify the maximum number of hops to the BGP peer\n")
5710 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5714 VTY_GET_INTEGER_RANGE ("", gtsm_hops
, argv
[1], 1, 254);
5716 return bgp_vty_return (vty
, peer_ttl_security_hops_set (peer
, gtsm_hops
));
5719 DEFUN (no_neighbor_ttl_security
,
5720 no_neighbor_ttl_security_cmd
,
5721 NO_NEIGHBOR_CMD2
"ttl-security hops <1-254>",
5725 "Specify the maximum number of hops to the BGP peer\n")
5729 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
5733 return bgp_vty_return (vty
, peer_ttl_security_hops_unset (peer
));
5736 /* Address family configuration. */
5737 DEFUN (address_family_ipv4
,
5738 address_family_ipv4_cmd
,
5739 "address-family ipv4",
5740 "Enter Address Family command mode\n"
5743 vty
->node
= BGP_IPV4_NODE
;
5747 DEFUN (address_family_ipv4_safi
,
5748 address_family_ipv4_safi_cmd
,
5749 "address-family ipv4 (unicast|multicast)",
5750 "Enter Address Family command mode\n"
5752 "Address Family modifier\n"
5753 "Address Family modifier\n")
5755 if (strncmp (argv
[0], "m", 1) == 0)
5756 vty
->node
= BGP_IPV4M_NODE
;
5758 vty
->node
= BGP_IPV4_NODE
;
5763 DEFUN (address_family_ipv6
,
5764 address_family_ipv6_cmd
,
5765 "address-family ipv6",
5766 "Enter Address Family command mode\n"
5769 vty
->node
= BGP_IPV6_NODE
;
5773 DEFUN (address_family_ipv6_safi
,
5774 address_family_ipv6_safi_cmd
,
5775 "address-family ipv6 (unicast|multicast)",
5776 "Enter Address Family command mode\n"
5778 "Address Family modifier\n"
5779 "Address Family modifier\n")
5781 if (strncmp (argv
[0], "m", 1) == 0)
5782 vty
->node
= BGP_IPV6M_NODE
;
5784 vty
->node
= BGP_IPV6_NODE
;
5789 DEFUN (address_family_vpnv4
,
5790 address_family_vpnv4_cmd
,
5791 "address-family vpnv4",
5792 "Enter Address Family command mode\n"
5795 vty
->node
= BGP_VPNV4_NODE
;
5799 ALIAS (address_family_vpnv4
,
5800 address_family_vpnv4_unicast_cmd
,
5801 "address-family vpnv4 unicast",
5802 "Enter Address Family command mode\n"
5804 "Address Family Modifier\n")
5806 DEFUN (exit_address_family
,
5807 exit_address_family_cmd
,
5808 "exit-address-family",
5809 "Exit from Address Family configuration mode\n")
5811 if (vty
->node
== BGP_IPV4_NODE
5812 || vty
->node
== BGP_IPV4M_NODE
5813 || vty
->node
== BGP_VPNV4_NODE
5814 || vty
->node
== BGP_IPV6_NODE
5815 || vty
->node
== BGP_IPV6M_NODE
)
5816 vty
->node
= BGP_NODE
;
5820 /* Recalculate bestpath and re-advertise a prefix */
5822 bgp_clear_prefix (struct vty
*vty
, char *view_name
, const char *ip_str
,
5823 afi_t afi
, safi_t safi
, struct prefix_rd
*prd
)
5826 struct prefix match
;
5827 struct bgp_node
*rn
;
5828 struct bgp_node
*rm
;
5830 struct bgp_table
*table
;
5831 struct bgp_table
*rib
;
5833 /* BGP structure lookup. */
5836 bgp
= bgp_lookup_by_name (view_name
);
5839 vty_out (vty
, "%% Can't find BGP view %s%s", view_name
, VTY_NEWLINE
);
5845 bgp
= bgp_get_default ();
5848 vty_out (vty
, "%% No BGP process is configured%s", VTY_NEWLINE
);
5853 /* Check IP address argument. */
5854 ret
= str2prefix (ip_str
, &match
);
5857 vty_out (vty
, "%% address is malformed%s", VTY_NEWLINE
);
5861 match
.family
= afi2family (afi
);
5862 rib
= bgp
->rib
[afi
][safi
];
5864 if (safi
== SAFI_MPLS_VPN
)
5866 for (rn
= bgp_table_top (rib
); rn
; rn
= bgp_route_next (rn
))
5868 if (prd
&& memcmp (rn
->p
.u
.val
, prd
->val
, 8) != 0)
5871 if ((table
= rn
->info
) != NULL
)
5873 if ((rm
= bgp_node_match (table
, &match
)) != NULL
)
5875 if (rm
->p
.prefixlen
== match
.prefixlen
)
5877 SET_FLAG (rn
->flags
, BGP_NODE_USER_CLEAR
);
5878 bgp_process (bgp
, rm
, afi
, safi
);
5880 bgp_unlock_node (rm
);
5887 if ((rn
= bgp_node_match (rib
, &match
)) != NULL
)
5889 if (rn
->p
.prefixlen
== match
.prefixlen
)
5891 SET_FLAG (rn
->flags
, BGP_NODE_USER_CLEAR
);
5892 bgp_process (bgp
, rn
, afi
, safi
);
5894 bgp_unlock_node (rn
);
5901 DEFUN (clear_ip_bgp_all
,
5902 clear_ip_bgp_all_cmd
,
5907 "Clear all peers\n")
5910 return bgp_clear_vty (vty
, argv
[0], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
5912 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
5915 ALIAS (clear_ip_bgp_all
,
5920 "Clear all peers\n")
5922 ALIAS (clear_ip_bgp_all
,
5923 clear_bgp_ipv6_all_cmd
,
5928 "Clear all peers\n")
5930 ALIAS (clear_ip_bgp_all
,
5931 clear_ip_bgp_instance_all_cmd
,
5932 "clear ip bgp view WORD *",
5938 "Clear all peers\n")
5940 ALIAS (clear_ip_bgp_all
,
5941 clear_bgp_instance_all_cmd
,
5942 "clear bgp view WORD *",
5947 "Clear all peers\n")
5949 DEFUN (clear_ip_bgp_peer
,
5950 clear_ip_bgp_peer_cmd
,
5951 "clear ip bgp (A.B.C.D|X:X::X:X|WORD)",
5955 "BGP neighbor IP address to clear\n"
5956 "BGP IPv6 neighbor to clear\n"
5957 "BGP neighbor on interface to clear\n")
5959 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
5962 ALIAS (clear_ip_bgp_peer
,
5964 "clear bgp (A.B.C.D|X:X::X:X|WORD)",
5967 "BGP neighbor address to clear\n"
5968 "BGP IPv6 neighbor to clear\n"
5969 "BGP neighbor on interface to clear\n")
5971 ALIAS (clear_ip_bgp_peer
,
5972 clear_bgp_ipv6_peer_cmd
,
5973 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD)",
5977 "BGP neighbor address to clear\n"
5978 "BGP IPv6 neighbor to clear\n"
5979 "BGP neighbor on interface to clear\n")
5981 DEFUN (clear_ip_bgp_peer_group
,
5982 clear_ip_bgp_peer_group_cmd
,
5983 "clear ip bgp peer-group WORD",
5987 "Clear all members of peer-group\n"
5988 "BGP peer-group name\n")
5990 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
5993 ALIAS (clear_ip_bgp_peer_group
,
5994 clear_bgp_peer_group_cmd
,
5995 "clear bgp peer-group WORD",
5998 "Clear all members of peer-group\n"
5999 "BGP peer-group name\n")
6001 ALIAS (clear_ip_bgp_peer_group
,
6002 clear_bgp_ipv6_peer_group_cmd
,
6003 "clear bgp ipv6 peer-group WORD",
6007 "Clear all members of peer-group\n"
6008 "BGP peer-group name\n")
6010 DEFUN (clear_ip_bgp_external
,
6011 clear_ip_bgp_external_cmd
,
6012 "clear ip bgp external",
6016 "Clear all external peers\n")
6018 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
6021 ALIAS (clear_ip_bgp_external
,
6022 clear_bgp_external_cmd
,
6023 "clear bgp external",
6026 "Clear all external peers\n")
6028 ALIAS (clear_ip_bgp_external
,
6029 clear_bgp_ipv6_external_cmd
,
6030 "clear bgp ipv6 external",
6034 "Clear all external peers\n")
6036 DEFUN (clear_ip_bgp_prefix
,
6037 clear_ip_bgp_prefix_cmd
,
6038 "clear ip bgp prefix A.B.C.D/M",
6042 "Clear bestpath and re-advertise\n"
6043 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
6045 return bgp_clear_prefix (vty
, NULL
, argv
[0], AFI_IP
, SAFI_UNICAST
, NULL
);
6048 ALIAS (clear_ip_bgp_prefix
,
6049 clear_bgp_prefix_cmd
,
6050 "clear bgp prefix A.B.C.D/M",
6053 "Clear bestpath and re-advertise\n"
6054 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
6057 DEFUN (clear_ip_bgp_as
,
6058 clear_ip_bgp_as_cmd
,
6059 "clear ip bgp " CMD_AS_RANGE
,
6063 "Clear peers with the AS number\n")
6065 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
6068 ALIAS (clear_ip_bgp_as
,
6070 "clear bgp " CMD_AS_RANGE
,
6073 "Clear peers with the AS number\n")
6075 ALIAS (clear_ip_bgp_as
,
6076 clear_bgp_ipv6_as_cmd
,
6077 "clear bgp ipv6 " CMD_AS_RANGE
,
6081 "Clear peers with the AS number\n")
6083 /* Outbound soft-reconfiguration */
6084 DEFUN (clear_ip_bgp_all_soft_out
,
6085 clear_ip_bgp_all_soft_out_cmd
,
6086 "clear ip bgp * soft out",
6095 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6096 BGP_CLEAR_SOFT_OUT
, NULL
);
6098 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6099 BGP_CLEAR_SOFT_OUT
, NULL
);
6102 ALIAS (clear_ip_bgp_all_soft_out
,
6103 clear_ip_bgp_all_out_cmd
,
6104 "clear ip bgp * out",
6111 ALIAS (clear_ip_bgp_all_soft_out
,
6112 clear_ip_bgp_instance_all_soft_out_cmd
,
6113 "clear ip bgp view WORD * soft out",
6123 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
6124 clear_ip_bgp_all_ipv4_soft_out_cmd
,
6125 "clear ip bgp * ipv4 (unicast|multicast) soft out",
6131 "Address Family modifier\n"
6132 "Address Family modifier\n"
6136 if (strncmp (argv
[0], "m", 1) == 0)
6137 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6138 BGP_CLEAR_SOFT_OUT
, NULL
);
6140 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6141 BGP_CLEAR_SOFT_OUT
, NULL
);
6144 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
6145 clear_ip_bgp_all_ipv4_out_cmd
,
6146 "clear ip bgp * ipv4 (unicast|multicast) out",
6152 "Address Family modifier\n"
6153 "Address Family modifier\n"
6156 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
6157 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
6158 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out",
6166 "Address Family modifier\n"
6167 "Address Family modifier\n"
6170 if (strncmp (argv
[1], "m", 1) == 0)
6171 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
6172 BGP_CLEAR_SOFT_OUT
, NULL
);
6174 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6175 BGP_CLEAR_SOFT_OUT
, NULL
);
6178 DEFUN (clear_ip_bgp_all_vpnv4_soft_out
,
6179 clear_ip_bgp_all_vpnv4_soft_out_cmd
,
6180 "clear ip bgp * vpnv4 unicast soft out",
6186 "Address Family Modifier\n"
6190 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
6191 BGP_CLEAR_SOFT_OUT
, NULL
);
6194 ALIAS (clear_ip_bgp_all_vpnv4_soft_out
,
6195 clear_ip_bgp_all_vpnv4_out_cmd
,
6196 "clear ip bgp * vpnv4 unicast out",
6202 "Address Family Modifier\n"
6205 DEFUN (clear_bgp_all_soft_out
,
6206 clear_bgp_all_soft_out_cmd
,
6207 "clear bgp * soft out",
6215 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6216 BGP_CLEAR_SOFT_OUT
, NULL
);
6218 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6219 BGP_CLEAR_SOFT_OUT
, NULL
);
6222 ALIAS (clear_bgp_all_soft_out
,
6223 clear_bgp_instance_all_soft_out_cmd
,
6224 "clear bgp view WORD * soft out",
6233 ALIAS (clear_bgp_all_soft_out
,
6234 clear_bgp_all_out_cmd
,
6241 ALIAS (clear_bgp_all_soft_out
,
6242 clear_bgp_ipv6_all_soft_out_cmd
,
6243 "clear bgp ipv6 * soft out",
6251 ALIAS (clear_bgp_all_soft_out
,
6252 clear_bgp_ipv6_all_out_cmd
,
6253 "clear bgp ipv6 * out",
6260 DEFUN (clear_bgp_ipv6_safi_prefix
,
6261 clear_bgp_ipv6_safi_prefix_cmd
,
6262 "clear bgp ipv6 (unicast|multicast) prefix X:X::X:X/M",
6266 "Address Family Modifier\n"
6267 "Clear bestpath and re-advertise\n"
6268 "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
6270 if (strncmp (argv
[0], "m", 1) == 0)
6271 return bgp_clear_prefix (vty
, NULL
, argv
[1], AFI_IP6
, SAFI_MULTICAST
, NULL
);
6273 return bgp_clear_prefix (vty
, NULL
, argv
[1], AFI_IP6
, SAFI_UNICAST
, NULL
);
6276 DEFUN (clear_ip_bgp_peer_soft_out
,
6277 clear_ip_bgp_peer_soft_out_cmd
,
6278 "clear ip bgp (A.B.C.D|WORD) soft out",
6282 "BGP neighbor address to clear\n"
6283 "BGP neighbor on interface to clear\n"
6287 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6288 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6291 ALIAS (clear_ip_bgp_peer_soft_out
,
6292 clear_ip_bgp_peer_out_cmd
,
6293 "clear ip bgp (A.B.C.D|WORD) out",
6297 "BGP neighbor address to clear\n"
6298 "BGP neighbor on interface to clear\n"
6301 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
6302 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
6303 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) soft out",
6307 "BGP neighbor address to clear\n"
6308 "BGP neighbor on interface to clear\n"
6310 "Address Family modifier\n"
6311 "Address Family modifier\n"
6315 if (strncmp (argv
[1], "m", 1) == 0)
6316 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
6317 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6319 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6320 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6323 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
6324 clear_ip_bgp_peer_ipv4_out_cmd
,
6325 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) out",
6329 "BGP neighbor address to clear\n"
6330 "BGP neighbor on interface to clear\n"
6332 "Address Family modifier\n"
6333 "Address Family modifier\n"
6336 /* NOTE: WORD peers have not been tested for vpnv4 */
6337 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out
,
6338 clear_ip_bgp_peer_vpnv4_soft_out_cmd
,
6339 "clear ip bgp (A.B.C.D|WORD) vpnv4 unicast soft out",
6343 "BGP neighbor address to clear\n"
6344 "BGP neighbor on interface to clear\n"
6346 "Address Family Modifier\n"
6350 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
6351 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6354 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out
,
6355 clear_ip_bgp_peer_vpnv4_out_cmd
,
6356 "clear ip bgp (A.B.C.D|WORD) vpnv4 unicast out",
6360 "BGP neighbor address to clear\n"
6361 "BGP neighbor on interface to clear\n"
6363 "Address Family Modifier\n"
6366 DEFUN (clear_bgp_peer_soft_out
,
6367 clear_bgp_peer_soft_out_cmd
,
6368 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft out",
6371 "BGP neighbor address to clear\n"
6372 "BGP IPv6 neighbor to clear\n"
6373 "BGP neighbor on interface to clear\n"
6377 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6378 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6381 ALIAS (clear_bgp_peer_soft_out
,
6382 clear_bgp_ipv6_peer_soft_out_cmd
,
6383 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft out",
6387 "BGP neighbor address to clear\n"
6388 "BGP IPv6 neighbor to clear\n"
6389 "BGP neighbor on interface to clear\n"
6393 ALIAS (clear_bgp_peer_soft_out
,
6394 clear_bgp_peer_out_cmd
,
6395 "clear bgp (A.B.C.D|X:X::X:X|WORD) out",
6398 "BGP neighbor address to clear\n"
6399 "BGP IPv6 neighbor to clear\n"
6400 "BGP neighbor on interface to clear\n"
6403 ALIAS (clear_bgp_peer_soft_out
,
6404 clear_bgp_ipv6_peer_out_cmd
,
6405 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) out",
6409 "BGP neighbor address to clear\n"
6410 "BGP IPv6 neighbor to clear\n"
6411 "BGP neighbor on interface to clear\n"
6414 DEFUN (clear_ip_bgp_peer_group_soft_out
,
6415 clear_ip_bgp_peer_group_soft_out_cmd
,
6416 "clear ip bgp peer-group WORD soft out",
6420 "Clear all members of peer-group\n"
6421 "BGP peer-group name\n"
6425 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6426 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6429 ALIAS (clear_ip_bgp_peer_group_soft_out
,
6430 clear_ip_bgp_peer_group_out_cmd
,
6431 "clear ip bgp peer-group WORD out",
6435 "Clear all members of peer-group\n"
6436 "BGP peer-group name\n"
6439 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
6440 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
6441 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
6445 "Clear all members of peer-group\n"
6446 "BGP peer-group name\n"
6448 "Address Family modifier\n"
6449 "Address Family modifier\n"
6453 if (strncmp (argv
[1], "m", 1) == 0)
6454 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
6455 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6457 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6458 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6461 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
6462 clear_ip_bgp_peer_group_ipv4_out_cmd
,
6463 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
6467 "Clear all members of peer-group\n"
6468 "BGP peer-group name\n"
6470 "Address Family modifier\n"
6471 "Address Family modifier\n"
6474 DEFUN (clear_bgp_peer_group_soft_out
,
6475 clear_bgp_peer_group_soft_out_cmd
,
6476 "clear bgp peer-group WORD soft out",
6479 "Clear all members of peer-group\n"
6480 "BGP peer-group name\n"
6484 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
6485 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6488 ALIAS (clear_bgp_peer_group_soft_out
,
6489 clear_bgp_ipv6_peer_group_soft_out_cmd
,
6490 "clear bgp ipv6 peer-group WORD soft out",
6494 "Clear all members of peer-group\n"
6495 "BGP peer-group name\n"
6499 ALIAS (clear_bgp_peer_group_soft_out
,
6500 clear_bgp_peer_group_out_cmd
,
6501 "clear bgp peer-group WORD out",
6504 "Clear all members of peer-group\n"
6505 "BGP peer-group name\n"
6508 ALIAS (clear_bgp_peer_group_soft_out
,
6509 clear_bgp_ipv6_peer_group_out_cmd
,
6510 "clear bgp ipv6 peer-group WORD out",
6514 "Clear all members of peer-group\n"
6515 "BGP peer-group name\n"
6518 DEFUN (clear_ip_bgp_external_soft_out
,
6519 clear_ip_bgp_external_soft_out_cmd
,
6520 "clear ip bgp external soft out",
6524 "Clear all external peers\n"
6528 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6529 BGP_CLEAR_SOFT_OUT
, NULL
);
6532 ALIAS (clear_ip_bgp_external_soft_out
,
6533 clear_ip_bgp_external_out_cmd
,
6534 "clear ip bgp external out",
6538 "Clear all external peers\n"
6541 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
6542 clear_ip_bgp_external_ipv4_soft_out_cmd
,
6543 "clear ip bgp external ipv4 (unicast|multicast) soft out",
6547 "Clear all external peers\n"
6549 "Address Family modifier\n"
6550 "Address Family modifier\n"
6554 if (strncmp (argv
[0], "m", 1) == 0)
6555 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
6556 BGP_CLEAR_SOFT_OUT
, NULL
);
6558 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6559 BGP_CLEAR_SOFT_OUT
, NULL
);
6562 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
6563 clear_ip_bgp_external_ipv4_out_cmd
,
6564 "clear ip bgp external ipv4 (unicast|multicast) out",
6568 "Clear all external peers\n"
6570 "Address Family modifier\n"
6571 "Address Family modifier\n"
6574 DEFUN (clear_bgp_external_soft_out
,
6575 clear_bgp_external_soft_out_cmd
,
6576 "clear bgp external soft out",
6579 "Clear all external peers\n"
6583 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6584 BGP_CLEAR_SOFT_OUT
, NULL
);
6587 ALIAS (clear_bgp_external_soft_out
,
6588 clear_bgp_ipv6_external_soft_out_cmd
,
6589 "clear bgp ipv6 external soft out",
6593 "Clear all external peers\n"
6597 ALIAS (clear_bgp_external_soft_out
,
6598 clear_bgp_external_out_cmd
,
6599 "clear bgp external out",
6602 "Clear all external peers\n"
6605 ALIAS (clear_bgp_external_soft_out
,
6606 clear_bgp_ipv6_external_out_cmd
,
6607 "clear bgp ipv6 external WORD out",
6611 "Clear all external peers\n"
6614 DEFUN (clear_ip_bgp_as_soft_out
,
6615 clear_ip_bgp_as_soft_out_cmd
,
6616 "clear ip bgp " CMD_AS_RANGE
" soft out",
6620 "Clear peers with the AS number\n"
6624 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6625 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6628 ALIAS (clear_ip_bgp_as_soft_out
,
6629 clear_ip_bgp_as_out_cmd
,
6630 "clear ip bgp " CMD_AS_RANGE
" out",
6634 "Clear peers with the AS number\n"
6637 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
6638 clear_ip_bgp_as_ipv4_soft_out_cmd
,
6639 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft out",
6643 "Clear peers with the AS number\n"
6645 "Address Family modifier\n"
6646 "Address Family modifier\n"
6650 if (strncmp (argv
[1], "m", 1) == 0)
6651 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
6652 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6654 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6655 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6658 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
6659 clear_ip_bgp_as_ipv4_out_cmd
,
6660 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) out",
6664 "Clear peers with the AS number\n"
6666 "Address Family modifier\n"
6667 "Address Family modifier\n"
6670 DEFUN (clear_ip_bgp_as_vpnv4_soft_out
,
6671 clear_ip_bgp_as_vpnv4_soft_out_cmd
,
6672 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft out",
6676 "Clear peers with the AS number\n"
6678 "Address Family modifier\n"
6682 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
6683 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6686 ALIAS (clear_ip_bgp_as_vpnv4_soft_out
,
6687 clear_ip_bgp_as_vpnv4_out_cmd
,
6688 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast out",
6692 "Clear peers with the AS number\n"
6694 "Address Family modifier\n"
6697 DEFUN (clear_bgp_as_soft_out
,
6698 clear_bgp_as_soft_out_cmd
,
6699 "clear bgp " CMD_AS_RANGE
" soft out",
6702 "Clear peers with the AS number\n"
6706 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
6707 BGP_CLEAR_SOFT_OUT
, argv
[0]);
6710 ALIAS (clear_bgp_as_soft_out
,
6711 clear_bgp_ipv6_as_soft_out_cmd
,
6712 "clear bgp ipv6 " CMD_AS_RANGE
" soft out",
6716 "Clear peers with the AS number\n"
6720 ALIAS (clear_bgp_as_soft_out
,
6721 clear_bgp_as_out_cmd
,
6722 "clear bgp " CMD_AS_RANGE
" out",
6725 "Clear peers with the AS number\n"
6728 ALIAS (clear_bgp_as_soft_out
,
6729 clear_bgp_ipv6_as_out_cmd
,
6730 "clear bgp ipv6 " CMD_AS_RANGE
" out",
6734 "Clear peers with the AS number\n"
6737 /* Inbound soft-reconfiguration */
6738 DEFUN (clear_ip_bgp_all_soft_in
,
6739 clear_ip_bgp_all_soft_in_cmd
,
6740 "clear ip bgp * soft in",
6749 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6750 BGP_CLEAR_SOFT_IN
, NULL
);
6752 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6753 BGP_CLEAR_SOFT_IN
, NULL
);
6756 ALIAS (clear_ip_bgp_all_soft_in
,
6757 clear_ip_bgp_instance_all_soft_in_cmd
,
6758 "clear ip bgp view WORD * soft in",
6768 ALIAS (clear_ip_bgp_all_soft_in
,
6769 clear_ip_bgp_all_in_cmd
,
6770 "clear ip bgp * in",
6777 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
6778 clear_ip_bgp_all_in_prefix_filter_cmd
,
6779 "clear ip bgp * in prefix-filter",
6785 "Push out prefix-list ORF and do inbound soft reconfig\n")
6788 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6789 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6791 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6792 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6795 ALIAS (clear_ip_bgp_all_in_prefix_filter
,
6796 clear_ip_bgp_instance_all_in_prefix_filter_cmd
,
6797 "clear ip bgp view WORD * in prefix-filter",
6805 "Push out prefix-list ORF and do inbound soft reconfig\n")
6808 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
6809 clear_ip_bgp_all_ipv4_soft_in_cmd
,
6810 "clear ip bgp * ipv4 (unicast|multicast) soft in",
6816 "Address Family modifier\n"
6817 "Address Family modifier\n"
6821 if (strncmp (argv
[0], "m", 1) == 0)
6822 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6823 BGP_CLEAR_SOFT_IN
, NULL
);
6825 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6826 BGP_CLEAR_SOFT_IN
, NULL
);
6829 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
6830 clear_ip_bgp_all_ipv4_in_cmd
,
6831 "clear ip bgp * ipv4 (unicast|multicast) in",
6837 "Address Family modifier\n"
6838 "Address Family modifier\n"
6841 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
6842 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
6843 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in",
6851 "Address Family modifier\n"
6852 "Address Family modifier\n"
6856 if (strncmp (argv
[1], "m", 1) == 0)
6857 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
6858 BGP_CLEAR_SOFT_IN
, NULL
);
6860 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6861 BGP_CLEAR_SOFT_IN
, NULL
);
6864 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
6865 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
6866 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
6872 "Address Family modifier\n"
6873 "Address Family modifier\n"
6875 "Push out prefix-list ORF and do inbound soft reconfig\n")
6877 if (strncmp (argv
[0], "m", 1) == 0)
6878 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
6879 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6881 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6882 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6885 DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter
,
6886 clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
,
6887 "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter",
6893 "Address Family modifier\n"
6894 "Address Family modifier\n"
6896 "Push out prefix-list ORF and do inbound soft reconfig\n")
6898 if (strncmp (argv
[1], "m", 1) == 0)
6899 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
6900 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6902 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6903 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
6906 DEFUN (clear_ip_bgp_all_vpnv4_soft_in
,
6907 clear_ip_bgp_all_vpnv4_soft_in_cmd
,
6908 "clear ip bgp * vpnv4 unicast soft in",
6914 "Address Family Modifier\n"
6918 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
6919 BGP_CLEAR_SOFT_IN
, NULL
);
6922 ALIAS (clear_ip_bgp_all_vpnv4_soft_in
,
6923 clear_ip_bgp_all_vpnv4_in_cmd
,
6924 "clear ip bgp * vpnv4 unicast in",
6930 "Address Family Modifier\n"
6933 DEFUN (clear_bgp_all_soft_in
,
6934 clear_bgp_all_soft_in_cmd
,
6935 "clear bgp * soft in",
6943 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6944 BGP_CLEAR_SOFT_IN
, NULL
);
6946 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6947 BGP_CLEAR_SOFT_IN
, NULL
);
6950 ALIAS (clear_bgp_all_soft_in
,
6951 clear_bgp_instance_all_soft_in_cmd
,
6952 "clear bgp view WORD * soft in",
6961 ALIAS (clear_bgp_all_soft_in
,
6962 clear_bgp_ipv6_all_soft_in_cmd
,
6963 "clear bgp ipv6 * soft in",
6971 ALIAS (clear_bgp_all_soft_in
,
6972 clear_bgp_all_in_cmd
,
6979 ALIAS (clear_bgp_all_soft_in
,
6980 clear_bgp_ipv6_all_in_cmd
,
6981 "clear bgp ipv6 * in",
6988 DEFUN (clear_bgp_all_in_prefix_filter
,
6989 clear_bgp_all_in_prefix_filter_cmd
,
6990 "clear bgp * in prefix-filter",
6995 "Push out prefix-list ORF and do inbound soft reconfig\n")
6997 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6998 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7001 ALIAS (clear_bgp_all_in_prefix_filter
,
7002 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
7003 "clear bgp ipv6 * in prefix-filter",
7009 "Push out prefix-list ORF and do inbound soft reconfig\n")
7011 DEFUN (clear_ip_bgp_peer_soft_in
,
7012 clear_ip_bgp_peer_soft_in_cmd
,
7013 "clear ip bgp (A.B.C.D|WORD) soft in",
7017 "BGP neighbor address to clear\n"
7018 "BGP neighbor on interface to clear\n"
7022 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7023 BGP_CLEAR_SOFT_IN
, argv
[0]);
7026 ALIAS (clear_ip_bgp_peer_soft_in
,
7027 clear_ip_bgp_peer_in_cmd
,
7028 "clear ip bgp (A.B.C.D|WORD) in",
7032 "BGP neighbor address to clear\n"
7033 "BGP neighbor on interface to clear\n"
7036 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
7037 clear_ip_bgp_peer_in_prefix_filter_cmd
,
7038 "clear ip bgp (A.B.C.D|WORD) in prefix-filter",
7042 "BGP neighbor address to clear\n"
7043 "BGP neighbor on interface to clear\n"
7045 "Push out the existing ORF prefix-list\n")
7047 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7048 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7051 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
7052 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
7053 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) soft in",
7057 "BGP neighbor address to clear\n"
7058 "BGP neighbor on interface to clear\n"
7060 "Address Family modifier\n"
7061 "Address Family modifier\n"
7065 if (strncmp (argv
[1], "m", 1) == 0)
7066 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
7067 BGP_CLEAR_SOFT_IN
, argv
[0]);
7069 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7070 BGP_CLEAR_SOFT_IN
, argv
[0]);
7073 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
7074 clear_ip_bgp_peer_ipv4_in_cmd
,
7075 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) in",
7079 "BGP neighbor address to clear\n"
7080 "BGP neighbor on interface to clear\n"
7082 "Address Family modifier\n"
7083 "Address Family modifier\n"
7086 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
7087 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
7088 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) in prefix-filter",
7092 "BGP neighbor address to clear\n"
7093 "BGP neighbor on interface to clear\n"
7095 "Address Family modifier\n"
7096 "Address Family modifier\n"
7098 "Push out the existing ORF prefix-list\n")
7100 if (strncmp (argv
[1], "m", 1) == 0)
7101 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
7102 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7104 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7105 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7108 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in
,
7109 clear_ip_bgp_peer_vpnv4_soft_in_cmd
,
7110 "clear ip bgp (A.B.C.D|WORD) vpnv4 unicast soft in",
7114 "BGP neighbor address to clear\n"
7115 "BGP neighbor on interface to clear\n"
7117 "Address Family Modifier\n"
7121 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
7122 BGP_CLEAR_SOFT_IN
, argv
[0]);
7125 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in
,
7126 clear_ip_bgp_peer_vpnv4_in_cmd
,
7127 "clear ip bgp (A.B.C.D|WORD) vpnv4 unicast in",
7131 "BGP neighbor address to clear\n"
7132 "BGP neighbor on interface to clear\n"
7134 "Address Family Modifier\n"
7137 DEFUN (clear_bgp_peer_soft_in
,
7138 clear_bgp_peer_soft_in_cmd
,
7139 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft in",
7142 "BGP neighbor address to clear\n"
7143 "BGP IPv6 neighbor to clear\n"
7144 "BGP neighbor on interface to clear\n"
7148 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
7149 BGP_CLEAR_SOFT_IN
, argv
[0]);
7152 ALIAS (clear_bgp_peer_soft_in
,
7153 clear_bgp_ipv6_peer_soft_in_cmd
,
7154 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft in",
7158 "BGP neighbor address to clear\n"
7159 "BGP IPv6 neighbor to clear\n"
7160 "BGP neighbor on interface to clear\n"
7164 ALIAS (clear_bgp_peer_soft_in
,
7165 clear_bgp_peer_in_cmd
,
7166 "clear bgp (A.B.C.D|X:X::X:X|WORD) in",
7169 "BGP neighbor address to clear\n"
7170 "BGP IPv6 neighbor to clear\n"
7171 "BGP neighbor on interface to clear\n"
7174 ALIAS (clear_bgp_peer_soft_in
,
7175 clear_bgp_ipv6_peer_in_cmd
,
7176 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) in",
7180 "BGP neighbor address to clear\n"
7181 "BGP IPv6 neighbor to clear\n"
7182 "BGP neighbor on interface to clear\n"
7185 DEFUN (clear_bgp_peer_in_prefix_filter
,
7186 clear_bgp_peer_in_prefix_filter_cmd
,
7187 "clear bgp (A.B.C.D|X:X::X:X|WORD) in prefix-filter",
7190 "BGP neighbor address to clear\n"
7191 "BGP IPv6 neighbor to clear\n"
7192 "BGP neighbor on interface to clear\n"
7194 "Push out the existing ORF prefix-list\n")
7196 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
7197 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7200 ALIAS (clear_bgp_peer_in_prefix_filter
,
7201 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
7202 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) in prefix-filter",
7206 "BGP neighbor address to clear\n"
7207 "BGP IPv6 neighbor to clear\n"
7208 "BGP neighbor on interface to clear\n"
7210 "Push out the existing ORF prefix-list\n")
7212 DEFUN (clear_ip_bgp_peer_group_soft_in
,
7213 clear_ip_bgp_peer_group_soft_in_cmd
,
7214 "clear ip bgp peer-group WORD soft in",
7218 "Clear all members of peer-group\n"
7219 "BGP peer-group name\n"
7223 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
7224 BGP_CLEAR_SOFT_IN
, argv
[0]);
7227 ALIAS (clear_ip_bgp_peer_group_soft_in
,
7228 clear_ip_bgp_peer_group_in_cmd
,
7229 "clear ip bgp peer-group WORD in",
7233 "Clear all members of peer-group\n"
7234 "BGP peer-group name\n"
7237 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
7238 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
7239 "clear ip bgp peer-group WORD in prefix-filter",
7243 "Clear all members of peer-group\n"
7244 "BGP peer-group name\n"
7246 "Push out prefix-list ORF and do inbound soft reconfig\n")
7248 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
7249 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7252 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
7253 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
7254 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
7258 "Clear all members of peer-group\n"
7259 "BGP peer-group name\n"
7261 "Address Family modifier\n"
7262 "Address Family modifier\n"
7266 if (strncmp (argv
[1], "m", 1) == 0)
7267 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
7268 BGP_CLEAR_SOFT_IN
, argv
[0]);
7270 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
7271 BGP_CLEAR_SOFT_IN
, argv
[0]);
7274 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
7275 clear_ip_bgp_peer_group_ipv4_in_cmd
,
7276 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
7280 "Clear all members of peer-group\n"
7281 "BGP peer-group name\n"
7283 "Address Family modifier\n"
7284 "Address Family modifier\n"
7287 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
7288 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
7289 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
7293 "Clear all members of peer-group\n"
7294 "BGP peer-group name\n"
7296 "Address Family modifier\n"
7297 "Address Family modifier\n"
7299 "Push out prefix-list ORF and do inbound soft reconfig\n")
7301 if (strncmp (argv
[1], "m", 1) == 0)
7302 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
7303 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7305 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
7306 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7309 DEFUN (clear_bgp_peer_group_soft_in
,
7310 clear_bgp_peer_group_soft_in_cmd
,
7311 "clear bgp peer-group WORD soft in",
7314 "Clear all members of peer-group\n"
7315 "BGP peer-group name\n"
7319 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
7320 BGP_CLEAR_SOFT_IN
, argv
[0]);
7323 ALIAS (clear_bgp_peer_group_soft_in
,
7324 clear_bgp_ipv6_peer_group_soft_in_cmd
,
7325 "clear bgp ipv6 peer-group WORD soft in",
7329 "Clear all members of peer-group\n"
7330 "BGP peer-group name\n"
7334 ALIAS (clear_bgp_peer_group_soft_in
,
7335 clear_bgp_peer_group_in_cmd
,
7336 "clear bgp peer-group WORD in",
7339 "Clear all members of peer-group\n"
7340 "BGP peer-group name\n"
7343 ALIAS (clear_bgp_peer_group_soft_in
,
7344 clear_bgp_ipv6_peer_group_in_cmd
,
7345 "clear bgp ipv6 peer-group WORD in",
7349 "Clear all members of peer-group\n"
7350 "BGP peer-group name\n"
7353 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
7354 clear_bgp_peer_group_in_prefix_filter_cmd
,
7355 "clear bgp peer-group WORD in prefix-filter",
7358 "Clear all members of peer-group\n"
7359 "BGP peer-group name\n"
7361 "Push out prefix-list ORF and do inbound soft reconfig\n")
7363 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
7364 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7367 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
7368 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
7369 "clear bgp ipv6 peer-group WORD in prefix-filter",
7373 "Clear all members of peer-group\n"
7374 "BGP peer-group name\n"
7376 "Push out prefix-list ORF and do inbound soft reconfig\n")
7378 DEFUN (clear_ip_bgp_external_soft_in
,
7379 clear_ip_bgp_external_soft_in_cmd
,
7380 "clear ip bgp external soft in",
7384 "Clear all external peers\n"
7388 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7389 BGP_CLEAR_SOFT_IN
, NULL
);
7392 ALIAS (clear_ip_bgp_external_soft_in
,
7393 clear_ip_bgp_external_in_cmd
,
7394 "clear ip bgp external in",
7398 "Clear all external peers\n"
7401 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
7402 clear_ip_bgp_external_in_prefix_filter_cmd
,
7403 "clear ip bgp external in prefix-filter",
7407 "Clear all external peers\n"
7409 "Push out prefix-list ORF and do inbound soft reconfig\n")
7411 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7412 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7415 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
7416 clear_ip_bgp_external_ipv4_soft_in_cmd
,
7417 "clear ip bgp external ipv4 (unicast|multicast) soft in",
7421 "Clear all external peers\n"
7423 "Address Family modifier\n"
7424 "Address Family modifier\n"
7428 if (strncmp (argv
[0], "m", 1) == 0)
7429 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
7430 BGP_CLEAR_SOFT_IN
, NULL
);
7432 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7433 BGP_CLEAR_SOFT_IN
, NULL
);
7436 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
7437 clear_ip_bgp_external_ipv4_in_cmd
,
7438 "clear ip bgp external ipv4 (unicast|multicast) in",
7442 "Clear all external peers\n"
7444 "Address Family modifier\n"
7445 "Address Family modifier\n"
7448 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
7449 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
7450 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
7454 "Clear all external peers\n"
7456 "Address Family modifier\n"
7457 "Address Family modifier\n"
7459 "Push out prefix-list ORF and do inbound soft reconfig\n")
7461 if (strncmp (argv
[0], "m", 1) == 0)
7462 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
7463 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7465 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7466 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7469 DEFUN (clear_bgp_external_soft_in
,
7470 clear_bgp_external_soft_in_cmd
,
7471 "clear bgp external soft in",
7474 "Clear all external peers\n"
7478 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
7479 BGP_CLEAR_SOFT_IN
, NULL
);
7482 ALIAS (clear_bgp_external_soft_in
,
7483 clear_bgp_ipv6_external_soft_in_cmd
,
7484 "clear bgp ipv6 external soft in",
7488 "Clear all external peers\n"
7492 ALIAS (clear_bgp_external_soft_in
,
7493 clear_bgp_external_in_cmd
,
7494 "clear bgp external in",
7497 "Clear all external peers\n"
7500 ALIAS (clear_bgp_external_soft_in
,
7501 clear_bgp_ipv6_external_in_cmd
,
7502 "clear bgp ipv6 external WORD in",
7506 "Clear all external peers\n"
7509 DEFUN (clear_bgp_external_in_prefix_filter
,
7510 clear_bgp_external_in_prefix_filter_cmd
,
7511 "clear bgp external in prefix-filter",
7514 "Clear all external peers\n"
7516 "Push out prefix-list ORF and do inbound soft reconfig\n")
7518 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
7519 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
7522 ALIAS (clear_bgp_external_in_prefix_filter
,
7523 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
7524 "clear bgp ipv6 external in prefix-filter",
7528 "Clear all external peers\n"
7530 "Push out prefix-list ORF and do inbound soft reconfig\n")
7532 DEFUN (clear_ip_bgp_as_soft_in
,
7533 clear_ip_bgp_as_soft_in_cmd
,
7534 "clear ip bgp " CMD_AS_RANGE
" soft in",
7538 "Clear peers with the AS number\n"
7542 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7543 BGP_CLEAR_SOFT_IN
, argv
[0]);
7546 ALIAS (clear_ip_bgp_as_soft_in
,
7547 clear_ip_bgp_as_in_cmd
,
7548 "clear ip bgp " CMD_AS_RANGE
" in",
7552 "Clear peers with the AS number\n"
7555 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
7556 clear_ip_bgp_as_in_prefix_filter_cmd
,
7557 "clear ip bgp " CMD_AS_RANGE
" in prefix-filter",
7561 "Clear peers with the AS number\n"
7563 "Push out prefix-list ORF and do inbound soft reconfig\n")
7565 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7566 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7569 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
7570 clear_ip_bgp_as_ipv4_soft_in_cmd
,
7571 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft in",
7575 "Clear peers with the AS number\n"
7577 "Address Family modifier\n"
7578 "Address Family modifier\n"
7582 if (strncmp (argv
[1], "m", 1) == 0)
7583 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
7584 BGP_CLEAR_SOFT_IN
, argv
[0]);
7586 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7587 BGP_CLEAR_SOFT_IN
, argv
[0]);
7590 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
7591 clear_ip_bgp_as_ipv4_in_cmd
,
7592 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in",
7596 "Clear peers with the AS number\n"
7598 "Address Family modifier\n"
7599 "Address Family modifier\n"
7602 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
7603 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
7604 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) in prefix-filter",
7608 "Clear peers with the AS number\n"
7610 "Address Family modifier\n"
7611 "Address Family modifier\n"
7613 "Push out prefix-list ORF and do inbound soft reconfig\n")
7615 if (strncmp (argv
[1], "m", 1) == 0)
7616 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
7617 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7619 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
7620 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7623 DEFUN (clear_ip_bgp_as_vpnv4_soft_in
,
7624 clear_ip_bgp_as_vpnv4_soft_in_cmd
,
7625 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft in",
7629 "Clear peers with the AS number\n"
7631 "Address Family modifier\n"
7635 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
7636 BGP_CLEAR_SOFT_IN
, argv
[0]);
7639 ALIAS (clear_ip_bgp_as_vpnv4_soft_in
,
7640 clear_ip_bgp_as_vpnv4_in_cmd
,
7641 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast in",
7645 "Clear peers with the AS number\n"
7647 "Address Family modifier\n"
7650 DEFUN (clear_bgp_as_soft_in
,
7651 clear_bgp_as_soft_in_cmd
,
7652 "clear bgp " CMD_AS_RANGE
" soft in",
7655 "Clear peers with the AS number\n"
7659 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
7660 BGP_CLEAR_SOFT_IN
, argv
[0]);
7663 ALIAS (clear_bgp_as_soft_in
,
7664 clear_bgp_ipv6_as_soft_in_cmd
,
7665 "clear bgp ipv6 " CMD_AS_RANGE
" soft in",
7669 "Clear peers with the AS number\n"
7673 ALIAS (clear_bgp_as_soft_in
,
7674 clear_bgp_as_in_cmd
,
7675 "clear bgp " CMD_AS_RANGE
" in",
7678 "Clear peers with the AS number\n"
7681 ALIAS (clear_bgp_as_soft_in
,
7682 clear_bgp_ipv6_as_in_cmd
,
7683 "clear bgp ipv6 " CMD_AS_RANGE
" in",
7687 "Clear peers with the AS number\n"
7690 DEFUN (clear_bgp_as_in_prefix_filter
,
7691 clear_bgp_as_in_prefix_filter_cmd
,
7692 "clear bgp " CMD_AS_RANGE
" in prefix-filter",
7695 "Clear peers with the AS number\n"
7697 "Push out prefix-list ORF and do inbound soft reconfig\n")
7699 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
7700 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
7703 ALIAS (clear_bgp_as_in_prefix_filter
,
7704 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
7705 "clear bgp ipv6 " CMD_AS_RANGE
" in prefix-filter",
7709 "Clear peers with the AS number\n"
7711 "Push out prefix-list ORF and do inbound soft reconfig\n")
7713 /* Both soft-reconfiguration */
7714 DEFUN (clear_ip_bgp_all_soft
,
7715 clear_ip_bgp_all_soft_cmd
,
7716 "clear ip bgp * soft",
7724 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
7725 BGP_CLEAR_SOFT_BOTH
, NULL
);
7727 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7728 BGP_CLEAR_SOFT_BOTH
, NULL
);
7731 ALIAS (clear_ip_bgp_all_soft
,
7732 clear_ip_bgp_instance_all_soft_cmd
,
7733 "clear ip bgp view WORD * soft",
7743 DEFUN (clear_ip_bgp_all_ipv4_soft
,
7744 clear_ip_bgp_all_ipv4_soft_cmd
,
7745 "clear ip bgp * ipv4 (unicast|multicast) soft",
7751 "Address Family Modifier\n"
7752 "Address Family Modifier\n"
7755 if (strncmp (argv
[0], "m", 1) == 0)
7756 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
7757 BGP_CLEAR_SOFT_BOTH
, NULL
);
7759 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7760 BGP_CLEAR_SOFT_BOTH
, NULL
);
7763 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
7764 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
7765 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft",
7773 "Address Family Modifier\n"
7774 "Address Family Modifier\n"
7777 if (strncmp (argv
[1], "m", 1) == 0)
7778 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
7779 BGP_CLEAR_SOFT_BOTH
, NULL
);
7781 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
7782 BGP_CLEAR_SOFT_BOTH
, NULL
);
7785 DEFUN (clear_ip_bgp_all_vpnv4_soft
,
7786 clear_ip_bgp_all_vpnv4_soft_cmd
,
7787 "clear ip bgp * vpnv4 unicast soft",
7793 "Address Family Modifier\n"
7796 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
7797 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7800 DEFUN (clear_bgp_all_soft
,
7801 clear_bgp_all_soft_cmd
,
7809 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
7810 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7812 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
7813 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7816 ALIAS (clear_bgp_all_soft
,
7817 clear_bgp_instance_all_soft_cmd
,
7818 "clear bgp view WORD * soft",
7826 ALIAS (clear_bgp_all_soft
,
7827 clear_bgp_ipv6_all_soft_cmd
,
7828 "clear bgp ipv6 * soft",
7835 DEFUN (clear_ip_bgp_peer_soft
,
7836 clear_ip_bgp_peer_soft_cmd
,
7837 "clear ip bgp (A.B.C.D|WORD) soft",
7841 "BGP neighbor address to clear\n"
7842 "BGP neighbor on interface to clear\n"
7845 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7846 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7849 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
7850 clear_ip_bgp_peer_ipv4_soft_cmd
,
7851 "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) soft",
7855 "BGP neighbor address to clear\n"
7856 "BGP neighbor on interface to clear\n"
7858 "Address Family Modifier\n"
7859 "Address Family Modifier\n"
7862 if (strncmp (argv
[1], "m", 1) == 0)
7863 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
7864 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7866 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
7867 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7870 DEFUN (clear_ip_bgp_peer_vpnv4_soft
,
7871 clear_ip_bgp_peer_vpnv4_soft_cmd
,
7872 "clear ip bgp (A.B.C.D|WORD) vpnv4 unicast soft",
7876 "BGP neighbor address to clear\n"
7877 "BGP neighbor on interface to clear\n"
7879 "Address Family Modifier\n"
7882 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
7883 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7886 DEFUN (clear_bgp_peer_soft
,
7887 clear_bgp_peer_soft_cmd
,
7888 "clear bgp (A.B.C.D|X:X::X:X|WORD) soft",
7891 "BGP neighbor address to clear\n"
7892 "BGP IPv6 neighbor to clear\n"
7893 "BGP neighbor on interface to clear\n"
7896 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
7897 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7900 ALIAS (clear_bgp_peer_soft
,
7901 clear_bgp_ipv6_peer_soft_cmd
,
7902 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) soft",
7906 "BGP neighbor address to clear\n"
7907 "BGP IPv6 neighbor to clear\n"
7908 "BGP neighbor on interface to clear\n"
7911 DEFUN (clear_ip_bgp_peer_group_soft
,
7912 clear_ip_bgp_peer_group_soft_cmd
,
7913 "clear ip bgp peer-group WORD soft",
7917 "Clear all members of peer-group\n"
7918 "BGP peer-group name\n"
7921 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
7922 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7925 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
7926 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
7927 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
7931 "Clear all members of peer-group\n"
7932 "BGP peer-group name\n"
7934 "Address Family modifier\n"
7935 "Address Family modifier\n"
7938 if (strncmp (argv
[1], "m", 1) == 0)
7939 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
7940 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7942 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
7943 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7946 DEFUN (clear_bgp_peer_group_soft
,
7947 clear_bgp_peer_group_soft_cmd
,
7948 "clear bgp peer-group WORD soft",
7951 "Clear all members of peer-group\n"
7952 "BGP peer-group name\n"
7955 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
7956 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
7959 ALIAS (clear_bgp_peer_group_soft
,
7960 clear_bgp_ipv6_peer_group_soft_cmd
,
7961 "clear bgp ipv6 peer-group WORD soft",
7965 "Clear all members of peer-group\n"
7966 "BGP peer-group name\n"
7969 DEFUN (clear_ip_bgp_external_soft
,
7970 clear_ip_bgp_external_soft_cmd
,
7971 "clear ip bgp external soft",
7975 "Clear all external peers\n"
7978 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7979 BGP_CLEAR_SOFT_BOTH
, NULL
);
7982 DEFUN (clear_ip_bgp_external_ipv4_soft
,
7983 clear_ip_bgp_external_ipv4_soft_cmd
,
7984 "clear ip bgp external ipv4 (unicast|multicast) soft",
7988 "Clear all external peers\n"
7990 "Address Family modifier\n"
7991 "Address Family modifier\n"
7994 if (strncmp (argv
[0], "m", 1) == 0)
7995 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
7996 BGP_CLEAR_SOFT_BOTH
, NULL
);
7998 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
7999 BGP_CLEAR_SOFT_BOTH
, NULL
);
8002 DEFUN (clear_bgp_external_soft
,
8003 clear_bgp_external_soft_cmd
,
8004 "clear bgp external soft",
8007 "Clear all external peers\n"
8010 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
8011 BGP_CLEAR_SOFT_BOTH
, NULL
);
8014 ALIAS (clear_bgp_external_soft
,
8015 clear_bgp_ipv6_external_soft_cmd
,
8016 "clear bgp ipv6 external soft",
8020 "Clear all external peers\n"
8023 DEFUN (clear_ip_bgp_as_soft
,
8024 clear_ip_bgp_as_soft_cmd
,
8025 "clear ip bgp " CMD_AS_RANGE
" soft",
8029 "Clear peers with the AS number\n"
8032 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
8033 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
8036 DEFUN (clear_ip_bgp_as_ipv4_soft
,
8037 clear_ip_bgp_as_ipv4_soft_cmd
,
8038 "clear ip bgp " CMD_AS_RANGE
" ipv4 (unicast|multicast) soft",
8042 "Clear peers with the AS number\n"
8044 "Address Family Modifier\n"
8045 "Address Family Modifier\n"
8048 if (strncmp (argv
[1], "m", 1) == 0)
8049 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
8050 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
8052 return bgp_clear_vty (vty
, NULL
,AFI_IP
, SAFI_UNICAST
, clear_as
,
8053 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
8056 DEFUN (clear_ip_bgp_as_vpnv4_soft
,
8057 clear_ip_bgp_as_vpnv4_soft_cmd
,
8058 "clear ip bgp " CMD_AS_RANGE
" vpnv4 unicast soft",
8062 "Clear peers with the AS number\n"
8064 "Address Family Modifier\n"
8067 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
8068 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
8071 DEFUN (clear_bgp_as_soft
,
8072 clear_bgp_as_soft_cmd
,
8073 "clear bgp " CMD_AS_RANGE
" soft",
8076 "Clear peers with the AS number\n"
8079 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
8080 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
8083 ALIAS (clear_bgp_as_soft
,
8084 clear_bgp_ipv6_as_soft_cmd
,
8085 "clear bgp ipv6 " CMD_AS_RANGE
" soft",
8089 "Clear peers with the AS number\n"
8092 /* RS-client soft reconfiguration. */
8094 DEFUN (clear_bgp_all_rsclient
,
8095 clear_bgp_all_rsclient_cmd
,
8096 "clear bgp * rsclient",
8100 BGP_SOFT_RSCLIENT_RIB_STR
)
8103 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
8104 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
8106 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
8107 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
8110 ALIAS (clear_bgp_all_rsclient
,
8111 clear_bgp_ipv6_all_rsclient_cmd
,
8112 "clear bgp ipv6 * rsclient",
8117 BGP_SOFT_RSCLIENT_RIB_STR
)
8119 ALIAS (clear_bgp_all_rsclient
,
8120 clear_bgp_instance_all_rsclient_cmd
,
8121 "clear bgp view WORD * rsclient",
8127 BGP_SOFT_RSCLIENT_RIB_STR
)
8129 ALIAS (clear_bgp_all_rsclient
,
8130 clear_bgp_ipv6_instance_all_rsclient_cmd
,
8131 "clear bgp ipv6 view WORD * rsclient",
8138 BGP_SOFT_RSCLIENT_RIB_STR
)
8139 #endif /* HAVE_IPV6 */
8141 DEFUN (clear_ip_bgp_all_rsclient
,
8142 clear_ip_bgp_all_rsclient_cmd
,
8143 "clear ip bgp * rsclient",
8148 BGP_SOFT_RSCLIENT_RIB_STR
)
8151 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
8152 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
8154 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
8155 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
8158 ALIAS (clear_ip_bgp_all_rsclient
,
8159 clear_ip_bgp_instance_all_rsclient_cmd
,
8160 "clear ip bgp view WORD * rsclient",
8167 BGP_SOFT_RSCLIENT_RIB_STR
)
8170 DEFUN (clear_bgp_peer_rsclient
,
8171 clear_bgp_peer_rsclient_cmd
,
8172 "clear bgp (A.B.C.D|X:X::X:X|WORD) rsclient",
8175 "BGP neighbor IP address to clear\n"
8176 "BGP IPv6 neighbor to clear\n"
8177 "BGP neighbor on interface to clear\n"
8178 BGP_SOFT_RSCLIENT_RIB_STR
)
8181 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
8182 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
8184 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
8185 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
8188 ALIAS (clear_bgp_peer_rsclient
,
8189 clear_bgp_ipv6_peer_rsclient_cmd
,
8190 "clear bgp ipv6 (A.B.C.D|X:X::X:X|WORD) rsclient",
8194 "BGP neighbor IP address to clear\n"
8195 "BGP IPv6 neighbor to clear\n"
8196 "BGP neighbor on interface to clear\n"
8197 BGP_SOFT_RSCLIENT_RIB_STR
)
8199 ALIAS (clear_bgp_peer_rsclient
,
8200 clear_bgp_instance_peer_rsclient_cmd
,
8201 "clear bgp view WORD (A.B.C.D|X:X::X:X|WORD) rsclient",
8206 "BGP neighbor IP address to clear\n"
8207 "BGP IPv6 neighbor to clear\n"
8208 "BGP neighbor on interface to clear\n"
8209 BGP_SOFT_RSCLIENT_RIB_STR
)
8211 ALIAS (clear_bgp_peer_rsclient
,
8212 clear_bgp_ipv6_instance_peer_rsclient_cmd
,
8213 "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X|WORD) rsclient",
8219 "BGP neighbor IP address to clear\n"
8220 "BGP IPv6 neighbor to clear\n"
8221 "BGP neighbor on interface to clear\n"
8222 BGP_SOFT_RSCLIENT_RIB_STR
)
8223 #endif /* HAVE_IPV6 */
8225 DEFUN (clear_ip_bgp_peer_rsclient
,
8226 clear_ip_bgp_peer_rsclient_cmd
,
8227 "clear ip bgp (A.B.C.D|X:X::X:X|WORD) rsclient",
8231 "BGP neighbor IP address to clear\n"
8232 "BGP IPv6 neighbor to clear\n"
8233 "BGP neighbor on interface to clear\n"
8234 BGP_SOFT_RSCLIENT_RIB_STR
)
8237 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_peer
,
8238 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
8240 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
8241 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
8244 ALIAS (clear_ip_bgp_peer_rsclient
,
8245 clear_ip_bgp_instance_peer_rsclient_cmd
,
8246 "clear ip bgp view WORD (A.B.C.D|X:X::X:X|WORD) rsclient",
8252 "BGP neighbor IP address to clear\n"
8253 "BGP IPv6 neighbor to clear\n"
8254 "BGP neighbor on interface to clear\n"
8255 BGP_SOFT_RSCLIENT_RIB_STR
)
8257 DEFUN (show_bgp_views
,
8262 "Show the defined BGP views\n")
8264 struct list
*inst
= bm
->bgp
;
8265 struct listnode
*node
;
8268 if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE
))
8270 vty_out (vty
, "Multiple BGP views are not defined%s", VTY_NEWLINE
);
8274 vty_out (vty
, "Defined BGP views:%s", VTY_NEWLINE
);
8275 for (ALL_LIST_ELEMENTS_RO(inst
, node
, bgp
))
8276 vty_out (vty
, "\t%s (AS%u)%s",
8277 bgp
->name
? bgp
->name
: "(null)",
8278 bgp
->as
, VTY_NEWLINE
);
8283 DEFUN (show_bgp_memory
,
8284 show_bgp_memory_cmd
,
8288 "Global BGP memory statistics\n")
8290 char memstrbuf
[MTYPE_MEMSTR_LEN
];
8291 unsigned long count
;
8293 /* RIB related usage stats */
8294 count
= mtype_stats_alloc (MTYPE_BGP_NODE
);
8295 vty_out (vty
, "%ld RIB nodes, using %s of memory%s", count
,
8296 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8297 count
* sizeof (struct bgp_node
)),
8300 count
= mtype_stats_alloc (MTYPE_BGP_ROUTE
);
8301 vty_out (vty
, "%ld BGP routes, using %s of memory%s", count
,
8302 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8303 count
* sizeof (struct bgp_info
)),
8305 if ((count
= mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA
)))
8306 vty_out (vty
, "%ld BGP route ancillaries, using %s of memory%s", count
,
8307 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8308 count
* sizeof (struct bgp_info_extra
)),
8311 if ((count
= mtype_stats_alloc (MTYPE_BGP_STATIC
)))
8312 vty_out (vty
, "%ld Static routes, using %s of memory%s", count
,
8313 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8314 count
* sizeof (struct bgp_static
)),
8317 if ((count
= mtype_stats_alloc (MTYPE_BGP_PACKET
)))
8318 vty_out (vty
, "%ld Packets, using %s of memory%s", count
,
8319 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8320 count
* sizeof (struct bpacket
)),
8324 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_IN
)))
8325 vty_out (vty
, "%ld Adj-In entries, using %s of memory%s", count
,
8326 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8327 count
* sizeof (struct bgp_adj_in
)),
8329 if ((count
= mtype_stats_alloc (MTYPE_BGP_ADJ_OUT
)))
8330 vty_out (vty
, "%ld Adj-Out entries, using %s of memory%s", count
,
8331 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8332 count
* sizeof (struct bgp_adj_out
)),
8335 if ((count
= mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE
)))
8336 vty_out (vty
, "%ld Nexthop cache entries, using %s of memory%s", count
,
8337 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8338 count
* sizeof (struct bgp_nexthop_cache
)),
8341 if ((count
= mtype_stats_alloc (MTYPE_BGP_DAMP_INFO
)))
8342 vty_out (vty
, "%ld Dampening entries, using %s of memory%s", count
,
8343 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8344 count
* sizeof (struct bgp_damp_info
)),
8348 count
= attr_count();
8349 vty_out (vty
, "%ld BGP attributes, using %s of memory%s", count
,
8350 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8351 count
* sizeof(struct attr
)),
8353 if ((count
= mtype_stats_alloc (MTYPE_ATTR_EXTRA
)))
8354 vty_out (vty
, "%ld BGP extra attributes, using %s of memory%s", count
,
8355 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8356 count
* sizeof(struct attr_extra
)),
8359 if ((count
= attr_unknown_count()))
8360 vty_out (vty
, "%ld unknown attributes%s", count
, VTY_NEWLINE
);
8362 /* AS_PATH attributes */
8363 count
= aspath_count ();
8364 vty_out (vty
, "%ld BGP AS-PATH entries, using %s of memory%s", count
,
8365 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8366 count
* sizeof (struct aspath
)),
8369 count
= mtype_stats_alloc (MTYPE_AS_SEG
);
8370 vty_out (vty
, "%ld BGP AS-PATH segments, using %s of memory%s", count
,
8371 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8372 count
* sizeof (struct assegment
)),
8375 /* Other attributes */
8376 if ((count
= community_count ()))
8377 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
8378 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8379 count
* sizeof (struct community
)),
8381 if ((count
= mtype_stats_alloc (MTYPE_ECOMMUNITY
)))
8382 vty_out (vty
, "%ld BGP community entries, using %s of memory%s", count
,
8383 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8384 count
* sizeof (struct ecommunity
)),
8387 if ((count
= mtype_stats_alloc (MTYPE_CLUSTER
)))
8388 vty_out (vty
, "%ld Cluster lists, using %s of memory%s", count
,
8389 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8390 count
* sizeof (struct cluster_list
)),
8393 /* Peer related usage */
8394 count
= mtype_stats_alloc (MTYPE_BGP_PEER
);
8395 vty_out (vty
, "%ld peers, using %s of memory%s", count
,
8396 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8397 count
* sizeof (struct peer
)),
8400 if ((count
= mtype_stats_alloc (MTYPE_PEER_GROUP
)))
8401 vty_out (vty
, "%ld peer groups, using %s of memory%s", count
,
8402 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8403 count
* sizeof (struct peer_group
)),
8407 if ((count
= mtype_stats_alloc (MTYPE_HASH
)))
8408 vty_out (vty
, "%ld hash tables, using %s of memory%s", count
,
8409 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8410 count
* sizeof (struct hash
)),
8412 if ((count
= mtype_stats_alloc (MTYPE_HASH_BACKET
)))
8413 vty_out (vty
, "%ld hash buckets, using %s of memory%s", count
,
8414 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8415 count
* sizeof (struct hash_backet
)),
8417 if ((count
= mtype_stats_alloc (MTYPE_BGP_REGEXP
)))
8418 vty_out (vty
, "%ld compiled regexes, using %s of memory%s", count
,
8419 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8420 count
* sizeof (regex_t
)),
8426 bgp_adj_out_count (struct peer
*peer
, int afi
, int safi
)
8428 struct bgp_table
*table
;
8429 struct bgp_node
*rn
;
8432 if (!peer
) return(0);
8434 table
= peer
->bgp
->rib
[afi
][safi
];
8435 if (!table
) return(0);
8436 for (rn
= bgp_table_top(table
); rn
; rn
= bgp_route_next(rn
))
8437 if (bgp_adj_out_lookup(peer
, NULL
, afi
, safi
, rn
))
8442 /* Show BGP peer's summary information. */
8444 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
,
8448 struct listnode
*node
, *nnode
;
8449 unsigned int count
= 0, dn_count
= 0;
8450 char timebuf
[BGP_UPTIME_LEN
], dn_flag
[2];
8452 json_object
*json
= NULL
;
8453 json_object
*json_int
= NULL
;
8454 json_object
*json_string
= NULL
;
8455 json_object
*json_peer
= NULL
;
8456 json_object
*json_peers
= NULL
;
8457 json_object
*json_boolean_true
= NULL
;
8459 /* Header string for each address family. */
8460 static char header
[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
8464 json
= json_object_new_object();
8465 json_peers
= json_object_new_array();
8466 json_boolean_true
= json_object_new_boolean(1);
8469 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
8471 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
8474 if (peer
->afc
[afi
][safi
])
8479 char memstrbuf
[MTYPE_MEMSTR_LEN
];
8481 /* Usage summary and header */
8484 json_string
= json_object_new_string(inet_ntoa (bgp
->router_id
));
8485 json_object_object_add(json
, "router-id", json_string
);
8487 json_int
= json_object_new_int(bgp
->as
);
8488 json_object_object_add(json
, "as", json_int
);
8493 "BGP router identifier %s, local AS number %u%s",
8494 inet_ntoa (bgp
->router_id
), bgp
->as
, VTY_NEWLINE
);
8497 if (bgp_update_delay_configured(bgp
))
8501 json_int
= json_object_new_int(bgp
->v_update_delay
);
8502 json_object_object_add(json
, "update-delay-limit", json_int
);
8504 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
8506 json_int
= json_object_new_int(bgp
->v_establish_wait
);
8507 json_object_object_add(json
, "update-delay-establish-wait", json_int
);
8510 if (bgp_update_delay_active(bgp
))
8512 json_string
= json_object_new_string(bgp
->update_delay_begin_time
);
8513 json_object_object_add(json
, "update-delay-first-neighbor", json_string
);
8514 json_object_object_add(json
, "update-delay-in-progress", json_boolean_true
);
8518 if (bgp
->update_delay_over
)
8520 json_string
= json_object_new_string(bgp
->update_delay_begin_time
);
8521 json_object_object_add(json
, "update-delay-first-neighbor", json_string
);
8523 json_string
= json_object_new_string(bgp
->update_delay_end_time
);
8524 json_object_object_add(json
, "update-delay-bestpath-resumed", json_string
);
8526 json_string
= json_object_new_string(bgp
->update_delay_zebra_resume_time
);
8527 json_object_object_add(json
, "update-delay-zebra-update-resume", json_string
);
8529 json_string
= json_object_new_string(bgp
->update_delay_peers_resume_time
);
8530 json_object_object_add(json
, "update-delay-peer-update-resume", json_string
);
8536 vty_out (vty
, "Read-only mode update-delay limit: %d seconds%s",
8537 bgp
->v_update_delay
, VTY_NEWLINE
);
8538 if (bgp
->v_update_delay
!= bgp
->v_establish_wait
)
8539 vty_out (vty
, " Establish wait: %d seconds%s",
8540 bgp
->v_establish_wait
, VTY_NEWLINE
);
8542 if (bgp_update_delay_active(bgp
))
8544 vty_out (vty
, " First neighbor established: %s%s",
8545 bgp
->update_delay_begin_time
, VTY_NEWLINE
);
8546 vty_out (vty
, " Delay in progress%s", VTY_NEWLINE
);
8550 if (bgp
->update_delay_over
)
8552 vty_out (vty
, " First neighbor established: %s%s",
8553 bgp
->update_delay_begin_time
, VTY_NEWLINE
);
8554 vty_out (vty
, " Best-paths resumed: %s%s",
8555 bgp
->update_delay_end_time
, VTY_NEWLINE
);
8556 vty_out (vty
, " zebra update resumed: %s%s",
8557 bgp
->update_delay_zebra_resume_time
, VTY_NEWLINE
);
8558 vty_out (vty
, " peers update resumed: %s%s",
8559 bgp
->update_delay_peers_resume_time
, VTY_NEWLINE
);
8567 if (bgp_maxmed_onstartup_configured(bgp
) && bgp
->maxmed_active
)
8568 json_object_object_add(json
, "max-med-on-startup", json_boolean_true
);
8569 if (bgp
->v_maxmed_admin
)
8570 json_object_object_add(json
, "max-med-administrative", json_boolean_true
);
8572 json_int
= json_object_new_int(bgp_table_version(bgp
->rib
[afi
][safi
]));
8573 json_object_object_add(json
, "table-version", json_int
);
8575 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
8576 json_int
= json_object_new_int(ents
);
8577 json_object_object_add(json
, "rib-count", json_int
);
8578 json_int
= json_object_new_int(ents
* sizeof (struct bgp_node
));
8579 json_object_object_add(json
, "rib-memory", json_int
);
8581 ents
= listcount (bgp
->peer
);
8582 json_int
= json_object_new_int(ents
);
8583 json_object_object_add(json
, "peer-count", json_int
);
8584 json_int
= json_object_new_int(ents
* sizeof (struct peer
));
8585 json_object_object_add(json
, "peer-memory", json_int
);
8587 if ((ents
= listcount (bgp
->rsclient
)))
8589 json_int
= json_object_new_int(ents
);
8590 json_object_object_add(json
, "rsclient-count", json_int
);
8591 json_int
= json_object_new_int(ents
* sizeof (struct peer
));
8592 json_object_object_add(json
, "rsclient-memory", json_int
);
8595 if ((ents
= listcount (bgp
->group
)))
8597 json_int
= json_object_new_int(ents
);
8598 json_object_object_add(json
, "peer-group-count", json_int
);
8599 json_int
= json_object_new_int(ents
* sizeof (struct peer_group
));
8600 json_object_object_add(json
, "peer-group-memory", json_int
);
8603 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
8604 json_object_object_add(json
, "dampening-enabled", json_boolean_true
);
8608 if (bgp_maxmed_onstartup_configured(bgp
) && bgp
->maxmed_active
)
8609 vty_out (vty
, "Max-med on-startup active%s", VTY_NEWLINE
);
8610 if (bgp
->v_maxmed_admin
)
8611 vty_out (vty
, "Max-med administrative active%s", VTY_NEWLINE
);
8613 vty_out(vty
, "BGP table version %" PRIu64
"%s",
8614 bgp_table_version(bgp
->rib
[afi
][safi
]), VTY_NEWLINE
);
8616 ents
= bgp_table_count (bgp
->rib
[afi
][safi
]);
8617 vty_out (vty
, "RIB entries %ld, using %s of memory%s", ents
,
8618 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8619 ents
* sizeof (struct bgp_node
)),
8622 /* Peer related usage */
8623 ents
= listcount (bgp
->peer
);
8624 vty_out (vty
, "Peers %ld, using %s of memory%s",
8626 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8627 ents
* sizeof (struct peer
)),
8630 if ((ents
= listcount (bgp
->rsclient
)))
8631 vty_out (vty
, "RS-Client peers %ld, using %s of memory%s",
8633 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8634 ents
* sizeof (struct peer
)),
8637 if ((ents
= listcount (bgp
->group
)))
8638 vty_out (vty
, "Peer groups %ld, using %s of memory%s", ents
,
8639 mtype_memstr (memstrbuf
, sizeof (memstrbuf
),
8640 ents
* sizeof (struct peer_group
)),
8643 if (CHECK_FLAG (bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
8644 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
8645 vty_out (vty
, "%s", VTY_NEWLINE
);
8646 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
8654 json_peer
= json_object_new_object();
8656 if (peer_dynamic_neighbor(peer
))
8657 json_object_object_add(json_peer
, "dynamic-peer", json_boolean_true
);
8659 json_string
= json_object_new_string(peer
->host
);
8660 json_object_object_add(json_peer
, "peer-id", json_string
);
8664 json_string
= json_object_new_string(peer
->hostname
);
8665 json_object_object_add(json_peer
, "hostname", json_string
);
8668 if (peer
->domainname
)
8670 json_string
= json_object_new_string(peer
->domainname
);
8671 json_object_object_add(json_peer
, "domainname", json_string
);
8674 json_int
= json_object_new_int(peer
->as
);
8675 json_object_object_add(json_peer
, "remote-as", json_int
);
8677 json_int
= json_object_new_int(4);
8678 json_object_object_add(json_peer
, "version", json_int
);
8680 json_int
= json_object_new_int(peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
8681 + peer
->notify_in
+ peer
->refresh_in
8682 + peer
->dynamic_cap_in
);
8683 json_object_object_add(json_peer
, "msgrcvd", json_int
);
8685 json_int
= json_object_new_int(peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
8686 + peer
->notify_out
+ peer
->refresh_out
8687 + peer
->dynamic_cap_out
);
8688 json_object_object_add(json_peer
, "msgsent", json_int
);
8690 json_int
= json_object_new_int(peer
->version
[afi
][safi
]);
8691 json_object_object_add(json_peer
, "table-version", json_int
);
8693 json_int
= json_object_new_int(peer
->obuf
->count
);
8694 json_object_object_add(json_peer
, "outq", json_int
);
8696 json_int
= json_object_new_int(0);
8697 json_object_object_add(json_peer
, "inq", json_int
);
8699 json_string
= json_object_new_string(peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
));
8700 json_object_object_add(json_peer
, "uptime", json_string
);
8702 json_int
= json_object_new_int(peer
->pcount
[afi
][safi
]);
8703 json_object_object_add(json_peer
, "prefix-received-count", json_int
);
8705 json_int
= json_object_new_int(bgp_adj_out_count(peer
, afi
, safi
));
8706 json_object_object_add(json_peer
, "prefix-advertised-count", json_int
);
8708 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
8709 json_string
= json_object_new_string("Idle (Admin)");
8711 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
8712 json_string
= json_object_new_string("Idle (PfxCt)");
8715 json_string
= json_object_new_string(LOOKUP(bgp_status_msg
, peer
->status
));
8717 json_object_object_add(json_peer
, "state", json_string
);
8719 json_object_array_add(json_peers
, json_peer
);
8723 memset(dn_flag
, '\0', sizeof(dn_flag
));
8724 if (peer_dynamic_neighbor(peer
))
8730 if (peer
->hostname
&& bgp_flag_check(bgp
, BGP_FLAG_SHOW_HOSTNAME
))
8731 len
= vty_out (vty
, "%s%s(%s)", dn_flag
, peer
->hostname
,
8734 len
= vty_out (vty
, "%s%s", dn_flag
, peer
->host
);
8738 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
8740 vty_out (vty
, "%*s", len
, " ");
8742 vty_out (vty
, "4 ");
8744 vty_out (vty
, "%5u %7d %7d %8lu %4d %4ld ",
8746 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
8747 + peer
->notify_in
+ peer
->refresh_in
8748 + peer
->dynamic_cap_in
,
8749 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
8750 + peer
->notify_out
+ peer
->refresh_out
8751 + peer
->dynamic_cap_out
,
8752 peer
->version
[afi
][safi
],
8756 vty_out (vty
, "%8s",
8757 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
));
8759 if (peer
->status
== Established
)
8760 vty_out (vty
, " %8ld", peer
->pcount
[afi
][safi
]);
8763 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
8764 vty_out (vty
, " Idle (Admin)");
8765 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
8766 vty_out (vty
, " Idle (PfxCt)");
8768 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, peer
->status
));
8770 vty_out (vty
, "%s", VTY_NEWLINE
);
8777 json_object_object_add(json
, "peers", json_peers
);
8779 json_int
= json_object_new_int(count
);
8780 json_object_object_add(json
, "total-peers", json_int
);
8782 json_int
= json_object_new_int(dn_count
);
8783 json_object_object_add(json
, "dynamic-peers", json_int
);
8785 vty_out (vty
, "%s%s", json_object_to_json_string(json
), VTY_NEWLINE
);
8787 // Recursively free all json structures
8788 json_object_put(json
);
8793 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
8794 count
, VTY_NEWLINE
);
8796 vty_out (vty
, "No %s neighbor is configured%s",
8797 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
8801 vty_out(vty
, "* - dynamic neighbor%s", VTY_NEWLINE
);
8803 "%d dynamic neighbor(s), limit %d%s",
8804 dn_count
, bgp
->dynamic_neighbors_limit
, VTY_NEWLINE
);
8812 bgp_show_summary_vty (struct vty
*vty
, const char *name
,
8813 afi_t afi
, safi_t safi
, u_char use_json
)
8819 bgp
= bgp_lookup_by_name (name
);
8823 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
8827 bgp_show_summary (vty
, bgp
, afi
, safi
, use_json
);
8831 bgp
= bgp_get_default ();
8834 bgp_show_summary (vty
, bgp
, afi
, safi
, use_json
);
8839 /* `show ip bgp summary' commands. */
8840 DEFUN (show_ip_bgp_summary
,
8841 show_ip_bgp_summary_cmd
,
8842 "show ip bgp summary {json}",
8846 "Summary of BGP neighbor status\n"
8847 "JavaScript Object Notation\n")
8849 u_char use_json
= (argv
[0] != NULL
);
8850 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, use_json
);
8853 DEFUN (show_ip_bgp_instance_summary
,
8854 show_ip_bgp_instance_summary_cmd
,
8855 "show ip bgp view WORD summary {json}",
8861 "Summary of BGP neighbor status\n"
8862 "JavaScript Object Notation\n")
8864 u_char use_json
= (argv
[1] != NULL
);
8865 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, use_json
);
8868 DEFUN (show_ip_bgp_ipv4_summary
,
8869 show_ip_bgp_ipv4_summary_cmd
,
8870 "show ip bgp ipv4 (unicast|multicast) summary {json}",
8875 "Address Family modifier\n"
8876 "Address Family modifier\n"
8877 "Summary of BGP neighbor status\n"
8878 "JavaScript Object Notation\n")
8880 u_char use_json
= (argv
[1] != NULL
);
8881 if (strncmp (argv
[0], "m", 1) == 0)
8882 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, use_json
);
8884 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, use_json
);
8887 ALIAS (show_ip_bgp_ipv4_summary
,
8888 show_bgp_ipv4_safi_summary_cmd
,
8889 "show bgp ipv4 (unicast|multicast) summary {json}",
8893 "Address Family modifier\n"
8894 "Address Family modifier\n"
8895 "Summary of BGP neighbor status\n")
8897 DEFUN (show_ip_bgp_instance_ipv4_summary
,
8898 show_ip_bgp_instance_ipv4_summary_cmd
,
8899 "show ip bgp view WORD ipv4 (unicast|multicast) summary {json}",
8906 "Address Family modifier\n"
8907 "Address Family modifier\n"
8908 "Summary of BGP neighbor status\n"
8909 "JavaScript Object Notation\n")
8911 u_char use_json
= (argv
[2] != NULL
);
8912 if (strncmp (argv
[1], "m", 1) == 0)
8913 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, use_json
);
8915 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, use_json
);
8918 ALIAS (show_ip_bgp_instance_ipv4_summary
,
8919 show_bgp_instance_ipv4_safi_summary_cmd
,
8920 "show bgp view WORD ipv4 (unicast|multicast) summary {json}",
8926 "Address Family modifier\n"
8927 "Address Family modifier\n"
8928 "Summary of BGP neighbor status\n")
8930 DEFUN (show_ip_bgp_vpnv4_all_summary
,
8931 show_ip_bgp_vpnv4_all_summary_cmd
,
8932 "show ip bgp vpnv4 all summary {json}",
8936 "Display VPNv4 NLRI specific information\n"
8937 "Display information about all VPNv4 NLRIs\n"
8938 "Summary of BGP neighbor status\n"
8939 "JavaScript Object Notation\n")
8941 u_char use_json
= (argv
[0] != NULL
);
8942 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, use_json
);
8945 DEFUN (show_ip_bgp_vpnv4_rd_summary
,
8946 show_ip_bgp_vpnv4_rd_summary_cmd
,
8947 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary {json}",
8951 "Display VPNv4 NLRI specific information\n"
8952 "Display information for a route distinguisher\n"
8953 "VPN Route Distinguisher\n"
8954 "Summary of BGP neighbor status\n"
8955 "JavaScript Object Notation\n")
8958 struct prefix_rd prd
;
8959 u_char use_json
= (argv
[1] != NULL
);
8961 ret
= str2prefix_rd (argv
[0], &prd
);
8964 vty_out (vty
, "%% Malformed Route Distinguisher%s", VTY_NEWLINE
);
8968 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, use_json
);
8972 DEFUN (show_bgp_summary
,
8973 show_bgp_summary_cmd
,
8974 "show bgp summary {json}",
8977 "Summary of BGP neighbor status\n"
8978 "JavaScript Object Notation\n")
8980 u_char use_json
= (argv
[0] != NULL
);
8981 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, use_json
);
8984 DEFUN (show_bgp_instance_summary
,
8985 show_bgp_instance_summary_cmd
,
8986 "show bgp view WORD summary {json}",
8991 "Summary of BGP neighbor status\n"
8992 "JavaScript Object Notation\n")
8994 u_char use_json
= (argv
[1] != NULL
);
8995 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, use_json
);
8998 ALIAS (show_bgp_summary
,
8999 show_bgp_ipv6_summary_cmd
,
9000 "show bgp ipv6 summary {json}",
9004 "Summary of BGP neighbor status\n")
9006 ALIAS (show_bgp_instance_summary
,
9007 show_bgp_instance_ipv6_summary_cmd
,
9008 "show bgp view WORD ipv6 summary {json}",
9014 "Summary of BGP neighbor status\n")
9016 DEFUN (show_bgp_ipv6_safi_summary
,
9017 show_bgp_ipv6_safi_summary_cmd
,
9018 "show bgp ipv6 (unicast|multicast) summary {json}",
9022 "Address Family modifier\n"
9023 "Address Family modifier\n"
9024 "Summary of BGP neighbor status\n"
9025 "JavaScript Object Notation\n")
9027 u_char use_json
= (argv
[1] != NULL
);
9028 if (strncmp (argv
[0], "m", 1) == 0)
9029 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
, use_json
);
9031 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, use_json
);
9034 DEFUN (show_bgp_instance_ipv6_safi_summary
,
9035 show_bgp_instance_ipv6_safi_summary_cmd
,
9036 "show bgp view WORD ipv6 (unicast|multicast) summary {json}",
9042 "Address Family modifier\n"
9043 "Address Family modifier\n"
9044 "Summary of BGP neighbor status\n"
9045 "JavaScript Object Notation\n")
9047 u_char use_json
= (argv
[2] != NULL
);
9048 if (strncmp (argv
[1], "m", 1) == 0)
9049 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_MULTICAST
, use_json
);
9051 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, use_json
);
9055 DEFUN (show_ipv6_bgp_summary
,
9056 show_ipv6_bgp_summary_cmd
,
9057 "show ipv6 bgp summary {json}",
9061 "Summary of BGP neighbor status\n"
9062 "JavaScript Object Notation\n")
9064 u_char use_json
= (argv
[0] != NULL
);
9065 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, use_json
);
9069 DEFUN (show_ipv6_mbgp_summary
,
9070 show_ipv6_mbgp_summary_cmd
,
9071 "show ipv6 mbgp summary {json}",
9075 "Summary of BGP neighbor status\n"
9076 "JavaScript Object Notation\n")
9078 u_char use_json
= (argv
[0] != NULL
);
9079 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
, use_json
);
9081 #endif /* HAVE_IPV6 */
9084 afi_safi_print (afi_t afi
, safi_t safi
)
9086 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
9087 return "IPv4 Unicast";
9088 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
9089 return "IPv4 Multicast";
9090 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
9091 return "VPNv4 Unicast";
9092 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
9093 return "IPv6 Unicast";
9094 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
9095 return "IPv6 Multicast";
9100 /* Show BGP peer's information. */
9108 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
,
9109 afi_t afi
, safi_t safi
,
9110 u_int16_t adv_smcap
, u_int16_t adv_rmcap
,
9111 u_int16_t rcv_smcap
, u_int16_t rcv_rmcap
)
9114 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
9115 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
9117 vty_out (vty
, " Send-mode: ");
9118 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
9119 vty_out (vty
, "advertised");
9120 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
9121 vty_out (vty
, "%sreceived",
9122 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
9124 vty_out (vty
, "%s", VTY_NEWLINE
);
9128 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
9129 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
9131 vty_out (vty
, " Receive-mode: ");
9132 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
9133 vty_out (vty
, "advertised");
9134 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
9135 vty_out (vty
, "%sreceived",
9136 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
9138 vty_out (vty
, "%s", VTY_NEWLINE
);
9143 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
)
9145 struct bgp_filter
*filter
;
9146 struct peer_af
*paf
;
9147 char orf_pfx_name
[BUFSIZ
];
9150 filter
= &p
->filter
[afi
][safi
];
9152 vty_out (vty
, " For address family: %s%s", afi_safi_print (afi
, safi
),
9155 if (p
->af_group
[afi
][safi
])
9156 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
9158 paf
= peer_af_find(p
, afi
, safi
);
9159 if (paf
&& PAF_SUBGRP(paf
))
9161 vty_out (vty
, " Update group %" PRIu64
", subgroup %" PRIu64
"%s",
9162 PAF_UPDGRP(paf
)->id
, PAF_SUBGRP(paf
)->id
, VTY_NEWLINE
);
9163 vty_out (vty
, " Packet Queue length %d%s",
9164 bpacket_queue_virtual_length(paf
), VTY_NEWLINE
);
9167 vty_out(vty
, " Not part of any update group%s", VTY_NEWLINE
);
9169 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
9170 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
9171 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
9172 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
9173 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
9174 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
9175 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
9177 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
9178 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
9179 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
9180 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
9182 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
9183 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
9184 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
9185 PEER_CAP_ORF_PREFIX_SM_ADV
,
9186 PEER_CAP_ORF_PREFIX_RM_ADV
,
9187 PEER_CAP_ORF_PREFIX_SM_RCV
,
9188 PEER_CAP_ORF_PREFIX_RM_RCV
);
9190 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
9191 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
9192 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
9193 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
9195 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
9196 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
9197 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
9198 PEER_CAP_ORF_PREFIX_SM_ADV
,
9199 PEER_CAP_ORF_PREFIX_RM_ADV
,
9200 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
9201 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
);
9204 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
9205 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
);
9207 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
9210 vty_out (vty
, " Outbound Route Filter (ORF):");
9211 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
9212 vty_out (vty
, " sent;");
9214 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
9215 vty_out (vty
, "%s", VTY_NEWLINE
);
9217 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
9218 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
9220 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
9221 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
9222 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
9223 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
9224 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
9225 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
9226 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS_REPLACE
))
9227 vty_out (vty
, " Private AS numbers replaced in updates to this neighbor%s", VTY_NEWLINE
);
9228 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
9229 vty_out (vty
, " Private AS numbers removed in updates to this neighbor%s", VTY_NEWLINE
);
9231 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_OVERRIDE
))
9232 vty_out (vty
, " Override ASNs in outbound updates if aspath equals remote-as%s", VTY_NEWLINE
);
9234 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
) ||
9235 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF_ALL
))
9236 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
9237 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
9238 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
9239 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
9240 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
9241 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
9242 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
9243 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
9244 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
9246 vty_out (vty
, " Community attribute sent to this neighbor");
9247 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
9248 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
9249 vty_out (vty
, "(both)%s", VTY_NEWLINE
);
9250 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
9251 vty_out (vty
, "(extended)%s", VTY_NEWLINE
);
9253 vty_out (vty
, "(standard)%s", VTY_NEWLINE
);
9255 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
9257 vty_out (vty
, " Default information originate,");
9259 if (p
->default_rmap
[afi
][safi
].name
)
9260 vty_out (vty
, " default route-map %s%s,",
9261 p
->default_rmap
[afi
][safi
].map
? "*" : "",
9262 p
->default_rmap
[afi
][safi
].name
);
9263 if (paf
&& PAF_SUBGRP(paf
) && CHECK_FLAG(PAF_SUBGRP(paf
)->sflags
,
9264 SUBGRP_STATUS_DEFAULT_ORIGINATE
))
9265 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
9267 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
9270 if (filter
->plist
[FILTER_IN
].name
9271 || filter
->dlist
[FILTER_IN
].name
9272 || filter
->aslist
[FILTER_IN
].name
9273 || filter
->map
[RMAP_IN
].name
)
9274 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
9275 if (filter
->plist
[FILTER_OUT
].name
9276 || filter
->dlist
[FILTER_OUT
].name
9277 || filter
->aslist
[FILTER_OUT
].name
9278 || filter
->map
[RMAP_OUT
].name
9279 || filter
->usmap
.name
)
9280 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
9281 if (filter
->map
[RMAP_IMPORT
].name
)
9282 vty_out (vty
, " Import policy for this RS-client configured%s", VTY_NEWLINE
);
9283 if (filter
->map
[RMAP_EXPORT
].name
)
9284 vty_out (vty
, " Export policy for this RS-client configured%s", VTY_NEWLINE
);
9287 if (filter
->plist
[FILTER_IN
].name
)
9288 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
9289 filter
->plist
[FILTER_IN
].plist
? "*" : "",
9290 filter
->plist
[FILTER_IN
].name
,
9292 if (filter
->plist
[FILTER_OUT
].name
)
9293 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
9294 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
9295 filter
->plist
[FILTER_OUT
].name
,
9298 /* distribute-list */
9299 if (filter
->dlist
[FILTER_IN
].name
)
9300 vty_out (vty
, " Incoming update network filter list is %s%s%s",
9301 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
9302 filter
->dlist
[FILTER_IN
].name
,
9304 if (filter
->dlist
[FILTER_OUT
].name
)
9305 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
9306 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
9307 filter
->dlist
[FILTER_OUT
].name
,
9311 if (filter
->aslist
[FILTER_IN
].name
)
9312 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
9313 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
9314 filter
->aslist
[FILTER_IN
].name
,
9316 if (filter
->aslist
[FILTER_OUT
].name
)
9317 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
9318 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
9319 filter
->aslist
[FILTER_OUT
].name
,
9323 if (filter
->map
[RMAP_IN
].name
)
9324 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
9325 filter
->map
[RMAP_IN
].map
? "*" : "",
9326 filter
->map
[RMAP_IN
].name
,
9328 if (filter
->map
[RMAP_OUT
].name
)
9329 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
9330 filter
->map
[RMAP_OUT
].map
? "*" : "",
9331 filter
->map
[RMAP_OUT
].name
,
9333 if (filter
->map
[RMAP_IMPORT
].name
)
9334 vty_out (vty
, " Route map for advertisements going into this RS-client's table is %s%s%s",
9335 filter
->map
[RMAP_IMPORT
].map
? "*" : "",
9336 filter
->map
[RMAP_IMPORT
].name
,
9338 if (filter
->map
[RMAP_EXPORT
].name
)
9339 vty_out (vty
, " Route map for advertisements coming from this RS-client is %s%s%s",
9340 filter
->map
[RMAP_EXPORT
].map
? "*" : "",
9341 filter
->map
[RMAP_EXPORT
].name
,
9344 /* unsuppress-map */
9345 if (filter
->usmap
.name
)
9346 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
9347 filter
->usmap
.map
? "*" : "",
9348 filter
->usmap
.name
, VTY_NEWLINE
);
9350 /* Receive prefix count */
9351 vty_out (vty
, " %ld accepted prefixes%s", p
->pcount
[afi
][safi
], VTY_NEWLINE
);
9353 /* Maximum prefix */
9354 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
9356 vty_out (vty
, " Maximum prefixes allowed %ld%s%s", p
->pmax
[afi
][safi
],
9357 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
9358 ? " (warning-only)" : "", VTY_NEWLINE
);
9359 vty_out (vty
, " Threshold for warning message %d%%",
9360 p
->pmax_threshold
[afi
][safi
]);
9361 if (p
->pmax_restart
[afi
][safi
])
9362 vty_out (vty
, ", restart interval %d min", p
->pmax_restart
[afi
][safi
]);
9363 vty_out (vty
, "%s", VTY_NEWLINE
);
9366 vty_out (vty
, "%s", VTY_NEWLINE
);
9370 bgp_show_peer (struct vty
*vty
, struct peer
*p
)
9373 char buf1
[BUFSIZ
], buf
[SU_ADDRSTRLEN
];
9374 char timebuf
[BGP_UPTIME_LEN
];
9383 if (p
->conf_if
) /* Configured interface name. */
9384 vty_out (vty
, "BGP neighbor on %s: %s, ", p
->conf_if
,
9385 BGP_PEER_SU_UNSPEC(p
) ? "None" :
9386 sockunion2str (&p
->su
, buf
, SU_ADDRSTRLEN
));
9387 else /* Configured IP address. */
9389 memset(dn_flag
, '\0', sizeof(dn_flag
));
9390 if (peer_dynamic_neighbor(p
))
9393 vty_out (vty
, "BGP neighbor is %s%s, ", dn_flag
, p
->host
);
9396 vty_out (vty
, "remote AS %u, ", p
->as
);
9397 vty_out (vty
, "local AS %u%s%s, ",
9398 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
9399 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
9401 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_REPLACE_AS
) ?
9402 " replace-as" : "");
9403 vty_out (vty
, "%s link%s",
9404 p
->as
== p
->local_as
? "internal" : "external",
9409 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
9413 if (p
->domainname
&& (p
->domainname
[0] != '\0'))
9414 vty_out(vty
, "Hostname: %s.%s%s", p
->hostname
, p
->domainname
,
9417 vty_out(vty
, "Hostname: %s%s", p
->hostname
, VTY_NEWLINE
);
9423 vty_out (vty
, " Member of peer-group %s for session parameters%s",
9424 p
->group
->name
, VTY_NEWLINE
);
9428 struct prefix
*prefix
= NULL
, *range
= NULL
;
9430 prefix
= sockunion2hostprefix(&(p
->su
));
9432 range
= peer_group_lookup_dynamic_neighbor_range (p
->group
,
9436 prefix2str(range
, buf1
, sizeof(buf1
));
9437 vty_out (vty
, " Belongs to the subnet range group: %s%s",
9443 /* Administrative shutdown. */
9444 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
9445 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
9448 vty_out (vty
, " BGP version 4");
9449 vty_out (vty
, ", remote router ID %s%s",
9450 inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
9454 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
)
9455 && bgp_confederation_peers_check (bgp
, p
->as
))
9456 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
9459 vty_out (vty
, " BGP state = %s",
9460 LOOKUP (bgp_status_msg
, p
->status
));
9461 if (p
->status
== Established
)
9462 vty_out (vty
, ", up for %8s",
9463 peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
));
9464 else if (p
->status
== Active
)
9466 if (CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
))
9467 vty_out (vty
, " (passive)");
9468 else if (CHECK_FLAG (p
->sflags
, PEER_STATUS_NSF_WAIT
))
9469 vty_out (vty
, " (NSF passive)");
9471 vty_out (vty
, "%s", VTY_NEWLINE
);
9474 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
));
9475 vty_out (vty
, ", Last write %s%s",
9476 peer_uptime (p
->last_write
, timebuf
, BGP_UPTIME_LEN
), VTY_NEWLINE
);
9478 /* Configured timer values. */
9479 vty_out (vty
, " Hold time is %d, keepalive interval is %d seconds%s",
9480 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
9481 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
9483 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
9484 vty_out (vty
, ", keepalive interval is %d seconds%s",
9485 p
->keepalive
, VTY_NEWLINE
);
9489 if (p
->status
== Established
)
9492 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
9493 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
9494 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
9495 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
9497 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
9498 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
9499 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
9500 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
9501 #endif /* HAVE_IPV6 */
9502 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
9503 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
9505 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
9508 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
)
9509 || CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
9511 vty_out (vty
, " 4 Byte AS:");
9512 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
))
9513 vty_out (vty
, " advertised");
9514 if (CHECK_FLAG (p
->cap
, PEER_CAP_AS4_RCV
))
9515 vty_out (vty
, " %sreceived",
9516 CHECK_FLAG (p
->cap
, PEER_CAP_AS4_ADV
) ? "and " : "");
9517 vty_out (vty
, "%s", VTY_NEWLINE
);
9521 if (CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_RCV
)
9522 || CHECK_FLAG (p
->cap
, PEER_CAP_ADDPATH_ADV
))
9524 vty_out (vty
, " AddPath:%s", VTY_NEWLINE
);
9526 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
9527 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
9530 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ||
9531 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
9533 vty_out (vty
, " %s: TX ", afi_safi_print (afi
, safi
));
9535 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
))
9536 vty_out (vty
, "advertised %s", afi_safi_print (afi
, safi
));
9538 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_RCV
))
9539 vty_out (vty
, "%sreceived", CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_TX_ADV
) ? " and " : "" );
9541 vty_out (vty
, "%s", VTY_NEWLINE
);
9544 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ||
9545 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
9547 vty_out (vty
, " %s: RX ", afi_safi_print (afi
, safi
));
9549 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
))
9550 vty_out (vty
, "advertised %s", afi_safi_print (afi
, safi
));
9552 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_RCV
))
9553 vty_out (vty
, "%sreceived", CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ADDPATH_AF_RX_ADV
) ? " and " : "" );
9555 vty_out (vty
, "%s", VTY_NEWLINE
);
9561 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
9562 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
9564 vty_out (vty
, " Dynamic:");
9565 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
9566 vty_out (vty
, " advertised");
9567 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
9568 vty_out (vty
, " %sreceived",
9569 CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) ? "and " : "");
9570 vty_out (vty
, "%s", VTY_NEWLINE
);
9573 /* Extended nexthop */
9574 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
)
9575 || CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
))
9577 vty_out (vty
, " Extended nexthop:");
9578 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
))
9579 vty_out (vty
, " advertised");
9580 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
9581 vty_out (vty
, " %sreceived",
9582 CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_ADV
) ? "and " : "");
9583 vty_out (vty
, "%s", VTY_NEWLINE
);
9585 if (CHECK_FLAG (p
->cap
, PEER_CAP_ENHE_RCV
))
9587 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
9588 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
9589 if (CHECK_FLAG (p
->af_cap
[AFI_IP
][safi
], PEER_CAP_ENHE_AF_RCV
))
9590 vty_out (vty
, " %s%s",
9591 afi_safi_print (AFI_IP
, safi
), VTY_NEWLINE
);
9596 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
9597 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
9598 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
9600 vty_out (vty
, " Route refresh:");
9601 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
9602 vty_out (vty
, " advertised");
9603 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
9604 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
9605 vty_out (vty
, " %sreceived(%s)",
9606 CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) ? "and " : "",
9607 (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
9608 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)) ?
9609 "old & new" : CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) ? "old" : "new");
9611 vty_out (vty
, "%s", VTY_NEWLINE
);
9614 /* Multiprotocol Extensions */
9615 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
9616 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
9617 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
9619 vty_out (vty
, " Address family %s:", afi_safi_print (afi
, safi
));
9620 if (p
->afc_adv
[afi
][safi
])
9621 vty_out (vty
, " advertised");
9622 if (p
->afc_recv
[afi
][safi
])
9623 vty_out (vty
, " %sreceived", p
->afc_adv
[afi
][safi
] ? "and " : "");
9624 vty_out (vty
, "%s", VTY_NEWLINE
);
9627 /* Hostname capability */
9628 if (CHECK_FLAG(p
->cap
, PEER_CAP_HOSTNAME_ADV
) ||
9629 CHECK_FLAG(p
->cap
, PEER_CAP_HOSTNAME_RCV
))
9631 vty_out (vty
, " Hostname Capability:");
9632 if (CHECK_FLAG (p
->cap
, PEER_CAP_HOSTNAME_ADV
))
9633 vty_out (vty
, " advertised");
9634 if (CHECK_FLAG (p
->cap
, PEER_CAP_HOSTNAME_RCV
))
9635 vty_out (vty
, " %sreceived",
9636 CHECK_FLAG (p
->cap
, PEER_CAP_HOSTNAME_ADV
) ? "and " : "");
9637 vty_out (vty
, "%s", VTY_NEWLINE
);
9640 /* Gracefull Restart */
9641 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
9642 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
9644 vty_out (vty
, " Graceful Restart Capabilty:");
9645 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
9646 vty_out (vty
, " advertised");
9647 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
9648 vty_out (vty
, " %sreceived",
9649 CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) ? "and " : "");
9650 vty_out (vty
, "%s", VTY_NEWLINE
);
9652 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
9654 int restart_af_count
= 0;
9656 vty_out (vty
, " Remote Restart timer is %d seconds%s",
9657 p
->v_gr_restart
, VTY_NEWLINE
);
9658 vty_out (vty
, " Address families by peer:%s ", VTY_NEWLINE
);
9660 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
9661 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
9662 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
9664 vty_out (vty
, "%s%s(%s)", restart_af_count
? ", " : "",
9665 afi_safi_print (afi
, safi
),
9666 CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_PRESERVE_RCV
) ?
9667 "preserved" : "not preserved");
9670 if (! restart_af_count
)
9671 vty_out (vty
, "none");
9672 vty_out (vty
, "%s", VTY_NEWLINE
);
9678 /* graceful restart information */
9679 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
9683 int eor_send_af_count
= 0;
9684 int eor_receive_af_count
= 0;
9686 vty_out (vty
, " Graceful restart informations:%s", VTY_NEWLINE
);
9687 if (p
->status
== Established
)
9689 vty_out (vty
, " End-of-RIB send: ");
9690 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
9691 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
9692 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_SEND
))
9694 vty_out (vty
, "%s%s", eor_send_af_count
? ", " : "",
9695 afi_safi_print (afi
, safi
));
9696 eor_send_af_count
++;
9698 vty_out (vty
, "%s", VTY_NEWLINE
);
9700 vty_out (vty
, " End-of-RIB received: ");
9701 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
9702 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
9703 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_EOR_RECEIVED
))
9705 vty_out (vty
, "%s%s", eor_receive_af_count
? ", " : "",
9706 afi_safi_print (afi
, safi
));
9707 eor_receive_af_count
++;
9709 vty_out (vty
, "%s", VTY_NEWLINE
);
9712 if (p
->t_gr_restart
)
9713 vty_out (vty
, " The remaining time of restart timer is %ld%s",
9714 thread_timer_remain_second (p
->t_gr_restart
), VTY_NEWLINE
);
9717 vty_out (vty
, " The remaining time of stalepath timer is %ld%s",
9718 thread_timer_remain_second (p
->t_gr_stale
), VTY_NEWLINE
);
9721 /* Packet counts. */
9722 vty_out (vty
, " Message statistics:%s", VTY_NEWLINE
);
9723 vty_out (vty
, " Inq depth is 0%s", VTY_NEWLINE
);
9724 vty_out (vty
, " Outq depth is %lu%s", (unsigned long) p
->obuf
->count
, VTY_NEWLINE
);
9725 vty_out (vty
, " Sent Rcvd%s", VTY_NEWLINE
);
9726 vty_out (vty
, " Opens: %10d %10d%s", p
->open_out
, p
->open_in
, VTY_NEWLINE
);
9727 vty_out (vty
, " Notifications: %10d %10d%s", p
->notify_out
, p
->notify_in
, VTY_NEWLINE
);
9728 vty_out (vty
, " Updates: %10d %10d%s", p
->update_out
, p
->update_in
, VTY_NEWLINE
);
9729 vty_out (vty
, " Keepalives: %10d %10d%s", p
->keepalive_out
, p
->keepalive_in
, VTY_NEWLINE
);
9730 vty_out (vty
, " Route Refresh: %10d %10d%s", p
->refresh_out
, p
->refresh_in
, VTY_NEWLINE
);
9731 vty_out (vty
, " Capability: %10d %10d%s", p
->dynamic_cap_out
, p
->dynamic_cap_in
, VTY_NEWLINE
);
9732 vty_out (vty
, " Total: %10d %10d%s", p
->open_out
+ p
->notify_out
+
9733 p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
+ p
->dynamic_cap_out
,
9734 p
->open_in
+ p
->notify_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
+
9735 p
->dynamic_cap_in
, VTY_NEWLINE
);
9737 /* advertisement-interval */
9738 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
9739 p
->v_routeadv
, VTY_NEWLINE
);
9741 /* Update-source. */
9742 if (p
->update_if
|| p
->update_source
)
9744 vty_out (vty
, " Update source is ");
9746 vty_out (vty
, "%s", p
->update_if
);
9747 else if (p
->update_source
)
9749 sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
9750 vty_out (vty
, "%s", VTY_NEWLINE
);
9753 /* Default weight */
9754 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
9755 vty_out (vty
, " Default weight %d%s", p
->weight
,
9758 vty_out (vty
, "%s", VTY_NEWLINE
);
9760 /* Address Family Information */
9761 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
9762 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
9763 if (p
->afc
[afi
][safi
])
9764 bgp_show_peer_afi (vty
, p
, afi
, safi
);
9766 vty_out (vty
, " Connections established %d; dropped %d%s",
9767 p
->established
, p
->dropped
,
9770 if (! p
->last_reset
)
9771 vty_out (vty
, " Last reset never%s", VTY_NEWLINE
);
9774 vty_out (vty
, " Last reset %s, due to %s%s",
9775 peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
),
9776 peer_down_str
[(int) p
->last_reset
], VTY_NEWLINE
);
9778 if (p
->last_reset_cause_size
)
9780 msg
= p
->last_reset_cause
;
9781 vty_out(vty
, " Message received that caused BGP to send a NOTIFICATION:%s ", VTY_NEWLINE
);
9782 for (i
= 1; i
<= p
->last_reset_cause_size
; i
++)
9784 vty_out(vty
, "%02X", *msg
++);
9786 if (i
!= p
->last_reset_cause_size
)
9790 vty_out(vty
, "%s ", VTY_NEWLINE
);
9792 else if (i
% 4 == 0)
9798 vty_out(vty
, "%s", VTY_NEWLINE
);
9802 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
9804 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
9806 if (p
->t_pmax_restart
)
9807 vty_out (vty
, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
9808 p
->host
, thread_timer_remain_second (p
->t_pmax_restart
),
9811 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
9812 p
->host
, VTY_NEWLINE
);
9815 /* EBGP Multihop and GTSM */
9816 if (p
->sort
!= BGP_PEER_IBGP
)
9818 if (p
->gtsm_hops
> 0)
9819 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
9820 p
->gtsm_hops
, VTY_NEWLINE
);
9821 else if (p
->ttl
> 1)
9822 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
9823 p
->ttl
, VTY_NEWLINE
);
9827 if (p
->gtsm_hops
> 0)
9828 vty_out (vty
, " Internal BGP neighbor may be up to %d hops away.%s",
9829 p
->gtsm_hops
, VTY_NEWLINE
);
9832 /* Local address. */
9835 vty_out (vty
, "Local host: %s, Local port: %d%s",
9836 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
9837 ntohs (p
->su_local
->sin
.sin_port
),
9841 /* Remote address. */
9844 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
9845 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
9846 ntohs (p
->su_remote
->sin
.sin_port
),
9850 /* Nexthop display. */
9853 vty_out (vty
, "Nexthop: %s%s",
9854 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
9857 vty_out (vty
, "Nexthop global: %s%s",
9858 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
9860 vty_out (vty
, "Nexthop local: %s%s",
9861 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
9863 vty_out (vty
, "BGP connection: %s%s",
9864 p
->shared_network
? "shared network" : "non shared network",
9866 #endif /* HAVE_IPV6 */
9869 /* Timer information. */
9871 vty_out (vty
, "Next start timer due in %ld seconds%s",
9872 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
9874 vty_out (vty
, "Next connect timer due in %ld seconds%s",
9875 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
9877 vty_out (vty
, "MRAI (interval %u) timer expires in %ld seconds%s",
9878 p
->v_routeadv
, thread_timer_remain_second (p
->t_routeadv
),
9881 vty_out (vty
, "Read thread: %s Write thread: %s%s",
9882 p
->t_read
? "on" : "off",
9883 p
->t_write
? "on" : "off",
9886 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
9887 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
9888 bgp_capability_vty_out (vty
, p
);
9890 vty_out (vty
, "%s", VTY_NEWLINE
);
9894 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
,
9895 enum show_type type
, union sockunion
*su
, const char *conf_if
)
9897 struct listnode
*node
, *nnode
;
9901 for (ALL_LIST_ELEMENTS (bgp
->peer
, node
, nnode
, peer
))
9903 if (!CHECK_FLAG(peer
->flags
, PEER_FLAG_CONFIG_NODE
))
9909 bgp_show_peer (vty
, peer
);
9914 if (peer
->conf_if
&& !strcmp(peer
->conf_if
, conf_if
))
9917 bgp_show_peer (vty
, peer
);
9919 else if (peer
->hostname
&& !strcmp(peer
->hostname
, conf_if
))
9922 bgp_show_peer (vty
, peer
);
9927 if (sockunion_same (&peer
->su
, su
))
9930 bgp_show_peer (vty
, peer
);
9937 if (type
== show_peer
&& ! find
)
9938 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
9944 bgp_show_neighbor_vty (struct vty
*vty
, const char *name
,
9945 enum show_type type
, const char *ip_str
)
9953 bgp
= bgp_lookup_by_name (name
);
9956 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
9962 bgp
= bgp_get_default ();
9969 ret
= str2sockunion (ip_str
, &su
);
9971 bgp_show_neighbor (vty
, bgp
, type
, NULL
, ip_str
);
9973 bgp_show_neighbor (vty
, bgp
, type
, &su
, NULL
);
9977 bgp_show_neighbor (vty
, bgp
, type
, NULL
, NULL
);
9984 /* "show ip bgp neighbors" commands. */
9985 DEFUN (show_ip_bgp_neighbors
,
9986 show_ip_bgp_neighbors_cmd
,
9987 "show ip bgp neighbors",
9991 "Detailed information on TCP and BGP neighbor connections\n")
9993 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
);
9996 ALIAS (show_ip_bgp_neighbors
,
9997 show_ip_bgp_ipv4_neighbors_cmd
,
9998 "show ip bgp ipv4 (unicast|multicast) neighbors",
10003 "Address Family modifier\n"
10004 "Address Family modifier\n"
10005 "Detailed information on TCP and BGP neighbor connections\n")
10007 ALIAS (show_ip_bgp_neighbors
,
10008 show_ip_bgp_vpnv4_all_neighbors_cmd
,
10009 "show ip bgp vpnv4 all neighbors",
10013 "Display VPNv4 NLRI specific information\n"
10014 "Display information about all VPNv4 NLRIs\n"
10015 "Detailed information on TCP and BGP neighbor connections\n")
10017 ALIAS (show_ip_bgp_neighbors
,
10018 show_ip_bgp_vpnv4_rd_neighbors_cmd
,
10019 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
10023 "Display VPNv4 NLRI specific information\n"
10024 "Display information for a route distinguisher\n"
10025 "VPN Route Distinguisher\n"
10026 "Detailed information on TCP and BGP neighbor connections\n")
10028 ALIAS (show_ip_bgp_neighbors
,
10029 show_bgp_neighbors_cmd
,
10030 "show bgp neighbors",
10033 "Detailed information on TCP and BGP neighbor connections\n")
10035 ALIAS (show_ip_bgp_neighbors
,
10036 show_bgp_ipv6_neighbors_cmd
,
10037 "show bgp ipv6 neighbors",
10041 "Detailed information on TCP and BGP neighbor connections\n")
10043 DEFUN (show_ip_bgp_neighbors_peer
,
10044 show_ip_bgp_neighbors_peer_cmd
,
10045 "show ip bgp neighbors (A.B.C.D|X:X::X:X|WORD)",
10049 "Detailed information on TCP and BGP neighbor connections\n"
10050 "Neighbor to display information about\n"
10051 "Neighbor to display information about\n"
10052 "Neighbor on bgp configured interface\n")
10054 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 1]);
10057 ALIAS (show_ip_bgp_neighbors_peer
,
10058 show_ip_bgp_ipv4_neighbors_peer_cmd
,
10059 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD)",
10064 "Address Family modifier\n"
10065 "Address Family modifier\n"
10066 "Detailed information on TCP and BGP neighbor connections\n"
10067 "Neighbor to display information about\n"
10068 "Neighbor to display information about\n"
10069 "Neighbor on bgp configured interface\n")
10071 ALIAS (show_ip_bgp_neighbors_peer
,
10072 show_ip_bgp_vpnv4_all_neighbors_peer_cmd
,
10073 "show ip bgp vpnv4 all neighbors A.B.C.D",
10077 "Display VPNv4 NLRI specific information\n"
10078 "Display information about all VPNv4 NLRIs\n"
10079 "Detailed information on TCP and BGP neighbor connections\n"
10080 "Neighbor to display information about\n")
10082 ALIAS (show_ip_bgp_neighbors_peer
,
10083 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
,
10084 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
10088 "Display VPNv4 NLRI specific information\n"
10089 "Display information about all VPNv4 NLRIs\n"
10090 "Detailed information on TCP and BGP neighbor connections\n"
10091 "Neighbor to display information about\n")
10093 ALIAS (show_ip_bgp_neighbors_peer
,
10094 show_bgp_neighbors_peer_cmd
,
10095 "show bgp neighbors (A.B.C.D|X:X::X:X|WORD)",
10098 "Detailed information on TCP and BGP neighbor connections\n"
10099 "Neighbor to display information about\n"
10100 "Neighbor to display information about\n"
10101 "Neighbor on bgp configured interface\n")
10103 ALIAS (show_ip_bgp_neighbors_peer
,
10104 show_bgp_ipv6_neighbors_peer_cmd
,
10105 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X|WORD)",
10109 "Detailed information on TCP and BGP neighbor connections\n"
10110 "Neighbor to display information about\n"
10111 "Neighbor to display information about\n"
10112 "Neighbor on bgp configured interface\n")
10114 DEFUN (show_ip_bgp_instance_neighbors
,
10115 show_ip_bgp_instance_neighbors_cmd
,
10116 "show ip bgp view WORD neighbors",
10122 "Detailed information on TCP and BGP neighbor connections\n")
10124 return bgp_show_neighbor_vty (vty
, argv
[0], show_all
, NULL
);
10127 ALIAS (show_ip_bgp_instance_neighbors
,
10128 show_bgp_instance_neighbors_cmd
,
10129 "show bgp view WORD neighbors",
10134 "Detailed information on TCP and BGP neighbor connections\n")
10136 ALIAS (show_ip_bgp_instance_neighbors
,
10137 show_bgp_instance_ipv6_neighbors_cmd
,
10138 "show bgp view WORD ipv6 neighbors",
10144 "Detailed information on TCP and BGP neighbor connections\n")
10146 DEFUN (show_ip_bgp_instance_neighbors_peer
,
10147 show_ip_bgp_instance_neighbors_peer_cmd
,
10148 "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X|WORD)",
10154 "Detailed information on TCP and BGP neighbor connections\n"
10155 "Neighbor to display information about\n"
10156 "Neighbor to display information about\n"
10157 "Neighbor on bgp configured interface\n")
10159 return bgp_show_neighbor_vty (vty
, argv
[0], show_peer
, argv
[1]);
10162 ALIAS (show_ip_bgp_instance_neighbors_peer
,
10163 show_bgp_instance_neighbors_peer_cmd
,
10164 "show bgp view WORD neighbors (A.B.C.D|X:X::X:X|WORD)",
10169 "Detailed information on TCP and BGP neighbor connections\n"
10170 "Neighbor to display information about\n"
10171 "Neighbor to display information about\n"
10172 "Neighbor on bgp configured interface\n")
10174 ALIAS (show_ip_bgp_instance_neighbors_peer
,
10175 show_bgp_instance_ipv6_neighbors_peer_cmd
,
10176 "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X|WORD)",
10182 "Detailed information on TCP and BGP neighbor connections\n"
10183 "Neighbor to display information about\n"
10184 "Neighbor to display information about\n"
10185 "Neighbor on bgp configured interface\n")
10187 /* Show BGP's AS paths internal data. There are both `show ip bgp
10188 paths' and `show ip mbgp paths'. Those functions results are the
10190 DEFUN (show_ip_bgp_paths
,
10191 show_ip_bgp_paths_cmd
,
10192 "show ip bgp paths",
10196 "Path information\n")
10198 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
10199 aspath_print_all_vty (vty
);
10200 return CMD_SUCCESS
;
10203 DEFUN (show_ip_bgp_ipv4_paths
,
10204 show_ip_bgp_ipv4_paths_cmd
,
10205 "show ip bgp ipv4 (unicast|multicast) paths",
10210 "Address Family modifier\n"
10211 "Address Family modifier\n"
10212 "Path information\n")
10214 vty_out (vty
, "Address Refcnt Path\r\n");
10215 aspath_print_all_vty (vty
);
10217 return CMD_SUCCESS
;
10223 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
10225 struct community
*com
;
10227 com
= (struct community
*) backet
->data
;
10228 vty_out (vty
, "[%p] (%ld) %s%s", backet
, com
->refcnt
,
10229 community_str (com
), VTY_NEWLINE
);
10232 /* Show BGP's community internal data. */
10233 DEFUN (show_ip_bgp_community_info
,
10234 show_ip_bgp_community_info_cmd
,
10235 "show ip bgp community-info",
10239 "List all bgp community information\n")
10241 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
10243 hash_iterate (community_hash (),
10244 (void (*) (struct hash_backet
*, void *))
10245 community_show_all_iterator
,
10248 return CMD_SUCCESS
;
10251 DEFUN (show_ip_bgp_attr_info
,
10252 show_ip_bgp_attr_info_cmd
,
10253 "show ip bgp attribute-info",
10257 "List all bgp attribute information\n")
10259 attr_show_all (vty
);
10260 return CMD_SUCCESS
;
10264 bgp_write_rsclient_summary (struct vty
*vty
, struct peer
*rsclient
,
10265 afi_t afi
, safi_t safi
)
10267 char timebuf
[BGP_UPTIME_LEN
];
10269 const char *rmname
;
10271 struct listnode
*node
, *nnode
;
10275 if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_GROUP
))
10277 for (ALL_LIST_ELEMENTS (rsclient
->group
->peer
, node
, nnode
, peer
))
10280 bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
10285 len
= vty_out (vty
, "%s", rsclient
->host
);
10289 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
10291 vty_out (vty
, "%*s", len
, " ");
10293 vty_out (vty
, "4 ");
10295 vty_out (vty
, "%11d ", rsclient
->as
);
10297 rmname
= ROUTE_MAP_EXPORT_NAME(&rsclient
->filter
[afi
][safi
]);
10298 if ( rmname
&& strlen (rmname
) > 13 )
10300 sprintf (rmbuf
, "%13s", "...");
10301 rmname
= strncpy (rmbuf
, rmname
, 10);
10305 vty_out (vty
, " %13s ", rmname
);
10307 rmname
= ROUTE_MAP_IMPORT_NAME(&rsclient
->filter
[afi
][safi
]);
10308 if ( rmname
&& strlen (rmname
) > 13 )
10310 sprintf (rmbuf
, "%13s", "...");
10311 rmname
= strncpy (rmbuf
, rmname
, 10);
10315 vty_out (vty
, " %13s ", rmname
);
10317 vty_out (vty
, "%8s", peer_uptime (rsclient
->uptime
, timebuf
, BGP_UPTIME_LEN
));
10319 if (CHECK_FLAG (rsclient
->flags
, PEER_FLAG_SHUTDOWN
))
10320 vty_out (vty
, " Idle (Admin)");
10321 else if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
10322 vty_out (vty
, " Idle (PfxCt)");
10324 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, rsclient
->status
));
10326 vty_out (vty
, "%s", VTY_NEWLINE
);
10332 bgp_show_rsclient_summary (struct vty
*vty
, struct bgp
*bgp
,
10333 afi_t afi
, safi_t safi
)
10336 struct listnode
*node
, *nnode
;
10339 /* Header string for each address family. */
10340 static char header
[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
10342 for (ALL_LIST_ELEMENTS (bgp
->rsclient
, node
, nnode
, peer
))
10344 if (peer
->afc
[afi
][safi
] &&
10345 CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
10350 "Route Server's BGP router identifier %s%s",
10351 inet_ntoa (bgp
->router_id
), VTY_NEWLINE
);
10353 "Route Server's local AS number %u%s", bgp
->as
,
10356 vty_out (vty
, "%s", VTY_NEWLINE
);
10357 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
10360 count
+= bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
10365 vty_out (vty
, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE
,
10366 count
, VTY_NEWLINE
);
10368 vty_out (vty
, "No %s Route Server Client is configured%s",
10369 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
10371 return CMD_SUCCESS
;
10375 bgp_show_rsclient_summary_vty (struct vty
*vty
, const char *name
,
10376 afi_t afi
, safi_t safi
)
10382 bgp
= bgp_lookup_by_name (name
);
10386 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
10387 return CMD_WARNING
;
10390 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
10391 return CMD_SUCCESS
;
10394 bgp
= bgp_get_default ();
10397 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
10399 return CMD_SUCCESS
;
10402 /* 'show bgp rsclient' commands. */
10403 DEFUN (show_ip_bgp_rsclient_summary
,
10404 show_ip_bgp_rsclient_summary_cmd
,
10405 "show ip bgp rsclient summary",
10409 "Information about Route Server Clients\n"
10410 "Summary of all Route Server Clients\n")
10412 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
10415 DEFUN (show_ip_bgp_instance_rsclient_summary
,
10416 show_ip_bgp_instance_rsclient_summary_cmd
,
10417 "show ip bgp view WORD rsclient summary",
10423 "Information about Route Server Clients\n"
10424 "Summary of all Route Server Clients\n")
10426 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
10429 DEFUN (show_ip_bgp_ipv4_rsclient_summary
,
10430 show_ip_bgp_ipv4_rsclient_summary_cmd
,
10431 "show ip bgp ipv4 (unicast|multicast) rsclient summary",
10436 "Address Family modifier\n"
10437 "Address Family modifier\n"
10438 "Information about Route Server Clients\n"
10439 "Summary of all Route Server Clients\n")
10441 if (strncmp (argv
[0], "m", 1) == 0)
10442 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
10444 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
10447 DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary
,
10448 show_ip_bgp_instance_ipv4_rsclient_summary_cmd
,
10449 "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary",
10456 "Address Family modifier\n"
10457 "Address Family modifier\n"
10458 "Information about Route Server Clients\n"
10459 "Summary of all Route Server Clients\n")
10461 if (strncmp (argv
[1], "m", 1) == 0)
10462 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
10464 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
10467 DEFUN (show_bgp_instance_ipv4_safi_rsclient_summary
,
10468 show_bgp_instance_ipv4_safi_rsclient_summary_cmd
,
10469 "show bgp view WORD ipv4 (unicast|multicast) rsclient summary",
10475 "Address Family modifier\n"
10476 "Address Family modifier\n"
10477 "Information about Route Server Clients\n"
10478 "Summary of all Route Server Clients\n")
10483 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
10484 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, safi
);
10486 safi
= (strncmp (argv
[0], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
10487 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, safi
);
10491 ALIAS (show_bgp_instance_ipv4_safi_rsclient_summary
,
10492 show_bgp_ipv4_safi_rsclient_summary_cmd
,
10493 "show bgp ipv4 (unicast|multicast) rsclient summary",
10497 "Address Family modifier\n"
10498 "Address Family modifier\n"
10499 "Information about Route Server Clients\n"
10500 "Summary of all Route Server Clients\n")
10503 DEFUN (show_bgp_rsclient_summary
,
10504 show_bgp_rsclient_summary_cmd
,
10505 "show bgp rsclient summary",
10508 "Information about Route Server Clients\n"
10509 "Summary of all Route Server Clients\n")
10511 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
10514 DEFUN (show_bgp_instance_rsclient_summary
,
10515 show_bgp_instance_rsclient_summary_cmd
,
10516 "show bgp view WORD rsclient summary",
10521 "Information about Route Server Clients\n"
10522 "Summary of all Route Server Clients\n")
10524 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
10527 ALIAS (show_bgp_rsclient_summary
,
10528 show_bgp_ipv6_rsclient_summary_cmd
,
10529 "show bgp ipv6 rsclient summary",
10533 "Information about Route Server Clients\n"
10534 "Summary of all Route Server Clients\n")
10536 ALIAS (show_bgp_instance_rsclient_summary
,
10537 show_bgp_instance_ipv6_rsclient_summary_cmd
,
10538 "show bgp view WORD ipv6 rsclient summary",
10544 "Information about Route Server Clients\n"
10545 "Summary of all Route Server Clients\n")
10547 DEFUN (show_bgp_instance_ipv6_safi_rsclient_summary
,
10548 show_bgp_instance_ipv6_safi_rsclient_summary_cmd
,
10549 "show bgp view WORD ipv6 (unicast|multicast) rsclient summary",
10555 "Address Family modifier\n"
10556 "Address Family modifier\n"
10557 "Information about Route Server Clients\n"
10558 "Summary of all Route Server Clients\n")
10563 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
10564 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, safi
);
10566 safi
= (strncmp (argv
[0], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
10567 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, safi
);
10571 ALIAS (show_bgp_instance_ipv6_safi_rsclient_summary
,
10572 show_bgp_ipv6_safi_rsclient_summary_cmd
,
10573 "show bgp ipv6 (unicast|multicast) rsclient summary",
10577 "Address Family modifier\n"
10578 "Address Family modifier\n"
10579 "Information about Route Server Clients\n"
10580 "Summary of all Route Server Clients\n")
10582 #endif /* HAVE IPV6 */
10584 static int bgp_show_update_groups(int afi
, int safi
, struct vty
*vty
,
10585 u_int64_t subgrp_id
)
10589 bgp
= bgp_get_default();
10591 update_group_show(bgp
, afi
, safi
, vty
, subgrp_id
);
10592 return CMD_SUCCESS
;
10595 DEFUN (show_ip_bgp_updgrps
,
10596 show_ip_bgp_updgrps_cmd
,
10597 "show ip bgp update-groups",
10601 "Detailed info about dynamic update groups\n")
10603 return (bgp_show_update_groups(AFI_IP
, SAFI_UNICAST
, vty
, 0));
10606 DEFUN (show_bgp_ipv6_updgrps
,
10607 show_bgp_ipv6_updgrps_cmd
,
10608 "show bgp update-groups",
10611 "Detailed info about v6 dynamic update groups\n")
10613 return (bgp_show_update_groups(AFI_IP6
, SAFI_UNICAST
, vty
, 0));
10616 DEFUN (show_bgp_updgrps
,
10617 show_bgp_updgrps_cmd
,
10618 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups",
10623 "Address Family modifier\n"
10624 "Address Family modifier\n"
10625 "Detailed info about dynamic update groups\n")
10630 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
10631 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
10632 return (bgp_show_update_groups(afi
, safi
, vty
, 0));
10635 DEFUN (show_ip_bgp_updgrps_s
,
10636 show_ip_bgp_updgrps_s_cmd
,
10637 "show ip bgp update-groups SUBGROUP-ID",
10641 "Detailed info about dynamic update groups\n"
10642 "Specific subgroup to display detailed info for\n")
10644 u_int64_t subgrp_id
;
10646 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
10647 return (bgp_show_update_groups(AFI_IP
, SAFI_UNICAST
, vty
, subgrp_id
));
10650 DEFUN (show_bgp_ipv6_updgrps_s
,
10651 show_bgp_ipv6_updgrps_s_cmd
,
10652 "show bgp update-groups SUBGROUP-ID",
10655 "Detailed info about v6 dynamic update groups\n"
10656 "Specific subgroup to display detailed info for\n")
10658 u_int64_t subgrp_id
;
10660 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
10661 return(bgp_show_update_groups(AFI_IP6
, SAFI_UNICAST
, vty
, subgrp_id
));
10664 DEFUN (show_bgp_updgrps_s
,
10665 show_bgp_updgrps_s_cmd
,
10666 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups SUBGROUP-ID",
10671 "Address Family modifier\n"
10672 "Address Family modifier\n"
10673 "Detailed info about v6 dynamic update groups\n"
10674 "Specific subgroup to display detailed info for")
10678 u_int64_t subgrp_id
;
10680 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
10681 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
10683 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
10684 return(bgp_show_update_groups(afi
, safi
, vty
, subgrp_id
));
10687 DEFUN (show_bgp_updgrps_stats
,
10688 show_bgp_updgrps_stats_cmd
,
10689 "show bgp update-groups statistics",
10692 "BGP update groups\n"
10697 bgp
= bgp_get_default();
10699 update_group_show_stats(bgp
, vty
);
10701 return CMD_SUCCESS
;
10705 show_bgp_updgrps_adj_info_aux (struct vty
*vty
, afi_t afi
, safi_t safi
,
10706 const char *what
, u_int64_t subgrp_id
)
10709 bgp
= bgp_get_default();
10712 if (!strcmp(what
, "advertise-queue"))
10713 update_group_show_adj_queue(bgp
, afi
, safi
, vty
, subgrp_id
);
10714 else if (!strcmp(what
, "advertised-routes"))
10715 update_group_show_advertised(bgp
, afi
, safi
, vty
, subgrp_id
);
10716 else if (!strcmp(what
, "packet-queue"))
10717 update_group_show_packet_queue(bgp
, afi
, safi
, vty
, subgrp_id
);
10721 DEFUN (show_ip_bgp_updgrps_adj
,
10722 show_ip_bgp_updgrps_adj_cmd
,
10723 "show ip bgp update-groups (advertise-queue|advertised-routes|packet-queue)",
10727 "BGP update groups\n"
10728 "Advertisement queue\n"
10729 "Announced routes\n"
10733 show_bgp_updgrps_adj_info_aux(vty
, AFI_IP
, SAFI_UNICAST
, argv
[0], 0);
10734 return CMD_SUCCESS
;
10737 DEFUN (show_bgp_updgrps_afi_adj
,
10738 show_bgp_updgrps_afi_adj_cmd
,
10739 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups (advertise-queue|advertised-routes|packet-queue)",
10744 "Address Family modifier\n"
10745 "Address Family modifier\n"
10746 "BGP update groups\n"
10747 "Advertisement queue\n"
10748 "Announced routes\n"
10750 "Specific subgroup info wanted for\n")
10755 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
10756 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
10757 show_bgp_updgrps_adj_info_aux(vty
, afi
, safi
, argv
[2], 0);
10758 return CMD_SUCCESS
;
10761 DEFUN (show_bgp_updgrps_adj
,
10762 show_bgp_updgrps_adj_cmd
,
10763 "show bgp update-groups (advertise-queue|advertised-routes|packet-queue)",
10766 "BGP update groups\n"
10767 "Advertisement queue\n"
10768 "Announced routes\n"
10771 show_bgp_updgrps_adj_info_aux(vty
, AFI_IP6
, SAFI_UNICAST
, argv
[0], 0);
10772 return CMD_SUCCESS
;
10775 DEFUN (show_ip_bgp_updgrps_adj_s
,
10776 show_ip_bgp_updgrps_adj_s_cmd
,
10777 "show ip bgp update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
10781 "BGP update groups\n"
10782 "Specific subgroup to display info for\n"
10783 "Advertisement queue\n"
10784 "Announced routes\n"
10788 u_int64_t subgrp_id
;
10790 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
10792 show_bgp_updgrps_adj_info_aux(vty
, AFI_IP
, SAFI_UNICAST
, argv
[1], subgrp_id
);
10793 return CMD_SUCCESS
;
10796 DEFUN (show_bgp_updgrps_afi_adj_s
,
10797 show_bgp_updgrps_afi_adj_s_cmd
,
10798 "show bgp (ipv4|ipv6) (unicast|multicast) update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
10803 "Address Family modifier\n"
10804 "Address Family modifier\n"
10805 "BGP update groups\n"
10806 "Specific subgroup to display info for\n"
10807 "Advertisement queue\n"
10808 "Announced routes\n"
10810 "Specific subgroup info wanted for\n")
10814 u_int64_t subgrp_id
;
10816 afi
= (strcmp(argv
[0], "ipv4") == 0) ? AFI_IP
: AFI_IP6
;
10817 safi
= (strncmp (argv
[1], "m", 1) == 0) ? SAFI_MULTICAST
: SAFI_UNICAST
;
10818 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[2]);
10820 show_bgp_updgrps_adj_info_aux(vty
, afi
, safi
, argv
[3], subgrp_id
);
10821 return CMD_SUCCESS
;
10824 DEFUN (show_bgp_updgrps_adj_s
,
10825 show_bgp_updgrps_adj_s_cmd
,
10826 "show bgp update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
10829 "BGP update groups\n"
10830 "Specific subgroup to display info for\n"
10831 "Advertisement queue\n"
10832 "Announced routes\n"
10835 u_int64_t subgrp_id
;
10837 VTY_GET_ULL("subgroup-id", subgrp_id
, argv
[0]);
10839 show_bgp_updgrps_adj_info_aux(vty
, AFI_IP6
, SAFI_UNICAST
, argv
[1], subgrp_id
);
10840 return CMD_SUCCESS
;
10845 bgp_show_one_peer_group (struct vty
*vty
, struct peer_group
*group
)
10847 struct listnode
*node
, *nnode
;
10848 struct prefix
*range
;
10854 const char *peer_status
;
10855 const char *af_str
;
10860 conf
= group
->conf
;
10862 if (conf
->as_type
== AS_SPECIFIED
||
10863 conf
->as_type
== AS_EXTERNAL
) {
10864 vty_out (vty
, "%sBGP peer-group %s, remote AS %d%s",
10865 VTY_NEWLINE
, group
->name
, conf
->as
, VTY_NEWLINE
);
10866 } else if (conf
->as_type
== AS_INTERNAL
) {
10867 vty_out (vty
, "%sBGP peer-group %s, remote AS %d%s",
10868 VTY_NEWLINE
, group
->name
, group
->bgp
->as
, VTY_NEWLINE
);
10871 if ((group
->bgp
->as
== conf
->as
) || (conf
->as_type
== AS_INTERNAL
))
10872 vty_out (vty
, " Peer-group type is internal%s", VTY_NEWLINE
);
10874 vty_out (vty
, " Peer-group type is external%s", VTY_NEWLINE
);
10876 /* Display AFs configured. */
10877 vty_out (vty
, " Configured address-families:");
10878 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
10879 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
10881 if (conf
->afc
[afi
][safi
])
10884 vty_out (vty
, " %s;", afi_safi_print(afi
, safi
));
10888 vty_out (vty
, " none%s", VTY_NEWLINE
);
10890 vty_out (vty
, "%s", VTY_NEWLINE
);
10892 /* Display listen ranges (for dynamic neighbors), if any */
10893 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
10897 else if (afi
== AFI_IP6
)
10899 lr_count
= listcount(group
->listen_range
[afi
]);
10903 " %d %s listen range(s)%s",
10904 lr_count
, af_str
, VTY_NEWLINE
);
10907 for (ALL_LIST_ELEMENTS (group
->listen_range
[afi
], node
,
10910 prefix2str(range
, buf
, sizeof(buf
));
10911 vty_out(vty
, " %s%s", buf
, VTY_NEWLINE
);
10916 /* Display group members and their status */
10917 if (listcount(group
->peer
))
10919 vty_out (vty
, " Peer-group members:%s", VTY_NEWLINE
);
10920 for (ALL_LIST_ELEMENTS (group
->peer
, node
, nnode
, peer
))
10922 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
10923 peer_status
= "Idle (Admin)";
10924 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
10925 peer_status
= "Idle (PfxCt)";
10927 peer_status
= LOOKUP(bgp_status_msg
, peer
->status
);
10929 dynamic
= peer_dynamic_neighbor(peer
);
10930 vty_out (vty
, " %s %s %s %s",
10931 peer
->host
, dynamic
? "(dynamic)" : "",
10932 peer_status
, VTY_NEWLINE
);
10936 return CMD_SUCCESS
;
10939 /* Show BGP peer group's information. */
10940 enum show_group_type
10947 bgp_show_peer_group (struct vty
*vty
, struct bgp
*bgp
,
10948 enum show_group_type type
, const char *group_name
)
10950 struct listnode
*node
, *nnode
;
10951 struct peer_group
*group
;
10954 for (ALL_LIST_ELEMENTS (bgp
->group
, node
, nnode
, group
))
10958 case show_all_groups
:
10959 bgp_show_one_peer_group (vty
, group
);
10961 case show_peer_group
:
10962 if (group_name
&& (strcmp(group
->name
, group_name
) == 0))
10965 bgp_show_one_peer_group (vty
, group
);
10971 if (type
== show_peer_group
&& ! find
)
10972 vty_out (vty
, "%% No such peer-groupr%s", VTY_NEWLINE
);
10974 return CMD_SUCCESS
;
10978 bgp_show_peer_group_vty (struct vty
*vty
, const char *name
,
10979 enum show_group_type type
, const char *group_name
)
10982 int ret
= CMD_SUCCESS
;
10986 bgp
= bgp_lookup_by_name (name
);
10990 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
10991 return CMD_WARNING
;
10995 bgp
= bgp_get_default ();
10998 ret
= bgp_show_peer_group (vty
, bgp
, type
, group_name
);
11003 DEFUN (show_ip_bgp_peer_groups
,
11004 show_ip_bgp_peer_groups_cmd
,
11005 "show ip bgp peer-group",
11009 "Detailed information on all BGP peer groups\n")
11011 return bgp_show_peer_group_vty (vty
, NULL
, show_all_groups
, NULL
);
11014 DEFUN (show_ip_bgp_instance_peer_groups
,
11015 show_ip_bgp_instance_peer_groups_cmd
,
11016 "show ip bgp view WORD peer-group",
11021 "Detailed information on all BGP peer groups\n")
11023 return bgp_show_peer_group_vty (vty
, argv
[0], show_all_groups
, NULL
);
11026 DEFUN (show_ip_bgp_peer_group
,
11027 show_ip_bgp_peer_group_cmd
,
11028 "show ip bgp peer-group WORD",
11032 "BGP peer-group name\n"
11033 "Detailed information on a BGP peer group\n")
11035 return bgp_show_peer_group_vty (vty
, NULL
, show_peer_group
, argv
[0]);
11038 DEFUN (show_ip_bgp_instance_peer_group
,
11039 show_ip_bgp_instance_peer_group_cmd
,
11040 "show ip bgp view WORD peer-group WORD",
11045 "BGP peer-group name\n"
11046 "Detailed information on a BGP peer group\n")
11048 return bgp_show_peer_group_vty (vty
, argv
[0], show_peer_group
, argv
[1]);
11051 /* Redistribute VTY commands. */
11053 DEFUN (bgp_redistribute_ipv4
,
11054 bgp_redistribute_ipv4_cmd
,
11055 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
,
11056 "Redistribute information from another routing protocol\n"
11057 QUAGGA_IP_REDIST_HELP_STR_BGPD
)
11061 type
= proto_redistnum (AFI_IP
, argv
[0]);
11062 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11064 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11065 return CMD_WARNING
;
11067 bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
11068 return bgp_redistribute_set (AFI_IP
, type
, 0);
11071 DEFUN (bgp_redistribute_ipv4_rmap
,
11072 bgp_redistribute_ipv4_rmap_cmd
,
11073 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD",
11074 "Redistribute information from another routing protocol\n"
11075 QUAGGA_IP_REDIST_HELP_STR_BGPD
11076 "Route map reference\n"
11077 "Pointer to route-map entries\n")
11080 struct bgp_redist
*red
;
11082 type
= proto_redistnum (AFI_IP
, argv
[0]);
11083 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11085 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11086 return CMD_WARNING
;
11089 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
11090 bgp_redistribute_rmap_set (red
, argv
[1]);
11091 return bgp_redistribute_set (AFI_IP
, type
, 0);
11094 DEFUN (bgp_redistribute_ipv4_metric
,
11095 bgp_redistribute_ipv4_metric_cmd
,
11096 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295>",
11097 "Redistribute information from another routing protocol\n"
11098 QUAGGA_IP_REDIST_HELP_STR_BGPD
11099 "Metric for redistributed routes\n"
11100 "Default metric\n")
11104 struct bgp_redist
*red
;
11106 type
= proto_redistnum (AFI_IP
, argv
[0]);
11107 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11109 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11110 return CMD_WARNING
;
11112 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
11114 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
11115 bgp_redistribute_metric_set (red
, metric
);
11116 return bgp_redistribute_set (AFI_IP
, type
, 0);
11119 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
11120 bgp_redistribute_ipv4_rmap_metric_cmd
,
11121 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
11122 "Redistribute information from another routing protocol\n"
11123 QUAGGA_IP_REDIST_HELP_STR_BGPD
11124 "Route map reference\n"
11125 "Pointer to route-map entries\n"
11126 "Metric for redistributed routes\n"
11127 "Default metric\n")
11131 struct bgp_redist
*red
;
11133 type
= proto_redistnum (AFI_IP
, argv
[0]);
11134 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11136 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11137 return CMD_WARNING
;
11139 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
11141 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
11142 bgp_redistribute_rmap_set (red
, argv
[1]);
11143 bgp_redistribute_metric_set (red
, metric
);
11144 return bgp_redistribute_set (AFI_IP
, type
, 0);
11147 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
11148 bgp_redistribute_ipv4_metric_rmap_cmd
,
11149 "redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
11150 "Redistribute information from another routing protocol\n"
11151 QUAGGA_IP_REDIST_HELP_STR_BGPD
11152 "Metric for redistributed routes\n"
11154 "Route map reference\n"
11155 "Pointer to route-map entries\n")
11159 struct bgp_redist
*red
;
11161 type
= proto_redistnum (AFI_IP
, argv
[0]);
11162 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11164 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11165 return CMD_WARNING
;
11167 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
11169 red
= bgp_redist_add(vty
->index
, AFI_IP
, type
, 0);
11170 bgp_redistribute_metric_set (red
, metric
);
11171 bgp_redistribute_rmap_set (red
, argv
[2]);
11172 return bgp_redistribute_set (AFI_IP
, type
, 0);
11175 DEFUN (bgp_redistribute_ipv4_ospf
,
11176 bgp_redistribute_ipv4_ospf_cmd
,
11177 "redistribute (ospf|table) <1-65535>",
11178 "Redistribute information from another routing protocol\n"
11179 "Open Shortest Path First (OSPFv2)\n"
11180 "Non-main Kernel Routing Table\n"
11181 "Instance ID/Table ID\n")
11186 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
11188 if (strncmp(argv
[0], "o", 1) == 0)
11189 protocol
= ZEBRA_ROUTE_OSPF
;
11191 protocol
= ZEBRA_ROUTE_TABLE
;
11193 bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
11194 return bgp_redistribute_set (AFI_IP
, protocol
, instance
);
11197 DEFUN (bgp_redistribute_ipv4_ospf_rmap
,
11198 bgp_redistribute_ipv4_ospf_rmap_cmd
,
11199 "redistribute (ospf|table) <1-65535> route-map WORD",
11200 "Redistribute information from another routing protocol\n"
11201 "Open Shortest Path First (OSPFv2)\n"
11202 "Non-main Kernel Routing Table\n"
11203 "Instance ID/Table ID\n"
11204 "Route map reference\n"
11205 "Pointer to route-map entries\n")
11207 struct bgp_redist
*red
;
11211 if (strncmp(argv
[0], "o", 1) == 0)
11212 protocol
= ZEBRA_ROUTE_OSPF
;
11214 protocol
= ZEBRA_ROUTE_TABLE
;
11216 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
11217 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
11218 bgp_redistribute_rmap_set (red
, argv
[2]);
11219 return bgp_redistribute_set (AFI_IP
, protocol
, instance
);
11222 DEFUN (bgp_redistribute_ipv4_ospf_metric
,
11223 bgp_redistribute_ipv4_ospf_metric_cmd
,
11224 "redistribute (ospf|table) <1-65535> metric <0-4294967295>",
11225 "Redistribute information from another routing protocol\n"
11226 "Open Shortest Path First (OSPFv2)\n"
11227 "Non-main Kernel Routing Table\n"
11228 "Instance ID/Table ID\n"
11229 "Metric for redistributed routes\n"
11230 "Default metric\n")
11233 struct bgp_redist
*red
;
11237 if (strncmp(argv
[0], "o", 1) == 0)
11238 protocol
= ZEBRA_ROUTE_OSPF
;
11240 protocol
= ZEBRA_ROUTE_TABLE
;
11242 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
11243 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
11245 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
11246 bgp_redistribute_metric_set (red
, metric
);
11247 return bgp_redistribute_set (AFI_IP
, protocol
, instance
);
11250 DEFUN (bgp_redistribute_ipv4_ospf_rmap_metric
,
11251 bgp_redistribute_ipv4_ospf_rmap_metric_cmd
,
11252 "redistribute (ospf|table) <1-65535> route-map WORD metric <0-4294967295>",
11253 "Redistribute information from another routing protocol\n"
11254 "Open Shortest Path First (OSPFv2)\n"
11255 "Non-main Kernel Routing Table\n"
11256 "Instance ID/Table ID\n"
11257 "Route map reference\n"
11258 "Pointer to route-map entries\n"
11259 "Metric for redistributed routes\n"
11260 "Default metric\n")
11263 struct bgp_redist
*red
;
11267 if (strncmp(argv
[0], "o", 1) == 0)
11268 protocol
= ZEBRA_ROUTE_OSPF
;
11270 protocol
= ZEBRA_ROUTE_TABLE
;
11272 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
11273 VTY_GET_INTEGER ("metric", metric
, argv
[3]);
11275 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
11276 bgp_redistribute_rmap_set (red
, argv
[2]);
11277 bgp_redistribute_metric_set (red
, metric
);
11278 return bgp_redistribute_set (AFI_IP
, protocol
, instance
);
11281 DEFUN (bgp_redistribute_ipv4_ospf_metric_rmap
,
11282 bgp_redistribute_ipv4_ospf_metric_rmap_cmd
,
11283 "redistribute (ospf|table) <1-65535> metric <0-4294967295> route-map WORD",
11284 "Redistribute information from another routing protocol\n"
11285 "Open Shortest Path First (OSPFv2)\n"
11286 "Non-main Kernel Routing Table\n"
11287 "Instance ID/Table ID\n"
11288 "Metric for redistributed routes\n"
11290 "Route map reference\n"
11291 "Pointer to route-map entries\n")
11294 struct bgp_redist
*red
;
11298 if (strncmp(argv
[0], "o", 1) == 0)
11299 protocol
= ZEBRA_ROUTE_OSPF
;
11301 protocol
= ZEBRA_ROUTE_TABLE
;
11303 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
11304 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
11306 red
= bgp_redist_add(vty
->index
, AFI_IP
, protocol
, instance
);
11307 bgp_redistribute_metric_set (red
, metric
);
11308 bgp_redistribute_rmap_set (red
, argv
[3]);
11309 return bgp_redistribute_set (AFI_IP
, protocol
, instance
);
11312 DEFUN (no_bgp_redistribute_ipv4_ospf
,
11313 no_bgp_redistribute_ipv4_ospf_cmd
,
11314 "no redistribute (ospf|table) <1-65535>",
11316 "Redistribute information from another routing protocol\n"
11317 "Open Shortest Path First (OSPFv2)\n"
11318 "Non-main Kernel Routing Table\n"
11319 "Instance ID/Table ID\n")
11324 if (strncmp(argv
[0], "o", 1) == 0)
11325 protocol
= ZEBRA_ROUTE_OSPF
;
11327 protocol
= ZEBRA_ROUTE_TABLE
;
11329 VTY_GET_INTEGER ("Instance ID", instance
, argv
[1]);
11330 return bgp_redistribute_unset (vty
->index
, AFI_IP
, protocol
, instance
);
11333 ALIAS (no_bgp_redistribute_ipv4_ospf
,
11334 no_bgp_redistribute_ipv4_ospf_rmap_cmd
,
11335 "no redistribute (ospf|table) <1-65535> route-map WORD",
11337 "Redistribute information from another routing protocol\n"
11338 "Open Shortest Path First (OSPFv2)\n"
11339 "Non-main Kernel Routing Table\n"
11340 "Instance ID/Table ID\n"
11341 "Route map reference\n"
11342 "Pointer to route-map entries\n")
11344 ALIAS (no_bgp_redistribute_ipv4_ospf
,
11345 no_bgp_redistribute_ipv4_ospf_metric_cmd
,
11346 "no redistribute (ospf|table) <1-65535> metric <0-4294967295>",
11348 "Redistribute information from another routing protocol\n"
11349 "Open Shortest Path First (OSPFv2)\n"
11350 "Non-main Kernel Routing Table\n"
11351 "Instance ID/Table ID\n"
11352 "Metric for redistributed routes\n"
11353 "Default metric\n")
11355 ALIAS (no_bgp_redistribute_ipv4_ospf
,
11356 no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd
,
11357 "no redistribute (ospf|table) <1-65535> route-map WORD metric <0-4294967295>",
11359 "Redistribute information from another routing protocol\n"
11360 "Open Shortest Path First (OSPFv2)\n"
11361 "Non-main Kernel Routing Table\n"
11362 "Instance ID/Table ID\n"
11363 "Route map reference\n"
11364 "Pointer to route-map entries\n"
11365 "Metric for redistributed routes\n"
11366 "Default metric\n")
11368 ALIAS (no_bgp_redistribute_ipv4_ospf
,
11369 no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd
,
11370 "no redistribute (ospf|table) <1-65535> metric <0-4294967295> route-map WORD",
11372 "Redistribute information from another routing protocol\n"
11373 "Open Shortest Path First (OSPFv2)\n"
11374 "Non-main Kernel Routing Table\n"
11375 "Instance ID/Table ID\n"
11376 "Metric for redistributed routes\n"
11378 "Route map reference\n"
11379 "Pointer to route-map entries\n")
11381 DEFUN (no_bgp_redistribute_ipv4
,
11382 no_bgp_redistribute_ipv4_cmd
,
11383 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
,
11385 "Redistribute information from another routing protocol\n"
11386 QUAGGA_IP_REDIST_HELP_STR_BGPD
)
11390 type
= proto_redistnum (AFI_IP
, argv
[0]);
11391 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11393 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11394 return CMD_WARNING
;
11396 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
, 0);
11399 ALIAS (no_bgp_redistribute_ipv4
,
11400 no_bgp_redistribute_ipv4_rmap_cmd
,
11401 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD",
11403 "Redistribute information from another routing protocol\n"
11404 QUAGGA_IP_REDIST_HELP_STR_BGPD
11405 "Route map reference\n"
11406 "Pointer to route-map entries\n")
11408 ALIAS (no_bgp_redistribute_ipv4
,
11409 no_bgp_redistribute_ipv4_metric_cmd
,
11410 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295>",
11412 "Redistribute information from another routing protocol\n"
11413 QUAGGA_IP_REDIST_HELP_STR_BGPD
11414 "Metric for redistributed routes\n"
11415 "Default metric\n")
11417 ALIAS (no_bgp_redistribute_ipv4
,
11418 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
11419 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
11421 "Redistribute information from another routing protocol\n"
11422 QUAGGA_IP_REDIST_HELP_STR_BGPD
11423 "Route map reference\n"
11424 "Pointer to route-map entries\n"
11425 "Metric for redistributed routes\n"
11426 "Default metric\n")
11428 ALIAS (no_bgp_redistribute_ipv4
,
11429 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
11430 "no redistribute " QUAGGA_IP_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
11432 "Redistribute information from another routing protocol\n"
11433 QUAGGA_IP_REDIST_HELP_STR_BGPD
11434 "Metric for redistributed routes\n"
11436 "Route map reference\n"
11437 "Pointer to route-map entries\n")
11440 DEFUN (bgp_redistribute_ipv6
,
11441 bgp_redistribute_ipv6_cmd
,
11442 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
,
11443 "Redistribute information from another routing protocol\n"
11444 QUAGGA_IP6_REDIST_HELP_STR_BGPD
)
11448 type
= proto_redistnum (AFI_IP6
, argv
[0]);
11449 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11451 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11452 return CMD_WARNING
;
11455 bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
11456 return bgp_redistribute_set (AFI_IP6
, type
, 0);
11459 DEFUN (bgp_redistribute_ipv6_rmap
,
11460 bgp_redistribute_ipv6_rmap_cmd
,
11461 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD",
11462 "Redistribute information from another routing protocol\n"
11463 QUAGGA_IP6_REDIST_HELP_STR_BGPD
11464 "Route map reference\n"
11465 "Pointer to route-map entries\n")
11468 struct bgp_redist
*red
;
11470 type
= proto_redistnum (AFI_IP6
, argv
[0]);
11471 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11473 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11474 return CMD_WARNING
;
11477 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
11478 bgp_redistribute_rmap_set (red
, argv
[1]);
11479 return bgp_redistribute_set (AFI_IP6
, type
, 0);
11482 DEFUN (bgp_redistribute_ipv6_metric
,
11483 bgp_redistribute_ipv6_metric_cmd
,
11484 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295>",
11485 "Redistribute information from another routing protocol\n"
11486 QUAGGA_IP6_REDIST_HELP_STR_BGPD
11487 "Metric for redistributed routes\n"
11488 "Default metric\n")
11492 struct bgp_redist
*red
;
11494 type
= proto_redistnum (AFI_IP6
, argv
[0]);
11495 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11497 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11498 return CMD_WARNING
;
11500 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
11502 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
11503 bgp_redistribute_metric_set (red
, metric
);
11504 return bgp_redistribute_set (AFI_IP6
, type
, 0);
11507 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
11508 bgp_redistribute_ipv6_rmap_metric_cmd
,
11509 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
11510 "Redistribute information from another routing protocol\n"
11511 QUAGGA_IP6_REDIST_HELP_STR_BGPD
11512 "Route map reference\n"
11513 "Pointer to route-map entries\n"
11514 "Metric for redistributed routes\n"
11515 "Default metric\n")
11519 struct bgp_redist
*red
;
11521 type
= proto_redistnum (AFI_IP6
, argv
[0]);
11522 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11524 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11525 return CMD_WARNING
;
11527 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
11529 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
11530 bgp_redistribute_rmap_set (red
, argv
[1]);
11531 bgp_redistribute_metric_set (red
, metric
);
11532 return bgp_redistribute_set (AFI_IP6
, type
, 0);
11535 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
11536 bgp_redistribute_ipv6_metric_rmap_cmd
,
11537 "redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
11538 "Redistribute information from another routing protocol\n"
11539 QUAGGA_IP6_REDIST_HELP_STR_BGPD
11540 "Metric for redistributed routes\n"
11542 "Route map reference\n"
11543 "Pointer to route-map entries\n")
11547 struct bgp_redist
*red
;
11549 type
= proto_redistnum (AFI_IP6
, argv
[0]);
11550 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11552 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11553 return CMD_WARNING
;
11555 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
11557 red
= bgp_redist_add(vty
->index
, AFI_IP6
, type
, 0);
11558 bgp_redistribute_metric_set (red
, metric
);
11559 bgp_redistribute_rmap_set (red
, argv
[2]);
11560 return bgp_redistribute_set (AFI_IP6
, type
, 0);
11563 DEFUN (no_bgp_redistribute_ipv6
,
11564 no_bgp_redistribute_ipv6_cmd
,
11565 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
,
11567 "Redistribute information from another routing protocol\n"
11568 QUAGGA_IP6_REDIST_HELP_STR_BGPD
)
11572 type
= proto_redistnum (AFI_IP6
, argv
[0]);
11573 if (type
< 0 || type
== ZEBRA_ROUTE_BGP
)
11575 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
11576 return CMD_WARNING
;
11579 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
, 0);
11582 ALIAS (no_bgp_redistribute_ipv6
,
11583 no_bgp_redistribute_ipv6_rmap_cmd
,
11584 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD",
11586 "Redistribute information from another routing protocol\n"
11587 QUAGGA_IP6_REDIST_HELP_STR_BGPD
11588 "Route map reference\n"
11589 "Pointer to route-map entries\n")
11591 ALIAS (no_bgp_redistribute_ipv6
,
11592 no_bgp_redistribute_ipv6_metric_cmd
,
11593 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295>",
11595 "Redistribute information from another routing protocol\n"
11596 QUAGGA_IP6_REDIST_HELP_STR_BGPD
11597 "Metric for redistributed routes\n"
11598 "Default metric\n")
11600 ALIAS (no_bgp_redistribute_ipv6
,
11601 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
11602 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" route-map WORD metric <0-4294967295>",
11604 "Redistribute information from another routing protocol\n"
11605 QUAGGA_IP6_REDIST_HELP_STR_BGPD
11606 "Route map reference\n"
11607 "Pointer to route-map entries\n"
11608 "Metric for redistributed routes\n"
11609 "Default metric\n")
11611 ALIAS (no_bgp_redistribute_ipv6
,
11612 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
11613 "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD
" metric <0-4294967295> route-map WORD",
11615 "Redistribute information from another routing protocol\n"
11616 QUAGGA_IP6_REDIST_HELP_STR_BGPD
11617 "Metric for redistributed routes\n"
11619 "Route map reference\n"
11620 "Pointer to route-map entries\n")
11621 #endif /* HAVE_IPV6 */
11624 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
11625 safi_t safi
, int *write
)
11629 /* Unicast redistribution only. */
11630 if (safi
!= SAFI_UNICAST
)
11633 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
11635 /* Redistribute BGP does not make sense. */
11636 if (i
!= ZEBRA_ROUTE_BGP
)
11638 struct list
*red_list
;
11639 struct listnode
*node
;
11640 struct bgp_redist
*red
;
11642 red_list
= bgp
->redist
[afi
][i
];
11646 for (ALL_LIST_ELEMENTS_RO(red_list
, node
, red
))
11648 /* Display "address-family" when it is not yet diplayed. */
11649 bgp_config_write_family_header (vty
, afi
, safi
, write
);
11651 /* "redistribute" configuration. */
11652 vty_out (vty
, " redistribute %s", zebra_route_string(i
));
11654 vty_out (vty
, " %d", red
->instance
);
11655 if (red
->redist_metric_flag
)
11656 vty_out (vty
, " metric %u", red
->redist_metric
);
11657 if (red
->rmap
.name
)
11658 vty_out (vty
, " route-map %s", red
->rmap
.name
);
11659 vty_out (vty
, "%s", VTY_NEWLINE
);
11666 /* BGP node structure. */
11667 static struct cmd_node bgp_node
=
11670 "%s(config-router)# ",
11674 static struct cmd_node bgp_ipv4_unicast_node
=
11677 "%s(config-router-af)# ",
11681 static struct cmd_node bgp_ipv4_multicast_node
=
11684 "%s(config-router-af)# ",
11688 static struct cmd_node bgp_ipv6_unicast_node
=
11691 "%s(config-router-af)# ",
11695 static struct cmd_node bgp_ipv6_multicast_node
=
11698 "%s(config-router-af)# ",
11702 static struct cmd_node bgp_vpnv4_node
=
11705 "%s(config-router-af)# ",
11709 static void community_list_vty (void);
11712 bgp_vty_init (void)
11714 /* Install bgp top node. */
11715 install_node (&bgp_node
, bgp_config_write
);
11716 install_node (&bgp_ipv4_unicast_node
, NULL
);
11717 install_node (&bgp_ipv4_multicast_node
, NULL
);
11718 install_node (&bgp_ipv6_unicast_node
, NULL
);
11719 install_node (&bgp_ipv6_multicast_node
, NULL
);
11720 install_node (&bgp_vpnv4_node
, NULL
);
11722 /* Install default VTY commands to new nodes. */
11723 install_default (BGP_NODE
);
11724 install_default (BGP_IPV4_NODE
);
11725 install_default (BGP_IPV4M_NODE
);
11726 install_default (BGP_IPV6_NODE
);
11727 install_default (BGP_IPV6M_NODE
);
11728 install_default (BGP_VPNV4_NODE
);
11730 /* "bgp multiple-instance" commands. */
11731 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
11732 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
11734 /* "bgp config-type" commands. */
11735 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
11736 install_element (CONFIG_NODE
, &no_bgp_config_type_cmd
);
11738 /* Dummy commands (Currently not supported) */
11739 install_element (BGP_NODE
, &no_synchronization_cmd
);
11740 install_element (BGP_NODE
, &no_auto_summary_cmd
);
11742 /* "router bgp" commands. */
11743 install_element (CONFIG_NODE
, &router_bgp_cmd
);
11744 install_element (CONFIG_NODE
, &router_bgp_view_cmd
);
11746 /* "no router bgp" commands. */
11747 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
11748 install_element (CONFIG_NODE
, &no_router_bgp_view_cmd
);
11750 /* "bgp router-id" commands. */
11751 install_element (BGP_NODE
, &bgp_router_id_cmd
);
11752 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
11753 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
11755 /* "bgp cluster-id" commands. */
11756 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
11757 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
11758 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
11759 install_element (BGP_NODE
, &no_bgp_cluster_id_arg_cmd
);
11761 /* "bgp confederation" commands. */
11762 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
11763 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
11764 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
11766 /* "bgp confederation peers" commands. */
11767 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
11768 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
11770 /* bgp max-med command */
11771 install_element (BGP_NODE
, &bgp_maxmed_admin_cmd
);
11772 install_element (BGP_NODE
, &no_bgp_maxmed_admin_cmd
);
11773 install_element (BGP_NODE
, &bgp_maxmed_admin_medv_cmd
);
11774 install_element (BGP_NODE
, &no_bgp_maxmed_admin_medv_cmd
);
11775 install_element (BGP_NODE
, &bgp_maxmed_onstartup_cmd
);
11776 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_cmd
);
11777 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_period_cmd
);
11778 install_element (BGP_NODE
, &bgp_maxmed_onstartup_medv_cmd
);
11779 install_element (BGP_NODE
, &no_bgp_maxmed_onstartup_period_medv_cmd
);
11781 /* bgp disable-ebgp-connected-nh-check */
11782 install_element (BGP_NODE
, &bgp_disable_connected_route_check_cmd
);
11783 install_element (BGP_NODE
, &no_bgp_disable_connected_route_check_cmd
);
11785 /* bgp update-delay command */
11786 install_element (BGP_NODE
, &bgp_update_delay_cmd
);
11787 install_element (BGP_NODE
, &no_bgp_update_delay_cmd
);
11788 install_element (BGP_NODE
, &bgp_update_delay_establish_wait_cmd
);
11789 install_element (BGP_NODE
, &no_bgp_update_delay_establish_wait_cmd
);
11791 install_element (BGP_NODE
, &bgp_wpkt_quanta_cmd
);
11792 install_element (BGP_NODE
, &no_bgp_wpkt_quanta_cmd
);
11794 install_element (BGP_NODE
, &bgp_coalesce_time_cmd
);
11795 install_element (BGP_NODE
, &no_bgp_coalesce_time_cmd
);
11797 /* "maximum-paths" commands. */
11798 install_element (BGP_NODE
, &bgp_maxpaths_cmd
);
11799 install_element (BGP_NODE
, &no_bgp_maxpaths_cmd
);
11800 install_element (BGP_NODE
, &no_bgp_maxpaths_arg_cmd
);
11801 install_element (BGP_IPV4_NODE
, &bgp_maxpaths_cmd
);
11802 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_cmd
);
11803 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_arg_cmd
);
11804 install_element (BGP_IPV6_NODE
, &bgp_maxpaths_cmd
);
11805 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_cmd
);
11806 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_arg_cmd
);
11807 install_element (BGP_NODE
, &bgp_maxpaths_ibgp_cmd
);
11808 install_element(BGP_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
11809 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
11810 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
11811 install_element (BGP_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
11812 install_element (BGP_IPV4_NODE
, &bgp_maxpaths_ibgp_cmd
);
11813 install_element(BGP_IPV4_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
11814 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
11815 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
11816 install_element (BGP_IPV4_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
11817 install_element (BGP_IPV6_NODE
, &bgp_maxpaths_ibgp_cmd
);
11818 install_element(BGP_IPV6_NODE
, &bgp_maxpaths_ibgp_cluster_cmd
);
11819 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_cmd
);
11820 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_arg_cmd
);
11821 install_element (BGP_IPV6_NODE
, &no_bgp_maxpaths_ibgp_cluster_cmd
);
11823 /* "timers bgp" commands. */
11824 install_element (BGP_NODE
, &bgp_timers_cmd
);
11825 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
11826 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
11828 /* route-map delay-timer commands */
11829 install_element (BGP_NODE
, &bgp_set_route_map_delay_timer_cmd
);
11830 install_element (BGP_NODE
, &no_bgp_set_route_map_delay_timer_cmd
);
11831 install_element (BGP_NODE
, &no_bgp_set_route_map_delay_timer_val_cmd
);
11833 /* "bgp client-to-client reflection" commands */
11834 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
11835 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
11837 /* "bgp always-compare-med" commands */
11838 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
11839 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
11841 /* "bgp deterministic-med" commands */
11842 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
11843 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
11845 /* "bgp graceful-restart" commands */
11846 install_element (BGP_NODE
, &bgp_graceful_restart_cmd
);
11847 install_element (BGP_NODE
, &no_bgp_graceful_restart_cmd
);
11848 install_element (BGP_NODE
, &bgp_graceful_restart_stalepath_time_cmd
);
11849 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_cmd
);
11850 install_element (BGP_NODE
, &no_bgp_graceful_restart_stalepath_time_val_cmd
);
11852 /* "bgp fast-external-failover" commands */
11853 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
11854 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
11856 /* "bgp enforce-first-as" commands */
11857 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
11858 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
11860 /* "bgp bestpath compare-routerid" commands */
11861 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
11862 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
11864 /* "bgp bestpath as-path ignore" commands */
11865 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
11866 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
11868 /* "bgp bestpath as-path confed" commands */
11869 install_element (BGP_NODE
, &bgp_bestpath_aspath_confed_cmd
);
11870 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_confed_cmd
);
11872 /* "bgp bestpath as-path multipath-relax" commands */
11873 install_element (BGP_NODE
, &bgp_bestpath_aspath_multipath_relax_cmd
);
11874 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_multipath_relax_cmd
);
11876 /* "bgp bestpath as-path multipath-relax no-as-set" commands */
11877 install_element (BGP_NODE
, &bgp_bestpath_aspath_multipath_relax_no_as_set_cmd
);
11878 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_multipath_relax_no_as_set_cmd
);
11880 /* "bgp log-neighbor-changes" commands */
11881 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
11882 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
11884 /* "bgp bestpath med" commands */
11885 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
11886 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
11887 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
11888 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
11889 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
11890 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
11892 /* "no bgp default ipv4-unicast" commands. */
11893 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
11894 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
11896 /* "bgp network import-check" commands. */
11897 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
11898 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
11900 /* "bgp default local-preference" commands. */
11901 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
11902 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
11903 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
11905 /* bgp default show-hostname */
11906 install_element (BGP_NODE
, &bgp_default_show_hostname_cmd
);
11907 install_element (BGP_NODE
, &no_bgp_default_show_hostname_cmd
);
11909 /* "bgp default subgroup-pkt-queue-max" commands. */
11910 install_element (BGP_NODE
, &bgp_default_subgroup_pkt_queue_max_cmd
);
11911 install_element (BGP_NODE
, &no_bgp_default_subgroup_pkt_queue_max_cmd
);
11913 /* bgp ibgp-allow-policy-mods command */
11914 install_element (BGP_NODE
, &bgp_rr_allow_outbound_policy_cmd
);
11915 install_element (BGP_NODE
, &no_bgp_rr_allow_outbound_policy_cmd
);
11917 /* "bgp listen limit" commands. */
11918 install_element (BGP_NODE
, &bgp_listen_limit_cmd
);
11919 install_element (BGP_NODE
, &no_bgp_listen_limit_cmd
);
11921 /* "bgp listen range" commands. */
11922 install_element (BGP_NODE
, &bgp_listen_range_cmd
);
11923 install_element (BGP_NODE
, &no_bgp_listen_range_cmd
);
11925 /* "neighbor remote-as" commands. */
11926 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
11927 install_element (BGP_NODE
, &neighbor_interface_config_cmd
);
11928 install_element (BGP_NODE
, &no_neighbor_cmd
);
11929 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
11930 install_element (BGP_NODE
, &no_neighbor_interface_config_cmd
);
11932 /* "neighbor peer-group" commands. */
11933 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
11934 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
11935 install_element (BGP_NODE
, &no_neighbor_interface_peer_group_remote_as_cmd
);
11937 /* "neighbor local-as" commands. */
11938 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
11939 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
11940 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_replace_as_cmd
);
11941 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
11942 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
11943 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
11944 install_element (BGP_NODE
, &no_neighbor_local_as_val3_cmd
);
11946 /* "neighbor solo" commands. */
11947 install_element (BGP_NODE
, &neighbor_solo_cmd
);
11948 install_element (BGP_NODE
, &no_neighbor_solo_cmd
);
11950 /* "neighbor password" commands. */
11951 install_element (BGP_NODE
, &neighbor_password_cmd
);
11952 install_element (BGP_NODE
, &no_neighbor_password_cmd
);
11954 /* "neighbor activate" commands. */
11955 install_element (BGP_NODE
, &neighbor_activate_cmd
);
11956 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
11957 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
11958 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
11959 install_element (BGP_IPV6M_NODE
, &neighbor_activate_cmd
);
11960 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
11962 /* "no neighbor activate" commands. */
11963 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
11964 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
11965 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
11966 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
11967 install_element (BGP_IPV6M_NODE
, &no_neighbor_activate_cmd
);
11968 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
11970 /* "neighbor peer-group set" commands. */
11971 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
11972 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
11973 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
11974 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
11975 install_element (BGP_IPV6M_NODE
, &neighbor_set_peer_group_cmd
);
11976 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
11978 /* "no neighbor peer-group unset" commands. */
11979 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
11980 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
11981 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
11982 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
11983 install_element (BGP_IPV6M_NODE
, &no_neighbor_set_peer_group_cmd
);
11984 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
11986 /* "neighbor softreconfiguration inbound" commands.*/
11987 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
11988 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
11989 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
11990 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
11991 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
11992 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
11993 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
11994 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
11995 install_element (BGP_IPV6M_NODE
, &neighbor_soft_reconfiguration_cmd
);
11996 install_element (BGP_IPV6M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
11997 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
11998 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
12000 /* "neighbor attribute-unchanged" commands. */
12001 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
12002 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
12003 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
12004 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
12005 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
12006 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
12007 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
12008 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
12009 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
12010 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
12011 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
12012 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
12013 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
12014 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
12015 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
12016 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
12017 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
12018 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
12019 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
12020 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
12021 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
12022 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
12023 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
12024 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
12025 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
12026 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
12027 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
12028 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
12029 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
12030 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
12031 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
12032 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
12033 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
12034 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
12035 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
12036 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
12037 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
12038 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
12039 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
12040 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
12041 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
12042 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
12043 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
12044 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
12045 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
12046 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
12047 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
12048 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
12049 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
12050 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
12051 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
12052 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
12053 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
12054 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
12055 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
12056 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
12057 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
12058 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
12059 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
12060 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
12061 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
12062 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
12063 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
12064 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
12065 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
12066 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
12067 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
12068 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
12069 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
12070 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
12071 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
12072 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
12073 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
12074 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
12075 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
12076 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
12077 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
12078 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
12079 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
12080 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
12081 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
12082 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
12083 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
12084 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
12085 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
12086 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
12087 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
12088 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
12089 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged_cmd
);
12090 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged1_cmd
);
12091 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged2_cmd
);
12092 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged3_cmd
);
12093 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged4_cmd
);
12094 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged5_cmd
);
12095 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged6_cmd
);
12096 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged7_cmd
);
12097 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged8_cmd
);
12098 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged9_cmd
);
12099 install_element (BGP_IPV6M_NODE
, &neighbor_attr_unchanged10_cmd
);
12100 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged_cmd
);
12101 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
12102 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
12103 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
12104 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
12105 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
12106 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
12107 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
12108 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
12109 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
12110 install_element (BGP_IPV6M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
12111 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
12112 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
12113 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
12114 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
12115 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
12116 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
12117 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
12118 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
12119 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
12120 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
12121 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
12122 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
12123 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
12124 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
12125 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
12126 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
12127 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
12128 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
12129 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
12130 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
12131 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
12132 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
12134 /* "nexthop-local unchanged" commands */
12135 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_local_unchanged_cmd
);
12136 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_local_unchanged_cmd
);
12138 /* "transparent-as" and "transparent-nexthop" for old version
12140 install_element (BGP_NODE
, &neighbor_transparent_as_cmd
);
12141 install_element (BGP_NODE
, &neighbor_transparent_nexthop_cmd
);
12143 /* "neighbor next-hop-self" commands. */
12144 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
12145 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
12146 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
12147 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
12148 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
12149 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
12150 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
12151 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
12152 install_element (BGP_IPV6M_NODE
, &neighbor_nexthop_self_cmd
);
12153 install_element (BGP_IPV6M_NODE
, &no_neighbor_nexthop_self_cmd
);
12154 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
12155 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
12157 /* "neighbor as-override" commands. */
12158 install_element (BGP_NODE
, &neighbor_as_override_cmd
);
12159 install_element (BGP_NODE
, &no_neighbor_as_override_cmd
);
12160 install_element (BGP_IPV4_NODE
, &neighbor_as_override_cmd
);
12161 install_element (BGP_IPV4_NODE
, &no_neighbor_as_override_cmd
);
12162 install_element (BGP_IPV4M_NODE
, &neighbor_as_override_cmd
);
12163 install_element (BGP_IPV4M_NODE
, &no_neighbor_as_override_cmd
);
12164 install_element (BGP_IPV6_NODE
, &neighbor_as_override_cmd
);
12165 install_element (BGP_IPV6_NODE
, &no_neighbor_as_override_cmd
);
12166 install_element (BGP_IPV6M_NODE
, &neighbor_as_override_cmd
);
12167 install_element (BGP_IPV6M_NODE
, &no_neighbor_as_override_cmd
);
12168 install_element (BGP_VPNV4_NODE
, &neighbor_as_override_cmd
);
12169 install_element (BGP_VPNV4_NODE
, &no_neighbor_as_override_cmd
);
12171 /* "neighbor remove-private-AS" commands. */
12172 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
12173 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
12174 install_element (BGP_NODE
, &neighbor_remove_private_as_all_cmd
);
12175 install_element (BGP_NODE
, &no_neighbor_remove_private_as_all_cmd
);
12176 install_element (BGP_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
12177 install_element (BGP_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
12178 install_element (BGP_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
12179 install_element (BGP_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
12180 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
12181 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
12182 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_all_cmd
);
12183 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_all_cmd
);
12184 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
12185 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
12186 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
12187 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
12188 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
12189 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
12190 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_all_cmd
);
12191 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_all_cmd
);
12192 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
12193 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
12194 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
12195 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
12196 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
12197 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
12198 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_all_cmd
);
12199 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_all_cmd
);
12200 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
12201 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
12202 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
12203 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
12204 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_cmd
);
12205 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_cmd
);
12206 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_all_cmd
);
12207 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_all_cmd
);
12208 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
12209 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
12210 install_element (BGP_IPV6M_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
12211 install_element (BGP_IPV6M_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
12212 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
12213 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
12214 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_all_cmd
);
12215 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_all_cmd
);
12216 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_replace_as_cmd
);
12217 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_replace_as_cmd
);
12218 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_all_replace_as_cmd
);
12219 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_all_replace_as_cmd
);
12221 /* "neighbor send-community" commands.*/
12222 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
12223 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
12224 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
12225 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
12226 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
12227 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
12228 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
12229 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
12230 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
12231 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
12232 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
12233 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
12234 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
12235 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
12236 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
12237 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
12238 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_cmd
);
12239 install_element (BGP_IPV6M_NODE
, &neighbor_send_community_type_cmd
);
12240 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_cmd
);
12241 install_element (BGP_IPV6M_NODE
, &no_neighbor_send_community_type_cmd
);
12242 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
12243 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
12244 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
12245 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
12247 /* "neighbor route-reflector" commands.*/
12248 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
12249 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
12250 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
12251 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
12252 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
12253 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
12254 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
12255 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
12256 install_element (BGP_IPV6M_NODE
, &neighbor_route_reflector_client_cmd
);
12257 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_reflector_client_cmd
);
12258 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
12259 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
12261 /* "neighbor route-server" commands.*/
12262 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
12263 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
12264 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
12265 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
12266 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
12267 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
12268 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
12269 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
12270 install_element (BGP_IPV6M_NODE
, &neighbor_route_server_client_cmd
);
12271 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_server_client_cmd
);
12272 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
12273 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
12275 /* "neighbor passive" commands. */
12276 install_element (BGP_NODE
, &neighbor_passive_cmd
);
12277 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
12279 /* "neighbor bfd" commands. */
12280 install_element (BGP_NODE
, &neighbor_bfd_cmd
);
12281 install_element (BGP_NODE
, &no_neighbor_bfd_cmd
);
12283 /* "neighbor shutdown" commands. */
12284 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
12285 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
12287 /* Deprecated "neighbor capability route-refresh" commands.*/
12288 install_element (BGP_NODE
, &neighbor_capability_route_refresh_cmd
);
12289 install_element (BGP_NODE
, &no_neighbor_capability_route_refresh_cmd
);
12291 /* "neighbor capability extended-nexthop" commands.*/
12292 install_element (BGP_NODE
, &neighbor_capability_enhe_cmd
);
12293 install_element (BGP_NODE
, &no_neighbor_capability_enhe_cmd
);
12295 /* "neighbor capability orf prefix-list" commands.*/
12296 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
12297 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
12298 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
12299 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
12300 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
12301 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
12302 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
12303 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
12304 install_element (BGP_IPV6M_NODE
, &neighbor_capability_orf_prefix_cmd
);
12305 install_element (BGP_IPV6M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
12307 /* "neighbor capability dynamic" commands.*/
12308 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
12309 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
12311 /* "neighbor dont-capability-negotiate" commands. */
12312 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
12313 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
12315 /* "neighbor ebgp-multihop" commands. */
12316 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
12317 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
12318 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
12319 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
12321 /* "neighbor disable-connected-check" commands. */
12322 install_element (BGP_NODE
, &neighbor_disable_connected_check_cmd
);
12323 install_element (BGP_NODE
, &no_neighbor_disable_connected_check_cmd
);
12324 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
12325 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
12327 /* "neighbor description" commands. */
12328 install_element (BGP_NODE
, &neighbor_description_cmd
);
12329 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
12330 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
12332 /* "neighbor update-source" commands. "*/
12333 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
12334 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
12336 /* "neighbor default-originate" commands. */
12337 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
12338 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
12339 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
12340 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
12341 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
12342 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
12343 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
12344 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
12345 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
12346 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
12347 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
12348 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
12349 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
12350 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
12351 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
12352 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
12353 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_cmd
);
12354 install_element (BGP_IPV6M_NODE
, &neighbor_default_originate_rmap_cmd
);
12355 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_cmd
);
12356 install_element (BGP_IPV6M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
12358 /* "neighbor port" commands. */
12359 install_element (BGP_NODE
, &neighbor_port_cmd
);
12360 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
12361 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
12363 /* "neighbor weight" commands. */
12364 install_element (BGP_NODE
, &neighbor_weight_cmd
);
12365 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
12366 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
12368 /* "neighbor override-capability" commands. */
12369 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
12370 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
12372 /* "neighbor strict-capability-match" commands. */
12373 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
12374 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
12376 /* "neighbor timers" commands. */
12377 install_element (BGP_NODE
, &neighbor_timers_cmd
);
12378 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
12380 /* "neighbor timers connect" commands. */
12381 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
12382 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
12383 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
12385 /* "neighbor advertisement-interval" commands. */
12386 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
12387 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
12388 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
12390 /* "neighbor version" commands. */
12391 install_element (BGP_NODE
, &neighbor_version_cmd
);
12393 /* "neighbor interface" commands. */
12394 install_element (BGP_NODE
, &neighbor_interface_cmd
);
12395 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
12397 /* "neighbor distribute" commands. */
12398 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
12399 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
12400 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
12401 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
12402 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
12403 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
12404 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
12405 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
12406 install_element (BGP_IPV6M_NODE
, &neighbor_distribute_list_cmd
);
12407 install_element (BGP_IPV6M_NODE
, &no_neighbor_distribute_list_cmd
);
12408 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
12409 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
12411 /* "neighbor prefix-list" commands. */
12412 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
12413 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
12414 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
12415 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
12416 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
12417 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
12418 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
12419 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
12420 install_element (BGP_IPV6M_NODE
, &neighbor_prefix_list_cmd
);
12421 install_element (BGP_IPV6M_NODE
, &no_neighbor_prefix_list_cmd
);
12422 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
12423 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
12425 /* "neighbor filter-list" commands. */
12426 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
12427 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
12428 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
12429 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
12430 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
12431 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
12432 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
12433 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
12434 install_element (BGP_IPV6M_NODE
, &neighbor_filter_list_cmd
);
12435 install_element (BGP_IPV6M_NODE
, &no_neighbor_filter_list_cmd
);
12436 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
12437 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
12439 /* "neighbor route-map" commands. */
12440 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
12441 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
12442 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
12443 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
12444 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
12445 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
12446 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
12447 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
12448 install_element (BGP_IPV6M_NODE
, &neighbor_route_map_cmd
);
12449 install_element (BGP_IPV6M_NODE
, &no_neighbor_route_map_cmd
);
12450 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
12451 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
12453 /* "neighbor unsuppress-map" commands. */
12454 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
12455 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
12456 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
12457 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
12458 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
12459 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
12460 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
12461 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
12462 install_element (BGP_IPV6M_NODE
, &neighbor_unsuppress_map_cmd
);
12463 install_element (BGP_IPV6M_NODE
, &no_neighbor_unsuppress_map_cmd
);
12464 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
12465 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
12467 /* "neighbor maximum-prefix" commands. */
12468 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
12469 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
12470 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
12471 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
12472 install_element (BGP_NODE
, &neighbor_maximum_prefix_restart_cmd
);
12473 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
12474 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
12475 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
12476 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
12477 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
12478 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
12479 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
12480 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
12481 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
12482 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
12483 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
12484 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
12485 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
12486 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
12487 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
12488 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
12489 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
12490 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
12491 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
12492 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
12493 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
12494 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
12495 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
12496 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
12497 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
12498 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
12499 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
12500 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
12501 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
12502 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
12503 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
12504 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
12505 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
12506 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
12507 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
12508 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
12509 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
12510 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
12511 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_restart_cmd
);
12512 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
12513 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
12514 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
12515 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
12516 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
12517 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
12518 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
12519 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
12520 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_cmd
);
12521 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
12522 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
12523 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
12524 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_restart_cmd
);
12525 install_element (BGP_IPV6M_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
12526 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_cmd
);
12527 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
12528 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
12529 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
12530 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
12531 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
12532 install_element (BGP_IPV6M_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
12533 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
12534 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
12535 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
12536 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
12537 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_restart_cmd
);
12538 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_restart_cmd
);
12539 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
12540 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
12541 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_cmd
);
12542 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_warning_cmd
);
12543 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_warning_cmd
);
12544 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_restart_cmd
);
12545 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_threshold_restart_cmd
);
12547 /* "neighbor allowas-in" */
12548 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
12549 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
12550 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
12551 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
12552 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
12553 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
12554 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
12555 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
12556 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
12557 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
12558 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
12559 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
12560 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_cmd
);
12561 install_element (BGP_IPV6M_NODE
, &neighbor_allowas_in_arg_cmd
);
12562 install_element (BGP_IPV6M_NODE
, &no_neighbor_allowas_in_cmd
);
12563 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
12564 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
12565 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
12567 /* address-family commands. */
12568 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
12569 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
12571 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
12572 install_element (BGP_NODE
, &address_family_ipv6_safi_cmd
);
12573 #endif /* HAVE_IPV6 */
12574 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
12575 install_element (BGP_NODE
, &address_family_vpnv4_unicast_cmd
);
12577 /* "exit-address-family" command. */
12578 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
12579 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
12580 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
12581 install_element (BGP_IPV6M_NODE
, &exit_address_family_cmd
);
12582 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
12584 /* "clear ip bgp commands" */
12585 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
12586 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
12587 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
12588 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
12589 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
12590 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
12592 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
12593 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
12594 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
12595 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
12596 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
12597 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
12598 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
12599 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
12600 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
12601 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
12602 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
12603 #endif /* HAVE_IPV6 */
12605 /* "clear ip bgp neighbor soft in" */
12606 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
12607 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
12608 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
12609 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
12610 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_prefix_filter_cmd
);
12611 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
12612 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
12613 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
12614 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
12615 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
12616 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
12617 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
12618 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
12619 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
12620 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
12621 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
12622 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
12623 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
12624 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
12625 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
12626 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
12627 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
);
12628 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
12629 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
12630 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
12631 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
12632 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
12633 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
12634 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
12635 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
12636 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
12637 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
12638 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
12639 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
12640 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_in_cmd
);
12641 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_in_cmd
);
12642 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_in_cmd
);
12643 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_in_cmd
);
12644 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_in_cmd
);
12645 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_in_cmd
);
12647 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
12648 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
12649 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
12650 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
12651 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
12652 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
12653 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
12654 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
12655 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
12656 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
12657 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
12658 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
12659 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
12660 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
12661 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
12662 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
12663 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
12664 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
12665 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
12666 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
12667 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
12668 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
12669 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
12670 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
12671 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
12672 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
12673 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
12674 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
12675 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
12676 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
12677 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
12678 #endif /* HAVE_IPV6 */
12680 /* clear ip bgp prefix */
12681 install_element (ENABLE_NODE
, &clear_ip_bgp_prefix_cmd
);
12682 install_element (ENABLE_NODE
, &clear_bgp_ipv6_safi_prefix_cmd
);
12684 /* "clear ip bgp neighbor soft out" */
12685 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
12686 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
12687 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
12688 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
12689 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
12690 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
12691 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
12692 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
12693 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
12694 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
12695 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
12696 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
12697 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
12698 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
12699 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
12700 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
12701 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
12702 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
12703 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
12704 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
12705 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
12706 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
12707 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_out_cmd
);
12708 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_out_cmd
);
12709 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_out_cmd
);
12710 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_out_cmd
);
12711 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_out_cmd
);
12712 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_out_cmd
);
12714 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
12715 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
12716 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
12717 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
12718 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
12719 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
12720 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
12721 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
12722 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
12723 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
12724 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
12725 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
12726 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
12727 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
12728 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
12729 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
12730 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
12731 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
12732 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
12733 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
12734 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
12735 #endif /* HAVE_IPV6 */
12737 /* "clear ip bgp neighbor soft" */
12738 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
12739 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
12740 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
12741 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
12742 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
12743 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
12744 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
12745 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
12746 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
12747 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
12748 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
12749 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
12750 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_cmd
);
12751 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_cmd
);
12752 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_cmd
);
12754 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
12755 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
12756 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
12757 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
12758 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
12759 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
12760 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
12761 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
12762 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
12763 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
12764 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
12765 #endif /* HAVE_IPV6 */
12767 /* "clear ip bgp neighbor rsclient" */
12768 install_element (ENABLE_NODE
, &clear_ip_bgp_all_rsclient_cmd
);
12769 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_rsclient_cmd
);
12770 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_rsclient_cmd
);
12771 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_rsclient_cmd
);
12773 install_element (ENABLE_NODE
, &clear_bgp_all_rsclient_cmd
);
12774 install_element (ENABLE_NODE
, &clear_bgp_instance_all_rsclient_cmd
);
12775 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_rsclient_cmd
);
12776 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_all_rsclient_cmd
);
12777 install_element (ENABLE_NODE
, &clear_bgp_peer_rsclient_cmd
);
12778 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_rsclient_cmd
);
12779 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_rsclient_cmd
);
12780 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_peer_rsclient_cmd
);
12781 #endif /* HAVE_IPV6 */
12783 /* "show ip bgp summary" commands. */
12784 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
12785 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_cmd
);
12786 install_element (VIEW_NODE
, &show_bgp_updgrps_cmd
);
12787 install_element (VIEW_NODE
, &show_bgp_ipv6_updgrps_cmd
);
12788 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_s_cmd
);
12789 install_element (VIEW_NODE
, &show_bgp_updgrps_s_cmd
);
12790 install_element (VIEW_NODE
, &show_bgp_ipv6_updgrps_s_cmd
);
12791 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_adj_cmd
);
12792 install_element (VIEW_NODE
, &show_bgp_updgrps_adj_cmd
);
12793 install_element (VIEW_NODE
, &show_bgp_updgrps_afi_adj_cmd
);
12794 install_element (VIEW_NODE
, &show_ip_bgp_updgrps_adj_s_cmd
);
12795 install_element (VIEW_NODE
, &show_bgp_updgrps_adj_s_cmd
);
12796 install_element (VIEW_NODE
, &show_bgp_updgrps_afi_adj_s_cmd
);
12797 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
12798 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
12799 install_element (VIEW_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
12800 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
12801 install_element (VIEW_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
12802 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
12803 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
12805 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
12806 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
12807 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
12808 install_element (VIEW_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
12809 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
12810 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
12811 #endif /* HAVE_IPV6 */
12812 install_element (RESTRICTED_NODE
, &show_ip_bgp_summary_cmd
);
12813 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_cmd
);
12814 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_cmd
);
12815 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_updgrps_cmd
);
12816 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_s_cmd
);
12817 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_s_cmd
);
12818 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_updgrps_s_cmd
);
12819 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_adj_cmd
);
12820 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_adj_cmd
);
12821 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_afi_adj_cmd
);
12822 install_element (RESTRICTED_NODE
, &show_ip_bgp_updgrps_adj_s_cmd
);
12823 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_adj_s_cmd
);
12824 install_element (RESTRICTED_NODE
, &show_bgp_updgrps_afi_adj_s_cmd
);
12825 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_summary_cmd
);
12826 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
12827 install_element (RESTRICTED_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
12828 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
12829 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
12830 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
12831 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
12833 install_element (RESTRICTED_NODE
, &show_bgp_summary_cmd
);
12834 install_element (RESTRICTED_NODE
, &show_bgp_instance_summary_cmd
);
12835 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_summary_cmd
);
12836 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
12837 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
12838 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
12839 #endif /* HAVE_IPV6 */
12840 install_element (ENABLE_NODE
, &show_ip_bgp_summary_cmd
);
12841 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_cmd
);
12842 install_element (ENABLE_NODE
, &show_bgp_updgrps_cmd
);
12843 install_element (ENABLE_NODE
, &show_bgp_ipv6_updgrps_cmd
);
12844 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_s_cmd
);
12845 install_element (ENABLE_NODE
, &show_bgp_updgrps_s_cmd
);
12846 install_element (ENABLE_NODE
, &show_bgp_ipv6_updgrps_s_cmd
);
12847 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_adj_cmd
);
12848 install_element (ENABLE_NODE
, &show_bgp_updgrps_adj_cmd
);
12849 install_element (ENABLE_NODE
, &show_bgp_updgrps_afi_adj_cmd
);
12850 install_element (ENABLE_NODE
, &show_ip_bgp_updgrps_adj_s_cmd
);
12851 install_element (ENABLE_NODE
, &show_bgp_updgrps_adj_s_cmd
);
12852 install_element (ENABLE_NODE
, &show_bgp_updgrps_afi_adj_s_cmd
);
12853 install_element (ENABLE_NODE
, &show_ip_bgp_instance_summary_cmd
);
12854 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
12855 install_element (ENABLE_NODE
, &show_bgp_ipv4_safi_summary_cmd
);
12856 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
12857 install_element (ENABLE_NODE
, &show_bgp_instance_ipv4_safi_summary_cmd
);
12858 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
12859 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
12861 install_element (ENABLE_NODE
, &show_bgp_summary_cmd
);
12862 install_element (ENABLE_NODE
, &show_bgp_instance_summary_cmd
);
12863 install_element (ENABLE_NODE
, &show_bgp_ipv6_summary_cmd
);
12864 install_element (ENABLE_NODE
, &show_bgp_ipv6_safi_summary_cmd
);
12865 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
12866 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_safi_summary_cmd
);
12867 #endif /* HAVE_IPV6 */
12869 /* "show ip bgp neighbors" commands. */
12870 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
12871 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
12872 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
12873 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
12874 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
12875 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
12876 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
12877 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
12878 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
12879 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
12880 install_element (RESTRICTED_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
12881 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
12882 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
12883 install_element (RESTRICTED_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
12884 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
12885 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_cmd
);
12886 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
12887 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
12888 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
12889 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
12890 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
12891 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
12892 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
12893 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
12894 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
12897 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
12898 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
12899 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
12900 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
12901 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
12902 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
12903 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
12904 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
12905 install_element (RESTRICTED_NODE
, &show_bgp_neighbors_peer_cmd
);
12906 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
12907 install_element (RESTRICTED_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
12908 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
12909 install_element (ENABLE_NODE
, &show_bgp_neighbors_cmd
);
12910 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_cmd
);
12911 install_element (ENABLE_NODE
, &show_bgp_neighbors_peer_cmd
);
12912 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
12913 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_cmd
);
12914 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
12915 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
12916 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
12918 /* Old commands. */
12919 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
12920 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
12921 install_element (ENABLE_NODE
, &show_ipv6_bgp_summary_cmd
);
12922 install_element (ENABLE_NODE
, &show_ipv6_mbgp_summary_cmd
);
12923 #endif /* HAVE_IPV6 */
12925 /* "show ip bgp peer-group" commands. */
12926 install_element (VIEW_NODE
, &show_ip_bgp_peer_groups_cmd
);
12927 install_element (VIEW_NODE
, &show_ip_bgp_instance_peer_groups_cmd
);
12928 install_element (VIEW_NODE
, &show_ip_bgp_peer_group_cmd
);
12929 install_element (VIEW_NODE
, &show_ip_bgp_instance_peer_group_cmd
);
12930 install_element (ENABLE_NODE
, &show_ip_bgp_peer_groups_cmd
);
12931 install_element (ENABLE_NODE
, &show_ip_bgp_instance_peer_groups_cmd
);
12932 install_element (ENABLE_NODE
, &show_ip_bgp_peer_group_cmd
);
12933 install_element (ENABLE_NODE
, &show_ip_bgp_instance_peer_group_cmd
);
12935 /* "show ip bgp rsclient" commands. */
12936 install_element (VIEW_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
12937 install_element (VIEW_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
12938 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
12939 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
12940 install_element (VIEW_NODE
, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd
);
12941 install_element (VIEW_NODE
, &show_bgp_ipv4_safi_rsclient_summary_cmd
);
12942 install_element (RESTRICTED_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
12943 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
12944 install_element (RESTRICTED_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
12945 install_element (RESTRICTED_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
12946 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd
);
12947 install_element (RESTRICTED_NODE
, &show_bgp_ipv4_safi_rsclient_summary_cmd
);
12948 install_element (ENABLE_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
12949 install_element (ENABLE_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
12950 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
12951 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
12952 install_element (ENABLE_NODE
, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd
);
12953 install_element (ENABLE_NODE
, &show_bgp_ipv4_safi_rsclient_summary_cmd
);
12956 install_element (VIEW_NODE
, &show_bgp_rsclient_summary_cmd
);
12957 install_element (VIEW_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
12958 install_element (VIEW_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
12959 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
12960 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd
);
12961 install_element (VIEW_NODE
, &show_bgp_ipv6_safi_rsclient_summary_cmd
);
12962 install_element (RESTRICTED_NODE
, &show_bgp_rsclient_summary_cmd
);
12963 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
12964 install_element (RESTRICTED_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
12965 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
12966 install_element (RESTRICTED_NODE
, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd
);
12967 install_element (RESTRICTED_NODE
, &show_bgp_ipv6_safi_rsclient_summary_cmd
);
12968 install_element (ENABLE_NODE
, &show_bgp_rsclient_summary_cmd
);
12969 install_element (ENABLE_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
12970 install_element (ENABLE_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
12971 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
12972 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd
);
12973 install_element (ENABLE_NODE
, &show_bgp_ipv6_safi_rsclient_summary_cmd
);
12974 #endif /* HAVE_IPV6 */
12976 /* "show ip bgp paths" commands. */
12977 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
12978 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
12979 install_element (ENABLE_NODE
, &show_ip_bgp_paths_cmd
);
12980 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
12982 /* "show ip bgp community" commands. */
12983 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
12984 install_element (ENABLE_NODE
, &show_ip_bgp_community_info_cmd
);
12986 /* "show ip bgp attribute-info" commands. */
12987 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
12988 install_element (ENABLE_NODE
, &show_ip_bgp_attr_info_cmd
);
12990 /* "redistribute" commands. */
12991 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
12992 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
12993 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
12994 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
12995 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
12996 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
12997 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
12998 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
12999 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
13000 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
13001 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_cmd
);
13002 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_cmd
);
13003 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_rmap_cmd
);
13004 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_cmd
);
13005 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_metric_cmd
);
13006 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_cmd
);
13007 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
13008 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_rmap_metric_cmd
);
13009 install_element (BGP_NODE
, &bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
13010 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_ospf_metric_rmap_cmd
);
13012 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
13013 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
13014 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
13015 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
13016 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
13017 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
13018 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
13019 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
13020 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
13021 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
13022 #endif /* HAVE_IPV6 */
13024 /* ttl_security commands */
13025 install_element (BGP_NODE
, &neighbor_ttl_security_cmd
);
13026 install_element (BGP_NODE
, &no_neighbor_ttl_security_cmd
);
13028 /* "show bgp memory" commands. */
13029 install_element (VIEW_NODE
, &show_bgp_memory_cmd
);
13030 install_element (RESTRICTED_NODE
, &show_bgp_memory_cmd
);
13031 install_element (ENABLE_NODE
, &show_bgp_memory_cmd
);
13033 /* "show bgp views" commands. */
13034 install_element (VIEW_NODE
, &show_bgp_views_cmd
);
13035 install_element (RESTRICTED_NODE
, &show_bgp_views_cmd
);
13036 install_element (ENABLE_NODE
, &show_bgp_views_cmd
);
13038 /* Community-list. */
13039 community_list_vty ();
13042 #include "memory.h"
13043 #include "bgp_regex.h"
13044 #include "bgp_clist.h"
13045 #include "bgp_ecommunity.h"
13047 /* VTY functions. */
13049 /* Direction value to string conversion. */
13050 static const char *
13051 community_direct_str (int direct
)
13055 case COMMUNITY_DENY
:
13057 case COMMUNITY_PERMIT
:
13064 /* Display error string. */
13066 community_list_perror (struct vty
*vty
, int ret
)
13070 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
13071 vty_out (vty
, "%% Can't find community-list%s", VTY_NEWLINE
);
13073 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
13074 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
13076 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
13077 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
13079 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
13080 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
13085 /* VTY interface for community_set() function. */
13087 community_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
13088 int style
, int reject_all_digit_name
)
13094 /* Check the list type. */
13095 if (strncmp (argv
[1], "p", 1) == 0)
13096 direct
= COMMUNITY_PERMIT
;
13097 else if (strncmp (argv
[1], "d", 1) == 0)
13098 direct
= COMMUNITY_DENY
;
13101 vty_out (vty
, "%% Matching condition must be permit or deny%s",
13103 return CMD_WARNING
;
13106 /* All digit name check. */
13107 if (reject_all_digit_name
&& all_digit (argv
[0]))
13109 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
13110 return CMD_WARNING
;
13113 /* Concat community string argument. */
13115 str
= argv_concat (argv
, argc
, 2);
13119 /* When community_list_set() return nevetive value, it means
13120 malformed community string. */
13121 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
13123 /* Free temporary community list string allocated by
13126 XFREE (MTYPE_TMP
, str
);
13130 /* Display error string. */
13131 community_list_perror (vty
, ret
);
13132 return CMD_WARNING
;
13135 return CMD_SUCCESS
;
13138 /* Communiyt-list entry delete. */
13140 community_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
13149 /* Check the list direct. */
13150 if (strncmp (argv
[1], "p", 1) == 0)
13151 direct
= COMMUNITY_PERMIT
;
13152 else if (strncmp (argv
[1], "d", 1) == 0)
13153 direct
= COMMUNITY_DENY
;
13156 vty_out (vty
, "%% Matching condition must be permit or deny%s",
13158 return CMD_WARNING
;
13161 /* Concat community string argument. */
13162 str
= argv_concat (argv
, argc
, 2);
13165 /* Unset community list. */
13166 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
13168 /* Free temporary community list string allocated by
13171 XFREE (MTYPE_TMP
, str
);
13175 community_list_perror (vty
, ret
);
13176 return CMD_WARNING
;
13179 return CMD_SUCCESS
;
13182 /* "community-list" keyword help string. */
13183 #define COMMUNITY_LIST_STR "Add a community list entry\n"
13184 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
13186 DEFUN (ip_community_list_standard
,
13187 ip_community_list_standard_cmd
,
13188 "ip community-list <1-99> (deny|permit) .AA:NN",
13191 "Community list number (standard)\n"
13192 "Specify community to reject\n"
13193 "Specify community to accept\n"
13196 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
13199 ALIAS (ip_community_list_standard
,
13200 ip_community_list_standard2_cmd
,
13201 "ip community-list <1-99> (deny|permit)",
13204 "Community list number (standard)\n"
13205 "Specify community to reject\n"
13206 "Specify community to accept\n")
13208 DEFUN (ip_community_list_expanded
,
13209 ip_community_list_expanded_cmd
,
13210 "ip community-list <100-500> (deny|permit) .LINE",
13213 "Community list number (expanded)\n"
13214 "Specify community to reject\n"
13215 "Specify community to accept\n"
13216 "An ordered list as a regular-expression\n")
13218 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
13221 DEFUN (ip_community_list_name_standard
,
13222 ip_community_list_name_standard_cmd
,
13223 "ip community-list standard WORD (deny|permit) .AA:NN",
13226 "Add a standard community-list entry\n"
13227 "Community list name\n"
13228 "Specify community to reject\n"
13229 "Specify community to accept\n"
13232 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
13235 ALIAS (ip_community_list_name_standard
,
13236 ip_community_list_name_standard2_cmd
,
13237 "ip community-list standard WORD (deny|permit)",
13240 "Add a standard community-list entry\n"
13241 "Community list name\n"
13242 "Specify community to reject\n"
13243 "Specify community to accept\n")
13245 DEFUN (ip_community_list_name_expanded
,
13246 ip_community_list_name_expanded_cmd
,
13247 "ip community-list expanded WORD (deny|permit) .LINE",
13250 "Add an expanded community-list entry\n"
13251 "Community list name\n"
13252 "Specify community to reject\n"
13253 "Specify community to accept\n"
13254 "An ordered list as a regular-expression\n")
13256 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
13259 DEFUN (no_ip_community_list_standard_all
,
13260 no_ip_community_list_standard_all_cmd
,
13261 "no ip community-list <1-99>",
13265 "Community list number (standard)\n")
13267 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
13270 DEFUN (no_ip_community_list_expanded_all
,
13271 no_ip_community_list_expanded_all_cmd
,
13272 "no ip community-list <100-500>",
13276 "Community list number (expanded)\n")
13278 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
13281 DEFUN (no_ip_community_list_name_standard_all
,
13282 no_ip_community_list_name_standard_all_cmd
,
13283 "no ip community-list standard WORD",
13287 "Add a standard community-list entry\n"
13288 "Community list name\n")
13290 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
13293 DEFUN (no_ip_community_list_name_expanded_all
,
13294 no_ip_community_list_name_expanded_all_cmd
,
13295 "no ip community-list expanded WORD",
13299 "Add an expanded community-list entry\n"
13300 "Community list name\n")
13302 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
13305 DEFUN (no_ip_community_list_standard
,
13306 no_ip_community_list_standard_cmd
,
13307 "no ip community-list <1-99> (deny|permit) .AA:NN",
13311 "Community list number (standard)\n"
13312 "Specify community to reject\n"
13313 "Specify community to accept\n"
13316 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
13319 DEFUN (no_ip_community_list_expanded
,
13320 no_ip_community_list_expanded_cmd
,
13321 "no ip community-list <100-500> (deny|permit) .LINE",
13325 "Community list number (expanded)\n"
13326 "Specify community to reject\n"
13327 "Specify community to accept\n"
13328 "An ordered list as a regular-expression\n")
13330 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
13333 DEFUN (no_ip_community_list_name_standard
,
13334 no_ip_community_list_name_standard_cmd
,
13335 "no ip community-list standard WORD (deny|permit) .AA:NN",
13339 "Specify a standard community-list\n"
13340 "Community list name\n"
13341 "Specify community to reject\n"
13342 "Specify community to accept\n"
13345 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
13348 DEFUN (no_ip_community_list_name_expanded
,
13349 no_ip_community_list_name_expanded_cmd
,
13350 "no ip community-list expanded WORD (deny|permit) .LINE",
13354 "Specify an expanded community-list\n"
13355 "Community list name\n"
13356 "Specify community to reject\n"
13357 "Specify community to accept\n"
13358 "An ordered list as a regular-expression\n")
13360 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
13364 community_list_show (struct vty
*vty
, struct community_list
*list
)
13366 struct community_entry
*entry
;
13368 for (entry
= list
->head
; entry
; entry
= entry
->next
)
13370 if (entry
== list
->head
)
13372 if (all_digit (list
->name
))
13373 vty_out (vty
, "Community %s list %s%s",
13374 entry
->style
== COMMUNITY_LIST_STANDARD
?
13375 "standard" : "(expanded) access",
13376 list
->name
, VTY_NEWLINE
);
13378 vty_out (vty
, "Named Community %s list %s%s",
13379 entry
->style
== COMMUNITY_LIST_STANDARD
?
13380 "standard" : "expanded",
13381 list
->name
, VTY_NEWLINE
);
13384 vty_out (vty
, " %s%s",
13385 community_direct_str (entry
->direct
), VTY_NEWLINE
);
13387 vty_out (vty
, " %s %s%s",
13388 community_direct_str (entry
->direct
),
13389 entry
->style
== COMMUNITY_LIST_STANDARD
13390 ? community_str (entry
->u
.com
) : entry
->config
,
13395 DEFUN (show_ip_community_list
,
13396 show_ip_community_list_cmd
,
13397 "show ip community-list",
13400 "List community-list\n")
13402 struct community_list
*list
;
13403 struct community_list_master
*cm
;
13405 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
13407 return CMD_SUCCESS
;
13409 for (list
= cm
->num
.head
; list
; list
= list
->next
)
13410 community_list_show (vty
, list
);
13412 for (list
= cm
->str
.head
; list
; list
= list
->next
)
13413 community_list_show (vty
, list
);
13415 return CMD_SUCCESS
;
13418 DEFUN (show_ip_community_list_arg
,
13419 show_ip_community_list_arg_cmd
,
13420 "show ip community-list (<1-500>|WORD)",
13423 "List community-list\n"
13424 "Community-list number\n"
13425 "Community-list name\n")
13427 struct community_list
*list
;
13429 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_MASTER
);
13432 vty_out (vty
, "%% Can't find community-list%s", VTY_NEWLINE
);
13433 return CMD_WARNING
;
13436 community_list_show (vty
, list
);
13438 return CMD_SUCCESS
;
13442 extcommunity_list_set_vty (struct vty
*vty
, int argc
, const char **argv
,
13443 int style
, int reject_all_digit_name
)
13449 /* Check the list type. */
13450 if (strncmp (argv
[1], "p", 1) == 0)
13451 direct
= COMMUNITY_PERMIT
;
13452 else if (strncmp (argv
[1], "d", 1) == 0)
13453 direct
= COMMUNITY_DENY
;
13456 vty_out (vty
, "%% Matching condition must be permit or deny%s",
13458 return CMD_WARNING
;
13461 /* All digit name check. */
13462 if (reject_all_digit_name
&& all_digit (argv
[0]))
13464 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
13465 return CMD_WARNING
;
13468 /* Concat community string argument. */
13470 str
= argv_concat (argv
, argc
, 2);
13474 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
13476 /* Free temporary community list string allocated by
13479 XFREE (MTYPE_TMP
, str
);
13483 community_list_perror (vty
, ret
);
13484 return CMD_WARNING
;
13486 return CMD_SUCCESS
;
13490 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, const char **argv
,
13499 /* Check the list direct. */
13500 if (strncmp (argv
[1], "p", 1) == 0)
13501 direct
= COMMUNITY_PERMIT
;
13502 else if (strncmp (argv
[1], "d", 1) == 0)
13503 direct
= COMMUNITY_DENY
;
13506 vty_out (vty
, "%% Matching condition must be permit or deny%s",
13508 return CMD_WARNING
;
13511 /* Concat community string argument. */
13512 str
= argv_concat (argv
, argc
, 2);
13515 /* Unset community list. */
13516 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
13518 /* Free temporary community list string allocated by
13521 XFREE (MTYPE_TMP
, str
);
13525 community_list_perror (vty
, ret
);
13526 return CMD_WARNING
;
13529 return CMD_SUCCESS
;
13532 /* "extcommunity-list" keyword help string. */
13533 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
13534 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
13536 DEFUN (ip_extcommunity_list_standard
,
13537 ip_extcommunity_list_standard_cmd
,
13538 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
13540 EXTCOMMUNITY_LIST_STR
13541 "Extended Community list number (standard)\n"
13542 "Specify community to reject\n"
13543 "Specify community to accept\n"
13544 EXTCOMMUNITY_VAL_STR
)
13546 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
13549 ALIAS (ip_extcommunity_list_standard
,
13550 ip_extcommunity_list_standard2_cmd
,
13551 "ip extcommunity-list <1-99> (deny|permit)",
13553 EXTCOMMUNITY_LIST_STR
13554 "Extended Community list number (standard)\n"
13555 "Specify community to reject\n"
13556 "Specify community to accept\n")
13558 DEFUN (ip_extcommunity_list_expanded
,
13559 ip_extcommunity_list_expanded_cmd
,
13560 "ip extcommunity-list <100-500> (deny|permit) .LINE",
13562 EXTCOMMUNITY_LIST_STR
13563 "Extended Community list number (expanded)\n"
13564 "Specify community to reject\n"
13565 "Specify community to accept\n"
13566 "An ordered list as a regular-expression\n")
13568 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
13571 DEFUN (ip_extcommunity_list_name_standard
,
13572 ip_extcommunity_list_name_standard_cmd
,
13573 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
13575 EXTCOMMUNITY_LIST_STR
13576 "Specify standard extcommunity-list\n"
13577 "Extended Community list name\n"
13578 "Specify community to reject\n"
13579 "Specify community to accept\n"
13580 EXTCOMMUNITY_VAL_STR
)
13582 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
13585 ALIAS (ip_extcommunity_list_name_standard
,
13586 ip_extcommunity_list_name_standard2_cmd
,
13587 "ip extcommunity-list standard WORD (deny|permit)",
13589 EXTCOMMUNITY_LIST_STR
13590 "Specify standard extcommunity-list\n"
13591 "Extended Community list name\n"
13592 "Specify community to reject\n"
13593 "Specify community to accept\n")
13595 DEFUN (ip_extcommunity_list_name_expanded
,
13596 ip_extcommunity_list_name_expanded_cmd
,
13597 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
13599 EXTCOMMUNITY_LIST_STR
13600 "Specify expanded extcommunity-list\n"
13601 "Extended Community list name\n"
13602 "Specify community to reject\n"
13603 "Specify community to accept\n"
13604 "An ordered list as a regular-expression\n")
13606 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
13609 DEFUN (no_ip_extcommunity_list_standard_all
,
13610 no_ip_extcommunity_list_standard_all_cmd
,
13611 "no ip extcommunity-list <1-99>",
13614 EXTCOMMUNITY_LIST_STR
13615 "Extended Community list number (standard)\n")
13617 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
13620 DEFUN (no_ip_extcommunity_list_expanded_all
,
13621 no_ip_extcommunity_list_expanded_all_cmd
,
13622 "no ip extcommunity-list <100-500>",
13625 EXTCOMMUNITY_LIST_STR
13626 "Extended Community list number (expanded)\n")
13628 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
13631 DEFUN (no_ip_extcommunity_list_name_standard_all
,
13632 no_ip_extcommunity_list_name_standard_all_cmd
,
13633 "no ip extcommunity-list standard WORD",
13636 EXTCOMMUNITY_LIST_STR
13637 "Specify standard extcommunity-list\n"
13638 "Extended Community list name\n")
13640 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
13643 DEFUN (no_ip_extcommunity_list_name_expanded_all
,
13644 no_ip_extcommunity_list_name_expanded_all_cmd
,
13645 "no ip extcommunity-list expanded WORD",
13648 EXTCOMMUNITY_LIST_STR
13649 "Specify expanded extcommunity-list\n"
13650 "Extended Community list name\n")
13652 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
13655 DEFUN (no_ip_extcommunity_list_standard
,
13656 no_ip_extcommunity_list_standard_cmd
,
13657 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
13660 EXTCOMMUNITY_LIST_STR
13661 "Extended Community list number (standard)\n"
13662 "Specify community to reject\n"
13663 "Specify community to accept\n"
13664 EXTCOMMUNITY_VAL_STR
)
13666 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
13669 DEFUN (no_ip_extcommunity_list_expanded
,
13670 no_ip_extcommunity_list_expanded_cmd
,
13671 "no ip extcommunity-list <100-500> (deny|permit) .LINE",
13674 EXTCOMMUNITY_LIST_STR
13675 "Extended Community list number (expanded)\n"
13676 "Specify community to reject\n"
13677 "Specify community to accept\n"
13678 "An ordered list as a regular-expression\n")
13680 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
13683 DEFUN (no_ip_extcommunity_list_name_standard
,
13684 no_ip_extcommunity_list_name_standard_cmd
,
13685 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
13688 EXTCOMMUNITY_LIST_STR
13689 "Specify standard extcommunity-list\n"
13690 "Extended Community list name\n"
13691 "Specify community to reject\n"
13692 "Specify community to accept\n"
13693 EXTCOMMUNITY_VAL_STR
)
13695 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
13698 DEFUN (no_ip_extcommunity_list_name_expanded
,
13699 no_ip_extcommunity_list_name_expanded_cmd
,
13700 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
13703 EXTCOMMUNITY_LIST_STR
13704 "Specify expanded extcommunity-list\n"
13705 "Community list name\n"
13706 "Specify community to reject\n"
13707 "Specify community to accept\n"
13708 "An ordered list as a regular-expression\n")
13710 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
13714 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
13716 struct community_entry
*entry
;
13718 for (entry
= list
->head
; entry
; entry
= entry
->next
)
13720 if (entry
== list
->head
)
13722 if (all_digit (list
->name
))
13723 vty_out (vty
, "Extended community %s list %s%s",
13724 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
13725 "standard" : "(expanded) access",
13726 list
->name
, VTY_NEWLINE
);
13728 vty_out (vty
, "Named extended community %s list %s%s",
13729 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
13730 "standard" : "expanded",
13731 list
->name
, VTY_NEWLINE
);
13734 vty_out (vty
, " %s%s",
13735 community_direct_str (entry
->direct
), VTY_NEWLINE
);
13737 vty_out (vty
, " %s %s%s",
13738 community_direct_str (entry
->direct
),
13739 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
13740 entry
->u
.ecom
->str
: entry
->config
,
13745 DEFUN (show_ip_extcommunity_list
,
13746 show_ip_extcommunity_list_cmd
,
13747 "show ip extcommunity-list",
13750 "List extended-community list\n")
13752 struct community_list
*list
;
13753 struct community_list_master
*cm
;
13755 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
13757 return CMD_SUCCESS
;
13759 for (list
= cm
->num
.head
; list
; list
= list
->next
)
13760 extcommunity_list_show (vty
, list
);
13762 for (list
= cm
->str
.head
; list
; list
= list
->next
)
13763 extcommunity_list_show (vty
, list
);
13765 return CMD_SUCCESS
;
13768 DEFUN (show_ip_extcommunity_list_arg
,
13769 show_ip_extcommunity_list_arg_cmd
,
13770 "show ip extcommunity-list (<1-500>|WORD)",
13773 "List extended-community list\n"
13774 "Extcommunity-list number\n"
13775 "Extcommunity-list name\n")
13777 struct community_list
*list
;
13779 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_MASTER
);
13782 vty_out (vty
, "%% Can't find extcommunity-list%s", VTY_NEWLINE
);
13783 return CMD_WARNING
;
13786 extcommunity_list_show (vty
, list
);
13788 return CMD_SUCCESS
;
13791 /* Return configuration string of community-list entry. */
13792 static const char *
13793 community_list_config_str (struct community_entry
*entry
)
13801 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
13802 str
= community_str (entry
->u
.com
);
13804 str
= entry
->config
;
13809 /* Display community-list and extcommunity-list configuration. */
13811 community_list_config_write (struct vty
*vty
)
13813 struct community_list
*list
;
13814 struct community_entry
*entry
;
13815 struct community_list_master
*cm
;
13818 /* Community-list. */
13819 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_MASTER
);
13821 for (list
= cm
->num
.head
; list
; list
= list
->next
)
13822 for (entry
= list
->head
; entry
; entry
= entry
->next
)
13824 vty_out (vty
, "ip community-list %s %s %s%s",
13825 list
->name
, community_direct_str (entry
->direct
),
13826 community_list_config_str (entry
),
13830 for (list
= cm
->str
.head
; list
; list
= list
->next
)
13831 for (entry
= list
->head
; entry
; entry
= entry
->next
)
13833 vty_out (vty
, "ip community-list %s %s %s %s%s",
13834 entry
->style
== COMMUNITY_LIST_STANDARD
13835 ? "standard" : "expanded",
13836 list
->name
, community_direct_str (entry
->direct
),
13837 community_list_config_str (entry
),
13842 /* Extcommunity-list. */
13843 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_MASTER
);
13845 for (list
= cm
->num
.head
; list
; list
= list
->next
)
13846 for (entry
= list
->head
; entry
; entry
= entry
->next
)
13848 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
13849 list
->name
, community_direct_str (entry
->direct
),
13850 community_list_config_str (entry
), VTY_NEWLINE
);
13853 for (list
= cm
->str
.head
; list
; list
= list
->next
)
13854 for (entry
= list
->head
; entry
; entry
= entry
->next
)
13856 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
13857 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
13858 ? "standard" : "expanded",
13859 list
->name
, community_direct_str (entry
->direct
),
13860 community_list_config_str (entry
), VTY_NEWLINE
);
13866 static struct cmd_node community_list_node
=
13868 COMMUNITY_LIST_NODE
,
13870 1 /* Export to vtysh. */
13874 community_list_vty (void)
13876 install_node (&community_list_node
, community_list_config_write
);
13878 /* Community-list. */
13879 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
13880 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
13881 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
13882 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
13883 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
13884 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
13885 install_element (CONFIG_NODE
, &no_ip_community_list_standard_all_cmd
);
13886 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_all_cmd
);
13887 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_all_cmd
);
13888 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_all_cmd
);
13889 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
13890 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
13891 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
13892 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
13893 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
13894 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
13895 install_element (ENABLE_NODE
, &show_ip_community_list_cmd
);
13896 install_element (ENABLE_NODE
, &show_ip_community_list_arg_cmd
);
13898 /* Extcommunity-list. */
13899 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
13900 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
13901 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
13902 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
13903 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
13904 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
13905 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_all_cmd
);
13906 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_all_cmd
);
13907 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_all_cmd
);
13908 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_all_cmd
);
13909 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
13910 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
13911 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
13912 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
13913 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
13914 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);
13915 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_cmd
);
13916 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_arg_cmd
);