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
32 #include "bgpd/bgpd.h"
33 #include "bgpd/bgp_attr.h"
34 #include "bgpd/bgp_aspath.h"
35 #include "bgpd/bgp_community.h"
36 #include "bgpd/bgp_debug.h"
37 #include "bgpd/bgp_fsm.h"
38 #include "bgpd/bgp_mplsvpn.h"
39 #include "bgpd/bgp_open.h"
40 #include "bgpd/bgp_route.h"
41 #include "bgpd/bgp_zebra.h"
42 #include "bgpd/bgp_table.h"
44 extern struct in_addr router_id_zebra
;
46 /* Utility function to get address family from current node. */
48 bgp_node_afi (struct vty
*vty
)
50 if (vty
->node
== BGP_IPV6_NODE
)
55 /* Utility function to get subsequent address family from current
58 bgp_node_safi (struct vty
*vty
)
60 if (vty
->node
== BGP_VPNV4_NODE
)
62 if (vty
->node
== BGP_IPV4M_NODE
)
63 return SAFI_MULTICAST
;
68 peer_address_self_check (union sockunion
*su
)
70 struct interface
*ifp
= NULL
;
72 if (su
->sa
.sa_family
== AF_INET
)
73 ifp
= if_lookup_by_ipv4_exact (&su
->sin
.sin_addr
);
75 else if (su
->sa
.sa_family
== AF_INET6
)
76 ifp
= if_lookup_by_ipv6_exact (&su
->sin6
.sin6_addr
);
77 #endif /* HAVE IPV6 */
85 /* Utility function for looking up peer from VTY. */
87 peer_lookup_vty (struct vty
*vty
, char *ip_str
)
96 ret
= str2sockunion (ip_str
, &su
);
99 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
103 peer
= peer_lookup (bgp
, &su
);
106 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s", VTY_NEWLINE
);
112 /* Utility function for looking up peer or peer group. */
114 peer_and_group_lookup_vty (struct vty
*vty
, char *peer_str
)
120 struct peer_group
*group
;
124 ret
= str2sockunion (peer_str
, &su
);
127 peer
= peer_lookup (bgp
, &su
);
133 group
= peer_group_lookup (bgp
, peer_str
);
138 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
145 bgp_vty_return (struct vty
*vty
, int ret
)
151 case BGP_ERR_INVALID_VALUE
:
152 str
= "Invalid value";
154 case BGP_ERR_INVALID_FLAG
:
155 str
= "Invalid flag";
157 case BGP_ERR_PEER_INACTIVE
:
158 str
= "Activate the neighbor for the address family first";
160 case BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER
:
161 str
= "Invalid command for a peer-group member";
163 case BGP_ERR_PEER_GROUP_SHUTDOWN
:
164 str
= "Peer-group has been shutdown. Activate the peer-group first";
166 case BGP_ERR_PEER_GROUP_HAS_THE_FLAG
:
167 str
= "This peer is a peer-group member. Please change peer-group configuration";
169 case BGP_ERR_PEER_FLAG_CONFLICT
:
170 str
= "Can't set override-capability and strict-capability-match at the same time";
172 case BGP_ERR_PEER_GROUP_MEMBER_EXISTS
:
173 str
= "No activate for peergroup can be given only if peer-group has no members";
175 case BGP_ERR_PEER_BELONGS_TO_GROUP
:
176 str
= "No activate for an individual peer-group member is invalid";
178 case BGP_ERR_PEER_GROUP_AF_UNCONFIGURED
:
179 str
= "Activate the peer-group for the address family first";
181 case BGP_ERR_PEER_GROUP_NO_REMOTE_AS
:
182 str
= "Specify remote-as or peer-group remote AS first";
184 case BGP_ERR_PEER_GROUP_CANT_CHANGE
:
185 str
= "Cannot change the peer-group. Deconfigure first";
187 case BGP_ERR_PEER_GROUP_MISMATCH
:
188 str
= "Cannot have different peer-group for the neighbor";
190 case BGP_ERR_PEER_FILTER_CONFLICT
:
191 str
= "Prefix/distribute list can not co-exist";
193 case BGP_ERR_NOT_INTERNAL_PEER
:
194 str
= "Invalid command. Not an internal neighbor";
196 case BGP_ERR_REMOVE_PRIVATE_AS
:
197 str
= "Private AS cannot be removed for IBGP peers";
199 case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP
:
200 str
= "Local-AS allowed only for EBGP peers";
202 case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS
:
203 str
= "Cannot have local-as same as BGP AS number";
208 vty_out (vty
, "%% %s%s", str
, VTY_NEWLINE
);
214 /* BGP global configuration. */
216 DEFUN (bgp_multiple_instance_func
,
217 bgp_multiple_instance_cmd
,
218 "bgp multiple-instance",
220 "Enable bgp multiple instance\n")
222 bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE
);
226 DEFUN (no_bgp_multiple_instance
,
227 no_bgp_multiple_instance_cmd
,
228 "no bgp multiple-instance",
231 "BGP multiple instance\n")
235 ret
= bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE
);
238 vty_out (vty
, "%% There are more than two BGP instances%s", VTY_NEWLINE
);
244 DEFUN (bgp_config_type
,
246 "bgp config-type (cisco|zebra)",
248 "Configuration type\n"
252 if (strncmp (argv
[0], "c", 1) == 0)
253 bgp_option_set (BGP_OPT_CONFIG_CISCO
);
255 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
260 DEFUN (no_bgp_config_type
,
261 no_bgp_config_type_cmd
,
262 "no bgp config-type",
265 "Display configuration type\n")
267 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
271 DEFUN (no_synchronization
,
272 no_synchronization_cmd
,
273 "no synchronization",
275 "Perform IGP synchronization\n")
280 DEFUN (no_auto_summary
,
284 "Enable automatic network number summarization\n")
289 /* "router bgp" commands. */
292 "router bgp <1-65535>",
302 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, 65535);
307 ret
= bgp_get (&bgp
, &as
, name
);
310 case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET
:
311 vty_out (vty
, "Please specify 'bgp multiple-instance' first%s",
315 case BGP_ERR_AS_MISMATCH
:
316 vty_out (vty
, "BGP is already running; AS is %d%s", as
, VTY_NEWLINE
);
319 case BGP_ERR_INSTANCE_MISMATCH
:
320 vty_out (vty
, "BGP view name and AS number mismatch%s", VTY_NEWLINE
);
321 vty_out (vty
, "BGP instance is already running; AS is %d%s",
327 vty
->node
= BGP_NODE
;
335 "router bgp <1-65535> view WORD",
342 /* "no router bgp" commands. */
343 DEFUN (no_router_bgp
,
345 "no router bgp <1-65535>",
355 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, 65535);
360 /* Lookup bgp structure. */
361 bgp
= bgp_lookup (as
, name
);
364 vty_out (vty
, "%% Can't find BGP instance%s", VTY_NEWLINE
);
373 ALIAS (no_router_bgp
,
374 no_router_bgp_view_cmd
,
375 "no router bgp <1-65535> view WORD",
385 DEFUN (bgp_router_id
,
387 "bgp router-id A.B.C.D",
389 "Override configured router identifier\n"
390 "Manually configured router identifier\n")
398 ret
= inet_aton (argv
[0], &id
);
401 vty_out (vty
, "%% Malformed bgp router identifier%s", VTY_NEWLINE
);
405 bgp
->router_id_static
= id
;
406 bgp_router_id_set (bgp
, &id
);
411 DEFUN (no_bgp_router_id
,
412 no_bgp_router_id_cmd
,
416 "Override configured router identifier\n")
426 ret
= inet_aton (argv
[0], &id
);
429 vty_out (vty
, "%% Malformed BGP router identifier%s", VTY_NEWLINE
);
433 if (! IPV4_ADDR_SAME (&bgp
->router_id_static
, &id
))
435 vty_out (vty
, "%% BGP router-id doesn't match%s", VTY_NEWLINE
);
440 bgp
->router_id_static
.s_addr
= 0;
441 bgp_router_id_set (bgp
, &router_id_zebra
);
446 ALIAS (no_bgp_router_id
,
447 no_bgp_router_id_val_cmd
,
448 "no bgp router-id A.B.C.D",
451 "Override configured router identifier\n"
452 "Manually configured router identifier\n")
454 /* BGP Cluster ID. */
456 DEFUN (bgp_cluster_id
,
458 "bgp cluster-id A.B.C.D",
460 "Configure Route-Reflector Cluster-id\n"
461 "Route-Reflector Cluster-id in IP address format\n")
465 struct in_addr cluster
;
469 ret
= inet_aton (argv
[0], &cluster
);
472 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
476 bgp_cluster_id_set (bgp
, &cluster
);
481 ALIAS (bgp_cluster_id
,
482 bgp_cluster_id32_cmd
,
483 "bgp cluster-id <1-4294967295>",
485 "Configure Route-Reflector Cluster-id\n"
486 "Route-Reflector Cluster-id as 32 bit quantity\n")
488 DEFUN (no_bgp_cluster_id
,
489 no_bgp_cluster_id_cmd
,
493 "Configure Route-Reflector Cluster-id\n")
497 struct in_addr cluster
;
503 ret
= inet_aton (argv
[0], &cluster
);
506 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
511 bgp_cluster_id_unset (bgp
);
516 ALIAS (no_bgp_cluster_id
,
517 no_bgp_cluster_id_arg_cmd
,
518 "no bgp cluster-id A.B.C.D",
521 "Configure Route-Reflector Cluster-id\n"
522 "Route-Reflector Cluster-id in IP address format\n")
524 DEFUN (bgp_confederation_identifier
,
525 bgp_confederation_identifier_cmd
,
526 "bgp confederation identifier <1-65535>",
527 "BGP specific commands\n"
528 "AS confederation parameters\n"
530 "Set routing domain confederation AS\n")
537 VTY_GET_INTEGER ("AS", as
, argv
[0]);
539 bgp_confederation_id_set (bgp
, as
);
544 DEFUN (no_bgp_confederation_identifier
,
545 no_bgp_confederation_identifier_cmd
,
546 "no bgp confederation identifier",
548 "BGP specific commands\n"
549 "AS confederation parameters\n"
558 VTY_GET_INTEGER ("AS", as
, argv
[0]);
560 bgp_confederation_id_unset (bgp
);
565 ALIAS (no_bgp_confederation_identifier
,
566 no_bgp_confederation_identifier_arg_cmd
,
567 "no bgp confederation identifier <1-65535>",
569 "BGP specific commands\n"
570 "AS confederation parameters\n"
572 "Set routing domain confederation AS\n")
574 DEFUN (bgp_confederation_peers
,
575 bgp_confederation_peers_cmd
,
576 "bgp confederation peers .<1-65535>",
577 "BGP specific commands\n"
578 "AS confederation parameters\n"
579 "Peer ASs in BGP confederation\n"
588 for (i
= 0; i
< argc
; i
++)
590 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, 65535);
594 vty_out (vty
, "%% Local member-AS not allowed in confed peer list%s",
599 bgp_confederation_peers_add (bgp
, as
);
604 DEFUN (no_bgp_confederation_peers
,
605 no_bgp_confederation_peers_cmd
,
606 "no bgp confederation peers .<1-65535>",
608 "BGP specific commands\n"
609 "AS confederation parameters\n"
610 "Peer ASs in BGP confederation\n"
619 for (i
= 0; i
< argc
; i
++)
621 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, 65535);
623 bgp_confederation_peers_remove (bgp
, as
);
632 "timers bgp <0-65535> <0-65535>",
633 "Adjust routing timers\n"
635 "Keepalive interval\n"
639 unsigned long keepalive
= 0;
640 unsigned long holdtime
= 0;
644 VTY_GET_INTEGER ("keepalive", keepalive
, argv
[0]);
645 VTY_GET_INTEGER ("holdtime", holdtime
, argv
[1]);
647 /* Holdtime value check. */
648 if (holdtime
< 3 && holdtime
!= 0)
650 vty_out (vty
, "%% hold time value must be either 0 or greater than 3%s",
655 bgp_timers_set (bgp
, keepalive
, holdtime
);
660 DEFUN (no_bgp_timers
,
664 "Adjust routing timers\n"
670 bgp_timers_unset (bgp
);
675 ALIAS (no_bgp_timers
,
676 no_bgp_timers_arg_cmd
,
677 "no timers bgp <0-65535> <0-65535>",
679 "Adjust routing timers\n"
681 "Keepalive interval\n"
684 DEFUN (bgp_client_to_client_reflection
,
685 bgp_client_to_client_reflection_cmd
,
686 "bgp client-to-client reflection",
687 "BGP specific commands\n"
688 "Configure client to client route reflection\n"
689 "reflection of routes allowed\n")
694 bgp_flag_unset (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
698 DEFUN (no_bgp_client_to_client_reflection
,
699 no_bgp_client_to_client_reflection_cmd
,
700 "no bgp client-to-client reflection",
702 "BGP specific commands\n"
703 "Configure client to client route reflection\n"
704 "reflection of routes allowed\n")
709 bgp_flag_set (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
713 /* "bgp always-compare-med" configuration. */
714 DEFUN (bgp_always_compare_med
,
715 bgp_always_compare_med_cmd
,
716 "bgp always-compare-med",
717 "BGP specific commands\n"
718 "Allow comparing MED from different neighbors\n")
723 bgp_flag_set (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
727 DEFUN (no_bgp_always_compare_med
,
728 no_bgp_always_compare_med_cmd
,
729 "no bgp always-compare-med",
731 "BGP specific commands\n"
732 "Allow comparing MED from different neighbors\n")
737 bgp_flag_unset (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
741 /* "bgp deterministic-med" configuration. */
742 DEFUN (bgp_deterministic_med
,
743 bgp_deterministic_med_cmd
,
744 "bgp deterministic-med",
745 "BGP specific commands\n"
746 "Pick the best-MED path among paths advertised from the neighboring AS\n")
751 bgp_flag_set (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
755 DEFUN (no_bgp_deterministic_med
,
756 no_bgp_deterministic_med_cmd
,
757 "no bgp deterministic-med",
759 "BGP specific commands\n"
760 "Pick the best-MED path among paths advertised from the neighboring AS\n")
765 bgp_flag_unset (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
769 /* "bgp graceful-restart" configuration. */
770 DEFUN (bgp_graceful_restart
,
771 bgp_graceful_restart_cmd
,
772 "bgp graceful-restart",
773 "BGP specific commands\n"
774 "Graceful restart capability parameters\n")
779 bgp_flag_set (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
783 DEFUN (no_bgp_graceful_restart
,
784 no_bgp_graceful_restart_cmd
,
785 "no bgp graceful-restart",
787 "BGP specific commands\n"
788 "Graceful restart capability parameters\n")
793 bgp_flag_unset (bgp
, BGP_FLAG_GRACEFUL_RESTART
);
797 /* "bgp fast-external-failover" configuration. */
798 DEFUN (bgp_fast_external_failover
,
799 bgp_fast_external_failover_cmd
,
800 "bgp fast-external-failover",
802 "Immediately reset session if a link to a directly connected external peer goes down\n")
807 bgp_flag_unset (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
811 DEFUN (no_bgp_fast_external_failover
,
812 no_bgp_fast_external_failover_cmd
,
813 "no bgp fast-external-failover",
816 "Immediately reset session if a link to a directly connected external peer goes down\n")
821 bgp_flag_set (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
825 /* "bgp enforce-first-as" configuration. */
826 DEFUN (bgp_enforce_first_as
,
827 bgp_enforce_first_as_cmd
,
828 "bgp enforce-first-as",
830 "Enforce the first AS for EBGP routes\n")
835 bgp_flag_set (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
839 DEFUN (no_bgp_enforce_first_as
,
840 no_bgp_enforce_first_as_cmd
,
841 "no bgp enforce-first-as",
844 "Enforce the first AS for EBGP routes\n")
849 bgp_flag_unset (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
853 /* "bgp bestpath compare-routerid" configuration. */
854 DEFUN (bgp_bestpath_compare_router_id
,
855 bgp_bestpath_compare_router_id_cmd
,
856 "bgp bestpath compare-routerid",
857 "BGP specific commands\n"
858 "Change the default bestpath selection\n"
859 "Compare router-id for identical EBGP paths\n")
864 bgp_flag_set (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
868 DEFUN (no_bgp_bestpath_compare_router_id
,
869 no_bgp_bestpath_compare_router_id_cmd
,
870 "no bgp bestpath compare-routerid",
872 "BGP specific commands\n"
873 "Change the default bestpath selection\n"
874 "Compare router-id for identical EBGP paths\n")
879 bgp_flag_unset (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
883 /* "bgp bestpath as-path ignore" configuration. */
884 DEFUN (bgp_bestpath_aspath_ignore
,
885 bgp_bestpath_aspath_ignore_cmd
,
886 "bgp bestpath as-path ignore",
887 "BGP specific commands\n"
888 "Change the default bestpath selection\n"
889 "AS-path attribute\n"
890 "Ignore as-path length in selecting a route\n")
895 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_IGNORE
);
899 DEFUN (no_bgp_bestpath_aspath_ignore
,
900 no_bgp_bestpath_aspath_ignore_cmd
,
901 "no bgp bestpath as-path ignore",
903 "BGP specific commands\n"
904 "Change the default bestpath selection\n"
905 "AS-path attribute\n"
906 "Ignore as-path length in selecting a route\n")
911 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_IGNORE
);
915 /* "bgp log-neighbor-changes" configuration. */
916 DEFUN (bgp_log_neighbor_changes
,
917 bgp_log_neighbor_changes_cmd
,
918 "bgp log-neighbor-changes",
919 "BGP specific commands\n"
920 "Log neighbor up/down and reset reason\n")
925 bgp_flag_set (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
929 DEFUN (no_bgp_log_neighbor_changes
,
930 no_bgp_log_neighbor_changes_cmd
,
931 "no bgp log-neighbor-changes",
933 "BGP specific commands\n"
934 "Log neighbor up/down and reset reason\n")
939 bgp_flag_unset (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
943 /* "bgp bestpath med" configuration. */
944 DEFUN (bgp_bestpath_med
,
945 bgp_bestpath_med_cmd
,
946 "bgp bestpath med (confed|missing-as-worst)",
947 "BGP specific commands\n"
948 "Change the default bestpath selection\n"
950 "Compare MED among confederation paths\n"
951 "Treat missing MED as the least preferred one\n")
957 if (strncmp (argv
[0], "confed", 1) == 0)
958 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
960 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
965 DEFUN (bgp_bestpath_med2
,
966 bgp_bestpath_med2_cmd
,
967 "bgp bestpath med confed missing-as-worst",
968 "BGP specific commands\n"
969 "Change the default bestpath selection\n"
971 "Compare MED among confederation paths\n"
972 "Treat missing MED as the least preferred one\n")
977 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
978 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
982 ALIAS (bgp_bestpath_med2
,
983 bgp_bestpath_med3_cmd
,
984 "bgp bestpath med missing-as-worst confed",
985 "BGP specific commands\n"
986 "Change the default bestpath selection\n"
988 "Treat missing MED as the least preferred one\n"
989 "Compare MED among confederation paths\n")
991 DEFUN (no_bgp_bestpath_med
,
992 no_bgp_bestpath_med_cmd
,
993 "no bgp bestpath med (confed|missing-as-worst)",
995 "BGP specific commands\n"
996 "Change the default bestpath selection\n"
998 "Compare MED among confederation paths\n"
999 "Treat missing MED as the least preferred one\n")
1005 if (strncmp (argv
[0], "confed", 1) == 0)
1006 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
1008 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1013 DEFUN (no_bgp_bestpath_med2
,
1014 no_bgp_bestpath_med2_cmd
,
1015 "no bgp bestpath med confed missing-as-worst",
1017 "BGP specific commands\n"
1018 "Change the default bestpath selection\n"
1020 "Compare MED among confederation paths\n"
1021 "Treat missing MED as the least preferred one\n")
1026 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
1027 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
1031 ALIAS (no_bgp_bestpath_med2
,
1032 no_bgp_bestpath_med3_cmd
,
1033 "no bgp bestpath med missing-as-worst confed",
1035 "BGP specific commands\n"
1036 "Change the default bestpath selection\n"
1038 "Treat missing MED as the least preferred one\n"
1039 "Compare MED among confederation paths\n")
1041 /* "no bgp default ipv4-unicast". */
1042 DEFUN (no_bgp_default_ipv4_unicast
,
1043 no_bgp_default_ipv4_unicast_cmd
,
1044 "no bgp default ipv4-unicast",
1046 "BGP specific commands\n"
1047 "Configure BGP defaults\n"
1048 "Activate ipv4-unicast for a peer by default\n")
1053 bgp_flag_set (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1057 DEFUN (bgp_default_ipv4_unicast
,
1058 bgp_default_ipv4_unicast_cmd
,
1059 "bgp default ipv4-unicast",
1060 "BGP specific commands\n"
1061 "Configure BGP defaults\n"
1062 "Activate ipv4-unicast for a peer by default\n")
1067 bgp_flag_unset (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1071 /* "bgp import-check" configuration. */
1072 DEFUN (bgp_network_import_check
,
1073 bgp_network_import_check_cmd
,
1074 "bgp network import-check",
1075 "BGP specific commands\n"
1076 "BGP network command\n"
1077 "Check BGP network route exists in IGP\n")
1082 bgp_flag_set (bgp
, BGP_FLAG_IMPORT_CHECK
);
1086 DEFUN (no_bgp_network_import_check
,
1087 no_bgp_network_import_check_cmd
,
1088 "no bgp network import-check",
1090 "BGP specific commands\n"
1091 "BGP network command\n"
1092 "Check BGP network route exists in IGP\n")
1097 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK
);
1101 DEFUN (bgp_default_local_preference
,
1102 bgp_default_local_preference_cmd
,
1103 "bgp default local-preference <0-4294967295>",
1104 "BGP specific commands\n"
1105 "Configure BGP defaults\n"
1106 "local preference (higher=more preferred)\n"
1107 "Configure default local preference value\n")
1110 u_int32_t local_pref
;
1114 VTY_GET_INTEGER ("local preference", local_pref
, argv
[0]);
1116 bgp_default_local_preference_set (bgp
, local_pref
);
1121 DEFUN (no_bgp_default_local_preference
,
1122 no_bgp_default_local_preference_cmd
,
1123 "no bgp default local-preference",
1125 "BGP specific commands\n"
1126 "Configure BGP defaults\n"
1127 "local preference (higher=more preferred)\n")
1132 bgp_default_local_preference_unset (bgp
);
1136 ALIAS (no_bgp_default_local_preference
,
1137 no_bgp_default_local_preference_val_cmd
,
1138 "no bgp default local-preference <0-4294967295>",
1140 "BGP specific commands\n"
1141 "Configure BGP defaults\n"
1142 "local preference (higher=more preferred)\n"
1143 "Configure default local preference value\n")
1146 peer_remote_as_vty (struct vty
*vty
, char *peer_str
, char *as_str
, afi_t afi
,
1156 /* Get AS number. */
1157 VTY_GET_INTEGER_RANGE ("AS", as
, as_str
, 1, 65535);
1159 /* If peer is peer group, call proper function. */
1160 ret
= str2sockunion (peer_str
, &su
);
1163 ret
= peer_group_remote_as (bgp
, peer_str
, &as
);
1166 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1172 if (peer_address_self_check (&su
))
1174 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1179 ret
= peer_remote_as (bgp
, &su
, &as
, afi
, safi
);
1181 /* This peer belongs to peer group. */
1184 case BGP_ERR_PEER_GROUP_MEMBER
:
1185 vty_out (vty
, "%% Peer-group AS %d. Cannot configure remote-as for member%s", as
, VTY_NEWLINE
);
1188 case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
:
1189 vty_out (vty
, "%% The AS# can not be changed from %d to %s, peer-group members must be all internal or all external%s", as
, as_str
, VTY_NEWLINE
);
1193 return bgp_vty_return (vty
, ret
);
1196 DEFUN (neighbor_remote_as
,
1197 neighbor_remote_as_cmd
,
1198 NEIGHBOR_CMD2
"remote-as <1-65535>",
1201 "Specify a BGP neighbor\n"
1204 return peer_remote_as_vty (vty
, argv
[0], argv
[1], AFI_IP
, SAFI_UNICAST
);
1207 DEFUN (neighbor_peer_group
,
1208 neighbor_peer_group_cmd
,
1209 "neighbor WORD peer-group",
1212 "Configure peer-group\n")
1215 struct peer_group
*group
;
1219 group
= peer_group_get (bgp
, argv
[0]);
1235 struct peer_group
*group
;
1238 ret
= str2sockunion (argv
[0], &su
);
1241 group
= peer_group_lookup (vty
->index
, argv
[0]);
1243 peer_group_delete (group
);
1246 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1252 peer
= peer_lookup (vty
->index
, &su
);
1261 no_neighbor_remote_as_cmd
,
1262 NO_NEIGHBOR_CMD
"remote-as <1-65535>",
1266 "Specify a BGP neighbor\n"
1269 DEFUN (no_neighbor_peer_group
,
1270 no_neighbor_peer_group_cmd
,
1271 "no neighbor WORD peer-group",
1275 "Configure peer-group\n")
1277 struct peer_group
*group
;
1279 group
= peer_group_lookup (vty
->index
, argv
[0]);
1281 peer_group_delete (group
);
1284 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1290 DEFUN (no_neighbor_peer_group_remote_as
,
1291 no_neighbor_peer_group_remote_as_cmd
,
1292 "no neighbor WORD remote-as <1-65535>",
1296 "Specify a BGP neighbor\n"
1299 struct peer_group
*group
;
1301 group
= peer_group_lookup (vty
->index
, argv
[0]);
1303 peer_group_remote_as_delete (group
);
1306 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1312 DEFUN (neighbor_local_as
,
1313 neighbor_local_as_cmd
,
1314 NEIGHBOR_CMD2
"local-as <1-65535>",
1317 "Specify a local-as number\n"
1318 "AS number used as local AS\n")
1323 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1327 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 0);
1328 return bgp_vty_return (vty
, ret
);
1331 DEFUN (neighbor_local_as_no_prepend
,
1332 neighbor_local_as_no_prepend_cmd
,
1333 NEIGHBOR_CMD2
"local-as <1-65535> no-prepend",
1336 "Specify a local-as number\n"
1337 "AS number used as local AS\n"
1338 "Do not prepend local-as to updates from ebgp peers\n")
1343 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1347 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1);
1348 return bgp_vty_return (vty
, ret
);
1351 DEFUN (no_neighbor_local_as
,
1352 no_neighbor_local_as_cmd
,
1353 NO_NEIGHBOR_CMD2
"local-as",
1357 "Specify a local-as number\n")
1362 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1366 ret
= peer_local_as_unset (peer
);
1367 return bgp_vty_return (vty
, ret
);
1370 ALIAS (no_neighbor_local_as
,
1371 no_neighbor_local_as_val_cmd
,
1372 NO_NEIGHBOR_CMD2
"local-as <1-65535>",
1376 "Specify a local-as number\n"
1377 "AS number used as local AS\n")
1379 ALIAS (no_neighbor_local_as
,
1380 no_neighbor_local_as_val2_cmd
,
1381 NO_NEIGHBOR_CMD2
"local-as <1-65535> no-prepend",
1385 "Specify a local-as number\n"
1386 "AS number used as local AS\n"
1387 "Do not prepend local-as to updates from ebgp peers\n")
1389 DEFUN (neighbor_activate
,
1390 neighbor_activate_cmd
,
1391 NEIGHBOR_CMD2
"activate",
1394 "Enable the Address Family for this Neighbor\n")
1398 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1402 peer_activate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
1407 DEFUN (no_neighbor_activate
,
1408 no_neighbor_activate_cmd
,
1409 NO_NEIGHBOR_CMD2
"activate",
1413 "Enable the Address Family for this Neighbor\n")
1419 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1423 ret
= peer_deactivate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
1425 return bgp_vty_return (vty
, ret
);
1428 DEFUN (neighbor_set_peer_group
,
1429 neighbor_set_peer_group_cmd
,
1430 NEIGHBOR_CMD
"peer-group WORD",
1433 "Member of the peer-group\n"
1434 "peer-group name\n")
1440 struct peer_group
*group
;
1444 ret
= str2sockunion (argv
[0], &su
);
1447 vty_out (vty
, "%% Malformed address: %s%s", argv
[0], VTY_NEWLINE
);
1451 group
= peer_group_lookup (bgp
, argv
[1]);
1454 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
1458 if (peer_address_self_check (&su
))
1460 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1465 ret
= peer_group_bind (bgp
, &su
, group
, bgp_node_afi (vty
),
1466 bgp_node_safi (vty
), &as
);
1468 if (ret
== BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
)
1470 vty_out (vty
, "%% Peer with AS %d cannot be in this peer-group, members must be all internal or all external%s", as
, VTY_NEWLINE
);
1474 return bgp_vty_return (vty
, ret
);
1477 DEFUN (no_neighbor_set_peer_group
,
1478 no_neighbor_set_peer_group_cmd
,
1479 NO_NEIGHBOR_CMD
"peer-group WORD",
1483 "Member of the peer-group\n"
1484 "peer-group name\n")
1489 struct peer_group
*group
;
1493 peer
= peer_lookup_vty (vty
, argv
[0]);
1497 group
= peer_group_lookup (bgp
, argv
[1]);
1500 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
1504 ret
= peer_group_unbind (bgp
, peer
, group
, bgp_node_afi (vty
),
1505 bgp_node_safi (vty
));
1507 return bgp_vty_return (vty
, ret
);
1511 peer_flag_modify_vty (struct vty
*vty
, char *ip_str
, u_int16_t flag
, int set
)
1516 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
1521 ret
= peer_flag_set (peer
, flag
);
1523 ret
= peer_flag_unset (peer
, flag
);
1525 return bgp_vty_return (vty
, ret
);
1529 peer_flag_set_vty (struct vty
*vty
, char *ip_str
, u_int16_t flag
)
1531 return peer_flag_modify_vty (vty
, ip_str
, flag
, 1);
1535 peer_flag_unset_vty (struct vty
*vty
, char *ip_str
, u_int16_t flag
)
1537 return peer_flag_modify_vty (vty
, ip_str
, flag
, 0);
1540 /* neighbor passive. */
1541 DEFUN (neighbor_passive
,
1542 neighbor_passive_cmd
,
1543 NEIGHBOR_CMD2
"passive",
1546 "Don't send open messages to this neighbor\n")
1548 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
1551 DEFUN (no_neighbor_passive
,
1552 no_neighbor_passive_cmd
,
1553 NO_NEIGHBOR_CMD2
"passive",
1557 "Don't send open messages to this neighbor\n")
1559 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
1562 /* neighbor shutdown. */
1563 DEFUN (neighbor_shutdown
,
1564 neighbor_shutdown_cmd
,
1565 NEIGHBOR_CMD2
"shutdown",
1568 "Administratively shut down this neighbor\n")
1570 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
1573 DEFUN (no_neighbor_shutdown
,
1574 no_neighbor_shutdown_cmd
,
1575 NO_NEIGHBOR_CMD2
"shutdown",
1579 "Administratively shut down this neighbor\n")
1581 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
1584 /* neighbor capability route-refresh. */
1585 DEFUN (neighbor_capability_route_refresh
,
1586 neighbor_capability_route_refresh_cmd
,
1587 NEIGHBOR_CMD2
"capability route-refresh",
1590 "Advertise capability to the peer\n"
1591 "Advertise route-refresh capability to this neighbor\n")
1593 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_NO_ROUTE_REFRESH_CAP
);
1596 DEFUN (no_neighbor_capability_route_refresh
,
1597 no_neighbor_capability_route_refresh_cmd
,
1598 NO_NEIGHBOR_CMD2
"capability route-refresh",
1602 "Advertise capability to the peer\n"
1603 "Advertise route-refresh capability to this neighbor\n")
1605 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_NO_ROUTE_REFRESH_CAP
);
1608 /* neighbor capability dynamic. */
1609 DEFUN (neighbor_capability_dynamic
,
1610 neighbor_capability_dynamic_cmd
,
1611 NEIGHBOR_CMD2
"capability dynamic",
1614 "Advertise capability to the peer\n"
1615 "Advertise dynamic capability to this neighbor\n")
1617 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
1620 DEFUN (no_neighbor_capability_dynamic
,
1621 no_neighbor_capability_dynamic_cmd
,
1622 NO_NEIGHBOR_CMD2
"capability dynamic",
1626 "Advertise capability to the peer\n"
1627 "Advertise dynamic capability to this neighbor\n")
1629 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
1632 /* neighbor dont-capability-negotiate */
1633 DEFUN (neighbor_dont_capability_negotiate
,
1634 neighbor_dont_capability_negotiate_cmd
,
1635 NEIGHBOR_CMD2
"dont-capability-negotiate",
1638 "Do not perform capability negotiation\n")
1640 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
1643 DEFUN (no_neighbor_dont_capability_negotiate
,
1644 no_neighbor_dont_capability_negotiate_cmd
,
1645 NO_NEIGHBOR_CMD2
"dont-capability-negotiate",
1649 "Do not perform capability negotiation\n")
1651 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
1655 peer_af_flag_modify_vty (struct vty
*vty
, char *peer_str
, afi_t afi
,
1656 safi_t safi
, u_int32_t flag
, int set
)
1661 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
1666 ret
= peer_af_flag_set (peer
, afi
, safi
, flag
);
1668 ret
= peer_af_flag_unset (peer
, afi
, safi
, flag
);
1670 return bgp_vty_return (vty
, ret
);
1674 peer_af_flag_set_vty (struct vty
*vty
, char *peer_str
, afi_t afi
,
1675 safi_t safi
, u_int32_t flag
)
1677 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 1);
1681 peer_af_flag_unset_vty (struct vty
*vty
, char *peer_str
, afi_t afi
,
1682 safi_t safi
, u_int32_t flag
)
1684 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 0);
1687 /* neighbor capability orf prefix-list. */
1688 DEFUN (neighbor_capability_orf_prefix
,
1689 neighbor_capability_orf_prefix_cmd
,
1690 NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
1693 "Advertise capability to the peer\n"
1694 "Advertise ORF capability to the peer\n"
1695 "Advertise prefixlist ORF capability to this neighbor\n"
1696 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
1697 "Capability to RECEIVE the ORF from this neighbor\n"
1698 "Capability to SEND the ORF to this neighbor\n")
1702 if (strncmp (argv
[1], "s", 1) == 0)
1703 flag
= PEER_FLAG_ORF_PREFIX_SM
;
1704 else if (strncmp (argv
[1], "r", 1) == 0)
1705 flag
= PEER_FLAG_ORF_PREFIX_RM
;
1706 else if (strncmp (argv
[1], "b", 1) == 0)
1707 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
1711 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1712 bgp_node_safi (vty
), flag
);
1715 DEFUN (no_neighbor_capability_orf_prefix
,
1716 no_neighbor_capability_orf_prefix_cmd
,
1717 NO_NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
1721 "Advertise capability to the peer\n"
1722 "Advertise ORF capability to the peer\n"
1723 "Advertise prefixlist ORF capability to this neighbor\n"
1724 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
1725 "Capability to RECEIVE the ORF from this neighbor\n"
1726 "Capability to SEND the ORF to this neighbor\n")
1730 if (strncmp (argv
[1], "s", 1) == 0)
1731 flag
= PEER_FLAG_ORF_PREFIX_SM
;
1732 else if (strncmp (argv
[1], "r", 1) == 0)
1733 flag
= PEER_FLAG_ORF_PREFIX_RM
;
1734 else if (strncmp (argv
[1], "b", 1) == 0)
1735 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
1739 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1740 bgp_node_safi (vty
), flag
);
1743 /* neighbor next-hop-self. */
1744 DEFUN (neighbor_nexthop_self
,
1745 neighbor_nexthop_self_cmd
,
1746 NEIGHBOR_CMD2
"next-hop-self",
1749 "Disable the next hop calculation for this neighbor\n")
1751 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1752 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
1755 DEFUN (no_neighbor_nexthop_self
,
1756 no_neighbor_nexthop_self_cmd
,
1757 NO_NEIGHBOR_CMD2
"next-hop-self",
1761 "Disable the next hop calculation for this neighbor\n")
1763 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1764 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
1767 /* neighbor remove-private-AS. */
1768 DEFUN (neighbor_remove_private_as
,
1769 neighbor_remove_private_as_cmd
,
1770 NEIGHBOR_CMD2
"remove-private-AS",
1773 "Remove private AS number from outbound updates\n")
1775 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1776 bgp_node_safi (vty
),
1777 PEER_FLAG_REMOVE_PRIVATE_AS
);
1780 DEFUN (no_neighbor_remove_private_as
,
1781 no_neighbor_remove_private_as_cmd
,
1782 NO_NEIGHBOR_CMD2
"remove-private-AS",
1786 "Remove private AS number from outbound updates\n")
1788 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1789 bgp_node_safi (vty
),
1790 PEER_FLAG_REMOVE_PRIVATE_AS
);
1793 /* neighbor send-community. */
1794 DEFUN (neighbor_send_community
,
1795 neighbor_send_community_cmd
,
1796 NEIGHBOR_CMD2
"send-community",
1799 "Send Community attribute to this neighbor\n")
1801 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1802 bgp_node_safi (vty
),
1803 PEER_FLAG_SEND_COMMUNITY
);
1806 DEFUN (no_neighbor_send_community
,
1807 no_neighbor_send_community_cmd
,
1808 NO_NEIGHBOR_CMD2
"send-community",
1812 "Send Community attribute to this neighbor\n")
1814 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1815 bgp_node_safi (vty
),
1816 PEER_FLAG_SEND_COMMUNITY
);
1819 /* neighbor send-community extended. */
1820 DEFUN (neighbor_send_community_type
,
1821 neighbor_send_community_type_cmd
,
1822 NEIGHBOR_CMD2
"send-community (both|extended|standard)",
1825 "Send Community attribute to this neighbor\n"
1826 "Send Standard and Extended Community attributes\n"
1827 "Send Extended Community attributes\n"
1828 "Send Standard Community attributes\n")
1830 if (strncmp (argv
[1], "s", 1) == 0)
1831 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1832 bgp_node_safi (vty
),
1833 PEER_FLAG_SEND_COMMUNITY
);
1834 if (strncmp (argv
[1], "e", 1) == 0)
1835 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1836 bgp_node_safi (vty
),
1837 PEER_FLAG_SEND_EXT_COMMUNITY
);
1839 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1840 bgp_node_safi (vty
),
1841 (PEER_FLAG_SEND_COMMUNITY
|
1842 PEER_FLAG_SEND_EXT_COMMUNITY
));
1845 DEFUN (no_neighbor_send_community_type
,
1846 no_neighbor_send_community_type_cmd
,
1847 NO_NEIGHBOR_CMD2
"send-community (both|extended|standard)",
1851 "Send Community attribute to this neighbor\n"
1852 "Send Standard and Extended Community attributes\n"
1853 "Send Extended Community attributes\n"
1854 "Send Standard Community attributes\n")
1856 if (strncmp (argv
[1], "s", 1) == 0)
1857 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1858 bgp_node_safi (vty
),
1859 PEER_FLAG_SEND_COMMUNITY
);
1860 if (strncmp (argv
[1], "e", 1) == 0)
1861 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1862 bgp_node_safi (vty
),
1863 PEER_FLAG_SEND_EXT_COMMUNITY
);
1865 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1866 bgp_node_safi (vty
),
1867 (PEER_FLAG_SEND_COMMUNITY
|
1868 PEER_FLAG_SEND_EXT_COMMUNITY
));
1871 /* neighbor soft-reconfig. */
1872 DEFUN (neighbor_soft_reconfiguration
,
1873 neighbor_soft_reconfiguration_cmd
,
1874 NEIGHBOR_CMD2
"soft-reconfiguration inbound",
1877 "Per neighbor soft reconfiguration\n"
1878 "Allow inbound soft reconfiguration for this neighbor\n")
1880 return peer_af_flag_set_vty (vty
, argv
[0],
1881 bgp_node_afi (vty
), bgp_node_safi (vty
),
1882 PEER_FLAG_SOFT_RECONFIG
);
1885 DEFUN (no_neighbor_soft_reconfiguration
,
1886 no_neighbor_soft_reconfiguration_cmd
,
1887 NO_NEIGHBOR_CMD2
"soft-reconfiguration inbound",
1891 "Per neighbor soft reconfiguration\n"
1892 "Allow inbound soft reconfiguration for this neighbor\n")
1894 return peer_af_flag_unset_vty (vty
, argv
[0],
1895 bgp_node_afi (vty
), bgp_node_safi (vty
),
1896 PEER_FLAG_SOFT_RECONFIG
);
1899 DEFUN (neighbor_route_reflector_client
,
1900 neighbor_route_reflector_client_cmd
,
1901 NEIGHBOR_CMD2
"route-reflector-client",
1904 "Configure a neighbor as Route Reflector client\n")
1909 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1913 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1914 bgp_node_safi (vty
),
1915 PEER_FLAG_REFLECTOR_CLIENT
);
1918 DEFUN (no_neighbor_route_reflector_client
,
1919 no_neighbor_route_reflector_client_cmd
,
1920 NO_NEIGHBOR_CMD2
"route-reflector-client",
1924 "Configure a neighbor as Route Reflector client\n")
1926 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1927 bgp_node_safi (vty
),
1928 PEER_FLAG_REFLECTOR_CLIENT
);
1932 peer_rsclient_set_vty (struct vty
*vty
, char *peer_str
, int afi
, int safi
)
1937 struct peer_group
*group
;
1938 struct listnode
*nn
;
1939 struct bgp_filter
*pfilter
;
1940 struct bgp_filter
*gfilter
;
1944 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
1948 /* If it is already a RS-Client, don't do anything. */
1949 if ( CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
1952 if ( ! peer_rsclient_active (peer
) )
1953 listnode_add_sort (bgp
->rsclient
, peer
);
1955 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
1957 return bgp_vty_return (vty
, ret
);
1959 peer
->rib
[afi
][safi
] = bgp_table_init ();
1960 peer
->rib
[afi
][safi
]->type
= BGP_TABLE_RSCLIENT
;
1961 peer
->rib
[afi
][safi
]->owner
= peer
;
1963 /* Check for existing 'network' and 'redistribute' routes. */
1964 bgp_check_local_routes_rsclient (peer
, afi
, safi
);
1966 /* Check for routes for peers configured with 'soft-reconfiguration'. */
1967 bgp_soft_reconfig_rsclient (peer
, afi
, safi
);
1969 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
1971 group
= peer
->group
;
1972 gfilter
= &peer
->filter
[afi
][safi
];
1974 LIST_LOOP(group
->peer
, peer
, nn
)
1976 pfilter
= &peer
->filter
[afi
][safi
];
1978 /* Members of a non-RS-Client group should not be RS-Clients, as that
1979 is checked when the become part of the peer-group */
1980 ret
= peer_af_flag_set (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
1982 return bgp_vty_return (vty
, ret
);
1984 /* Make peer's RIB point to group's RIB. */
1985 peer
->rib
[afi
][safi
] = group
->conf
->rib
[afi
][safi
];
1987 /* Import policy. */
1988 if (pfilter
->map
[RMAP_IMPORT
].name
)
1989 free (pfilter
->map
[RMAP_IMPORT
].name
);
1990 if (gfilter
->map
[RMAP_IMPORT
].name
)
1992 pfilter
->map
[RMAP_IMPORT
].name
= strdup (gfilter
->map
[RMAP_IMPORT
].name
);
1993 pfilter
->map
[RMAP_IMPORT
].map
= gfilter
->map
[RMAP_IMPORT
].map
;
1997 pfilter
->map
[RMAP_IMPORT
].name
= NULL
;
1998 pfilter
->map
[RMAP_IMPORT
].map
=NULL
;
2001 /* Export policy. */
2002 if (gfilter
->map
[RMAP_EXPORT
].name
&& ! pfilter
->map
[RMAP_EXPORT
].name
)
2004 pfilter
->map
[RMAP_EXPORT
].name
= strdup (gfilter
->map
[RMAP_EXPORT
].name
);
2005 pfilter
->map
[RMAP_EXPORT
].map
= gfilter
->map
[RMAP_EXPORT
].map
;
2013 peer_rsclient_unset_vty (struct vty
*vty
, char *peer_str
, int afi
, int safi
)
2018 struct peer_group
*group
;
2019 struct listnode
*nn
;
2023 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2027 /* If it is not a RS-Client, don't do anything. */
2028 if ( ! CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
) )
2031 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
))
2033 group
= peer
->group
;
2035 LIST_LOOP (group
->peer
, peer
, nn
)
2037 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2039 return bgp_vty_return (vty
, ret
);
2041 peer
->rib
[afi
][safi
] = NULL
;
2047 ret
= peer_af_flag_unset (peer
, afi
, safi
, PEER_FLAG_RSERVER_CLIENT
);
2049 return bgp_vty_return (vty
, ret
);
2051 if ( ! peer_rsclient_active (peer
) )
2052 listnode_delete (bgp
->rsclient
, peer
);
2054 bgp_table_finish (peer
->rib
[bgp_node_afi(vty
)][bgp_node_safi(vty
)]);
2059 /* neighbor route-server-client. */
2060 DEFUN (neighbor_route_server_client
,
2061 neighbor_route_server_client_cmd
,
2062 NEIGHBOR_CMD2
"route-server-client",
2065 "Configure a neighbor as Route Server client\n")
2067 return peer_rsclient_set_vty (vty
, argv
[0], bgp_node_afi(vty
),
2068 bgp_node_safi(vty
));
2071 DEFUN (no_neighbor_route_server_client
,
2072 no_neighbor_route_server_client_cmd
,
2073 NO_NEIGHBOR_CMD2
"route-server-client",
2077 "Configure a neighbor as Route Server client\n")
2079 return peer_rsclient_unset_vty (vty
, argv
[0], bgp_node_afi(vty
),
2080 bgp_node_safi(vty
));
2083 DEFUN (neighbor_nexthop_local_unchanged
,
2084 neighbor_nexthop_local_unchanged_cmd
,
2085 NEIGHBOR_CMD2
"nexthop-local unchanged",
2088 "Configure treatment of outgoing link-local nexthop attribute\n"
2089 "Leave link-local nexthop unchanged for this peer\n")
2091 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2092 bgp_node_safi (vty
),
2093 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
2096 DEFUN (no_neighbor_nexthop_local_unchanged
,
2097 no_neighbor_nexthop_local_unchanged_cmd
,
2098 NO_NEIGHBOR_CMD2
"nexthop-local unchanged",
2102 "Configure treatment of outgoing link-local-nexthop attribute\n"
2103 "Leave link-local nexthop unchanged for this peer\n")
2105 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2106 bgp_node_safi (vty
),
2107 PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED
);
2110 DEFUN (neighbor_attr_unchanged
,
2111 neighbor_attr_unchanged_cmd
,
2112 NEIGHBOR_CMD2
"attribute-unchanged",
2115 "BGP attribute is propagated unchanged to this neighbor\n")
2117 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2118 bgp_node_safi (vty
),
2119 (PEER_FLAG_AS_PATH_UNCHANGED
|
2120 PEER_FLAG_NEXTHOP_UNCHANGED
|
2121 PEER_FLAG_MED_UNCHANGED
));
2124 DEFUN (neighbor_attr_unchanged1
,
2125 neighbor_attr_unchanged1_cmd
,
2126 NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2129 "BGP attribute is propagated unchanged to this neighbor\n"
2130 "As-path attribute\n"
2131 "Nexthop attribute\n"
2134 u_int16_t flags
= 0;
2136 if (strncmp (argv
[1], "as-path", 1) == 0)
2137 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2138 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2139 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2140 else if (strncmp (argv
[1], "med", 1) == 0)
2141 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2143 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2144 bgp_node_safi (vty
), flags
);
2147 DEFUN (neighbor_attr_unchanged2
,
2148 neighbor_attr_unchanged2_cmd
,
2149 NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2152 "BGP attribute is propagated unchanged to this neighbor\n"
2153 "As-path attribute\n"
2154 "Nexthop attribute\n"
2157 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2159 if (strncmp (argv
[1], "next-hop", 1) == 0)
2160 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2161 else if (strncmp (argv
[1], "med", 1) == 0)
2162 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2164 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2165 bgp_node_safi (vty
), flags
);
2169 DEFUN (neighbor_attr_unchanged3
,
2170 neighbor_attr_unchanged3_cmd
,
2171 NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2174 "BGP attribute is propagated unchanged to this neighbor\n"
2175 "Nexthop attribute\n"
2176 "As-path attribute\n"
2179 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2181 if (strncmp (argv
[1], "as-path", 1) == 0)
2182 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2183 else if (strncmp (argv
[1], "med", 1) == 0)
2184 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2186 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2187 bgp_node_safi (vty
), flags
);
2190 DEFUN (neighbor_attr_unchanged4
,
2191 neighbor_attr_unchanged4_cmd
,
2192 NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2195 "BGP attribute is propagated unchanged to this neighbor\n"
2197 "As-path attribute\n"
2198 "Nexthop attribute\n")
2200 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2202 if (strncmp (argv
[1], "as-path", 1) == 0)
2203 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2204 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2205 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2207 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2208 bgp_node_safi (vty
), flags
);
2211 ALIAS (neighbor_attr_unchanged
,
2212 neighbor_attr_unchanged5_cmd
,
2213 NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2216 "BGP attribute is propagated unchanged to this neighbor\n"
2217 "As-path attribute\n"
2218 "Nexthop attribute\n"
2221 ALIAS (neighbor_attr_unchanged
,
2222 neighbor_attr_unchanged6_cmd
,
2223 NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2226 "BGP attribute is propagated unchanged to this neighbor\n"
2227 "As-path attribute\n"
2229 "Nexthop attribute\n")
2231 ALIAS (neighbor_attr_unchanged
,
2232 neighbor_attr_unchanged7_cmd
,
2233 NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2236 "BGP attribute is propagated unchanged to this neighbor\n"
2237 "Nexthop attribute\n"
2239 "As-path attribute\n")
2241 ALIAS (neighbor_attr_unchanged
,
2242 neighbor_attr_unchanged8_cmd
,
2243 NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2246 "BGP attribute is propagated unchanged to this neighbor\n"
2247 "Nexthop attribute\n"
2248 "As-path attribute\n"
2251 ALIAS (neighbor_attr_unchanged
,
2252 neighbor_attr_unchanged9_cmd
,
2253 NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2256 "BGP attribute is propagated unchanged to this neighbor\n"
2258 "Nexthop attribute\n"
2259 "As-path attribute\n")
2261 ALIAS (neighbor_attr_unchanged
,
2262 neighbor_attr_unchanged10_cmd
,
2263 NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2266 "BGP attribute is propagated unchanged to this neighbor\n"
2268 "As-path attribute\n"
2269 "Nexthop attribute\n")
2271 DEFUN (no_neighbor_attr_unchanged
,
2272 no_neighbor_attr_unchanged_cmd
,
2273 NO_NEIGHBOR_CMD2
"attribute-unchanged",
2277 "BGP attribute is propagated unchanged to this neighbor\n")
2279 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2280 bgp_node_safi (vty
),
2281 (PEER_FLAG_AS_PATH_UNCHANGED
|
2282 PEER_FLAG_NEXTHOP_UNCHANGED
|
2283 PEER_FLAG_MED_UNCHANGED
));
2286 DEFUN (no_neighbor_attr_unchanged1
,
2287 no_neighbor_attr_unchanged1_cmd
,
2288 NO_NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2292 "BGP attribute is propagated unchanged to this neighbor\n"
2293 "As-path attribute\n"
2294 "Nexthop attribute\n"
2297 u_int16_t flags
= 0;
2299 if (strncmp (argv
[1], "as-path", 1) == 0)
2300 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2301 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2302 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2303 else if (strncmp (argv
[1], "med", 1) == 0)
2304 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2306 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2307 bgp_node_safi (vty
), flags
);
2310 DEFUN (no_neighbor_attr_unchanged2
,
2311 no_neighbor_attr_unchanged2_cmd
,
2312 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2316 "BGP attribute is propagated unchanged to this neighbor\n"
2317 "As-path attribute\n"
2318 "Nexthop attribute\n"
2321 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2323 if (strncmp (argv
[1], "next-hop", 1) == 0)
2324 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2325 else if (strncmp (argv
[1], "med", 1) == 0)
2326 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2328 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2329 bgp_node_safi (vty
), flags
);
2332 DEFUN (no_neighbor_attr_unchanged3
,
2333 no_neighbor_attr_unchanged3_cmd
,
2334 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2338 "BGP attribute is propagated unchanged to this neighbor\n"
2339 "Nexthop attribute\n"
2340 "As-path attribute\n"
2343 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2345 if (strncmp (argv
[1], "as-path", 1) == 0)
2346 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2347 else if (strncmp (argv
[1], "med", 1) == 0)
2348 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2350 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2351 bgp_node_safi (vty
), flags
);
2354 DEFUN (no_neighbor_attr_unchanged4
,
2355 no_neighbor_attr_unchanged4_cmd
,
2356 NO_NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2360 "BGP attribute is propagated unchanged to this neighbor\n"
2362 "As-path attribute\n"
2363 "Nexthop attribute\n")
2365 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2367 if (strncmp (argv
[1], "as-path", 1) == 0)
2368 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2369 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2370 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2372 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2373 bgp_node_safi (vty
), flags
);
2376 ALIAS (no_neighbor_attr_unchanged
,
2377 no_neighbor_attr_unchanged5_cmd
,
2378 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2382 "BGP attribute is propagated unchanged to this neighbor\n"
2383 "As-path attribute\n"
2384 "Nexthop attribute\n"
2387 ALIAS (no_neighbor_attr_unchanged
,
2388 no_neighbor_attr_unchanged6_cmd
,
2389 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2393 "BGP attribute is propagated unchanged to this neighbor\n"
2394 "As-path attribute\n"
2396 "Nexthop attribute\n")
2398 ALIAS (no_neighbor_attr_unchanged
,
2399 no_neighbor_attr_unchanged7_cmd
,
2400 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2404 "BGP attribute is propagated unchanged to this neighbor\n"
2405 "Nexthop attribute\n"
2407 "As-path attribute\n")
2409 ALIAS (no_neighbor_attr_unchanged
,
2410 no_neighbor_attr_unchanged8_cmd
,
2411 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2415 "BGP attribute is propagated unchanged to this neighbor\n"
2416 "Nexthop attribute\n"
2417 "As-path attribute\n"
2420 ALIAS (no_neighbor_attr_unchanged
,
2421 no_neighbor_attr_unchanged9_cmd
,
2422 NO_NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2426 "BGP attribute is propagated unchanged to this neighbor\n"
2428 "Nexthop attribute\n"
2429 "As-path attribute\n")
2431 ALIAS (no_neighbor_attr_unchanged
,
2432 no_neighbor_attr_unchanged10_cmd
,
2433 NO_NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2437 "BGP attribute is propagated unchanged to this neighbor\n"
2439 "As-path attribute\n"
2440 "Nexthop attribute\n")
2442 /* For old version Zebra compatibility. */
2443 DEFUN (neighbor_transparent_as
,
2444 neighbor_transparent_as_cmd
,
2445 NEIGHBOR_CMD
"transparent-as",
2448 "Do not append my AS number even peer is EBGP peer\n")
2450 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2451 bgp_node_safi (vty
),
2452 PEER_FLAG_AS_PATH_UNCHANGED
);
2455 DEFUN (neighbor_transparent_nexthop
,
2456 neighbor_transparent_nexthop_cmd
,
2457 NEIGHBOR_CMD
"transparent-nexthop",
2460 "Do not change nexthop even peer is EBGP peer\n")
2462 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2463 bgp_node_safi (vty
),
2464 PEER_FLAG_NEXTHOP_UNCHANGED
);
2467 /* EBGP multihop configuration. */
2469 peer_ebgp_multihop_set_vty (struct vty
*vty
, char *ip_str
, char *ttl_str
)
2474 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2481 VTY_GET_INTEGER_RANGE ("TTL", ttl
, ttl_str
, 1, 255);
2483 peer_ebgp_multihop_set (peer
, ttl
);
2489 peer_ebgp_multihop_unset_vty (struct vty
*vty
, char *ip_str
)
2493 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2497 peer_ebgp_multihop_unset (peer
);
2502 /* neighbor ebgp-multihop. */
2503 DEFUN (neighbor_ebgp_multihop
,
2504 neighbor_ebgp_multihop_cmd
,
2505 NEIGHBOR_CMD2
"ebgp-multihop",
2508 "Allow EBGP neighbors not on directly connected networks\n")
2510 return peer_ebgp_multihop_set_vty (vty
, argv
[0], NULL
);
2513 DEFUN (neighbor_ebgp_multihop_ttl
,
2514 neighbor_ebgp_multihop_ttl_cmd
,
2515 NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2518 "Allow EBGP neighbors not on directly connected networks\n"
2519 "maximum hop count\n")
2521 return peer_ebgp_multihop_set_vty (vty
, argv
[0], argv
[1]);
2524 DEFUN (no_neighbor_ebgp_multihop
,
2525 no_neighbor_ebgp_multihop_cmd
,
2526 NO_NEIGHBOR_CMD2
"ebgp-multihop",
2530 "Allow EBGP neighbors not on directly connected networks\n")
2532 return peer_ebgp_multihop_unset_vty (vty
, argv
[0]);
2535 ALIAS (no_neighbor_ebgp_multihop
,
2536 no_neighbor_ebgp_multihop_ttl_cmd
,
2537 NO_NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2541 "Allow EBGP neighbors not on directly connected networks\n"
2542 "maximum hop count\n")
2544 /* Enforce multihop. */
2545 DEFUN (neighbor_enforce_multihop
,
2546 neighbor_enforce_multihop_cmd
,
2547 NEIGHBOR_CMD2
"enforce-multihop",
2550 "Enforce EBGP neighbors perform multihop\n")
2552 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_ENFORCE_MULTIHOP
);
2555 DEFUN (no_neighbor_enforce_multihop
,
2556 no_neighbor_enforce_multihop_cmd
,
2557 NO_NEIGHBOR_CMD2
"enforce-multihop",
2561 "Enforce EBGP neighbors perform multihop\n")
2563 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_ENFORCE_MULTIHOP
);
2566 DEFUN (neighbor_description
,
2567 neighbor_description_cmd
,
2568 NEIGHBOR_CMD2
"description .LINE",
2571 "Neighbor specific description\n"
2572 "Up to 80 characters describing this neighbor\n")
2579 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2586 /* Make string from buffer. This function should be provided by
2588 b
= buffer_new (1024);
2589 for (i
= 1; i
< argc
; i
++)
2591 buffer_putstr (b
, argv
[i
]);
2592 buffer_putc (b
, ' ');
2594 buffer_putc (b
, '\0');
2595 str
= buffer_getstr (b
);
2598 peer_description_set (peer
, str
);
2605 DEFUN (no_neighbor_description
,
2606 no_neighbor_description_cmd
,
2607 NO_NEIGHBOR_CMD2
"description",
2611 "Neighbor specific description\n")
2615 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2619 peer_description_unset (peer
);
2624 ALIAS (no_neighbor_description
,
2625 no_neighbor_description_val_cmd
,
2626 NO_NEIGHBOR_CMD2
"description .LINE",
2630 "Neighbor specific description\n"
2631 "Up to 80 characters describing this neighbor\n")
2633 /* Neighbor update-source. */
2635 peer_update_source_vty (struct vty
*vty
, char *peer_str
, char *source_str
)
2638 union sockunion
*su
;
2640 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2646 su
= sockunion_str2su (source_str
);
2649 peer_update_source_addr_set (peer
, su
);
2650 sockunion_free (su
);
2653 peer_update_source_if_set (peer
, source_str
);
2656 peer_update_source_unset (peer
);
2661 DEFUN (neighbor_update_source
,
2662 neighbor_update_source_cmd
,
2663 NEIGHBOR_CMD2
"update-source WORD",
2666 "Source of routing updates\n"
2669 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
2672 DEFUN (no_neighbor_update_source
,
2673 no_neighbor_update_source_cmd
,
2674 NO_NEIGHBOR_CMD2
"update-source",
2678 "Source of routing updates\n"
2681 return peer_update_source_vty (vty
, argv
[0], NULL
);
2685 peer_default_originate_set_vty (struct vty
*vty
, char *peer_str
, afi_t afi
,
2686 safi_t safi
, char *rmap
, int set
)
2691 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2696 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
2698 ret
= peer_default_originate_unset (peer
, afi
, safi
);
2700 return bgp_vty_return (vty
, ret
);
2703 /* neighbor default-originate. */
2704 DEFUN (neighbor_default_originate
,
2705 neighbor_default_originate_cmd
,
2706 NEIGHBOR_CMD2
"default-originate",
2709 "Originate default route to this neighbor\n")
2711 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2712 bgp_node_safi (vty
), NULL
, 1);
2715 DEFUN (neighbor_default_originate_rmap
,
2716 neighbor_default_originate_rmap_cmd
,
2717 NEIGHBOR_CMD2
"default-originate route-map WORD",
2720 "Originate default route to this neighbor\n"
2721 "Route-map to specify criteria to originate default\n"
2724 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2725 bgp_node_safi (vty
), argv
[1], 1);
2728 DEFUN (no_neighbor_default_originate
,
2729 no_neighbor_default_originate_cmd
,
2730 NO_NEIGHBOR_CMD2
"default-originate",
2734 "Originate default route to this neighbor\n")
2736 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2737 bgp_node_safi (vty
), NULL
, 0);
2740 ALIAS (no_neighbor_default_originate
,
2741 no_neighbor_default_originate_rmap_cmd
,
2742 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
2746 "Originate default route to this neighbor\n"
2747 "Route-map to specify criteria to originate default\n"
2750 /* Set neighbor's BGP port. */
2752 peer_port_vty (struct vty
*vty
, char *ip_str
, int afi
, char *port_str
)
2758 peer
= peer_lookup_vty (vty
, ip_str
);
2764 sp
= getservbyname ("bgp", "tcp");
2765 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
2769 VTY_GET_INTEGER("port", port
, port_str
);
2772 peer_port_set (peer
, port
);
2777 /* Set specified peer's BGP version. */
2778 DEFUN (neighbor_port
,
2780 NEIGHBOR_CMD
"port <0-65535>",
2783 "Neighbor's BGP port\n"
2784 "TCP port number\n")
2786 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
2789 DEFUN (no_neighbor_port
,
2790 no_neighbor_port_cmd
,
2791 NO_NEIGHBOR_CMD
"port",
2795 "Neighbor's BGP port\n")
2797 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
2800 ALIAS (no_neighbor_port
,
2801 no_neighbor_port_val_cmd
,
2802 NO_NEIGHBOR_CMD
"port <0-65535>",
2806 "Neighbor's BGP port\n"
2807 "TCP port number\n")
2809 /* neighbor weight. */
2811 peer_weight_set_vty (struct vty
*vty
, char *ip_str
, char *weight_str
)
2815 unsigned long weight
;
2817 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2821 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
2823 ret
= peer_weight_set (peer
, weight
);
2829 peer_weight_unset_vty (struct vty
*vty
, char *ip_str
)
2833 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2837 peer_weight_unset (peer
);
2842 DEFUN (neighbor_weight
,
2843 neighbor_weight_cmd
,
2844 NEIGHBOR_CMD2
"weight <0-65535>",
2847 "Set default weight for routes from this neighbor\n"
2850 return peer_weight_set_vty (vty
, argv
[0], argv
[1]);
2853 DEFUN (no_neighbor_weight
,
2854 no_neighbor_weight_cmd
,
2855 NO_NEIGHBOR_CMD2
"weight",
2859 "Set default weight for routes from this neighbor\n")
2861 return peer_weight_unset_vty (vty
, argv
[0]);
2864 ALIAS (no_neighbor_weight
,
2865 no_neighbor_weight_val_cmd
,
2866 NO_NEIGHBOR_CMD2
"weight <0-65535>",
2870 "Set default weight for routes from this neighbor\n"
2873 /* Override capability negotiation. */
2874 DEFUN (neighbor_override_capability
,
2875 neighbor_override_capability_cmd
,
2876 NEIGHBOR_CMD2
"override-capability",
2879 "Override capability negotiation result\n")
2881 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
2884 DEFUN (no_neighbor_override_capability
,
2885 no_neighbor_override_capability_cmd
,
2886 NO_NEIGHBOR_CMD2
"override-capability",
2890 "Override capability negotiation result\n")
2892 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
2895 DEFUN (neighbor_strict_capability
,
2896 neighbor_strict_capability_cmd
,
2897 NEIGHBOR_CMD
"strict-capability-match",
2900 "Strict capability negotiation match\n")
2902 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
2905 DEFUN (no_neighbor_strict_capability
,
2906 no_neighbor_strict_capability_cmd
,
2907 NO_NEIGHBOR_CMD
"strict-capability-match",
2911 "Strict capability negotiation match\n")
2913 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
2917 peer_timers_set_vty (struct vty
*vty
, char *ip_str
, char *keep_str
,
2922 u_int32_t keepalive
;
2925 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2929 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
2930 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
2932 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
2934 return bgp_vty_return (vty
, ret
);
2938 peer_timers_unset_vty (struct vty
*vty
, char *ip_str
)
2943 peer
= peer_lookup_vty (vty
, ip_str
);
2947 ret
= peer_timers_unset (peer
);
2949 return bgp_vty_return (vty
, ret
);
2952 DEFUN (neighbor_timers
,
2953 neighbor_timers_cmd
,
2954 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
2957 "BGP per neighbor timers\n"
2958 "Keepalive interval\n"
2961 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
2964 DEFUN (no_neighbor_timers
,
2965 no_neighbor_timers_cmd
,
2966 NO_NEIGHBOR_CMD2
"timers",
2970 "BGP per neighbor timers\n")
2972 return peer_timers_unset_vty (vty
, argv
[0]);
2976 peer_timers_connect_set_vty (struct vty
*vty
, char *ip_str
, char *time_str
)
2982 peer
= peer_lookup_vty (vty
, ip_str
);
2986 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
2988 ret
= peer_timers_connect_set (peer
, connect
);
2994 peer_timers_connect_unset_vty (struct vty
*vty
, char *ip_str
)
2999 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3003 ret
= peer_timers_connect_unset (peer
);
3008 DEFUN (neighbor_timers_connect
,
3009 neighbor_timers_connect_cmd
,
3010 NEIGHBOR_CMD
"timers connect <0-65535>",
3013 "BGP per neighbor timers\n"
3014 "BGP connect timer\n"
3017 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
3020 DEFUN (no_neighbor_timers_connect
,
3021 no_neighbor_timers_connect_cmd
,
3022 NO_NEIGHBOR_CMD
"timers connect",
3026 "BGP per neighbor timers\n"
3027 "BGP connect timer\n")
3029 return peer_timers_connect_unset_vty (vty
, argv
[0]);
3032 ALIAS (no_neighbor_timers_connect
,
3033 no_neighbor_timers_connect_val_cmd
,
3034 NO_NEIGHBOR_CMD
"timers connect <0-65535>",
3038 "BGP per neighbor timers\n"
3039 "BGP connect timer\n"
3043 peer_advertise_interval_vty (struct vty
*vty
, char *ip_str
, char *time_str
,
3048 u_int32_t routeadv
= 0;
3050 peer
= peer_lookup_vty (vty
, ip_str
);
3055 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
3058 ret
= peer_advertise_interval_set (peer
, routeadv
);
3060 ret
= peer_advertise_interval_unset (peer
);
3065 DEFUN (neighbor_advertise_interval
,
3066 neighbor_advertise_interval_cmd
,
3067 NEIGHBOR_CMD
"advertisement-interval <0-600>",
3070 "Minimum interval between sending BGP routing updates\n"
3071 "time in seconds\n")
3073 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
3076 DEFUN (no_neighbor_advertise_interval
,
3077 no_neighbor_advertise_interval_cmd
,
3078 NO_NEIGHBOR_CMD
"advertisement-interval",
3082 "Minimum interval between sending BGP routing updates\n")
3084 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
3087 ALIAS (no_neighbor_advertise_interval
,
3088 no_neighbor_advertise_interval_val_cmd
,
3089 NO_NEIGHBOR_CMD
"advertisement-interval <0-600>",
3093 "Minimum interval between sending BGP routing updates\n"
3094 "time in seconds\n")
3097 peer_version_vty (struct vty
*vty
, char *ip_str
, char *str
)
3101 int version
= BGP_VERSION_4
;
3103 peer
= peer_lookup_vty (vty
, ip_str
);
3107 /* BGP version string check. */
3110 if (strcmp (str
, "4") == 0)
3111 version
= BGP_VERSION_4
;
3112 else if (strcmp (str
, "4-") == 0)
3113 version
= BGP_VERSION_MP_4_DRAFT_00
;
3115 ret
= peer_version_set (peer
, version
);
3118 ret
= peer_version_unset (peer
);
3123 DEFUN (neighbor_version
,
3124 neighbor_version_cmd
,
3125 NEIGHBOR_CMD
"version (4|4-)",
3128 "Neighbor's BGP version\n"
3129 "Border Gateway Protocol 4\n"
3130 "Multiprotocol Extensions for BGP-4(Old Draft)\n")
3132 return peer_version_vty (vty
, argv
[0], argv
[1]);
3135 DEFUN (no_neighbor_version
,
3136 no_neighbor_version_cmd
,
3137 NO_NEIGHBOR_CMD
"version",
3141 "Neighbor's BGP version\n")
3143 return peer_version_vty (vty
, argv
[0], NULL
);
3146 /* neighbor interface */
3148 peer_interface_vty (struct vty
*vty
, char *ip_str
, char *str
)
3153 peer
= peer_lookup_vty (vty
, ip_str
);
3158 ret
= peer_interface_set (peer
, str
);
3160 ret
= peer_interface_unset (peer
);
3165 DEFUN (neighbor_interface
,
3166 neighbor_interface_cmd
,
3167 NEIGHBOR_CMD
"interface WORD",
3173 return peer_interface_vty (vty
, argv
[0], argv
[1]);
3176 DEFUN (no_neighbor_interface
,
3177 no_neighbor_interface_cmd
,
3178 NO_NEIGHBOR_CMD
"interface WORD",
3185 return peer_interface_vty (vty
, argv
[0], NULL
);
3188 /* Set distribute list to the peer. */
3190 peer_distribute_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
, safi_t safi
,
3191 char *name_str
, char *direct_str
)
3195 int direct
= FILTER_IN
;
3197 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3201 /* Check filter direction. */
3202 if (strncmp (direct_str
, "i", 1) == 0)
3204 else if (strncmp (direct_str
, "o", 1) == 0)
3205 direct
= FILTER_OUT
;
3207 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
3209 return bgp_vty_return (vty
, ret
);
3213 peer_distribute_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3214 safi_t safi
, char *direct_str
)
3218 int direct
= FILTER_IN
;
3220 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3224 /* Check filter direction. */
3225 if (strncmp (direct_str
, "i", 1) == 0)
3227 else if (strncmp (direct_str
, "o", 1) == 0)
3228 direct
= FILTER_OUT
;
3230 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
3232 return bgp_vty_return (vty
, ret
);
3235 DEFUN (neighbor_distribute_list
,
3236 neighbor_distribute_list_cmd
,
3237 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3240 "Filter updates to/from this neighbor\n"
3241 "IP access-list number\n"
3242 "IP access-list number (expanded range)\n"
3243 "IP Access-list name\n"
3244 "Filter incoming updates\n"
3245 "Filter outgoing updates\n")
3247 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3248 bgp_node_safi (vty
), argv
[1], argv
[2]);
3251 DEFUN (no_neighbor_distribute_list
,
3252 no_neighbor_distribute_list_cmd
,
3253 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3257 "Filter updates to/from this neighbor\n"
3258 "IP access-list number\n"
3259 "IP access-list number (expanded range)\n"
3260 "IP Access-list name\n"
3261 "Filter incoming updates\n"
3262 "Filter outgoing updates\n")
3264 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3265 bgp_node_safi (vty
), argv
[2]);
3268 /* Set prefix list to the peer. */
3270 peer_prefix_list_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3271 safi_t safi
, char *name_str
, char *direct_str
)
3275 int direct
= FILTER_IN
;
3277 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3281 /* Check filter direction. */
3282 if (strncmp (direct_str
, "i", 1) == 0)
3284 else if (strncmp (direct_str
, "o", 1) == 0)
3285 direct
= FILTER_OUT
;
3287 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
3289 return bgp_vty_return (vty
, ret
);
3293 peer_prefix_list_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3294 safi_t safi
, char *direct_str
)
3298 int direct
= FILTER_IN
;
3300 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3304 /* Check filter direction. */
3305 if (strncmp (direct_str
, "i", 1) == 0)
3307 else if (strncmp (direct_str
, "o", 1) == 0)
3308 direct
= FILTER_OUT
;
3310 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
3312 return bgp_vty_return (vty
, ret
);
3315 DEFUN (neighbor_prefix_list
,
3316 neighbor_prefix_list_cmd
,
3317 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3320 "Filter updates to/from this neighbor\n"
3321 "Name of a prefix list\n"
3322 "Filter incoming updates\n"
3323 "Filter outgoing updates\n")
3325 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3326 bgp_node_safi (vty
), argv
[1], argv
[2]);
3329 DEFUN (no_neighbor_prefix_list
,
3330 no_neighbor_prefix_list_cmd
,
3331 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3335 "Filter updates to/from this neighbor\n"
3336 "Name of a prefix list\n"
3337 "Filter incoming updates\n"
3338 "Filter outgoing updates\n")
3340 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3341 bgp_node_safi (vty
), argv
[2]);
3345 peer_aslist_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
, safi_t safi
,
3346 char *name_str
, char *direct_str
)
3350 int direct
= FILTER_IN
;
3352 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3356 /* Check filter direction. */
3357 if (strncmp (direct_str
, "i", 1) == 0)
3359 else if (strncmp (direct_str
, "o", 1) == 0)
3360 direct
= FILTER_OUT
;
3362 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
3364 return bgp_vty_return (vty
, ret
);
3368 peer_aslist_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
, safi_t safi
,
3373 int direct
= FILTER_IN
;
3375 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3379 /* Check filter direction. */
3380 if (strncmp (direct_str
, "i", 1) == 0)
3382 else if (strncmp (direct_str
, "o", 1) == 0)
3383 direct
= FILTER_OUT
;
3385 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
3387 return bgp_vty_return (vty
, ret
);
3390 DEFUN (neighbor_filter_list
,
3391 neighbor_filter_list_cmd
,
3392 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3395 "Establish BGP filters\n"
3396 "AS path access-list name\n"
3397 "Filter incoming routes\n"
3398 "Filter outgoing routes\n")
3400 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3401 bgp_node_safi (vty
), argv
[1], argv
[2]);
3404 DEFUN (no_neighbor_filter_list
,
3405 no_neighbor_filter_list_cmd
,
3406 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3410 "Establish BGP filters\n"
3411 "AS path access-list name\n"
3412 "Filter incoming routes\n"
3413 "Filter outgoing routes\n")
3415 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3416 bgp_node_safi (vty
), argv
[2]);
3419 /* Set route-map to the peer. */
3421 peer_route_map_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
, safi_t safi
,
3422 char *name_str
, char *direct_str
)
3426 int direct
= RMAP_IN
;
3428 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3432 /* Check filter direction. */
3433 if (strncmp (direct_str
, "in", 2) == 0)
3435 else if (strncmp (direct_str
, "o", 1) == 0)
3437 else if (strncmp (direct_str
, "im", 2) == 0)
3438 direct
= RMAP_IMPORT
;
3439 else if (strncmp (direct_str
, "e", 1) == 0)
3440 direct
= RMAP_EXPORT
;
3442 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
3444 return bgp_vty_return (vty
, ret
);
3448 peer_route_map_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3449 safi_t safi
, char *direct_str
)
3453 int direct
= RMAP_IN
;
3455 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3459 /* Check filter direction. */
3460 if (strncmp (direct_str
, "in", 2) == 0)
3462 else if (strncmp (direct_str
, "o", 1) == 0)
3464 else if (strncmp (direct_str
, "im", 2) == 0)
3465 direct
= RMAP_IMPORT
;
3466 else if (strncmp (direct_str
, "e", 1) == 0)
3467 direct
= RMAP_EXPORT
;
3469 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
3471 return bgp_vty_return (vty
, ret
);
3474 DEFUN (neighbor_route_map
,
3475 neighbor_route_map_cmd
,
3476 NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3479 "Apply route map to neighbor\n"
3480 "Name of route map\n"
3481 "Apply map to incoming routes\n"
3482 "Apply map to outbound routes\n"
3483 "Apply map to routes going into a Route-Server client's table\n"
3484 "Apply map to routes coming from a Route-Server client")
3486 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3487 bgp_node_safi (vty
), argv
[1], argv
[2]);
3490 DEFUN (no_neighbor_route_map
,
3491 no_neighbor_route_map_cmd
,
3492 NO_NEIGHBOR_CMD2
"route-map WORD (in|out|import|export)",
3496 "Apply route map to neighbor\n"
3497 "Name of route map\n"
3498 "Apply map to incoming routes\n"
3499 "Apply map to outbound routes\n"
3500 "Apply map to routes going into a Route-Server client's table\n"
3501 "Apply map to routes coming from a Route-Server client")
3503 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3504 bgp_node_safi (vty
), argv
[2]);
3507 /* Set unsuppress-map to the peer. */
3509 peer_unsuppress_map_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3510 safi_t safi
, char *name_str
)
3515 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3519 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
3521 return bgp_vty_return (vty
, ret
);
3524 /* Unset route-map from the peer. */
3526 peer_unsuppress_map_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3532 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3536 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
3538 return bgp_vty_return (vty
, ret
);
3541 DEFUN (neighbor_unsuppress_map
,
3542 neighbor_unsuppress_map_cmd
,
3543 NEIGHBOR_CMD2
"unsuppress-map WORD",
3546 "Route-map to selectively unsuppress suppressed routes\n"
3547 "Name of route map\n")
3549 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3550 bgp_node_safi (vty
), argv
[1]);
3553 DEFUN (no_neighbor_unsuppress_map
,
3554 no_neighbor_unsuppress_map_cmd
,
3555 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
3559 "Route-map to selectively unsuppress suppressed routes\n"
3560 "Name of route map\n")
3562 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3563 bgp_node_safi (vty
));
3567 peer_maximum_prefix_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3568 safi_t safi
, char *num_str
, char *threshold_str
,
3576 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3580 VTY_GET_INTEGER ("maxmum number", max
, num_str
);
3582 threshold
= atoi (threshold_str
);
3584 threshold
= MAXIMUM_PREFIX_THRESHOLD_DEFAULT
;
3586 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, threshold
, warning
);
3588 return bgp_vty_return (vty
, ret
);
3592 peer_maximum_prefix_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3598 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3602 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
3604 return bgp_vty_return (vty
, ret
);
3607 /* Maximum number of prefix configuration. prefix count is different
3608 for each peer configuration. So this configuration can be set for
3609 each peer configuration. */
3610 DEFUN (neighbor_maximum_prefix
,
3611 neighbor_maximum_prefix_cmd
,
3612 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3615 "Maximum number of prefix accept from this peer\n"
3616 "maximum no. of prefix limit\n")
3618 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3619 bgp_node_safi (vty
), argv
[1], NULL
, 0);
3622 DEFUN (neighbor_maximum_prefix_threshold
,
3623 neighbor_maximum_prefix_threshold_cmd
,
3624 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100>",
3627 "Maximum number of prefix accept from this peer\n"
3628 "maximum no. of prefix limit\n"
3629 "Threshold value (%) at which to generate a warning msg\n")
3631 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3632 bgp_node_safi (vty
), argv
[1], argv
[2], 0);
3635 DEFUN (neighbor_maximum_prefix_warning
,
3636 neighbor_maximum_prefix_warning_cmd
,
3637 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3640 "Maximum number of prefix accept from this peer\n"
3641 "maximum no. of prefix limit\n"
3642 "Only give warning message when limit is exceeded\n")
3644 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3645 bgp_node_safi (vty
), argv
[1], NULL
, 1);
3648 DEFUN (neighbor_maximum_prefix_threshold_warning
,
3649 neighbor_maximum_prefix_threshold_warning_cmd
,
3650 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3653 "Maximum number of prefix accept from this peer\n"
3654 "maximum no. of prefix limit\n"
3655 "Threshold value (%) at which to generate a warning msg\n"
3656 "Only give warning message when limit is exceeded\n")
3658 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3659 bgp_node_safi (vty
), argv
[1], argv
[2], 1);
3662 DEFUN (no_neighbor_maximum_prefix
,
3663 no_neighbor_maximum_prefix_cmd
,
3664 NO_NEIGHBOR_CMD2
"maximum-prefix",
3668 "Maximum number of prefix accept from this peer\n")
3670 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3671 bgp_node_safi (vty
));
3674 ALIAS (no_neighbor_maximum_prefix
,
3675 no_neighbor_maximum_prefix_val_cmd
,
3676 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3680 "Maximum number of prefix accept from this peer\n"
3681 "maximum no. of prefix limit\n")
3683 ALIAS (no_neighbor_maximum_prefix
,
3684 no_neighbor_maximum_prefix_val2_cmd
,
3685 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> <1-100> warning-only",
3689 "Maximum number of prefix accept from this peer\n"
3690 "maximum no. of prefix limit\n"
3691 "Threshold value (%) at which to generate a warning msg\n"
3692 "Only give warning message when limit is exceeded\n")
3694 ALIAS (no_neighbor_maximum_prefix
,
3695 no_neighbor_maximum_prefix_val3_cmd
,
3696 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3700 "Maximum number of prefix accept from this peer\n"
3701 "maximum no. of prefix limit\n"
3702 "Only give warning message when limit is exceeded\n")
3704 /* "neighbor allowas-in" */
3705 DEFUN (neighbor_allowas_in
,
3706 neighbor_allowas_in_cmd
,
3707 NEIGHBOR_CMD2
"allowas-in",
3710 "Accept as-path with my AS present in it\n")
3716 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3723 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
3725 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
3728 return bgp_vty_return (vty
, ret
);
3731 ALIAS (neighbor_allowas_in
,
3732 neighbor_allowas_in_arg_cmd
,
3733 NEIGHBOR_CMD2
"allowas-in <1-10>",
3736 "Accept as-path with my AS present in it\n"
3737 "Number of occurances of AS number\n")
3739 DEFUN (no_neighbor_allowas_in
,
3740 no_neighbor_allowas_in_cmd
,
3741 NO_NEIGHBOR_CMD2
"allowas-in",
3745 "allow local ASN appears in aspath attribute\n")
3750 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3754 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3756 return bgp_vty_return (vty
, ret
);
3759 /* Address family configuration. */
3760 DEFUN (address_family_ipv4
,
3761 address_family_ipv4_cmd
,
3762 "address-family ipv4",
3763 "Enter Address Family command mode\n"
3766 vty
->node
= BGP_IPV4_NODE
;
3770 DEFUN (address_family_ipv4_safi
,
3771 address_family_ipv4_safi_cmd
,
3772 "address-family ipv4 (unicast|multicast)",
3773 "Enter Address Family command mode\n"
3775 "Address Family modifier\n"
3776 "Address Family modifier\n")
3778 if (strncmp (argv
[0], "m", 1) == 0)
3779 vty
->node
= BGP_IPV4M_NODE
;
3781 vty
->node
= BGP_IPV4_NODE
;
3786 DEFUN (address_family_ipv6_unicast
,
3787 address_family_ipv6_unicast_cmd
,
3788 "address-family ipv6 unicast",
3789 "Enter Address Family command mode\n"
3793 vty
->node
= BGP_IPV6_NODE
;
3797 ALIAS (address_family_ipv6_unicast
,
3798 address_family_ipv6_cmd
,
3799 "address-family ipv6",
3800 "Enter Address Family command mode\n"
3803 DEFUN (address_family_vpnv4
,
3804 address_family_vpnv4_cmd
,
3805 "address-family vpnv4",
3806 "Enter Address Family command mode\n"
3809 vty
->node
= BGP_VPNV4_NODE
;
3813 ALIAS (address_family_vpnv4
,
3814 address_family_vpnv4_unicast_cmd
,
3815 "address-family vpnv4 unicast",
3816 "Enter Address Family command mode\n"
3818 "Address Family Modifier\n")
3820 DEFUN (exit_address_family
,
3821 exit_address_family_cmd
,
3822 "exit-address-family",
3823 "Exit from Address Family configuration mode\n")
3825 if (vty
->node
== BGP_IPV4M_NODE
3826 || vty
->node
== BGP_VPNV4_NODE
3827 || vty
->node
== BGP_IPV6_NODE
)
3828 vty
->node
= BGP_NODE
;
3832 /* BGP clear sort. */
3843 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
3844 safi_t safi
, int error
)
3848 case BGP_ERR_AF_UNCONFIGURED
:
3850 "%%BGP: Enable %s %s address family for the neighbor %s%s",
3851 afi
== AFI_IP6
? "IPv6" : safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
3852 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
3853 peer
->host
, VTY_NEWLINE
);
3855 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
3856 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
);
3863 /* `clear ip bgp' functions. */
3865 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
3866 enum clear_sort sort
,enum bgp_clear_type stype
, char *arg
)
3870 struct listnode
*nn
;
3872 /* Clear all neighbors. */
3873 if (sort
== clear_all
)
3875 LIST_LOOP (bgp
->peer
, peer
, nn
)
3877 if (stype
== BGP_CLEAR_SOFT_NONE
)
3878 ret
= peer_clear (peer
);
3880 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
3883 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
3888 /* Clear specified neighbors. */
3889 if (sort
== clear_peer
)
3894 /* Make sockunion for lookup. */
3895 ret
= str2sockunion (arg
, &su
);
3898 vty_out (vty
, "Malformed address: %s%s", arg
, VTY_NEWLINE
);
3901 peer
= peer_lookup (bgp
, &su
);
3904 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
3908 if (stype
== BGP_CLEAR_SOFT_NONE
)
3909 ret
= peer_clear (peer
);
3911 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
3914 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
3919 /* Clear all peer-group members. */
3920 if (sort
== clear_group
)
3922 struct peer_group
*group
;
3924 group
= peer_group_lookup (bgp
, arg
);
3927 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
3931 LIST_LOOP (group
->peer
, peer
, nn
)
3933 if (stype
== BGP_CLEAR_SOFT_NONE
)
3935 ret
= peer_clear (peer
);
3939 if (! peer
->af_group
[afi
][safi
])
3942 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
3945 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
3950 if (sort
== clear_external
)
3952 LIST_LOOP (bgp
->peer
, peer
, nn
)
3954 if (peer_sort (peer
) == BGP_PEER_IBGP
)
3957 if (stype
== BGP_CLEAR_SOFT_NONE
)
3958 ret
= peer_clear (peer
);
3960 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
3963 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
3968 if (sort
== clear_as
)
3971 unsigned long as_ul
;
3972 char *endptr
= NULL
;
3975 as_ul
= strtoul(arg
, &endptr
, 10);
3977 if ((as_ul
== ULONG_MAX
) || (*endptr
!= '\0') || (as_ul
> USHRT_MAX
))
3979 vty_out (vty
, "Invalid AS number%s", VTY_NEWLINE
);
3984 LIST_LOOP (bgp
->peer
, peer
, nn
)
3990 if (stype
== BGP_CLEAR_SOFT_NONE
)
3991 ret
= peer_clear (peer
);
3993 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
3996 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
3999 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
4008 bgp_clear_vty (struct vty
*vty
, char *name
, afi_t afi
, safi_t safi
,
4009 enum clear_sort sort
, enum bgp_clear_type stype
, char *arg
)
4014 /* BGP structure lookup. */
4017 bgp
= bgp_lookup_by_name (name
);
4020 vty_out (vty
, "Can't find BGP view %s%s", name
, VTY_NEWLINE
);
4026 bgp
= bgp_get_default ();
4029 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
4034 ret
= bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
4041 DEFUN (clear_ip_bgp_all
,
4042 clear_ip_bgp_all_cmd
,
4047 "Clear all peers\n")
4050 return bgp_clear_vty (vty
, argv
[0], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4052 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
4055 ALIAS (clear_ip_bgp_all
,
4060 "Clear all peers\n")
4062 ALIAS (clear_ip_bgp_all
,
4063 clear_bgp_ipv6_all_cmd
,
4068 "Clear all peers\n")
4070 ALIAS (clear_ip_bgp_all
,
4071 clear_ip_bgp_instance_all_cmd
,
4072 "clear ip bgp view WORD *",
4078 "Clear all peers\n")
4080 ALIAS (clear_ip_bgp_all
,
4081 clear_bgp_instance_all_cmd
,
4082 "clear bgp view WORD *",
4087 "Clear all peers\n")
4089 DEFUN (clear_ip_bgp_peer
,
4090 clear_ip_bgp_peer_cmd
,
4091 "clear ip bgp (A.B.C.D|X:X::X:X)",
4095 "BGP neighbor IP address to clear\n"
4096 "BGP IPv6 neighbor to clear\n")
4098 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4101 ALIAS (clear_ip_bgp_peer
,
4103 "clear bgp (A.B.C.D|X:X::X:X)",
4106 "BGP neighbor address to clear\n"
4107 "BGP IPv6 neighbor to clear\n")
4109 ALIAS (clear_ip_bgp_peer
,
4110 clear_bgp_ipv6_peer_cmd
,
4111 "clear bgp ipv6 (A.B.C.D|X:X::X:X)",
4115 "BGP neighbor address to clear\n"
4116 "BGP IPv6 neighbor to clear\n")
4118 DEFUN (clear_ip_bgp_peer_group
,
4119 clear_ip_bgp_peer_group_cmd
,
4120 "clear ip bgp peer-group WORD",
4124 "Clear all members of peer-group\n"
4125 "BGP peer-group name\n")
4127 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4130 ALIAS (clear_ip_bgp_peer_group
,
4131 clear_bgp_peer_group_cmd
,
4132 "clear bgp peer-group WORD",
4135 "Clear all members of peer-group\n"
4136 "BGP peer-group name\n")
4138 ALIAS (clear_ip_bgp_peer_group
,
4139 clear_bgp_ipv6_peer_group_cmd
,
4140 "clear bgp ipv6 peer-group WORD",
4144 "Clear all members of peer-group\n"
4145 "BGP peer-group name\n")
4147 DEFUN (clear_ip_bgp_external
,
4148 clear_ip_bgp_external_cmd
,
4149 "clear ip bgp external",
4153 "Clear all external peers\n")
4155 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
4158 ALIAS (clear_ip_bgp_external
,
4159 clear_bgp_external_cmd
,
4160 "clear bgp external",
4163 "Clear all external peers\n")
4165 ALIAS (clear_ip_bgp_external
,
4166 clear_bgp_ipv6_external_cmd
,
4167 "clear bgp ipv6 external",
4171 "Clear all external peers\n")
4173 DEFUN (clear_ip_bgp_as
,
4174 clear_ip_bgp_as_cmd
,
4175 "clear ip bgp <1-65535>",
4179 "Clear peers with the AS number\n")
4181 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
4184 ALIAS (clear_ip_bgp_as
,
4186 "clear bgp <1-65535>",
4189 "Clear peers with the AS number\n")
4191 ALIAS (clear_ip_bgp_as
,
4192 clear_bgp_ipv6_as_cmd
,
4193 "clear bgp ipv6 <1-65535>",
4197 "Clear peers with the AS number\n")
4199 /* Outbound soft-reconfiguration */
4200 DEFUN (clear_ip_bgp_all_soft_out
,
4201 clear_ip_bgp_all_soft_out_cmd
,
4202 "clear ip bgp * soft out",
4208 "Soft reconfig outbound update\n")
4211 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4212 BGP_CLEAR_SOFT_OUT
, NULL
);
4214 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4215 BGP_CLEAR_SOFT_OUT
, NULL
);
4218 ALIAS (clear_ip_bgp_all_soft_out
,
4219 clear_ip_bgp_all_out_cmd
,
4220 "clear ip bgp * out",
4225 "Soft reconfig outbound update\n")
4227 ALIAS (clear_ip_bgp_all_soft_out
,
4228 clear_ip_bgp_instance_all_soft_out_cmd
,
4229 "clear ip bgp view WORD * soft out",
4237 "Soft reconfig outbound update\n")
4239 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
4240 clear_ip_bgp_all_ipv4_soft_out_cmd
,
4241 "clear ip bgp * ipv4 (unicast|multicast) soft out",
4247 "Address Family modifier\n"
4248 "Address Family modifier\n"
4250 "Soft reconfig outbound update\n")
4252 if (strncmp (argv
[0], "m", 1) == 0)
4253 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4254 BGP_CLEAR_SOFT_OUT
, NULL
);
4256 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4257 BGP_CLEAR_SOFT_OUT
, NULL
);
4260 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
4261 clear_ip_bgp_all_ipv4_out_cmd
,
4262 "clear ip bgp * ipv4 (unicast|multicast) out",
4268 "Address Family modifier\n"
4269 "Address Family modifier\n"
4270 "Soft reconfig outbound update\n")
4272 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
4273 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
4274 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out",
4282 "Address Family modifier\n"
4283 "Address Family modifier\n"
4284 "Soft reconfig outbound update\n")
4286 if (strncmp (argv
[1], "m", 1) == 0)
4287 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4288 BGP_CLEAR_SOFT_OUT
, NULL
);
4290 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4291 BGP_CLEAR_SOFT_OUT
, NULL
);
4294 DEFUN (clear_ip_bgp_all_vpnv4_soft_out
,
4295 clear_ip_bgp_all_vpnv4_soft_out_cmd
,
4296 "clear ip bgp * vpnv4 unicast soft out",
4302 "Address Family Modifier\n"
4304 "Soft reconfig outbound update\n")
4306 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
4307 BGP_CLEAR_SOFT_OUT
, NULL
);
4310 ALIAS (clear_ip_bgp_all_vpnv4_soft_out
,
4311 clear_ip_bgp_all_vpnv4_out_cmd
,
4312 "clear ip bgp * vpnv4 unicast out",
4318 "Address Family Modifier\n"
4319 "Soft reconfig outbound update\n")
4321 DEFUN (clear_bgp_all_soft_out
,
4322 clear_bgp_all_soft_out_cmd
,
4323 "clear bgp * soft out",
4328 "Soft reconfig outbound update\n")
4331 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
4332 BGP_CLEAR_SOFT_OUT
, NULL
);
4334 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
4335 BGP_CLEAR_SOFT_OUT
, NULL
);
4338 ALIAS (clear_bgp_all_soft_out
,
4339 clear_bgp_instance_all_soft_out_cmd
,
4340 "clear bgp view WORD * soft out",
4347 "Soft reconfig outbound update\n")
4349 ALIAS (clear_bgp_all_soft_out
,
4350 clear_bgp_all_out_cmd
,
4355 "Soft reconfig outbound update\n")
4357 ALIAS (clear_bgp_all_soft_out
,
4358 clear_bgp_ipv6_all_soft_out_cmd
,
4359 "clear bgp ipv6 * soft out",
4365 "Soft reconfig outbound update\n")
4367 ALIAS (clear_bgp_all_soft_out
,
4368 clear_bgp_ipv6_all_out_cmd
,
4369 "clear bgp ipv6 * out",
4374 "Soft reconfig outbound update\n")
4376 DEFUN (clear_ip_bgp_peer_soft_out
,
4377 clear_ip_bgp_peer_soft_out_cmd
,
4378 "clear ip bgp A.B.C.D soft out",
4382 "BGP neighbor address to clear\n"
4384 "Soft reconfig outbound update\n")
4386 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4387 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4390 ALIAS (clear_ip_bgp_peer_soft_out
,
4391 clear_ip_bgp_peer_out_cmd
,
4392 "clear ip bgp A.B.C.D out",
4396 "BGP neighbor address to clear\n"
4397 "Soft reconfig outbound update\n")
4399 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
4400 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
4401 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out",
4405 "BGP neighbor address to clear\n"
4407 "Address Family modifier\n"
4408 "Address Family modifier\n"
4410 "Soft reconfig outbound update\n")
4412 if (strncmp (argv
[1], "m", 1) == 0)
4413 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
4414 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4416 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4417 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4420 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
4421 clear_ip_bgp_peer_ipv4_out_cmd
,
4422 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out",
4426 "BGP neighbor address to clear\n"
4428 "Address Family modifier\n"
4429 "Address Family modifier\n"
4430 "Soft reconfig outbound update\n")
4432 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out
,
4433 clear_ip_bgp_peer_vpnv4_soft_out_cmd
,
4434 "clear ip bgp A.B.C.D vpnv4 unicast soft out",
4438 "BGP neighbor address to clear\n"
4440 "Address Family Modifier\n"
4442 "Soft reconfig outbound update\n")
4444 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
4445 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4448 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out
,
4449 clear_ip_bgp_peer_vpnv4_out_cmd
,
4450 "clear ip bgp A.B.C.D vpnv4 unicast out",
4454 "BGP neighbor address to clear\n"
4456 "Address Family Modifier\n"
4457 "Soft reconfig outbound update\n")
4459 DEFUN (clear_bgp_peer_soft_out
,
4460 clear_bgp_peer_soft_out_cmd
,
4461 "clear bgp (A.B.C.D|X:X::X:X) soft out",
4464 "BGP neighbor address to clear\n"
4465 "BGP IPv6 neighbor to clear\n"
4467 "Soft reconfig outbound update\n")
4469 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
4470 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4473 ALIAS (clear_bgp_peer_soft_out
,
4474 clear_bgp_ipv6_peer_soft_out_cmd
,
4475 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out",
4479 "BGP neighbor address to clear\n"
4480 "BGP IPv6 neighbor to clear\n"
4482 "Soft reconfig outbound update\n")
4484 ALIAS (clear_bgp_peer_soft_out
,
4485 clear_bgp_peer_out_cmd
,
4486 "clear bgp (A.B.C.D|X:X::X:X) out",
4489 "BGP neighbor address to clear\n"
4490 "BGP IPv6 neighbor to clear\n"
4491 "Soft reconfig outbound update\n")
4493 ALIAS (clear_bgp_peer_soft_out
,
4494 clear_bgp_ipv6_peer_out_cmd
,
4495 "clear bgp ipv6 (A.B.C.D|X:X::X:X) out",
4499 "BGP neighbor address to clear\n"
4500 "BGP IPv6 neighbor to clear\n"
4501 "Soft reconfig outbound update\n")
4503 DEFUN (clear_ip_bgp_peer_group_soft_out
,
4504 clear_ip_bgp_peer_group_soft_out_cmd
,
4505 "clear ip bgp peer-group WORD soft out",
4509 "Clear all members of peer-group\n"
4510 "BGP peer-group name\n"
4512 "Soft reconfig outbound update\n")
4514 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4515 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4518 ALIAS (clear_ip_bgp_peer_group_soft_out
,
4519 clear_ip_bgp_peer_group_out_cmd
,
4520 "clear ip bgp peer-group WORD out",
4524 "Clear all members of peer-group\n"
4525 "BGP peer-group name\n"
4526 "Soft reconfig outbound update\n")
4528 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
4529 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
4530 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
4534 "Clear all members of peer-group\n"
4535 "BGP peer-group name\n"
4537 "Address Family modifier\n"
4538 "Address Family modifier\n"
4540 "Soft reconfig outbound update\n")
4542 if (strncmp (argv
[1], "m", 1) == 0)
4543 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
4544 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4546 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4547 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4550 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
4551 clear_ip_bgp_peer_group_ipv4_out_cmd
,
4552 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
4556 "Clear all members of peer-group\n"
4557 "BGP peer-group name\n"
4559 "Address Family modifier\n"
4560 "Address Family modifier\n"
4561 "Soft reconfig outbound update\n")
4563 DEFUN (clear_bgp_peer_group_soft_out
,
4564 clear_bgp_peer_group_soft_out_cmd
,
4565 "clear bgp peer-group WORD soft out",
4568 "Clear all members of peer-group\n"
4569 "BGP peer-group name\n"
4571 "Soft reconfig outbound update\n")
4573 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
4574 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4577 ALIAS (clear_bgp_peer_group_soft_out
,
4578 clear_bgp_ipv6_peer_group_soft_out_cmd
,
4579 "clear bgp ipv6 peer-group WORD soft out",
4583 "Clear all members of peer-group\n"
4584 "BGP peer-group name\n"
4586 "Soft reconfig outbound update\n")
4588 ALIAS (clear_bgp_peer_group_soft_out
,
4589 clear_bgp_peer_group_out_cmd
,
4590 "clear bgp peer-group WORD out",
4593 "Clear all members of peer-group\n"
4594 "BGP peer-group name\n"
4595 "Soft reconfig outbound update\n")
4597 ALIAS (clear_bgp_peer_group_soft_out
,
4598 clear_bgp_ipv6_peer_group_out_cmd
,
4599 "clear bgp ipv6 peer-group WORD out",
4603 "Clear all members of peer-group\n"
4604 "BGP peer-group name\n"
4605 "Soft reconfig outbound update\n")
4607 DEFUN (clear_ip_bgp_external_soft_out
,
4608 clear_ip_bgp_external_soft_out_cmd
,
4609 "clear ip bgp external soft out",
4613 "Clear all external peers\n"
4615 "Soft reconfig outbound update\n")
4617 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4618 BGP_CLEAR_SOFT_OUT
, NULL
);
4621 ALIAS (clear_ip_bgp_external_soft_out
,
4622 clear_ip_bgp_external_out_cmd
,
4623 "clear ip bgp external out",
4627 "Clear all external peers\n"
4628 "Soft reconfig outbound update\n")
4630 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
4631 clear_ip_bgp_external_ipv4_soft_out_cmd
,
4632 "clear ip bgp external ipv4 (unicast|multicast) soft out",
4636 "Clear all external peers\n"
4638 "Address Family modifier\n"
4639 "Address Family modifier\n"
4641 "Soft reconfig outbound update\n")
4643 if (strncmp (argv
[0], "m", 1) == 0)
4644 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
4645 BGP_CLEAR_SOFT_OUT
, NULL
);
4647 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4648 BGP_CLEAR_SOFT_OUT
, NULL
);
4651 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
4652 clear_ip_bgp_external_ipv4_out_cmd
,
4653 "clear ip bgp external ipv4 (unicast|multicast) out",
4657 "Clear all external peers\n"
4659 "Address Family modifier\n"
4660 "Address Family modifier\n"
4661 "Soft reconfig outbound update\n")
4663 DEFUN (clear_bgp_external_soft_out
,
4664 clear_bgp_external_soft_out_cmd
,
4665 "clear bgp external soft out",
4668 "Clear all external peers\n"
4670 "Soft reconfig outbound update\n")
4672 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
4673 BGP_CLEAR_SOFT_OUT
, NULL
);
4676 ALIAS (clear_bgp_external_soft_out
,
4677 clear_bgp_ipv6_external_soft_out_cmd
,
4678 "clear bgp ipv6 external soft out",
4682 "Clear all external peers\n"
4684 "Soft reconfig outbound update\n")
4686 ALIAS (clear_bgp_external_soft_out
,
4687 clear_bgp_external_out_cmd
,
4688 "clear bgp external out",
4691 "Clear all external peers\n"
4692 "Soft reconfig outbound update\n")
4694 ALIAS (clear_bgp_external_soft_out
,
4695 clear_bgp_ipv6_external_out_cmd
,
4696 "clear bgp ipv6 external WORD out",
4700 "Clear all external peers\n"
4701 "Soft reconfig outbound update\n")
4703 DEFUN (clear_ip_bgp_as_soft_out
,
4704 clear_ip_bgp_as_soft_out_cmd
,
4705 "clear ip bgp <1-65535> soft out",
4709 "Clear peers with the AS number\n"
4711 "Soft reconfig outbound update\n")
4713 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4714 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4717 ALIAS (clear_ip_bgp_as_soft_out
,
4718 clear_ip_bgp_as_out_cmd
,
4719 "clear ip bgp <1-65535> out",
4723 "Clear peers with the AS number\n"
4724 "Soft reconfig outbound update\n")
4726 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
4727 clear_ip_bgp_as_ipv4_soft_out_cmd
,
4728 "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft out",
4732 "Clear peers with the AS number\n"
4734 "Address Family modifier\n"
4735 "Address Family modifier\n"
4737 "Soft reconfig outbound update\n")
4739 if (strncmp (argv
[1], "m", 1) == 0)
4740 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
4741 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4743 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4744 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4747 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
4748 clear_ip_bgp_as_ipv4_out_cmd
,
4749 "clear ip bgp <1-65535> ipv4 (unicast|multicast) out",
4753 "Clear peers with the AS number\n"
4755 "Address Family modifier\n"
4756 "Address Family modifier\n"
4757 "Soft reconfig outbound update\n")
4759 DEFUN (clear_ip_bgp_as_vpnv4_soft_out
,
4760 clear_ip_bgp_as_vpnv4_soft_out_cmd
,
4761 "clear ip bgp <1-65535> vpnv4 unicast soft out",
4765 "Clear peers with the AS number\n"
4767 "Address Family modifier\n"
4769 "Soft reconfig outbound update\n")
4771 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
4772 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4775 ALIAS (clear_ip_bgp_as_vpnv4_soft_out
,
4776 clear_ip_bgp_as_vpnv4_out_cmd
,
4777 "clear ip bgp <1-65535> vpnv4 unicast out",
4781 "Clear peers with the AS number\n"
4783 "Address Family modifier\n"
4784 "Soft reconfig outbound update\n")
4786 DEFUN (clear_bgp_as_soft_out
,
4787 clear_bgp_as_soft_out_cmd
,
4788 "clear bgp <1-65535> soft out",
4791 "Clear peers with the AS number\n"
4793 "Soft reconfig outbound update\n")
4795 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
4796 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4799 ALIAS (clear_bgp_as_soft_out
,
4800 clear_bgp_ipv6_as_soft_out_cmd
,
4801 "clear bgp ipv6 <1-65535> soft out",
4805 "Clear peers with the AS number\n"
4807 "Soft reconfig outbound update\n")
4809 ALIAS (clear_bgp_as_soft_out
,
4810 clear_bgp_as_out_cmd
,
4811 "clear bgp <1-65535> out",
4814 "Clear peers with the AS number\n"
4815 "Soft reconfig outbound update\n")
4817 ALIAS (clear_bgp_as_soft_out
,
4818 clear_bgp_ipv6_as_out_cmd
,
4819 "clear bgp ipv6 <1-65535> out",
4823 "Clear peers with the AS number\n"
4824 "Soft reconfig outbound update\n")
4826 /* Inbound soft-reconfiguration */
4827 DEFUN (clear_ip_bgp_all_soft_in
,
4828 clear_ip_bgp_all_soft_in_cmd
,
4829 "clear ip bgp * soft in",
4835 "Soft reconfig inbound update\n")
4838 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4839 BGP_CLEAR_SOFT_IN
, NULL
);
4841 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4842 BGP_CLEAR_SOFT_IN
, NULL
);
4845 ALIAS (clear_ip_bgp_all_soft_in
,
4846 clear_ip_bgp_instance_all_soft_in_cmd
,
4847 "clear ip bgp view WORD * soft in",
4855 "Soft reconfig inbound update\n")
4857 ALIAS (clear_ip_bgp_all_soft_in
,
4858 clear_ip_bgp_all_in_cmd
,
4859 "clear ip bgp * in",
4864 "Soft reconfig inbound update\n")
4866 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
4867 clear_ip_bgp_all_in_prefix_filter_cmd
,
4868 "clear ip bgp * in prefix-filter",
4873 "Soft reconfig inbound update\n"
4874 "Push out prefix-list ORF and do inbound soft reconfig\n")
4877 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4878 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4880 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4881 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4884 ALIAS (clear_ip_bgp_all_in_prefix_filter
,
4885 clear_ip_bgp_instance_all_in_prefix_filter_cmd
,
4886 "clear ip bgp view WORD * in prefix-filter",
4893 "Soft reconfig inbound update\n"
4894 "Push out prefix-list ORF and do inbound soft reconfig\n")
4897 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
4898 clear_ip_bgp_all_ipv4_soft_in_cmd
,
4899 "clear ip bgp * ipv4 (unicast|multicast) soft in",
4905 "Address Family modifier\n"
4906 "Address Family modifier\n"
4908 "Soft reconfig inbound update\n")
4910 if (strncmp (argv
[0], "m", 1) == 0)
4911 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4912 BGP_CLEAR_SOFT_IN
, NULL
);
4914 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4915 BGP_CLEAR_SOFT_IN
, NULL
);
4918 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
4919 clear_ip_bgp_all_ipv4_in_cmd
,
4920 "clear ip bgp * ipv4 (unicast|multicast) in",
4926 "Address Family modifier\n"
4927 "Address Family modifier\n"
4928 "Soft reconfig inbound update\n")
4930 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
4931 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
4932 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in",
4940 "Address Family modifier\n"
4941 "Address Family modifier\n"
4943 "Soft reconfig inbound update\n")
4945 if (strncmp (argv
[1], "m", 1) == 0)
4946 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4947 BGP_CLEAR_SOFT_IN
, NULL
);
4949 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4950 BGP_CLEAR_SOFT_IN
, NULL
);
4953 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
4954 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
4955 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
4961 "Address Family modifier\n"
4962 "Address Family modifier\n"
4963 "Soft reconfig inbound update\n"
4964 "Push out prefix-list ORF and do inbound soft reconfig\n")
4966 if (strncmp (argv
[0], "m", 1) == 0)
4967 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4968 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4970 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4971 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4974 DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter
,
4975 clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
,
4976 "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter",
4982 "Address Family modifier\n"
4983 "Address Family modifier\n"
4984 "Soft reconfig inbound update\n"
4985 "Push out prefix-list ORF and do inbound soft reconfig\n")
4987 if (strncmp (argv
[1], "m", 1) == 0)
4988 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4989 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4991 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4992 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4995 DEFUN (clear_ip_bgp_all_vpnv4_soft_in
,
4996 clear_ip_bgp_all_vpnv4_soft_in_cmd
,
4997 "clear ip bgp * vpnv4 unicast soft in",
5003 "Address Family Modifier\n"
5005 "Soft reconfig inbound update\n")
5007 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
5008 BGP_CLEAR_SOFT_IN
, NULL
);
5011 ALIAS (clear_ip_bgp_all_vpnv4_soft_in
,
5012 clear_ip_bgp_all_vpnv4_in_cmd
,
5013 "clear ip bgp * vpnv4 unicast in",
5019 "Address Family Modifier\n"
5020 "Soft reconfig inbound update\n")
5022 DEFUN (clear_bgp_all_soft_in
,
5023 clear_bgp_all_soft_in_cmd
,
5024 "clear bgp * soft in",
5029 "Soft reconfig inbound update\n")
5032 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
5033 BGP_CLEAR_SOFT_IN
, NULL
);
5035 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5036 BGP_CLEAR_SOFT_IN
, NULL
);
5039 ALIAS (clear_bgp_all_soft_in
,
5040 clear_bgp_instance_all_soft_in_cmd
,
5041 "clear bgp view WORD * soft in",
5048 "Soft reconfig inbound update\n")
5050 ALIAS (clear_bgp_all_soft_in
,
5051 clear_bgp_ipv6_all_soft_in_cmd
,
5052 "clear bgp ipv6 * soft in",
5058 "Soft reconfig inbound update\n")
5060 ALIAS (clear_bgp_all_soft_in
,
5061 clear_bgp_all_in_cmd
,
5066 "Soft reconfig inbound update\n")
5068 ALIAS (clear_bgp_all_soft_in
,
5069 clear_bgp_ipv6_all_in_cmd
,
5070 "clear bgp ipv6 * in",
5075 "Soft reconfig inbound update\n")
5077 DEFUN (clear_bgp_all_in_prefix_filter
,
5078 clear_bgp_all_in_prefix_filter_cmd
,
5079 "clear bgp * in prefix-filter",
5083 "Soft reconfig inbound update\n"
5084 "Push out prefix-list ORF and do inbound soft reconfig\n")
5086 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5087 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5090 ALIAS (clear_bgp_all_in_prefix_filter
,
5091 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
5092 "clear bgp ipv6 * in prefix-filter",
5097 "Soft reconfig inbound update\n"
5098 "Push out prefix-list ORF and do inbound soft reconfig\n")
5100 DEFUN (clear_ip_bgp_peer_soft_in
,
5101 clear_ip_bgp_peer_soft_in_cmd
,
5102 "clear ip bgp A.B.C.D soft in",
5106 "BGP neighbor address to clear\n"
5108 "Soft reconfig inbound update\n")
5110 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5111 BGP_CLEAR_SOFT_IN
, argv
[0]);
5114 ALIAS (clear_ip_bgp_peer_soft_in
,
5115 clear_ip_bgp_peer_in_cmd
,
5116 "clear ip bgp A.B.C.D in",
5120 "BGP neighbor address to clear\n"
5121 "Soft reconfig inbound update\n")
5123 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
5124 clear_ip_bgp_peer_in_prefix_filter_cmd
,
5125 "clear ip bgp A.B.C.D in prefix-filter",
5129 "BGP neighbor address to clear\n"
5130 "Soft reconfig inbound update\n"
5131 "Push out the existing ORF prefix-list\n")
5133 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5134 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5137 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
5138 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
5139 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in",
5143 "BGP neighbor address to clear\n"
5145 "Address Family modifier\n"
5146 "Address Family modifier\n"
5148 "Soft reconfig inbound update\n")
5150 if (strncmp (argv
[1], "m", 1) == 0)
5151 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5152 BGP_CLEAR_SOFT_IN
, argv
[0]);
5154 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5155 BGP_CLEAR_SOFT_IN
, argv
[0]);
5158 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
5159 clear_ip_bgp_peer_ipv4_in_cmd
,
5160 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in",
5164 "BGP neighbor address to clear\n"
5166 "Address Family modifier\n"
5167 "Address Family modifier\n"
5168 "Soft reconfig inbound update\n")
5170 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
5171 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
5172 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter",
5176 "BGP neighbor address to clear\n"
5178 "Address Family modifier\n"
5179 "Address Family modifier\n"
5180 "Soft reconfig inbound update\n"
5181 "Push out the existing ORF prefix-list\n")
5183 if (strncmp (argv
[1], "m", 1) == 0)
5184 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5185 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5187 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5188 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5191 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in
,
5192 clear_ip_bgp_peer_vpnv4_soft_in_cmd
,
5193 "clear ip bgp A.B.C.D vpnv4 unicast soft in",
5197 "BGP neighbor address to clear\n"
5199 "Address Family Modifier\n"
5201 "Soft reconfig inbound update\n")
5203 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
5204 BGP_CLEAR_SOFT_IN
, argv
[0]);
5207 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in
,
5208 clear_ip_bgp_peer_vpnv4_in_cmd
,
5209 "clear ip bgp A.B.C.D vpnv4 unicast in",
5213 "BGP neighbor address to clear\n"
5215 "Address Family Modifier\n"
5216 "Soft reconfig inbound update\n")
5218 DEFUN (clear_bgp_peer_soft_in
,
5219 clear_bgp_peer_soft_in_cmd
,
5220 "clear bgp (A.B.C.D|X:X::X:X) soft in",
5223 "BGP neighbor address to clear\n"
5224 "BGP IPv6 neighbor to clear\n"
5226 "Soft reconfig inbound update\n")
5228 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5229 BGP_CLEAR_SOFT_IN
, argv
[0]);
5232 ALIAS (clear_bgp_peer_soft_in
,
5233 clear_bgp_ipv6_peer_soft_in_cmd
,
5234 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in",
5238 "BGP neighbor address to clear\n"
5239 "BGP IPv6 neighbor to clear\n"
5241 "Soft reconfig inbound update\n")
5243 ALIAS (clear_bgp_peer_soft_in
,
5244 clear_bgp_peer_in_cmd
,
5245 "clear bgp (A.B.C.D|X:X::X:X) in",
5248 "BGP neighbor address to clear\n"
5249 "BGP IPv6 neighbor to clear\n"
5250 "Soft reconfig inbound update\n")
5252 ALIAS (clear_bgp_peer_soft_in
,
5253 clear_bgp_ipv6_peer_in_cmd
,
5254 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in",
5258 "BGP neighbor address to clear\n"
5259 "BGP IPv6 neighbor to clear\n"
5260 "Soft reconfig inbound update\n")
5262 DEFUN (clear_bgp_peer_in_prefix_filter
,
5263 clear_bgp_peer_in_prefix_filter_cmd
,
5264 "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter",
5267 "BGP neighbor address to clear\n"
5268 "BGP IPv6 neighbor to clear\n"
5269 "Soft reconfig inbound update\n"
5270 "Push out the existing ORF prefix-list\n")
5272 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5273 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5276 ALIAS (clear_bgp_peer_in_prefix_filter
,
5277 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
5278 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter",
5282 "BGP neighbor address to clear\n"
5283 "BGP IPv6 neighbor to clear\n"
5284 "Soft reconfig inbound update\n"
5285 "Push out the existing ORF prefix-list\n")
5287 DEFUN (clear_ip_bgp_peer_group_soft_in
,
5288 clear_ip_bgp_peer_group_soft_in_cmd
,
5289 "clear ip bgp peer-group WORD soft in",
5293 "Clear all members of peer-group\n"
5294 "BGP peer-group name\n"
5296 "Soft reconfig inbound update\n")
5298 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5299 BGP_CLEAR_SOFT_IN
, argv
[0]);
5302 ALIAS (clear_ip_bgp_peer_group_soft_in
,
5303 clear_ip_bgp_peer_group_in_cmd
,
5304 "clear ip bgp peer-group WORD in",
5308 "Clear all members of peer-group\n"
5309 "BGP peer-group name\n"
5310 "Soft reconfig inbound update\n")
5312 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
5313 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
5314 "clear ip bgp peer-group WORD in prefix-filter",
5318 "Clear all members of peer-group\n"
5319 "BGP peer-group name\n"
5320 "Soft reconfig inbound update\n"
5321 "Push out prefix-list ORF and do inbound soft reconfig\n")
5323 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5324 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5327 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
5328 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
5329 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
5333 "Clear all members of peer-group\n"
5334 "BGP peer-group name\n"
5336 "Address Family modifier\n"
5337 "Address Family modifier\n"
5339 "Soft reconfig inbound update\n")
5341 if (strncmp (argv
[1], "m", 1) == 0)
5342 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5343 BGP_CLEAR_SOFT_IN
, argv
[0]);
5345 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5346 BGP_CLEAR_SOFT_IN
, argv
[0]);
5349 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
5350 clear_ip_bgp_peer_group_ipv4_in_cmd
,
5351 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
5355 "Clear all members of peer-group\n"
5356 "BGP peer-group name\n"
5358 "Address Family modifier\n"
5359 "Address Family modifier\n"
5360 "Soft reconfig inbound update\n")
5362 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
5363 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
5364 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
5368 "Clear all members of peer-group\n"
5369 "BGP peer-group name\n"
5371 "Address Family modifier\n"
5372 "Address Family modifier\n"
5373 "Soft reconfig inbound update\n"
5374 "Push out prefix-list ORF and do inbound soft reconfig\n")
5376 if (strncmp (argv
[1], "m", 1) == 0)
5377 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5378 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5380 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5381 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5384 DEFUN (clear_bgp_peer_group_soft_in
,
5385 clear_bgp_peer_group_soft_in_cmd
,
5386 "clear bgp peer-group WORD soft in",
5389 "Clear all members of peer-group\n"
5390 "BGP peer-group name\n"
5392 "Soft reconfig inbound update\n")
5394 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5395 BGP_CLEAR_SOFT_IN
, argv
[0]);
5398 ALIAS (clear_bgp_peer_group_soft_in
,
5399 clear_bgp_ipv6_peer_group_soft_in_cmd
,
5400 "clear bgp ipv6 peer-group WORD soft in",
5404 "Clear all members of peer-group\n"
5405 "BGP peer-group name\n"
5407 "Soft reconfig inbound update\n")
5409 ALIAS (clear_bgp_peer_group_soft_in
,
5410 clear_bgp_peer_group_in_cmd
,
5411 "clear bgp peer-group WORD in",
5414 "Clear all members of peer-group\n"
5415 "BGP peer-group name\n"
5416 "Soft reconfig inbound update\n")
5418 ALIAS (clear_bgp_peer_group_soft_in
,
5419 clear_bgp_ipv6_peer_group_in_cmd
,
5420 "clear bgp ipv6 peer-group WORD in",
5424 "Clear all members of peer-group\n"
5425 "BGP peer-group name\n"
5426 "Soft reconfig inbound update\n")
5428 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
5429 clear_bgp_peer_group_in_prefix_filter_cmd
,
5430 "clear bgp peer-group WORD in prefix-filter",
5433 "Clear all members of peer-group\n"
5434 "BGP peer-group name\n"
5435 "Soft reconfig inbound update\n"
5436 "Push out prefix-list ORF and do inbound soft reconfig\n")
5438 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5439 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5442 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
5443 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
5444 "clear bgp ipv6 peer-group WORD in prefix-filter",
5448 "Clear all members of peer-group\n"
5449 "BGP peer-group name\n"
5450 "Soft reconfig inbound update\n"
5451 "Push out prefix-list ORF and do inbound soft reconfig\n")
5453 DEFUN (clear_ip_bgp_external_soft_in
,
5454 clear_ip_bgp_external_soft_in_cmd
,
5455 "clear ip bgp external soft in",
5459 "Clear all external peers\n"
5461 "Soft reconfig inbound update\n")
5463 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5464 BGP_CLEAR_SOFT_IN
, NULL
);
5467 ALIAS (clear_ip_bgp_external_soft_in
,
5468 clear_ip_bgp_external_in_cmd
,
5469 "clear ip bgp external in",
5473 "Clear all external peers\n"
5474 "Soft reconfig inbound update\n")
5476 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
5477 clear_ip_bgp_external_in_prefix_filter_cmd
,
5478 "clear ip bgp external in prefix-filter",
5482 "Clear all external peers\n"
5483 "Soft reconfig inbound update\n"
5484 "Push out prefix-list ORF and do inbound soft reconfig\n")
5486 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5487 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5490 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
5491 clear_ip_bgp_external_ipv4_soft_in_cmd
,
5492 "clear ip bgp external ipv4 (unicast|multicast) soft in",
5496 "Clear all external peers\n"
5498 "Address Family modifier\n"
5499 "Address Family modifier\n"
5501 "Soft reconfig inbound update\n")
5503 if (strncmp (argv
[0], "m", 1) == 0)
5504 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5505 BGP_CLEAR_SOFT_IN
, NULL
);
5507 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5508 BGP_CLEAR_SOFT_IN
, NULL
);
5511 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
5512 clear_ip_bgp_external_ipv4_in_cmd
,
5513 "clear ip bgp external ipv4 (unicast|multicast) in",
5517 "Clear all external peers\n"
5519 "Address Family modifier\n"
5520 "Address Family modifier\n"
5521 "Soft reconfig inbound update\n")
5523 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
5524 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
5525 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
5529 "Clear all external peers\n"
5531 "Address Family modifier\n"
5532 "Address Family modifier\n"
5533 "Soft reconfig inbound update\n"
5534 "Push out prefix-list ORF and do inbound soft reconfig\n")
5536 if (strncmp (argv
[0], "m", 1) == 0)
5537 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5538 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5540 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5541 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5544 DEFUN (clear_bgp_external_soft_in
,
5545 clear_bgp_external_soft_in_cmd
,
5546 "clear bgp external soft in",
5549 "Clear all external peers\n"
5551 "Soft reconfig inbound update\n")
5553 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5554 BGP_CLEAR_SOFT_IN
, NULL
);
5557 ALIAS (clear_bgp_external_soft_in
,
5558 clear_bgp_ipv6_external_soft_in_cmd
,
5559 "clear bgp ipv6 external soft in",
5563 "Clear all external peers\n"
5565 "Soft reconfig inbound update\n")
5567 ALIAS (clear_bgp_external_soft_in
,
5568 clear_bgp_external_in_cmd
,
5569 "clear bgp external in",
5572 "Clear all external peers\n"
5573 "Soft reconfig inbound update\n")
5575 ALIAS (clear_bgp_external_soft_in
,
5576 clear_bgp_ipv6_external_in_cmd
,
5577 "clear bgp ipv6 external WORD in",
5581 "Clear all external peers\n"
5582 "Soft reconfig inbound update\n")
5584 DEFUN (clear_bgp_external_in_prefix_filter
,
5585 clear_bgp_external_in_prefix_filter_cmd
,
5586 "clear bgp external in prefix-filter",
5589 "Clear all external peers\n"
5590 "Soft reconfig inbound update\n"
5591 "Push out prefix-list ORF and do inbound soft reconfig\n")
5593 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5594 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5597 ALIAS (clear_bgp_external_in_prefix_filter
,
5598 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
5599 "clear bgp ipv6 external in prefix-filter",
5603 "Clear all external peers\n"
5604 "Soft reconfig inbound update\n"
5605 "Push out prefix-list ORF and do inbound soft reconfig\n")
5607 DEFUN (clear_ip_bgp_as_soft_in
,
5608 clear_ip_bgp_as_soft_in_cmd
,
5609 "clear ip bgp <1-65535> soft in",
5613 "Clear peers with the AS number\n"
5615 "Soft reconfig inbound update\n")
5617 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5618 BGP_CLEAR_SOFT_IN
, argv
[0]);
5621 ALIAS (clear_ip_bgp_as_soft_in
,
5622 clear_ip_bgp_as_in_cmd
,
5623 "clear ip bgp <1-65535> in",
5627 "Clear peers with the AS number\n"
5628 "Soft reconfig inbound update\n")
5630 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
5631 clear_ip_bgp_as_in_prefix_filter_cmd
,
5632 "clear ip bgp <1-65535> in prefix-filter",
5636 "Clear peers with the AS number\n"
5637 "Soft reconfig inbound update\n"
5638 "Push out prefix-list ORF and do inbound soft reconfig\n")
5640 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5641 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5644 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
5645 clear_ip_bgp_as_ipv4_soft_in_cmd
,
5646 "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft in",
5650 "Clear peers with the AS number\n"
5652 "Address Family modifier\n"
5653 "Address Family modifier\n"
5655 "Soft reconfig inbound update\n")
5657 if (strncmp (argv
[1], "m", 1) == 0)
5658 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5659 BGP_CLEAR_SOFT_IN
, argv
[0]);
5661 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5662 BGP_CLEAR_SOFT_IN
, argv
[0]);
5665 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
5666 clear_ip_bgp_as_ipv4_in_cmd
,
5667 "clear ip bgp <1-65535> ipv4 (unicast|multicast) in",
5671 "Clear peers with the AS number\n"
5673 "Address Family modifier\n"
5674 "Address Family modifier\n"
5675 "Soft reconfig inbound update\n")
5677 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
5678 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
5679 "clear ip bgp <1-65535> ipv4 (unicast|multicast) in prefix-filter",
5683 "Clear peers with the AS number\n"
5685 "Address Family modifier\n"
5686 "Address Family modifier\n"
5687 "Soft reconfig inbound update\n"
5688 "Push out prefix-list ORF and do inbound soft reconfig\n")
5690 if (strncmp (argv
[1], "m", 1) == 0)
5691 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5692 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5694 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5695 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5698 DEFUN (clear_ip_bgp_as_vpnv4_soft_in
,
5699 clear_ip_bgp_as_vpnv4_soft_in_cmd
,
5700 "clear ip bgp <1-65535> vpnv4 unicast soft in",
5704 "Clear peers with the AS number\n"
5706 "Address Family modifier\n"
5708 "Soft reconfig inbound update\n")
5710 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
5711 BGP_CLEAR_SOFT_IN
, argv
[0]);
5714 ALIAS (clear_ip_bgp_as_vpnv4_soft_in
,
5715 clear_ip_bgp_as_vpnv4_in_cmd
,
5716 "clear ip bgp <1-65535> vpnv4 unicast in",
5720 "Clear peers with the AS number\n"
5722 "Address Family modifier\n"
5723 "Soft reconfig inbound update\n")
5725 DEFUN (clear_bgp_as_soft_in
,
5726 clear_bgp_as_soft_in_cmd
,
5727 "clear bgp <1-65535> soft in",
5730 "Clear peers with the AS number\n"
5732 "Soft reconfig inbound update\n")
5734 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5735 BGP_CLEAR_SOFT_IN
, argv
[0]);
5738 ALIAS (clear_bgp_as_soft_in
,
5739 clear_bgp_ipv6_as_soft_in_cmd
,
5740 "clear bgp ipv6 <1-65535> soft in",
5744 "Clear peers with the AS number\n"
5746 "Soft reconfig inbound update\n")
5748 ALIAS (clear_bgp_as_soft_in
,
5749 clear_bgp_as_in_cmd
,
5750 "clear bgp <1-65535> in",
5753 "Clear peers with the AS number\n"
5754 "Soft reconfig inbound update\n")
5756 ALIAS (clear_bgp_as_soft_in
,
5757 clear_bgp_ipv6_as_in_cmd
,
5758 "clear bgp ipv6 <1-65535> in",
5762 "Clear peers with the AS number\n"
5763 "Soft reconfig inbound update\n")
5765 DEFUN (clear_bgp_as_in_prefix_filter
,
5766 clear_bgp_as_in_prefix_filter_cmd
,
5767 "clear bgp <1-65535> in prefix-filter",
5770 "Clear peers with the AS number\n"
5771 "Soft reconfig inbound update\n"
5772 "Push out prefix-list ORF and do inbound soft reconfig\n")
5774 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5775 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5778 ALIAS (clear_bgp_as_in_prefix_filter
,
5779 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
5780 "clear bgp ipv6 <1-65535> in prefix-filter",
5784 "Clear peers with the AS number\n"
5785 "Soft reconfig inbound update\n"
5786 "Push out prefix-list ORF and do inbound soft reconfig\n")
5788 /* Both soft-reconfiguration */
5789 DEFUN (clear_ip_bgp_all_soft
,
5790 clear_ip_bgp_all_soft_cmd
,
5791 "clear ip bgp * soft",
5799 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5800 BGP_CLEAR_SOFT_BOTH
, NULL
);
5802 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5803 BGP_CLEAR_SOFT_BOTH
, NULL
);
5806 ALIAS (clear_ip_bgp_all_soft
,
5807 clear_ip_bgp_instance_all_soft_cmd
,
5808 "clear ip bgp view WORD * soft",
5818 DEFUN (clear_ip_bgp_all_ipv4_soft
,
5819 clear_ip_bgp_all_ipv4_soft_cmd
,
5820 "clear ip bgp * ipv4 (unicast|multicast) soft",
5826 "Address Family Modifier\n"
5827 "Address Family Modifier\n"
5830 if (strncmp (argv
[0], "m", 1) == 0)
5831 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5832 BGP_CLEAR_SOFT_BOTH
, NULL
);
5834 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5835 BGP_CLEAR_SOFT_BOTH
, NULL
);
5838 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
5839 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
5840 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft",
5848 "Address Family Modifier\n"
5849 "Address Family Modifier\n"
5852 if (strncmp (argv
[1], "m", 1) == 0)
5853 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5854 BGP_CLEAR_SOFT_BOTH
, NULL
);
5856 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5857 BGP_CLEAR_SOFT_BOTH
, NULL
);
5860 DEFUN (clear_ip_bgp_all_vpnv4_soft
,
5861 clear_ip_bgp_all_vpnv4_soft_cmd
,
5862 "clear ip bgp * vpnv4 unicast soft",
5868 "Address Family Modifier\n"
5871 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
5872 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5875 DEFUN (clear_bgp_all_soft
,
5876 clear_bgp_all_soft_cmd
,
5884 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
5885 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5887 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5888 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5891 ALIAS (clear_bgp_all_soft
,
5892 clear_bgp_instance_all_soft_cmd
,
5893 "clear bgp view WORD * soft",
5901 ALIAS (clear_bgp_all_soft
,
5902 clear_bgp_ipv6_all_soft_cmd
,
5903 "clear bgp ipv6 * soft",
5910 DEFUN (clear_ip_bgp_peer_soft
,
5911 clear_ip_bgp_peer_soft_cmd
,
5912 "clear ip bgp A.B.C.D soft",
5916 "BGP neighbor address to clear\n"
5919 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5920 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5923 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
5924 clear_ip_bgp_peer_ipv4_soft_cmd
,
5925 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft",
5929 "BGP neighbor address to clear\n"
5931 "Address Family Modifier\n"
5932 "Address Family Modifier\n"
5935 if (strncmp (argv
[1], "m", 1) == 0)
5936 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5937 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5939 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5940 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5943 DEFUN (clear_ip_bgp_peer_vpnv4_soft
,
5944 clear_ip_bgp_peer_vpnv4_soft_cmd
,
5945 "clear ip bgp A.B.C.D vpnv4 unicast soft",
5949 "BGP neighbor address to clear\n"
5951 "Address Family Modifier\n"
5954 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
5955 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5958 DEFUN (clear_bgp_peer_soft
,
5959 clear_bgp_peer_soft_cmd
,
5960 "clear bgp (A.B.C.D|X:X::X:X) soft",
5963 "BGP neighbor address to clear\n"
5964 "BGP IPv6 neighbor to clear\n"
5967 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5968 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5971 ALIAS (clear_bgp_peer_soft
,
5972 clear_bgp_ipv6_peer_soft_cmd
,
5973 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft",
5977 "BGP neighbor address to clear\n"
5978 "BGP IPv6 neighbor to clear\n"
5981 DEFUN (clear_ip_bgp_peer_group_soft
,
5982 clear_ip_bgp_peer_group_soft_cmd
,
5983 "clear ip bgp peer-group WORD soft",
5987 "Clear all members of peer-group\n"
5988 "BGP peer-group name\n"
5991 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5992 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5995 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
5996 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
5997 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
6001 "Clear all members of peer-group\n"
6002 "BGP peer-group name\n"
6004 "Address Family modifier\n"
6005 "Address Family modifier\n"
6008 if (strncmp (argv
[1], "m", 1) == 0)
6009 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
6010 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6012 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
6013 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6016 DEFUN (clear_bgp_peer_group_soft
,
6017 clear_bgp_peer_group_soft_cmd
,
6018 "clear bgp peer-group WORD soft",
6021 "Clear all members of peer-group\n"
6022 "BGP peer-group name\n"
6025 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
6026 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6029 ALIAS (clear_bgp_peer_group_soft
,
6030 clear_bgp_ipv6_peer_group_soft_cmd
,
6031 "clear bgp ipv6 peer-group WORD soft",
6035 "Clear all members of peer-group\n"
6036 "BGP peer-group name\n"
6039 DEFUN (clear_ip_bgp_external_soft
,
6040 clear_ip_bgp_external_soft_cmd
,
6041 "clear ip bgp external soft",
6045 "Clear all external peers\n"
6048 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6049 BGP_CLEAR_SOFT_BOTH
, NULL
);
6052 DEFUN (clear_ip_bgp_external_ipv4_soft
,
6053 clear_ip_bgp_external_ipv4_soft_cmd
,
6054 "clear ip bgp external ipv4 (unicast|multicast) soft",
6058 "Clear all external peers\n"
6060 "Address Family modifier\n"
6061 "Address Family modifier\n"
6064 if (strncmp (argv
[0], "m", 1) == 0)
6065 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
6066 BGP_CLEAR_SOFT_BOTH
, NULL
);
6068 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
6069 BGP_CLEAR_SOFT_BOTH
, NULL
);
6072 DEFUN (clear_bgp_external_soft
,
6073 clear_bgp_external_soft_cmd
,
6074 "clear bgp external soft",
6077 "Clear all external peers\n"
6080 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
6081 BGP_CLEAR_SOFT_BOTH
, NULL
);
6084 ALIAS (clear_bgp_external_soft
,
6085 clear_bgp_ipv6_external_soft_cmd
,
6086 "clear bgp ipv6 external soft",
6090 "Clear all external peers\n"
6093 DEFUN (clear_ip_bgp_as_soft
,
6094 clear_ip_bgp_as_soft_cmd
,
6095 "clear ip bgp <1-65535> soft",
6099 "Clear peers with the AS number\n"
6102 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
6103 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6106 DEFUN (clear_ip_bgp_as_ipv4_soft
,
6107 clear_ip_bgp_as_ipv4_soft_cmd
,
6108 "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft",
6112 "Clear peers with the AS number\n"
6114 "Address Family Modifier\n"
6115 "Address Family Modifier\n"
6118 if (strncmp (argv
[1], "m", 1) == 0)
6119 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
6120 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6122 return bgp_clear_vty (vty
, NULL
,AFI_IP
, SAFI_UNICAST
, clear_as
,
6123 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6126 DEFUN (clear_ip_bgp_as_vpnv4_soft
,
6127 clear_ip_bgp_as_vpnv4_soft_cmd
,
6128 "clear ip bgp <1-65535> vpnv4 unicast soft",
6132 "Clear peers with the AS number\n"
6134 "Address Family Modifier\n"
6137 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
6138 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6141 DEFUN (clear_bgp_as_soft
,
6142 clear_bgp_as_soft_cmd
,
6143 "clear bgp <1-65535> soft",
6146 "Clear peers with the AS number\n"
6149 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
6150 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
6153 ALIAS (clear_bgp_as_soft
,
6154 clear_bgp_ipv6_as_soft_cmd
,
6155 "clear bgp ipv6 <1-65535> soft",
6159 "Clear peers with the AS number\n"
6162 /* RS-client soft reconfiguration. */
6164 DEFUN (clear_bgp_all_rsclient
,
6165 clear_bgp_all_rsclient_cmd
,
6166 "clear bgp * rsclient",
6170 "Soft reconfig for rsclient RIB\n")
6173 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
6174 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6176 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
6177 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6180 ALIAS (clear_bgp_all_rsclient
,
6181 clear_bgp_ipv6_all_rsclient_cmd
,
6182 "clear bgp ipv6 * rsclient",
6187 "Soft reconfig for rsclient RIB\n")
6189 ALIAS (clear_bgp_all_rsclient
,
6190 clear_bgp_instance_all_rsclient_cmd
,
6191 "clear bgp view WORD * rsclient",
6197 "Soft reconfig for rsclient RIB\n")
6199 ALIAS (clear_bgp_all_rsclient
,
6200 clear_bgp_ipv6_instance_all_rsclient_cmd
,
6201 "clear bgp ipv6 view WORD * rsclient",
6208 "Soft reconfig for rsclient RIB\n")
6209 #endif /* HAVE_IPV6 */
6211 DEFUN (clear_ip_bgp_all_rsclient
,
6212 clear_ip_bgp_all_rsclient_cmd
,
6213 "clear ip bgp * rsclient",
6218 "Soft reconfig for rsclient RIB\n")
6221 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
6222 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6224 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
6225 BGP_CLEAR_SOFT_RSCLIENT
, NULL
);
6228 ALIAS (clear_ip_bgp_all_rsclient
,
6229 clear_ip_bgp_instance_all_rsclient_cmd
,
6230 "clear ip bgp view WORD * rsclient",
6237 "Soft reconfig for rsclient RIB\n")
6240 DEFUN (clear_bgp_peer_rsclient
,
6241 clear_bgp_peer_rsclient_cmd
,
6242 "clear bgp (A.B.C.D|X:X::X:X) rsclient",
6245 "BGP neighbor IP address to clear\n"
6246 "BGP IPv6 neighbor to clear\n"
6247 "Soft reconfig for rsclient RIB\n")
6250 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6251 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6253 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
6254 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6257 ALIAS (clear_bgp_peer_rsclient
,
6258 clear_bgp_ipv6_peer_rsclient_cmd
,
6259 "clear bgp ipv6 (A.B.C.D|X:X::X:X) rsclient",
6263 "BGP neighbor IP address to clear\n"
6264 "BGP IPv6 neighbor to clear\n"
6265 "Soft reconfig for rsclient RIB\n")
6267 ALIAS (clear_bgp_peer_rsclient
,
6268 clear_bgp_instance_peer_rsclient_cmd
,
6269 "clear bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6274 "BGP neighbor IP address to clear\n"
6275 "BGP IPv6 neighbor to clear\n"
6276 "Soft reconfig for rsclient RIB\n")
6278 ALIAS (clear_bgp_peer_rsclient
,
6279 clear_bgp_ipv6_instance_peer_rsclient_cmd
,
6280 "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X) rsclient",
6286 "BGP neighbor IP address to clear\n"
6287 "BGP IPv6 neighbor to clear\n"
6288 "Soft reconfig for rsclient RIB\n")
6289 #endif /* HAVE_IPV6 */
6291 DEFUN (clear_ip_bgp_peer_rsclient
,
6292 clear_ip_bgp_peer_rsclient_cmd
,
6293 "clear ip bgp (A.B.C.D|X:X::X:X) rsclient",
6297 "BGP neighbor IP address to clear\n"
6298 "BGP IPv6 neighbor to clear\n"
6299 "Soft reconfig for rsclient RIB\n")
6302 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_peer
,
6303 BGP_CLEAR_SOFT_RSCLIENT
, argv
[1]);
6305 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
6306 BGP_CLEAR_SOFT_RSCLIENT
, argv
[0]);
6309 ALIAS (clear_ip_bgp_peer_rsclient
,
6310 clear_ip_bgp_instance_peer_rsclient_cmd
,
6311 "clear ip bgp view WORD (A.B.C.D|X:X::X:X) rsclient",
6317 "BGP neighbor IP address to clear\n"
6318 "BGP IPv6 neighbor to clear\n"
6319 "Soft reconfig for rsclient RIB\n")
6322 /* Show BGP peer's summary information. */
6324 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
)
6327 struct listnode
*nn
;
6329 char timebuf
[BGP_UPTIME_LEN
];
6332 /* Header string for each address family. */
6333 static char header
[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
6335 LIST_LOOP (bgp
->peer
, peer
, nn
)
6337 if (peer
->afc
[afi
][safi
])
6342 "BGP router identifier %s, local AS number %d%s",
6343 inet_ntoa (bgp
->router_id
), bgp
->as
, VTY_NEWLINE
);
6345 "%ld BGP AS-PATH entries%s", aspath_count (),
6348 "%ld BGP community entries%s", community_count (),
6351 if (CHECK_FLAG(bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
6352 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
6353 vty_out (vty
, "%s", VTY_NEWLINE
);
6354 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
6358 len
= vty_out (vty
, "%s", peer
->host
);
6361 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
6363 vty_out (vty
, "%*s", len
, " ");
6365 switch (peer
->version
)
6368 vty_out (vty
, "4 ");
6370 case BGP_VERSION_MP_4_DRAFT_00
:
6371 vty_out (vty
, "4-");
6375 vty_out (vty
, "%5d %7d %7d %8d %4d %4ld ",
6377 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
6378 + peer
->notify_in
+ peer
->refresh_in
+ peer
->dynamic_cap_in
,
6379 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
6380 + peer
->notify_out
+ peer
->refresh_out
6381 + peer
->dynamic_cap_out
,
6382 0, 0, peer
->obuf
->count
);
6384 vty_out (vty
, "%8s",
6385 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
));
6387 if (peer
->status
== Established
)
6389 vty_out (vty
, " %8ld", peer
->pcount
[afi
][safi
]);
6393 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
6394 vty_out (vty
, " Idle (Admin)");
6395 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
6396 vty_out (vty
, " Idle (PfxCt)");
6398 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, peer
->status
));
6401 vty_out (vty
, "%s", VTY_NEWLINE
);
6406 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
6407 count
, VTY_NEWLINE
);
6409 vty_out (vty
, "No %s neighbor is configured%s",
6410 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
6415 bgp_show_summary_vty (struct vty
*vty
, char *name
, afi_t afi
, safi_t safi
)
6421 bgp
= bgp_lookup_by_name (name
);
6425 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
6429 bgp_show_summary (vty
, bgp
, afi
, safi
);
6433 bgp
= bgp_get_default ();
6436 bgp_show_summary (vty
, bgp
, afi
, safi
);
6441 /* `show ip bgp summary' commands. */
6442 DEFUN (show_ip_bgp_summary
,
6443 show_ip_bgp_summary_cmd
,
6444 "show ip bgp summary",
6448 "Summary of BGP neighbor status\n")
6450 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6453 DEFUN (show_ip_bgp_instance_summary
,
6454 show_ip_bgp_instance_summary_cmd
,
6455 "show ip bgp view WORD summary",
6461 "Summary of BGP neighbor status\n")
6463 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6466 DEFUN (show_ip_bgp_ipv4_summary
,
6467 show_ip_bgp_ipv4_summary_cmd
,
6468 "show ip bgp ipv4 (unicast|multicast) summary",
6473 "Address Family modifier\n"
6474 "Address Family modifier\n"
6475 "Summary of BGP neighbor status\n")
6477 if (strncmp (argv
[0], "m", 1) == 0)
6478 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
6480 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6483 DEFUN (show_ip_bgp_instance_ipv4_summary
,
6484 show_ip_bgp_instance_ipv4_summary_cmd
,
6485 "show ip bgp view WORD ipv4 (unicast|multicast) summary",
6492 "Address Family modifier\n"
6493 "Address Family modifier\n"
6494 "Summary of BGP neighbor status\n")
6496 if (strncmp (argv
[1], "m", 1) == 0)
6497 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
6499 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6502 DEFUN (show_ip_bgp_vpnv4_all_summary
,
6503 show_ip_bgp_vpnv4_all_summary_cmd
,
6504 "show ip bgp vpnv4 all summary",
6508 "Display VPNv4 NLRI specific information\n"
6509 "Display information about all VPNv4 NLRIs\n"
6510 "Summary of BGP neighbor status\n")
6512 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6515 DEFUN (show_ip_bgp_vpnv4_rd_summary
,
6516 show_ip_bgp_vpnv4_rd_summary_cmd
,
6517 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary",
6521 "Display VPNv4 NLRI specific information\n"
6522 "Display information for a route distinguisher\n"
6523 "VPN Route Distinguisher\n"
6524 "Summary of BGP neighbor status\n")
6527 struct prefix_rd prd
;
6529 ret
= str2prefix_rd (argv
[0], &prd
);
6532 vty_out (vty
, "%% Malformed Route Distinguisher%s", VTY_NEWLINE
);
6536 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6540 DEFUN (show_bgp_summary
,
6541 show_bgp_summary_cmd
,
6545 "Summary of BGP neighbor status\n")
6547 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6550 DEFUN (show_bgp_instance_summary
,
6551 show_bgp_instance_summary_cmd
,
6552 "show bgp view WORD summary",
6557 "Summary of BGP neighbor status\n")
6559 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
6562 ALIAS (show_bgp_summary
,
6563 show_bgp_ipv6_summary_cmd
,
6564 "show bgp ipv6 summary",
6568 "Summary of BGP neighbor status\n")
6570 ALIAS (show_bgp_instance_summary
,
6571 show_bgp_instance_ipv6_summary_cmd
,
6572 "show bgp view WORD ipv6 summary",
6578 "Summary of BGP neighbor status\n")
6581 DEFUN (show_ipv6_bgp_summary
,
6582 show_ipv6_bgp_summary_cmd
,
6583 "show ipv6 bgp summary",
6587 "Summary of BGP neighbor status\n")
6589 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6593 DEFUN (show_ipv6_mbgp_summary
,
6594 show_ipv6_mbgp_summary_cmd
,
6595 "show ipv6 mbgp summary",
6599 "Summary of BGP neighbor status\n")
6601 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
);
6603 #endif /* HAVE_IPV6 */
6606 afi_safi_print (afi_t afi
, safi_t safi
)
6608 if (afi
== AFI_IP
&& safi
== SAFI_UNICAST
)
6609 return "IPv4 Unicast";
6610 else if (afi
== AFI_IP
&& safi
== SAFI_MULTICAST
)
6611 return "IPv4 Multicast";
6612 else if (afi
== AFI_IP
&& safi
== SAFI_MPLS_VPN
)
6613 return "VPNv4 Unicast";
6614 else if (afi
== AFI_IP6
&& safi
== SAFI_UNICAST
)
6615 return "IPv6 Unicast";
6616 else if (afi
== AFI_IP6
&& safi
== SAFI_MULTICAST
)
6617 return "IPv6 Multicast";
6622 /* Show BGP peer's information. */
6630 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
,
6631 afi_t afi
, safi_t safi
,
6632 u_int16_t adv_smcap
, u_int16_t adv_rmcap
,
6633 u_int16_t rcv_smcap
, u_int16_t rcv_rmcap
)
6636 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
6637 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
6639 vty_out (vty
, " Send-mode: ");
6640 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
6641 vty_out (vty
, "advertised");
6642 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
6643 vty_out (vty
, "%sreceived",
6644 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
6646 vty_out (vty
, "%s", VTY_NEWLINE
);
6650 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
6651 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
6653 vty_out (vty
, " Receive-mode: ");
6654 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
6655 vty_out (vty
, "advertised");
6656 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
6657 vty_out (vty
, "%sreceived",
6658 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
6660 vty_out (vty
, "%s", VTY_NEWLINE
);
6665 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
)
6667 struct bgp_filter
*filter
;
6668 char orf_pfx_name
[BUFSIZ
];
6671 filter
= &p
->filter
[afi
][safi
];
6673 vty_out (vty
, " For address family: %s%s", afi_safi_print (afi
, safi
),
6676 if (p
->af_group
[afi
][safi
])
6677 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
6679 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
6680 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
6681 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
6682 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
6683 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
6684 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
6685 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
6687 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
6688 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
6689 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
6690 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
6692 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
6693 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
6694 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
6695 PEER_CAP_ORF_PREFIX_SM_ADV
,
6696 PEER_CAP_ORF_PREFIX_RM_ADV
,
6697 PEER_CAP_ORF_PREFIX_SM_RCV
,
6698 PEER_CAP_ORF_PREFIX_RM_RCV
);
6700 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
6701 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
6702 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
6703 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
6705 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
6706 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
6707 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
6708 PEER_CAP_ORF_PREFIX_SM_ADV
,
6709 PEER_CAP_ORF_PREFIX_RM_ADV
,
6710 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
6711 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
);
6714 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
6715 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
);
6717 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
6720 vty_out (vty
, " Outbound Route Filter (ORF):");
6721 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
6722 vty_out (vty
, " sent;");
6724 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
6725 vty_out (vty
, "%s", VTY_NEWLINE
);
6727 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
6728 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
6730 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
6731 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
6732 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
6733 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
6734 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
6735 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
6736 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
6737 vty_out (vty
, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE
);
6738 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
))
6739 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
6740 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
6741 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
6742 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
6743 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
6744 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
6745 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
6746 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
6747 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
6749 vty_out (vty
, " Community attribute sent to this neighbor");
6750 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
6751 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
6752 vty_out (vty
, "(both)%s", VTY_NEWLINE
);
6753 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
6754 vty_out (vty
, "(extended)%s", VTY_NEWLINE
);
6756 vty_out (vty
, "(standard)%s", VTY_NEWLINE
);
6758 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
6760 vty_out (vty
, " Default information originate,");
6762 if (p
->default_rmap
[afi
][safi
].name
)
6763 vty_out (vty
, " default route-map %s%s,",
6764 p
->default_rmap
[afi
][safi
].map
? "*" : "",
6765 p
->default_rmap
[afi
][safi
].name
);
6766 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_DEFAULT_ORIGINATE
))
6767 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
6769 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
6772 if (filter
->plist
[FILTER_IN
].name
6773 || filter
->dlist
[FILTER_IN
].name
6774 || filter
->aslist
[FILTER_IN
].name
6775 || filter
->map
[RMAP_IN
].name
)
6776 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
6777 if (filter
->plist
[FILTER_OUT
].name
6778 || filter
->dlist
[FILTER_OUT
].name
6779 || filter
->aslist
[FILTER_OUT
].name
6780 || filter
->map
[RMAP_OUT
].name
6781 || filter
->usmap
.name
)
6782 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
6783 if (filter
->map
[RMAP_IMPORT
].name
)
6784 vty_out (vty
, " Import policy for this RS-client configured%s", VTY_NEWLINE
);
6785 if (filter
->map
[RMAP_EXPORT
].name
)
6786 vty_out (vty
, " Export policy for this RS-client configured%s", VTY_NEWLINE
);
6789 if (filter
->plist
[FILTER_IN
].name
)
6790 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
6791 filter
->plist
[FILTER_IN
].plist
? "*" : "",
6792 filter
->plist
[FILTER_IN
].name
,
6794 if (filter
->plist
[FILTER_OUT
].name
)
6795 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
6796 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
6797 filter
->plist
[FILTER_OUT
].name
,
6800 /* distribute-list */
6801 if (filter
->dlist
[FILTER_IN
].name
)
6802 vty_out (vty
, " Incoming update network filter list is %s%s%s",
6803 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
6804 filter
->dlist
[FILTER_IN
].name
,
6806 if (filter
->dlist
[FILTER_OUT
].name
)
6807 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
6808 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
6809 filter
->dlist
[FILTER_OUT
].name
,
6813 if (filter
->aslist
[FILTER_IN
].name
)
6814 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
6815 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
6816 filter
->aslist
[FILTER_IN
].name
,
6818 if (filter
->aslist
[FILTER_OUT
].name
)
6819 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
6820 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
6821 filter
->aslist
[FILTER_OUT
].name
,
6825 if (filter
->map
[RMAP_IN
].name
)
6826 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
6827 filter
->map
[RMAP_IN
].map
? "*" : "",
6828 filter
->map
[RMAP_IN
].name
,
6830 if (filter
->map
[RMAP_OUT
].name
)
6831 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
6832 filter
->map
[RMAP_OUT
].map
? "*" : "",
6833 filter
->map
[RMAP_OUT
].name
,
6835 if (filter
->map
[RMAP_IMPORT
].name
)
6836 vty_out (vty
, " Route map for advertisements going into this RS-client's table is %s%s%s",
6837 filter
->map
[RMAP_IMPORT
].map
? "*" : "",
6838 filter
->map
[RMAP_IMPORT
].name
,
6840 if (filter
->map
[RMAP_EXPORT
].name
)
6841 vty_out (vty
, " Route map for advertisements coming from this RS-client is %s%s%s",
6842 filter
->map
[RMAP_EXPORT
].map
? "*" : "",
6843 filter
->map
[RMAP_EXPORT
].name
,
6846 /* unsuppress-map */
6847 if (filter
->usmap
.name
)
6848 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
6849 filter
->usmap
.map
? "*" : "",
6850 filter
->usmap
.name
, VTY_NEWLINE
);
6852 /* Receive prefix count */
6853 vty_out (vty
, " %ld accepted prefixes%s", p
->pcount
[afi
][safi
], VTY_NEWLINE
);
6855 /* Maximum prefix */
6856 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
6858 vty_out (vty
, " maximum limit %ld%s%s", p
->pmax
[afi
][safi
],
6859 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
6860 ? " (warning-only)" : "", VTY_NEWLINE
);
6861 vty_out (vty
, " Threshold for warning message %d%%%s", p
->pmax_threshold
[afi
][safi
],
6865 vty_out (vty
, "%s", VTY_NEWLINE
);
6869 bgp_show_peer (struct vty
*vty
, struct peer
*p
)
6873 char timebuf
[BGP_UPTIME_LEN
];
6879 /* Configured IP address. */
6880 vty_out (vty
, "BGP neighbor is %s, ", p
->host
);
6881 vty_out (vty
, "remote AS %d, ", p
->as
);
6882 vty_out (vty
, "local AS %d%s, ",
6883 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
6884 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
6885 " no-prepend" : "");
6886 vty_out (vty
, "%s link%s",
6887 p
->as
== p
->local_as
? "internal" : "external",
6892 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
6896 vty_out (vty
, " Member of peer-group %s for session parameters%s",
6897 p
->group
->name
, VTY_NEWLINE
);
6899 /* Administrative shutdown. */
6900 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
6901 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
6904 vty_out (vty
, " BGP version 4");
6905 if (p
->version
== BGP_VERSION_MP_4_DRAFT_00
)
6906 vty_out (vty
, "(with draft-00 verion of multiporotocol extension)");
6907 vty_out (vty
, ", remote router ID %s%s",
6908 inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
6912 if (CHECK_FLAG (bgp
->config
, BGP_CONFIG_CONFEDERATION
)
6913 && bgp_confederation_peers_check (bgp
, p
->as
))
6914 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
6917 vty_out (vty
, " BGP state = %s",
6918 LOOKUP (bgp_status_msg
, p
->status
));
6919 if (p
->status
== Established
)
6920 vty_out (vty
, ", up for %8s",
6921 peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
));
6922 vty_out (vty
, "%s", VTY_NEWLINE
);
6925 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
));
6927 /* Configured timer values. */
6928 vty_out (vty
, ", hold time is %d, keepalive interval is %d seconds%s",
6929 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
6930 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
6932 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
6933 vty_out (vty
, ", keepalive interval is %d seconds%s",
6934 p
->keepalive
, VTY_NEWLINE
);
6938 if (p
->status
== Established
)
6941 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
6942 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
6943 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
6944 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
6946 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
6947 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
6948 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
6949 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
6950 #endif /* HAVE_IPV6 */
6951 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
6952 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
6954 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
6957 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
6958 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
6960 vty_out (vty
, " Dynamic:");
6961 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
6962 vty_out (vty
, " advertised");
6963 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
6964 vty_out (vty
, " %sreceived",
6965 CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
) ? "and " : "");
6966 vty_out (vty
, "%s", VTY_NEWLINE
);
6970 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
6971 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
6972 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
6974 vty_out (vty
, " Route refresh:");
6975 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
6976 vty_out (vty
, " advertised");
6977 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
6978 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
6979 vty_out (vty
, " %sreceived(%s)",
6980 CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
) ? "and " : "",
6981 (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
6982 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)) ?
6983 "old & new" : CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
) ? "old" : "new");
6985 vty_out (vty
, "%s", VTY_NEWLINE
);
6988 /* Multiprotocol Extensions */
6989 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
6990 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
6991 if (p
->afc_adv
[afi
][safi
] || p
->afc_recv
[afi
][safi
])
6993 vty_out (vty
, " Address family %s:", afi_safi_print (afi
, safi
));
6994 if (p
->afc_adv
[afi
][safi
])
6995 vty_out (vty
, " advertised");
6996 if (p
->afc_recv
[afi
][safi
])
6997 vty_out (vty
, " %sreceived", p
->afc_adv
[afi
][safi
] ? "and " : "");
6998 vty_out (vty
, "%s", VTY_NEWLINE
);
7001 /* Gracefull Restart */
7002 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
)
7003 || CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7005 vty_out (vty
, " Graceful Restart Capabilty:");
7006 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
))
7007 vty_out (vty
, " advertised");
7008 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7009 vty_out (vty
, " %sreceived",
7010 CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_ADV
) ? "and " : "");
7011 vty_out (vty
, "%s", VTY_NEWLINE
);
7013 if (CHECK_FLAG (p
->cap
, PEER_CAP_RESTART_RCV
))
7015 int restart_af_count
= 0;
7017 vty_out (vty
, " Remote Restart timer is %d seconds%s",
7018 p
->restart_time_rcv
, VTY_NEWLINE
);
7019 vty_out (vty
, " Address families preserved by peer:%s ", VTY_NEWLINE
);
7021 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7022 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7023 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_RESTART_AF_RCV
))
7025 vty_out (vty
, "%s%s", restart_af_count
? ", " : "",
7026 afi_safi_print (afi
, safi
));
7029 if (! restart_af_count
)
7030 vty_out (vty
, "none");
7031 vty_out (vty
, "%s", VTY_NEWLINE
);
7037 /* Packet counts. */
7038 vty_out(vty
, " Received %d messages, %d notifications, %d in queue%s",
7039 p
->open_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
7040 + p
->dynamic_cap_in
, p
->notify_in
, 0, VTY_NEWLINE
);
7041 vty_out(vty
, " Sent %d messages, %d notifications, %ld in queue%s",
7042 p
->open_out
+ p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
7043 + p
->dynamic_cap_out
, p
->notify_out
, p
->obuf
->count
, VTY_NEWLINE
);
7044 vty_out(vty
, " Route refresh request: received %d, sent %d%s",
7045 p
->refresh_in
, p
->refresh_out
, VTY_NEWLINE
);
7047 /* advertisement-interval */
7048 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
7049 p
->v_routeadv
, VTY_NEWLINE
);
7051 /* Update-source. */
7052 if (p
->update_if
|| p
->update_source
)
7054 vty_out (vty
, " Update source is ");
7056 vty_out (vty
, "%s", p
->update_if
);
7057 else if (p
->update_source
)
7059 sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
7060 vty_out (vty
, "%s", VTY_NEWLINE
);
7063 /* Default weight */
7064 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
7065 vty_out (vty
, " Default weight %d%s", p
->weight
,
7068 vty_out (vty
, "%s", VTY_NEWLINE
);
7070 /* Address Family Information */
7071 for (afi
= AFI_IP
; afi
< AFI_MAX
; afi
++)
7072 for (safi
= SAFI_UNICAST
; safi
< SAFI_MAX
; safi
++)
7073 if (p
->afc
[afi
][safi
])
7074 bgp_show_peer_afi (vty
, p
, afi
, safi
);
7076 vty_out (vty
, " Connections established %d; dropped %d%s",
7077 p
->established
, p
->dropped
,
7081 vty_out (vty
, " Last reset never%s", VTY_NEWLINE
);
7083 vty_out (vty
, " Last reset %s, due to %s%s",
7084 peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
),
7085 peer_down_str
[(int) p
->last_reset
], VTY_NEWLINE
);
7087 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
7089 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
7090 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
7091 p
->host
, VTY_NEWLINE
);
7095 if (peer_sort (p
) != BGP_PEER_IBGP
&& p
->ttl
> 1)
7096 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
7097 p
->ttl
, VTY_NEWLINE
);
7099 /* Local address. */
7102 vty_out (vty
, "Local host: %s, Local port: %d%s%s",
7103 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
7104 ntohs (p
->su_local
->sin
.sin_port
),
7105 CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
) ?
7106 ", passive-mode" : "",
7110 /* Remote address. */
7113 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
7114 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
7115 ntohs (p
->su_remote
->sin
.sin_port
),
7119 /* Nexthop display. */
7122 vty_out (vty
, "Nexthop: %s%s",
7123 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
7126 vty_out (vty
, "Nexthop global: %s%s",
7127 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
7129 vty_out (vty
, "Nexthop local: %s%s",
7130 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
7132 vty_out (vty
, "BGP connection: %s%s",
7133 p
->shared_network
? "shared network" : "non shared network",
7135 #endif /* HAVE_IPV6 */
7138 /* Timer information. */
7140 vty_out (vty
, "Next start timer due in %ld seconds%s",
7141 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
7143 vty_out (vty
, "Next connect timer due in %ld seconds%s",
7144 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
7146 vty_out (vty
, "Read thread: %s Write thread: %s%s",
7147 p
->t_read
? "on" : "off",
7148 p
->t_write
? "on" : "off",
7151 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
7152 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
7153 bgp_capability_vty_out (vty
, p
);
7155 vty_out (vty
, "%s", VTY_NEWLINE
);
7159 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
,
7160 enum show_type type
, union sockunion
*su
)
7162 struct listnode
*nn
;
7166 LIST_LOOP (bgp
->peer
, peer
, nn
)
7171 bgp_show_peer (vty
, peer
);
7174 if (sockunion_same (&peer
->su
, su
))
7177 bgp_show_peer (vty
, peer
);
7183 if (type
== show_peer
&& ! find
)
7184 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
7190 bgp_show_neighbor_vty (struct vty
*vty
, char *name
, enum show_type type
,
7199 ret
= str2sockunion (ip_str
, &su
);
7202 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
7209 bgp
= bgp_lookup_by_name (name
);
7213 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
7217 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7222 bgp
= bgp_get_default ();
7225 bgp_show_neighbor (vty
, bgp
, type
, &su
);
7230 /* "show ip bgp neighbors" commands. */
7231 DEFUN (show_ip_bgp_neighbors
,
7232 show_ip_bgp_neighbors_cmd
,
7233 "show ip bgp neighbors",
7237 "Detailed information on TCP and BGP neighbor connections\n")
7239 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
);
7242 ALIAS (show_ip_bgp_neighbors
,
7243 show_ip_bgp_ipv4_neighbors_cmd
,
7244 "show ip bgp ipv4 (unicast|multicast) neighbors",
7249 "Address Family modifier\n"
7250 "Address Family modifier\n"
7251 "Detailed information on TCP and BGP neighbor connections\n")
7253 ALIAS (show_ip_bgp_neighbors
,
7254 show_ip_bgp_vpnv4_all_neighbors_cmd
,
7255 "show ip bgp vpnv4 all neighbors",
7259 "Display VPNv4 NLRI specific information\n"
7260 "Display information about all VPNv4 NLRIs\n"
7261 "Detailed information on TCP and BGP neighbor connections\n")
7263 ALIAS (show_ip_bgp_neighbors
,
7264 show_ip_bgp_vpnv4_rd_neighbors_cmd
,
7265 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
7269 "Display VPNv4 NLRI specific information\n"
7270 "Display information for a route distinguisher\n"
7271 "VPN Route Distinguisher\n"
7272 "Detailed information on TCP and BGP neighbor connections\n")
7274 ALIAS (show_ip_bgp_neighbors
,
7275 show_bgp_neighbors_cmd
,
7276 "show bgp neighbors",
7279 "Detailed information on TCP and BGP neighbor connections\n")
7281 ALIAS (show_ip_bgp_neighbors
,
7282 show_bgp_ipv6_neighbors_cmd
,
7283 "show bgp ipv6 neighbors",
7287 "Detailed information on TCP and BGP neighbor connections\n")
7289 DEFUN (show_ip_bgp_neighbors_peer
,
7290 show_ip_bgp_neighbors_peer_cmd
,
7291 "show ip bgp neighbors (A.B.C.D|X:X::X:X)",
7295 "Detailed information on TCP and BGP neighbor connections\n"
7296 "Neighbor to display information about\n"
7297 "Neighbor to display information about\n")
7299 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 1]);
7302 ALIAS (show_ip_bgp_neighbors_peer
,
7303 show_ip_bgp_ipv4_neighbors_peer_cmd
,
7304 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)",
7309 "Address Family modifier\n"
7310 "Address Family modifier\n"
7311 "Detailed information on TCP and BGP neighbor connections\n"
7312 "Neighbor to display information about\n"
7313 "Neighbor to display information about\n")
7315 ALIAS (show_ip_bgp_neighbors_peer
,
7316 show_ip_bgp_vpnv4_all_neighbors_peer_cmd
,
7317 "show ip bgp vpnv4 all neighbors A.B.C.D",
7321 "Display VPNv4 NLRI specific information\n"
7322 "Display information about all VPNv4 NLRIs\n"
7323 "Detailed information on TCP and BGP neighbor connections\n"
7324 "Neighbor to display information about\n")
7326 ALIAS (show_ip_bgp_neighbors_peer
,
7327 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
,
7328 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
7332 "Display VPNv4 NLRI specific information\n"
7333 "Display information about all VPNv4 NLRIs\n"
7334 "Detailed information on TCP and BGP neighbor connections\n"
7335 "Neighbor to display information about\n")
7337 ALIAS (show_ip_bgp_neighbors_peer
,
7338 show_bgp_neighbors_peer_cmd
,
7339 "show bgp neighbors (A.B.C.D|X:X::X:X)",
7342 "Detailed information on TCP and BGP neighbor connections\n"
7343 "Neighbor to display information about\n"
7344 "Neighbor to display information about\n")
7346 ALIAS (show_ip_bgp_neighbors_peer
,
7347 show_bgp_ipv6_neighbors_peer_cmd
,
7348 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)",
7352 "Detailed information on TCP and BGP neighbor connections\n"
7353 "Neighbor to display information about\n"
7354 "Neighbor to display information about\n")
7356 DEFUN (show_ip_bgp_instance_neighbors
,
7357 show_ip_bgp_instance_neighbors_cmd
,
7358 "show ip bgp view WORD neighbors",
7364 "Detailed information on TCP and BGP neighbor connections\n")
7366 return bgp_show_neighbor_vty (vty
, argv
[0], show_all
, NULL
);
7369 ALIAS (show_ip_bgp_instance_neighbors
,
7370 show_bgp_instance_neighbors_cmd
,
7371 "show bgp view WORD neighbors",
7376 "Detailed information on TCP and BGP neighbor connections\n")
7378 ALIAS (show_ip_bgp_instance_neighbors
,
7379 show_bgp_instance_ipv6_neighbors_cmd
,
7380 "show bgp view WORD ipv6 neighbors",
7386 "Detailed information on TCP and BGP neighbor connections\n")
7388 DEFUN (show_ip_bgp_instance_neighbors_peer
,
7389 show_ip_bgp_instance_neighbors_peer_cmd
,
7390 "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7396 "Detailed information on TCP and BGP neighbor connections\n"
7397 "Neighbor to display information about\n"
7398 "Neighbor to display information about\n")
7400 return bgp_show_neighbor_vty (vty
, argv
[0], show_peer
, argv
[1]);
7403 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7404 show_bgp_instance_neighbors_peer_cmd
,
7405 "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7410 "Detailed information on TCP and BGP neighbor connections\n"
7411 "Neighbor to display information about\n"
7412 "Neighbor to display information about\n")
7414 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7415 show_bgp_instance_ipv6_neighbors_peer_cmd
,
7416 "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)",
7422 "Detailed information on TCP and BGP neighbor connections\n"
7423 "Neighbor to display information about\n"
7424 "Neighbor to display information about\n")
7426 /* Show BGP's AS paths internal data. There are both `show ip bgp
7427 paths' and `show ip mbgp paths'. Those functions results are the
7429 DEFUN (show_ip_bgp_paths
,
7430 show_ip_bgp_paths_cmd
,
7431 "show ip bgp paths",
7435 "Path information\n")
7437 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
7438 aspath_print_all_vty (vty
);
7442 DEFUN (show_ip_bgp_ipv4_paths
,
7443 show_ip_bgp_ipv4_paths_cmd
,
7444 "show ip bgp ipv4 (unicast|multicast) paths",
7449 "Address Family modifier\n"
7450 "Address Family modifier\n"
7451 "Path information\n")
7453 vty_out (vty
, "Address Refcnt Path\r\n");
7454 aspath_print_all_vty (vty
);
7462 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
7464 struct community
*com
;
7466 com
= (struct community
*) backet
->data
;
7467 vty_out (vty
, "[%p] (%ld) %s%s", backet
, com
->refcnt
,
7468 community_str (com
), VTY_NEWLINE
);
7471 /* Show BGP's community internal data. */
7472 DEFUN (show_ip_bgp_community_info
,
7473 show_ip_bgp_community_info_cmd
,
7474 "show ip bgp community-info",
7478 "List all bgp community information\n")
7480 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
7482 hash_iterate (community_hash (),
7483 (void (*) (struct hash_backet
*, void *))
7484 community_show_all_iterator
,
7490 DEFUN (show_ip_bgp_attr_info
,
7491 show_ip_bgp_attr_info_cmd
,
7492 "show ip bgp attribute-info",
7496 "List all bgp attribute information\n")
7498 attr_show_all (vty
);
7503 bgp_write_rsclient_summary (struct vty
*vty
, struct peer
*rsclient
,
7504 afi_t afi
, safi_t safi
)
7506 char timebuf
[BGP_UPTIME_LEN
];
7510 struct listnode
*nn
;
7514 if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_GROUP
))
7516 LIST_LOOP (rsclient
->group
->peer
, peer
, nn
)
7519 bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
7524 len
= vty_out (vty
, "%s", rsclient
->host
);
7528 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
7530 vty_out (vty
, "%*s", len
, " ");
7532 switch (rsclient
->version
)
7535 vty_out (vty
, "4 ");
7537 case BGP_VERSION_MP_4_DRAFT_00
:
7538 vty_out (vty
, "4-");
7542 vty_out (vty
, "%5d ", rsclient
->as
);
7544 rmname
= ROUTE_MAP_EXPORT_NAME(&rsclient
->filter
[afi
][safi
]);
7545 if ( rmname
&& strlen (rmname
) > 13 )
7547 sprintf (rmbuf
, "%13s", "...");
7548 rmname
= strncpy (rmbuf
, rmname
, 10);
7552 vty_out (vty
, " %13s ", rmname
);
7554 rmname
= ROUTE_MAP_IMPORT_NAME(&rsclient
->filter
[afi
][safi
]);
7555 if ( rmname
&& strlen (rmname
) > 13 )
7557 sprintf (rmbuf
, "%13s", "...");
7558 rmname
= strncpy (rmbuf
, rmname
, 10);
7562 vty_out (vty
, " %13s ", rmname
);
7564 vty_out (vty
, "%8s", peer_uptime (rsclient
->uptime
, timebuf
, BGP_UPTIME_LEN
));
7566 if (CHECK_FLAG (rsclient
->flags
, PEER_FLAG_SHUTDOWN
))
7567 vty_out (vty
, " Idle (Admin)");
7568 else if (CHECK_FLAG (rsclient
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
7569 vty_out (vty
, " Idle (PfxCt)");
7571 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, rsclient
->status
));
7573 vty_out (vty
, "%s", VTY_NEWLINE
);
7579 bgp_show_rsclient_summary (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
)
7582 struct listnode
*nn
;
7585 /* Header string for each address family. */
7586 static char header
[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
7588 LIST_LOOP (bgp
->rsclient
, peer
, nn
)
7590 if (peer
->afc
[afi
][safi
] &&
7591 CHECK_FLAG (peer
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
7596 "Route Server's BGP router identifier %s%s",
7597 inet_ntoa (bgp
->router_id
), VTY_NEWLINE
);
7599 "Route Server's local AS number %d%s", bgp
->as
,
7602 vty_out (vty
, "%s", VTY_NEWLINE
);
7603 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
7606 count
+= bgp_write_rsclient_summary (vty
, peer
, afi
, safi
);
7611 vty_out (vty
, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE
,
7612 count
, VTY_NEWLINE
);
7614 vty_out (vty
, "No %s Route Server Client is configured%s",
7615 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
7621 bgp_show_rsclient_summary_vty (struct vty
*vty
, char *name
, afi_t afi
, safi_t safi
)
7627 bgp
= bgp_lookup_by_name (name
);
7631 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
7635 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
7639 bgp
= bgp_get_default ();
7642 bgp_show_rsclient_summary (vty
, bgp
, afi
, safi
);
7647 /* 'show bgp rsclient' commands. */
7648 DEFUN (show_ip_bgp_rsclient_summary
,
7649 show_ip_bgp_rsclient_summary_cmd
,
7650 "show ip bgp rsclient summary",
7654 "Information about Route Server Clients\n"
7655 "Summary of all Route Server Clients\n")
7657 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
7660 DEFUN (show_ip_bgp_instance_rsclient_summary
,
7661 show_ip_bgp_instance_rsclient_summary_cmd
,
7662 "show ip bgp view WORD rsclient summary",
7668 "Information about Route Server Clients\n"
7669 "Summary of all Route Server Clients\n")
7671 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
7674 DEFUN (show_ip_bgp_ipv4_rsclient_summary
,
7675 show_ip_bgp_ipv4_rsclient_summary_cmd
,
7676 "show ip bgp ipv4 (unicast|multicast) rsclient summary",
7681 "Address Family modifier\n"
7682 "Address Family modifier\n"
7683 "Information about Route Server Clients\n"
7684 "Summary of all Route Server Clients\n")
7686 if (strncmp (argv
[0], "m", 1) == 0)
7687 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
7689 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
7692 DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary
,
7693 show_ip_bgp_instance_ipv4_rsclient_summary_cmd
,
7694 "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary",
7701 "Address Family modifier\n"
7702 "Address Family modifier\n"
7703 "Information about Route Server Clients\n"
7704 "Summary of all Route Server Clients\n")
7706 if (strncmp (argv
[1], "m", 1) == 0)
7707 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
7709 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
7713 DEFUN (show_bgp_rsclient_summary
,
7714 show_bgp_rsclient_summary_cmd
,
7715 "show bgp rsclient summary",
7718 "Information about Route Server Clients\n"
7719 "Summary of all Route Server Clients\n")
7721 return bgp_show_rsclient_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
7724 DEFUN (show_bgp_instance_rsclient_summary
,
7725 show_bgp_instance_rsclient_summary_cmd
,
7726 "show bgp view WORD rsclient summary",
7731 "Information about Route Server Clients\n"
7732 "Summary of all Route Server Clients\n")
7734 return bgp_show_rsclient_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
7737 ALIAS (show_bgp_rsclient_summary
,
7738 show_bgp_ipv6_rsclient_summary_cmd
,
7739 "show bgp ipv6 rsclient summary",
7743 "Information about Route Server Clients\n"
7744 "Summary of all Route Server Clients\n")
7746 ALIAS (show_bgp_instance_rsclient_summary
,
7747 show_bgp_instance_ipv6_rsclient_summary_cmd
,
7748 "show bgp view WORD ipv6 rsclient summary",
7754 "Information about Route Server Clients\n"
7755 "Summary of all Route Server Clients\n")
7756 #endif /* HAVE IPV6 */
7758 /* Redistribute VTY commands. */
7760 /* Utility function to convert user input route type string to route
7763 bgp_str2route_type (int afi
, char *str
)
7770 if (strncmp (str
, "k", 1) == 0)
7771 return ZEBRA_ROUTE_KERNEL
;
7772 else if (strncmp (str
, "c", 1) == 0)
7773 return ZEBRA_ROUTE_CONNECT
;
7774 else if (strncmp (str
, "s", 1) == 0)
7775 return ZEBRA_ROUTE_STATIC
;
7776 else if (strncmp (str
, "r", 1) == 0)
7777 return ZEBRA_ROUTE_RIP
;
7778 else if (strncmp (str
, "o", 1) == 0)
7779 return ZEBRA_ROUTE_OSPF
;
7783 if (strncmp (str
, "k", 1) == 0)
7784 return ZEBRA_ROUTE_KERNEL
;
7785 else if (strncmp (str
, "c", 1) == 0)
7786 return ZEBRA_ROUTE_CONNECT
;
7787 else if (strncmp (str
, "s", 1) == 0)
7788 return ZEBRA_ROUTE_STATIC
;
7789 else if (strncmp (str
, "r", 1) == 0)
7790 return ZEBRA_ROUTE_RIPNG
;
7791 else if (strncmp (str
, "o", 1) == 0)
7792 return ZEBRA_ROUTE_OSPF6
;
7797 DEFUN (bgp_redistribute_ipv4
,
7798 bgp_redistribute_ipv4_cmd
,
7799 "redistribute (connected|kernel|ospf|rip|static)",
7800 "Redistribute information from another routing protocol\n"
7803 "Open Shurtest Path First (OSPF)\n"
7804 "Routing Information Protocol (RIP)\n"
7809 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7812 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7815 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
7818 DEFUN (bgp_redistribute_ipv4_rmap
,
7819 bgp_redistribute_ipv4_rmap_cmd
,
7820 "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
7821 "Redistribute information from another routing protocol\n"
7824 "Open Shurtest Path First (OSPF)\n"
7825 "Routing Information Protocol (RIP)\n"
7827 "Route map reference\n"
7828 "Pointer to route-map entries\n")
7832 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7835 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7839 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
7840 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
7843 DEFUN (bgp_redistribute_ipv4_metric
,
7844 bgp_redistribute_ipv4_metric_cmd
,
7845 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
7846 "Redistribute information from another routing protocol\n"
7849 "Open Shurtest Path First (OSPF)\n"
7850 "Routing Information Protocol (RIP)\n"
7852 "Metric for redistributed routes\n"
7858 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7861 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7864 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
7866 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
7867 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
7870 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
7871 bgp_redistribute_ipv4_rmap_metric_cmd
,
7872 "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
7873 "Redistribute information from another routing protocol\n"
7876 "Open Shurtest Path First (OSPF)\n"
7877 "Routing Information Protocol (RIP)\n"
7879 "Route map reference\n"
7880 "Pointer to route-map entries\n"
7881 "Metric for redistributed routes\n"
7887 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7890 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7893 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
7895 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
7896 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
7897 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
7900 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
7901 bgp_redistribute_ipv4_metric_rmap_cmd
,
7902 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
7903 "Redistribute information from another routing protocol\n"
7906 "Open Shurtest Path First (OSPF)\n"
7907 "Routing Information Protocol (RIP)\n"
7909 "Metric for redistributed routes\n"
7911 "Route map reference\n"
7912 "Pointer to route-map entries\n")
7917 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7920 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7923 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
7925 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
7926 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[2]);
7927 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
7930 DEFUN (no_bgp_redistribute_ipv4
,
7931 no_bgp_redistribute_ipv4_cmd
,
7932 "no redistribute (connected|kernel|ospf|rip|static)",
7934 "Redistribute information from another routing protocol\n"
7937 "Open Shurtest Path First (OSPF)\n"
7938 "Routing Information Protocol (RIP)\n"
7943 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7946 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7950 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
);
7953 DEFUN (no_bgp_redistribute_ipv4_rmap
,
7954 no_bgp_redistribute_ipv4_rmap_cmd
,
7955 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
7957 "Redistribute information from another routing protocol\n"
7960 "Open Shurtest Path First (OSPF)\n"
7961 "Routing Information Protocol (RIP)\n"
7963 "Route map reference\n"
7964 "Pointer to route-map entries\n")
7968 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7971 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7975 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
7979 DEFUN (no_bgp_redistribute_ipv4_metric
,
7980 no_bgp_redistribute_ipv4_metric_cmd
,
7981 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
7983 "Redistribute information from another routing protocol\n"
7986 "Open Shurtest Path First (OSPF)\n"
7987 "Routing Information Protocol (RIP)\n"
7989 "Metric for redistributed routes\n"
7994 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7997 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8001 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8005 DEFUN (no_bgp_redistribute_ipv4_rmap_metric
,
8006 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
8007 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
8009 "Redistribute information from another routing protocol\n"
8012 "Open Shurtest Path First (OSPF)\n"
8013 "Routing Information Protocol (RIP)\n"
8015 "Route map reference\n"
8016 "Pointer to route-map entries\n"
8017 "Metric for redistributed routes\n"
8022 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
8025 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8029 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
8030 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
8034 ALIAS (no_bgp_redistribute_ipv4_rmap_metric
,
8035 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
8036 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
8038 "Redistribute information from another routing protocol\n"
8041 "Open Shurtest Path First (OSPF)\n"
8042 "Routing Information Protocol (RIP)\n"
8044 "Metric for redistributed routes\n"
8046 "Route map reference\n"
8047 "Pointer to route-map entries\n")
8050 DEFUN (bgp_redistribute_ipv6
,
8051 bgp_redistribute_ipv6_cmd
,
8052 "redistribute (connected|kernel|ospf6|ripng|static)",
8053 "Redistribute information from another routing protocol\n"
8056 "Open Shurtest Path First (OSPFv3)\n"
8057 "Routing Information Protocol (RIPng)\n"
8062 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8065 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8069 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8072 DEFUN (bgp_redistribute_ipv6_rmap
,
8073 bgp_redistribute_ipv6_rmap_cmd
,
8074 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
8075 "Redistribute information from another routing protocol\n"
8078 "Open Shurtest Path First (OSPFv3)\n"
8079 "Routing Information Protocol (RIPng)\n"
8081 "Route map reference\n"
8082 "Pointer to route-map entries\n")
8086 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8089 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8093 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8094 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8097 DEFUN (bgp_redistribute_ipv6_metric
,
8098 bgp_redistribute_ipv6_metric_cmd
,
8099 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
8100 "Redistribute information from another routing protocol\n"
8103 "Open Shurtest Path First (OSPFv3)\n"
8104 "Routing Information Protocol (RIPng)\n"
8106 "Metric for redistributed routes\n"
8112 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8115 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8118 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8120 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8121 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8124 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
8125 bgp_redistribute_ipv6_rmap_metric_cmd
,
8126 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
8127 "Redistribute information from another routing protocol\n"
8130 "Open Shurtest Path First (OSPFv3)\n"
8131 "Routing Information Protocol (RIPng)\n"
8133 "Route map reference\n"
8134 "Pointer to route-map entries\n"
8135 "Metric for redistributed routes\n"
8141 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8144 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8147 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
8149 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
8150 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8151 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8154 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
8155 bgp_redistribute_ipv6_metric_rmap_cmd
,
8156 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
8157 "Redistribute information from another routing protocol\n"
8160 "Open Shurtest Path First (OSPFv3)\n"
8161 "Routing Information Protocol (RIPng)\n"
8163 "Metric for redistributed routes\n"
8165 "Route map reference\n"
8166 "Pointer to route-map entries\n")
8171 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8174 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8177 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
8179 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
8180 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[2]);
8181 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
8184 DEFUN (no_bgp_redistribute_ipv6
,
8185 no_bgp_redistribute_ipv6_cmd
,
8186 "no redistribute (connected|kernel|ospf6|ripng|static)",
8188 "Redistribute information from another routing protocol\n"
8191 "Open Shurtest Path First (OSPFv3)\n"
8192 "Routing Information Protocol (RIPng)\n"
8197 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8200 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8204 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
);
8207 DEFUN (no_bgp_redistribute_ipv6_rmap
,
8208 no_bgp_redistribute_ipv6_rmap_cmd
,
8209 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
8211 "Redistribute information from another routing protocol\n"
8214 "Open Shurtest Path First (OSPFv3)\n"
8215 "Routing Information Protocol (RIPng)\n"
8217 "Route map reference\n"
8218 "Pointer to route-map entries\n")
8222 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8225 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8229 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8233 DEFUN (no_bgp_redistribute_ipv6_metric
,
8234 no_bgp_redistribute_ipv6_metric_cmd
,
8235 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
8237 "Redistribute information from another routing protocol\n"
8240 "Open Shurtest Path First (OSPFv3)\n"
8241 "Routing Information Protocol (RIPng)\n"
8243 "Metric for redistributed routes\n"
8248 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8251 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8255 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8259 DEFUN (no_bgp_redistribute_ipv6_rmap_metric
,
8260 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
8261 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
8263 "Redistribute information from another routing protocol\n"
8266 "Open Shurtest Path First (OSPFv3)\n"
8267 "Routing Information Protocol (RIPng)\n"
8269 "Route map reference\n"
8270 "Pointer to route-map entries\n"
8271 "Metric for redistributed routes\n"
8276 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
8279 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
8283 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
8284 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
8288 ALIAS (no_bgp_redistribute_ipv6_rmap_metric
,
8289 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
8290 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
8292 "Redistribute information from another routing protocol\n"
8295 "Open Shurtest Path First (OSPFv3)\n"
8296 "Routing Information Protocol (RIPng)\n"
8298 "Metric for redistributed routes\n"
8300 "Route map reference\n"
8301 "Pointer to route-map entries\n")
8302 #endif /* HAVE_IPV6 */
8305 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
8306 safi_t safi
, int *write
)
8309 char *str
[] = { "system", "kernel", "connected", "static", "rip",
8310 "ripng", "ospf", "ospf6", "isis", "bgp"};
8312 /* Unicast redistribution only. */
8313 if (safi
!= SAFI_UNICAST
)
8316 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
8318 /* Redistribute BGP does not make sense. */
8319 if (bgp
->redist
[afi
][i
] && i
!= ZEBRA_ROUTE_BGP
)
8321 /* Display "address-family" when it is not yet diplayed. */
8322 bgp_config_write_family_header (vty
, afi
, safi
, write
);
8324 /* "redistribute" configuration. */
8325 vty_out (vty
, " redistribute %s", str
[i
]);
8327 if (bgp
->redist_metric_flag
[afi
][i
])
8328 vty_out (vty
, " metric %d", bgp
->redist_metric
[afi
][i
]);
8330 if (bgp
->rmap
[afi
][i
].name
)
8331 vty_out (vty
, " route-map %s", bgp
->rmap
[afi
][i
].name
);
8333 vty_out (vty
, "%s", VTY_NEWLINE
);
8339 /* BGP node structure. */
8340 struct cmd_node bgp_node
=
8343 "%s(config-router)# ",
8347 struct cmd_node bgp_ipv4_unicast_node
=
8350 "%s(config-router-af)# ",
8354 struct cmd_node bgp_ipv4_multicast_node
=
8357 "%s(config-router-af)# ",
8361 struct cmd_node bgp_ipv6_unicast_node
=
8364 "%s(config-router-af)# ",
8368 struct cmd_node bgp_vpnv4_node
=
8371 "%s(config-router-af)# ",
8378 int bgp_config_write (struct vty
*);
8379 void community_list_vty ();
8381 /* Install bgp top node. */
8382 install_node (&bgp_node
, bgp_config_write
);
8383 install_node (&bgp_ipv4_unicast_node
, NULL
);
8384 install_node (&bgp_ipv4_multicast_node
, NULL
);
8385 install_node (&bgp_ipv6_unicast_node
, NULL
);
8386 install_node (&bgp_vpnv4_node
, NULL
);
8388 /* Install default VTY commands to new nodes. */
8389 install_default (BGP_NODE
);
8390 install_default (BGP_IPV4_NODE
);
8391 install_default (BGP_IPV4M_NODE
);
8392 install_default (BGP_IPV6_NODE
);
8393 install_default (BGP_VPNV4_NODE
);
8395 /* "bgp multiple-instance" commands. */
8396 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
8397 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
8399 /* "bgp config-type" commands. */
8400 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
8401 install_element (CONFIG_NODE
, &no_bgp_config_type_cmd
);
8403 /* Dummy commands (Currently not supported) */
8404 install_element (BGP_NODE
, &no_synchronization_cmd
);
8405 install_element (BGP_NODE
, &no_auto_summary_cmd
);
8407 /* "router bgp" commands. */
8408 install_element (CONFIG_NODE
, &router_bgp_cmd
);
8409 install_element (CONFIG_NODE
, &router_bgp_view_cmd
);
8411 /* "no router bgp" commands. */
8412 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
8413 install_element (CONFIG_NODE
, &no_router_bgp_view_cmd
);
8415 /* "bgp router-id" commands. */
8416 install_element (BGP_NODE
, &bgp_router_id_cmd
);
8417 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
8418 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
8420 /* "bgp cluster-id" commands. */
8421 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
8422 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
8423 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
8424 install_element (BGP_NODE
, &no_bgp_cluster_id_arg_cmd
);
8426 /* "bgp confederation" commands. */
8427 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
8428 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
8429 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
8431 /* "bgp confederation peers" commands. */
8432 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
8433 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
8435 /* "timers bgp" commands. */
8436 install_element (BGP_NODE
, &bgp_timers_cmd
);
8437 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
8438 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
8440 /* "bgp client-to-client reflection" commands */
8441 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
8442 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
8444 /* "bgp always-compare-med" commands */
8445 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
8446 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
8448 /* "bgp deterministic-med" commands */
8449 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
8450 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
8453 /* "bgp graceful-restart" commands */
8454 install_element (BGP_NODE
, &bgp_graceful_restart_cmd
);
8455 install_element (BGP_NODE
, &no_bgp_graceful_restart_cmd
);
8458 /* "bgp fast-external-failover" commands */
8459 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
8460 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
8462 /* "bgp enforce-first-as" commands */
8463 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
8464 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
8466 /* "bgp bestpath compare-routerid" commands */
8467 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
8468 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
8470 /* "bgp bestpath as-path ignore" commands */
8471 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
8472 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
8474 /* "bgp log-neighbor-changes" commands */
8475 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
8476 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
8478 /* "bgp bestpath med" commands */
8479 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
8480 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
8481 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
8482 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
8483 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
8484 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
8486 /* "no bgp default ipv4-unicast" commands. */
8487 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
8488 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
8490 /* "bgp network import-check" commands. */
8491 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
8492 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
8494 /* "bgp default local-preference" commands. */
8495 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
8496 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
8497 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
8499 /* "neighbor remote-as" commands. */
8500 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
8501 install_element (BGP_NODE
, &no_neighbor_cmd
);
8502 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
8504 /* "neighbor peer-group" commands. */
8505 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
8506 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
8507 install_element (BGP_NODE
, &no_neighbor_peer_group_remote_as_cmd
);
8509 /* "neighbor local-as" commands. */
8510 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
8511 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
8512 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
8513 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
8514 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
8516 /* "neighbor activate" commands. */
8517 install_element (BGP_NODE
, &neighbor_activate_cmd
);
8518 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
8519 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
8520 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
8521 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
8523 /* "no neighbor activate" commands. */
8524 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
8525 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
8526 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
8527 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
8528 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
8530 /* "neighbor peer-group set" commands. */
8531 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
8532 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
8533 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
8534 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
8535 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
8537 /* "no neighbor peer-group unset" commands. */
8538 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
8539 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
8540 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
8541 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
8542 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
8544 /* "neighbor softreconfiguration inbound" commands.*/
8545 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
8546 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8547 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
8548 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8549 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
8550 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8551 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
8552 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8553 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
8554 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
8556 /* "neighbor attribute-unchanged" commands. */
8557 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
8558 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
8559 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
8560 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
8561 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
8562 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
8563 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
8564 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
8565 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
8566 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
8567 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
8568 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
8569 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8570 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8571 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8572 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8573 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8574 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8575 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8576 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8577 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8578 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8579 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
8580 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
8581 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
8582 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
8583 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
8584 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
8585 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
8586 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
8587 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
8588 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
8589 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
8590 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
8591 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8592 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8593 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8594 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8595 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8596 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8597 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8598 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8599 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8600 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8601 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
8602 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
8603 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
8604 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
8605 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
8606 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
8607 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
8608 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
8609 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
8610 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
8611 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
8612 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
8613 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8614 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8615 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8616 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8617 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8618 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8619 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8620 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8621 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8622 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8623 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
8624 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
8625 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
8626 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
8627 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
8628 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
8629 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
8630 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
8631 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
8632 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
8633 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
8634 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
8635 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8636 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8637 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8638 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8639 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8640 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8641 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8642 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8643 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8644 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8645 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
8646 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
8647 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
8648 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
8649 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
8650 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
8651 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
8652 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
8653 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
8654 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
8655 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
8656 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
8657 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8658 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8659 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8660 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8661 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8662 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8663 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8664 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8665 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8666 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8668 /* "nexthop-local unchanged" commands */
8669 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_local_unchanged_cmd
);
8670 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_local_unchanged_cmd
);
8672 /* "transparent-as" and "transparent-nexthop" for old version
8674 install_element (BGP_NODE
, &neighbor_transparent_as_cmd
);
8675 install_element (BGP_NODE
, &neighbor_transparent_nexthop_cmd
);
8677 /* "neighbor next-hop-self" commands. */
8678 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
8679 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
8680 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
8681 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
8682 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
8683 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
8684 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
8685 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
8686 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
8687 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
8689 /* "neighbor remove-private-AS" commands. */
8690 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
8691 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
8692 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
8693 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
8694 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
8695 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
8696 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
8697 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
8698 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
8699 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
8701 /* "neighbor send-community" commands.*/
8702 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
8703 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
8704 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
8705 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
8706 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
8707 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
8708 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
8709 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
8710 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
8711 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
8712 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
8713 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
8714 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
8715 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
8716 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
8717 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
8718 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
8719 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
8720 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
8721 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
8723 /* "neighbor route-reflector" commands.*/
8724 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
8725 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
8726 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
8727 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
8728 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
8729 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
8730 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
8731 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
8732 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
8733 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
8735 /* "neighbor route-server" commands.*/
8736 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
8737 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
8738 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
8739 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
8740 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
8741 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
8742 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
8743 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
8744 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
8745 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
8747 /* "neighbor passive" commands. */
8748 install_element (BGP_NODE
, &neighbor_passive_cmd
);
8749 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
8751 /* "neighbor shutdown" commands. */
8752 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
8753 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
8755 /* "neighbor capability route-refresh" commands.*/
8756 install_element (BGP_NODE
, &neighbor_capability_route_refresh_cmd
);
8757 install_element (BGP_NODE
, &no_neighbor_capability_route_refresh_cmd
);
8759 /* "neighbor capability orf prefix-list" commands.*/
8760 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
8761 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
8762 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
8763 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
8764 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
8765 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
8766 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
8767 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
8769 /* "neighbor capability dynamic" commands.*/
8770 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
8771 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
8773 /* "neighbor dont-capability-negotiate" commands. */
8774 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
8775 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
8777 /* "neighbor ebgp-multihop" commands. */
8778 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
8779 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
8780 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
8781 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
8783 /* "neighbor enforce-multihop" commands. */
8784 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
8785 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
8787 /* "neighbor description" commands. */
8788 install_element (BGP_NODE
, &neighbor_description_cmd
);
8789 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
8790 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
8792 /* "neighbor update-source" commands. "*/
8793 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
8794 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
8796 /* "neighbor default-originate" commands. */
8797 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
8798 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
8799 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
8800 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
8801 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
8802 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
8803 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
8804 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
8805 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
8806 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
8807 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
8808 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
8809 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
8810 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
8811 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
8812 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
8814 /* "neighbor port" commands. */
8815 install_element (BGP_NODE
, &neighbor_port_cmd
);
8816 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
8817 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
8819 /* "neighbor weight" commands. */
8820 install_element (BGP_NODE
, &neighbor_weight_cmd
);
8821 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
8822 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
8824 /* "neighbor override-capability" commands. */
8825 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
8826 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
8828 /* "neighbor strict-capability-match" commands. */
8829 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
8830 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
8832 /* "neighbor timers" commands. */
8833 install_element (BGP_NODE
, &neighbor_timers_cmd
);
8834 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
8836 /* "neighbor timers connect" commands. */
8837 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
8838 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
8839 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
8841 /* "neighbor advertisement-interval" commands. */
8842 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
8843 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
8844 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
8846 /* "neighbor version" commands. */
8847 install_element (BGP_NODE
, &neighbor_version_cmd
);
8848 install_element (BGP_NODE
, &no_neighbor_version_cmd
);
8850 /* "neighbor interface" commands. */
8851 install_element (BGP_NODE
, &neighbor_interface_cmd
);
8852 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
8854 /* "neighbor distribute" commands. */
8855 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
8856 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
8857 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
8858 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
8859 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
8860 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
8861 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
8862 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
8863 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
8864 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
8866 /* "neighbor prefix-list" commands. */
8867 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
8868 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
8869 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
8870 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
8871 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
8872 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
8873 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
8874 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
8875 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
8876 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
8878 /* "neighbor filter-list" commands. */
8879 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
8880 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
8881 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
8882 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
8883 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
8884 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
8885 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
8886 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
8887 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
8888 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
8890 /* "neighbor route-map" commands. */
8891 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
8892 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
8893 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
8894 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
8895 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
8896 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
8897 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
8898 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
8899 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
8900 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
8902 /* "neighbor unsuppress-map" commands. */
8903 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
8904 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
8905 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
8906 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
8907 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
8908 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
8909 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
8910 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
8911 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
8912 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
8914 /* "neighbor maximum-prefix" commands. */
8915 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
8916 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
8917 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
8918 install_element (BGP_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
8919 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
8920 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
8921 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val2_cmd
);
8922 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val3_cmd
);
8923 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
8924 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
8925 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
8926 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
8927 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
8928 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
8929 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val2_cmd
);
8930 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val3_cmd
);
8931 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
8932 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
8933 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
8934 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
8935 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
8936 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
8937 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val2_cmd
);
8938 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val3_cmd
);
8939 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
8940 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
8941 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
8942 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
8943 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
8944 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
8945 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val2_cmd
);
8946 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val3_cmd
);
8947 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
8948 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_cmd
);
8949 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
8950 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_threshold_warning_cmd
);
8951 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
8952 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
8953 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val2_cmd
);
8954 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val3_cmd
);
8956 /* "neighbor allowas-in" */
8957 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
8958 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
8959 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
8960 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
8961 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
8962 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
8963 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
8964 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
8965 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
8966 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
8967 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
8968 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
8969 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
8970 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
8971 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
8973 /* address-family commands. */
8974 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
8975 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
8977 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
8978 install_element (BGP_NODE
, &address_family_ipv6_unicast_cmd
);
8979 #endif /* HAVE_IPV6 */
8980 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
8981 install_element (BGP_NODE
, &address_family_vpnv4_unicast_cmd
);
8983 /* "exit-address-family" command. */
8984 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
8985 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
8986 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
8987 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
8989 /* "clear ip bgp commands" */
8990 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
8991 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
8992 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
8993 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
8994 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
8995 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
8997 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
8998 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
8999 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
9000 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
9001 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
9002 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
9003 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
9004 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
9005 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
9006 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
9007 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
9008 #endif /* HAVE_IPV6 */
9010 /* "clear ip bgp neighbor soft in" */
9011 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
9012 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
9013 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
9014 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
9015 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_prefix_filter_cmd
);
9016 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
9017 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
9018 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
9019 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
9020 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
9021 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
9022 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
9023 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
9024 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
9025 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
9026 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
9027 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
9028 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
9029 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
9030 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
9031 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
9032 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
);
9033 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
9034 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
9035 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
9036 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
9037 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
9038 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
9039 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
9040 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
9041 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
9042 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
9043 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
9044 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
9045 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_in_cmd
);
9046 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_in_cmd
);
9047 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_in_cmd
);
9048 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_in_cmd
);
9049 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_in_cmd
);
9050 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_in_cmd
);
9052 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
9053 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
9054 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
9055 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
9056 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
9057 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
9058 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
9059 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
9060 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
9061 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
9062 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
9063 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
9064 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
9065 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
9066 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
9067 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
9068 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
9069 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
9070 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
9071 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
9072 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
9073 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
9074 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
9075 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
9076 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
9077 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
9078 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
9079 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
9080 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
9081 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
9082 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
9083 #endif /* HAVE_IPV6 */
9085 /* "clear ip bgp neighbor soft out" */
9086 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
9087 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
9088 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
9089 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
9090 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
9091 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
9092 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
9093 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
9094 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
9095 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
9096 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
9097 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
9098 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
9099 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
9100 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
9101 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
9102 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
9103 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
9104 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
9105 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
9106 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
9107 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
9108 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_out_cmd
);
9109 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_out_cmd
);
9110 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_out_cmd
);
9111 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_out_cmd
);
9112 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_out_cmd
);
9113 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_out_cmd
);
9115 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
9116 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
9117 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
9118 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
9119 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
9120 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
9121 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
9122 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
9123 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
9124 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
9125 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
9126 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
9127 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
9128 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
9129 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
9130 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
9131 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
9132 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
9133 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
9134 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
9135 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
9136 #endif /* HAVE_IPV6 */
9138 /* "clear ip bgp neighbor soft" */
9139 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
9140 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
9141 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
9142 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
9143 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
9144 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
9145 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
9146 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
9147 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
9148 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
9149 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
9150 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
9151 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_cmd
);
9152 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_cmd
);
9153 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_cmd
);
9155 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
9156 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
9157 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
9158 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
9159 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
9160 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
9161 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
9162 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
9163 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
9164 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
9165 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
9166 #endif /* HAVE_IPV6 */
9168 /* "clear ip bgp neighbor rsclient" */
9169 install_element (ENABLE_NODE
, &clear_ip_bgp_all_rsclient_cmd
);
9170 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_rsclient_cmd
);
9171 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_rsclient_cmd
);
9172 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_peer_rsclient_cmd
);
9174 install_element (ENABLE_NODE
, &clear_bgp_all_rsclient_cmd
);
9175 install_element (ENABLE_NODE
, &clear_bgp_instance_all_rsclient_cmd
);
9176 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_rsclient_cmd
);
9177 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_all_rsclient_cmd
);
9178 install_element (ENABLE_NODE
, &clear_bgp_peer_rsclient_cmd
);
9179 install_element (ENABLE_NODE
, &clear_bgp_instance_peer_rsclient_cmd
);
9180 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_rsclient_cmd
);
9181 install_element (ENABLE_NODE
, &clear_bgp_ipv6_instance_peer_rsclient_cmd
);
9182 #endif /* HAVE_IPV6 */
9184 /* "show ip bgp summary" commands. */
9185 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
9186 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
9187 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9188 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9189 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9190 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9192 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
9193 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
9194 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
9195 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9196 #endif /* HAVE_IPV6 */
9197 install_element (ENABLE_NODE
, &show_ip_bgp_summary_cmd
);
9198 install_element (ENABLE_NODE
, &show_ip_bgp_instance_summary_cmd
);
9199 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
9200 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
9201 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
9202 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
9204 install_element (ENABLE_NODE
, &show_bgp_summary_cmd
);
9205 install_element (ENABLE_NODE
, &show_bgp_instance_summary_cmd
);
9206 install_element (ENABLE_NODE
, &show_bgp_ipv6_summary_cmd
);
9207 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
9208 #endif /* HAVE_IPV6 */
9210 /* "show ip bgp neighbors" commands. */
9211 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
9212 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
9213 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9214 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9215 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
9216 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
9217 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9218 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9219 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
9220 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9221 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_cmd
);
9222 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
9223 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
9224 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
9225 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
9226 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
9227 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
9228 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
9229 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
9230 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
9233 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
9234 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
9235 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
9236 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9237 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
9238 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
9239 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9240 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9241 install_element (ENABLE_NODE
, &show_bgp_neighbors_cmd
);
9242 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_cmd
);
9243 install_element (ENABLE_NODE
, &show_bgp_neighbors_peer_cmd
);
9244 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
9245 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_cmd
);
9246 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
9247 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
9248 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
9251 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
9252 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
9253 install_element (ENABLE_NODE
, &show_ipv6_bgp_summary_cmd
);
9254 install_element (ENABLE_NODE
, &show_ipv6_mbgp_summary_cmd
);
9255 #endif /* HAVE_IPV6 */
9257 /* "show ip bgp rsclient" commands. */
9258 install_element (VIEW_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9259 install_element (VIEW_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9260 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9261 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9262 install_element (ENABLE_NODE
, &show_ip_bgp_rsclient_summary_cmd
);
9263 install_element (ENABLE_NODE
, &show_ip_bgp_instance_rsclient_summary_cmd
);
9264 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_rsclient_summary_cmd
);
9265 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd
);
9268 install_element (VIEW_NODE
, &show_bgp_rsclient_summary_cmd
);
9269 install_element (VIEW_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9270 install_element (VIEW_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9271 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9272 install_element (ENABLE_NODE
, &show_bgp_rsclient_summary_cmd
);
9273 install_element (ENABLE_NODE
, &show_bgp_ipv6_rsclient_summary_cmd
);
9274 install_element (ENABLE_NODE
, &show_bgp_instance_rsclient_summary_cmd
);
9275 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_rsclient_summary_cmd
);
9276 #endif /* HAVE_IPV6 */
9278 /* "show ip bgp paths" commands. */
9279 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
9280 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
9281 install_element (ENABLE_NODE
, &show_ip_bgp_paths_cmd
);
9282 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
9284 /* "show ip bgp community" commands. */
9285 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
9286 install_element (ENABLE_NODE
, &show_ip_bgp_community_info_cmd
);
9288 /* "show ip bgp attribute-info" commands. */
9289 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
9290 install_element (ENABLE_NODE
, &show_ip_bgp_attr_info_cmd
);
9292 /* "redistribute" commands. */
9293 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
9294 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
9295 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
9296 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
9297 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
9298 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
9299 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
9300 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
9301 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
9302 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
9304 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
9305 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
9306 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
9307 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
9308 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
9309 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
9310 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
9311 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
9312 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
9313 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
9314 #endif /* HAVE_IPV6 */
9316 /* Community-list. */
9317 community_list_vty ();
9321 #include "bgp_regex.h"
9322 #include "bgp_clist.h"
9323 #include "bgp_ecommunity.h"
9325 /* VTY functions. */
9327 /* Direction value to string conversion. */
9329 community_direct_str (int direct
)
9333 case COMMUNITY_DENY
:
9336 case COMMUNITY_PERMIT
:
9345 /* Display error string. */
9347 community_list_perror (struct vty
*vty
, int ret
)
9351 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
9352 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
9354 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
9355 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
9357 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
9358 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
9360 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
9361 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
9366 /* VTY interface for community_set() function. */
9368 community_list_set_vty (struct vty
*vty
, int argc
, char **argv
, int style
,
9369 int reject_all_digit_name
)
9375 /* Check the list type. */
9376 if (strncmp (argv
[1], "p", 1) == 0)
9377 direct
= COMMUNITY_PERMIT
;
9378 else if (strncmp (argv
[1], "d", 1) == 0)
9379 direct
= COMMUNITY_DENY
;
9382 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9387 /* All digit name check. */
9388 if (reject_all_digit_name
&& all_digit (argv
[0]))
9390 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
9394 /* Concat community string argument. */
9396 str
= argv_concat (argv
, argc
, 2);
9400 /* When community_list_set() return nevetive value, it means
9401 malformed community string. */
9402 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
9404 /* Free temporary community list string allocated by
9407 XFREE (MTYPE_TMP
, str
);
9411 /* Display error string. */
9412 community_list_perror (vty
, ret
);
9419 /* Community-list delete with name. */
9421 community_list_unset_all_vty (struct vty
*vty
, char *name
)
9425 ret
= community_list_unset (bgp_clist
, name
, NULL
, 0, COMMUNITY_LIST_AUTO
);
9429 community_list_perror (vty
, ret
);
9435 /* Communiyt-list entry delete. */
9437 community_list_unset_vty (struct vty
*vty
, int argc
, char **argv
, int style
)
9443 /* Check the list direct. */
9444 if (strncmp (argv
[1], "p", 1) == 0)
9445 direct
= COMMUNITY_PERMIT
;
9446 else if (strncmp (argv
[1], "d", 1) == 0)
9447 direct
= COMMUNITY_DENY
;
9450 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9455 /* Concat community string argument. */
9456 str
= argv_concat (argv
, argc
, 2);
9458 /* Unset community list. */
9459 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
9461 /* Free temporary community list string allocated by
9463 XFREE (MTYPE_TMP
, str
);
9467 community_list_perror (vty
, ret
);
9474 /* "community-list" keyword help string. */
9475 #define COMMUNITY_LIST_STR "Add a community list entry\n"
9476 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
9478 DEFUN (ip_community_list
,
9479 ip_community_list_cmd
,
9480 "ip community-list WORD (deny|permit) .AA:NN",
9483 "Community list name\n"
9484 "Specify community to reject\n"
9485 "Specify community to accept\n"
9488 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_AUTO
, 1);
9491 DEFUN (ip_community_list_standard
,
9492 ip_community_list_standard_cmd
,
9493 "ip community-list <1-99> (deny|permit) .AA:NN",
9496 "Community list number (standard)\n"
9497 "Specify community to reject\n"
9498 "Specify community to accept\n"
9501 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
9504 ALIAS (ip_community_list_standard
,
9505 ip_community_list_standard2_cmd
,
9506 "ip community-list <1-99> (deny|permit)",
9509 "Community list number (standard)\n"
9510 "Specify community to reject\n"
9511 "Specify community to accept\n")
9513 DEFUN (ip_community_list_expanded
,
9514 ip_community_list_expanded_cmd
,
9515 "ip community-list <100-199> (deny|permit) .LINE",
9518 "Community list number (expanded)\n"
9519 "Specify community to reject\n"
9520 "Specify community to accept\n"
9521 "An ordered list as a regular-expression\n")
9523 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
9526 DEFUN (ip_community_list_name_standard
,
9527 ip_community_list_name_standard_cmd
,
9528 "ip community-list standard WORD (deny|permit) .AA:NN",
9531 "Add a standard community-list entry\n"
9532 "Community list name\n"
9533 "Specify community to reject\n"
9534 "Specify community to accept\n"
9537 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
9540 ALIAS (ip_community_list_name_standard
,
9541 ip_community_list_name_standard2_cmd
,
9542 "ip community-list standard WORD (deny|permit)",
9545 "Add a standard community-list entry\n"
9546 "Community list name\n"
9547 "Specify community to reject\n"
9548 "Specify community to accept\n")
9550 DEFUN (ip_community_list_name_expanded
,
9551 ip_community_list_name_expanded_cmd
,
9552 "ip community-list expanded WORD (deny|permit) .LINE",
9555 "Add an expanded community-list entry\n"
9556 "Community list name\n"
9557 "Specify community to reject\n"
9558 "Specify community to accept\n"
9559 "An ordered list as a regular-expression\n")
9561 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
9564 DEFUN (no_ip_community_list_all
,
9565 no_ip_community_list_all_cmd
,
9566 "no ip community-list (WORD|<1-99>|<100-199>)",
9570 "Community list name\n"
9571 "Community list number (standard)\n"
9572 "Community list number (expanded)\n")
9574 return community_list_unset_all_vty (vty
, argv
[0]);
9577 DEFUN (no_ip_community_list_name_all
,
9578 no_ip_community_list_name_all_cmd
,
9579 "no ip community-list (standard|expanded) WORD",
9583 "Add a standard community-list entry\n"
9584 "Add an expanded community-list entry\n"
9585 "Community list name\n")
9587 return community_list_unset_all_vty (vty
, argv
[1]);
9590 DEFUN (no_ip_community_list
,
9591 no_ip_community_list_cmd
,
9592 "no ip community-list WORD (deny|permit) .AA:NN",
9596 "Community list name\n"
9597 "Specify community to reject\n"
9598 "Specify community to accept\n"
9601 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_AUTO
);
9604 DEFUN (no_ip_community_list_standard
,
9605 no_ip_community_list_standard_cmd
,
9606 "no ip community-list <1-99> (deny|permit) .AA:NN",
9610 "Community list number (standard)\n"
9611 "Specify community to reject\n"
9612 "Specify community to accept\n"
9615 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
9618 DEFUN (no_ip_community_list_expanded
,
9619 no_ip_community_list_expanded_cmd
,
9620 "no ip community-list <100-199> (deny|permit) .LINE",
9624 "Community list number (expanded)\n"
9625 "Specify community to reject\n"
9626 "Specify community to accept\n"
9627 "An ordered list as a regular-expression\n")
9629 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
9632 DEFUN (no_ip_community_list_name_standard
,
9633 no_ip_community_list_name_standard_cmd
,
9634 "no ip community-list standard WORD (deny|permit) .AA:NN",
9638 "Specify a standard community-list\n"
9639 "Community list name\n"
9640 "Specify community to reject\n"
9641 "Specify community to accept\n"
9644 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
9647 DEFUN (no_ip_community_list_name_expanded
,
9648 no_ip_community_list_name_expanded_cmd
,
9649 "no ip community-list expanded WORD (deny|permit) .LINE",
9653 "Specify an expanded community-list\n"
9654 "Community list name\n"
9655 "Specify community to reject\n"
9656 "Specify community to accept\n"
9657 "An ordered list as a regular-expression\n")
9659 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
9663 community_list_show (struct vty
*vty
, struct community_list
*list
)
9665 struct community_entry
*entry
;
9667 for (entry
= list
->head
; entry
; entry
= entry
->next
)
9669 if (entry
== list
->head
)
9671 if (all_digit (list
->name
))
9672 vty_out (vty
, "Community %s list %s%s",
9673 entry
->style
== COMMUNITY_LIST_STANDARD
?
9674 "standard" : "(expanded) access",
9675 list
->name
, VTY_NEWLINE
);
9677 vty_out (vty
, "Named Community %s list %s%s",
9678 entry
->style
== COMMUNITY_LIST_STANDARD
?
9679 "standard" : "expanded",
9680 list
->name
, VTY_NEWLINE
);
9683 vty_out (vty
, " %s%s",
9684 community_direct_str (entry
->direct
), VTY_NEWLINE
);
9686 vty_out (vty
, " %s %s%s",
9687 community_direct_str (entry
->direct
),
9688 entry
->style
== COMMUNITY_LIST_STANDARD
9689 ? community_str (entry
->u
.com
) : entry
->config
,
9694 DEFUN (show_ip_community_list
,
9695 show_ip_community_list_cmd
,
9696 "show ip community-list",
9699 "List community-list\n")
9701 struct community_list
*list
;
9702 struct community_list_master
*cm
;
9704 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_AUTO
);
9708 for (list
= cm
->num
.head
; list
; list
= list
->next
)
9709 community_list_show (vty
, list
);
9711 for (list
= cm
->str
.head
; list
; list
= list
->next
)
9712 community_list_show (vty
, list
);
9717 DEFUN (show_ip_community_list_arg
,
9718 show_ip_community_list_arg_cmd
,
9719 "show ip community-list (<1-199>|WORD)",
9722 "List community-list\n"
9723 "Community-list number\n"
9724 "Community-list name\n")
9726 struct community_list
*list
;
9728 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_AUTO
);
9731 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
9735 community_list_show (vty
, list
);
9741 extcommunity_list_set_vty (struct vty
*vty
, int argc
, char **argv
, int style
,
9742 int reject_all_digit_name
)
9748 /* Check the list type. */
9749 if (strncmp (argv
[1], "p", 1) == 0)
9750 direct
= COMMUNITY_PERMIT
;
9751 else if (strncmp (argv
[1], "d", 1) == 0)
9752 direct
= COMMUNITY_DENY
;
9755 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9760 /* All digit name check. */
9761 if (reject_all_digit_name
&& all_digit (argv
[0]))
9763 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
9767 /* Concat community string argument. */
9769 str
= argv_concat (argv
, argc
, 2);
9773 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
9775 /* Free temporary community list string allocated by
9778 XFREE (MTYPE_TMP
, str
);
9782 community_list_perror (vty
, ret
);
9789 extcommunity_list_unset_all_vty (struct vty
*vty
, char *name
)
9793 ret
= extcommunity_list_unset (bgp_clist
, name
, NULL
, 0, EXTCOMMUNITY_LIST_AUTO
);
9797 community_list_perror (vty
, ret
);
9804 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, char **argv
, int style
)
9810 /* Check the list direct. */
9811 if (strncmp (argv
[1], "p", 1) == 0)
9812 direct
= COMMUNITY_PERMIT
;
9813 else if (strncmp (argv
[1], "d", 1) == 0)
9814 direct
= COMMUNITY_DENY
;
9817 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9822 /* Concat community string argument. */
9823 str
= argv_concat (argv
, argc
, 2);
9825 /* Unset community list. */
9826 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
9828 /* Free temporary community list string allocated by
9830 XFREE (MTYPE_TMP
, str
);
9834 community_list_perror (vty
, ret
);
9841 /* "extcommunity-list" keyword help string. */
9842 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
9843 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
9845 DEFUN (ip_extcommunity_list_standard
,
9846 ip_extcommunity_list_standard_cmd
,
9847 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
9849 EXTCOMMUNITY_LIST_STR
9850 "Extended Community list number (standard)\n"
9851 "Specify community to reject\n"
9852 "Specify community to accept\n"
9853 EXTCOMMUNITY_VAL_STR
)
9855 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
9858 ALIAS (ip_extcommunity_list_standard
,
9859 ip_extcommunity_list_standard2_cmd
,
9860 "ip extcommunity-list <1-99> (deny|permit)",
9862 EXTCOMMUNITY_LIST_STR
9863 "Extended Community list number (standard)\n"
9864 "Specify community to reject\n"
9865 "Specify community to accept\n")
9867 DEFUN (ip_extcommunity_list_expanded
,
9868 ip_extcommunity_list_expanded_cmd
,
9869 "ip extcommunity-list <100-199> (deny|permit) .LINE",
9871 EXTCOMMUNITY_LIST_STR
9872 "Extended Community list number (expanded)\n"
9873 "Specify community to reject\n"
9874 "Specify community to accept\n"
9875 "An ordered list as a regular-expression\n")
9877 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
9880 DEFUN (ip_extcommunity_list_name_standard
,
9881 ip_extcommunity_list_name_standard_cmd
,
9882 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
9884 EXTCOMMUNITY_LIST_STR
9885 "Specify standard extcommunity-list\n"
9886 "Extended Community list name\n"
9887 "Specify community to reject\n"
9888 "Specify community to accept\n"
9889 EXTCOMMUNITY_VAL_STR
)
9891 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
9894 ALIAS (ip_extcommunity_list_name_standard
,
9895 ip_extcommunity_list_name_standard2_cmd
,
9896 "ip extcommunity-list standard WORD (deny|permit)",
9898 EXTCOMMUNITY_LIST_STR
9899 "Specify standard extcommunity-list\n"
9900 "Extended Community list name\n"
9901 "Specify community to reject\n"
9902 "Specify community to accept\n")
9904 DEFUN (ip_extcommunity_list_name_expanded
,
9905 ip_extcommunity_list_name_expanded_cmd
,
9906 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
9908 EXTCOMMUNITY_LIST_STR
9909 "Specify expanded extcommunity-list\n"
9910 "Extended Community list name\n"
9911 "Specify community to reject\n"
9912 "Specify community to accept\n"
9913 "An ordered list as a regular-expression\n")
9915 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
9918 DEFUN (no_ip_extcommunity_list_all
,
9919 no_ip_extcommunity_list_all_cmd
,
9920 "no ip extcommunity-list (<1-99>|<100-199>)",
9923 EXTCOMMUNITY_LIST_STR
9924 "Extended Community list number (standard)\n"
9925 "Extended Community list number (expanded)\n")
9927 return extcommunity_list_unset_all_vty (vty
, argv
[0]);
9930 DEFUN (no_ip_extcommunity_list_name_all
,
9931 no_ip_extcommunity_list_name_all_cmd
,
9932 "no ip extcommunity-list (standard|expanded) WORD",
9935 EXTCOMMUNITY_LIST_STR
9936 "Specify standard extcommunity-list\n"
9937 "Specify expanded extcommunity-list\n"
9938 "Extended Community list name\n")
9940 return extcommunity_list_unset_all_vty (vty
, argv
[1]);
9943 DEFUN (no_ip_extcommunity_list_standard
,
9944 no_ip_extcommunity_list_standard_cmd
,
9945 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
9948 EXTCOMMUNITY_LIST_STR
9949 "Extended Community list number (standard)\n"
9950 "Specify community to reject\n"
9951 "Specify community to accept\n"
9952 EXTCOMMUNITY_VAL_STR
)
9954 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
9957 DEFUN (no_ip_extcommunity_list_expanded
,
9958 no_ip_extcommunity_list_expanded_cmd
,
9959 "no ip extcommunity-list <100-199> (deny|permit) .LINE",
9962 EXTCOMMUNITY_LIST_STR
9963 "Extended Community list number (expanded)\n"
9964 "Specify community to reject\n"
9965 "Specify community to accept\n"
9966 "An ordered list as a regular-expression\n")
9968 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
9971 DEFUN (no_ip_extcommunity_list_name_standard
,
9972 no_ip_extcommunity_list_name_standard_cmd
,
9973 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
9976 EXTCOMMUNITY_LIST_STR
9977 "Specify standard extcommunity-list\n"
9978 "Extended Community list name\n"
9979 "Specify community to reject\n"
9980 "Specify community to accept\n"
9981 EXTCOMMUNITY_VAL_STR
)
9983 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
9986 DEFUN (no_ip_extcommunity_list_name_expanded
,
9987 no_ip_extcommunity_list_name_expanded_cmd
,
9988 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
9991 EXTCOMMUNITY_LIST_STR
9992 "Specify expanded extcommunity-list\n"
9993 "Community list name\n"
9994 "Specify community to reject\n"
9995 "Specify community to accept\n"
9996 "An ordered list as a regular-expression\n")
9998 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
10002 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
10004 struct community_entry
*entry
;
10006 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10008 if (entry
== list
->head
)
10010 if (all_digit (list
->name
))
10011 vty_out (vty
, "Extended community %s list %s%s",
10012 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10013 "standard" : "(expanded) access",
10014 list
->name
, VTY_NEWLINE
);
10016 vty_out (vty
, "Named extended community %s list %s%s",
10017 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10018 "standard" : "expanded",
10019 list
->name
, VTY_NEWLINE
);
10022 vty_out (vty
, " %s%s",
10023 community_direct_str (entry
->direct
), VTY_NEWLINE
);
10025 vty_out (vty
, " %s %s%s",
10026 community_direct_str (entry
->direct
),
10027 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
10028 entry
->u
.ecom
->str
: entry
->config
,
10033 DEFUN (show_ip_extcommunity_list
,
10034 show_ip_extcommunity_list_cmd
,
10035 "show ip extcommunity-list",
10038 "List extended-community list\n")
10040 struct community_list
*list
;
10041 struct community_list_master
*cm
;
10043 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_AUTO
);
10045 return CMD_SUCCESS
;
10047 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10048 extcommunity_list_show (vty
, list
);
10050 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10051 extcommunity_list_show (vty
, list
);
10053 return CMD_SUCCESS
;
10056 DEFUN (show_ip_extcommunity_list_arg
,
10057 show_ip_extcommunity_list_arg_cmd
,
10058 "show ip extcommunity-list (<1-199>|WORD)",
10061 "List extended-community list\n"
10062 "Extcommunity-list number\n"
10063 "Extcommunity-list name\n")
10065 struct community_list
*list
;
10067 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_AUTO
);
10070 vty_out (vty
, "%% Can't find extcommunit-list%s", VTY_NEWLINE
);
10071 return CMD_WARNING
;
10074 extcommunity_list_show (vty
, list
);
10076 return CMD_SUCCESS
;
10079 /* Return configuration string of community-list entry. */
10081 community_list_config_str (struct community_entry
*entry
)
10089 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
10090 str
= community_str (entry
->u
.com
);
10092 str
= entry
->config
;
10097 /* Display community-list and extcommunity-list configuration. */
10099 community_list_config_write (struct vty
*vty
)
10101 struct community_list
*list
;
10102 struct community_entry
*entry
;
10103 struct community_list_master
*cm
;
10106 /* Community-list. */
10107 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_AUTO
);
10109 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10110 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10112 if (atol (list
->name
) < 200)
10113 vty_out (vty
, "ip community-list %s %s %s%s",
10114 list
->name
, community_direct_str (entry
->direct
),
10115 community_list_config_str (entry
),
10118 vty_out (vty
, "ip community-list %s %s %s %s%s",
10119 entry
->style
== COMMUNITY_LIST_STANDARD
10120 ? "standard" : "expanded",
10121 list
->name
, community_direct_str (entry
->direct
),
10122 community_list_config_str (entry
),
10126 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10127 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10129 vty_out (vty
, "ip community-list %s %s %s %s%s",
10130 entry
->style
== COMMUNITY_LIST_STANDARD
10131 ? "standard" : "expanded",
10132 list
->name
, community_direct_str (entry
->direct
),
10133 community_list_config_str (entry
),
10138 /* Extcommunity-list. */
10139 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_AUTO
);
10141 for (list
= cm
->num
.head
; list
; list
= list
->next
)
10142 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10144 if (atol (list
->name
) < 200)
10145 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
10146 list
->name
, community_direct_str (entry
->direct
),
10147 community_list_config_str (entry
), VTY_NEWLINE
);
10149 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
10150 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
10151 ? "standard" : "expanded",
10152 list
->name
, community_direct_str (entry
->direct
),
10153 community_list_config_str (entry
), VTY_NEWLINE
);
10156 for (list
= cm
->str
.head
; list
; list
= list
->next
)
10157 for (entry
= list
->head
; entry
; entry
= entry
->next
)
10159 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
10160 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
10161 ? "standard" : "expanded",
10162 list
->name
, community_direct_str (entry
->direct
),
10163 community_list_config_str (entry
), VTY_NEWLINE
);
10169 struct cmd_node community_list_node
=
10171 COMMUNITY_LIST_NODE
,
10173 1 /* Export to vtysh. */
10177 community_list_vty ()
10179 install_node (&community_list_node
, community_list_config_write
);
10181 /* Community-list. */
10182 install_element (CONFIG_NODE
, &ip_community_list_cmd
);
10183 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
10184 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
10185 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
10186 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
10187 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
10188 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
10189 install_element (CONFIG_NODE
, &no_ip_community_list_all_cmd
);
10190 install_element (CONFIG_NODE
, &no_ip_community_list_name_all_cmd
);
10191 install_element (CONFIG_NODE
, &no_ip_community_list_cmd
);
10192 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
10193 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
10194 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
10195 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
10196 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
10197 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
10198 install_element (ENABLE_NODE
, &show_ip_community_list_cmd
);
10199 install_element (ENABLE_NODE
, &show_ip_community_list_arg_cmd
);
10201 /* Extcommunity-list. */
10202 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
10203 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
10204 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
10205 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
10206 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
10207 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
10208 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_all_cmd
);
10209 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_all_cmd
);
10210 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
10211 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
10212 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
10213 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
10214 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
10215 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);
10216 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_cmd
);
10217 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_arg_cmd
);