paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* BGP VTY interface. |
| 2 | Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro |
| 3 | |
| 4 | This file is part of GNU Zebra. |
| 5 | |
| 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 |
| 9 | later version. |
| 10 | |
| 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. |
| 15 | |
| 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 |
| 19 | 02111-1307, USA. */ |
| 20 | |
| 21 | #include <zebra.h> |
| 22 | |
| 23 | #include "command.h" |
| 24 | #include "prefix.h" |
| 25 | #include "plist.h" |
| 26 | #include "buffer.h" |
| 27 | #include "linklist.h" |
| 28 | #include "stream.h" |
| 29 | #include "thread.h" |
| 30 | #include "log.h" |
ajs | 3b8b185 | 2005-01-29 18:19:13 +0000 | [diff] [blame] | 31 | #include "memory.h" |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 32 | #include "hash.h" |
Donald Sharp | 0490729 | 2016-01-07 10:03:01 -0500 | [diff] [blame] | 33 | #include "filter.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 34 | |
| 35 | #include "bgpd/bgpd.h" |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 36 | #include "bgpd/bgp_advertise.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 37 | #include "bgpd/bgp_attr.h" |
| 38 | #include "bgpd/bgp_aspath.h" |
| 39 | #include "bgpd/bgp_community.h" |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 40 | #include "bgpd/bgp_ecommunity.h" |
| 41 | #include "bgpd/bgp_damp.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 42 | #include "bgpd/bgp_debug.h" |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 43 | #include "bgpd/bgp_fsm.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 44 | #include "bgpd/bgp_mplsvpn.h" |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 45 | #include "bgpd/bgp_nexthop.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 46 | #include "bgpd/bgp_open.h" |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 47 | #include "bgpd/bgp_regex.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 48 | #include "bgpd/bgp_route.h" |
| 49 | #include "bgpd/bgp_zebra.h" |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 50 | #include "bgpd/bgp_table.h" |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 51 | #include "bgpd/bgp_vty.h" |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 52 | #include "bgpd/bgp_mpath.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 53 | |
| 54 | /* Utility function to get address family from current node. */ |
| 55 | afi_t |
| 56 | bgp_node_afi (struct vty *vty) |
| 57 | { |
Lou Berger | 135ca15 | 2016-01-12 13:42:05 -0500 | [diff] [blame] | 58 | afi_t afi; |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 59 | switch (vty->node) |
| 60 | { |
| 61 | case BGP_IPV6_NODE: |
| 62 | case BGP_IPV6M_NODE: |
| 63 | case BGP_VPNV6_NODE: |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 64 | case BGP_ENCAPV6_NODE: |
Lou Berger | 135ca15 | 2016-01-12 13:42:05 -0500 | [diff] [blame] | 65 | afi = AFI_IP6; |
| 66 | break; |
| 67 | default: |
| 68 | afi = AFI_IP; |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 69 | break; |
| 70 | } |
Lou Berger | 135ca15 | 2016-01-12 13:42:05 -0500 | [diff] [blame] | 71 | return afi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | /* Utility function to get subsequent address family from current |
| 75 | node. */ |
| 76 | safi_t |
| 77 | bgp_node_safi (struct vty *vty) |
| 78 | { |
Lou Berger | 135ca15 | 2016-01-12 13:42:05 -0500 | [diff] [blame] | 79 | safi_t safi; |
| 80 | switch (vty->node) |
| 81 | { |
| 82 | case BGP_ENCAP_NODE: |
| 83 | case BGP_ENCAPV6_NODE: |
| 84 | safi = SAFI_ENCAP; |
| 85 | break; |
| 86 | case BGP_VPNV4_NODE: |
| 87 | case BGP_VPNV6_NODE: |
| 88 | safi = SAFI_MPLS_VPN; |
| 89 | break; |
| 90 | case BGP_IPV4M_NODE: |
| 91 | case BGP_IPV6M_NODE: |
| 92 | safi = SAFI_MULTICAST; |
| 93 | break; |
| 94 | default: |
| 95 | safi = SAFI_UNICAST; |
| 96 | break; |
| 97 | } |
| 98 | return safi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 99 | } |
| 100 | |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 101 | int |
| 102 | bgp_parse_afi(const char *str, afi_t *afi) |
| 103 | { |
| 104 | if (!strcmp(str, "ipv4")) { |
| 105 | *afi = AFI_IP; |
| 106 | return 0; |
| 107 | } |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 108 | if (!strcmp(str, "ipv6")) { |
| 109 | *afi = AFI_IP6; |
| 110 | return 0; |
| 111 | } |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 112 | return -1; |
| 113 | } |
| 114 | |
| 115 | int |
| 116 | bgp_parse_safi(const char *str, safi_t *safi) |
| 117 | { |
| 118 | if (!strcmp(str, "encap")) { |
| 119 | *safi = SAFI_ENCAP; |
| 120 | return 0; |
| 121 | } |
| 122 | if (!strcmp(str, "multicast")) { |
| 123 | *safi = SAFI_MULTICAST; |
| 124 | return 0; |
| 125 | } |
| 126 | if (!strcmp(str, "unicast")) { |
| 127 | *safi = SAFI_UNICAST; |
| 128 | return 0; |
| 129 | } |
| 130 | if (!strcmp(str, "vpn")) { |
| 131 | *safi = SAFI_MPLS_VPN; |
| 132 | return 0; |
| 133 | } |
| 134 | return -1; |
| 135 | } |
| 136 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 137 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 138 | peer_address_self_check (union sockunion *su) |
| 139 | { |
| 140 | struct interface *ifp = NULL; |
| 141 | |
| 142 | if (su->sa.sa_family == AF_INET) |
| 143 | ifp = if_lookup_by_ipv4_exact (&su->sin.sin_addr); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 144 | else if (su->sa.sa_family == AF_INET6) |
| 145 | ifp = if_lookup_by_ipv6_exact (&su->sin6.sin6_addr); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 146 | |
| 147 | if (ifp) |
| 148 | return 1; |
| 149 | |
| 150 | return 0; |
| 151 | } |
| 152 | |
| 153 | /* Utility function for looking up peer from VTY. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 154 | static struct peer * |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 155 | peer_lookup_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 156 | { |
| 157 | int ret; |
| 158 | struct bgp *bgp; |
| 159 | union sockunion su; |
| 160 | struct peer *peer; |
| 161 | |
| 162 | bgp = vty->index; |
| 163 | |
| 164 | ret = str2sockunion (ip_str, &su); |
| 165 | if (ret < 0) |
| 166 | { |
| 167 | vty_out (vty, "%% Malformed address: %s%s", ip_str, VTY_NEWLINE); |
| 168 | return NULL; |
| 169 | } |
| 170 | |
| 171 | peer = peer_lookup (bgp, &su); |
| 172 | if (! peer) |
| 173 | { |
| 174 | vty_out (vty, "%% Specify remote-as or peer-group commands first%s", VTY_NEWLINE); |
| 175 | return NULL; |
| 176 | } |
| 177 | return peer; |
| 178 | } |
| 179 | |
| 180 | /* Utility function for looking up peer or peer group. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 181 | static struct peer * |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 182 | peer_and_group_lookup_vty (struct vty *vty, const char *peer_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 183 | { |
| 184 | int ret; |
| 185 | struct bgp *bgp; |
| 186 | union sockunion su; |
| 187 | struct peer *peer; |
| 188 | struct peer_group *group; |
| 189 | |
| 190 | bgp = vty->index; |
| 191 | |
| 192 | ret = str2sockunion (peer_str, &su); |
| 193 | if (ret == 0) |
| 194 | { |
| 195 | peer = peer_lookup (bgp, &su); |
| 196 | if (peer) |
| 197 | return peer; |
| 198 | } |
| 199 | else |
| 200 | { |
| 201 | group = peer_group_lookup (bgp, peer_str); |
| 202 | if (group) |
| 203 | return group->conf; |
| 204 | } |
| 205 | |
| 206 | vty_out (vty, "%% Specify remote-as or peer-group commands first%s", |
| 207 | VTY_NEWLINE); |
| 208 | |
| 209 | return NULL; |
| 210 | } |
| 211 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 212 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 213 | bgp_vty_return (struct vty *vty, int ret) |
| 214 | { |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 215 | const char *str = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 216 | |
| 217 | switch (ret) |
| 218 | { |
| 219 | case BGP_ERR_INVALID_VALUE: |
| 220 | str = "Invalid value"; |
| 221 | break; |
| 222 | case BGP_ERR_INVALID_FLAG: |
| 223 | str = "Invalid flag"; |
| 224 | break; |
| 225 | case BGP_ERR_PEER_INACTIVE: |
| 226 | str = "Activate the neighbor for the address family first"; |
| 227 | break; |
| 228 | case BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER: |
| 229 | str = "Invalid command for a peer-group member"; |
| 230 | break; |
| 231 | case BGP_ERR_PEER_GROUP_SHUTDOWN: |
| 232 | str = "Peer-group has been shutdown. Activate the peer-group first"; |
| 233 | break; |
| 234 | case BGP_ERR_PEER_GROUP_HAS_THE_FLAG: |
| 235 | str = "This peer is a peer-group member. Please change peer-group configuration"; |
| 236 | break; |
| 237 | case BGP_ERR_PEER_FLAG_CONFLICT: |
| 238 | str = "Can't set override-capability and strict-capability-match at the same time"; |
| 239 | break; |
| 240 | case BGP_ERR_PEER_GROUP_MEMBER_EXISTS: |
| 241 | str = "No activate for peergroup can be given only if peer-group has no members"; |
| 242 | break; |
| 243 | case BGP_ERR_PEER_BELONGS_TO_GROUP: |
| 244 | str = "No activate for an individual peer-group member is invalid"; |
| 245 | break; |
| 246 | case BGP_ERR_PEER_GROUP_AF_UNCONFIGURED: |
| 247 | str = "Activate the peer-group for the address family first"; |
| 248 | break; |
| 249 | case BGP_ERR_PEER_GROUP_NO_REMOTE_AS: |
| 250 | str = "Specify remote-as or peer-group remote AS first"; |
| 251 | break; |
| 252 | case BGP_ERR_PEER_GROUP_CANT_CHANGE: |
| 253 | str = "Cannot change the peer-group. Deconfigure first"; |
| 254 | break; |
| 255 | case BGP_ERR_PEER_GROUP_MISMATCH: |
| 256 | str = "Cannot have different peer-group for the neighbor"; |
| 257 | break; |
| 258 | case BGP_ERR_PEER_FILTER_CONFLICT: |
| 259 | str = "Prefix/distribute list can not co-exist"; |
| 260 | break; |
| 261 | case BGP_ERR_NOT_INTERNAL_PEER: |
| 262 | str = "Invalid command. Not an internal neighbor"; |
| 263 | break; |
| 264 | case BGP_ERR_REMOVE_PRIVATE_AS: |
| 265 | str = "Private AS cannot be removed for IBGP peers"; |
| 266 | break; |
| 267 | case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP: |
| 268 | str = "Local-AS allowed only for EBGP peers"; |
| 269 | break; |
| 270 | case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS: |
| 271 | str = "Cannot have local-as same as BGP AS number"; |
| 272 | break; |
Paul Jakma | 0df7c91 | 2008-07-21 21:02:49 +0000 | [diff] [blame] | 273 | case BGP_ERR_TCPSIG_FAILED: |
| 274 | str = "Error while applying TCP-Sig to session(s)"; |
| 275 | break; |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 276 | case BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK: |
| 277 | str = "ebgp-multihop and ttl-security cannot be configured together"; |
| 278 | break; |
Stephen Hemminger | f5a4827 | 2011-03-24 17:30:21 +0000 | [diff] [blame] | 279 | case BGP_ERR_NO_IBGP_WITH_TTLHACK: |
| 280 | str = "ttl-security only allowed for EBGP peers"; |
| 281 | break; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 282 | } |
| 283 | if (str) |
| 284 | { |
| 285 | vty_out (vty, "%% %s%s", str, VTY_NEWLINE); |
| 286 | return CMD_WARNING; |
| 287 | } |
| 288 | return CMD_SUCCESS; |
| 289 | } |
| 290 | |
| 291 | /* BGP global configuration. */ |
| 292 | |
| 293 | DEFUN (bgp_multiple_instance_func, |
| 294 | bgp_multiple_instance_cmd, |
| 295 | "bgp multiple-instance", |
| 296 | BGP_STR |
| 297 | "Enable bgp multiple instance\n") |
| 298 | { |
| 299 | bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE); |
| 300 | return CMD_SUCCESS; |
| 301 | } |
| 302 | |
| 303 | DEFUN (no_bgp_multiple_instance, |
| 304 | no_bgp_multiple_instance_cmd, |
| 305 | "no bgp multiple-instance", |
| 306 | NO_STR |
| 307 | BGP_STR |
| 308 | "BGP multiple instance\n") |
| 309 | { |
| 310 | int ret; |
| 311 | |
| 312 | ret = bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE); |
| 313 | if (ret < 0) |
| 314 | { |
| 315 | vty_out (vty, "%% There are more than two BGP instances%s", VTY_NEWLINE); |
| 316 | return CMD_WARNING; |
| 317 | } |
| 318 | return CMD_SUCCESS; |
| 319 | } |
| 320 | |
| 321 | DEFUN (bgp_config_type, |
| 322 | bgp_config_type_cmd, |
| 323 | "bgp config-type (cisco|zebra)", |
| 324 | BGP_STR |
| 325 | "Configuration type\n" |
| 326 | "cisco\n" |
| 327 | "zebra\n") |
| 328 | { |
| 329 | if (strncmp (argv[0], "c", 1) == 0) |
| 330 | bgp_option_set (BGP_OPT_CONFIG_CISCO); |
| 331 | else |
| 332 | bgp_option_unset (BGP_OPT_CONFIG_CISCO); |
| 333 | |
| 334 | return CMD_SUCCESS; |
| 335 | } |
| 336 | |
| 337 | DEFUN (no_bgp_config_type, |
| 338 | no_bgp_config_type_cmd, |
| 339 | "no bgp config-type", |
| 340 | NO_STR |
| 341 | BGP_STR |
| 342 | "Display configuration type\n") |
| 343 | { |
| 344 | bgp_option_unset (BGP_OPT_CONFIG_CISCO); |
| 345 | return CMD_SUCCESS; |
| 346 | } |
| 347 | |
| 348 | DEFUN (no_synchronization, |
| 349 | no_synchronization_cmd, |
| 350 | "no synchronization", |
| 351 | NO_STR |
| 352 | "Perform IGP synchronization\n") |
| 353 | { |
| 354 | return CMD_SUCCESS; |
| 355 | } |
| 356 | |
| 357 | DEFUN (no_auto_summary, |
| 358 | no_auto_summary_cmd, |
| 359 | "no auto-summary", |
| 360 | NO_STR |
| 361 | "Enable automatic network number summarization\n") |
| 362 | { |
| 363 | return CMD_SUCCESS; |
| 364 | } |
hasso | 3d515fd | 2005-02-01 21:30:04 +0000 | [diff] [blame] | 365 | |
| 366 | DEFUN_DEPRECATED (neighbor_version, |
| 367 | neighbor_version_cmd, |
| 368 | NEIGHBOR_CMD "version (4|4-)", |
| 369 | NEIGHBOR_STR |
| 370 | NEIGHBOR_ADDR_STR |
| 371 | "Set the BGP version to match a neighbor\n" |
| 372 | "Neighbor's BGP version\n") |
| 373 | { |
| 374 | return CMD_SUCCESS; |
| 375 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 376 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 377 | /* "router bgp" commands. */ |
| 378 | DEFUN (router_bgp, |
| 379 | router_bgp_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 380 | "router bgp " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 381 | ROUTER_STR |
| 382 | BGP_STR |
| 383 | AS_STR) |
| 384 | { |
| 385 | int ret; |
| 386 | as_t as; |
| 387 | struct bgp *bgp; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 388 | const char *name = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 389 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 390 | VTY_GET_INTEGER_RANGE ("AS", as, argv[0], 1, BGP_AS4_MAX); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 391 | |
| 392 | if (argc == 2) |
| 393 | name = argv[1]; |
| 394 | |
| 395 | ret = bgp_get (&bgp, &as, name); |
| 396 | switch (ret) |
| 397 | { |
| 398 | case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET: |
| 399 | vty_out (vty, "Please specify 'bgp multiple-instance' first%s", |
| 400 | VTY_NEWLINE); |
| 401 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 402 | case BGP_ERR_AS_MISMATCH: |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 403 | vty_out (vty, "BGP is already running; AS is %u%s", as, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 404 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 405 | case BGP_ERR_INSTANCE_MISMATCH: |
| 406 | vty_out (vty, "BGP view name and AS number mismatch%s", VTY_NEWLINE); |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 407 | vty_out (vty, "BGP instance is already running; AS is %u%s", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 408 | as, VTY_NEWLINE); |
| 409 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 410 | } |
| 411 | |
| 412 | vty->node = BGP_NODE; |
| 413 | vty->index = bgp; |
| 414 | |
| 415 | return CMD_SUCCESS; |
| 416 | } |
| 417 | |
| 418 | ALIAS (router_bgp, |
| 419 | router_bgp_view_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 420 | "router bgp " CMD_AS_RANGE " view WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 421 | ROUTER_STR |
| 422 | BGP_STR |
| 423 | AS_STR |
| 424 | "BGP view\n" |
| 425 | "view name\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 426 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 427 | /* "no router bgp" commands. */ |
| 428 | DEFUN (no_router_bgp, |
| 429 | no_router_bgp_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 430 | "no router bgp " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 431 | NO_STR |
| 432 | ROUTER_STR |
| 433 | BGP_STR |
| 434 | AS_STR) |
| 435 | { |
| 436 | as_t as; |
| 437 | struct bgp *bgp; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 438 | const char *name = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 439 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 440 | VTY_GET_INTEGER_RANGE ("AS", as, argv[0], 1, BGP_AS4_MAX); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 441 | |
| 442 | if (argc == 2) |
| 443 | name = argv[1]; |
| 444 | |
| 445 | /* Lookup bgp structure. */ |
| 446 | bgp = bgp_lookup (as, name); |
| 447 | if (! bgp) |
| 448 | { |
| 449 | vty_out (vty, "%% Can't find BGP instance%s", VTY_NEWLINE); |
| 450 | return CMD_WARNING; |
| 451 | } |
| 452 | |
| 453 | bgp_delete (bgp); |
| 454 | |
| 455 | return CMD_SUCCESS; |
| 456 | } |
| 457 | |
| 458 | ALIAS (no_router_bgp, |
| 459 | no_router_bgp_view_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 460 | "no router bgp " CMD_AS_RANGE " view WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 461 | NO_STR |
| 462 | ROUTER_STR |
| 463 | BGP_STR |
| 464 | AS_STR |
| 465 | "BGP view\n" |
| 466 | "view name\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 467 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 468 | /* BGP router-id. */ |
| 469 | |
| 470 | DEFUN (bgp_router_id, |
| 471 | bgp_router_id_cmd, |
| 472 | "bgp router-id A.B.C.D", |
| 473 | BGP_STR |
| 474 | "Override configured router identifier\n" |
| 475 | "Manually configured router identifier\n") |
| 476 | { |
| 477 | int ret; |
| 478 | struct in_addr id; |
| 479 | struct bgp *bgp; |
| 480 | |
| 481 | bgp = vty->index; |
| 482 | |
| 483 | ret = inet_aton (argv[0], &id); |
| 484 | if (! ret) |
| 485 | { |
| 486 | vty_out (vty, "%% Malformed bgp router identifier%s", VTY_NEWLINE); |
| 487 | return CMD_WARNING; |
| 488 | } |
| 489 | |
David Lamparter | 584083d | 2016-05-24 18:58:08 +0200 | [diff] [blame] | 490 | bgp_router_id_static_set (bgp, id); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 491 | |
| 492 | return CMD_SUCCESS; |
| 493 | } |
| 494 | |
| 495 | DEFUN (no_bgp_router_id, |
| 496 | no_bgp_router_id_cmd, |
| 497 | "no bgp router-id", |
| 498 | NO_STR |
| 499 | BGP_STR |
| 500 | "Override configured router identifier\n") |
| 501 | { |
| 502 | int ret; |
| 503 | struct in_addr id; |
| 504 | struct bgp *bgp; |
| 505 | |
| 506 | bgp = vty->index; |
| 507 | |
| 508 | if (argc == 1) |
| 509 | { |
| 510 | ret = inet_aton (argv[0], &id); |
| 511 | if (! ret) |
| 512 | { |
| 513 | vty_out (vty, "%% Malformed BGP router identifier%s", VTY_NEWLINE); |
| 514 | return CMD_WARNING; |
| 515 | } |
| 516 | |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 517 | if (! IPV4_ADDR_SAME (&bgp->router_id_static, &id)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 518 | { |
| 519 | vty_out (vty, "%% BGP router-id doesn't match%s", VTY_NEWLINE); |
| 520 | return CMD_WARNING; |
| 521 | } |
| 522 | } |
| 523 | |
David Lamparter | 584083d | 2016-05-24 18:58:08 +0200 | [diff] [blame] | 524 | id.s_addr = 0; |
| 525 | bgp_router_id_static_set (bgp, id); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 526 | |
| 527 | return CMD_SUCCESS; |
| 528 | } |
| 529 | |
| 530 | ALIAS (no_bgp_router_id, |
| 531 | no_bgp_router_id_val_cmd, |
| 532 | "no bgp router-id A.B.C.D", |
| 533 | NO_STR |
| 534 | BGP_STR |
| 535 | "Override configured router identifier\n" |
| 536 | "Manually configured router identifier\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 537 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 538 | /* BGP Cluster ID. */ |
| 539 | |
| 540 | DEFUN (bgp_cluster_id, |
| 541 | bgp_cluster_id_cmd, |
| 542 | "bgp cluster-id A.B.C.D", |
| 543 | BGP_STR |
| 544 | "Configure Route-Reflector Cluster-id\n" |
| 545 | "Route-Reflector Cluster-id in IP address format\n") |
| 546 | { |
| 547 | int ret; |
| 548 | struct bgp *bgp; |
| 549 | struct in_addr cluster; |
| 550 | |
| 551 | bgp = vty->index; |
| 552 | |
| 553 | ret = inet_aton (argv[0], &cluster); |
| 554 | if (! ret) |
| 555 | { |
| 556 | vty_out (vty, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE); |
| 557 | return CMD_WARNING; |
| 558 | } |
| 559 | |
| 560 | bgp_cluster_id_set (bgp, &cluster); |
| 561 | |
| 562 | return CMD_SUCCESS; |
| 563 | } |
| 564 | |
| 565 | ALIAS (bgp_cluster_id, |
| 566 | bgp_cluster_id32_cmd, |
| 567 | "bgp cluster-id <1-4294967295>", |
| 568 | BGP_STR |
| 569 | "Configure Route-Reflector Cluster-id\n" |
| 570 | "Route-Reflector Cluster-id as 32 bit quantity\n") |
| 571 | |
| 572 | DEFUN (no_bgp_cluster_id, |
| 573 | no_bgp_cluster_id_cmd, |
| 574 | "no bgp cluster-id", |
| 575 | NO_STR |
| 576 | BGP_STR |
| 577 | "Configure Route-Reflector Cluster-id\n") |
| 578 | { |
| 579 | int ret; |
| 580 | struct bgp *bgp; |
| 581 | struct in_addr cluster; |
| 582 | |
| 583 | bgp = vty->index; |
| 584 | |
| 585 | if (argc == 1) |
| 586 | { |
| 587 | ret = inet_aton (argv[0], &cluster); |
| 588 | if (! ret) |
| 589 | { |
| 590 | vty_out (vty, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE); |
| 591 | return CMD_WARNING; |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | bgp_cluster_id_unset (bgp); |
| 596 | |
| 597 | return CMD_SUCCESS; |
| 598 | } |
| 599 | |
| 600 | ALIAS (no_bgp_cluster_id, |
| 601 | no_bgp_cluster_id_arg_cmd, |
| 602 | "no bgp cluster-id A.B.C.D", |
| 603 | NO_STR |
| 604 | BGP_STR |
| 605 | "Configure Route-Reflector Cluster-id\n" |
| 606 | "Route-Reflector Cluster-id in IP address format\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 607 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 608 | DEFUN (bgp_confederation_identifier, |
| 609 | bgp_confederation_identifier_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 610 | "bgp confederation identifier " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 611 | "BGP specific commands\n" |
| 612 | "AS confederation parameters\n" |
| 613 | "AS number\n" |
| 614 | "Set routing domain confederation AS\n") |
| 615 | { |
| 616 | struct bgp *bgp; |
| 617 | as_t as; |
| 618 | |
| 619 | bgp = vty->index; |
| 620 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 621 | VTY_GET_INTEGER_RANGE ("AS", as, argv[0], 1, BGP_AS4_MAX); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 622 | |
| 623 | bgp_confederation_id_set (bgp, as); |
| 624 | |
| 625 | return CMD_SUCCESS; |
| 626 | } |
| 627 | |
| 628 | DEFUN (no_bgp_confederation_identifier, |
| 629 | no_bgp_confederation_identifier_cmd, |
| 630 | "no bgp confederation identifier", |
| 631 | NO_STR |
| 632 | "BGP specific commands\n" |
| 633 | "AS confederation parameters\n" |
| 634 | "AS number\n") |
| 635 | { |
| 636 | struct bgp *bgp; |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 637 | as_t as __attribute__((unused)); /* Dummy for VTY_GET_INTEGER_RANGE */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 638 | |
| 639 | bgp = vty->index; |
| 640 | |
| 641 | if (argc == 1) |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 642 | VTY_GET_INTEGER_RANGE ("AS", as, argv[0], 1, BGP_AS4_MAX); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 643 | |
| 644 | bgp_confederation_id_unset (bgp); |
| 645 | |
| 646 | return CMD_SUCCESS; |
| 647 | } |
| 648 | |
| 649 | ALIAS (no_bgp_confederation_identifier, |
| 650 | no_bgp_confederation_identifier_arg_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 651 | "no bgp confederation identifier " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 652 | NO_STR |
| 653 | "BGP specific commands\n" |
| 654 | "AS confederation parameters\n" |
| 655 | "AS number\n" |
| 656 | "Set routing domain confederation AS\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 657 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 658 | DEFUN (bgp_confederation_peers, |
| 659 | bgp_confederation_peers_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 660 | "bgp confederation peers ." CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 661 | "BGP specific commands\n" |
| 662 | "AS confederation parameters\n" |
| 663 | "Peer ASs in BGP confederation\n" |
| 664 | AS_STR) |
| 665 | { |
| 666 | struct bgp *bgp; |
| 667 | as_t as; |
| 668 | int i; |
| 669 | |
| 670 | bgp = vty->index; |
| 671 | |
| 672 | for (i = 0; i < argc; i++) |
| 673 | { |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 674 | VTY_GET_INTEGER_RANGE ("AS", as, argv[i], 1, BGP_AS4_MAX); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 675 | |
| 676 | if (bgp->as == as) |
| 677 | { |
| 678 | vty_out (vty, "%% Local member-AS not allowed in confed peer list%s", |
| 679 | VTY_NEWLINE); |
| 680 | continue; |
| 681 | } |
| 682 | |
| 683 | bgp_confederation_peers_add (bgp, as); |
| 684 | } |
| 685 | return CMD_SUCCESS; |
| 686 | } |
| 687 | |
| 688 | DEFUN (no_bgp_confederation_peers, |
| 689 | no_bgp_confederation_peers_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 690 | "no bgp confederation peers ." CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 691 | NO_STR |
| 692 | "BGP specific commands\n" |
| 693 | "AS confederation parameters\n" |
| 694 | "Peer ASs in BGP confederation\n" |
| 695 | AS_STR) |
| 696 | { |
| 697 | struct bgp *bgp; |
| 698 | as_t as; |
| 699 | int i; |
| 700 | |
| 701 | bgp = vty->index; |
| 702 | |
| 703 | for (i = 0; i < argc; i++) |
| 704 | { |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 705 | VTY_GET_INTEGER_RANGE ("AS", as, argv[i], 1, BGP_AS4_MAX); |
| 706 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 707 | bgp_confederation_peers_remove (bgp, as); |
| 708 | } |
| 709 | return CMD_SUCCESS; |
| 710 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 711 | |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 712 | /* Maximum-paths configuration */ |
| 713 | DEFUN (bgp_maxpaths, |
| 714 | bgp_maxpaths_cmd, |
Donald Sharp | ecc1a13 | 2015-12-09 08:24:47 -0500 | [diff] [blame] | 715 | "maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM), |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 716 | "Forward packets over multiple paths\n" |
| 717 | "Number of paths\n") |
| 718 | { |
| 719 | struct bgp *bgp; |
| 720 | u_int16_t maxpaths; |
| 721 | int ret; |
| 722 | |
| 723 | bgp = vty->index; |
| 724 | |
| 725 | VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths, argv[0], 1, 255); |
| 726 | |
| 727 | ret = bgp_maximum_paths_set (bgp, bgp_node_afi (vty), bgp_node_safi(vty), |
| 728 | BGP_PEER_EBGP, maxpaths); |
| 729 | if (ret < 0) |
| 730 | { |
| 731 | vty_out (vty, |
| 732 | "%% Failed to set maximum-paths %u for afi %u, safi %u%s", |
| 733 | maxpaths, bgp_node_afi (vty), bgp_node_safi(vty), VTY_NEWLINE); |
| 734 | return CMD_WARNING; |
| 735 | } |
| 736 | |
| 737 | return CMD_SUCCESS; |
| 738 | } |
| 739 | |
| 740 | DEFUN (bgp_maxpaths_ibgp, |
| 741 | bgp_maxpaths_ibgp_cmd, |
Donald Sharp | ecc1a13 | 2015-12-09 08:24:47 -0500 | [diff] [blame] | 742 | "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM), |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 743 | "Forward packets over multiple paths\n" |
| 744 | "iBGP-multipath\n" |
| 745 | "Number of paths\n") |
| 746 | { |
| 747 | struct bgp *bgp; |
| 748 | u_int16_t maxpaths; |
| 749 | int ret; |
| 750 | |
| 751 | bgp = vty->index; |
| 752 | |
| 753 | VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths, argv[0], 1, 255); |
| 754 | |
| 755 | ret = bgp_maximum_paths_set (bgp, bgp_node_afi (vty), bgp_node_safi(vty), |
| 756 | BGP_PEER_IBGP, maxpaths); |
| 757 | if (ret < 0) |
| 758 | { |
| 759 | vty_out (vty, |
| 760 | "%% Failed to set maximum-paths ibgp %u for afi %u, safi %u%s", |
| 761 | maxpaths, bgp_node_afi (vty), bgp_node_safi(vty), VTY_NEWLINE); |
| 762 | return CMD_WARNING; |
| 763 | } |
| 764 | |
| 765 | return CMD_SUCCESS; |
| 766 | } |
| 767 | |
| 768 | DEFUN (no_bgp_maxpaths, |
| 769 | no_bgp_maxpaths_cmd, |
| 770 | "no maximum-paths", |
| 771 | NO_STR |
| 772 | "Forward packets over multiple paths\n" |
| 773 | "Number of paths\n") |
| 774 | { |
| 775 | struct bgp *bgp; |
| 776 | int ret; |
| 777 | |
| 778 | bgp = vty->index; |
| 779 | |
| 780 | ret = bgp_maximum_paths_unset (bgp, bgp_node_afi (vty), bgp_node_safi(vty), |
| 781 | BGP_PEER_EBGP); |
| 782 | if (ret < 0) |
| 783 | { |
| 784 | vty_out (vty, |
| 785 | "%% Failed to unset maximum-paths for afi %u, safi %u%s", |
| 786 | bgp_node_afi (vty), bgp_node_safi(vty), VTY_NEWLINE); |
| 787 | return CMD_WARNING; |
| 788 | } |
| 789 | |
| 790 | return CMD_SUCCESS; |
| 791 | } |
| 792 | |
| 793 | ALIAS (no_bgp_maxpaths, |
| 794 | no_bgp_maxpaths_arg_cmd, |
Donald Sharp | ecc1a13 | 2015-12-09 08:24:47 -0500 | [diff] [blame] | 795 | "no maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM), |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 796 | NO_STR |
| 797 | "Forward packets over multiple paths\n" |
| 798 | "Number of paths\n") |
| 799 | |
| 800 | DEFUN (no_bgp_maxpaths_ibgp, |
| 801 | no_bgp_maxpaths_ibgp_cmd, |
| 802 | "no maximum-paths ibgp", |
| 803 | NO_STR |
| 804 | "Forward packets over multiple paths\n" |
| 805 | "iBGP-multipath\n" |
| 806 | "Number of paths\n") |
| 807 | { |
| 808 | struct bgp *bgp; |
| 809 | int ret; |
| 810 | |
| 811 | bgp = vty->index; |
| 812 | |
| 813 | ret = bgp_maximum_paths_unset (bgp, bgp_node_afi (vty), bgp_node_safi(vty), |
| 814 | BGP_PEER_IBGP); |
| 815 | if (ret < 0) |
| 816 | { |
| 817 | vty_out (vty, |
| 818 | "%% Failed to unset maximum-paths ibgp for afi %u, safi %u%s", |
| 819 | bgp_node_afi (vty), bgp_node_safi(vty), VTY_NEWLINE); |
| 820 | return CMD_WARNING; |
| 821 | } |
| 822 | |
| 823 | return CMD_SUCCESS; |
| 824 | } |
| 825 | |
| 826 | ALIAS (no_bgp_maxpaths_ibgp, |
| 827 | no_bgp_maxpaths_ibgp_arg_cmd, |
Donald Sharp | ecc1a13 | 2015-12-09 08:24:47 -0500 | [diff] [blame] | 828 | "no maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM), |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 829 | NO_STR |
| 830 | "Forward packets over multiple paths\n" |
| 831 | "iBGP-multipath\n" |
| 832 | "Number of paths\n") |
| 833 | |
| 834 | int |
| 835 | bgp_config_write_maxpaths (struct vty *vty, struct bgp *bgp, afi_t afi, |
| 836 | safi_t safi, int *write) |
| 837 | { |
| 838 | if (bgp->maxpaths[afi][safi].maxpaths_ebgp != BGP_DEFAULT_MAXPATHS) |
| 839 | { |
| 840 | bgp_config_write_family_header (vty, afi, safi, write); |
| 841 | vty_out (vty, " maximum-paths %d%s", |
| 842 | bgp->maxpaths[afi][safi].maxpaths_ebgp, VTY_NEWLINE); |
| 843 | } |
| 844 | |
| 845 | if (bgp->maxpaths[afi][safi].maxpaths_ibgp != BGP_DEFAULT_MAXPATHS) |
| 846 | { |
| 847 | bgp_config_write_family_header (vty, afi, safi, write); |
| 848 | vty_out (vty, " maximum-paths ibgp %d%s", |
| 849 | bgp->maxpaths[afi][safi].maxpaths_ibgp, VTY_NEWLINE); |
| 850 | } |
| 851 | |
| 852 | return 0; |
| 853 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 854 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 855 | /* BGP timers. */ |
| 856 | |
| 857 | DEFUN (bgp_timers, |
| 858 | bgp_timers_cmd, |
| 859 | "timers bgp <0-65535> <0-65535>", |
| 860 | "Adjust routing timers\n" |
| 861 | "BGP timers\n" |
| 862 | "Keepalive interval\n" |
| 863 | "Holdtime\n") |
| 864 | { |
| 865 | struct bgp *bgp; |
| 866 | unsigned long keepalive = 0; |
| 867 | unsigned long holdtime = 0; |
| 868 | |
| 869 | bgp = vty->index; |
| 870 | |
| 871 | VTY_GET_INTEGER ("keepalive", keepalive, argv[0]); |
| 872 | VTY_GET_INTEGER ("holdtime", holdtime, argv[1]); |
| 873 | |
| 874 | /* Holdtime value check. */ |
| 875 | if (holdtime < 3 && holdtime != 0) |
| 876 | { |
| 877 | vty_out (vty, "%% hold time value must be either 0 or greater than 3%s", |
| 878 | VTY_NEWLINE); |
| 879 | return CMD_WARNING; |
| 880 | } |
| 881 | |
| 882 | bgp_timers_set (bgp, keepalive, holdtime); |
| 883 | |
| 884 | return CMD_SUCCESS; |
| 885 | } |
| 886 | |
| 887 | DEFUN (no_bgp_timers, |
| 888 | no_bgp_timers_cmd, |
| 889 | "no timers bgp", |
| 890 | NO_STR |
| 891 | "Adjust routing timers\n" |
| 892 | "BGP timers\n") |
| 893 | { |
| 894 | struct bgp *bgp; |
| 895 | |
| 896 | bgp = vty->index; |
| 897 | bgp_timers_unset (bgp); |
| 898 | |
| 899 | return CMD_SUCCESS; |
| 900 | } |
| 901 | |
| 902 | ALIAS (no_bgp_timers, |
| 903 | no_bgp_timers_arg_cmd, |
| 904 | "no timers bgp <0-65535> <0-65535>", |
| 905 | NO_STR |
| 906 | "Adjust routing timers\n" |
| 907 | "BGP timers\n" |
| 908 | "Keepalive interval\n" |
| 909 | "Holdtime\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 910 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 911 | DEFUN (bgp_client_to_client_reflection, |
| 912 | bgp_client_to_client_reflection_cmd, |
| 913 | "bgp client-to-client reflection", |
| 914 | "BGP specific commands\n" |
| 915 | "Configure client to client route reflection\n" |
| 916 | "reflection of routes allowed\n") |
| 917 | { |
| 918 | struct bgp *bgp; |
| 919 | |
| 920 | bgp = vty->index; |
| 921 | bgp_flag_unset (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT); |
| 922 | return CMD_SUCCESS; |
| 923 | } |
| 924 | |
| 925 | DEFUN (no_bgp_client_to_client_reflection, |
| 926 | no_bgp_client_to_client_reflection_cmd, |
| 927 | "no bgp client-to-client reflection", |
| 928 | NO_STR |
| 929 | "BGP specific commands\n" |
| 930 | "Configure client to client route reflection\n" |
| 931 | "reflection of routes allowed\n") |
| 932 | { |
| 933 | struct bgp *bgp; |
| 934 | |
| 935 | bgp = vty->index; |
| 936 | bgp_flag_set (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT); |
| 937 | return CMD_SUCCESS; |
| 938 | } |
| 939 | |
| 940 | /* "bgp always-compare-med" configuration. */ |
| 941 | DEFUN (bgp_always_compare_med, |
| 942 | bgp_always_compare_med_cmd, |
| 943 | "bgp always-compare-med", |
| 944 | "BGP specific commands\n" |
| 945 | "Allow comparing MED from different neighbors\n") |
| 946 | { |
| 947 | struct bgp *bgp; |
| 948 | |
| 949 | bgp = vty->index; |
| 950 | bgp_flag_set (bgp, BGP_FLAG_ALWAYS_COMPARE_MED); |
| 951 | return CMD_SUCCESS; |
| 952 | } |
| 953 | |
| 954 | DEFUN (no_bgp_always_compare_med, |
| 955 | no_bgp_always_compare_med_cmd, |
| 956 | "no bgp always-compare-med", |
| 957 | NO_STR |
| 958 | "BGP specific commands\n" |
| 959 | "Allow comparing MED from different neighbors\n") |
| 960 | { |
| 961 | struct bgp *bgp; |
| 962 | |
| 963 | bgp = vty->index; |
| 964 | bgp_flag_unset (bgp, BGP_FLAG_ALWAYS_COMPARE_MED); |
| 965 | return CMD_SUCCESS; |
| 966 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 967 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 968 | /* "bgp deterministic-med" configuration. */ |
| 969 | DEFUN (bgp_deterministic_med, |
| 970 | bgp_deterministic_med_cmd, |
| 971 | "bgp deterministic-med", |
| 972 | "BGP specific commands\n" |
| 973 | "Pick the best-MED path among paths advertised from the neighboring AS\n") |
| 974 | { |
| 975 | struct bgp *bgp; |
| 976 | |
| 977 | bgp = vty->index; |
| 978 | bgp_flag_set (bgp, BGP_FLAG_DETERMINISTIC_MED); |
| 979 | return CMD_SUCCESS; |
| 980 | } |
| 981 | |
| 982 | DEFUN (no_bgp_deterministic_med, |
| 983 | no_bgp_deterministic_med_cmd, |
| 984 | "no bgp deterministic-med", |
| 985 | NO_STR |
| 986 | "BGP specific commands\n" |
| 987 | "Pick the best-MED path among paths advertised from the neighboring AS\n") |
| 988 | { |
| 989 | struct bgp *bgp; |
| 990 | |
| 991 | bgp = vty->index; |
| 992 | bgp_flag_unset (bgp, BGP_FLAG_DETERMINISTIC_MED); |
| 993 | return CMD_SUCCESS; |
| 994 | } |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 995 | |
| 996 | /* "bgp graceful-restart" configuration. */ |
| 997 | DEFUN (bgp_graceful_restart, |
| 998 | bgp_graceful_restart_cmd, |
| 999 | "bgp graceful-restart", |
| 1000 | "BGP specific commands\n" |
| 1001 | "Graceful restart capability parameters\n") |
| 1002 | { |
| 1003 | struct bgp *bgp; |
| 1004 | |
| 1005 | bgp = vty->index; |
| 1006 | bgp_flag_set (bgp, BGP_FLAG_GRACEFUL_RESTART); |
| 1007 | return CMD_SUCCESS; |
| 1008 | } |
| 1009 | |
| 1010 | DEFUN (no_bgp_graceful_restart, |
| 1011 | no_bgp_graceful_restart_cmd, |
| 1012 | "no bgp graceful-restart", |
| 1013 | NO_STR |
| 1014 | "BGP specific commands\n" |
| 1015 | "Graceful restart capability parameters\n") |
| 1016 | { |
| 1017 | struct bgp *bgp; |
| 1018 | |
| 1019 | bgp = vty->index; |
| 1020 | bgp_flag_unset (bgp, BGP_FLAG_GRACEFUL_RESTART); |
| 1021 | return CMD_SUCCESS; |
| 1022 | } |
| 1023 | |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 1024 | DEFUN (bgp_graceful_restart_stalepath_time, |
| 1025 | bgp_graceful_restart_stalepath_time_cmd, |
| 1026 | "bgp graceful-restart stalepath-time <1-3600>", |
| 1027 | "BGP specific commands\n" |
| 1028 | "Graceful restart capability parameters\n" |
| 1029 | "Set the max time to hold onto restarting peer's stale paths\n" |
| 1030 | "Delay value (seconds)\n") |
| 1031 | { |
| 1032 | struct bgp *bgp; |
| 1033 | u_int32_t stalepath; |
| 1034 | |
| 1035 | bgp = vty->index; |
| 1036 | if (! bgp) |
| 1037 | return CMD_WARNING; |
| 1038 | |
| 1039 | VTY_GET_INTEGER_RANGE ("stalepath-time", stalepath, argv[0], 1, 3600); |
| 1040 | bgp->stalepath_time = stalepath; |
| 1041 | return CMD_SUCCESS; |
| 1042 | } |
| 1043 | |
Philippe Guibert | 4afa3dd | 2016-05-24 16:52:02 +0200 | [diff] [blame] | 1044 | DEFUN (bgp_graceful_restart_restart_time, |
| 1045 | bgp_graceful_restart_restart_time_cmd, |
| 1046 | "bgp graceful-restart restart-time <1-3600>", |
| 1047 | "BGP specific commands\n" |
| 1048 | "Graceful restart capability parameters\n" |
| 1049 | "Set the time to wait to delete stale routes before a BGP open message is received\n" |
| 1050 | "Delay value (seconds)\n") |
| 1051 | { |
| 1052 | struct bgp *bgp; |
| 1053 | u_int32_t restart; |
| 1054 | |
| 1055 | bgp = vty->index; |
| 1056 | if (! bgp) |
| 1057 | return CMD_WARNING; |
| 1058 | |
| 1059 | VTY_GET_INTEGER_RANGE ("restart-time", restart, argv[0], 1, 3600); |
| 1060 | bgp->restart_time = restart; |
| 1061 | return CMD_SUCCESS; |
| 1062 | } |
| 1063 | |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 1064 | DEFUN (no_bgp_graceful_restart_stalepath_time, |
| 1065 | no_bgp_graceful_restart_stalepath_time_cmd, |
| 1066 | "no bgp graceful-restart stalepath-time", |
| 1067 | NO_STR |
| 1068 | "BGP specific commands\n" |
| 1069 | "Graceful restart capability parameters\n" |
| 1070 | "Set the max time to hold onto restarting peer's stale paths\n") |
| 1071 | { |
| 1072 | struct bgp *bgp; |
| 1073 | |
| 1074 | bgp = vty->index; |
| 1075 | if (! bgp) |
| 1076 | return CMD_WARNING; |
| 1077 | |
| 1078 | bgp->stalepath_time = BGP_DEFAULT_STALEPATH_TIME; |
| 1079 | return CMD_SUCCESS; |
| 1080 | } |
| 1081 | |
Philippe Guibert | 4afa3dd | 2016-05-24 16:52:02 +0200 | [diff] [blame] | 1082 | DEFUN (no_bgp_graceful_restart_restart_time, |
| 1083 | no_bgp_graceful_restart_restart_time_cmd, |
| 1084 | "no bgp graceful-restart restart-time", |
| 1085 | NO_STR |
| 1086 | "BGP specific commands\n" |
| 1087 | "Graceful restart capability parameters\n" |
| 1088 | "Set the time to wait to delete stale routes before a BGP open message is received\n") |
| 1089 | { |
| 1090 | struct bgp *bgp; |
| 1091 | |
| 1092 | bgp = vty->index; |
| 1093 | if (! bgp) |
| 1094 | return CMD_WARNING; |
| 1095 | |
| 1096 | bgp->restart_time = BGP_DEFAULT_RESTART_TIME; |
| 1097 | return CMD_SUCCESS; |
| 1098 | } |
| 1099 | |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 1100 | ALIAS (no_bgp_graceful_restart_stalepath_time, |
| 1101 | no_bgp_graceful_restart_stalepath_time_val_cmd, |
| 1102 | "no bgp graceful-restart stalepath-time <1-3600>", |
| 1103 | NO_STR |
| 1104 | "BGP specific commands\n" |
| 1105 | "Graceful restart capability parameters\n" |
| 1106 | "Set the max time to hold onto restarting peer's stale paths\n" |
| 1107 | "Delay value (seconds)\n") |
| 1108 | |
Philippe Guibert | 4afa3dd | 2016-05-24 16:52:02 +0200 | [diff] [blame] | 1109 | ALIAS (no_bgp_graceful_restart_restart_time, |
| 1110 | no_bgp_graceful_restart_restart_time_val_cmd, |
| 1111 | "no bgp graceful-restart restart-time <1-3600>", |
| 1112 | NO_STR |
| 1113 | "BGP specific commands\n" |
| 1114 | "Graceful restart capability parameters\n" |
| 1115 | "Set the time to wait to delete stale routes before a BGP open message is received\n" |
| 1116 | "Delay value (seconds)\n") |
| 1117 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1118 | /* "bgp fast-external-failover" configuration. */ |
| 1119 | DEFUN (bgp_fast_external_failover, |
| 1120 | bgp_fast_external_failover_cmd, |
| 1121 | "bgp fast-external-failover", |
| 1122 | BGP_STR |
| 1123 | "Immediately reset session if a link to a directly connected external peer goes down\n") |
| 1124 | { |
| 1125 | struct bgp *bgp; |
| 1126 | |
| 1127 | bgp = vty->index; |
| 1128 | bgp_flag_unset (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER); |
| 1129 | return CMD_SUCCESS; |
| 1130 | } |
| 1131 | |
| 1132 | DEFUN (no_bgp_fast_external_failover, |
| 1133 | no_bgp_fast_external_failover_cmd, |
| 1134 | "no bgp fast-external-failover", |
| 1135 | NO_STR |
| 1136 | BGP_STR |
| 1137 | "Immediately reset session if a link to a directly connected external peer goes down\n") |
| 1138 | { |
| 1139 | struct bgp *bgp; |
| 1140 | |
| 1141 | bgp = vty->index; |
| 1142 | bgp_flag_set (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER); |
| 1143 | return CMD_SUCCESS; |
| 1144 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1145 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1146 | /* "bgp enforce-first-as" configuration. */ |
| 1147 | DEFUN (bgp_enforce_first_as, |
| 1148 | bgp_enforce_first_as_cmd, |
| 1149 | "bgp enforce-first-as", |
| 1150 | BGP_STR |
| 1151 | "Enforce the first AS for EBGP routes\n") |
| 1152 | { |
| 1153 | struct bgp *bgp; |
| 1154 | |
| 1155 | bgp = vty->index; |
| 1156 | bgp_flag_set (bgp, BGP_FLAG_ENFORCE_FIRST_AS); |
| 1157 | return CMD_SUCCESS; |
| 1158 | } |
| 1159 | |
| 1160 | DEFUN (no_bgp_enforce_first_as, |
| 1161 | no_bgp_enforce_first_as_cmd, |
| 1162 | "no bgp enforce-first-as", |
| 1163 | NO_STR |
| 1164 | BGP_STR |
| 1165 | "Enforce the first AS for EBGP routes\n") |
| 1166 | { |
| 1167 | struct bgp *bgp; |
| 1168 | |
| 1169 | bgp = vty->index; |
| 1170 | bgp_flag_unset (bgp, BGP_FLAG_ENFORCE_FIRST_AS); |
| 1171 | return CMD_SUCCESS; |
| 1172 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1173 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1174 | /* "bgp bestpath compare-routerid" configuration. */ |
| 1175 | DEFUN (bgp_bestpath_compare_router_id, |
| 1176 | bgp_bestpath_compare_router_id_cmd, |
| 1177 | "bgp bestpath compare-routerid", |
| 1178 | "BGP specific commands\n" |
| 1179 | "Change the default bestpath selection\n" |
| 1180 | "Compare router-id for identical EBGP paths\n") |
| 1181 | { |
| 1182 | struct bgp *bgp; |
| 1183 | |
| 1184 | bgp = vty->index; |
| 1185 | bgp_flag_set (bgp, BGP_FLAG_COMPARE_ROUTER_ID); |
| 1186 | return CMD_SUCCESS; |
| 1187 | } |
| 1188 | |
| 1189 | DEFUN (no_bgp_bestpath_compare_router_id, |
| 1190 | no_bgp_bestpath_compare_router_id_cmd, |
| 1191 | "no bgp bestpath compare-routerid", |
| 1192 | NO_STR |
| 1193 | "BGP specific commands\n" |
| 1194 | "Change the default bestpath selection\n" |
| 1195 | "Compare router-id for identical EBGP paths\n") |
| 1196 | { |
| 1197 | struct bgp *bgp; |
| 1198 | |
| 1199 | bgp = vty->index; |
| 1200 | bgp_flag_unset (bgp, BGP_FLAG_COMPARE_ROUTER_ID); |
| 1201 | return CMD_SUCCESS; |
| 1202 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1203 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1204 | /* "bgp bestpath as-path ignore" configuration. */ |
| 1205 | DEFUN (bgp_bestpath_aspath_ignore, |
| 1206 | bgp_bestpath_aspath_ignore_cmd, |
| 1207 | "bgp bestpath as-path ignore", |
| 1208 | "BGP specific commands\n" |
| 1209 | "Change the default bestpath selection\n" |
| 1210 | "AS-path attribute\n" |
| 1211 | "Ignore as-path length in selecting a route\n") |
| 1212 | { |
| 1213 | struct bgp *bgp; |
| 1214 | |
| 1215 | bgp = vty->index; |
| 1216 | bgp_flag_set (bgp, BGP_FLAG_ASPATH_IGNORE); |
| 1217 | return CMD_SUCCESS; |
| 1218 | } |
| 1219 | |
| 1220 | DEFUN (no_bgp_bestpath_aspath_ignore, |
| 1221 | no_bgp_bestpath_aspath_ignore_cmd, |
| 1222 | "no bgp bestpath as-path ignore", |
| 1223 | NO_STR |
| 1224 | "BGP specific commands\n" |
| 1225 | "Change the default bestpath selection\n" |
| 1226 | "AS-path attribute\n" |
| 1227 | "Ignore as-path length in selecting a route\n") |
| 1228 | { |
| 1229 | struct bgp *bgp; |
| 1230 | |
| 1231 | bgp = vty->index; |
| 1232 | bgp_flag_unset (bgp, BGP_FLAG_ASPATH_IGNORE); |
| 1233 | return CMD_SUCCESS; |
| 1234 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1235 | |
hasso | 6811845 | 2005-04-08 15:40:36 +0000 | [diff] [blame] | 1236 | /* "bgp bestpath as-path confed" configuration. */ |
| 1237 | DEFUN (bgp_bestpath_aspath_confed, |
| 1238 | bgp_bestpath_aspath_confed_cmd, |
| 1239 | "bgp bestpath as-path confed", |
| 1240 | "BGP specific commands\n" |
| 1241 | "Change the default bestpath selection\n" |
| 1242 | "AS-path attribute\n" |
| 1243 | "Compare path lengths including confederation sets & sequences in selecting a route\n") |
| 1244 | { |
| 1245 | struct bgp *bgp; |
| 1246 | |
| 1247 | bgp = vty->index; |
| 1248 | bgp_flag_set (bgp, BGP_FLAG_ASPATH_CONFED); |
| 1249 | return CMD_SUCCESS; |
| 1250 | } |
| 1251 | |
| 1252 | DEFUN (no_bgp_bestpath_aspath_confed, |
| 1253 | no_bgp_bestpath_aspath_confed_cmd, |
| 1254 | "no bgp bestpath as-path confed", |
| 1255 | NO_STR |
| 1256 | "BGP specific commands\n" |
| 1257 | "Change the default bestpath selection\n" |
| 1258 | "AS-path attribute\n" |
| 1259 | "Compare path lengths including confederation sets & sequences in selecting a route\n") |
| 1260 | { |
| 1261 | struct bgp *bgp; |
| 1262 | |
| 1263 | bgp = vty->index; |
| 1264 | bgp_flag_unset (bgp, BGP_FLAG_ASPATH_CONFED); |
| 1265 | return CMD_SUCCESS; |
| 1266 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1267 | |
Pradosh Mohapatra | 2fdd455 | 2013-09-07 07:02:36 +0000 | [diff] [blame] | 1268 | /* "bgp bestpath as-path multipath-relax" configuration. */ |
| 1269 | DEFUN (bgp_bestpath_aspath_multipath_relax, |
| 1270 | bgp_bestpath_aspath_multipath_relax_cmd, |
| 1271 | "bgp bestpath as-path multipath-relax", |
| 1272 | "BGP specific commands\n" |
| 1273 | "Change the default bestpath selection\n" |
| 1274 | "AS-path attribute\n" |
| 1275 | "Allow load sharing across routes that have different AS paths (but same length)\n") |
| 1276 | { |
| 1277 | struct bgp *bgp; |
| 1278 | |
| 1279 | bgp = vty->index; |
| 1280 | bgp_flag_set (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX); |
| 1281 | return CMD_SUCCESS; |
| 1282 | } |
| 1283 | |
| 1284 | DEFUN (no_bgp_bestpath_aspath_multipath_relax, |
| 1285 | no_bgp_bestpath_aspath_multipath_relax_cmd, |
| 1286 | "no bgp bestpath as-path multipath-relax", |
| 1287 | NO_STR |
| 1288 | "BGP specific commands\n" |
| 1289 | "Change the default bestpath selection\n" |
| 1290 | "AS-path attribute\n" |
| 1291 | "Allow load sharing across routes that have different AS paths (but same length)\n") |
| 1292 | { |
| 1293 | struct bgp *bgp; |
| 1294 | |
| 1295 | bgp = vty->index; |
| 1296 | bgp_flag_unset (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX); |
| 1297 | return CMD_SUCCESS; |
| 1298 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1299 | |
paul | 848973c | 2003-08-13 00:32:49 +0000 | [diff] [blame] | 1300 | /* "bgp log-neighbor-changes" configuration. */ |
| 1301 | DEFUN (bgp_log_neighbor_changes, |
| 1302 | bgp_log_neighbor_changes_cmd, |
| 1303 | "bgp log-neighbor-changes", |
| 1304 | "BGP specific commands\n" |
| 1305 | "Log neighbor up/down and reset reason\n") |
| 1306 | { |
| 1307 | struct bgp *bgp; |
| 1308 | |
| 1309 | bgp = vty->index; |
| 1310 | bgp_flag_set (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES); |
| 1311 | return CMD_SUCCESS; |
| 1312 | } |
| 1313 | |
| 1314 | DEFUN (no_bgp_log_neighbor_changes, |
| 1315 | no_bgp_log_neighbor_changes_cmd, |
| 1316 | "no bgp log-neighbor-changes", |
| 1317 | NO_STR |
| 1318 | "BGP specific commands\n" |
| 1319 | "Log neighbor up/down and reset reason\n") |
| 1320 | { |
| 1321 | struct bgp *bgp; |
| 1322 | |
| 1323 | bgp = vty->index; |
| 1324 | bgp_flag_unset (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES); |
| 1325 | return CMD_SUCCESS; |
| 1326 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1327 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1328 | /* "bgp bestpath med" configuration. */ |
| 1329 | DEFUN (bgp_bestpath_med, |
| 1330 | bgp_bestpath_med_cmd, |
| 1331 | "bgp bestpath med (confed|missing-as-worst)", |
| 1332 | "BGP specific commands\n" |
| 1333 | "Change the default bestpath selection\n" |
| 1334 | "MED attribute\n" |
| 1335 | "Compare MED among confederation paths\n" |
| 1336 | "Treat missing MED as the least preferred one\n") |
| 1337 | { |
| 1338 | struct bgp *bgp; |
| 1339 | |
| 1340 | bgp = vty->index; |
| 1341 | |
| 1342 | if (strncmp (argv[0], "confed", 1) == 0) |
| 1343 | bgp_flag_set (bgp, BGP_FLAG_MED_CONFED); |
| 1344 | else |
| 1345 | bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST); |
| 1346 | |
| 1347 | return CMD_SUCCESS; |
| 1348 | } |
| 1349 | |
| 1350 | DEFUN (bgp_bestpath_med2, |
| 1351 | bgp_bestpath_med2_cmd, |
| 1352 | "bgp bestpath med confed missing-as-worst", |
| 1353 | "BGP specific commands\n" |
| 1354 | "Change the default bestpath selection\n" |
| 1355 | "MED attribute\n" |
| 1356 | "Compare MED among confederation paths\n" |
| 1357 | "Treat missing MED as the least preferred one\n") |
| 1358 | { |
| 1359 | struct bgp *bgp; |
| 1360 | |
| 1361 | bgp = vty->index; |
| 1362 | bgp_flag_set (bgp, BGP_FLAG_MED_CONFED); |
| 1363 | bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST); |
| 1364 | return CMD_SUCCESS; |
| 1365 | } |
| 1366 | |
| 1367 | ALIAS (bgp_bestpath_med2, |
| 1368 | bgp_bestpath_med3_cmd, |
| 1369 | "bgp bestpath med missing-as-worst confed", |
| 1370 | "BGP specific commands\n" |
| 1371 | "Change the default bestpath selection\n" |
| 1372 | "MED attribute\n" |
| 1373 | "Treat missing MED as the least preferred one\n" |
| 1374 | "Compare MED among confederation paths\n") |
| 1375 | |
| 1376 | DEFUN (no_bgp_bestpath_med, |
| 1377 | no_bgp_bestpath_med_cmd, |
| 1378 | "no bgp bestpath med (confed|missing-as-worst)", |
| 1379 | NO_STR |
| 1380 | "BGP specific commands\n" |
| 1381 | "Change the default bestpath selection\n" |
| 1382 | "MED attribute\n" |
| 1383 | "Compare MED among confederation paths\n" |
| 1384 | "Treat missing MED as the least preferred one\n") |
| 1385 | { |
| 1386 | struct bgp *bgp; |
| 1387 | |
| 1388 | bgp = vty->index; |
| 1389 | |
| 1390 | if (strncmp (argv[0], "confed", 1) == 0) |
| 1391 | bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED); |
| 1392 | else |
| 1393 | bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST); |
| 1394 | |
| 1395 | return CMD_SUCCESS; |
| 1396 | } |
| 1397 | |
| 1398 | DEFUN (no_bgp_bestpath_med2, |
| 1399 | no_bgp_bestpath_med2_cmd, |
| 1400 | "no bgp bestpath med confed missing-as-worst", |
| 1401 | NO_STR |
| 1402 | "BGP specific commands\n" |
| 1403 | "Change the default bestpath selection\n" |
| 1404 | "MED attribute\n" |
| 1405 | "Compare MED among confederation paths\n" |
| 1406 | "Treat missing MED as the least preferred one\n") |
| 1407 | { |
| 1408 | struct bgp *bgp; |
| 1409 | |
| 1410 | bgp = vty->index; |
| 1411 | bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED); |
| 1412 | bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST); |
| 1413 | return CMD_SUCCESS; |
| 1414 | } |
| 1415 | |
| 1416 | ALIAS (no_bgp_bestpath_med2, |
| 1417 | no_bgp_bestpath_med3_cmd, |
| 1418 | "no bgp bestpath med missing-as-worst confed", |
| 1419 | NO_STR |
| 1420 | "BGP specific commands\n" |
| 1421 | "Change the default bestpath selection\n" |
| 1422 | "MED attribute\n" |
| 1423 | "Treat missing MED as the least preferred one\n" |
| 1424 | "Compare MED among confederation paths\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1425 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1426 | /* "no bgp default ipv4-unicast". */ |
| 1427 | DEFUN (no_bgp_default_ipv4_unicast, |
| 1428 | no_bgp_default_ipv4_unicast_cmd, |
| 1429 | "no bgp default ipv4-unicast", |
| 1430 | NO_STR |
| 1431 | "BGP specific commands\n" |
| 1432 | "Configure BGP defaults\n" |
| 1433 | "Activate ipv4-unicast for a peer by default\n") |
| 1434 | { |
| 1435 | struct bgp *bgp; |
| 1436 | |
| 1437 | bgp = vty->index; |
| 1438 | bgp_flag_set (bgp, BGP_FLAG_NO_DEFAULT_IPV4); |
| 1439 | return CMD_SUCCESS; |
| 1440 | } |
| 1441 | |
| 1442 | DEFUN (bgp_default_ipv4_unicast, |
| 1443 | bgp_default_ipv4_unicast_cmd, |
| 1444 | "bgp default ipv4-unicast", |
| 1445 | "BGP specific commands\n" |
| 1446 | "Configure BGP defaults\n" |
| 1447 | "Activate ipv4-unicast for a peer by default\n") |
| 1448 | { |
| 1449 | struct bgp *bgp; |
| 1450 | |
| 1451 | bgp = vty->index; |
| 1452 | bgp_flag_unset (bgp, BGP_FLAG_NO_DEFAULT_IPV4); |
| 1453 | return CMD_SUCCESS; |
| 1454 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1455 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1456 | /* "bgp import-check" configuration. */ |
| 1457 | DEFUN (bgp_network_import_check, |
| 1458 | bgp_network_import_check_cmd, |
| 1459 | "bgp network import-check", |
| 1460 | "BGP specific commands\n" |
| 1461 | "BGP network command\n" |
| 1462 | "Check BGP network route exists in IGP\n") |
| 1463 | { |
| 1464 | struct bgp *bgp; |
| 1465 | |
| 1466 | bgp = vty->index; |
| 1467 | bgp_flag_set (bgp, BGP_FLAG_IMPORT_CHECK); |
| 1468 | return CMD_SUCCESS; |
| 1469 | } |
| 1470 | |
| 1471 | DEFUN (no_bgp_network_import_check, |
| 1472 | no_bgp_network_import_check_cmd, |
| 1473 | "no bgp network import-check", |
| 1474 | NO_STR |
| 1475 | "BGP specific commands\n" |
| 1476 | "BGP network command\n" |
| 1477 | "Check BGP network route exists in IGP\n") |
| 1478 | { |
| 1479 | struct bgp *bgp; |
| 1480 | |
| 1481 | bgp = vty->index; |
| 1482 | bgp_flag_unset (bgp, BGP_FLAG_IMPORT_CHECK); |
| 1483 | return CMD_SUCCESS; |
| 1484 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1485 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1486 | DEFUN (bgp_default_local_preference, |
| 1487 | bgp_default_local_preference_cmd, |
| 1488 | "bgp default local-preference <0-4294967295>", |
| 1489 | "BGP specific commands\n" |
| 1490 | "Configure BGP defaults\n" |
| 1491 | "local preference (higher=more preferred)\n" |
| 1492 | "Configure default local preference value\n") |
| 1493 | { |
| 1494 | struct bgp *bgp; |
| 1495 | u_int32_t local_pref; |
| 1496 | |
| 1497 | bgp = vty->index; |
| 1498 | |
| 1499 | VTY_GET_INTEGER ("local preference", local_pref, argv[0]); |
| 1500 | |
| 1501 | bgp_default_local_preference_set (bgp, local_pref); |
| 1502 | |
| 1503 | return CMD_SUCCESS; |
| 1504 | } |
| 1505 | |
| 1506 | DEFUN (no_bgp_default_local_preference, |
| 1507 | no_bgp_default_local_preference_cmd, |
| 1508 | "no bgp default local-preference", |
| 1509 | NO_STR |
| 1510 | "BGP specific commands\n" |
| 1511 | "Configure BGP defaults\n" |
| 1512 | "local preference (higher=more preferred)\n") |
| 1513 | { |
| 1514 | struct bgp *bgp; |
| 1515 | |
| 1516 | bgp = vty->index; |
| 1517 | bgp_default_local_preference_unset (bgp); |
| 1518 | return CMD_SUCCESS; |
| 1519 | } |
| 1520 | |
| 1521 | ALIAS (no_bgp_default_local_preference, |
| 1522 | no_bgp_default_local_preference_val_cmd, |
| 1523 | "no bgp default local-preference <0-4294967295>", |
| 1524 | NO_STR |
| 1525 | "BGP specific commands\n" |
| 1526 | "Configure BGP defaults\n" |
| 1527 | "local preference (higher=more preferred)\n" |
| 1528 | "Configure default local preference value\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1529 | |
Dinesh Dutt | 083e5e2 | 2015-11-09 20:21:54 -0500 | [diff] [blame] | 1530 | static void |
| 1531 | peer_announce_routes_if_rmap_out (struct bgp *bgp) |
| 1532 | { |
| 1533 | struct peer *peer; |
| 1534 | struct listnode *node, *nnode; |
| 1535 | struct bgp_filter *filter; |
| 1536 | afi_t afi; |
| 1537 | safi_t safi; |
| 1538 | |
| 1539 | /* Reannounce all routes to appropriate neighbors */ |
| 1540 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
| 1541 | { |
| 1542 | for (afi = AFI_IP; afi < AFI_MAX; afi++) |
| 1543 | for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) |
| 1544 | { |
| 1545 | if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT)) |
| 1546 | { |
| 1547 | /* check if there's an out route-map on this client */ |
| 1548 | filter = &peer->filter[afi][safi]; |
| 1549 | if (ROUTE_MAP_OUT_NAME(filter)) |
| 1550 | { |
| 1551 | if (BGP_DEBUG(update, UPDATE_OUT)) |
| 1552 | zlog_debug("%s: Announcing routes again for peer %s" |
| 1553 | "(afi=%d, safi=%d", __func__, peer->host, afi, |
| 1554 | safi); |
| 1555 | |
| 1556 | bgp_announce_route_all(peer); |
| 1557 | } |
| 1558 | } |
| 1559 | } |
| 1560 | } |
| 1561 | } |
| 1562 | |
| 1563 | DEFUN (bgp_rr_allow_outbound_policy, |
| 1564 | bgp_rr_allow_outbound_policy_cmd, |
| 1565 | "bgp route-reflector allow-outbound-policy", |
| 1566 | "BGP specific commands\n" |
| 1567 | "Allow modifications made by out route-map\n" |
| 1568 | "on ibgp neighbors\n") |
| 1569 | { |
| 1570 | struct bgp *bgp; |
| 1571 | |
| 1572 | bgp = vty->index; |
| 1573 | |
| 1574 | if (!bgp_flag_check(bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY)) |
| 1575 | { |
| 1576 | bgp_flag_set(bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY); |
| 1577 | peer_announce_routes_if_rmap_out(bgp); |
| 1578 | } |
| 1579 | |
| 1580 | return CMD_SUCCESS; |
| 1581 | } |
| 1582 | |
| 1583 | DEFUN (no_bgp_rr_allow_outbound_policy, |
| 1584 | no_bgp_rr_allow_outbound_policy_cmd, |
| 1585 | "no bgp route-reflector allow-outbound-policy", |
| 1586 | NO_STR |
| 1587 | "BGP specific commands\n" |
| 1588 | "Allow modifications made by out route-map\n" |
| 1589 | "on ibgp neighbors\n") |
| 1590 | { |
| 1591 | struct bgp *bgp; |
| 1592 | |
| 1593 | bgp = vty->index; |
| 1594 | |
| 1595 | if (bgp_flag_check(bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY)) |
| 1596 | { |
| 1597 | bgp_flag_unset(bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY); |
| 1598 | peer_announce_routes_if_rmap_out(bgp); |
| 1599 | } |
| 1600 | |
| 1601 | return CMD_SUCCESS; |
| 1602 | } |
| 1603 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1604 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1605 | peer_remote_as_vty (struct vty *vty, const char *peer_str, |
| 1606 | const char *as_str, afi_t afi, safi_t safi) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1607 | { |
| 1608 | int ret; |
| 1609 | struct bgp *bgp; |
| 1610 | as_t as; |
| 1611 | union sockunion su; |
| 1612 | |
| 1613 | bgp = vty->index; |
| 1614 | |
| 1615 | /* Get AS number. */ |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 1616 | VTY_GET_INTEGER_RANGE ("AS", as, as_str, 1, BGP_AS4_MAX); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1617 | |
| 1618 | /* If peer is peer group, call proper function. */ |
| 1619 | ret = str2sockunion (peer_str, &su); |
| 1620 | if (ret < 0) |
| 1621 | { |
| 1622 | ret = peer_group_remote_as (bgp, peer_str, &as); |
| 1623 | if (ret < 0) |
| 1624 | { |
| 1625 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1626 | return CMD_WARNING; |
| 1627 | } |
| 1628 | return CMD_SUCCESS; |
| 1629 | } |
| 1630 | |
| 1631 | if (peer_address_self_check (&su)) |
| 1632 | { |
| 1633 | vty_out (vty, "%% Can not configure the local system as neighbor%s", |
| 1634 | VTY_NEWLINE); |
| 1635 | return CMD_WARNING; |
| 1636 | } |
| 1637 | |
| 1638 | ret = peer_remote_as (bgp, &su, &as, afi, safi); |
| 1639 | |
| 1640 | /* This peer belongs to peer group. */ |
| 1641 | switch (ret) |
| 1642 | { |
| 1643 | case BGP_ERR_PEER_GROUP_MEMBER: |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 1644 | vty_out (vty, "%% Peer-group AS %u. Cannot configure remote-as for member%s", as, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1645 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1646 | case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT: |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 1647 | vty_out (vty, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external%s", as, as_str, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1648 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1649 | } |
| 1650 | return bgp_vty_return (vty, ret); |
| 1651 | } |
| 1652 | |
| 1653 | DEFUN (neighbor_remote_as, |
| 1654 | neighbor_remote_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1655 | NEIGHBOR_CMD2 "remote-as " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1656 | NEIGHBOR_STR |
| 1657 | NEIGHBOR_ADDR_STR2 |
| 1658 | "Specify a BGP neighbor\n" |
| 1659 | AS_STR) |
| 1660 | { |
| 1661 | return peer_remote_as_vty (vty, argv[0], argv[1], AFI_IP, SAFI_UNICAST); |
| 1662 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1663 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1664 | DEFUN (neighbor_peer_group, |
| 1665 | neighbor_peer_group_cmd, |
| 1666 | "neighbor WORD peer-group", |
| 1667 | NEIGHBOR_STR |
| 1668 | "Neighbor tag\n" |
| 1669 | "Configure peer-group\n") |
| 1670 | { |
| 1671 | struct bgp *bgp; |
| 1672 | struct peer_group *group; |
| 1673 | |
| 1674 | bgp = vty->index; |
| 1675 | |
| 1676 | group = peer_group_get (bgp, argv[0]); |
| 1677 | if (! group) |
| 1678 | return CMD_WARNING; |
| 1679 | |
| 1680 | return CMD_SUCCESS; |
| 1681 | } |
| 1682 | |
| 1683 | DEFUN (no_neighbor, |
| 1684 | no_neighbor_cmd, |
| 1685 | NO_NEIGHBOR_CMD2, |
| 1686 | NO_STR |
| 1687 | NEIGHBOR_STR |
| 1688 | NEIGHBOR_ADDR_STR2) |
| 1689 | { |
| 1690 | int ret; |
| 1691 | union sockunion su; |
| 1692 | struct peer_group *group; |
| 1693 | struct peer *peer; |
| 1694 | |
| 1695 | ret = str2sockunion (argv[0], &su); |
| 1696 | if (ret < 0) |
| 1697 | { |
| 1698 | group = peer_group_lookup (vty->index, argv[0]); |
| 1699 | if (group) |
| 1700 | peer_group_delete (group); |
| 1701 | else |
| 1702 | { |
| 1703 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1704 | return CMD_WARNING; |
| 1705 | } |
| 1706 | } |
| 1707 | else |
| 1708 | { |
| 1709 | peer = peer_lookup (vty->index, &su); |
| 1710 | if (peer) |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 1711 | peer_delete (peer); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1712 | } |
| 1713 | |
| 1714 | return CMD_SUCCESS; |
| 1715 | } |
| 1716 | |
| 1717 | ALIAS (no_neighbor, |
| 1718 | no_neighbor_remote_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1719 | NO_NEIGHBOR_CMD "remote-as " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1720 | NO_STR |
| 1721 | NEIGHBOR_STR |
| 1722 | NEIGHBOR_ADDR_STR |
| 1723 | "Specify a BGP neighbor\n" |
| 1724 | AS_STR) |
| 1725 | |
| 1726 | DEFUN (no_neighbor_peer_group, |
| 1727 | no_neighbor_peer_group_cmd, |
| 1728 | "no neighbor WORD peer-group", |
| 1729 | NO_STR |
| 1730 | NEIGHBOR_STR |
| 1731 | "Neighbor tag\n" |
| 1732 | "Configure peer-group\n") |
| 1733 | { |
| 1734 | struct peer_group *group; |
| 1735 | |
| 1736 | group = peer_group_lookup (vty->index, argv[0]); |
| 1737 | if (group) |
| 1738 | peer_group_delete (group); |
| 1739 | else |
| 1740 | { |
| 1741 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1742 | return CMD_WARNING; |
| 1743 | } |
| 1744 | return CMD_SUCCESS; |
| 1745 | } |
| 1746 | |
| 1747 | DEFUN (no_neighbor_peer_group_remote_as, |
| 1748 | no_neighbor_peer_group_remote_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1749 | "no neighbor WORD remote-as " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1750 | NO_STR |
| 1751 | NEIGHBOR_STR |
| 1752 | "Neighbor tag\n" |
| 1753 | "Specify a BGP neighbor\n" |
| 1754 | AS_STR) |
| 1755 | { |
| 1756 | struct peer_group *group; |
| 1757 | |
| 1758 | group = peer_group_lookup (vty->index, argv[0]); |
| 1759 | if (group) |
| 1760 | peer_group_remote_as_delete (group); |
| 1761 | else |
| 1762 | { |
| 1763 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1764 | return CMD_WARNING; |
| 1765 | } |
| 1766 | return CMD_SUCCESS; |
| 1767 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1768 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1769 | DEFUN (neighbor_local_as, |
| 1770 | neighbor_local_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1771 | NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1772 | NEIGHBOR_STR |
| 1773 | NEIGHBOR_ADDR_STR2 |
| 1774 | "Specify a local-as number\n" |
| 1775 | "AS number used as local AS\n") |
| 1776 | { |
| 1777 | struct peer *peer; |
| 1778 | int ret; |
| 1779 | |
| 1780 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1781 | if (! peer) |
| 1782 | return CMD_WARNING; |
| 1783 | |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 1784 | ret = peer_local_as_set (peer, atoi (argv[1]), 0, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1785 | return bgp_vty_return (vty, ret); |
| 1786 | } |
| 1787 | |
| 1788 | DEFUN (neighbor_local_as_no_prepend, |
| 1789 | neighbor_local_as_no_prepend_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1790 | NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1791 | NEIGHBOR_STR |
| 1792 | NEIGHBOR_ADDR_STR2 |
| 1793 | "Specify a local-as number\n" |
| 1794 | "AS number used as local AS\n" |
| 1795 | "Do not prepend local-as to updates from ebgp peers\n") |
| 1796 | { |
| 1797 | struct peer *peer; |
| 1798 | int ret; |
| 1799 | |
| 1800 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1801 | if (! peer) |
| 1802 | return CMD_WARNING; |
| 1803 | |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 1804 | ret = peer_local_as_set (peer, atoi (argv[1]), 1, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1805 | return bgp_vty_return (vty, ret); |
| 1806 | } |
| 1807 | |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 1808 | DEFUN (neighbor_local_as_no_prepend_replace_as, |
| 1809 | neighbor_local_as_no_prepend_replace_as_cmd, |
| 1810 | NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend replace-as", |
| 1811 | NEIGHBOR_STR |
| 1812 | NEIGHBOR_ADDR_STR2 |
| 1813 | "Specify a local-as number\n" |
| 1814 | "AS number used as local AS\n" |
| 1815 | "Do not prepend local-as to updates from ebgp peers\n" |
| 1816 | "Do not prepend local-as to updates from ibgp peers\n") |
| 1817 | { |
| 1818 | struct peer *peer; |
| 1819 | int ret; |
| 1820 | |
| 1821 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1822 | if (! peer) |
| 1823 | return CMD_WARNING; |
| 1824 | |
| 1825 | ret = peer_local_as_set (peer, atoi (argv[1]), 1, 1); |
| 1826 | return bgp_vty_return (vty, ret); |
| 1827 | } |
| 1828 | |
| 1829 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1830 | DEFUN (no_neighbor_local_as, |
| 1831 | no_neighbor_local_as_cmd, |
| 1832 | NO_NEIGHBOR_CMD2 "local-as", |
| 1833 | NO_STR |
| 1834 | NEIGHBOR_STR |
| 1835 | NEIGHBOR_ADDR_STR2 |
| 1836 | "Specify a local-as number\n") |
| 1837 | { |
| 1838 | struct peer *peer; |
| 1839 | int ret; |
| 1840 | |
| 1841 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1842 | if (! peer) |
| 1843 | return CMD_WARNING; |
| 1844 | |
| 1845 | ret = peer_local_as_unset (peer); |
| 1846 | return bgp_vty_return (vty, ret); |
| 1847 | } |
| 1848 | |
| 1849 | ALIAS (no_neighbor_local_as, |
| 1850 | no_neighbor_local_as_val_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1851 | NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1852 | NO_STR |
| 1853 | NEIGHBOR_STR |
| 1854 | NEIGHBOR_ADDR_STR2 |
| 1855 | "Specify a local-as number\n" |
| 1856 | "AS number used as local AS\n") |
| 1857 | |
| 1858 | ALIAS (no_neighbor_local_as, |
| 1859 | no_neighbor_local_as_val2_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1860 | NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1861 | NO_STR |
| 1862 | NEIGHBOR_STR |
| 1863 | NEIGHBOR_ADDR_STR2 |
| 1864 | "Specify a local-as number\n" |
| 1865 | "AS number used as local AS\n" |
| 1866 | "Do not prepend local-as to updates from ebgp peers\n") |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 1867 | |
| 1868 | ALIAS (no_neighbor_local_as, |
| 1869 | no_neighbor_local_as_val3_cmd, |
| 1870 | NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend replace-as", |
| 1871 | NO_STR |
| 1872 | NEIGHBOR_STR |
| 1873 | NEIGHBOR_ADDR_STR2 |
| 1874 | "Specify a local-as number\n" |
| 1875 | "AS number used as local AS\n" |
| 1876 | "Do not prepend local-as to updates from ebgp peers\n" |
| 1877 | "Do not prepend local-as to updates from ibgp peers\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1878 | |
Paul Jakma | 0df7c91 | 2008-07-21 21:02:49 +0000 | [diff] [blame] | 1879 | DEFUN (neighbor_password, |
| 1880 | neighbor_password_cmd, |
| 1881 | NEIGHBOR_CMD2 "password LINE", |
| 1882 | NEIGHBOR_STR |
| 1883 | NEIGHBOR_ADDR_STR2 |
| 1884 | "Set a password\n" |
| 1885 | "The password\n") |
| 1886 | { |
| 1887 | struct peer *peer; |
| 1888 | int ret; |
| 1889 | |
| 1890 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1891 | if (! peer) |
| 1892 | return CMD_WARNING; |
| 1893 | |
| 1894 | ret = peer_password_set (peer, argv[1]); |
| 1895 | return bgp_vty_return (vty, ret); |
| 1896 | } |
| 1897 | |
| 1898 | DEFUN (no_neighbor_password, |
| 1899 | no_neighbor_password_cmd, |
| 1900 | NO_NEIGHBOR_CMD2 "password", |
| 1901 | NO_STR |
| 1902 | NEIGHBOR_STR |
| 1903 | NEIGHBOR_ADDR_STR2 |
| 1904 | "Set a password\n") |
| 1905 | { |
| 1906 | struct peer *peer; |
| 1907 | int ret; |
| 1908 | |
| 1909 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1910 | if (! peer) |
| 1911 | return CMD_WARNING; |
| 1912 | |
| 1913 | ret = peer_password_unset (peer); |
| 1914 | return bgp_vty_return (vty, ret); |
| 1915 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1916 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1917 | DEFUN (neighbor_activate, |
| 1918 | neighbor_activate_cmd, |
| 1919 | NEIGHBOR_CMD2 "activate", |
| 1920 | NEIGHBOR_STR |
| 1921 | NEIGHBOR_ADDR_STR2 |
| 1922 | "Enable the Address Family for this Neighbor\n") |
| 1923 | { |
| 1924 | struct peer *peer; |
| 1925 | |
| 1926 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1927 | if (! peer) |
| 1928 | return CMD_WARNING; |
| 1929 | |
| 1930 | peer_activate (peer, bgp_node_afi (vty), bgp_node_safi (vty)); |
| 1931 | |
| 1932 | return CMD_SUCCESS; |
| 1933 | } |
| 1934 | |
| 1935 | DEFUN (no_neighbor_activate, |
| 1936 | no_neighbor_activate_cmd, |
| 1937 | NO_NEIGHBOR_CMD2 "activate", |
| 1938 | NO_STR |
| 1939 | NEIGHBOR_STR |
| 1940 | NEIGHBOR_ADDR_STR2 |
| 1941 | "Enable the Address Family for this Neighbor\n") |
| 1942 | { |
| 1943 | int ret; |
| 1944 | struct peer *peer; |
| 1945 | |
| 1946 | /* Lookup peer. */ |
| 1947 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1948 | if (! peer) |
| 1949 | return CMD_WARNING; |
| 1950 | |
| 1951 | ret = peer_deactivate (peer, bgp_node_afi (vty), bgp_node_safi (vty)); |
| 1952 | |
| 1953 | return bgp_vty_return (vty, ret); |
| 1954 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1955 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1956 | DEFUN (neighbor_set_peer_group, |
| 1957 | neighbor_set_peer_group_cmd, |
| 1958 | NEIGHBOR_CMD "peer-group WORD", |
| 1959 | NEIGHBOR_STR |
| 1960 | NEIGHBOR_ADDR_STR |
| 1961 | "Member of the peer-group\n" |
| 1962 | "peer-group name\n") |
| 1963 | { |
| 1964 | int ret; |
| 1965 | as_t as; |
| 1966 | union sockunion su; |
| 1967 | struct bgp *bgp; |
| 1968 | struct peer_group *group; |
| 1969 | |
| 1970 | bgp = vty->index; |
| 1971 | |
| 1972 | ret = str2sockunion (argv[0], &su); |
| 1973 | if (ret < 0) |
| 1974 | { |
| 1975 | vty_out (vty, "%% Malformed address: %s%s", argv[0], VTY_NEWLINE); |
| 1976 | return CMD_WARNING; |
| 1977 | } |
| 1978 | |
| 1979 | group = peer_group_lookup (bgp, argv[1]); |
| 1980 | if (! group) |
| 1981 | { |
| 1982 | vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE); |
| 1983 | return CMD_WARNING; |
| 1984 | } |
| 1985 | |
| 1986 | if (peer_address_self_check (&su)) |
| 1987 | { |
| 1988 | vty_out (vty, "%% Can not configure the local system as neighbor%s", |
| 1989 | VTY_NEWLINE); |
| 1990 | return CMD_WARNING; |
| 1991 | } |
| 1992 | |
| 1993 | ret = peer_group_bind (bgp, &su, group, bgp_node_afi (vty), |
| 1994 | bgp_node_safi (vty), &as); |
| 1995 | |
| 1996 | if (ret == BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT) |
| 1997 | { |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 1998 | vty_out (vty, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external%s", as, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1999 | return CMD_WARNING; |
| 2000 | } |
| 2001 | |
| 2002 | return bgp_vty_return (vty, ret); |
| 2003 | } |
| 2004 | |
| 2005 | DEFUN (no_neighbor_set_peer_group, |
| 2006 | no_neighbor_set_peer_group_cmd, |
| 2007 | NO_NEIGHBOR_CMD "peer-group WORD", |
| 2008 | NO_STR |
| 2009 | NEIGHBOR_STR |
| 2010 | NEIGHBOR_ADDR_STR |
| 2011 | "Member of the peer-group\n" |
| 2012 | "peer-group name\n") |
| 2013 | { |
| 2014 | int ret; |
| 2015 | struct bgp *bgp; |
| 2016 | struct peer *peer; |
| 2017 | struct peer_group *group; |
| 2018 | |
| 2019 | bgp = vty->index; |
| 2020 | |
| 2021 | peer = peer_lookup_vty (vty, argv[0]); |
| 2022 | if (! peer) |
| 2023 | return CMD_WARNING; |
| 2024 | |
| 2025 | group = peer_group_lookup (bgp, argv[1]); |
| 2026 | if (! group) |
| 2027 | { |
| 2028 | vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE); |
| 2029 | return CMD_WARNING; |
| 2030 | } |
| 2031 | |
| 2032 | ret = peer_group_unbind (bgp, peer, group, bgp_node_afi (vty), |
| 2033 | bgp_node_safi (vty)); |
| 2034 | |
| 2035 | return bgp_vty_return (vty, ret); |
| 2036 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2037 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2038 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2039 | peer_flag_modify_vty (struct vty *vty, const char *ip_str, |
| 2040 | u_int16_t flag, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2041 | { |
| 2042 | int ret; |
| 2043 | struct peer *peer; |
| 2044 | |
| 2045 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 2046 | if (! peer) |
| 2047 | return CMD_WARNING; |
| 2048 | |
| 2049 | if (set) |
| 2050 | ret = peer_flag_set (peer, flag); |
| 2051 | else |
| 2052 | ret = peer_flag_unset (peer, flag); |
| 2053 | |
| 2054 | return bgp_vty_return (vty, ret); |
| 2055 | } |
| 2056 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2057 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2058 | peer_flag_set_vty (struct vty *vty, const char *ip_str, u_int16_t flag) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2059 | { |
| 2060 | return peer_flag_modify_vty (vty, ip_str, flag, 1); |
| 2061 | } |
| 2062 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2063 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2064 | peer_flag_unset_vty (struct vty *vty, const char *ip_str, u_int16_t flag) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2065 | { |
| 2066 | return peer_flag_modify_vty (vty, ip_str, flag, 0); |
| 2067 | } |
| 2068 | |
| 2069 | /* neighbor passive. */ |
| 2070 | DEFUN (neighbor_passive, |
| 2071 | neighbor_passive_cmd, |
| 2072 | NEIGHBOR_CMD2 "passive", |
| 2073 | NEIGHBOR_STR |
| 2074 | NEIGHBOR_ADDR_STR2 |
| 2075 | "Don't send open messages to this neighbor\n") |
| 2076 | { |
| 2077 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_PASSIVE); |
| 2078 | } |
| 2079 | |
| 2080 | DEFUN (no_neighbor_passive, |
| 2081 | no_neighbor_passive_cmd, |
| 2082 | NO_NEIGHBOR_CMD2 "passive", |
| 2083 | NO_STR |
| 2084 | NEIGHBOR_STR |
| 2085 | NEIGHBOR_ADDR_STR2 |
| 2086 | "Don't send open messages to this neighbor\n") |
| 2087 | { |
| 2088 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_PASSIVE); |
| 2089 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2090 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2091 | /* neighbor shutdown. */ |
| 2092 | DEFUN (neighbor_shutdown, |
| 2093 | neighbor_shutdown_cmd, |
| 2094 | NEIGHBOR_CMD2 "shutdown", |
| 2095 | NEIGHBOR_STR |
| 2096 | NEIGHBOR_ADDR_STR2 |
| 2097 | "Administratively shut down this neighbor\n") |
| 2098 | { |
| 2099 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_SHUTDOWN); |
| 2100 | } |
| 2101 | |
| 2102 | DEFUN (no_neighbor_shutdown, |
| 2103 | no_neighbor_shutdown_cmd, |
| 2104 | NO_NEIGHBOR_CMD2 "shutdown", |
| 2105 | NO_STR |
| 2106 | NEIGHBOR_STR |
| 2107 | NEIGHBOR_ADDR_STR2 |
| 2108 | "Administratively shut down this neighbor\n") |
| 2109 | { |
| 2110 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_SHUTDOWN); |
| 2111 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2112 | |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 2113 | /* Deprecated neighbor capability route-refresh. */ |
| 2114 | DEFUN_DEPRECATED (neighbor_capability_route_refresh, |
| 2115 | neighbor_capability_route_refresh_cmd, |
| 2116 | NEIGHBOR_CMD2 "capability route-refresh", |
| 2117 | NEIGHBOR_STR |
| 2118 | NEIGHBOR_ADDR_STR2 |
| 2119 | "Advertise capability to the peer\n" |
| 2120 | "Advertise route-refresh capability to this neighbor\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2121 | { |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 2122 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2123 | } |
| 2124 | |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 2125 | DEFUN_DEPRECATED (no_neighbor_capability_route_refresh, |
| 2126 | no_neighbor_capability_route_refresh_cmd, |
| 2127 | NO_NEIGHBOR_CMD2 "capability route-refresh", |
| 2128 | NO_STR |
| 2129 | NEIGHBOR_STR |
| 2130 | NEIGHBOR_ADDR_STR2 |
| 2131 | "Advertise capability to the peer\n" |
| 2132 | "Advertise route-refresh capability to this neighbor\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2133 | { |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 2134 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2135 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2136 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2137 | /* neighbor capability dynamic. */ |
| 2138 | DEFUN (neighbor_capability_dynamic, |
| 2139 | neighbor_capability_dynamic_cmd, |
| 2140 | NEIGHBOR_CMD2 "capability dynamic", |
| 2141 | NEIGHBOR_STR |
| 2142 | NEIGHBOR_ADDR_STR2 |
| 2143 | "Advertise capability to the peer\n" |
| 2144 | "Advertise dynamic capability to this neighbor\n") |
| 2145 | { |
| 2146 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DYNAMIC_CAPABILITY); |
| 2147 | } |
| 2148 | |
| 2149 | DEFUN (no_neighbor_capability_dynamic, |
| 2150 | no_neighbor_capability_dynamic_cmd, |
| 2151 | NO_NEIGHBOR_CMD2 "capability dynamic", |
| 2152 | NO_STR |
| 2153 | NEIGHBOR_STR |
| 2154 | NEIGHBOR_ADDR_STR2 |
| 2155 | "Advertise capability to the peer\n" |
| 2156 | "Advertise dynamic capability to this neighbor\n") |
| 2157 | { |
| 2158 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DYNAMIC_CAPABILITY); |
| 2159 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2160 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2161 | /* neighbor dont-capability-negotiate */ |
| 2162 | DEFUN (neighbor_dont_capability_negotiate, |
| 2163 | neighbor_dont_capability_negotiate_cmd, |
| 2164 | NEIGHBOR_CMD2 "dont-capability-negotiate", |
| 2165 | NEIGHBOR_STR |
| 2166 | NEIGHBOR_ADDR_STR2 |
| 2167 | "Do not perform capability negotiation\n") |
| 2168 | { |
| 2169 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DONT_CAPABILITY); |
| 2170 | } |
| 2171 | |
| 2172 | DEFUN (no_neighbor_dont_capability_negotiate, |
| 2173 | no_neighbor_dont_capability_negotiate_cmd, |
| 2174 | NO_NEIGHBOR_CMD2 "dont-capability-negotiate", |
| 2175 | NO_STR |
| 2176 | NEIGHBOR_STR |
| 2177 | NEIGHBOR_ADDR_STR2 |
| 2178 | "Do not perform capability negotiation\n") |
| 2179 | { |
| 2180 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DONT_CAPABILITY); |
| 2181 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2182 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2183 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2184 | peer_af_flag_modify_vty (struct vty *vty, const char *peer_str, afi_t afi, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2185 | safi_t safi, u_int32_t flag, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2186 | { |
| 2187 | int ret; |
| 2188 | struct peer *peer; |
| 2189 | |
| 2190 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 2191 | if (! peer) |
| 2192 | return CMD_WARNING; |
| 2193 | |
| 2194 | if (set) |
| 2195 | ret = peer_af_flag_set (peer, afi, safi, flag); |
| 2196 | else |
| 2197 | ret = peer_af_flag_unset (peer, afi, safi, flag); |
| 2198 | |
| 2199 | return bgp_vty_return (vty, ret); |
| 2200 | } |
| 2201 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2202 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2203 | peer_af_flag_set_vty (struct vty *vty, const char *peer_str, afi_t afi, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2204 | safi_t safi, u_int32_t flag) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2205 | { |
| 2206 | return peer_af_flag_modify_vty (vty, peer_str, afi, safi, flag, 1); |
| 2207 | } |
| 2208 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2209 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2210 | peer_af_flag_unset_vty (struct vty *vty, const char *peer_str, afi_t afi, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2211 | safi_t safi, u_int32_t flag) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2212 | { |
| 2213 | return peer_af_flag_modify_vty (vty, peer_str, afi, safi, flag, 0); |
| 2214 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2215 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2216 | /* neighbor capability orf prefix-list. */ |
| 2217 | DEFUN (neighbor_capability_orf_prefix, |
| 2218 | neighbor_capability_orf_prefix_cmd, |
| 2219 | NEIGHBOR_CMD2 "capability orf prefix-list (both|send|receive)", |
| 2220 | NEIGHBOR_STR |
| 2221 | NEIGHBOR_ADDR_STR2 |
| 2222 | "Advertise capability to the peer\n" |
| 2223 | "Advertise ORF capability to the peer\n" |
| 2224 | "Advertise prefixlist ORF capability to this neighbor\n" |
| 2225 | "Capability to SEND and RECEIVE the ORF to/from this neighbor\n" |
| 2226 | "Capability to RECEIVE the ORF from this neighbor\n" |
| 2227 | "Capability to SEND the ORF to this neighbor\n") |
| 2228 | { |
| 2229 | u_int16_t flag = 0; |
| 2230 | |
| 2231 | if (strncmp (argv[1], "s", 1) == 0) |
| 2232 | flag = PEER_FLAG_ORF_PREFIX_SM; |
| 2233 | else if (strncmp (argv[1], "r", 1) == 0) |
| 2234 | flag = PEER_FLAG_ORF_PREFIX_RM; |
| 2235 | else if (strncmp (argv[1], "b", 1) == 0) |
| 2236 | flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM; |
| 2237 | else |
| 2238 | return CMD_WARNING; |
| 2239 | |
| 2240 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2241 | bgp_node_safi (vty), flag); |
| 2242 | } |
| 2243 | |
| 2244 | DEFUN (no_neighbor_capability_orf_prefix, |
| 2245 | no_neighbor_capability_orf_prefix_cmd, |
| 2246 | NO_NEIGHBOR_CMD2 "capability orf prefix-list (both|send|receive)", |
| 2247 | NO_STR |
| 2248 | NEIGHBOR_STR |
| 2249 | NEIGHBOR_ADDR_STR2 |
| 2250 | "Advertise capability to the peer\n" |
| 2251 | "Advertise ORF capability to the peer\n" |
| 2252 | "Advertise prefixlist ORF capability to this neighbor\n" |
| 2253 | "Capability to SEND and RECEIVE the ORF to/from this neighbor\n" |
| 2254 | "Capability to RECEIVE the ORF from this neighbor\n" |
| 2255 | "Capability to SEND the ORF to this neighbor\n") |
| 2256 | { |
| 2257 | u_int16_t flag = 0; |
| 2258 | |
| 2259 | if (strncmp (argv[1], "s", 1) == 0) |
| 2260 | flag = PEER_FLAG_ORF_PREFIX_SM; |
| 2261 | else if (strncmp (argv[1], "r", 1) == 0) |
| 2262 | flag = PEER_FLAG_ORF_PREFIX_RM; |
| 2263 | else if (strncmp (argv[1], "b", 1) == 0) |
| 2264 | flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM; |
| 2265 | else |
| 2266 | return CMD_WARNING; |
| 2267 | |
| 2268 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2269 | bgp_node_safi (vty), flag); |
| 2270 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2271 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2272 | /* neighbor next-hop-self. */ |
| 2273 | DEFUN (neighbor_nexthop_self, |
| 2274 | neighbor_nexthop_self_cmd, |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2275 | NEIGHBOR_CMD2 "next-hop-self {all}", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2276 | NEIGHBOR_STR |
| 2277 | NEIGHBOR_ADDR_STR2 |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2278 | "Disable the next hop calculation for this neighbor\n" |
| 2279 | "Apply also to ibgp-learned routes when acting as a route reflector\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2280 | { |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2281 | u_int32_t flags = PEER_FLAG_NEXTHOP_SELF, unset = 0; |
| 2282 | int rc; |
| 2283 | |
| 2284 | /* Check if "all" is specified */ |
| 2285 | if (argv[1] != NULL) |
| 2286 | flags |= PEER_FLAG_NEXTHOP_SELF_ALL; |
| 2287 | else |
| 2288 | unset |= PEER_FLAG_NEXTHOP_SELF_ALL; |
| 2289 | |
| 2290 | rc = peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2291 | bgp_node_safi (vty), flags); |
| 2292 | if ( rc == CMD_SUCCESS && unset ) |
| 2293 | rc = peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2294 | bgp_node_safi (vty), unset); |
| 2295 | return rc; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2296 | } |
| 2297 | |
| 2298 | DEFUN (no_neighbor_nexthop_self, |
| 2299 | no_neighbor_nexthop_self_cmd, |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2300 | NO_NEIGHBOR_CMD2 "next-hop-self {all}", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2301 | NO_STR |
| 2302 | NEIGHBOR_STR |
| 2303 | NEIGHBOR_ADDR_STR2 |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2304 | "Disable the next hop calculation for this neighbor\n" |
| 2305 | "Apply also to ibgp-learned routes when acting as a route reflector\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2306 | { |
| 2307 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2308 | bgp_node_safi (vty), |
| 2309 | PEER_FLAG_NEXTHOP_SELF|PEER_FLAG_NEXTHOP_SELF_ALL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2310 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2311 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2312 | /* neighbor remove-private-AS. */ |
| 2313 | DEFUN (neighbor_remove_private_as, |
| 2314 | neighbor_remove_private_as_cmd, |
| 2315 | NEIGHBOR_CMD2 "remove-private-AS", |
| 2316 | NEIGHBOR_STR |
| 2317 | NEIGHBOR_ADDR_STR2 |
| 2318 | "Remove private AS number from outbound updates\n") |
| 2319 | { |
| 2320 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2321 | bgp_node_safi (vty), |
| 2322 | PEER_FLAG_REMOVE_PRIVATE_AS); |
| 2323 | } |
| 2324 | |
| 2325 | DEFUN (no_neighbor_remove_private_as, |
| 2326 | no_neighbor_remove_private_as_cmd, |
| 2327 | NO_NEIGHBOR_CMD2 "remove-private-AS", |
| 2328 | NO_STR |
| 2329 | NEIGHBOR_STR |
| 2330 | NEIGHBOR_ADDR_STR2 |
| 2331 | "Remove private AS number from outbound updates\n") |
| 2332 | { |
| 2333 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2334 | bgp_node_safi (vty), |
| 2335 | PEER_FLAG_REMOVE_PRIVATE_AS); |
| 2336 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2337 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2338 | /* neighbor send-community. */ |
| 2339 | DEFUN (neighbor_send_community, |
| 2340 | neighbor_send_community_cmd, |
| 2341 | NEIGHBOR_CMD2 "send-community", |
| 2342 | NEIGHBOR_STR |
| 2343 | NEIGHBOR_ADDR_STR2 |
| 2344 | "Send Community attribute to this neighbor\n") |
| 2345 | { |
| 2346 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2347 | bgp_node_safi (vty), |
| 2348 | PEER_FLAG_SEND_COMMUNITY); |
| 2349 | } |
| 2350 | |
| 2351 | DEFUN (no_neighbor_send_community, |
| 2352 | no_neighbor_send_community_cmd, |
| 2353 | NO_NEIGHBOR_CMD2 "send-community", |
| 2354 | NO_STR |
| 2355 | NEIGHBOR_STR |
| 2356 | NEIGHBOR_ADDR_STR2 |
| 2357 | "Send Community attribute to this neighbor\n") |
| 2358 | { |
| 2359 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2360 | bgp_node_safi (vty), |
| 2361 | PEER_FLAG_SEND_COMMUNITY); |
| 2362 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2363 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2364 | /* neighbor send-community extended. */ |
| 2365 | DEFUN (neighbor_send_community_type, |
| 2366 | neighbor_send_community_type_cmd, |
| 2367 | NEIGHBOR_CMD2 "send-community (both|extended|standard)", |
| 2368 | NEIGHBOR_STR |
| 2369 | NEIGHBOR_ADDR_STR2 |
| 2370 | "Send Community attribute to this neighbor\n" |
| 2371 | "Send Standard and Extended Community attributes\n" |
| 2372 | "Send Extended Community attributes\n" |
| 2373 | "Send Standard Community attributes\n") |
| 2374 | { |
| 2375 | if (strncmp (argv[1], "s", 1) == 0) |
| 2376 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2377 | bgp_node_safi (vty), |
| 2378 | PEER_FLAG_SEND_COMMUNITY); |
| 2379 | if (strncmp (argv[1], "e", 1) == 0) |
| 2380 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2381 | bgp_node_safi (vty), |
| 2382 | PEER_FLAG_SEND_EXT_COMMUNITY); |
| 2383 | |
| 2384 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2385 | bgp_node_safi (vty), |
| 2386 | (PEER_FLAG_SEND_COMMUNITY| |
| 2387 | PEER_FLAG_SEND_EXT_COMMUNITY)); |
| 2388 | } |
| 2389 | |
| 2390 | DEFUN (no_neighbor_send_community_type, |
| 2391 | no_neighbor_send_community_type_cmd, |
| 2392 | NO_NEIGHBOR_CMD2 "send-community (both|extended|standard)", |
| 2393 | NO_STR |
| 2394 | NEIGHBOR_STR |
| 2395 | NEIGHBOR_ADDR_STR2 |
| 2396 | "Send Community attribute to this neighbor\n" |
| 2397 | "Send Standard and Extended Community attributes\n" |
| 2398 | "Send Extended Community attributes\n" |
| 2399 | "Send Standard Community attributes\n") |
| 2400 | { |
| 2401 | if (strncmp (argv[1], "s", 1) == 0) |
| 2402 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2403 | bgp_node_safi (vty), |
| 2404 | PEER_FLAG_SEND_COMMUNITY); |
| 2405 | if (strncmp (argv[1], "e", 1) == 0) |
| 2406 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2407 | bgp_node_safi (vty), |
| 2408 | PEER_FLAG_SEND_EXT_COMMUNITY); |
| 2409 | |
| 2410 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2411 | bgp_node_safi (vty), |
| 2412 | (PEER_FLAG_SEND_COMMUNITY | |
| 2413 | PEER_FLAG_SEND_EXT_COMMUNITY)); |
| 2414 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2415 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2416 | /* neighbor soft-reconfig. */ |
| 2417 | DEFUN (neighbor_soft_reconfiguration, |
| 2418 | neighbor_soft_reconfiguration_cmd, |
| 2419 | NEIGHBOR_CMD2 "soft-reconfiguration inbound", |
| 2420 | NEIGHBOR_STR |
| 2421 | NEIGHBOR_ADDR_STR2 |
| 2422 | "Per neighbor soft reconfiguration\n" |
| 2423 | "Allow inbound soft reconfiguration for this neighbor\n") |
| 2424 | { |
| 2425 | return peer_af_flag_set_vty (vty, argv[0], |
| 2426 | bgp_node_afi (vty), bgp_node_safi (vty), |
| 2427 | PEER_FLAG_SOFT_RECONFIG); |
| 2428 | } |
| 2429 | |
| 2430 | DEFUN (no_neighbor_soft_reconfiguration, |
| 2431 | no_neighbor_soft_reconfiguration_cmd, |
| 2432 | NO_NEIGHBOR_CMD2 "soft-reconfiguration inbound", |
| 2433 | NO_STR |
| 2434 | NEIGHBOR_STR |
| 2435 | NEIGHBOR_ADDR_STR2 |
| 2436 | "Per neighbor soft reconfiguration\n" |
| 2437 | "Allow inbound soft reconfiguration for this neighbor\n") |
| 2438 | { |
| 2439 | return peer_af_flag_unset_vty (vty, argv[0], |
| 2440 | bgp_node_afi (vty), bgp_node_safi (vty), |
| 2441 | PEER_FLAG_SOFT_RECONFIG); |
| 2442 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2443 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2444 | DEFUN (neighbor_route_reflector_client, |
| 2445 | neighbor_route_reflector_client_cmd, |
| 2446 | NEIGHBOR_CMD2 "route-reflector-client", |
| 2447 | NEIGHBOR_STR |
| 2448 | NEIGHBOR_ADDR_STR2 |
| 2449 | "Configure a neighbor as Route Reflector client\n") |
| 2450 | { |
| 2451 | struct peer *peer; |
| 2452 | |
| 2453 | |
| 2454 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 2455 | if (! peer) |
| 2456 | return CMD_WARNING; |
| 2457 | |
| 2458 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2459 | bgp_node_safi (vty), |
| 2460 | PEER_FLAG_REFLECTOR_CLIENT); |
| 2461 | } |
| 2462 | |
| 2463 | DEFUN (no_neighbor_route_reflector_client, |
| 2464 | no_neighbor_route_reflector_client_cmd, |
| 2465 | NO_NEIGHBOR_CMD2 "route-reflector-client", |
| 2466 | NO_STR |
| 2467 | NEIGHBOR_STR |
| 2468 | NEIGHBOR_ADDR_STR2 |
| 2469 | "Configure a neighbor as Route Reflector client\n") |
| 2470 | { |
| 2471 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2472 | bgp_node_safi (vty), |
| 2473 | PEER_FLAG_REFLECTOR_CLIENT); |
| 2474 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2475 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2476 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2477 | peer_rsclient_set_vty (struct vty *vty, const char *peer_str, |
| 2478 | int afi, int safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2479 | { |
| 2480 | int ret; |
| 2481 | struct bgp *bgp; |
| 2482 | struct peer *peer; |
| 2483 | struct peer_group *group; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2484 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2485 | struct bgp_filter *pfilter; |
| 2486 | struct bgp_filter *gfilter; |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2487 | int locked_and_added = 0; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2488 | |
| 2489 | bgp = vty->index; |
| 2490 | |
| 2491 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 2492 | if ( ! peer ) |
| 2493 | return CMD_WARNING; |
| 2494 | |
| 2495 | /* If it is already a RS-Client, don't do anything. */ |
| 2496 | if ( CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT) ) |
| 2497 | return CMD_SUCCESS; |
| 2498 | |
| 2499 | if ( ! peer_rsclient_active (peer) ) |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2500 | { |
| 2501 | peer = peer_lock (peer); /* rsclient peer list reference */ |
| 2502 | listnode_add_sort (bgp->rsclient, peer); |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2503 | locked_and_added = 1; |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2504 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2505 | |
| 2506 | ret = peer_af_flag_set (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2507 | if (ret < 0) |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2508 | { |
| 2509 | if (locked_and_added) |
| 2510 | { |
| 2511 | listnode_delete (bgp->rsclient, peer); |
| 2512 | peer_unlock (peer); /* rsclient peer list reference */ |
| 2513 | } |
| 2514 | |
| 2515 | return bgp_vty_return (vty, ret); |
| 2516 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2517 | |
Paul Jakma | 64e580a | 2006-02-21 01:09:01 +0000 | [diff] [blame] | 2518 | peer->rib[afi][safi] = bgp_table_init (afi, safi); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2519 | peer->rib[afi][safi]->type = BGP_TABLE_RSCLIENT; |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2520 | /* RIB peer reference. Released when table is free'd in bgp_table_free. */ |
| 2521 | peer->rib[afi][safi]->owner = peer_lock (peer); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2522 | |
| 2523 | /* Check for existing 'network' and 'redistribute' routes. */ |
| 2524 | bgp_check_local_routes_rsclient (peer, afi, safi); |
| 2525 | |
| 2526 | /* Check for routes for peers configured with 'soft-reconfiguration'. */ |
| 2527 | bgp_soft_reconfig_rsclient (peer, afi, safi); |
| 2528 | |
| 2529 | if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) |
| 2530 | { |
| 2531 | group = peer->group; |
| 2532 | gfilter = &peer->filter[afi][safi]; |
| 2533 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2534 | for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2535 | { |
| 2536 | pfilter = &peer->filter[afi][safi]; |
| 2537 | |
| 2538 | /* Members of a non-RS-Client group should not be RS-Clients, as that |
| 2539 | is checked when the become part of the peer-group */ |
| 2540 | ret = peer_af_flag_set (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2541 | if (ret < 0) |
| 2542 | return bgp_vty_return (vty, ret); |
| 2543 | |
| 2544 | /* Make peer's RIB point to group's RIB. */ |
| 2545 | peer->rib[afi][safi] = group->conf->rib[afi][safi]; |
| 2546 | |
| 2547 | /* Import policy. */ |
| 2548 | if (pfilter->map[RMAP_IMPORT].name) |
| 2549 | free (pfilter->map[RMAP_IMPORT].name); |
| 2550 | if (gfilter->map[RMAP_IMPORT].name) |
| 2551 | { |
| 2552 | pfilter->map[RMAP_IMPORT].name = strdup (gfilter->map[RMAP_IMPORT].name); |
| 2553 | pfilter->map[RMAP_IMPORT].map = gfilter->map[RMAP_IMPORT].map; |
| 2554 | } |
| 2555 | else |
| 2556 | { |
| 2557 | pfilter->map[RMAP_IMPORT].name = NULL; |
| 2558 | pfilter->map[RMAP_IMPORT].map =NULL; |
| 2559 | } |
| 2560 | |
| 2561 | /* Export policy. */ |
| 2562 | if (gfilter->map[RMAP_EXPORT].name && ! pfilter->map[RMAP_EXPORT].name) |
| 2563 | { |
| 2564 | pfilter->map[RMAP_EXPORT].name = strdup (gfilter->map[RMAP_EXPORT].name); |
| 2565 | pfilter->map[RMAP_EXPORT].map = gfilter->map[RMAP_EXPORT].map; |
| 2566 | } |
| 2567 | } |
| 2568 | } |
| 2569 | return CMD_SUCCESS; |
| 2570 | } |
| 2571 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2572 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2573 | peer_rsclient_unset_vty (struct vty *vty, const char *peer_str, |
| 2574 | int afi, int safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2575 | { |
| 2576 | int ret; |
| 2577 | struct bgp *bgp; |
| 2578 | struct peer *peer; |
| 2579 | struct peer_group *group; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2580 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2581 | |
| 2582 | bgp = vty->index; |
| 2583 | |
| 2584 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 2585 | if ( ! peer ) |
| 2586 | return CMD_WARNING; |
| 2587 | |
| 2588 | /* If it is not a RS-Client, don't do anything. */ |
| 2589 | if ( ! CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT) ) |
| 2590 | return CMD_SUCCESS; |
| 2591 | |
| 2592 | if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) |
| 2593 | { |
| 2594 | group = peer->group; |
| 2595 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2596 | for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2597 | { |
| 2598 | ret = peer_af_flag_unset (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2599 | if (ret < 0) |
| 2600 | return bgp_vty_return (vty, ret); |
| 2601 | |
| 2602 | peer->rib[afi][safi] = NULL; |
| 2603 | } |
| 2604 | |
| 2605 | peer = group->conf; |
| 2606 | } |
| 2607 | |
| 2608 | ret = peer_af_flag_unset (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2609 | if (ret < 0) |
| 2610 | return bgp_vty_return (vty, ret); |
| 2611 | |
| 2612 | if ( ! peer_rsclient_active (peer) ) |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2613 | { |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2614 | bgp_clear_route (peer, afi, safi, BGP_CLEAR_ROUTE_MY_RSCLIENT); |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2615 | listnode_delete (bgp->rsclient, peer); |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2616 | peer_unlock (peer); /* peer bgp rsclient reference */ |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2617 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2618 | |
Paul Jakma | b608d5b | 2008-07-02 02:12:07 +0000 | [diff] [blame] | 2619 | bgp_table_finish (&peer->rib[bgp_node_afi(vty)][bgp_node_safi(vty)]); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2620 | |
| 2621 | return CMD_SUCCESS; |
| 2622 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2623 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2624 | /* neighbor route-server-client. */ |
| 2625 | DEFUN (neighbor_route_server_client, |
| 2626 | neighbor_route_server_client_cmd, |
| 2627 | NEIGHBOR_CMD2 "route-server-client", |
| 2628 | NEIGHBOR_STR |
| 2629 | NEIGHBOR_ADDR_STR2 |
| 2630 | "Configure a neighbor as Route Server client\n") |
| 2631 | { |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2632 | return peer_rsclient_set_vty (vty, argv[0], bgp_node_afi(vty), |
| 2633 | bgp_node_safi(vty)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2634 | } |
| 2635 | |
| 2636 | DEFUN (no_neighbor_route_server_client, |
| 2637 | no_neighbor_route_server_client_cmd, |
| 2638 | NO_NEIGHBOR_CMD2 "route-server-client", |
| 2639 | NO_STR |
| 2640 | NEIGHBOR_STR |
| 2641 | NEIGHBOR_ADDR_STR2 |
| 2642 | "Configure a neighbor as Route Server client\n") |
| 2643 | { |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2644 | return peer_rsclient_unset_vty (vty, argv[0], bgp_node_afi(vty), |
| 2645 | bgp_node_safi(vty)); |
| 2646 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2647 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2648 | DEFUN (neighbor_nexthop_local_unchanged, |
| 2649 | neighbor_nexthop_local_unchanged_cmd, |
| 2650 | NEIGHBOR_CMD2 "nexthop-local unchanged", |
| 2651 | NEIGHBOR_STR |
| 2652 | NEIGHBOR_ADDR_STR2 |
| 2653 | "Configure treatment of outgoing link-local nexthop attribute\n" |
| 2654 | "Leave link-local nexthop unchanged for this peer\n") |
| 2655 | { |
| 2656 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2657 | bgp_node_safi (vty), |
| 2658 | PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED ); |
| 2659 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2660 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2661 | DEFUN (no_neighbor_nexthop_local_unchanged, |
| 2662 | no_neighbor_nexthop_local_unchanged_cmd, |
| 2663 | NO_NEIGHBOR_CMD2 "nexthop-local unchanged", |
| 2664 | NO_STR |
| 2665 | NEIGHBOR_STR |
| 2666 | NEIGHBOR_ADDR_STR2 |
| 2667 | "Configure treatment of outgoing link-local-nexthop attribute\n" |
| 2668 | "Leave link-local nexthop unchanged for this peer\n") |
| 2669 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2670 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2671 | bgp_node_safi (vty), |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2672 | PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED ); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2673 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2674 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2675 | DEFUN (neighbor_attr_unchanged, |
| 2676 | neighbor_attr_unchanged_cmd, |
| 2677 | NEIGHBOR_CMD2 "attribute-unchanged", |
| 2678 | NEIGHBOR_STR |
| 2679 | NEIGHBOR_ADDR_STR2 |
| 2680 | "BGP attribute is propagated unchanged to this neighbor\n") |
| 2681 | { |
| 2682 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2683 | bgp_node_safi (vty), |
| 2684 | (PEER_FLAG_AS_PATH_UNCHANGED | |
| 2685 | PEER_FLAG_NEXTHOP_UNCHANGED | |
| 2686 | PEER_FLAG_MED_UNCHANGED)); |
| 2687 | } |
| 2688 | |
| 2689 | DEFUN (neighbor_attr_unchanged1, |
| 2690 | neighbor_attr_unchanged1_cmd, |
| 2691 | NEIGHBOR_CMD2 "attribute-unchanged (as-path|next-hop|med)", |
| 2692 | NEIGHBOR_STR |
| 2693 | NEIGHBOR_ADDR_STR2 |
| 2694 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2695 | "As-path attribute\n" |
| 2696 | "Nexthop attribute\n" |
| 2697 | "Med attribute\n") |
| 2698 | { |
| 2699 | u_int16_t flags = 0; |
| 2700 | |
| 2701 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2702 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2703 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2704 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2705 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2706 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2707 | |
| 2708 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2709 | bgp_node_safi (vty), flags); |
| 2710 | } |
| 2711 | |
| 2712 | DEFUN (neighbor_attr_unchanged2, |
| 2713 | neighbor_attr_unchanged2_cmd, |
| 2714 | NEIGHBOR_CMD2 "attribute-unchanged as-path (next-hop|med)", |
| 2715 | NEIGHBOR_STR |
| 2716 | NEIGHBOR_ADDR_STR2 |
| 2717 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2718 | "As-path attribute\n" |
| 2719 | "Nexthop attribute\n" |
| 2720 | "Med attribute\n") |
| 2721 | { |
| 2722 | u_int16_t flags = PEER_FLAG_AS_PATH_UNCHANGED; |
| 2723 | |
| 2724 | if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2725 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2726 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2727 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2728 | |
| 2729 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2730 | bgp_node_safi (vty), flags); |
| 2731 | |
| 2732 | } |
| 2733 | |
| 2734 | DEFUN (neighbor_attr_unchanged3, |
| 2735 | neighbor_attr_unchanged3_cmd, |
| 2736 | NEIGHBOR_CMD2 "attribute-unchanged next-hop (as-path|med)", |
| 2737 | NEIGHBOR_STR |
| 2738 | NEIGHBOR_ADDR_STR2 |
| 2739 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2740 | "Nexthop attribute\n" |
| 2741 | "As-path attribute\n" |
| 2742 | "Med attribute\n") |
| 2743 | { |
| 2744 | u_int16_t flags = PEER_FLAG_NEXTHOP_UNCHANGED; |
| 2745 | |
| 2746 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2747 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2748 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2749 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2750 | |
| 2751 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2752 | bgp_node_safi (vty), flags); |
| 2753 | } |
| 2754 | |
| 2755 | DEFUN (neighbor_attr_unchanged4, |
| 2756 | neighbor_attr_unchanged4_cmd, |
| 2757 | NEIGHBOR_CMD2 "attribute-unchanged med (as-path|next-hop)", |
| 2758 | NEIGHBOR_STR |
| 2759 | NEIGHBOR_ADDR_STR2 |
| 2760 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2761 | "Med attribute\n" |
| 2762 | "As-path attribute\n" |
| 2763 | "Nexthop attribute\n") |
| 2764 | { |
| 2765 | u_int16_t flags = PEER_FLAG_MED_UNCHANGED; |
| 2766 | |
| 2767 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2768 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2769 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2770 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2771 | |
| 2772 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2773 | bgp_node_safi (vty), flags); |
| 2774 | } |
| 2775 | |
| 2776 | ALIAS (neighbor_attr_unchanged, |
| 2777 | neighbor_attr_unchanged5_cmd, |
| 2778 | NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med", |
| 2779 | NEIGHBOR_STR |
| 2780 | NEIGHBOR_ADDR_STR2 |
| 2781 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2782 | "As-path attribute\n" |
| 2783 | "Nexthop attribute\n" |
| 2784 | "Med attribute\n") |
| 2785 | |
| 2786 | ALIAS (neighbor_attr_unchanged, |
| 2787 | neighbor_attr_unchanged6_cmd, |
| 2788 | NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop", |
| 2789 | NEIGHBOR_STR |
| 2790 | NEIGHBOR_ADDR_STR2 |
| 2791 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2792 | "As-path attribute\n" |
| 2793 | "Med attribute\n" |
| 2794 | "Nexthop attribute\n") |
| 2795 | |
| 2796 | ALIAS (neighbor_attr_unchanged, |
| 2797 | neighbor_attr_unchanged7_cmd, |
| 2798 | NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path", |
| 2799 | NEIGHBOR_STR |
| 2800 | NEIGHBOR_ADDR_STR2 |
| 2801 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2802 | "Nexthop attribute\n" |
| 2803 | "Med attribute\n" |
| 2804 | "As-path attribute\n") |
| 2805 | |
| 2806 | ALIAS (neighbor_attr_unchanged, |
| 2807 | neighbor_attr_unchanged8_cmd, |
| 2808 | NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med", |
| 2809 | NEIGHBOR_STR |
| 2810 | NEIGHBOR_ADDR_STR2 |
| 2811 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2812 | "Nexthop attribute\n" |
| 2813 | "As-path attribute\n" |
| 2814 | "Med attribute\n") |
| 2815 | |
| 2816 | ALIAS (neighbor_attr_unchanged, |
| 2817 | neighbor_attr_unchanged9_cmd, |
| 2818 | NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path", |
| 2819 | NEIGHBOR_STR |
| 2820 | NEIGHBOR_ADDR_STR2 |
| 2821 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2822 | "Med attribute\n" |
| 2823 | "Nexthop attribute\n" |
| 2824 | "As-path attribute\n") |
| 2825 | |
| 2826 | ALIAS (neighbor_attr_unchanged, |
| 2827 | neighbor_attr_unchanged10_cmd, |
| 2828 | NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop", |
| 2829 | NEIGHBOR_STR |
| 2830 | NEIGHBOR_ADDR_STR2 |
| 2831 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2832 | "Med attribute\n" |
| 2833 | "As-path attribute\n" |
| 2834 | "Nexthop attribute\n") |
| 2835 | |
| 2836 | DEFUN (no_neighbor_attr_unchanged, |
| 2837 | no_neighbor_attr_unchanged_cmd, |
| 2838 | NO_NEIGHBOR_CMD2 "attribute-unchanged", |
| 2839 | NO_STR |
| 2840 | NEIGHBOR_STR |
| 2841 | NEIGHBOR_ADDR_STR2 |
| 2842 | "BGP attribute is propagated unchanged to this neighbor\n") |
| 2843 | { |
| 2844 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2845 | bgp_node_safi (vty), |
| 2846 | (PEER_FLAG_AS_PATH_UNCHANGED | |
| 2847 | PEER_FLAG_NEXTHOP_UNCHANGED | |
| 2848 | PEER_FLAG_MED_UNCHANGED)); |
| 2849 | } |
| 2850 | |
| 2851 | DEFUN (no_neighbor_attr_unchanged1, |
| 2852 | no_neighbor_attr_unchanged1_cmd, |
| 2853 | NO_NEIGHBOR_CMD2 "attribute-unchanged (as-path|next-hop|med)", |
| 2854 | NO_STR |
| 2855 | NEIGHBOR_STR |
| 2856 | NEIGHBOR_ADDR_STR2 |
| 2857 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2858 | "As-path attribute\n" |
| 2859 | "Nexthop attribute\n" |
| 2860 | "Med attribute\n") |
| 2861 | { |
| 2862 | u_int16_t flags = 0; |
| 2863 | |
| 2864 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2865 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2866 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2867 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2868 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2869 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2870 | |
| 2871 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2872 | bgp_node_safi (vty), flags); |
| 2873 | } |
| 2874 | |
| 2875 | DEFUN (no_neighbor_attr_unchanged2, |
| 2876 | no_neighbor_attr_unchanged2_cmd, |
| 2877 | NO_NEIGHBOR_CMD2 "attribute-unchanged as-path (next-hop|med)", |
| 2878 | NO_STR |
| 2879 | NEIGHBOR_STR |
| 2880 | NEIGHBOR_ADDR_STR2 |
| 2881 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2882 | "As-path attribute\n" |
| 2883 | "Nexthop attribute\n" |
| 2884 | "Med attribute\n") |
| 2885 | { |
| 2886 | u_int16_t flags = PEER_FLAG_AS_PATH_UNCHANGED; |
| 2887 | |
| 2888 | if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2889 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2890 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2891 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2892 | |
| 2893 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2894 | bgp_node_safi (vty), flags); |
| 2895 | } |
| 2896 | |
| 2897 | DEFUN (no_neighbor_attr_unchanged3, |
| 2898 | no_neighbor_attr_unchanged3_cmd, |
| 2899 | NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop (as-path|med)", |
| 2900 | NO_STR |
| 2901 | NEIGHBOR_STR |
| 2902 | NEIGHBOR_ADDR_STR2 |
| 2903 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2904 | "Nexthop attribute\n" |
| 2905 | "As-path attribute\n" |
| 2906 | "Med attribute\n") |
| 2907 | { |
| 2908 | u_int16_t flags = PEER_FLAG_NEXTHOP_UNCHANGED; |
| 2909 | |
| 2910 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2911 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2912 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2913 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2914 | |
| 2915 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2916 | bgp_node_safi (vty), flags); |
| 2917 | } |
| 2918 | |
| 2919 | DEFUN (no_neighbor_attr_unchanged4, |
| 2920 | no_neighbor_attr_unchanged4_cmd, |
| 2921 | NO_NEIGHBOR_CMD2 "attribute-unchanged med (as-path|next-hop)", |
| 2922 | NO_STR |
| 2923 | NEIGHBOR_STR |
| 2924 | NEIGHBOR_ADDR_STR2 |
| 2925 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2926 | "Med attribute\n" |
| 2927 | "As-path attribute\n" |
| 2928 | "Nexthop attribute\n") |
| 2929 | { |
| 2930 | u_int16_t flags = PEER_FLAG_MED_UNCHANGED; |
| 2931 | |
| 2932 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2933 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2934 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2935 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2936 | |
| 2937 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2938 | bgp_node_safi (vty), flags); |
| 2939 | } |
| 2940 | |
| 2941 | ALIAS (no_neighbor_attr_unchanged, |
| 2942 | no_neighbor_attr_unchanged5_cmd, |
| 2943 | NO_NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med", |
| 2944 | NO_STR |
| 2945 | NEIGHBOR_STR |
| 2946 | NEIGHBOR_ADDR_STR2 |
| 2947 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2948 | "As-path attribute\n" |
| 2949 | "Nexthop attribute\n" |
| 2950 | "Med attribute\n") |
| 2951 | |
| 2952 | ALIAS (no_neighbor_attr_unchanged, |
| 2953 | no_neighbor_attr_unchanged6_cmd, |
| 2954 | NO_NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop", |
| 2955 | NO_STR |
| 2956 | NEIGHBOR_STR |
| 2957 | NEIGHBOR_ADDR_STR2 |
| 2958 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2959 | "As-path attribute\n" |
| 2960 | "Med attribute\n" |
| 2961 | "Nexthop attribute\n") |
| 2962 | |
| 2963 | ALIAS (no_neighbor_attr_unchanged, |
| 2964 | no_neighbor_attr_unchanged7_cmd, |
| 2965 | NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path", |
| 2966 | NO_STR |
| 2967 | NEIGHBOR_STR |
| 2968 | NEIGHBOR_ADDR_STR2 |
| 2969 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2970 | "Nexthop attribute\n" |
| 2971 | "Med attribute\n" |
| 2972 | "As-path attribute\n") |
| 2973 | |
| 2974 | ALIAS (no_neighbor_attr_unchanged, |
| 2975 | no_neighbor_attr_unchanged8_cmd, |
| 2976 | NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med", |
| 2977 | NO_STR |
| 2978 | NEIGHBOR_STR |
| 2979 | NEIGHBOR_ADDR_STR2 |
| 2980 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2981 | "Nexthop attribute\n" |
| 2982 | "As-path attribute\n" |
| 2983 | "Med attribute\n") |
| 2984 | |
| 2985 | ALIAS (no_neighbor_attr_unchanged, |
| 2986 | no_neighbor_attr_unchanged9_cmd, |
| 2987 | NO_NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path", |
| 2988 | NO_STR |
| 2989 | NEIGHBOR_STR |
| 2990 | NEIGHBOR_ADDR_STR2 |
| 2991 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2992 | "Med attribute\n" |
| 2993 | "Nexthop attribute\n" |
| 2994 | "As-path attribute\n") |
| 2995 | |
| 2996 | ALIAS (no_neighbor_attr_unchanged, |
| 2997 | no_neighbor_attr_unchanged10_cmd, |
| 2998 | NO_NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop", |
| 2999 | NO_STR |
| 3000 | NEIGHBOR_STR |
| 3001 | NEIGHBOR_ADDR_STR2 |
| 3002 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 3003 | "Med attribute\n" |
| 3004 | "As-path attribute\n" |
| 3005 | "Nexthop attribute\n") |
| 3006 | |
| 3007 | /* For old version Zebra compatibility. */ |
hasso | dd4c593 | 2005-02-02 17:15:34 +0000 | [diff] [blame] | 3008 | DEFUN_DEPRECATED (neighbor_transparent_as, |
| 3009 | neighbor_transparent_as_cmd, |
| 3010 | NEIGHBOR_CMD "transparent-as", |
| 3011 | NEIGHBOR_STR |
| 3012 | NEIGHBOR_ADDR_STR |
| 3013 | "Do not append my AS number even peer is EBGP peer\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3014 | { |
| 3015 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3016 | bgp_node_safi (vty), |
| 3017 | PEER_FLAG_AS_PATH_UNCHANGED); |
| 3018 | } |
| 3019 | |
hasso | dd4c593 | 2005-02-02 17:15:34 +0000 | [diff] [blame] | 3020 | DEFUN_DEPRECATED (neighbor_transparent_nexthop, |
| 3021 | neighbor_transparent_nexthop_cmd, |
| 3022 | NEIGHBOR_CMD "transparent-nexthop", |
| 3023 | NEIGHBOR_STR |
| 3024 | NEIGHBOR_ADDR_STR |
| 3025 | "Do not change nexthop even peer is EBGP peer\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3026 | { |
| 3027 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3028 | bgp_node_safi (vty), |
| 3029 | PEER_FLAG_NEXTHOP_UNCHANGED); |
| 3030 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3031 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3032 | /* EBGP multihop configuration. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3033 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3034 | peer_ebgp_multihop_set_vty (struct vty *vty, const char *ip_str, |
| 3035 | const char *ttl_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3036 | { |
| 3037 | struct peer *peer; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3038 | unsigned int ttl; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3039 | |
| 3040 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3041 | if (! peer) |
| 3042 | return CMD_WARNING; |
| 3043 | |
| 3044 | if (! ttl_str) |
| 3045 | ttl = TTL_MAX; |
| 3046 | else |
| 3047 | VTY_GET_INTEGER_RANGE ("TTL", ttl, ttl_str, 1, 255); |
| 3048 | |
Stephen Hemminger | 89b6d1f | 2011-03-24 10:51:59 +0000 | [diff] [blame] | 3049 | return bgp_vty_return (vty, peer_ebgp_multihop_set (peer, ttl)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3050 | } |
| 3051 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3052 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3053 | peer_ebgp_multihop_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3054 | { |
| 3055 | struct peer *peer; |
| 3056 | |
| 3057 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3058 | if (! peer) |
| 3059 | return CMD_WARNING; |
| 3060 | |
Stephen Hemminger | 89b6d1f | 2011-03-24 10:51:59 +0000 | [diff] [blame] | 3061 | return bgp_vty_return (vty, peer_ebgp_multihop_unset (peer)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3062 | } |
| 3063 | |
| 3064 | /* neighbor ebgp-multihop. */ |
| 3065 | DEFUN (neighbor_ebgp_multihop, |
| 3066 | neighbor_ebgp_multihop_cmd, |
| 3067 | NEIGHBOR_CMD2 "ebgp-multihop", |
| 3068 | NEIGHBOR_STR |
| 3069 | NEIGHBOR_ADDR_STR2 |
| 3070 | "Allow EBGP neighbors not on directly connected networks\n") |
| 3071 | { |
| 3072 | return peer_ebgp_multihop_set_vty (vty, argv[0], NULL); |
| 3073 | } |
| 3074 | |
| 3075 | DEFUN (neighbor_ebgp_multihop_ttl, |
| 3076 | neighbor_ebgp_multihop_ttl_cmd, |
| 3077 | NEIGHBOR_CMD2 "ebgp-multihop <1-255>", |
| 3078 | NEIGHBOR_STR |
| 3079 | NEIGHBOR_ADDR_STR2 |
| 3080 | "Allow EBGP neighbors not on directly connected networks\n" |
| 3081 | "maximum hop count\n") |
| 3082 | { |
| 3083 | return peer_ebgp_multihop_set_vty (vty, argv[0], argv[1]); |
| 3084 | } |
| 3085 | |
| 3086 | DEFUN (no_neighbor_ebgp_multihop, |
| 3087 | no_neighbor_ebgp_multihop_cmd, |
| 3088 | NO_NEIGHBOR_CMD2 "ebgp-multihop", |
| 3089 | NO_STR |
| 3090 | NEIGHBOR_STR |
| 3091 | NEIGHBOR_ADDR_STR2 |
| 3092 | "Allow EBGP neighbors not on directly connected networks\n") |
| 3093 | { |
| 3094 | return peer_ebgp_multihop_unset_vty (vty, argv[0]); |
| 3095 | } |
| 3096 | |
| 3097 | ALIAS (no_neighbor_ebgp_multihop, |
| 3098 | no_neighbor_ebgp_multihop_ttl_cmd, |
| 3099 | NO_NEIGHBOR_CMD2 "ebgp-multihop <1-255>", |
| 3100 | NO_STR |
| 3101 | NEIGHBOR_STR |
| 3102 | NEIGHBOR_ADDR_STR2 |
| 3103 | "Allow EBGP neighbors not on directly connected networks\n" |
| 3104 | "maximum hop count\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3105 | |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 3106 | /* disable-connected-check */ |
| 3107 | DEFUN (neighbor_disable_connected_check, |
| 3108 | neighbor_disable_connected_check_cmd, |
| 3109 | NEIGHBOR_CMD2 "disable-connected-check", |
| 3110 | NEIGHBOR_STR |
| 3111 | NEIGHBOR_ADDR_STR2 |
| 3112 | "one-hop away EBGP peer using loopback address\n") |
| 3113 | { |
| 3114 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DISABLE_CONNECTED_CHECK); |
| 3115 | } |
| 3116 | |
| 3117 | DEFUN (no_neighbor_disable_connected_check, |
| 3118 | no_neighbor_disable_connected_check_cmd, |
| 3119 | NO_NEIGHBOR_CMD2 "disable-connected-check", |
| 3120 | NO_STR |
| 3121 | NEIGHBOR_STR |
| 3122 | NEIGHBOR_ADDR_STR2 |
| 3123 | "one-hop away EBGP peer using loopback address\n") |
| 3124 | { |
| 3125 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DISABLE_CONNECTED_CHECK); |
| 3126 | } |
| 3127 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3128 | /* Enforce multihop. */ |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 3129 | ALIAS (neighbor_disable_connected_check, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3130 | neighbor_enforce_multihop_cmd, |
| 3131 | NEIGHBOR_CMD2 "enforce-multihop", |
| 3132 | NEIGHBOR_STR |
| 3133 | NEIGHBOR_ADDR_STR2 |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 3134 | "Enforce EBGP neighbors perform multihop\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3135 | |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 3136 | /* Enforce multihop. */ |
| 3137 | ALIAS (no_neighbor_disable_connected_check, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3138 | no_neighbor_enforce_multihop_cmd, |
| 3139 | NO_NEIGHBOR_CMD2 "enforce-multihop", |
| 3140 | NO_STR |
| 3141 | NEIGHBOR_STR |
| 3142 | NEIGHBOR_ADDR_STR2 |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 3143 | "Enforce EBGP neighbors perform multihop\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3144 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3145 | DEFUN (neighbor_description, |
| 3146 | neighbor_description_cmd, |
| 3147 | NEIGHBOR_CMD2 "description .LINE", |
| 3148 | NEIGHBOR_STR |
| 3149 | NEIGHBOR_ADDR_STR2 |
| 3150 | "Neighbor specific description\n" |
| 3151 | "Up to 80 characters describing this neighbor\n") |
| 3152 | { |
| 3153 | struct peer *peer; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3154 | char *str; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3155 | |
| 3156 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 3157 | if (! peer) |
| 3158 | return CMD_WARNING; |
| 3159 | |
| 3160 | if (argc == 1) |
| 3161 | return CMD_SUCCESS; |
| 3162 | |
ajs | 3b8b185 | 2005-01-29 18:19:13 +0000 | [diff] [blame] | 3163 | str = argv_concat(argv, argc, 1); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3164 | |
| 3165 | peer_description_set (peer, str); |
| 3166 | |
ajs | 3b8b185 | 2005-01-29 18:19:13 +0000 | [diff] [blame] | 3167 | XFREE (MTYPE_TMP, str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3168 | |
| 3169 | return CMD_SUCCESS; |
| 3170 | } |
| 3171 | |
| 3172 | DEFUN (no_neighbor_description, |
| 3173 | no_neighbor_description_cmd, |
| 3174 | NO_NEIGHBOR_CMD2 "description", |
| 3175 | NO_STR |
| 3176 | NEIGHBOR_STR |
| 3177 | NEIGHBOR_ADDR_STR2 |
| 3178 | "Neighbor specific description\n") |
| 3179 | { |
| 3180 | struct peer *peer; |
| 3181 | |
| 3182 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 3183 | if (! peer) |
| 3184 | return CMD_WARNING; |
| 3185 | |
| 3186 | peer_description_unset (peer); |
| 3187 | |
| 3188 | return CMD_SUCCESS; |
| 3189 | } |
| 3190 | |
| 3191 | ALIAS (no_neighbor_description, |
| 3192 | no_neighbor_description_val_cmd, |
| 3193 | NO_NEIGHBOR_CMD2 "description .LINE", |
| 3194 | NO_STR |
| 3195 | NEIGHBOR_STR |
| 3196 | NEIGHBOR_ADDR_STR2 |
| 3197 | "Neighbor specific description\n" |
| 3198 | "Up to 80 characters describing this neighbor\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3199 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3200 | /* Neighbor update-source. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3201 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3202 | peer_update_source_vty (struct vty *vty, const char *peer_str, |
| 3203 | const char *source_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3204 | { |
| 3205 | struct peer *peer; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3206 | |
| 3207 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 3208 | if (! peer) |
| 3209 | return CMD_WARNING; |
| 3210 | |
| 3211 | if (source_str) |
| 3212 | { |
Jorge Boncompte [DTI2] | c63b83f | 2012-04-10 16:57:24 +0200 | [diff] [blame] | 3213 | union sockunion su; |
| 3214 | int ret = str2sockunion (source_str, &su); |
| 3215 | |
| 3216 | if (ret == 0) |
| 3217 | peer_update_source_addr_set (peer, &su); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3218 | else |
| 3219 | peer_update_source_if_set (peer, source_str); |
| 3220 | } |
| 3221 | else |
| 3222 | peer_update_source_unset (peer); |
| 3223 | |
| 3224 | return CMD_SUCCESS; |
| 3225 | } |
| 3226 | |
Paul Jakma | 9a1a331 | 2009-07-27 12:27:55 +0100 | [diff] [blame] | 3227 | #define BGP_UPDATE_SOURCE_STR "(A.B.C.D|X:X::X:X|WORD)" |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 3228 | #define BGP_UPDATE_SOURCE_HELP_STR \ |
| 3229 | "IPv4 address\n" \ |
Paul Jakma | 9a1a331 | 2009-07-27 12:27:55 +0100 | [diff] [blame] | 3230 | "IPv6 address\n" \ |
| 3231 | "Interface name (requires zebra to be running)\n" |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 3232 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3233 | DEFUN (neighbor_update_source, |
| 3234 | neighbor_update_source_cmd, |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 3235 | NEIGHBOR_CMD2 "update-source " BGP_UPDATE_SOURCE_STR, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3236 | NEIGHBOR_STR |
| 3237 | NEIGHBOR_ADDR_STR2 |
| 3238 | "Source of routing updates\n" |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 3239 | BGP_UPDATE_SOURCE_HELP_STR) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3240 | { |
| 3241 | return peer_update_source_vty (vty, argv[0], argv[1]); |
| 3242 | } |
| 3243 | |
| 3244 | DEFUN (no_neighbor_update_source, |
| 3245 | no_neighbor_update_source_cmd, |
| 3246 | NO_NEIGHBOR_CMD2 "update-source", |
| 3247 | NO_STR |
| 3248 | NEIGHBOR_STR |
| 3249 | NEIGHBOR_ADDR_STR2 |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 3250 | "Source of routing updates\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3251 | { |
| 3252 | return peer_update_source_vty (vty, argv[0], NULL); |
| 3253 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3254 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3255 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3256 | peer_default_originate_set_vty (struct vty *vty, const char *peer_str, |
| 3257 | afi_t afi, safi_t safi, |
| 3258 | const char *rmap, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3259 | { |
| 3260 | int ret; |
| 3261 | struct peer *peer; |
| 3262 | |
| 3263 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 3264 | if (! peer) |
| 3265 | return CMD_WARNING; |
| 3266 | |
| 3267 | if (set) |
| 3268 | ret = peer_default_originate_set (peer, afi, safi, rmap); |
| 3269 | else |
| 3270 | ret = peer_default_originate_unset (peer, afi, safi); |
| 3271 | |
| 3272 | return bgp_vty_return (vty, ret); |
| 3273 | } |
| 3274 | |
| 3275 | /* neighbor default-originate. */ |
| 3276 | DEFUN (neighbor_default_originate, |
| 3277 | neighbor_default_originate_cmd, |
| 3278 | NEIGHBOR_CMD2 "default-originate", |
| 3279 | NEIGHBOR_STR |
| 3280 | NEIGHBOR_ADDR_STR2 |
| 3281 | "Originate default route to this neighbor\n") |
| 3282 | { |
| 3283 | return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3284 | bgp_node_safi (vty), NULL, 1); |
| 3285 | } |
| 3286 | |
| 3287 | DEFUN (neighbor_default_originate_rmap, |
| 3288 | neighbor_default_originate_rmap_cmd, |
| 3289 | NEIGHBOR_CMD2 "default-originate route-map WORD", |
| 3290 | NEIGHBOR_STR |
| 3291 | NEIGHBOR_ADDR_STR2 |
| 3292 | "Originate default route to this neighbor\n" |
| 3293 | "Route-map to specify criteria to originate default\n" |
| 3294 | "route-map name\n") |
| 3295 | { |
| 3296 | return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3297 | bgp_node_safi (vty), argv[1], 1); |
| 3298 | } |
| 3299 | |
| 3300 | DEFUN (no_neighbor_default_originate, |
| 3301 | no_neighbor_default_originate_cmd, |
| 3302 | NO_NEIGHBOR_CMD2 "default-originate", |
| 3303 | NO_STR |
| 3304 | NEIGHBOR_STR |
| 3305 | NEIGHBOR_ADDR_STR2 |
| 3306 | "Originate default route to this neighbor\n") |
| 3307 | { |
| 3308 | return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3309 | bgp_node_safi (vty), NULL, 0); |
| 3310 | } |
| 3311 | |
| 3312 | ALIAS (no_neighbor_default_originate, |
| 3313 | no_neighbor_default_originate_rmap_cmd, |
| 3314 | NO_NEIGHBOR_CMD2 "default-originate route-map WORD", |
| 3315 | NO_STR |
| 3316 | NEIGHBOR_STR |
| 3317 | NEIGHBOR_ADDR_STR2 |
| 3318 | "Originate default route to this neighbor\n" |
| 3319 | "Route-map to specify criteria to originate default\n" |
| 3320 | "route-map name\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3321 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3322 | /* Set neighbor's BGP port. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3323 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3324 | peer_port_vty (struct vty *vty, const char *ip_str, int afi, |
| 3325 | const char *port_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3326 | { |
| 3327 | struct peer *peer; |
| 3328 | u_int16_t port; |
| 3329 | struct servent *sp; |
| 3330 | |
| 3331 | peer = peer_lookup_vty (vty, ip_str); |
| 3332 | if (! peer) |
| 3333 | return CMD_WARNING; |
| 3334 | |
| 3335 | if (! port_str) |
| 3336 | { |
| 3337 | sp = getservbyname ("bgp", "tcp"); |
| 3338 | port = (sp == NULL) ? BGP_PORT_DEFAULT : ntohs (sp->s_port); |
| 3339 | } |
| 3340 | else |
| 3341 | { |
| 3342 | VTY_GET_INTEGER("port", port, port_str); |
| 3343 | } |
| 3344 | |
| 3345 | peer_port_set (peer, port); |
| 3346 | |
| 3347 | return CMD_SUCCESS; |
| 3348 | } |
| 3349 | |
hasso | f418446 | 2005-02-01 20:13:16 +0000 | [diff] [blame] | 3350 | /* Set specified peer's BGP port. */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3351 | DEFUN (neighbor_port, |
| 3352 | neighbor_port_cmd, |
| 3353 | NEIGHBOR_CMD "port <0-65535>", |
| 3354 | NEIGHBOR_STR |
| 3355 | NEIGHBOR_ADDR_STR |
| 3356 | "Neighbor's BGP port\n" |
| 3357 | "TCP port number\n") |
| 3358 | { |
| 3359 | return peer_port_vty (vty, argv[0], AFI_IP, argv[1]); |
| 3360 | } |
| 3361 | |
| 3362 | DEFUN (no_neighbor_port, |
| 3363 | no_neighbor_port_cmd, |
| 3364 | NO_NEIGHBOR_CMD "port", |
| 3365 | NO_STR |
| 3366 | NEIGHBOR_STR |
| 3367 | NEIGHBOR_ADDR_STR |
| 3368 | "Neighbor's BGP port\n") |
| 3369 | { |
| 3370 | return peer_port_vty (vty, argv[0], AFI_IP, NULL); |
| 3371 | } |
| 3372 | |
| 3373 | ALIAS (no_neighbor_port, |
| 3374 | no_neighbor_port_val_cmd, |
| 3375 | NO_NEIGHBOR_CMD "port <0-65535>", |
| 3376 | NO_STR |
| 3377 | NEIGHBOR_STR |
| 3378 | NEIGHBOR_ADDR_STR |
| 3379 | "Neighbor's BGP port\n" |
| 3380 | "TCP port number\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3381 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3382 | /* neighbor weight. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3383 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3384 | peer_weight_set_vty (struct vty *vty, const char *ip_str, |
| 3385 | const char *weight_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3386 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3387 | struct peer *peer; |
| 3388 | unsigned long weight; |
| 3389 | |
| 3390 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3391 | if (! peer) |
| 3392 | return CMD_WARNING; |
| 3393 | |
| 3394 | VTY_GET_INTEGER_RANGE("weight", weight, weight_str, 0, 65535); |
| 3395 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3396 | return bgp_vty_return (vty, peer_weight_set (peer, weight)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3397 | } |
| 3398 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3399 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3400 | peer_weight_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3401 | { |
| 3402 | struct peer *peer; |
| 3403 | |
| 3404 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3405 | if (! peer) |
| 3406 | return CMD_WARNING; |
| 3407 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3408 | return bgp_vty_return (vty, peer_weight_unset (peer)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3409 | } |
| 3410 | |
| 3411 | DEFUN (neighbor_weight, |
| 3412 | neighbor_weight_cmd, |
| 3413 | NEIGHBOR_CMD2 "weight <0-65535>", |
| 3414 | NEIGHBOR_STR |
| 3415 | NEIGHBOR_ADDR_STR2 |
| 3416 | "Set default weight for routes from this neighbor\n" |
| 3417 | "default weight\n") |
| 3418 | { |
| 3419 | return peer_weight_set_vty (vty, argv[0], argv[1]); |
| 3420 | } |
| 3421 | |
| 3422 | DEFUN (no_neighbor_weight, |
| 3423 | no_neighbor_weight_cmd, |
| 3424 | NO_NEIGHBOR_CMD2 "weight", |
| 3425 | NO_STR |
| 3426 | NEIGHBOR_STR |
| 3427 | NEIGHBOR_ADDR_STR2 |
| 3428 | "Set default weight for routes from this neighbor\n") |
| 3429 | { |
| 3430 | return peer_weight_unset_vty (vty, argv[0]); |
| 3431 | } |
| 3432 | |
| 3433 | ALIAS (no_neighbor_weight, |
| 3434 | no_neighbor_weight_val_cmd, |
| 3435 | NO_NEIGHBOR_CMD2 "weight <0-65535>", |
| 3436 | NO_STR |
| 3437 | NEIGHBOR_STR |
| 3438 | NEIGHBOR_ADDR_STR2 |
| 3439 | "Set default weight for routes from this neighbor\n" |
| 3440 | "default weight\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3441 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3442 | /* Override capability negotiation. */ |
| 3443 | DEFUN (neighbor_override_capability, |
| 3444 | neighbor_override_capability_cmd, |
| 3445 | NEIGHBOR_CMD2 "override-capability", |
| 3446 | NEIGHBOR_STR |
| 3447 | NEIGHBOR_ADDR_STR2 |
| 3448 | "Override capability negotiation result\n") |
| 3449 | { |
| 3450 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_OVERRIDE_CAPABILITY); |
| 3451 | } |
| 3452 | |
| 3453 | DEFUN (no_neighbor_override_capability, |
| 3454 | no_neighbor_override_capability_cmd, |
| 3455 | NO_NEIGHBOR_CMD2 "override-capability", |
| 3456 | NO_STR |
| 3457 | NEIGHBOR_STR |
| 3458 | NEIGHBOR_ADDR_STR2 |
| 3459 | "Override capability negotiation result\n") |
| 3460 | { |
| 3461 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_OVERRIDE_CAPABILITY); |
| 3462 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3463 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3464 | DEFUN (neighbor_strict_capability, |
| 3465 | neighbor_strict_capability_cmd, |
| 3466 | NEIGHBOR_CMD "strict-capability-match", |
| 3467 | NEIGHBOR_STR |
| 3468 | NEIGHBOR_ADDR_STR |
| 3469 | "Strict capability negotiation match\n") |
| 3470 | { |
| 3471 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_STRICT_CAP_MATCH); |
| 3472 | } |
| 3473 | |
| 3474 | DEFUN (no_neighbor_strict_capability, |
| 3475 | no_neighbor_strict_capability_cmd, |
| 3476 | NO_NEIGHBOR_CMD "strict-capability-match", |
| 3477 | NO_STR |
| 3478 | NEIGHBOR_STR |
| 3479 | NEIGHBOR_ADDR_STR |
| 3480 | "Strict capability negotiation match\n") |
| 3481 | { |
| 3482 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_STRICT_CAP_MATCH); |
| 3483 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3484 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3485 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3486 | peer_timers_set_vty (struct vty *vty, const char *ip_str, |
| 3487 | const char *keep_str, const char *hold_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3488 | { |
| 3489 | int ret; |
| 3490 | struct peer *peer; |
| 3491 | u_int32_t keepalive; |
| 3492 | u_int32_t holdtime; |
| 3493 | |
| 3494 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3495 | if (! peer) |
| 3496 | return CMD_WARNING; |
| 3497 | |
| 3498 | VTY_GET_INTEGER_RANGE ("Keepalive", keepalive, keep_str, 0, 65535); |
| 3499 | VTY_GET_INTEGER_RANGE ("Holdtime", holdtime, hold_str, 0, 65535); |
| 3500 | |
| 3501 | ret = peer_timers_set (peer, keepalive, holdtime); |
| 3502 | |
| 3503 | return bgp_vty_return (vty, ret); |
| 3504 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3505 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3506 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3507 | peer_timers_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3508 | { |
| 3509 | int ret; |
| 3510 | struct peer *peer; |
| 3511 | |
| 3512 | peer = peer_lookup_vty (vty, ip_str); |
| 3513 | if (! peer) |
| 3514 | return CMD_WARNING; |
| 3515 | |
| 3516 | ret = peer_timers_unset (peer); |
| 3517 | |
| 3518 | return bgp_vty_return (vty, ret); |
| 3519 | } |
| 3520 | |
| 3521 | DEFUN (neighbor_timers, |
| 3522 | neighbor_timers_cmd, |
| 3523 | NEIGHBOR_CMD2 "timers <0-65535> <0-65535>", |
| 3524 | NEIGHBOR_STR |
| 3525 | NEIGHBOR_ADDR_STR2 |
| 3526 | "BGP per neighbor timers\n" |
| 3527 | "Keepalive interval\n" |
| 3528 | "Holdtime\n") |
| 3529 | { |
| 3530 | return peer_timers_set_vty (vty, argv[0], argv[1], argv[2]); |
| 3531 | } |
| 3532 | |
| 3533 | DEFUN (no_neighbor_timers, |
| 3534 | no_neighbor_timers_cmd, |
| 3535 | NO_NEIGHBOR_CMD2 "timers", |
| 3536 | NO_STR |
| 3537 | NEIGHBOR_STR |
| 3538 | NEIGHBOR_ADDR_STR2 |
| 3539 | "BGP per neighbor timers\n") |
| 3540 | { |
| 3541 | return peer_timers_unset_vty (vty, argv[0]); |
| 3542 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3543 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3544 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3545 | peer_timers_connect_set_vty (struct vty *vty, const char *ip_str, |
| 3546 | const char *time_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3547 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3548 | struct peer *peer; |
| 3549 | u_int32_t connect; |
| 3550 | |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3551 | peer = peer_and_group_lookup_vty (vty, ip_str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3552 | if (! peer) |
| 3553 | return CMD_WARNING; |
| 3554 | |
| 3555 | VTY_GET_INTEGER_RANGE ("Connect time", connect, time_str, 0, 65535); |
| 3556 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3557 | return bgp_vty_return (vty, peer_timers_connect_set (peer, connect)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3558 | } |
| 3559 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3560 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3561 | peer_timers_connect_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3562 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3563 | struct peer *peer; |
| 3564 | |
| 3565 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3566 | if (! peer) |
| 3567 | return CMD_WARNING; |
| 3568 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3569 | return bgp_vty_return (vty, peer_timers_connect_unset (peer)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3570 | } |
| 3571 | |
| 3572 | DEFUN (neighbor_timers_connect, |
| 3573 | neighbor_timers_connect_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3574 | NEIGHBOR_CMD2 "timers connect <1-65535>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3575 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3576 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3577 | "BGP per neighbor timers\n" |
| 3578 | "BGP connect timer\n" |
| 3579 | "Connect timer\n") |
| 3580 | { |
| 3581 | return peer_timers_connect_set_vty (vty, argv[0], argv[1]); |
| 3582 | } |
| 3583 | |
| 3584 | DEFUN (no_neighbor_timers_connect, |
| 3585 | no_neighbor_timers_connect_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3586 | NO_NEIGHBOR_CMD2 "timers connect", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3587 | NO_STR |
| 3588 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3589 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3590 | "BGP per neighbor timers\n" |
| 3591 | "BGP connect timer\n") |
| 3592 | { |
| 3593 | return peer_timers_connect_unset_vty (vty, argv[0]); |
| 3594 | } |
| 3595 | |
| 3596 | ALIAS (no_neighbor_timers_connect, |
| 3597 | no_neighbor_timers_connect_val_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3598 | NO_NEIGHBOR_CMD2 "timers connect <1-65535>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3599 | NO_STR |
| 3600 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3601 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3602 | "BGP per neighbor timers\n" |
| 3603 | "BGP connect timer\n" |
| 3604 | "Connect timer\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3605 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3606 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3607 | peer_advertise_interval_vty (struct vty *vty, const char *ip_str, |
| 3608 | const char *time_str, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3609 | { |
| 3610 | int ret; |
| 3611 | struct peer *peer; |
| 3612 | u_int32_t routeadv = 0; |
| 3613 | |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3614 | peer = peer_and_group_lookup_vty (vty, ip_str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3615 | if (! peer) |
| 3616 | return CMD_WARNING; |
| 3617 | |
| 3618 | if (time_str) |
| 3619 | VTY_GET_INTEGER_RANGE ("advertise interval", routeadv, time_str, 0, 600); |
| 3620 | |
| 3621 | if (set) |
| 3622 | ret = peer_advertise_interval_set (peer, routeadv); |
| 3623 | else |
| 3624 | ret = peer_advertise_interval_unset (peer); |
| 3625 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3626 | return bgp_vty_return (vty, ret); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3627 | } |
| 3628 | |
| 3629 | DEFUN (neighbor_advertise_interval, |
| 3630 | neighbor_advertise_interval_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3631 | NEIGHBOR_CMD2 "advertisement-interval <0-600>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3632 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3633 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3634 | "Minimum interval between sending BGP routing updates\n" |
| 3635 | "time in seconds\n") |
| 3636 | { |
| 3637 | return peer_advertise_interval_vty (vty, argv[0], argv[1], 1); |
| 3638 | } |
| 3639 | |
| 3640 | DEFUN (no_neighbor_advertise_interval, |
| 3641 | no_neighbor_advertise_interval_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3642 | NO_NEIGHBOR_CMD2 "advertisement-interval", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3643 | NO_STR |
| 3644 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3645 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3646 | "Minimum interval between sending BGP routing updates\n") |
| 3647 | { |
| 3648 | return peer_advertise_interval_vty (vty, argv[0], NULL, 0); |
| 3649 | } |
| 3650 | |
| 3651 | ALIAS (no_neighbor_advertise_interval, |
| 3652 | no_neighbor_advertise_interval_val_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3653 | NO_NEIGHBOR_CMD2 "advertisement-interval <0-600>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3654 | NO_STR |
| 3655 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3656 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3657 | "Minimum interval between sending BGP routing updates\n" |
| 3658 | "time in seconds\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3659 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3660 | /* neighbor interface */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3661 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3662 | peer_interface_vty (struct vty *vty, const char *ip_str, const char *str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3663 | { |
| 3664 | int ret; |
| 3665 | struct peer *peer; |
| 3666 | |
| 3667 | peer = peer_lookup_vty (vty, ip_str); |
| 3668 | if (! peer) |
| 3669 | return CMD_WARNING; |
| 3670 | |
| 3671 | if (str) |
| 3672 | ret = peer_interface_set (peer, str); |
| 3673 | else |
| 3674 | ret = peer_interface_unset (peer); |
| 3675 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3676 | return bgp_vty_return (vty, ret); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3677 | } |
| 3678 | |
| 3679 | DEFUN (neighbor_interface, |
| 3680 | neighbor_interface_cmd, |
| 3681 | NEIGHBOR_CMD "interface WORD", |
| 3682 | NEIGHBOR_STR |
| 3683 | NEIGHBOR_ADDR_STR |
| 3684 | "Interface\n" |
| 3685 | "Interface name\n") |
| 3686 | { |
| 3687 | return peer_interface_vty (vty, argv[0], argv[1]); |
| 3688 | } |
| 3689 | |
| 3690 | DEFUN (no_neighbor_interface, |
| 3691 | no_neighbor_interface_cmd, |
| 3692 | NO_NEIGHBOR_CMD "interface WORD", |
| 3693 | NO_STR |
| 3694 | NEIGHBOR_STR |
| 3695 | NEIGHBOR_ADDR_STR |
| 3696 | "Interface\n" |
| 3697 | "Interface name\n") |
| 3698 | { |
| 3699 | return peer_interface_vty (vty, argv[0], NULL); |
| 3700 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3701 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3702 | /* Set distribute list to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3703 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3704 | peer_distribute_set_vty (struct vty *vty, const char *ip_str, |
| 3705 | afi_t afi, safi_t safi, |
| 3706 | const char *name_str, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3707 | { |
| 3708 | int ret; |
| 3709 | struct peer *peer; |
| 3710 | int direct = FILTER_IN; |
| 3711 | |
| 3712 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3713 | if (! peer) |
| 3714 | return CMD_WARNING; |
| 3715 | |
| 3716 | /* Check filter direction. */ |
| 3717 | if (strncmp (direct_str, "i", 1) == 0) |
| 3718 | direct = FILTER_IN; |
| 3719 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3720 | direct = FILTER_OUT; |
| 3721 | |
| 3722 | ret = peer_distribute_set (peer, afi, safi, direct, name_str); |
| 3723 | |
| 3724 | return bgp_vty_return (vty, ret); |
| 3725 | } |
| 3726 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3727 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3728 | peer_distribute_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3729 | safi_t safi, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3730 | { |
| 3731 | int ret; |
| 3732 | struct peer *peer; |
| 3733 | int direct = FILTER_IN; |
| 3734 | |
| 3735 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3736 | if (! peer) |
| 3737 | return CMD_WARNING; |
| 3738 | |
| 3739 | /* Check filter direction. */ |
| 3740 | if (strncmp (direct_str, "i", 1) == 0) |
| 3741 | direct = FILTER_IN; |
| 3742 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3743 | direct = FILTER_OUT; |
| 3744 | |
| 3745 | ret = peer_distribute_unset (peer, afi, safi, direct); |
| 3746 | |
| 3747 | return bgp_vty_return (vty, ret); |
| 3748 | } |
| 3749 | |
| 3750 | DEFUN (neighbor_distribute_list, |
| 3751 | neighbor_distribute_list_cmd, |
| 3752 | NEIGHBOR_CMD2 "distribute-list (<1-199>|<1300-2699>|WORD) (in|out)", |
| 3753 | NEIGHBOR_STR |
| 3754 | NEIGHBOR_ADDR_STR2 |
| 3755 | "Filter updates to/from this neighbor\n" |
| 3756 | "IP access-list number\n" |
| 3757 | "IP access-list number (expanded range)\n" |
| 3758 | "IP Access-list name\n" |
| 3759 | "Filter incoming updates\n" |
| 3760 | "Filter outgoing updates\n") |
| 3761 | { |
| 3762 | return peer_distribute_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3763 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3764 | } |
| 3765 | |
| 3766 | DEFUN (no_neighbor_distribute_list, |
| 3767 | no_neighbor_distribute_list_cmd, |
| 3768 | NO_NEIGHBOR_CMD2 "distribute-list (<1-199>|<1300-2699>|WORD) (in|out)", |
| 3769 | NO_STR |
| 3770 | NEIGHBOR_STR |
| 3771 | NEIGHBOR_ADDR_STR2 |
| 3772 | "Filter updates to/from this neighbor\n" |
| 3773 | "IP access-list number\n" |
| 3774 | "IP access-list number (expanded range)\n" |
| 3775 | "IP Access-list name\n" |
| 3776 | "Filter incoming updates\n" |
| 3777 | "Filter outgoing updates\n") |
| 3778 | { |
| 3779 | return peer_distribute_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3780 | bgp_node_safi (vty), argv[2]); |
| 3781 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3782 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3783 | /* Set prefix list to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3784 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3785 | peer_prefix_list_set_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3786 | safi_t safi, const char *name_str, |
| 3787 | const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3788 | { |
| 3789 | int ret; |
| 3790 | struct peer *peer; |
| 3791 | int direct = FILTER_IN; |
| 3792 | |
| 3793 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3794 | if (! peer) |
| 3795 | return CMD_WARNING; |
| 3796 | |
| 3797 | /* Check filter direction. */ |
| 3798 | if (strncmp (direct_str, "i", 1) == 0) |
| 3799 | direct = FILTER_IN; |
| 3800 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3801 | direct = FILTER_OUT; |
| 3802 | |
| 3803 | ret = peer_prefix_list_set (peer, afi, safi, direct, name_str); |
| 3804 | |
| 3805 | return bgp_vty_return (vty, ret); |
| 3806 | } |
| 3807 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3808 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3809 | peer_prefix_list_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3810 | safi_t safi, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3811 | { |
| 3812 | int ret; |
| 3813 | struct peer *peer; |
| 3814 | int direct = FILTER_IN; |
| 3815 | |
| 3816 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3817 | if (! peer) |
| 3818 | return CMD_WARNING; |
| 3819 | |
| 3820 | /* Check filter direction. */ |
| 3821 | if (strncmp (direct_str, "i", 1) == 0) |
| 3822 | direct = FILTER_IN; |
| 3823 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3824 | direct = FILTER_OUT; |
| 3825 | |
| 3826 | ret = peer_prefix_list_unset (peer, afi, safi, direct); |
| 3827 | |
| 3828 | return bgp_vty_return (vty, ret); |
| 3829 | } |
| 3830 | |
| 3831 | DEFUN (neighbor_prefix_list, |
| 3832 | neighbor_prefix_list_cmd, |
| 3833 | NEIGHBOR_CMD2 "prefix-list WORD (in|out)", |
| 3834 | NEIGHBOR_STR |
| 3835 | NEIGHBOR_ADDR_STR2 |
| 3836 | "Filter updates to/from this neighbor\n" |
| 3837 | "Name of a prefix list\n" |
| 3838 | "Filter incoming updates\n" |
| 3839 | "Filter outgoing updates\n") |
| 3840 | { |
| 3841 | return peer_prefix_list_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3842 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3843 | } |
| 3844 | |
| 3845 | DEFUN (no_neighbor_prefix_list, |
| 3846 | no_neighbor_prefix_list_cmd, |
| 3847 | NO_NEIGHBOR_CMD2 "prefix-list WORD (in|out)", |
| 3848 | NO_STR |
| 3849 | NEIGHBOR_STR |
| 3850 | NEIGHBOR_ADDR_STR2 |
| 3851 | "Filter updates to/from this neighbor\n" |
| 3852 | "Name of a prefix list\n" |
| 3853 | "Filter incoming updates\n" |
| 3854 | "Filter outgoing updates\n") |
| 3855 | { |
| 3856 | return peer_prefix_list_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3857 | bgp_node_safi (vty), argv[2]); |
| 3858 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3859 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3860 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3861 | peer_aslist_set_vty (struct vty *vty, const char *ip_str, |
| 3862 | afi_t afi, safi_t safi, |
| 3863 | const char *name_str, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3864 | { |
| 3865 | int ret; |
| 3866 | struct peer *peer; |
| 3867 | int direct = FILTER_IN; |
| 3868 | |
| 3869 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3870 | if (! peer) |
| 3871 | return CMD_WARNING; |
| 3872 | |
| 3873 | /* Check filter direction. */ |
| 3874 | if (strncmp (direct_str, "i", 1) == 0) |
| 3875 | direct = FILTER_IN; |
| 3876 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3877 | direct = FILTER_OUT; |
| 3878 | |
| 3879 | ret = peer_aslist_set (peer, afi, safi, direct, name_str); |
| 3880 | |
| 3881 | return bgp_vty_return (vty, ret); |
| 3882 | } |
| 3883 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3884 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3885 | peer_aslist_unset_vty (struct vty *vty, const char *ip_str, |
| 3886 | afi_t afi, safi_t safi, |
| 3887 | const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3888 | { |
| 3889 | int ret; |
| 3890 | struct peer *peer; |
| 3891 | int direct = FILTER_IN; |
| 3892 | |
| 3893 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3894 | if (! peer) |
| 3895 | return CMD_WARNING; |
| 3896 | |
| 3897 | /* Check filter direction. */ |
| 3898 | if (strncmp (direct_str, "i", 1) == 0) |
| 3899 | direct = FILTER_IN; |
| 3900 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3901 | direct = FILTER_OUT; |
| 3902 | |
| 3903 | ret = peer_aslist_unset (peer, afi, safi, direct); |
| 3904 | |
| 3905 | return bgp_vty_return (vty, ret); |
| 3906 | } |
| 3907 | |
| 3908 | DEFUN (neighbor_filter_list, |
| 3909 | neighbor_filter_list_cmd, |
| 3910 | NEIGHBOR_CMD2 "filter-list WORD (in|out)", |
| 3911 | NEIGHBOR_STR |
| 3912 | NEIGHBOR_ADDR_STR2 |
| 3913 | "Establish BGP filters\n" |
| 3914 | "AS path access-list name\n" |
| 3915 | "Filter incoming routes\n" |
| 3916 | "Filter outgoing routes\n") |
| 3917 | { |
| 3918 | return peer_aslist_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3919 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3920 | } |
| 3921 | |
| 3922 | DEFUN (no_neighbor_filter_list, |
| 3923 | no_neighbor_filter_list_cmd, |
| 3924 | NO_NEIGHBOR_CMD2 "filter-list WORD (in|out)", |
| 3925 | NO_STR |
| 3926 | NEIGHBOR_STR |
| 3927 | NEIGHBOR_ADDR_STR2 |
| 3928 | "Establish BGP filters\n" |
| 3929 | "AS path access-list name\n" |
| 3930 | "Filter incoming routes\n" |
| 3931 | "Filter outgoing routes\n") |
| 3932 | { |
| 3933 | return peer_aslist_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3934 | bgp_node_safi (vty), argv[2]); |
| 3935 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3936 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3937 | /* Set route-map to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3938 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3939 | peer_route_map_set_vty (struct vty *vty, const char *ip_str, |
| 3940 | afi_t afi, safi_t safi, |
| 3941 | const char *name_str, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3942 | { |
| 3943 | int ret; |
| 3944 | struct peer *peer; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3945 | int direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3946 | |
| 3947 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3948 | if (! peer) |
| 3949 | return CMD_WARNING; |
| 3950 | |
| 3951 | /* Check filter direction. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3952 | if (strncmp (direct_str, "in", 2) == 0) |
| 3953 | direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3954 | else if (strncmp (direct_str, "o", 1) == 0) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3955 | direct = RMAP_OUT; |
| 3956 | else if (strncmp (direct_str, "im", 2) == 0) |
| 3957 | direct = RMAP_IMPORT; |
| 3958 | else if (strncmp (direct_str, "e", 1) == 0) |
| 3959 | direct = RMAP_EXPORT; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3960 | |
| 3961 | ret = peer_route_map_set (peer, afi, safi, direct, name_str); |
| 3962 | |
| 3963 | return bgp_vty_return (vty, ret); |
| 3964 | } |
| 3965 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3966 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3967 | peer_route_map_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3968 | safi_t safi, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3969 | { |
| 3970 | int ret; |
| 3971 | struct peer *peer; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3972 | int direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3973 | |
| 3974 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3975 | if (! peer) |
| 3976 | return CMD_WARNING; |
| 3977 | |
| 3978 | /* Check filter direction. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3979 | if (strncmp (direct_str, "in", 2) == 0) |
| 3980 | direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3981 | else if (strncmp (direct_str, "o", 1) == 0) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3982 | direct = RMAP_OUT; |
| 3983 | else if (strncmp (direct_str, "im", 2) == 0) |
| 3984 | direct = RMAP_IMPORT; |
| 3985 | else if (strncmp (direct_str, "e", 1) == 0) |
| 3986 | direct = RMAP_EXPORT; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3987 | |
| 3988 | ret = peer_route_map_unset (peer, afi, safi, direct); |
| 3989 | |
| 3990 | return bgp_vty_return (vty, ret); |
| 3991 | } |
| 3992 | |
| 3993 | DEFUN (neighbor_route_map, |
| 3994 | neighbor_route_map_cmd, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3995 | NEIGHBOR_CMD2 "route-map WORD (in|out|import|export)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3996 | NEIGHBOR_STR |
| 3997 | NEIGHBOR_ADDR_STR2 |
| 3998 | "Apply route map to neighbor\n" |
| 3999 | "Name of route map\n" |
| 4000 | "Apply map to incoming routes\n" |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 4001 | "Apply map to outbound routes\n" |
| 4002 | "Apply map to routes going into a Route-Server client's table\n" |
| 4003 | "Apply map to routes coming from a Route-Server client") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4004 | { |
| 4005 | return peer_route_map_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 4006 | bgp_node_safi (vty), argv[1], argv[2]); |
| 4007 | } |
| 4008 | |
| 4009 | DEFUN (no_neighbor_route_map, |
| 4010 | no_neighbor_route_map_cmd, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 4011 | NO_NEIGHBOR_CMD2 "route-map WORD (in|out|import|export)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4012 | NO_STR |
| 4013 | NEIGHBOR_STR |
| 4014 | NEIGHBOR_ADDR_STR2 |
| 4015 | "Apply route map to neighbor\n" |
| 4016 | "Name of route map\n" |
| 4017 | "Apply map to incoming routes\n" |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 4018 | "Apply map to outbound routes\n" |
| 4019 | "Apply map to routes going into a Route-Server client's table\n" |
| 4020 | "Apply map to routes coming from a Route-Server client") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4021 | { |
| 4022 | return peer_route_map_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 4023 | bgp_node_safi (vty), argv[2]); |
| 4024 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4025 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4026 | /* Set unsuppress-map to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4027 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4028 | peer_unsuppress_map_set_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 4029 | safi_t safi, const char *name_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4030 | { |
| 4031 | int ret; |
| 4032 | struct peer *peer; |
| 4033 | |
| 4034 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 4035 | if (! peer) |
| 4036 | return CMD_WARNING; |
| 4037 | |
| 4038 | ret = peer_unsuppress_map_set (peer, afi, safi, name_str); |
| 4039 | |
| 4040 | return bgp_vty_return (vty, ret); |
| 4041 | } |
| 4042 | |
| 4043 | /* Unset route-map from the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4044 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4045 | peer_unsuppress_map_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4046 | safi_t safi) |
| 4047 | { |
| 4048 | int ret; |
| 4049 | struct peer *peer; |
| 4050 | |
| 4051 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 4052 | if (! peer) |
| 4053 | return CMD_WARNING; |
| 4054 | |
| 4055 | ret = peer_unsuppress_map_unset (peer, afi, safi); |
| 4056 | |
| 4057 | return bgp_vty_return (vty, ret); |
| 4058 | } |
| 4059 | |
| 4060 | DEFUN (neighbor_unsuppress_map, |
| 4061 | neighbor_unsuppress_map_cmd, |
| 4062 | NEIGHBOR_CMD2 "unsuppress-map WORD", |
| 4063 | NEIGHBOR_STR |
| 4064 | NEIGHBOR_ADDR_STR2 |
| 4065 | "Route-map to selectively unsuppress suppressed routes\n" |
| 4066 | "Name of route map\n") |
| 4067 | { |
| 4068 | return peer_unsuppress_map_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 4069 | bgp_node_safi (vty), argv[1]); |
| 4070 | } |
| 4071 | |
| 4072 | DEFUN (no_neighbor_unsuppress_map, |
| 4073 | no_neighbor_unsuppress_map_cmd, |
| 4074 | NO_NEIGHBOR_CMD2 "unsuppress-map WORD", |
| 4075 | NO_STR |
| 4076 | NEIGHBOR_STR |
| 4077 | NEIGHBOR_ADDR_STR2 |
| 4078 | "Route-map to selectively unsuppress suppressed routes\n" |
| 4079 | "Name of route map\n") |
| 4080 | { |
| 4081 | return peer_unsuppress_map_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 4082 | bgp_node_safi (vty)); |
| 4083 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4084 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4085 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4086 | peer_maximum_prefix_set_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 4087 | safi_t safi, const char *num_str, |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4088 | const char *threshold_str, int warning, |
| 4089 | const char *restart_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4090 | { |
| 4091 | int ret; |
| 4092 | struct peer *peer; |
| 4093 | u_int32_t max; |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4094 | u_char threshold; |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4095 | u_int16_t restart; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4096 | |
| 4097 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 4098 | if (! peer) |
| 4099 | return CMD_WARNING; |
| 4100 | |
Denis Ovsienko | e6ec1c3 | 2011-09-10 21:50:53 +0400 | [diff] [blame] | 4101 | VTY_GET_INTEGER ("maximum number", max, num_str); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4102 | if (threshold_str) |
| 4103 | threshold = atoi (threshold_str); |
| 4104 | else |
| 4105 | threshold = MAXIMUM_PREFIX_THRESHOLD_DEFAULT; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4106 | |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4107 | if (restart_str) |
| 4108 | restart = atoi (restart_str); |
| 4109 | else |
| 4110 | restart = 0; |
| 4111 | |
| 4112 | ret = peer_maximum_prefix_set (peer, afi, safi, max, threshold, warning, restart); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4113 | |
| 4114 | return bgp_vty_return (vty, ret); |
| 4115 | } |
| 4116 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4117 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4118 | peer_maximum_prefix_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4119 | safi_t safi) |
| 4120 | { |
| 4121 | int ret; |
| 4122 | struct peer *peer; |
| 4123 | |
| 4124 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 4125 | if (! peer) |
| 4126 | return CMD_WARNING; |
| 4127 | |
| 4128 | ret = peer_maximum_prefix_unset (peer, afi, safi); |
| 4129 | |
| 4130 | return bgp_vty_return (vty, ret); |
| 4131 | } |
| 4132 | |
| 4133 | /* Maximum number of prefix configuration. prefix count is different |
| 4134 | for each peer configuration. So this configuration can be set for |
| 4135 | each peer configuration. */ |
| 4136 | DEFUN (neighbor_maximum_prefix, |
| 4137 | neighbor_maximum_prefix_cmd, |
| 4138 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295>", |
| 4139 | NEIGHBOR_STR |
| 4140 | NEIGHBOR_ADDR_STR2 |
| 4141 | "Maximum number of prefix accept from this peer\n" |
| 4142 | "maximum no. of prefix limit\n") |
| 4143 | { |
| 4144 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4145 | bgp_node_safi (vty), argv[1], NULL, 0, |
| 4146 | NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4147 | } |
| 4148 | |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4149 | DEFUN (neighbor_maximum_prefix_threshold, |
| 4150 | neighbor_maximum_prefix_threshold_cmd, |
| 4151 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100>", |
| 4152 | NEIGHBOR_STR |
| 4153 | NEIGHBOR_ADDR_STR2 |
| 4154 | "Maximum number of prefix accept from this peer\n" |
| 4155 | "maximum no. of prefix limit\n" |
| 4156 | "Threshold value (%) at which to generate a warning msg\n") |
| 4157 | { |
| 4158 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4159 | bgp_node_safi (vty), argv[1], argv[2], 0, |
| 4160 | NULL); |
| 4161 | } |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4162 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4163 | DEFUN (neighbor_maximum_prefix_warning, |
| 4164 | neighbor_maximum_prefix_warning_cmd, |
| 4165 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only", |
| 4166 | NEIGHBOR_STR |
| 4167 | NEIGHBOR_ADDR_STR2 |
| 4168 | "Maximum number of prefix accept from this peer\n" |
| 4169 | "maximum no. of prefix limit\n" |
| 4170 | "Only give warning message when limit is exceeded\n") |
| 4171 | { |
| 4172 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4173 | bgp_node_safi (vty), argv[1], NULL, 1, |
| 4174 | NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4175 | } |
| 4176 | |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4177 | DEFUN (neighbor_maximum_prefix_threshold_warning, |
| 4178 | neighbor_maximum_prefix_threshold_warning_cmd, |
| 4179 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> warning-only", |
| 4180 | NEIGHBOR_STR |
| 4181 | NEIGHBOR_ADDR_STR2 |
| 4182 | "Maximum number of prefix accept from this peer\n" |
| 4183 | "maximum no. of prefix limit\n" |
| 4184 | "Threshold value (%) at which to generate a warning msg\n" |
| 4185 | "Only give warning message when limit is exceeded\n") |
| 4186 | { |
| 4187 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4188 | bgp_node_safi (vty), argv[1], argv[2], 1, NULL); |
| 4189 | } |
| 4190 | |
| 4191 | DEFUN (neighbor_maximum_prefix_restart, |
| 4192 | neighbor_maximum_prefix_restart_cmd, |
| 4193 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> restart <1-65535>", |
| 4194 | NEIGHBOR_STR |
| 4195 | NEIGHBOR_ADDR_STR2 |
| 4196 | "Maximum number of prefix accept from this peer\n" |
| 4197 | "maximum no. of prefix limit\n" |
| 4198 | "Restart bgp connection after limit is exceeded\n" |
| 4199 | "Restart interval in minutes") |
| 4200 | { |
| 4201 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 4202 | bgp_node_safi (vty), argv[1], NULL, 0, argv[2]); |
| 4203 | } |
| 4204 | |
| 4205 | DEFUN (neighbor_maximum_prefix_threshold_restart, |
| 4206 | neighbor_maximum_prefix_threshold_restart_cmd, |
| 4207 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> restart <1-65535>", |
| 4208 | NEIGHBOR_STR |
| 4209 | NEIGHBOR_ADDR_STR2 |
| 4210 | "Maximum number of prefix accept from this peer\n" |
| 4211 | "maximum no. of prefix limit\n" |
| 4212 | "Threshold value (%) at which to generate a warning msg\n" |
| 4213 | "Restart bgp connection after limit is exceeded\n" |
| 4214 | "Restart interval in minutes") |
| 4215 | { |
| 4216 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 4217 | bgp_node_safi (vty), argv[1], argv[2], 0, argv[3]); |
| 4218 | } |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4219 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4220 | DEFUN (no_neighbor_maximum_prefix, |
| 4221 | no_neighbor_maximum_prefix_cmd, |
| 4222 | NO_NEIGHBOR_CMD2 "maximum-prefix", |
| 4223 | NO_STR |
| 4224 | NEIGHBOR_STR |
| 4225 | NEIGHBOR_ADDR_STR2 |
| 4226 | "Maximum number of prefix accept from this peer\n") |
| 4227 | { |
| 4228 | return peer_maximum_prefix_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 4229 | bgp_node_safi (vty)); |
| 4230 | } |
| 4231 | |
| 4232 | ALIAS (no_neighbor_maximum_prefix, |
| 4233 | no_neighbor_maximum_prefix_val_cmd, |
| 4234 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295>", |
| 4235 | NO_STR |
| 4236 | NEIGHBOR_STR |
| 4237 | NEIGHBOR_ADDR_STR2 |
| 4238 | "Maximum number of prefix accept from this peer\n" |
| 4239 | "maximum no. of prefix limit\n") |
| 4240 | |
| 4241 | ALIAS (no_neighbor_maximum_prefix, |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4242 | no_neighbor_maximum_prefix_threshold_cmd, |
| 4243 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only", |
| 4244 | NO_STR |
| 4245 | NEIGHBOR_STR |
| 4246 | NEIGHBOR_ADDR_STR2 |
| 4247 | "Maximum number of prefix accept from this peer\n" |
| 4248 | "maximum no. of prefix limit\n" |
| 4249 | "Threshold value (%) at which to generate a warning msg\n") |
| 4250 | |
| 4251 | ALIAS (no_neighbor_maximum_prefix, |
| 4252 | no_neighbor_maximum_prefix_warning_cmd, |
| 4253 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only", |
| 4254 | NO_STR |
| 4255 | NEIGHBOR_STR |
| 4256 | NEIGHBOR_ADDR_STR2 |
| 4257 | "Maximum number of prefix accept from this peer\n" |
| 4258 | "maximum no. of prefix limit\n" |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 4259 | "Only give warning message when limit is exceeded\n") |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4260 | |
| 4261 | ALIAS (no_neighbor_maximum_prefix, |
| 4262 | no_neighbor_maximum_prefix_threshold_warning_cmd, |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4263 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> warning-only", |
| 4264 | NO_STR |
| 4265 | NEIGHBOR_STR |
| 4266 | NEIGHBOR_ADDR_STR2 |
| 4267 | "Maximum number of prefix accept from this peer\n" |
| 4268 | "maximum no. of prefix limit\n" |
| 4269 | "Threshold value (%) at which to generate a warning msg\n" |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 4270 | "Only give warning message when limit is exceeded\n") |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4271 | |
| 4272 | ALIAS (no_neighbor_maximum_prefix, |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4273 | no_neighbor_maximum_prefix_restart_cmd, |
| 4274 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> restart <1-65535>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4275 | NO_STR |
| 4276 | NEIGHBOR_STR |
| 4277 | NEIGHBOR_ADDR_STR2 |
| 4278 | "Maximum number of prefix accept from this peer\n" |
| 4279 | "maximum no. of prefix limit\n" |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4280 | "Restart bgp connection after limit is exceeded\n" |
| 4281 | "Restart interval in minutes") |
| 4282 | |
| 4283 | ALIAS (no_neighbor_maximum_prefix, |
| 4284 | no_neighbor_maximum_prefix_threshold_restart_cmd, |
| 4285 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> restart <1-65535>", |
| 4286 | NO_STR |
| 4287 | NEIGHBOR_STR |
| 4288 | NEIGHBOR_ADDR_STR2 |
| 4289 | "Maximum number of prefix accept from this peer\n" |
| 4290 | "maximum no. of prefix limit\n" |
| 4291 | "Threshold value (%) at which to generate a warning msg\n" |
| 4292 | "Restart bgp connection after limit is exceeded\n" |
| 4293 | "Restart interval in minutes") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4294 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4295 | /* "neighbor allowas-in" */ |
| 4296 | DEFUN (neighbor_allowas_in, |
| 4297 | neighbor_allowas_in_cmd, |
| 4298 | NEIGHBOR_CMD2 "allowas-in", |
| 4299 | NEIGHBOR_STR |
| 4300 | NEIGHBOR_ADDR_STR2 |
| 4301 | "Accept as-path with my AS present in it\n") |
| 4302 | { |
| 4303 | int ret; |
| 4304 | struct peer *peer; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4305 | unsigned int allow_num; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4306 | |
| 4307 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 4308 | if (! peer) |
| 4309 | return CMD_WARNING; |
| 4310 | |
| 4311 | if (argc == 1) |
| 4312 | allow_num = 3; |
| 4313 | else |
| 4314 | VTY_GET_INTEGER_RANGE ("AS number", allow_num, argv[1], 1, 10); |
| 4315 | |
| 4316 | ret = peer_allowas_in_set (peer, bgp_node_afi (vty), bgp_node_safi (vty), |
| 4317 | allow_num); |
| 4318 | |
| 4319 | return bgp_vty_return (vty, ret); |
| 4320 | } |
| 4321 | |
| 4322 | ALIAS (neighbor_allowas_in, |
| 4323 | neighbor_allowas_in_arg_cmd, |
| 4324 | NEIGHBOR_CMD2 "allowas-in <1-10>", |
| 4325 | NEIGHBOR_STR |
| 4326 | NEIGHBOR_ADDR_STR2 |
| 4327 | "Accept as-path with my AS present in it\n" |
| 4328 | "Number of occurances of AS number\n") |
| 4329 | |
| 4330 | DEFUN (no_neighbor_allowas_in, |
| 4331 | no_neighbor_allowas_in_cmd, |
| 4332 | NO_NEIGHBOR_CMD2 "allowas-in", |
| 4333 | NO_STR |
| 4334 | NEIGHBOR_STR |
| 4335 | NEIGHBOR_ADDR_STR2 |
| 4336 | "allow local ASN appears in aspath attribute\n") |
| 4337 | { |
| 4338 | int ret; |
| 4339 | struct peer *peer; |
| 4340 | |
| 4341 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 4342 | if (! peer) |
| 4343 | return CMD_WARNING; |
| 4344 | |
| 4345 | ret = peer_allowas_in_unset (peer, bgp_node_afi (vty), bgp_node_safi (vty)); |
| 4346 | |
| 4347 | return bgp_vty_return (vty, ret); |
| 4348 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4349 | |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 4350 | DEFUN (neighbor_ttl_security, |
| 4351 | neighbor_ttl_security_cmd, |
| 4352 | NEIGHBOR_CMD2 "ttl-security hops <1-254>", |
| 4353 | NEIGHBOR_STR |
| 4354 | NEIGHBOR_ADDR_STR2 |
| 4355 | "Specify the maximum number of hops to the BGP peer\n") |
| 4356 | { |
| 4357 | struct peer *peer; |
Stephen Hemminger | 89b6d1f | 2011-03-24 10:51:59 +0000 | [diff] [blame] | 4358 | int gtsm_hops; |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 4359 | |
| 4360 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 4361 | if (! peer) |
| 4362 | return CMD_WARNING; |
| 4363 | |
| 4364 | VTY_GET_INTEGER_RANGE ("", gtsm_hops, argv[1], 1, 254); |
| 4365 | |
Stephen Hemminger | 89b6d1f | 2011-03-24 10:51:59 +0000 | [diff] [blame] | 4366 | return bgp_vty_return (vty, peer_ttl_security_hops_set (peer, gtsm_hops)); |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 4367 | } |
| 4368 | |
| 4369 | DEFUN (no_neighbor_ttl_security, |
| 4370 | no_neighbor_ttl_security_cmd, |
| 4371 | NO_NEIGHBOR_CMD2 "ttl-security hops <1-254>", |
| 4372 | NO_STR |
| 4373 | NEIGHBOR_STR |
| 4374 | NEIGHBOR_ADDR_STR2 |
| 4375 | "Specify the maximum number of hops to the BGP peer\n") |
| 4376 | { |
| 4377 | struct peer *peer; |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 4378 | |
| 4379 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 4380 | if (! peer) |
| 4381 | return CMD_WARNING; |
| 4382 | |
Stephen Hemminger | 89b6d1f | 2011-03-24 10:51:59 +0000 | [diff] [blame] | 4383 | return bgp_vty_return (vty, peer_ttl_security_hops_unset (peer)); |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 4384 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4385 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4386 | /* Address family configuration. */ |
| 4387 | DEFUN (address_family_ipv4, |
| 4388 | address_family_ipv4_cmd, |
| 4389 | "address-family ipv4", |
| 4390 | "Enter Address Family command mode\n" |
| 4391 | "Address family\n") |
| 4392 | { |
| 4393 | vty->node = BGP_IPV4_NODE; |
| 4394 | return CMD_SUCCESS; |
| 4395 | } |
| 4396 | |
| 4397 | DEFUN (address_family_ipv4_safi, |
| 4398 | address_family_ipv4_safi_cmd, |
| 4399 | "address-family ipv4 (unicast|multicast)", |
| 4400 | "Enter Address Family command mode\n" |
| 4401 | "Address family\n" |
| 4402 | "Address Family modifier\n" |
| 4403 | "Address Family modifier\n") |
| 4404 | { |
| 4405 | if (strncmp (argv[0], "m", 1) == 0) |
| 4406 | vty->node = BGP_IPV4M_NODE; |
| 4407 | else |
| 4408 | vty->node = BGP_IPV4_NODE; |
| 4409 | |
| 4410 | return CMD_SUCCESS; |
| 4411 | } |
| 4412 | |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 4413 | DEFUN (address_family_ipv6, |
| 4414 | address_family_ipv6_cmd, |
| 4415 | "address-family ipv6", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4416 | "Enter Address Family command mode\n" |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 4417 | "Address family\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4418 | { |
| 4419 | vty->node = BGP_IPV6_NODE; |
| 4420 | return CMD_SUCCESS; |
| 4421 | } |
| 4422 | |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 4423 | DEFUN (address_family_ipv6_safi, |
| 4424 | address_family_ipv6_safi_cmd, |
| 4425 | "address-family ipv6 (unicast|multicast)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4426 | "Enter Address Family command mode\n" |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 4427 | "Address family\n" |
| 4428 | "Address Family modifier\n" |
| 4429 | "Address Family modifier\n") |
| 4430 | { |
| 4431 | if (strncmp (argv[0], "m", 1) == 0) |
| 4432 | vty->node = BGP_IPV6M_NODE; |
| 4433 | else |
| 4434 | vty->node = BGP_IPV6_NODE; |
| 4435 | |
| 4436 | return CMD_SUCCESS; |
| 4437 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4438 | |
| 4439 | DEFUN (address_family_vpnv4, |
| 4440 | address_family_vpnv4_cmd, |
| 4441 | "address-family vpnv4", |
| 4442 | "Enter Address Family command mode\n" |
| 4443 | "Address family\n") |
| 4444 | { |
| 4445 | vty->node = BGP_VPNV4_NODE; |
| 4446 | return CMD_SUCCESS; |
| 4447 | } |
| 4448 | |
| 4449 | ALIAS (address_family_vpnv4, |
| 4450 | address_family_vpnv4_unicast_cmd, |
| 4451 | "address-family vpnv4 unicast", |
| 4452 | "Enter Address Family command mode\n" |
| 4453 | "Address family\n" |
| 4454 | "Address Family Modifier\n") |
| 4455 | |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 4456 | DEFUN (address_family_vpnv6, |
| 4457 | address_family_vpnv6_cmd, |
| 4458 | "address-family vpnv6", |
| 4459 | "Enter Address Family command mode\n" |
| 4460 | "Address family\n") |
| 4461 | { |
| 4462 | vty->node = BGP_VPNV6_NODE; |
| 4463 | return CMD_SUCCESS; |
| 4464 | } |
| 4465 | |
| 4466 | ALIAS (address_family_vpnv6, |
| 4467 | address_family_vpnv6_unicast_cmd, |
| 4468 | "address-family vpnv6 unicast", |
| 4469 | "Enter Address Family command mode\n" |
| 4470 | "Address family\n" |
| 4471 | "Address Family Modifier\n") |
| 4472 | |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 4473 | DEFUN (address_family_encap, |
| 4474 | address_family_encap_cmd, |
| 4475 | "address-family encap", |
| 4476 | "Enter Address Family command mode\n" |
| 4477 | "Address family\n") |
| 4478 | { |
| 4479 | vty->node = BGP_ENCAP_NODE; |
| 4480 | return CMD_SUCCESS; |
| 4481 | } |
| 4482 | |
| 4483 | ALIAS (address_family_encap, |
| 4484 | address_family_encapv4_cmd, |
| 4485 | "address-family encapv4", |
| 4486 | "Enter Address Family command mode\n" |
| 4487 | "Address family\n") |
| 4488 | |
| 4489 | DEFUN (address_family_encapv6, |
| 4490 | address_family_encapv6_cmd, |
| 4491 | "address-family encapv6", |
| 4492 | "Enter Address Family command mode\n" |
| 4493 | "Address family\n") |
| 4494 | { |
| 4495 | vty->node = BGP_ENCAPV6_NODE; |
| 4496 | return CMD_SUCCESS; |
| 4497 | } |
| 4498 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4499 | DEFUN (exit_address_family, |
| 4500 | exit_address_family_cmd, |
| 4501 | "exit-address-family", |
| 4502 | "Exit from Address Family configuration mode\n") |
| 4503 | { |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 4504 | /* should match list in command.c:config_exit */ |
hasso | a8a80d5 | 2005-04-09 13:07:47 +0000 | [diff] [blame] | 4505 | if (vty->node == BGP_IPV4_NODE |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 4506 | || vty->node == BGP_ENCAP_NODE |
| 4507 | || vty->node == BGP_ENCAPV6_NODE |
hasso | a8a80d5 | 2005-04-09 13:07:47 +0000 | [diff] [blame] | 4508 | || vty->node == BGP_IPV4M_NODE |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4509 | || vty->node == BGP_VPNV4_NODE |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 4510 | || vty->node == BGP_VPNV6_NODE |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 4511 | || vty->node == BGP_IPV6_NODE |
| 4512 | || vty->node == BGP_IPV6M_NODE) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4513 | vty->node = BGP_NODE; |
| 4514 | return CMD_SUCCESS; |
| 4515 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4516 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4517 | /* BGP clear sort. */ |
| 4518 | enum clear_sort |
| 4519 | { |
| 4520 | clear_all, |
| 4521 | clear_peer, |
| 4522 | clear_group, |
| 4523 | clear_external, |
| 4524 | clear_as |
| 4525 | }; |
| 4526 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4527 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4528 | bgp_clear_vty_error (struct vty *vty, struct peer *peer, afi_t afi, |
| 4529 | safi_t safi, int error) |
| 4530 | { |
| 4531 | switch (error) |
| 4532 | { |
| 4533 | case BGP_ERR_AF_UNCONFIGURED: |
| 4534 | vty_out (vty, |
| 4535 | "%%BGP: Enable %s %s address family for the neighbor %s%s", |
| 4536 | afi == AFI_IP6 ? "IPv6" : safi == SAFI_MPLS_VPN ? "VPNv4" : "IPv4", |
| 4537 | safi == SAFI_MULTICAST ? "Multicast" : "Unicast", |
| 4538 | peer->host, VTY_NEWLINE); |
| 4539 | break; |
| 4540 | case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED: |
| 4541 | 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); |
| 4542 | break; |
| 4543 | default: |
| 4544 | break; |
| 4545 | } |
| 4546 | } |
| 4547 | |
| 4548 | /* `clear ip bgp' functions. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4549 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4550 | bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4551 | enum clear_sort sort,enum bgp_clear_type stype, const char *arg) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4552 | { |
| 4553 | int ret; |
| 4554 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4555 | struct listnode *node, *nnode; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4556 | |
| 4557 | /* Clear all neighbors. */ |
| 4558 | if (sort == clear_all) |
| 4559 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4560 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4561 | { |
| 4562 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4563 | ret = peer_clear (peer); |
| 4564 | else |
| 4565 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4566 | |
| 4567 | if (ret < 0) |
| 4568 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4569 | } |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4570 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4571 | } |
| 4572 | |
| 4573 | /* Clear specified neighbors. */ |
| 4574 | if (sort == clear_peer) |
| 4575 | { |
| 4576 | union sockunion su; |
| 4577 | int ret; |
| 4578 | |
| 4579 | /* Make sockunion for lookup. */ |
| 4580 | ret = str2sockunion (arg, &su); |
| 4581 | if (ret < 0) |
| 4582 | { |
| 4583 | vty_out (vty, "Malformed address: %s%s", arg, VTY_NEWLINE); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4584 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4585 | } |
| 4586 | peer = peer_lookup (bgp, &su); |
| 4587 | if (! peer) |
| 4588 | { |
| 4589 | vty_out (vty, "%%BGP: Unknown neighbor - \"%s\"%s", arg, VTY_NEWLINE); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4590 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4591 | } |
| 4592 | |
| 4593 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4594 | ret = peer_clear (peer); |
| 4595 | else |
| 4596 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4597 | |
| 4598 | if (ret < 0) |
| 4599 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4600 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4601 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4602 | } |
| 4603 | |
| 4604 | /* Clear all peer-group members. */ |
| 4605 | if (sort == clear_group) |
| 4606 | { |
| 4607 | struct peer_group *group; |
| 4608 | |
| 4609 | group = peer_group_lookup (bgp, arg); |
| 4610 | if (! group) |
| 4611 | { |
| 4612 | vty_out (vty, "%%BGP: No such peer-group %s%s", arg, VTY_NEWLINE); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4613 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4614 | } |
| 4615 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4616 | for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4617 | { |
| 4618 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4619 | { |
| 4620 | ret = peer_clear (peer); |
| 4621 | continue; |
| 4622 | } |
| 4623 | |
| 4624 | if (! peer->af_group[afi][safi]) |
| 4625 | continue; |
| 4626 | |
| 4627 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4628 | |
| 4629 | if (ret < 0) |
| 4630 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4631 | } |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4632 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4633 | } |
| 4634 | |
| 4635 | if (sort == clear_external) |
| 4636 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4637 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4638 | { |
Jorge Boncompte [DTI2] | 6d85b15 | 2012-05-07 16:52:54 +0000 | [diff] [blame] | 4639 | if (peer->sort == BGP_PEER_IBGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4640 | continue; |
| 4641 | |
| 4642 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4643 | ret = peer_clear (peer); |
| 4644 | else |
| 4645 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4646 | |
| 4647 | if (ret < 0) |
| 4648 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4649 | } |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4650 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4651 | } |
| 4652 | |
| 4653 | if (sort == clear_as) |
| 4654 | { |
| 4655 | as_t as; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4656 | int find = 0; |
| 4657 | |
Ulrich Weber | bde12e3 | 2011-11-16 19:32:12 +0400 | [diff] [blame] | 4658 | VTY_GET_INTEGER_RANGE ("AS", as, arg, 1, BGP_AS4_MAX); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4659 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4660 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4661 | { |
| 4662 | if (peer->as != as) |
| 4663 | continue; |
| 4664 | |
| 4665 | find = 1; |
| 4666 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4667 | ret = peer_clear (peer); |
| 4668 | else |
| 4669 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4670 | |
| 4671 | if (ret < 0) |
| 4672 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4673 | } |
| 4674 | if (! find) |
| 4675 | vty_out (vty, "%%BGP: No peer is configured with AS %s%s", arg, |
| 4676 | VTY_NEWLINE); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4677 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4678 | } |
| 4679 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4680 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4681 | } |
| 4682 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4683 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4684 | bgp_clear_vty (struct vty *vty, const char *name, afi_t afi, safi_t safi, |
| 4685 | enum clear_sort sort, enum bgp_clear_type stype, |
| 4686 | const char *arg) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4687 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4688 | struct bgp *bgp; |
| 4689 | |
| 4690 | /* BGP structure lookup. */ |
| 4691 | if (name) |
| 4692 | { |
| 4693 | bgp = bgp_lookup_by_name (name); |
| 4694 | if (bgp == NULL) |
| 4695 | { |
| 4696 | vty_out (vty, "Can't find BGP view %s%s", name, VTY_NEWLINE); |
| 4697 | return CMD_WARNING; |
| 4698 | } |
| 4699 | } |
| 4700 | else |
| 4701 | { |
| 4702 | bgp = bgp_get_default (); |
| 4703 | if (bgp == NULL) |
| 4704 | { |
| 4705 | vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE); |
| 4706 | return CMD_WARNING; |
| 4707 | } |
| 4708 | } |
| 4709 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4710 | return bgp_clear (vty, bgp, afi, safi, sort, stype, arg); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4711 | } |
| 4712 | |
| 4713 | DEFUN (clear_ip_bgp_all, |
| 4714 | clear_ip_bgp_all_cmd, |
| 4715 | "clear ip bgp *", |
| 4716 | CLEAR_STR |
| 4717 | IP_STR |
| 4718 | BGP_STR |
| 4719 | "Clear all peers\n") |
| 4720 | { |
| 4721 | if (argc == 1) |
| 4722 | return bgp_clear_vty (vty, argv[0], 0, 0, clear_all, BGP_CLEAR_SOFT_NONE, NULL); |
| 4723 | |
| 4724 | return bgp_clear_vty (vty, NULL, 0, 0, clear_all, BGP_CLEAR_SOFT_NONE, NULL); |
| 4725 | } |
| 4726 | |
| 4727 | ALIAS (clear_ip_bgp_all, |
| 4728 | clear_bgp_all_cmd, |
| 4729 | "clear bgp *", |
| 4730 | CLEAR_STR |
| 4731 | BGP_STR |
| 4732 | "Clear all peers\n") |
| 4733 | |
| 4734 | ALIAS (clear_ip_bgp_all, |
| 4735 | clear_bgp_ipv6_all_cmd, |
| 4736 | "clear bgp ipv6 *", |
| 4737 | CLEAR_STR |
| 4738 | BGP_STR |
| 4739 | "Address family\n" |
| 4740 | "Clear all peers\n") |
| 4741 | |
| 4742 | ALIAS (clear_ip_bgp_all, |
| 4743 | clear_ip_bgp_instance_all_cmd, |
| 4744 | "clear ip bgp view WORD *", |
| 4745 | CLEAR_STR |
| 4746 | IP_STR |
| 4747 | BGP_STR |
| 4748 | "BGP view\n" |
| 4749 | "view name\n" |
| 4750 | "Clear all peers\n") |
| 4751 | |
| 4752 | ALIAS (clear_ip_bgp_all, |
| 4753 | clear_bgp_instance_all_cmd, |
| 4754 | "clear bgp view WORD *", |
| 4755 | CLEAR_STR |
| 4756 | BGP_STR |
| 4757 | "BGP view\n" |
| 4758 | "view name\n" |
| 4759 | "Clear all peers\n") |
| 4760 | |
| 4761 | DEFUN (clear_ip_bgp_peer, |
| 4762 | clear_ip_bgp_peer_cmd, |
| 4763 | "clear ip bgp (A.B.C.D|X:X::X:X)", |
| 4764 | CLEAR_STR |
| 4765 | IP_STR |
| 4766 | BGP_STR |
| 4767 | "BGP neighbor IP address to clear\n" |
| 4768 | "BGP IPv6 neighbor to clear\n") |
| 4769 | { |
| 4770 | return bgp_clear_vty (vty, NULL, 0, 0, clear_peer, BGP_CLEAR_SOFT_NONE, argv[0]); |
| 4771 | } |
| 4772 | |
| 4773 | ALIAS (clear_ip_bgp_peer, |
| 4774 | clear_bgp_peer_cmd, |
| 4775 | "clear bgp (A.B.C.D|X:X::X:X)", |
| 4776 | CLEAR_STR |
| 4777 | BGP_STR |
| 4778 | "BGP neighbor address to clear\n" |
| 4779 | "BGP IPv6 neighbor to clear\n") |
| 4780 | |
| 4781 | ALIAS (clear_ip_bgp_peer, |
| 4782 | clear_bgp_ipv6_peer_cmd, |
| 4783 | "clear bgp ipv6 (A.B.C.D|X:X::X:X)", |
| 4784 | CLEAR_STR |
| 4785 | BGP_STR |
| 4786 | "Address family\n" |
| 4787 | "BGP neighbor address to clear\n" |
| 4788 | "BGP IPv6 neighbor to clear\n") |
| 4789 | |
| 4790 | DEFUN (clear_ip_bgp_peer_group, |
| 4791 | clear_ip_bgp_peer_group_cmd, |
| 4792 | "clear ip bgp peer-group WORD", |
| 4793 | CLEAR_STR |
| 4794 | IP_STR |
| 4795 | BGP_STR |
| 4796 | "Clear all members of peer-group\n" |
| 4797 | "BGP peer-group name\n") |
| 4798 | { |
| 4799 | return bgp_clear_vty (vty, NULL, 0, 0, clear_group, BGP_CLEAR_SOFT_NONE, argv[0]); |
| 4800 | } |
| 4801 | |
| 4802 | ALIAS (clear_ip_bgp_peer_group, |
| 4803 | clear_bgp_peer_group_cmd, |
| 4804 | "clear bgp peer-group WORD", |
| 4805 | CLEAR_STR |
| 4806 | BGP_STR |
| 4807 | "Clear all members of peer-group\n" |
| 4808 | "BGP peer-group name\n") |
| 4809 | |
| 4810 | ALIAS (clear_ip_bgp_peer_group, |
| 4811 | clear_bgp_ipv6_peer_group_cmd, |
| 4812 | "clear bgp ipv6 peer-group WORD", |
| 4813 | CLEAR_STR |
| 4814 | BGP_STR |
| 4815 | "Address family\n" |
| 4816 | "Clear all members of peer-group\n" |
| 4817 | "BGP peer-group name\n") |
| 4818 | |
| 4819 | DEFUN (clear_ip_bgp_external, |
| 4820 | clear_ip_bgp_external_cmd, |
| 4821 | "clear ip bgp external", |
| 4822 | CLEAR_STR |
| 4823 | IP_STR |
| 4824 | BGP_STR |
| 4825 | "Clear all external peers\n") |
| 4826 | { |
| 4827 | return bgp_clear_vty (vty, NULL, 0, 0, clear_external, BGP_CLEAR_SOFT_NONE, NULL); |
| 4828 | } |
| 4829 | |
| 4830 | ALIAS (clear_ip_bgp_external, |
| 4831 | clear_bgp_external_cmd, |
| 4832 | "clear bgp external", |
| 4833 | CLEAR_STR |
| 4834 | BGP_STR |
| 4835 | "Clear all external peers\n") |
| 4836 | |
| 4837 | ALIAS (clear_ip_bgp_external, |
| 4838 | clear_bgp_ipv6_external_cmd, |
| 4839 | "clear bgp ipv6 external", |
| 4840 | CLEAR_STR |
| 4841 | BGP_STR |
| 4842 | "Address family\n" |
| 4843 | "Clear all external peers\n") |
| 4844 | |
| 4845 | DEFUN (clear_ip_bgp_as, |
| 4846 | clear_ip_bgp_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 4847 | "clear ip bgp " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4848 | CLEAR_STR |
| 4849 | IP_STR |
| 4850 | BGP_STR |
| 4851 | "Clear peers with the AS number\n") |
| 4852 | { |
| 4853 | return bgp_clear_vty (vty, NULL, 0, 0, clear_as, BGP_CLEAR_SOFT_NONE, argv[0]); |
| 4854 | } |
| 4855 | |
| 4856 | ALIAS (clear_ip_bgp_as, |
| 4857 | clear_bgp_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 4858 | "clear bgp " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4859 | CLEAR_STR |
| 4860 | BGP_STR |
| 4861 | "Clear peers with the AS number\n") |
| 4862 | |
| 4863 | ALIAS (clear_ip_bgp_as, |
| 4864 | clear_bgp_ipv6_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 4865 | "clear bgp ipv6 " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4866 | CLEAR_STR |
| 4867 | BGP_STR |
| 4868 | "Address family\n" |
| 4869 | "Clear peers with the AS number\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4870 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4871 | /* Outbound soft-reconfiguration */ |
| 4872 | DEFUN (clear_ip_bgp_all_soft_out, |
| 4873 | clear_ip_bgp_all_soft_out_cmd, |
| 4874 | "clear ip bgp * soft out", |
| 4875 | CLEAR_STR |
| 4876 | IP_STR |
| 4877 | BGP_STR |
| 4878 | "Clear all peers\n" |
| 4879 | "Soft reconfig\n" |
| 4880 | "Soft reconfig outbound update\n") |
| 4881 | { |
| 4882 | if (argc == 1) |
| 4883 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 4884 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4885 | |
| 4886 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 4887 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4888 | } |
| 4889 | |
| 4890 | ALIAS (clear_ip_bgp_all_soft_out, |
| 4891 | clear_ip_bgp_all_out_cmd, |
| 4892 | "clear ip bgp * out", |
| 4893 | CLEAR_STR |
| 4894 | IP_STR |
| 4895 | BGP_STR |
| 4896 | "Clear all peers\n" |
| 4897 | "Soft reconfig outbound update\n") |
| 4898 | |
| 4899 | ALIAS (clear_ip_bgp_all_soft_out, |
| 4900 | clear_ip_bgp_instance_all_soft_out_cmd, |
| 4901 | "clear ip bgp view WORD * soft out", |
| 4902 | CLEAR_STR |
| 4903 | IP_STR |
| 4904 | BGP_STR |
| 4905 | "BGP view\n" |
| 4906 | "view name\n" |
| 4907 | "Clear all peers\n" |
| 4908 | "Soft reconfig\n" |
| 4909 | "Soft reconfig outbound update\n") |
| 4910 | |
| 4911 | DEFUN (clear_ip_bgp_all_ipv4_soft_out, |
| 4912 | clear_ip_bgp_all_ipv4_soft_out_cmd, |
| 4913 | "clear ip bgp * ipv4 (unicast|multicast) soft out", |
| 4914 | CLEAR_STR |
| 4915 | IP_STR |
| 4916 | BGP_STR |
| 4917 | "Clear all peers\n" |
| 4918 | "Address family\n" |
| 4919 | "Address Family modifier\n" |
| 4920 | "Address Family modifier\n" |
| 4921 | "Soft reconfig\n" |
| 4922 | "Soft reconfig outbound update\n") |
| 4923 | { |
| 4924 | if (strncmp (argv[0], "m", 1) == 0) |
| 4925 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 4926 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4927 | |
| 4928 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 4929 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4930 | } |
| 4931 | |
| 4932 | ALIAS (clear_ip_bgp_all_ipv4_soft_out, |
| 4933 | clear_ip_bgp_all_ipv4_out_cmd, |
| 4934 | "clear ip bgp * ipv4 (unicast|multicast) out", |
| 4935 | CLEAR_STR |
| 4936 | IP_STR |
| 4937 | BGP_STR |
| 4938 | "Clear all peers\n" |
| 4939 | "Address family\n" |
| 4940 | "Address Family modifier\n" |
| 4941 | "Address Family modifier\n" |
| 4942 | "Soft reconfig outbound update\n") |
| 4943 | |
| 4944 | DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out, |
| 4945 | clear_ip_bgp_instance_all_ipv4_soft_out_cmd, |
| 4946 | "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out", |
| 4947 | CLEAR_STR |
| 4948 | IP_STR |
| 4949 | BGP_STR |
| 4950 | "BGP view\n" |
| 4951 | "view name\n" |
| 4952 | "Clear all peers\n" |
| 4953 | "Address family\n" |
| 4954 | "Address Family modifier\n" |
| 4955 | "Address Family modifier\n" |
| 4956 | "Soft reconfig outbound update\n") |
| 4957 | { |
| 4958 | if (strncmp (argv[1], "m", 1) == 0) |
| 4959 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all, |
| 4960 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4961 | |
| 4962 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 4963 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4964 | } |
| 4965 | |
| 4966 | DEFUN (clear_ip_bgp_all_vpnv4_soft_out, |
| 4967 | clear_ip_bgp_all_vpnv4_soft_out_cmd, |
| 4968 | "clear ip bgp * vpnv4 unicast soft out", |
| 4969 | CLEAR_STR |
| 4970 | IP_STR |
| 4971 | BGP_STR |
| 4972 | "Clear all peers\n" |
| 4973 | "Address family\n" |
| 4974 | "Address Family Modifier\n" |
| 4975 | "Soft reconfig\n" |
| 4976 | "Soft reconfig outbound update\n") |
| 4977 | { |
| 4978 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all, |
| 4979 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4980 | } |
| 4981 | |
| 4982 | ALIAS (clear_ip_bgp_all_vpnv4_soft_out, |
| 4983 | clear_ip_bgp_all_vpnv4_out_cmd, |
| 4984 | "clear ip bgp * vpnv4 unicast out", |
| 4985 | CLEAR_STR |
| 4986 | IP_STR |
| 4987 | BGP_STR |
| 4988 | "Clear all peers\n" |
| 4989 | "Address family\n" |
| 4990 | "Address Family Modifier\n" |
| 4991 | "Soft reconfig outbound update\n") |
| 4992 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 4993 | DEFUN (clear_ip_bgp_all_encap_soft_out, |
| 4994 | clear_ip_bgp_all_encap_soft_out_cmd, |
| 4995 | "clear ip bgp * encap unicast soft out", |
| 4996 | CLEAR_STR |
| 4997 | IP_STR |
| 4998 | BGP_STR |
| 4999 | "Clear all peers\n" |
| 5000 | "Address family\n" |
| 5001 | "Address Family Modifier\n" |
| 5002 | "Soft reconfig\n" |
| 5003 | "Soft reconfig outbound update\n") |
| 5004 | { |
| 5005 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all, |
| 5006 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5007 | } |
| 5008 | |
| 5009 | ALIAS (clear_ip_bgp_all_encap_soft_out, |
| 5010 | clear_ip_bgp_all_encap_out_cmd, |
| 5011 | "clear ip bgp * encap unicast out", |
| 5012 | CLEAR_STR |
| 5013 | IP_STR |
| 5014 | BGP_STR |
| 5015 | "Clear all peers\n" |
| 5016 | "Address family\n" |
| 5017 | "Address Family Modifier\n" |
| 5018 | "Soft reconfig outbound update\n") |
| 5019 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5020 | DEFUN (clear_bgp_all_soft_out, |
| 5021 | clear_bgp_all_soft_out_cmd, |
| 5022 | "clear bgp * soft out", |
| 5023 | CLEAR_STR |
| 5024 | BGP_STR |
| 5025 | "Clear all peers\n" |
| 5026 | "Soft reconfig\n" |
| 5027 | "Soft reconfig outbound update\n") |
| 5028 | { |
| 5029 | if (argc == 1) |
| 5030 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 5031 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5032 | |
| 5033 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 5034 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5035 | } |
| 5036 | |
| 5037 | ALIAS (clear_bgp_all_soft_out, |
| 5038 | clear_bgp_instance_all_soft_out_cmd, |
| 5039 | "clear bgp view WORD * soft out", |
| 5040 | CLEAR_STR |
| 5041 | BGP_STR |
| 5042 | "BGP view\n" |
| 5043 | "view name\n" |
| 5044 | "Clear all peers\n" |
| 5045 | "Soft reconfig\n" |
| 5046 | "Soft reconfig outbound update\n") |
| 5047 | |
| 5048 | ALIAS (clear_bgp_all_soft_out, |
| 5049 | clear_bgp_all_out_cmd, |
| 5050 | "clear bgp * out", |
| 5051 | CLEAR_STR |
| 5052 | BGP_STR |
| 5053 | "Clear all peers\n" |
| 5054 | "Soft reconfig outbound update\n") |
| 5055 | |
| 5056 | ALIAS (clear_bgp_all_soft_out, |
| 5057 | clear_bgp_ipv6_all_soft_out_cmd, |
| 5058 | "clear bgp ipv6 * soft out", |
| 5059 | CLEAR_STR |
| 5060 | BGP_STR |
| 5061 | "Address family\n" |
| 5062 | "Clear all peers\n" |
| 5063 | "Soft reconfig\n" |
| 5064 | "Soft reconfig outbound update\n") |
| 5065 | |
| 5066 | ALIAS (clear_bgp_all_soft_out, |
| 5067 | clear_bgp_ipv6_all_out_cmd, |
| 5068 | "clear bgp ipv6 * out", |
| 5069 | CLEAR_STR |
| 5070 | BGP_STR |
| 5071 | "Address family\n" |
| 5072 | "Clear all peers\n" |
| 5073 | "Soft reconfig outbound update\n") |
| 5074 | |
| 5075 | DEFUN (clear_ip_bgp_peer_soft_out, |
| 5076 | clear_ip_bgp_peer_soft_out_cmd, |
| 5077 | "clear ip bgp A.B.C.D soft out", |
| 5078 | CLEAR_STR |
| 5079 | IP_STR |
| 5080 | BGP_STR |
| 5081 | "BGP neighbor address to clear\n" |
| 5082 | "Soft reconfig\n" |
| 5083 | "Soft reconfig outbound update\n") |
| 5084 | { |
| 5085 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5086 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5087 | } |
| 5088 | |
| 5089 | ALIAS (clear_ip_bgp_peer_soft_out, |
| 5090 | clear_ip_bgp_peer_out_cmd, |
| 5091 | "clear ip bgp A.B.C.D out", |
| 5092 | CLEAR_STR |
| 5093 | IP_STR |
| 5094 | BGP_STR |
| 5095 | "BGP neighbor address to clear\n" |
| 5096 | "Soft reconfig outbound update\n") |
| 5097 | |
| 5098 | DEFUN (clear_ip_bgp_peer_ipv4_soft_out, |
| 5099 | clear_ip_bgp_peer_ipv4_soft_out_cmd, |
| 5100 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out", |
| 5101 | CLEAR_STR |
| 5102 | IP_STR |
| 5103 | BGP_STR |
| 5104 | "BGP neighbor address to clear\n" |
| 5105 | "Address family\n" |
| 5106 | "Address Family modifier\n" |
| 5107 | "Address Family modifier\n" |
| 5108 | "Soft reconfig\n" |
| 5109 | "Soft reconfig outbound update\n") |
| 5110 | { |
| 5111 | if (strncmp (argv[1], "m", 1) == 0) |
| 5112 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 5113 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5114 | |
| 5115 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5116 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5117 | } |
| 5118 | |
| 5119 | ALIAS (clear_ip_bgp_peer_ipv4_soft_out, |
| 5120 | clear_ip_bgp_peer_ipv4_out_cmd, |
| 5121 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out", |
| 5122 | CLEAR_STR |
| 5123 | IP_STR |
| 5124 | BGP_STR |
| 5125 | "BGP neighbor address to clear\n" |
| 5126 | "Address family\n" |
| 5127 | "Address Family modifier\n" |
| 5128 | "Address Family modifier\n" |
| 5129 | "Soft reconfig outbound update\n") |
| 5130 | |
| 5131 | DEFUN (clear_ip_bgp_peer_vpnv4_soft_out, |
| 5132 | clear_ip_bgp_peer_vpnv4_soft_out_cmd, |
| 5133 | "clear ip bgp A.B.C.D vpnv4 unicast soft out", |
| 5134 | CLEAR_STR |
| 5135 | IP_STR |
| 5136 | BGP_STR |
| 5137 | "BGP neighbor address to clear\n" |
| 5138 | "Address family\n" |
| 5139 | "Address Family Modifier\n" |
| 5140 | "Soft reconfig\n" |
| 5141 | "Soft reconfig outbound update\n") |
| 5142 | { |
| 5143 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer, |
| 5144 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5145 | } |
| 5146 | |
| 5147 | ALIAS (clear_ip_bgp_peer_vpnv4_soft_out, |
| 5148 | clear_ip_bgp_peer_vpnv4_out_cmd, |
| 5149 | "clear ip bgp A.B.C.D vpnv4 unicast out", |
| 5150 | CLEAR_STR |
| 5151 | IP_STR |
| 5152 | BGP_STR |
| 5153 | "BGP neighbor address to clear\n" |
| 5154 | "Address family\n" |
| 5155 | "Address Family Modifier\n" |
| 5156 | "Soft reconfig outbound update\n") |
| 5157 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 5158 | DEFUN (clear_ip_bgp_peer_encap_soft_out, |
| 5159 | clear_ip_bgp_peer_encap_soft_out_cmd, |
| 5160 | "clear ip bgp A.B.C.D encap unicast soft out", |
| 5161 | CLEAR_STR |
| 5162 | IP_STR |
| 5163 | BGP_STR |
| 5164 | "BGP neighbor address to clear\n" |
| 5165 | "Address family\n" |
| 5166 | "Address Family Modifier\n" |
| 5167 | "Soft reconfig\n" |
| 5168 | "Soft reconfig outbound update\n") |
| 5169 | { |
| 5170 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer, |
| 5171 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5172 | } |
| 5173 | |
| 5174 | ALIAS (clear_ip_bgp_peer_encap_soft_out, |
| 5175 | clear_ip_bgp_peer_encap_out_cmd, |
| 5176 | "clear ip bgp A.B.C.D encap unicast out", |
| 5177 | CLEAR_STR |
| 5178 | IP_STR |
| 5179 | BGP_STR |
| 5180 | "BGP neighbor address to clear\n" |
| 5181 | "Address family\n" |
| 5182 | "Address Family Modifier\n" |
| 5183 | "Soft reconfig outbound update\n") |
| 5184 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5185 | DEFUN (clear_bgp_peer_soft_out, |
| 5186 | clear_bgp_peer_soft_out_cmd, |
| 5187 | "clear bgp (A.B.C.D|X:X::X:X) soft out", |
| 5188 | CLEAR_STR |
| 5189 | BGP_STR |
| 5190 | "BGP neighbor address to clear\n" |
| 5191 | "BGP IPv6 neighbor to clear\n" |
| 5192 | "Soft reconfig\n" |
| 5193 | "Soft reconfig outbound update\n") |
| 5194 | { |
| 5195 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 5196 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5197 | } |
| 5198 | |
| 5199 | ALIAS (clear_bgp_peer_soft_out, |
| 5200 | clear_bgp_ipv6_peer_soft_out_cmd, |
| 5201 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out", |
| 5202 | CLEAR_STR |
| 5203 | BGP_STR |
| 5204 | "Address family\n" |
| 5205 | "BGP neighbor address to clear\n" |
| 5206 | "BGP IPv6 neighbor to clear\n" |
| 5207 | "Soft reconfig\n" |
| 5208 | "Soft reconfig outbound update\n") |
| 5209 | |
| 5210 | ALIAS (clear_bgp_peer_soft_out, |
| 5211 | clear_bgp_peer_out_cmd, |
| 5212 | "clear bgp (A.B.C.D|X:X::X:X) out", |
| 5213 | CLEAR_STR |
| 5214 | BGP_STR |
| 5215 | "BGP neighbor address to clear\n" |
| 5216 | "BGP IPv6 neighbor to clear\n" |
| 5217 | "Soft reconfig outbound update\n") |
| 5218 | |
| 5219 | ALIAS (clear_bgp_peer_soft_out, |
| 5220 | clear_bgp_ipv6_peer_out_cmd, |
| 5221 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) out", |
| 5222 | CLEAR_STR |
| 5223 | BGP_STR |
| 5224 | "Address family\n" |
| 5225 | "BGP neighbor address to clear\n" |
| 5226 | "BGP IPv6 neighbor to clear\n" |
| 5227 | "Soft reconfig outbound update\n") |
| 5228 | |
| 5229 | DEFUN (clear_ip_bgp_peer_group_soft_out, |
| 5230 | clear_ip_bgp_peer_group_soft_out_cmd, |
| 5231 | "clear ip bgp peer-group WORD soft out", |
| 5232 | CLEAR_STR |
| 5233 | IP_STR |
| 5234 | BGP_STR |
| 5235 | "Clear all members of peer-group\n" |
| 5236 | "BGP peer-group name\n" |
| 5237 | "Soft reconfig\n" |
| 5238 | "Soft reconfig outbound update\n") |
| 5239 | { |
| 5240 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 5241 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5242 | } |
| 5243 | |
| 5244 | ALIAS (clear_ip_bgp_peer_group_soft_out, |
| 5245 | clear_ip_bgp_peer_group_out_cmd, |
| 5246 | "clear ip bgp peer-group WORD out", |
| 5247 | CLEAR_STR |
| 5248 | IP_STR |
| 5249 | BGP_STR |
| 5250 | "Clear all members of peer-group\n" |
| 5251 | "BGP peer-group name\n" |
| 5252 | "Soft reconfig outbound update\n") |
| 5253 | |
| 5254 | DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out, |
| 5255 | clear_ip_bgp_peer_group_ipv4_soft_out_cmd, |
| 5256 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out", |
| 5257 | CLEAR_STR |
| 5258 | IP_STR |
| 5259 | BGP_STR |
| 5260 | "Clear all members of peer-group\n" |
| 5261 | "BGP peer-group name\n" |
| 5262 | "Address family\n" |
| 5263 | "Address Family modifier\n" |
| 5264 | "Address Family modifier\n" |
| 5265 | "Soft reconfig\n" |
| 5266 | "Soft reconfig outbound update\n") |
| 5267 | { |
| 5268 | if (strncmp (argv[1], "m", 1) == 0) |
| 5269 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 5270 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5271 | |
| 5272 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 5273 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5274 | } |
| 5275 | |
| 5276 | ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out, |
| 5277 | clear_ip_bgp_peer_group_ipv4_out_cmd, |
| 5278 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out", |
| 5279 | CLEAR_STR |
| 5280 | IP_STR |
| 5281 | BGP_STR |
| 5282 | "Clear all members of peer-group\n" |
| 5283 | "BGP peer-group name\n" |
| 5284 | "Address family\n" |
| 5285 | "Address Family modifier\n" |
| 5286 | "Address Family modifier\n" |
| 5287 | "Soft reconfig outbound update\n") |
| 5288 | |
| 5289 | DEFUN (clear_bgp_peer_group_soft_out, |
| 5290 | clear_bgp_peer_group_soft_out_cmd, |
| 5291 | "clear bgp peer-group WORD soft out", |
| 5292 | CLEAR_STR |
| 5293 | BGP_STR |
| 5294 | "Clear all members of peer-group\n" |
| 5295 | "BGP peer-group name\n" |
| 5296 | "Soft reconfig\n" |
| 5297 | "Soft reconfig outbound update\n") |
| 5298 | { |
| 5299 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 5300 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5301 | } |
| 5302 | |
| 5303 | ALIAS (clear_bgp_peer_group_soft_out, |
| 5304 | clear_bgp_ipv6_peer_group_soft_out_cmd, |
| 5305 | "clear bgp ipv6 peer-group WORD soft out", |
| 5306 | CLEAR_STR |
| 5307 | BGP_STR |
| 5308 | "Address family\n" |
| 5309 | "Clear all members of peer-group\n" |
| 5310 | "BGP peer-group name\n" |
| 5311 | "Soft reconfig\n" |
| 5312 | "Soft reconfig outbound update\n") |
| 5313 | |
| 5314 | ALIAS (clear_bgp_peer_group_soft_out, |
| 5315 | clear_bgp_peer_group_out_cmd, |
| 5316 | "clear bgp peer-group WORD out", |
| 5317 | CLEAR_STR |
| 5318 | BGP_STR |
| 5319 | "Clear all members of peer-group\n" |
| 5320 | "BGP peer-group name\n" |
| 5321 | "Soft reconfig outbound update\n") |
| 5322 | |
| 5323 | ALIAS (clear_bgp_peer_group_soft_out, |
| 5324 | clear_bgp_ipv6_peer_group_out_cmd, |
| 5325 | "clear bgp ipv6 peer-group WORD out", |
| 5326 | CLEAR_STR |
| 5327 | BGP_STR |
| 5328 | "Address family\n" |
| 5329 | "Clear all members of peer-group\n" |
| 5330 | "BGP peer-group name\n" |
| 5331 | "Soft reconfig outbound update\n") |
| 5332 | |
| 5333 | DEFUN (clear_ip_bgp_external_soft_out, |
| 5334 | clear_ip_bgp_external_soft_out_cmd, |
| 5335 | "clear ip bgp external soft out", |
| 5336 | CLEAR_STR |
| 5337 | IP_STR |
| 5338 | BGP_STR |
| 5339 | "Clear all external peers\n" |
| 5340 | "Soft reconfig\n" |
| 5341 | "Soft reconfig outbound update\n") |
| 5342 | { |
| 5343 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 5344 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5345 | } |
| 5346 | |
| 5347 | ALIAS (clear_ip_bgp_external_soft_out, |
| 5348 | clear_ip_bgp_external_out_cmd, |
| 5349 | "clear ip bgp external out", |
| 5350 | CLEAR_STR |
| 5351 | IP_STR |
| 5352 | BGP_STR |
| 5353 | "Clear all external peers\n" |
| 5354 | "Soft reconfig outbound update\n") |
| 5355 | |
| 5356 | DEFUN (clear_ip_bgp_external_ipv4_soft_out, |
| 5357 | clear_ip_bgp_external_ipv4_soft_out_cmd, |
| 5358 | "clear ip bgp external ipv4 (unicast|multicast) soft out", |
| 5359 | CLEAR_STR |
| 5360 | IP_STR |
| 5361 | BGP_STR |
| 5362 | "Clear all external peers\n" |
| 5363 | "Address family\n" |
| 5364 | "Address Family modifier\n" |
| 5365 | "Address Family modifier\n" |
| 5366 | "Soft reconfig\n" |
| 5367 | "Soft reconfig outbound update\n") |
| 5368 | { |
| 5369 | if (strncmp (argv[0], "m", 1) == 0) |
| 5370 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 5371 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5372 | |
| 5373 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 5374 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5375 | } |
| 5376 | |
| 5377 | ALIAS (clear_ip_bgp_external_ipv4_soft_out, |
| 5378 | clear_ip_bgp_external_ipv4_out_cmd, |
| 5379 | "clear ip bgp external ipv4 (unicast|multicast) out", |
| 5380 | CLEAR_STR |
| 5381 | IP_STR |
| 5382 | BGP_STR |
| 5383 | "Clear all external peers\n" |
| 5384 | "Address family\n" |
| 5385 | "Address Family modifier\n" |
| 5386 | "Address Family modifier\n" |
| 5387 | "Soft reconfig outbound update\n") |
| 5388 | |
| 5389 | DEFUN (clear_bgp_external_soft_out, |
| 5390 | clear_bgp_external_soft_out_cmd, |
| 5391 | "clear bgp external soft out", |
| 5392 | CLEAR_STR |
| 5393 | BGP_STR |
| 5394 | "Clear all external peers\n" |
| 5395 | "Soft reconfig\n" |
| 5396 | "Soft reconfig outbound update\n") |
| 5397 | { |
| 5398 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 5399 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5400 | } |
| 5401 | |
| 5402 | ALIAS (clear_bgp_external_soft_out, |
| 5403 | clear_bgp_ipv6_external_soft_out_cmd, |
| 5404 | "clear bgp ipv6 external soft out", |
| 5405 | CLEAR_STR |
| 5406 | BGP_STR |
| 5407 | "Address family\n" |
| 5408 | "Clear all external peers\n" |
| 5409 | "Soft reconfig\n" |
| 5410 | "Soft reconfig outbound update\n") |
| 5411 | |
| 5412 | ALIAS (clear_bgp_external_soft_out, |
| 5413 | clear_bgp_external_out_cmd, |
| 5414 | "clear bgp external out", |
| 5415 | CLEAR_STR |
| 5416 | BGP_STR |
| 5417 | "Clear all external peers\n" |
| 5418 | "Soft reconfig outbound update\n") |
| 5419 | |
| 5420 | ALIAS (clear_bgp_external_soft_out, |
| 5421 | clear_bgp_ipv6_external_out_cmd, |
| 5422 | "clear bgp ipv6 external WORD out", |
| 5423 | CLEAR_STR |
| 5424 | BGP_STR |
| 5425 | "Address family\n" |
| 5426 | "Clear all external peers\n" |
| 5427 | "Soft reconfig outbound update\n") |
| 5428 | |
| 5429 | DEFUN (clear_ip_bgp_as_soft_out, |
| 5430 | clear_ip_bgp_as_soft_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5431 | "clear ip bgp " CMD_AS_RANGE " soft out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5432 | CLEAR_STR |
| 5433 | IP_STR |
| 5434 | BGP_STR |
| 5435 | "Clear peers with the AS number\n" |
| 5436 | "Soft reconfig\n" |
| 5437 | "Soft reconfig outbound update\n") |
| 5438 | { |
| 5439 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 5440 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5441 | } |
| 5442 | |
| 5443 | ALIAS (clear_ip_bgp_as_soft_out, |
| 5444 | clear_ip_bgp_as_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5445 | "clear ip bgp " CMD_AS_RANGE " out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5446 | CLEAR_STR |
| 5447 | IP_STR |
| 5448 | BGP_STR |
| 5449 | "Clear peers with the AS number\n" |
| 5450 | "Soft reconfig outbound update\n") |
| 5451 | |
| 5452 | DEFUN (clear_ip_bgp_as_ipv4_soft_out, |
| 5453 | clear_ip_bgp_as_ipv4_soft_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5454 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5455 | CLEAR_STR |
| 5456 | IP_STR |
| 5457 | BGP_STR |
| 5458 | "Clear peers with the AS number\n" |
| 5459 | "Address family\n" |
| 5460 | "Address Family modifier\n" |
| 5461 | "Address Family modifier\n" |
| 5462 | "Soft reconfig\n" |
| 5463 | "Soft reconfig outbound update\n") |
| 5464 | { |
| 5465 | if (strncmp (argv[1], "m", 1) == 0) |
| 5466 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 5467 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5468 | |
| 5469 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 5470 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5471 | } |
| 5472 | |
| 5473 | ALIAS (clear_ip_bgp_as_ipv4_soft_out, |
| 5474 | clear_ip_bgp_as_ipv4_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5475 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5476 | CLEAR_STR |
| 5477 | IP_STR |
| 5478 | BGP_STR |
| 5479 | "Clear peers with the AS number\n" |
| 5480 | "Address family\n" |
| 5481 | "Address Family modifier\n" |
| 5482 | "Address Family modifier\n" |
| 5483 | "Soft reconfig outbound update\n") |
| 5484 | |
| 5485 | DEFUN (clear_ip_bgp_as_vpnv4_soft_out, |
| 5486 | clear_ip_bgp_as_vpnv4_soft_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5487 | "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast soft out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5488 | CLEAR_STR |
| 5489 | IP_STR |
| 5490 | BGP_STR |
| 5491 | "Clear peers with the AS number\n" |
| 5492 | "Address family\n" |
| 5493 | "Address Family modifier\n" |
| 5494 | "Soft reconfig\n" |
| 5495 | "Soft reconfig outbound update\n") |
| 5496 | { |
| 5497 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as, |
| 5498 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5499 | } |
| 5500 | |
| 5501 | ALIAS (clear_ip_bgp_as_vpnv4_soft_out, |
| 5502 | clear_ip_bgp_as_vpnv4_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5503 | "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5504 | CLEAR_STR |
| 5505 | IP_STR |
| 5506 | BGP_STR |
| 5507 | "Clear peers with the AS number\n" |
| 5508 | "Address family\n" |
| 5509 | "Address Family modifier\n" |
| 5510 | "Soft reconfig outbound update\n") |
| 5511 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 5512 | DEFUN (clear_ip_bgp_as_encap_soft_out, |
| 5513 | clear_ip_bgp_as_encap_soft_out_cmd, |
| 5514 | "clear ip bgp " CMD_AS_RANGE " encap unicast soft out", |
| 5515 | CLEAR_STR |
| 5516 | IP_STR |
| 5517 | BGP_STR |
| 5518 | "Clear peers with the AS number\n" |
| 5519 | "Address family\n" |
| 5520 | "Address Family modifier\n" |
| 5521 | "Soft reconfig\n" |
| 5522 | "Soft reconfig outbound update\n") |
| 5523 | { |
| 5524 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as, |
| 5525 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5526 | } |
| 5527 | |
| 5528 | ALIAS (clear_ip_bgp_as_encap_soft_out, |
| 5529 | clear_ip_bgp_as_encap_out_cmd, |
| 5530 | "clear ip bgp " CMD_AS_RANGE " encap unicast out", |
| 5531 | CLEAR_STR |
| 5532 | IP_STR |
| 5533 | BGP_STR |
| 5534 | "Clear peers with the AS number\n" |
| 5535 | "Address family\n" |
| 5536 | "Address Family modifier\n" |
| 5537 | "Soft reconfig outbound update\n") |
| 5538 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5539 | DEFUN (clear_bgp_as_soft_out, |
| 5540 | clear_bgp_as_soft_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5541 | "clear bgp " CMD_AS_RANGE " soft out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5542 | CLEAR_STR |
| 5543 | BGP_STR |
| 5544 | "Clear peers with the AS number\n" |
| 5545 | "Soft reconfig\n" |
| 5546 | "Soft reconfig outbound update\n") |
| 5547 | { |
| 5548 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 5549 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5550 | } |
| 5551 | |
| 5552 | ALIAS (clear_bgp_as_soft_out, |
| 5553 | clear_bgp_ipv6_as_soft_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5554 | "clear bgp ipv6 " CMD_AS_RANGE " soft out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5555 | CLEAR_STR |
| 5556 | BGP_STR |
| 5557 | "Address family\n" |
| 5558 | "Clear peers with the AS number\n" |
| 5559 | "Soft reconfig\n" |
| 5560 | "Soft reconfig outbound update\n") |
| 5561 | |
| 5562 | ALIAS (clear_bgp_as_soft_out, |
| 5563 | clear_bgp_as_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5564 | "clear bgp " CMD_AS_RANGE " out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5565 | CLEAR_STR |
| 5566 | BGP_STR |
| 5567 | "Clear peers with the AS number\n" |
| 5568 | "Soft reconfig outbound update\n") |
| 5569 | |
| 5570 | ALIAS (clear_bgp_as_soft_out, |
| 5571 | clear_bgp_ipv6_as_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5572 | "clear bgp ipv6 " CMD_AS_RANGE " out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5573 | CLEAR_STR |
| 5574 | BGP_STR |
| 5575 | "Address family\n" |
| 5576 | "Clear peers with the AS number\n" |
| 5577 | "Soft reconfig outbound update\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 5578 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5579 | /* Inbound soft-reconfiguration */ |
| 5580 | DEFUN (clear_ip_bgp_all_soft_in, |
| 5581 | clear_ip_bgp_all_soft_in_cmd, |
| 5582 | "clear ip bgp * soft in", |
| 5583 | CLEAR_STR |
| 5584 | IP_STR |
| 5585 | BGP_STR |
| 5586 | "Clear all peers\n" |
| 5587 | "Soft reconfig\n" |
| 5588 | "Soft reconfig inbound update\n") |
| 5589 | { |
| 5590 | if (argc == 1) |
| 5591 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5592 | BGP_CLEAR_SOFT_IN, NULL); |
| 5593 | |
| 5594 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5595 | BGP_CLEAR_SOFT_IN, NULL); |
| 5596 | } |
| 5597 | |
| 5598 | ALIAS (clear_ip_bgp_all_soft_in, |
| 5599 | clear_ip_bgp_instance_all_soft_in_cmd, |
| 5600 | "clear ip bgp view WORD * soft in", |
| 5601 | CLEAR_STR |
| 5602 | IP_STR |
| 5603 | BGP_STR |
| 5604 | "BGP view\n" |
| 5605 | "view name\n" |
| 5606 | "Clear all peers\n" |
| 5607 | "Soft reconfig\n" |
| 5608 | "Soft reconfig inbound update\n") |
| 5609 | |
| 5610 | ALIAS (clear_ip_bgp_all_soft_in, |
| 5611 | clear_ip_bgp_all_in_cmd, |
| 5612 | "clear ip bgp * in", |
| 5613 | CLEAR_STR |
| 5614 | IP_STR |
| 5615 | BGP_STR |
| 5616 | "Clear all peers\n" |
| 5617 | "Soft reconfig inbound update\n") |
| 5618 | |
| 5619 | DEFUN (clear_ip_bgp_all_in_prefix_filter, |
| 5620 | clear_ip_bgp_all_in_prefix_filter_cmd, |
| 5621 | "clear ip bgp * in prefix-filter", |
| 5622 | CLEAR_STR |
| 5623 | IP_STR |
| 5624 | BGP_STR |
| 5625 | "Clear all peers\n" |
| 5626 | "Soft reconfig inbound update\n" |
| 5627 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5628 | { |
| 5629 | if (argc== 1) |
| 5630 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5631 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5632 | |
| 5633 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5634 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5635 | } |
| 5636 | |
| 5637 | ALIAS (clear_ip_bgp_all_in_prefix_filter, |
| 5638 | clear_ip_bgp_instance_all_in_prefix_filter_cmd, |
| 5639 | "clear ip bgp view WORD * in prefix-filter", |
| 5640 | CLEAR_STR |
| 5641 | IP_STR |
| 5642 | BGP_STR |
| 5643 | "BGP view\n" |
| 5644 | "view name\n" |
| 5645 | "Clear all peers\n" |
| 5646 | "Soft reconfig inbound update\n" |
| 5647 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5648 | |
| 5649 | |
| 5650 | DEFUN (clear_ip_bgp_all_ipv4_soft_in, |
| 5651 | clear_ip_bgp_all_ipv4_soft_in_cmd, |
| 5652 | "clear ip bgp * ipv4 (unicast|multicast) soft in", |
| 5653 | CLEAR_STR |
| 5654 | IP_STR |
| 5655 | BGP_STR |
| 5656 | "Clear all peers\n" |
| 5657 | "Address family\n" |
| 5658 | "Address Family modifier\n" |
| 5659 | "Address Family modifier\n" |
| 5660 | "Soft reconfig\n" |
| 5661 | "Soft reconfig inbound update\n") |
| 5662 | { |
| 5663 | if (strncmp (argv[0], "m", 1) == 0) |
| 5664 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 5665 | BGP_CLEAR_SOFT_IN, NULL); |
| 5666 | |
| 5667 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5668 | BGP_CLEAR_SOFT_IN, NULL); |
| 5669 | } |
| 5670 | |
| 5671 | ALIAS (clear_ip_bgp_all_ipv4_soft_in, |
| 5672 | clear_ip_bgp_all_ipv4_in_cmd, |
| 5673 | "clear ip bgp * ipv4 (unicast|multicast) in", |
| 5674 | CLEAR_STR |
| 5675 | IP_STR |
| 5676 | BGP_STR |
| 5677 | "Clear all peers\n" |
| 5678 | "Address family\n" |
| 5679 | "Address Family modifier\n" |
| 5680 | "Address Family modifier\n" |
| 5681 | "Soft reconfig inbound update\n") |
| 5682 | |
| 5683 | DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in, |
| 5684 | clear_ip_bgp_instance_all_ipv4_soft_in_cmd, |
| 5685 | "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in", |
| 5686 | CLEAR_STR |
| 5687 | IP_STR |
| 5688 | BGP_STR |
| 5689 | "BGP view\n" |
| 5690 | "view name\n" |
| 5691 | "Clear all peers\n" |
| 5692 | "Address family\n" |
| 5693 | "Address Family modifier\n" |
| 5694 | "Address Family modifier\n" |
| 5695 | "Soft reconfig\n" |
| 5696 | "Soft reconfig inbound update\n") |
| 5697 | { |
| 5698 | if (strncmp (argv[1], "m", 1) == 0) |
| 5699 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all, |
| 5700 | BGP_CLEAR_SOFT_IN, NULL); |
| 5701 | |
| 5702 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5703 | BGP_CLEAR_SOFT_IN, NULL); |
| 5704 | } |
| 5705 | |
| 5706 | DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter, |
| 5707 | clear_ip_bgp_all_ipv4_in_prefix_filter_cmd, |
| 5708 | "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter", |
| 5709 | CLEAR_STR |
| 5710 | IP_STR |
| 5711 | BGP_STR |
| 5712 | "Clear all peers\n" |
| 5713 | "Address family\n" |
| 5714 | "Address Family modifier\n" |
| 5715 | "Address Family modifier\n" |
| 5716 | "Soft reconfig inbound update\n" |
| 5717 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5718 | { |
| 5719 | if (strncmp (argv[0], "m", 1) == 0) |
| 5720 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 5721 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5722 | |
| 5723 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5724 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5725 | } |
| 5726 | |
| 5727 | DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter, |
| 5728 | clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd, |
| 5729 | "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter", |
| 5730 | CLEAR_STR |
| 5731 | IP_STR |
| 5732 | BGP_STR |
| 5733 | "Clear all peers\n" |
| 5734 | "Address family\n" |
| 5735 | "Address Family modifier\n" |
| 5736 | "Address Family modifier\n" |
| 5737 | "Soft reconfig inbound update\n" |
| 5738 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5739 | { |
| 5740 | if (strncmp (argv[1], "m", 1) == 0) |
| 5741 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all, |
| 5742 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5743 | |
| 5744 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5745 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5746 | } |
| 5747 | |
| 5748 | DEFUN (clear_ip_bgp_all_vpnv4_soft_in, |
| 5749 | clear_ip_bgp_all_vpnv4_soft_in_cmd, |
| 5750 | "clear ip bgp * vpnv4 unicast soft in", |
| 5751 | CLEAR_STR |
| 5752 | IP_STR |
| 5753 | BGP_STR |
| 5754 | "Clear all peers\n" |
| 5755 | "Address family\n" |
| 5756 | "Address Family Modifier\n" |
| 5757 | "Soft reconfig\n" |
| 5758 | "Soft reconfig inbound update\n") |
| 5759 | { |
| 5760 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all, |
| 5761 | BGP_CLEAR_SOFT_IN, NULL); |
| 5762 | } |
| 5763 | |
| 5764 | ALIAS (clear_ip_bgp_all_vpnv4_soft_in, |
| 5765 | clear_ip_bgp_all_vpnv4_in_cmd, |
| 5766 | "clear ip bgp * vpnv4 unicast in", |
| 5767 | CLEAR_STR |
| 5768 | IP_STR |
| 5769 | BGP_STR |
| 5770 | "Clear all peers\n" |
| 5771 | "Address family\n" |
| 5772 | "Address Family Modifier\n" |
| 5773 | "Soft reconfig inbound update\n") |
| 5774 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 5775 | DEFUN (clear_ip_bgp_all_encap_soft_in, |
| 5776 | clear_ip_bgp_all_encap_soft_in_cmd, |
| 5777 | "clear ip bgp * encap unicast soft in", |
| 5778 | CLEAR_STR |
| 5779 | IP_STR |
| 5780 | BGP_STR |
| 5781 | "Clear all peers\n" |
| 5782 | "Address family\n" |
| 5783 | "Address Family Modifier\n" |
| 5784 | "Soft reconfig\n" |
| 5785 | "Soft reconfig inbound update\n") |
| 5786 | { |
| 5787 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all, |
| 5788 | BGP_CLEAR_SOFT_IN, NULL); |
| 5789 | } |
| 5790 | |
| 5791 | ALIAS (clear_ip_bgp_all_encap_soft_in, |
| 5792 | clear_ip_bgp_all_encap_in_cmd, |
| 5793 | "clear ip bgp * encap unicast in", |
| 5794 | CLEAR_STR |
| 5795 | IP_STR |
| 5796 | BGP_STR |
| 5797 | "Clear all peers\n" |
| 5798 | "Address family\n" |
| 5799 | "Address Family Modifier\n" |
| 5800 | "Soft reconfig inbound update\n") |
| 5801 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5802 | DEFUN (clear_bgp_all_soft_in, |
| 5803 | clear_bgp_all_soft_in_cmd, |
| 5804 | "clear bgp * soft in", |
| 5805 | CLEAR_STR |
| 5806 | BGP_STR |
| 5807 | "Clear all peers\n" |
| 5808 | "Soft reconfig\n" |
| 5809 | "Soft reconfig inbound update\n") |
| 5810 | { |
| 5811 | if (argc == 1) |
| 5812 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 5813 | BGP_CLEAR_SOFT_IN, NULL); |
| 5814 | |
| 5815 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 5816 | BGP_CLEAR_SOFT_IN, NULL); |
| 5817 | } |
| 5818 | |
| 5819 | ALIAS (clear_bgp_all_soft_in, |
| 5820 | clear_bgp_instance_all_soft_in_cmd, |
| 5821 | "clear bgp view WORD * soft in", |
| 5822 | CLEAR_STR |
| 5823 | BGP_STR |
| 5824 | "BGP view\n" |
| 5825 | "view name\n" |
| 5826 | "Clear all peers\n" |
| 5827 | "Soft reconfig\n" |
| 5828 | "Soft reconfig inbound update\n") |
| 5829 | |
| 5830 | ALIAS (clear_bgp_all_soft_in, |
| 5831 | clear_bgp_ipv6_all_soft_in_cmd, |
| 5832 | "clear bgp ipv6 * soft in", |
| 5833 | CLEAR_STR |
| 5834 | BGP_STR |
| 5835 | "Address family\n" |
| 5836 | "Clear all peers\n" |
| 5837 | "Soft reconfig\n" |
| 5838 | "Soft reconfig inbound update\n") |
| 5839 | |
| 5840 | ALIAS (clear_bgp_all_soft_in, |
| 5841 | clear_bgp_all_in_cmd, |
| 5842 | "clear bgp * in", |
| 5843 | CLEAR_STR |
| 5844 | BGP_STR |
| 5845 | "Clear all peers\n" |
| 5846 | "Soft reconfig inbound update\n") |
| 5847 | |
| 5848 | ALIAS (clear_bgp_all_soft_in, |
| 5849 | clear_bgp_ipv6_all_in_cmd, |
| 5850 | "clear bgp ipv6 * in", |
| 5851 | CLEAR_STR |
| 5852 | BGP_STR |
| 5853 | "Address family\n" |
| 5854 | "Clear all peers\n" |
| 5855 | "Soft reconfig inbound update\n") |
| 5856 | |
| 5857 | DEFUN (clear_bgp_all_in_prefix_filter, |
| 5858 | clear_bgp_all_in_prefix_filter_cmd, |
| 5859 | "clear bgp * in prefix-filter", |
| 5860 | CLEAR_STR |
| 5861 | BGP_STR |
| 5862 | "Clear all peers\n" |
| 5863 | "Soft reconfig inbound update\n" |
| 5864 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5865 | { |
| 5866 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 5867 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5868 | } |
| 5869 | |
| 5870 | ALIAS (clear_bgp_all_in_prefix_filter, |
| 5871 | clear_bgp_ipv6_all_in_prefix_filter_cmd, |
| 5872 | "clear bgp ipv6 * in prefix-filter", |
| 5873 | CLEAR_STR |
| 5874 | BGP_STR |
| 5875 | "Address family\n" |
| 5876 | "Clear all peers\n" |
| 5877 | "Soft reconfig inbound update\n" |
| 5878 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5879 | |
| 5880 | DEFUN (clear_ip_bgp_peer_soft_in, |
| 5881 | clear_ip_bgp_peer_soft_in_cmd, |
| 5882 | "clear ip bgp A.B.C.D soft in", |
| 5883 | CLEAR_STR |
| 5884 | IP_STR |
| 5885 | BGP_STR |
| 5886 | "BGP neighbor address to clear\n" |
| 5887 | "Soft reconfig\n" |
| 5888 | "Soft reconfig inbound update\n") |
| 5889 | { |
| 5890 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5891 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5892 | } |
| 5893 | |
| 5894 | ALIAS (clear_ip_bgp_peer_soft_in, |
| 5895 | clear_ip_bgp_peer_in_cmd, |
| 5896 | "clear ip bgp A.B.C.D in", |
| 5897 | CLEAR_STR |
| 5898 | IP_STR |
| 5899 | BGP_STR |
| 5900 | "BGP neighbor address to clear\n" |
| 5901 | "Soft reconfig inbound update\n") |
| 5902 | |
| 5903 | DEFUN (clear_ip_bgp_peer_in_prefix_filter, |
| 5904 | clear_ip_bgp_peer_in_prefix_filter_cmd, |
| 5905 | "clear ip bgp A.B.C.D in prefix-filter", |
| 5906 | CLEAR_STR |
| 5907 | IP_STR |
| 5908 | BGP_STR |
| 5909 | "BGP neighbor address to clear\n" |
| 5910 | "Soft reconfig inbound update\n" |
| 5911 | "Push out the existing ORF prefix-list\n") |
| 5912 | { |
| 5913 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5914 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5915 | } |
| 5916 | |
| 5917 | DEFUN (clear_ip_bgp_peer_ipv4_soft_in, |
| 5918 | clear_ip_bgp_peer_ipv4_soft_in_cmd, |
| 5919 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in", |
| 5920 | CLEAR_STR |
| 5921 | IP_STR |
| 5922 | BGP_STR |
| 5923 | "BGP neighbor address to clear\n" |
| 5924 | "Address family\n" |
| 5925 | "Address Family modifier\n" |
| 5926 | "Address Family modifier\n" |
| 5927 | "Soft reconfig\n" |
| 5928 | "Soft reconfig inbound update\n") |
| 5929 | { |
| 5930 | if (strncmp (argv[1], "m", 1) == 0) |
| 5931 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 5932 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5933 | |
| 5934 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5935 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5936 | } |
| 5937 | |
| 5938 | ALIAS (clear_ip_bgp_peer_ipv4_soft_in, |
| 5939 | clear_ip_bgp_peer_ipv4_in_cmd, |
| 5940 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in", |
| 5941 | CLEAR_STR |
| 5942 | IP_STR |
| 5943 | BGP_STR |
| 5944 | "BGP neighbor address to clear\n" |
| 5945 | "Address family\n" |
| 5946 | "Address Family modifier\n" |
| 5947 | "Address Family modifier\n" |
| 5948 | "Soft reconfig inbound update\n") |
| 5949 | |
| 5950 | DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter, |
| 5951 | clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd, |
| 5952 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter", |
| 5953 | CLEAR_STR |
| 5954 | IP_STR |
| 5955 | BGP_STR |
| 5956 | "BGP neighbor address to clear\n" |
| 5957 | "Address family\n" |
| 5958 | "Address Family modifier\n" |
| 5959 | "Address Family modifier\n" |
| 5960 | "Soft reconfig inbound update\n" |
| 5961 | "Push out the existing ORF prefix-list\n") |
| 5962 | { |
| 5963 | if (strncmp (argv[1], "m", 1) == 0) |
| 5964 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 5965 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5966 | |
| 5967 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5968 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5969 | } |
| 5970 | |
| 5971 | DEFUN (clear_ip_bgp_peer_vpnv4_soft_in, |
| 5972 | clear_ip_bgp_peer_vpnv4_soft_in_cmd, |
| 5973 | "clear ip bgp A.B.C.D vpnv4 unicast soft in", |
| 5974 | CLEAR_STR |
| 5975 | IP_STR |
| 5976 | BGP_STR |
| 5977 | "BGP neighbor address to clear\n" |
| 5978 | "Address family\n" |
| 5979 | "Address Family Modifier\n" |
| 5980 | "Soft reconfig\n" |
| 5981 | "Soft reconfig inbound update\n") |
| 5982 | { |
| 5983 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer, |
| 5984 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5985 | } |
| 5986 | |
| 5987 | ALIAS (clear_ip_bgp_peer_vpnv4_soft_in, |
| 5988 | clear_ip_bgp_peer_vpnv4_in_cmd, |
| 5989 | "clear ip bgp A.B.C.D vpnv4 unicast in", |
| 5990 | CLEAR_STR |
| 5991 | IP_STR |
| 5992 | BGP_STR |
| 5993 | "BGP neighbor address to clear\n" |
| 5994 | "Address family\n" |
| 5995 | "Address Family Modifier\n" |
| 5996 | "Soft reconfig inbound update\n") |
| 5997 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 5998 | DEFUN (clear_ip_bgp_peer_encap_soft_in, |
| 5999 | clear_ip_bgp_peer_encap_soft_in_cmd, |
| 6000 | "clear ip bgp A.B.C.D encap unicast soft in", |
| 6001 | CLEAR_STR |
| 6002 | IP_STR |
| 6003 | BGP_STR |
| 6004 | "BGP neighbor address to clear\n" |
| 6005 | "Address family\n" |
| 6006 | "Address Family Modifier\n" |
| 6007 | "Soft reconfig\n" |
| 6008 | "Soft reconfig inbound update\n") |
| 6009 | { |
| 6010 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer, |
| 6011 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6012 | } |
| 6013 | |
| 6014 | ALIAS (clear_ip_bgp_peer_encap_soft_in, |
| 6015 | clear_ip_bgp_peer_encap_in_cmd, |
| 6016 | "clear ip bgp A.B.C.D encap unicast in", |
| 6017 | CLEAR_STR |
| 6018 | IP_STR |
| 6019 | BGP_STR |
| 6020 | "BGP neighbor address to clear\n" |
| 6021 | "Address family\n" |
| 6022 | "Address Family Modifier\n" |
| 6023 | "Soft reconfig inbound update\n") |
| 6024 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6025 | DEFUN (clear_bgp_peer_soft_in, |
| 6026 | clear_bgp_peer_soft_in_cmd, |
| 6027 | "clear bgp (A.B.C.D|X:X::X:X) soft in", |
| 6028 | CLEAR_STR |
| 6029 | BGP_STR |
| 6030 | "BGP neighbor address to clear\n" |
| 6031 | "BGP IPv6 neighbor to clear\n" |
| 6032 | "Soft reconfig\n" |
| 6033 | "Soft reconfig inbound update\n") |
| 6034 | { |
| 6035 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 6036 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6037 | } |
| 6038 | |
| 6039 | ALIAS (clear_bgp_peer_soft_in, |
| 6040 | clear_bgp_ipv6_peer_soft_in_cmd, |
| 6041 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in", |
| 6042 | CLEAR_STR |
| 6043 | BGP_STR |
| 6044 | "Address family\n" |
| 6045 | "BGP neighbor address to clear\n" |
| 6046 | "BGP IPv6 neighbor to clear\n" |
| 6047 | "Soft reconfig\n" |
| 6048 | "Soft reconfig inbound update\n") |
| 6049 | |
| 6050 | ALIAS (clear_bgp_peer_soft_in, |
| 6051 | clear_bgp_peer_in_cmd, |
| 6052 | "clear bgp (A.B.C.D|X:X::X:X) in", |
| 6053 | CLEAR_STR |
| 6054 | BGP_STR |
| 6055 | "BGP neighbor address to clear\n" |
| 6056 | "BGP IPv6 neighbor to clear\n" |
| 6057 | "Soft reconfig inbound update\n") |
| 6058 | |
| 6059 | ALIAS (clear_bgp_peer_soft_in, |
| 6060 | clear_bgp_ipv6_peer_in_cmd, |
| 6061 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) in", |
| 6062 | CLEAR_STR |
| 6063 | BGP_STR |
| 6064 | "Address family\n" |
| 6065 | "BGP neighbor address to clear\n" |
| 6066 | "BGP IPv6 neighbor to clear\n" |
| 6067 | "Soft reconfig inbound update\n") |
| 6068 | |
| 6069 | DEFUN (clear_bgp_peer_in_prefix_filter, |
| 6070 | clear_bgp_peer_in_prefix_filter_cmd, |
| 6071 | "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter", |
| 6072 | CLEAR_STR |
| 6073 | BGP_STR |
| 6074 | "BGP neighbor address to clear\n" |
| 6075 | "BGP IPv6 neighbor to clear\n" |
| 6076 | "Soft reconfig inbound update\n" |
| 6077 | "Push out the existing ORF prefix-list\n") |
| 6078 | { |
| 6079 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 6080 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6081 | } |
| 6082 | |
| 6083 | ALIAS (clear_bgp_peer_in_prefix_filter, |
| 6084 | clear_bgp_ipv6_peer_in_prefix_filter_cmd, |
| 6085 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter", |
| 6086 | CLEAR_STR |
| 6087 | BGP_STR |
| 6088 | "Address family\n" |
| 6089 | "BGP neighbor address to clear\n" |
| 6090 | "BGP IPv6 neighbor to clear\n" |
| 6091 | "Soft reconfig inbound update\n" |
| 6092 | "Push out the existing ORF prefix-list\n") |
| 6093 | |
| 6094 | DEFUN (clear_ip_bgp_peer_group_soft_in, |
| 6095 | clear_ip_bgp_peer_group_soft_in_cmd, |
| 6096 | "clear ip bgp peer-group WORD soft in", |
| 6097 | CLEAR_STR |
| 6098 | IP_STR |
| 6099 | BGP_STR |
| 6100 | "Clear all members of peer-group\n" |
| 6101 | "BGP peer-group name\n" |
| 6102 | "Soft reconfig\n" |
| 6103 | "Soft reconfig inbound update\n") |
| 6104 | { |
| 6105 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6106 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6107 | } |
| 6108 | |
| 6109 | ALIAS (clear_ip_bgp_peer_group_soft_in, |
| 6110 | clear_ip_bgp_peer_group_in_cmd, |
| 6111 | "clear ip bgp peer-group WORD in", |
| 6112 | CLEAR_STR |
| 6113 | IP_STR |
| 6114 | BGP_STR |
| 6115 | "Clear all members of peer-group\n" |
| 6116 | "BGP peer-group name\n" |
| 6117 | "Soft reconfig inbound update\n") |
| 6118 | |
| 6119 | DEFUN (clear_ip_bgp_peer_group_in_prefix_filter, |
| 6120 | clear_ip_bgp_peer_group_in_prefix_filter_cmd, |
| 6121 | "clear ip bgp peer-group WORD in prefix-filter", |
| 6122 | CLEAR_STR |
| 6123 | IP_STR |
| 6124 | BGP_STR |
| 6125 | "Clear all members of peer-group\n" |
| 6126 | "BGP peer-group name\n" |
| 6127 | "Soft reconfig inbound update\n" |
| 6128 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6129 | { |
| 6130 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6131 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6132 | } |
| 6133 | |
| 6134 | DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in, |
| 6135 | clear_ip_bgp_peer_group_ipv4_soft_in_cmd, |
| 6136 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in", |
| 6137 | CLEAR_STR |
| 6138 | IP_STR |
| 6139 | BGP_STR |
| 6140 | "Clear all members of peer-group\n" |
| 6141 | "BGP peer-group name\n" |
| 6142 | "Address family\n" |
| 6143 | "Address Family modifier\n" |
| 6144 | "Address Family modifier\n" |
| 6145 | "Soft reconfig\n" |
| 6146 | "Soft reconfig inbound update\n") |
| 6147 | { |
| 6148 | if (strncmp (argv[1], "m", 1) == 0) |
| 6149 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 6150 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6151 | |
| 6152 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6153 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6154 | } |
| 6155 | |
| 6156 | ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in, |
| 6157 | clear_ip_bgp_peer_group_ipv4_in_cmd, |
| 6158 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in", |
| 6159 | CLEAR_STR |
| 6160 | IP_STR |
| 6161 | BGP_STR |
| 6162 | "Clear all members of peer-group\n" |
| 6163 | "BGP peer-group name\n" |
| 6164 | "Address family\n" |
| 6165 | "Address Family modifier\n" |
| 6166 | "Address Family modifier\n" |
| 6167 | "Soft reconfig inbound update\n") |
| 6168 | |
| 6169 | DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter, |
| 6170 | clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd, |
| 6171 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter", |
| 6172 | CLEAR_STR |
| 6173 | IP_STR |
| 6174 | BGP_STR |
| 6175 | "Clear all members of peer-group\n" |
| 6176 | "BGP peer-group name\n" |
| 6177 | "Address family\n" |
| 6178 | "Address Family modifier\n" |
| 6179 | "Address Family modifier\n" |
| 6180 | "Soft reconfig inbound update\n" |
| 6181 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6182 | { |
| 6183 | if (strncmp (argv[1], "m", 1) == 0) |
| 6184 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 6185 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6186 | |
| 6187 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6188 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6189 | } |
| 6190 | |
| 6191 | DEFUN (clear_bgp_peer_group_soft_in, |
| 6192 | clear_bgp_peer_group_soft_in_cmd, |
| 6193 | "clear bgp peer-group WORD soft in", |
| 6194 | CLEAR_STR |
| 6195 | BGP_STR |
| 6196 | "Clear all members of peer-group\n" |
| 6197 | "BGP peer-group name\n" |
| 6198 | "Soft reconfig\n" |
| 6199 | "Soft reconfig inbound update\n") |
| 6200 | { |
| 6201 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 6202 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6203 | } |
| 6204 | |
| 6205 | ALIAS (clear_bgp_peer_group_soft_in, |
| 6206 | clear_bgp_ipv6_peer_group_soft_in_cmd, |
| 6207 | "clear bgp ipv6 peer-group WORD soft in", |
| 6208 | CLEAR_STR |
| 6209 | BGP_STR |
| 6210 | "Address family\n" |
| 6211 | "Clear all members of peer-group\n" |
| 6212 | "BGP peer-group name\n" |
| 6213 | "Soft reconfig\n" |
| 6214 | "Soft reconfig inbound update\n") |
| 6215 | |
| 6216 | ALIAS (clear_bgp_peer_group_soft_in, |
| 6217 | clear_bgp_peer_group_in_cmd, |
| 6218 | "clear bgp peer-group WORD in", |
| 6219 | CLEAR_STR |
| 6220 | BGP_STR |
| 6221 | "Clear all members of peer-group\n" |
| 6222 | "BGP peer-group name\n" |
| 6223 | "Soft reconfig inbound update\n") |
| 6224 | |
| 6225 | ALIAS (clear_bgp_peer_group_soft_in, |
| 6226 | clear_bgp_ipv6_peer_group_in_cmd, |
| 6227 | "clear bgp ipv6 peer-group WORD in", |
| 6228 | CLEAR_STR |
| 6229 | BGP_STR |
| 6230 | "Address family\n" |
| 6231 | "Clear all members of peer-group\n" |
| 6232 | "BGP peer-group name\n" |
| 6233 | "Soft reconfig inbound update\n") |
| 6234 | |
| 6235 | DEFUN (clear_bgp_peer_group_in_prefix_filter, |
| 6236 | clear_bgp_peer_group_in_prefix_filter_cmd, |
| 6237 | "clear bgp peer-group WORD in prefix-filter", |
| 6238 | CLEAR_STR |
| 6239 | BGP_STR |
| 6240 | "Clear all members of peer-group\n" |
| 6241 | "BGP peer-group name\n" |
| 6242 | "Soft reconfig inbound update\n" |
| 6243 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6244 | { |
| 6245 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 6246 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6247 | } |
| 6248 | |
| 6249 | ALIAS (clear_bgp_peer_group_in_prefix_filter, |
| 6250 | clear_bgp_ipv6_peer_group_in_prefix_filter_cmd, |
| 6251 | "clear bgp ipv6 peer-group WORD in prefix-filter", |
| 6252 | CLEAR_STR |
| 6253 | BGP_STR |
| 6254 | "Address family\n" |
| 6255 | "Clear all members of peer-group\n" |
| 6256 | "BGP peer-group name\n" |
| 6257 | "Soft reconfig inbound update\n" |
| 6258 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6259 | |
| 6260 | DEFUN (clear_ip_bgp_external_soft_in, |
| 6261 | clear_ip_bgp_external_soft_in_cmd, |
| 6262 | "clear ip bgp external soft in", |
| 6263 | CLEAR_STR |
| 6264 | IP_STR |
| 6265 | BGP_STR |
| 6266 | "Clear all external peers\n" |
| 6267 | "Soft reconfig\n" |
| 6268 | "Soft reconfig inbound update\n") |
| 6269 | { |
| 6270 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6271 | BGP_CLEAR_SOFT_IN, NULL); |
| 6272 | } |
| 6273 | |
| 6274 | ALIAS (clear_ip_bgp_external_soft_in, |
| 6275 | clear_ip_bgp_external_in_cmd, |
| 6276 | "clear ip bgp external in", |
| 6277 | CLEAR_STR |
| 6278 | IP_STR |
| 6279 | BGP_STR |
| 6280 | "Clear all external peers\n" |
| 6281 | "Soft reconfig inbound update\n") |
| 6282 | |
| 6283 | DEFUN (clear_ip_bgp_external_in_prefix_filter, |
| 6284 | clear_ip_bgp_external_in_prefix_filter_cmd, |
| 6285 | "clear ip bgp external in prefix-filter", |
| 6286 | CLEAR_STR |
| 6287 | IP_STR |
| 6288 | BGP_STR |
| 6289 | "Clear all external peers\n" |
| 6290 | "Soft reconfig inbound update\n" |
| 6291 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6292 | { |
| 6293 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6294 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 6295 | } |
| 6296 | |
| 6297 | DEFUN (clear_ip_bgp_external_ipv4_soft_in, |
| 6298 | clear_ip_bgp_external_ipv4_soft_in_cmd, |
| 6299 | "clear ip bgp external ipv4 (unicast|multicast) soft in", |
| 6300 | CLEAR_STR |
| 6301 | IP_STR |
| 6302 | BGP_STR |
| 6303 | "Clear all external peers\n" |
| 6304 | "Address family\n" |
| 6305 | "Address Family modifier\n" |
| 6306 | "Address Family modifier\n" |
| 6307 | "Soft reconfig\n" |
| 6308 | "Soft reconfig inbound update\n") |
| 6309 | { |
| 6310 | if (strncmp (argv[0], "m", 1) == 0) |
| 6311 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 6312 | BGP_CLEAR_SOFT_IN, NULL); |
| 6313 | |
| 6314 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6315 | BGP_CLEAR_SOFT_IN, NULL); |
| 6316 | } |
| 6317 | |
| 6318 | ALIAS (clear_ip_bgp_external_ipv4_soft_in, |
| 6319 | clear_ip_bgp_external_ipv4_in_cmd, |
| 6320 | "clear ip bgp external ipv4 (unicast|multicast) in", |
| 6321 | CLEAR_STR |
| 6322 | IP_STR |
| 6323 | BGP_STR |
| 6324 | "Clear all external peers\n" |
| 6325 | "Address family\n" |
| 6326 | "Address Family modifier\n" |
| 6327 | "Address Family modifier\n" |
| 6328 | "Soft reconfig inbound update\n") |
| 6329 | |
| 6330 | DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter, |
| 6331 | clear_ip_bgp_external_ipv4_in_prefix_filter_cmd, |
| 6332 | "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter", |
| 6333 | CLEAR_STR |
| 6334 | IP_STR |
| 6335 | BGP_STR |
| 6336 | "Clear all external peers\n" |
| 6337 | "Address family\n" |
| 6338 | "Address Family modifier\n" |
| 6339 | "Address Family modifier\n" |
| 6340 | "Soft reconfig inbound update\n" |
| 6341 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6342 | { |
| 6343 | if (strncmp (argv[0], "m", 1) == 0) |
| 6344 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 6345 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 6346 | |
| 6347 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6348 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 6349 | } |
| 6350 | |
| 6351 | DEFUN (clear_bgp_external_soft_in, |
| 6352 | clear_bgp_external_soft_in_cmd, |
| 6353 | "clear bgp external soft in", |
| 6354 | CLEAR_STR |
| 6355 | BGP_STR |
| 6356 | "Clear all external peers\n" |
| 6357 | "Soft reconfig\n" |
| 6358 | "Soft reconfig inbound update\n") |
| 6359 | { |
| 6360 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 6361 | BGP_CLEAR_SOFT_IN, NULL); |
| 6362 | } |
| 6363 | |
| 6364 | ALIAS (clear_bgp_external_soft_in, |
| 6365 | clear_bgp_ipv6_external_soft_in_cmd, |
| 6366 | "clear bgp ipv6 external soft in", |
| 6367 | CLEAR_STR |
| 6368 | BGP_STR |
| 6369 | "Address family\n" |
| 6370 | "Clear all external peers\n" |
| 6371 | "Soft reconfig\n" |
| 6372 | "Soft reconfig inbound update\n") |
| 6373 | |
| 6374 | ALIAS (clear_bgp_external_soft_in, |
| 6375 | clear_bgp_external_in_cmd, |
| 6376 | "clear bgp external in", |
| 6377 | CLEAR_STR |
| 6378 | BGP_STR |
| 6379 | "Clear all external peers\n" |
| 6380 | "Soft reconfig inbound update\n") |
| 6381 | |
| 6382 | ALIAS (clear_bgp_external_soft_in, |
| 6383 | clear_bgp_ipv6_external_in_cmd, |
| 6384 | "clear bgp ipv6 external WORD in", |
| 6385 | CLEAR_STR |
| 6386 | BGP_STR |
| 6387 | "Address family\n" |
| 6388 | "Clear all external peers\n" |
| 6389 | "Soft reconfig inbound update\n") |
| 6390 | |
| 6391 | DEFUN (clear_bgp_external_in_prefix_filter, |
| 6392 | clear_bgp_external_in_prefix_filter_cmd, |
| 6393 | "clear bgp external in prefix-filter", |
| 6394 | CLEAR_STR |
| 6395 | BGP_STR |
| 6396 | "Clear all external peers\n" |
| 6397 | "Soft reconfig inbound update\n" |
| 6398 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6399 | { |
| 6400 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 6401 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 6402 | } |
| 6403 | |
| 6404 | ALIAS (clear_bgp_external_in_prefix_filter, |
| 6405 | clear_bgp_ipv6_external_in_prefix_filter_cmd, |
| 6406 | "clear bgp ipv6 external in prefix-filter", |
| 6407 | CLEAR_STR |
| 6408 | BGP_STR |
| 6409 | "Address family\n" |
| 6410 | "Clear all external peers\n" |
| 6411 | "Soft reconfig inbound update\n" |
| 6412 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6413 | |
| 6414 | DEFUN (clear_ip_bgp_as_soft_in, |
| 6415 | clear_ip_bgp_as_soft_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6416 | "clear ip bgp " CMD_AS_RANGE " soft in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6417 | CLEAR_STR |
| 6418 | IP_STR |
| 6419 | BGP_STR |
| 6420 | "Clear peers with the AS number\n" |
| 6421 | "Soft reconfig\n" |
| 6422 | "Soft reconfig inbound update\n") |
| 6423 | { |
| 6424 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6425 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6426 | } |
| 6427 | |
| 6428 | ALIAS (clear_ip_bgp_as_soft_in, |
| 6429 | clear_ip_bgp_as_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6430 | "clear ip bgp " CMD_AS_RANGE " in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6431 | CLEAR_STR |
| 6432 | IP_STR |
| 6433 | BGP_STR |
| 6434 | "Clear peers with the AS number\n" |
| 6435 | "Soft reconfig inbound update\n") |
| 6436 | |
| 6437 | DEFUN (clear_ip_bgp_as_in_prefix_filter, |
| 6438 | clear_ip_bgp_as_in_prefix_filter_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6439 | "clear ip bgp " CMD_AS_RANGE " in prefix-filter", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6440 | CLEAR_STR |
| 6441 | IP_STR |
| 6442 | BGP_STR |
| 6443 | "Clear peers with the AS number\n" |
| 6444 | "Soft reconfig inbound update\n" |
| 6445 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6446 | { |
| 6447 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6448 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6449 | } |
| 6450 | |
| 6451 | DEFUN (clear_ip_bgp_as_ipv4_soft_in, |
| 6452 | clear_ip_bgp_as_ipv4_soft_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6453 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6454 | CLEAR_STR |
| 6455 | IP_STR |
| 6456 | BGP_STR |
| 6457 | "Clear peers with the AS number\n" |
| 6458 | "Address family\n" |
| 6459 | "Address Family modifier\n" |
| 6460 | "Address Family modifier\n" |
| 6461 | "Soft reconfig\n" |
| 6462 | "Soft reconfig inbound update\n") |
| 6463 | { |
| 6464 | if (strncmp (argv[1], "m", 1) == 0) |
| 6465 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 6466 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6467 | |
| 6468 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6469 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6470 | } |
| 6471 | |
| 6472 | ALIAS (clear_ip_bgp_as_ipv4_soft_in, |
| 6473 | clear_ip_bgp_as_ipv4_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6474 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6475 | CLEAR_STR |
| 6476 | IP_STR |
| 6477 | BGP_STR |
| 6478 | "Clear peers with the AS number\n" |
| 6479 | "Address family\n" |
| 6480 | "Address Family modifier\n" |
| 6481 | "Address Family modifier\n" |
| 6482 | "Soft reconfig inbound update\n") |
| 6483 | |
| 6484 | DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter, |
| 6485 | clear_ip_bgp_as_ipv4_in_prefix_filter_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6486 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) in prefix-filter", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6487 | CLEAR_STR |
| 6488 | IP_STR |
| 6489 | BGP_STR |
| 6490 | "Clear peers with the AS number\n" |
| 6491 | "Address family\n" |
| 6492 | "Address Family modifier\n" |
| 6493 | "Address Family modifier\n" |
| 6494 | "Soft reconfig inbound update\n" |
| 6495 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6496 | { |
| 6497 | if (strncmp (argv[1], "m", 1) == 0) |
| 6498 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 6499 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6500 | |
| 6501 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6502 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6503 | } |
| 6504 | |
| 6505 | DEFUN (clear_ip_bgp_as_vpnv4_soft_in, |
| 6506 | clear_ip_bgp_as_vpnv4_soft_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6507 | "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast soft in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6508 | CLEAR_STR |
| 6509 | IP_STR |
| 6510 | BGP_STR |
| 6511 | "Clear peers with the AS number\n" |
| 6512 | "Address family\n" |
| 6513 | "Address Family modifier\n" |
| 6514 | "Soft reconfig\n" |
| 6515 | "Soft reconfig inbound update\n") |
| 6516 | { |
| 6517 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as, |
| 6518 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6519 | } |
| 6520 | |
| 6521 | ALIAS (clear_ip_bgp_as_vpnv4_soft_in, |
| 6522 | clear_ip_bgp_as_vpnv4_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6523 | "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6524 | CLEAR_STR |
| 6525 | IP_STR |
| 6526 | BGP_STR |
| 6527 | "Clear peers with the AS number\n" |
| 6528 | "Address family\n" |
| 6529 | "Address Family modifier\n" |
| 6530 | "Soft reconfig inbound update\n") |
| 6531 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 6532 | DEFUN (clear_ip_bgp_as_encap_soft_in, |
| 6533 | clear_ip_bgp_as_encap_soft_in_cmd, |
| 6534 | "clear ip bgp " CMD_AS_RANGE " encap unicast soft in", |
| 6535 | CLEAR_STR |
| 6536 | IP_STR |
| 6537 | BGP_STR |
| 6538 | "Clear peers with the AS number\n" |
| 6539 | "Address family\n" |
| 6540 | "Address Family modifier\n" |
| 6541 | "Soft reconfig\n" |
| 6542 | "Soft reconfig inbound update\n") |
| 6543 | { |
| 6544 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as, |
| 6545 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6546 | } |
| 6547 | |
| 6548 | ALIAS (clear_ip_bgp_as_encap_soft_in, |
| 6549 | clear_ip_bgp_as_encap_in_cmd, |
| 6550 | "clear ip bgp " CMD_AS_RANGE " encap unicast in", |
| 6551 | CLEAR_STR |
| 6552 | IP_STR |
| 6553 | BGP_STR |
| 6554 | "Clear peers with the AS number\n" |
| 6555 | "Address family\n" |
| 6556 | "Address Family modifier\n" |
| 6557 | "Soft reconfig inbound update\n") |
| 6558 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6559 | DEFUN (clear_bgp_as_soft_in, |
| 6560 | clear_bgp_as_soft_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6561 | "clear bgp " CMD_AS_RANGE " soft in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6562 | CLEAR_STR |
| 6563 | BGP_STR |
| 6564 | "Clear peers with the AS number\n" |
| 6565 | "Soft reconfig\n" |
| 6566 | "Soft reconfig inbound update\n") |
| 6567 | { |
| 6568 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 6569 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6570 | } |
| 6571 | |
| 6572 | ALIAS (clear_bgp_as_soft_in, |
| 6573 | clear_bgp_ipv6_as_soft_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6574 | "clear bgp ipv6 " CMD_AS_RANGE " soft in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6575 | CLEAR_STR |
| 6576 | BGP_STR |
| 6577 | "Address family\n" |
| 6578 | "Clear peers with the AS number\n" |
| 6579 | "Soft reconfig\n" |
| 6580 | "Soft reconfig inbound update\n") |
| 6581 | |
| 6582 | ALIAS (clear_bgp_as_soft_in, |
| 6583 | clear_bgp_as_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6584 | "clear bgp " CMD_AS_RANGE " in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6585 | CLEAR_STR |
| 6586 | BGP_STR |
| 6587 | "Clear peers with the AS number\n" |
| 6588 | "Soft reconfig inbound update\n") |
| 6589 | |
| 6590 | ALIAS (clear_bgp_as_soft_in, |
| 6591 | clear_bgp_ipv6_as_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6592 | "clear bgp ipv6 " CMD_AS_RANGE " in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6593 | CLEAR_STR |
| 6594 | BGP_STR |
| 6595 | "Address family\n" |
| 6596 | "Clear peers with the AS number\n" |
| 6597 | "Soft reconfig inbound update\n") |
| 6598 | |
| 6599 | DEFUN (clear_bgp_as_in_prefix_filter, |
| 6600 | clear_bgp_as_in_prefix_filter_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6601 | "clear bgp " CMD_AS_RANGE " in prefix-filter", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6602 | CLEAR_STR |
| 6603 | BGP_STR |
| 6604 | "Clear peers with the AS number\n" |
| 6605 | "Soft reconfig inbound update\n" |
| 6606 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6607 | { |
| 6608 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 6609 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6610 | } |
| 6611 | |
| 6612 | ALIAS (clear_bgp_as_in_prefix_filter, |
| 6613 | clear_bgp_ipv6_as_in_prefix_filter_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6614 | "clear bgp ipv6 " CMD_AS_RANGE " in prefix-filter", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6615 | CLEAR_STR |
| 6616 | BGP_STR |
| 6617 | "Address family\n" |
| 6618 | "Clear peers with the AS number\n" |
| 6619 | "Soft reconfig inbound update\n" |
| 6620 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 6621 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6622 | /* Both soft-reconfiguration */ |
| 6623 | DEFUN (clear_ip_bgp_all_soft, |
| 6624 | clear_ip_bgp_all_soft_cmd, |
| 6625 | "clear ip bgp * soft", |
| 6626 | CLEAR_STR |
| 6627 | IP_STR |
| 6628 | BGP_STR |
| 6629 | "Clear all peers\n" |
| 6630 | "Soft reconfig\n") |
| 6631 | { |
| 6632 | if (argc == 1) |
| 6633 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 6634 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6635 | |
| 6636 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 6637 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6638 | } |
| 6639 | |
| 6640 | ALIAS (clear_ip_bgp_all_soft, |
| 6641 | clear_ip_bgp_instance_all_soft_cmd, |
| 6642 | "clear ip bgp view WORD * soft", |
| 6643 | CLEAR_STR |
| 6644 | IP_STR |
| 6645 | BGP_STR |
| 6646 | "BGP view\n" |
| 6647 | "view name\n" |
| 6648 | "Clear all peers\n" |
| 6649 | "Soft reconfig\n") |
| 6650 | |
| 6651 | |
| 6652 | DEFUN (clear_ip_bgp_all_ipv4_soft, |
| 6653 | clear_ip_bgp_all_ipv4_soft_cmd, |
| 6654 | "clear ip bgp * ipv4 (unicast|multicast) soft", |
| 6655 | CLEAR_STR |
| 6656 | IP_STR |
| 6657 | BGP_STR |
| 6658 | "Clear all peers\n" |
| 6659 | "Address family\n" |
| 6660 | "Address Family Modifier\n" |
| 6661 | "Address Family Modifier\n" |
| 6662 | "Soft reconfig\n") |
| 6663 | { |
| 6664 | if (strncmp (argv[0], "m", 1) == 0) |
| 6665 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 6666 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6667 | |
| 6668 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 6669 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6670 | } |
| 6671 | |
| 6672 | DEFUN (clear_ip_bgp_instance_all_ipv4_soft, |
| 6673 | clear_ip_bgp_instance_all_ipv4_soft_cmd, |
| 6674 | "clear ip bgp view WORD * ipv4 (unicast|multicast) soft", |
| 6675 | CLEAR_STR |
| 6676 | IP_STR |
| 6677 | BGP_STR |
| 6678 | "BGP view\n" |
| 6679 | "view name\n" |
| 6680 | "Clear all peers\n" |
| 6681 | "Address family\n" |
| 6682 | "Address Family Modifier\n" |
| 6683 | "Address Family Modifier\n" |
| 6684 | "Soft reconfig\n") |
| 6685 | { |
| 6686 | if (strncmp (argv[1], "m", 1) == 0) |
| 6687 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 6688 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6689 | |
| 6690 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 6691 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6692 | } |
| 6693 | |
| 6694 | DEFUN (clear_ip_bgp_all_vpnv4_soft, |
| 6695 | clear_ip_bgp_all_vpnv4_soft_cmd, |
| 6696 | "clear ip bgp * vpnv4 unicast soft", |
| 6697 | CLEAR_STR |
| 6698 | IP_STR |
| 6699 | BGP_STR |
| 6700 | "Clear all peers\n" |
| 6701 | "Address family\n" |
| 6702 | "Address Family Modifier\n" |
| 6703 | "Soft reconfig\n") |
| 6704 | { |
| 6705 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all, |
| 6706 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6707 | } |
| 6708 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 6709 | DEFUN (clear_ip_bgp_all_encap_soft, |
| 6710 | clear_ip_bgp_all_encap_soft_cmd, |
| 6711 | "clear ip bgp * encap unicast soft", |
| 6712 | CLEAR_STR |
| 6713 | IP_STR |
| 6714 | BGP_STR |
| 6715 | "Clear all peers\n" |
| 6716 | "Address family\n" |
| 6717 | "Address Family Modifier\n" |
| 6718 | "Soft reconfig\n") |
| 6719 | { |
| 6720 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all, |
| 6721 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6722 | } |
| 6723 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6724 | DEFUN (clear_bgp_all_soft, |
| 6725 | clear_bgp_all_soft_cmd, |
| 6726 | "clear bgp * soft", |
| 6727 | CLEAR_STR |
| 6728 | BGP_STR |
| 6729 | "Clear all peers\n" |
| 6730 | "Soft reconfig\n") |
| 6731 | { |
| 6732 | if (argc == 1) |
| 6733 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 6734 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6735 | |
| 6736 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 6737 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6738 | } |
| 6739 | |
| 6740 | ALIAS (clear_bgp_all_soft, |
| 6741 | clear_bgp_instance_all_soft_cmd, |
| 6742 | "clear bgp view WORD * soft", |
| 6743 | CLEAR_STR |
| 6744 | BGP_STR |
| 6745 | "BGP view\n" |
| 6746 | "view name\n" |
| 6747 | "Clear all peers\n" |
| 6748 | "Soft reconfig\n") |
| 6749 | |
| 6750 | ALIAS (clear_bgp_all_soft, |
| 6751 | clear_bgp_ipv6_all_soft_cmd, |
| 6752 | "clear bgp ipv6 * soft", |
| 6753 | CLEAR_STR |
| 6754 | BGP_STR |
| 6755 | "Address family\n" |
| 6756 | "Clear all peers\n" |
| 6757 | "Soft reconfig\n") |
| 6758 | |
| 6759 | DEFUN (clear_ip_bgp_peer_soft, |
| 6760 | clear_ip_bgp_peer_soft_cmd, |
| 6761 | "clear ip bgp A.B.C.D soft", |
| 6762 | CLEAR_STR |
| 6763 | IP_STR |
| 6764 | BGP_STR |
| 6765 | "BGP neighbor address to clear\n" |
| 6766 | "Soft reconfig\n") |
| 6767 | { |
| 6768 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 6769 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6770 | } |
| 6771 | |
| 6772 | DEFUN (clear_ip_bgp_peer_ipv4_soft, |
| 6773 | clear_ip_bgp_peer_ipv4_soft_cmd, |
| 6774 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft", |
| 6775 | CLEAR_STR |
| 6776 | IP_STR |
| 6777 | BGP_STR |
| 6778 | "BGP neighbor address to clear\n" |
| 6779 | "Address family\n" |
| 6780 | "Address Family Modifier\n" |
| 6781 | "Address Family Modifier\n" |
| 6782 | "Soft reconfig\n") |
| 6783 | { |
| 6784 | if (strncmp (argv[1], "m", 1) == 0) |
| 6785 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 6786 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6787 | |
| 6788 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 6789 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6790 | } |
| 6791 | |
| 6792 | DEFUN (clear_ip_bgp_peer_vpnv4_soft, |
| 6793 | clear_ip_bgp_peer_vpnv4_soft_cmd, |
| 6794 | "clear ip bgp A.B.C.D vpnv4 unicast soft", |
| 6795 | CLEAR_STR |
| 6796 | IP_STR |
| 6797 | BGP_STR |
| 6798 | "BGP neighbor address to clear\n" |
| 6799 | "Address family\n" |
| 6800 | "Address Family Modifier\n" |
| 6801 | "Soft reconfig\n") |
| 6802 | { |
| 6803 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer, |
| 6804 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6805 | } |
| 6806 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 6807 | DEFUN (clear_ip_bgp_peer_encap_soft, |
| 6808 | clear_ip_bgp_peer_encap_soft_cmd, |
| 6809 | "clear ip bgp A.B.C.D encap unicast soft", |
| 6810 | CLEAR_STR |
| 6811 | IP_STR |
| 6812 | BGP_STR |
| 6813 | "BGP neighbor address to clear\n" |
| 6814 | "Address family\n" |
| 6815 | "Address Family Modifier\n" |
| 6816 | "Soft reconfig\n") |
| 6817 | { |
| 6818 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer, |
| 6819 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6820 | } |
| 6821 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6822 | DEFUN (clear_bgp_peer_soft, |
| 6823 | clear_bgp_peer_soft_cmd, |
| 6824 | "clear bgp (A.B.C.D|X:X::X:X) soft", |
| 6825 | CLEAR_STR |
| 6826 | BGP_STR |
| 6827 | "BGP neighbor address to clear\n" |
| 6828 | "BGP IPv6 neighbor to clear\n" |
| 6829 | "Soft reconfig\n") |
| 6830 | { |
| 6831 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 6832 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6833 | } |
| 6834 | |
| 6835 | ALIAS (clear_bgp_peer_soft, |
| 6836 | clear_bgp_ipv6_peer_soft_cmd, |
| 6837 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft", |
| 6838 | CLEAR_STR |
| 6839 | BGP_STR |
| 6840 | "Address family\n" |
| 6841 | "BGP neighbor address to clear\n" |
| 6842 | "BGP IPv6 neighbor to clear\n" |
| 6843 | "Soft reconfig\n") |
| 6844 | |
| 6845 | DEFUN (clear_ip_bgp_peer_group_soft, |
| 6846 | clear_ip_bgp_peer_group_soft_cmd, |
| 6847 | "clear ip bgp peer-group WORD soft", |
| 6848 | CLEAR_STR |
| 6849 | IP_STR |
| 6850 | BGP_STR |
| 6851 | "Clear all members of peer-group\n" |
| 6852 | "BGP peer-group name\n" |
| 6853 | "Soft reconfig\n") |
| 6854 | { |
| 6855 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6856 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6857 | } |
| 6858 | |
| 6859 | DEFUN (clear_ip_bgp_peer_group_ipv4_soft, |
| 6860 | clear_ip_bgp_peer_group_ipv4_soft_cmd, |
| 6861 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft", |
| 6862 | CLEAR_STR |
| 6863 | IP_STR |
| 6864 | BGP_STR |
| 6865 | "Clear all members of peer-group\n" |
| 6866 | "BGP peer-group name\n" |
| 6867 | "Address family\n" |
| 6868 | "Address Family modifier\n" |
| 6869 | "Address Family modifier\n" |
| 6870 | "Soft reconfig\n") |
| 6871 | { |
| 6872 | if (strncmp (argv[1], "m", 1) == 0) |
| 6873 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 6874 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6875 | |
| 6876 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6877 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6878 | } |
| 6879 | |
| 6880 | DEFUN (clear_bgp_peer_group_soft, |
| 6881 | clear_bgp_peer_group_soft_cmd, |
| 6882 | "clear bgp peer-group WORD soft", |
| 6883 | CLEAR_STR |
| 6884 | BGP_STR |
| 6885 | "Clear all members of peer-group\n" |
| 6886 | "BGP peer-group name\n" |
| 6887 | "Soft reconfig\n") |
| 6888 | { |
| 6889 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 6890 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6891 | } |
| 6892 | |
| 6893 | ALIAS (clear_bgp_peer_group_soft, |
| 6894 | clear_bgp_ipv6_peer_group_soft_cmd, |
| 6895 | "clear bgp ipv6 peer-group WORD soft", |
| 6896 | CLEAR_STR |
| 6897 | BGP_STR |
| 6898 | "Address family\n" |
| 6899 | "Clear all members of peer-group\n" |
| 6900 | "BGP peer-group name\n" |
| 6901 | "Soft reconfig\n") |
| 6902 | |
| 6903 | DEFUN (clear_ip_bgp_external_soft, |
| 6904 | clear_ip_bgp_external_soft_cmd, |
| 6905 | "clear ip bgp external soft", |
| 6906 | CLEAR_STR |
| 6907 | IP_STR |
| 6908 | BGP_STR |
| 6909 | "Clear all external peers\n" |
| 6910 | "Soft reconfig\n") |
| 6911 | { |
| 6912 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6913 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6914 | } |
| 6915 | |
| 6916 | DEFUN (clear_ip_bgp_external_ipv4_soft, |
| 6917 | clear_ip_bgp_external_ipv4_soft_cmd, |
| 6918 | "clear ip bgp external ipv4 (unicast|multicast) soft", |
| 6919 | CLEAR_STR |
| 6920 | IP_STR |
| 6921 | BGP_STR |
| 6922 | "Clear all external peers\n" |
| 6923 | "Address family\n" |
| 6924 | "Address Family modifier\n" |
| 6925 | "Address Family modifier\n" |
| 6926 | "Soft reconfig\n") |
| 6927 | { |
| 6928 | if (strncmp (argv[0], "m", 1) == 0) |
| 6929 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 6930 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6931 | |
| 6932 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6933 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6934 | } |
| 6935 | |
| 6936 | DEFUN (clear_bgp_external_soft, |
| 6937 | clear_bgp_external_soft_cmd, |
| 6938 | "clear bgp external soft", |
| 6939 | CLEAR_STR |
| 6940 | BGP_STR |
| 6941 | "Clear all external peers\n" |
| 6942 | "Soft reconfig\n") |
| 6943 | { |
| 6944 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 6945 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6946 | } |
| 6947 | |
| 6948 | ALIAS (clear_bgp_external_soft, |
| 6949 | clear_bgp_ipv6_external_soft_cmd, |
| 6950 | "clear bgp ipv6 external soft", |
| 6951 | CLEAR_STR |
| 6952 | BGP_STR |
| 6953 | "Address family\n" |
| 6954 | "Clear all external peers\n" |
| 6955 | "Soft reconfig\n") |
| 6956 | |
| 6957 | DEFUN (clear_ip_bgp_as_soft, |
| 6958 | clear_ip_bgp_as_soft_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6959 | "clear ip bgp " CMD_AS_RANGE " soft", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6960 | CLEAR_STR |
| 6961 | IP_STR |
| 6962 | BGP_STR |
| 6963 | "Clear peers with the AS number\n" |
| 6964 | "Soft reconfig\n") |
| 6965 | { |
| 6966 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6967 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6968 | } |
| 6969 | |
| 6970 | DEFUN (clear_ip_bgp_as_ipv4_soft, |
| 6971 | clear_ip_bgp_as_ipv4_soft_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6972 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6973 | CLEAR_STR |
| 6974 | IP_STR |
| 6975 | BGP_STR |
| 6976 | "Clear peers with the AS number\n" |
| 6977 | "Address family\n" |
| 6978 | "Address Family Modifier\n" |
| 6979 | "Address Family Modifier\n" |
| 6980 | "Soft reconfig\n") |
| 6981 | { |
| 6982 | if (strncmp (argv[1], "m", 1) == 0) |
| 6983 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 6984 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6985 | |
| 6986 | return bgp_clear_vty (vty, NULL,AFI_IP, SAFI_UNICAST, clear_as, |
| 6987 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6988 | } |
| 6989 | |
| 6990 | DEFUN (clear_ip_bgp_as_vpnv4_soft, |
| 6991 | clear_ip_bgp_as_vpnv4_soft_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6992 | "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast soft", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6993 | CLEAR_STR |
| 6994 | IP_STR |
| 6995 | BGP_STR |
| 6996 | "Clear peers with the AS number\n" |
| 6997 | "Address family\n" |
| 6998 | "Address Family Modifier\n" |
| 6999 | "Soft reconfig\n") |
| 7000 | { |
| 7001 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as, |
| 7002 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 7003 | } |
| 7004 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 7005 | DEFUN (clear_ip_bgp_as_encap_soft, |
| 7006 | clear_ip_bgp_as_encap_soft_cmd, |
| 7007 | "clear ip bgp " CMD_AS_RANGE " encap unicast soft", |
| 7008 | CLEAR_STR |
| 7009 | IP_STR |
| 7010 | BGP_STR |
| 7011 | "Clear peers with the AS number\n" |
| 7012 | "Address family\n" |
| 7013 | "Address Family Modifier\n" |
| 7014 | "Soft reconfig\n") |
| 7015 | { |
| 7016 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as, |
| 7017 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 7018 | } |
| 7019 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7020 | DEFUN (clear_bgp_as_soft, |
| 7021 | clear_bgp_as_soft_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 7022 | "clear bgp " CMD_AS_RANGE " soft", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7023 | CLEAR_STR |
| 7024 | BGP_STR |
| 7025 | "Clear peers with the AS number\n" |
| 7026 | "Soft reconfig\n") |
| 7027 | { |
| 7028 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 7029 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 7030 | } |
| 7031 | |
| 7032 | ALIAS (clear_bgp_as_soft, |
| 7033 | clear_bgp_ipv6_as_soft_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 7034 | "clear bgp ipv6 " CMD_AS_RANGE " soft", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7035 | CLEAR_STR |
| 7036 | BGP_STR |
| 7037 | "Address family\n" |
| 7038 | "Clear peers with the AS number\n" |
| 7039 | "Soft reconfig\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 7040 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7041 | /* RS-client soft reconfiguration. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7042 | DEFUN (clear_bgp_all_rsclient, |
| 7043 | clear_bgp_all_rsclient_cmd, |
| 7044 | "clear bgp * rsclient", |
| 7045 | CLEAR_STR |
| 7046 | BGP_STR |
| 7047 | "Clear all peers\n" |
| 7048 | "Soft reconfig for rsclient RIB\n") |
| 7049 | { |
| 7050 | if (argc == 1) |
| 7051 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 7052 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 7053 | |
| 7054 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 7055 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 7056 | } |
| 7057 | |
| 7058 | ALIAS (clear_bgp_all_rsclient, |
| 7059 | clear_bgp_ipv6_all_rsclient_cmd, |
| 7060 | "clear bgp ipv6 * rsclient", |
| 7061 | CLEAR_STR |
| 7062 | BGP_STR |
| 7063 | "Address family\n" |
| 7064 | "Clear all peers\n" |
| 7065 | "Soft reconfig for rsclient RIB\n") |
| 7066 | |
| 7067 | ALIAS (clear_bgp_all_rsclient, |
| 7068 | clear_bgp_instance_all_rsclient_cmd, |
| 7069 | "clear bgp view WORD * rsclient", |
| 7070 | CLEAR_STR |
| 7071 | BGP_STR |
| 7072 | "BGP view\n" |
| 7073 | "view name\n" |
| 7074 | "Clear all peers\n" |
| 7075 | "Soft reconfig for rsclient RIB\n") |
| 7076 | |
| 7077 | ALIAS (clear_bgp_all_rsclient, |
| 7078 | clear_bgp_ipv6_instance_all_rsclient_cmd, |
| 7079 | "clear bgp ipv6 view WORD * rsclient", |
| 7080 | CLEAR_STR |
| 7081 | BGP_STR |
| 7082 | "Address family\n" |
| 7083 | "BGP view\n" |
| 7084 | "view name\n" |
| 7085 | "Clear all peers\n" |
| 7086 | "Soft reconfig for rsclient RIB\n") |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7087 | |
| 7088 | DEFUN (clear_ip_bgp_all_rsclient, |
| 7089 | clear_ip_bgp_all_rsclient_cmd, |
| 7090 | "clear ip bgp * rsclient", |
| 7091 | CLEAR_STR |
| 7092 | IP_STR |
| 7093 | BGP_STR |
| 7094 | "Clear all peers\n" |
| 7095 | "Soft reconfig for rsclient RIB\n") |
| 7096 | { |
| 7097 | if (argc == 1) |
| 7098 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 7099 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 7100 | |
| 7101 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 7102 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 7103 | } |
| 7104 | |
| 7105 | ALIAS (clear_ip_bgp_all_rsclient, |
| 7106 | clear_ip_bgp_instance_all_rsclient_cmd, |
| 7107 | "clear ip bgp view WORD * rsclient", |
| 7108 | CLEAR_STR |
| 7109 | IP_STR |
| 7110 | BGP_STR |
| 7111 | "BGP view\n" |
| 7112 | "view name\n" |
| 7113 | "Clear all peers\n" |
| 7114 | "Soft reconfig for rsclient RIB\n") |
| 7115 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7116 | DEFUN (clear_bgp_peer_rsclient, |
| 7117 | clear_bgp_peer_rsclient_cmd, |
| 7118 | "clear bgp (A.B.C.D|X:X::X:X) rsclient", |
| 7119 | CLEAR_STR |
| 7120 | BGP_STR |
| 7121 | "BGP neighbor IP address to clear\n" |
| 7122 | "BGP IPv6 neighbor to clear\n" |
| 7123 | "Soft reconfig for rsclient RIB\n") |
| 7124 | { |
| 7125 | if (argc == 2) |
| 7126 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_peer, |
| 7127 | BGP_CLEAR_SOFT_RSCLIENT, argv[1]); |
| 7128 | |
| 7129 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 7130 | BGP_CLEAR_SOFT_RSCLIENT, argv[0]); |
| 7131 | } |
| 7132 | |
| 7133 | ALIAS (clear_bgp_peer_rsclient, |
| 7134 | clear_bgp_ipv6_peer_rsclient_cmd, |
| 7135 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) rsclient", |
| 7136 | CLEAR_STR |
| 7137 | BGP_STR |
| 7138 | "Address family\n" |
| 7139 | "BGP neighbor IP address to clear\n" |
| 7140 | "BGP IPv6 neighbor to clear\n" |
| 7141 | "Soft reconfig for rsclient RIB\n") |
| 7142 | |
| 7143 | ALIAS (clear_bgp_peer_rsclient, |
| 7144 | clear_bgp_instance_peer_rsclient_cmd, |
| 7145 | "clear bgp view WORD (A.B.C.D|X:X::X:X) rsclient", |
| 7146 | CLEAR_STR |
| 7147 | BGP_STR |
| 7148 | "BGP view\n" |
| 7149 | "view name\n" |
| 7150 | "BGP neighbor IP address to clear\n" |
| 7151 | "BGP IPv6 neighbor to clear\n" |
| 7152 | "Soft reconfig for rsclient RIB\n") |
| 7153 | |
| 7154 | ALIAS (clear_bgp_peer_rsclient, |
| 7155 | clear_bgp_ipv6_instance_peer_rsclient_cmd, |
| 7156 | "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X) rsclient", |
| 7157 | CLEAR_STR |
| 7158 | BGP_STR |
| 7159 | "Address family\n" |
| 7160 | "BGP view\n" |
| 7161 | "view name\n" |
| 7162 | "BGP neighbor IP address to clear\n" |
| 7163 | "BGP IPv6 neighbor to clear\n" |
| 7164 | "Soft reconfig for rsclient RIB\n") |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7165 | |
| 7166 | DEFUN (clear_ip_bgp_peer_rsclient, |
| 7167 | clear_ip_bgp_peer_rsclient_cmd, |
| 7168 | "clear ip bgp (A.B.C.D|X:X::X:X) rsclient", |
| 7169 | CLEAR_STR |
| 7170 | IP_STR |
| 7171 | BGP_STR |
| 7172 | "BGP neighbor IP address to clear\n" |
| 7173 | "BGP IPv6 neighbor to clear\n" |
| 7174 | "Soft reconfig for rsclient RIB\n") |
| 7175 | { |
| 7176 | if (argc == 2) |
| 7177 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_peer, |
| 7178 | BGP_CLEAR_SOFT_RSCLIENT, argv[1]); |
| 7179 | |
| 7180 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 7181 | BGP_CLEAR_SOFT_RSCLIENT, argv[0]); |
| 7182 | } |
| 7183 | |
| 7184 | ALIAS (clear_ip_bgp_peer_rsclient, |
| 7185 | clear_ip_bgp_instance_peer_rsclient_cmd, |
| 7186 | "clear ip bgp view WORD (A.B.C.D|X:X::X:X) rsclient", |
| 7187 | CLEAR_STR |
| 7188 | IP_STR |
| 7189 | BGP_STR |
| 7190 | "BGP view\n" |
| 7191 | "view name\n" |
| 7192 | "BGP neighbor IP address to clear\n" |
| 7193 | "BGP IPv6 neighbor to clear\n" |
| 7194 | "Soft reconfig for rsclient RIB\n") |
| 7195 | |
Michael Lambert | e0081f7 | 2008-11-16 20:12:04 +0000 | [diff] [blame] | 7196 | DEFUN (show_bgp_views, |
| 7197 | show_bgp_views_cmd, |
| 7198 | "show bgp views", |
| 7199 | SHOW_STR |
| 7200 | BGP_STR |
| 7201 | "Show the defined BGP views\n") |
| 7202 | { |
| 7203 | struct list *inst = bm->bgp; |
| 7204 | struct listnode *node; |
| 7205 | struct bgp *bgp; |
| 7206 | |
| 7207 | if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE)) |
| 7208 | { |
| 7209 | vty_out (vty, "Multiple BGP views are not defined%s", VTY_NEWLINE); |
| 7210 | return CMD_WARNING; |
| 7211 | } |
| 7212 | |
| 7213 | vty_out (vty, "Defined BGP views:%s", VTY_NEWLINE); |
| 7214 | for (ALL_LIST_ELEMENTS_RO(inst, node, bgp)) |
| 7215 | vty_out (vty, "\t%s (AS%u)%s", |
| 7216 | bgp->name ? bgp->name : "(null)", |
| 7217 | bgp->as, VTY_NEWLINE); |
| 7218 | |
| 7219 | return CMD_SUCCESS; |
| 7220 | } |
| 7221 | |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7222 | DEFUN (show_bgp_memory, |
| 7223 | show_bgp_memory_cmd, |
| 7224 | "show bgp memory", |
| 7225 | SHOW_STR |
| 7226 | BGP_STR |
| 7227 | "Global BGP memory statistics\n") |
| 7228 | { |
| 7229 | char memstrbuf[MTYPE_MEMSTR_LEN]; |
| 7230 | unsigned long count; |
| 7231 | |
| 7232 | /* RIB related usage stats */ |
| 7233 | count = mtype_stats_alloc (MTYPE_BGP_NODE); |
| 7234 | vty_out (vty, "%ld RIB nodes, using %s of memory%s", count, |
| 7235 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7236 | count * sizeof (struct bgp_node)), |
| 7237 | VTY_NEWLINE); |
| 7238 | |
| 7239 | count = mtype_stats_alloc (MTYPE_BGP_ROUTE); |
| 7240 | vty_out (vty, "%ld BGP routes, using %s of memory%s", count, |
| 7241 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7242 | count * sizeof (struct bgp_info)), |
| 7243 | VTY_NEWLINE); |
Paul Jakma | fb982c2 | 2007-05-04 20:15:47 +0000 | [diff] [blame] | 7244 | if ((count = mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA))) |
| 7245 | vty_out (vty, "%ld BGP route ancillaries, using %s of memory%s", count, |
| 7246 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7247 | count * sizeof (struct bgp_info_extra)), |
| 7248 | VTY_NEWLINE); |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7249 | |
| 7250 | if ((count = mtype_stats_alloc (MTYPE_BGP_STATIC))) |
| 7251 | vty_out (vty, "%ld Static routes, using %s of memory%s", count, |
| 7252 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7253 | count * sizeof (struct bgp_static)), |
| 7254 | VTY_NEWLINE); |
| 7255 | |
| 7256 | /* Adj-In/Out */ |
| 7257 | if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_IN))) |
| 7258 | vty_out (vty, "%ld Adj-In entries, using %s of memory%s", count, |
| 7259 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7260 | count * sizeof (struct bgp_adj_in)), |
| 7261 | VTY_NEWLINE); |
| 7262 | if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_OUT))) |
| 7263 | vty_out (vty, "%ld Adj-Out entries, using %s of memory%s", count, |
| 7264 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7265 | count * sizeof (struct bgp_adj_out)), |
| 7266 | VTY_NEWLINE); |
| 7267 | |
| 7268 | if ((count = mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE))) |
| 7269 | vty_out (vty, "%ld Nexthop cache entries, using %s of memory%s", count, |
| 7270 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7271 | count * sizeof (struct bgp_nexthop_cache)), |
| 7272 | VTY_NEWLINE); |
| 7273 | |
| 7274 | if ((count = mtype_stats_alloc (MTYPE_BGP_DAMP_INFO))) |
| 7275 | vty_out (vty, "%ld Dampening entries, using %s of memory%s", count, |
| 7276 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7277 | count * sizeof (struct bgp_damp_info)), |
| 7278 | VTY_NEWLINE); |
| 7279 | |
| 7280 | /* Attributes */ |
| 7281 | count = attr_count(); |
| 7282 | vty_out (vty, "%ld BGP attributes, using %s of memory%s", count, |
| 7283 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7284 | count * sizeof(struct attr)), |
| 7285 | VTY_NEWLINE); |
Paul Jakma | fb982c2 | 2007-05-04 20:15:47 +0000 | [diff] [blame] | 7286 | if ((count = mtype_stats_alloc (MTYPE_ATTR_EXTRA))) |
| 7287 | vty_out (vty, "%ld BGP extra attributes, using %s of memory%s", count, |
| 7288 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7289 | count * sizeof(struct attr_extra)), |
| 7290 | VTY_NEWLINE); |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7291 | |
| 7292 | if ((count = attr_unknown_count())) |
| 7293 | vty_out (vty, "%ld unknown attributes%s", count, VTY_NEWLINE); |
| 7294 | |
| 7295 | /* AS_PATH attributes */ |
| 7296 | count = aspath_count (); |
| 7297 | vty_out (vty, "%ld BGP AS-PATH entries, using %s of memory%s", count, |
| 7298 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7299 | count * sizeof (struct aspath)), |
| 7300 | VTY_NEWLINE); |
| 7301 | |
| 7302 | count = mtype_stats_alloc (MTYPE_AS_SEG); |
| 7303 | vty_out (vty, "%ld BGP AS-PATH segments, using %s of memory%s", count, |
| 7304 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7305 | count * sizeof (struct assegment)), |
| 7306 | VTY_NEWLINE); |
| 7307 | |
| 7308 | /* Other attributes */ |
| 7309 | if ((count = community_count ())) |
| 7310 | vty_out (vty, "%ld BGP community entries, using %s of memory%s", count, |
| 7311 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7312 | count * sizeof (struct community)), |
| 7313 | VTY_NEWLINE); |
| 7314 | if ((count = mtype_stats_alloc (MTYPE_ECOMMUNITY))) |
| 7315 | vty_out (vty, "%ld BGP community entries, using %s of memory%s", count, |
| 7316 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7317 | count * sizeof (struct ecommunity)), |
| 7318 | VTY_NEWLINE); |
| 7319 | |
| 7320 | if ((count = mtype_stats_alloc (MTYPE_CLUSTER))) |
| 7321 | vty_out (vty, "%ld Cluster lists, using %s of memory%s", count, |
| 7322 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7323 | count * sizeof (struct cluster_list)), |
| 7324 | VTY_NEWLINE); |
| 7325 | |
| 7326 | /* Peer related usage */ |
| 7327 | count = mtype_stats_alloc (MTYPE_BGP_PEER); |
| 7328 | vty_out (vty, "%ld peers, using %s of memory%s", count, |
| 7329 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7330 | count * sizeof (struct peer)), |
| 7331 | VTY_NEWLINE); |
| 7332 | |
| 7333 | if ((count = mtype_stats_alloc (MTYPE_PEER_GROUP))) |
| 7334 | vty_out (vty, "%ld peer groups, using %s of memory%s", count, |
| 7335 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7336 | count * sizeof (struct peer_group)), |
| 7337 | VTY_NEWLINE); |
| 7338 | |
| 7339 | /* Other */ |
| 7340 | if ((count = mtype_stats_alloc (MTYPE_HASH))) |
| 7341 | vty_out (vty, "%ld hash tables, using %s of memory%s", count, |
| 7342 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7343 | count * sizeof (struct hash)), |
| 7344 | VTY_NEWLINE); |
| 7345 | if ((count = mtype_stats_alloc (MTYPE_HASH_BACKET))) |
| 7346 | vty_out (vty, "%ld hash buckets, using %s of memory%s", count, |
| 7347 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7348 | count * sizeof (struct hash_backet)), |
| 7349 | VTY_NEWLINE); |
| 7350 | if ((count = mtype_stats_alloc (MTYPE_BGP_REGEXP))) |
| 7351 | vty_out (vty, "%ld compiled regexes, using %s of memory%s", count, |
| 7352 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7353 | count * sizeof (regex_t)), |
| 7354 | VTY_NEWLINE); |
| 7355 | return CMD_SUCCESS; |
| 7356 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7357 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7358 | /* Show BGP peer's summary information. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7359 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7360 | bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi) |
| 7361 | { |
| 7362 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 7363 | struct listnode *node, *nnode; |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7364 | unsigned int count = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7365 | char timebuf[BGP_UPTIME_LEN]; |
| 7366 | int len; |
| 7367 | |
| 7368 | /* Header string for each address family. */ |
Milan Kocian | cb4fc59 | 2014-12-01 12:48:25 +0000 | [diff] [blame] | 7369 | static char header[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd"; |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7370 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 7371 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7372 | { |
| 7373 | if (peer->afc[afi][safi]) |
| 7374 | { |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7375 | if (!count) |
| 7376 | { |
| 7377 | unsigned long ents; |
| 7378 | char memstrbuf[MTYPE_MEMSTR_LEN]; |
| 7379 | |
| 7380 | /* Usage summary and header */ |
| 7381 | vty_out (vty, |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 7382 | "BGP router identifier %s, local AS number %u%s", |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7383 | inet_ntoa (bgp->router_id), bgp->as, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7384 | |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7385 | ents = bgp_table_count (bgp->rib[afi][safi]); |
| 7386 | vty_out (vty, "RIB entries %ld, using %s of memory%s", ents, |
| 7387 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7388 | ents * sizeof (struct bgp_node)), |
| 7389 | VTY_NEWLINE); |
| 7390 | |
| 7391 | /* Peer related usage */ |
| 7392 | ents = listcount (bgp->peer); |
| 7393 | vty_out (vty, "Peers %ld, using %s of memory%s", |
| 7394 | ents, |
| 7395 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7396 | ents * sizeof (struct peer)), |
| 7397 | VTY_NEWLINE); |
| 7398 | |
| 7399 | if ((ents = listcount (bgp->rsclient))) |
| 7400 | vty_out (vty, "RS-Client peers %ld, using %s of memory%s", |
| 7401 | ents, |
| 7402 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7403 | ents * sizeof (struct peer)), |
| 7404 | VTY_NEWLINE); |
| 7405 | |
| 7406 | if ((ents = listcount (bgp->group))) |
| 7407 | vty_out (vty, "Peer groups %ld, using %s of memory%s", ents, |
| 7408 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7409 | ents * sizeof (struct peer_group)), |
| 7410 | VTY_NEWLINE); |
| 7411 | |
| 7412 | if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)) |
| 7413 | vty_out (vty, "Dampening enabled.%s", VTY_NEWLINE); |
| 7414 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7415 | vty_out (vty, "%s%s", header, VTY_NEWLINE); |
| 7416 | } |
| 7417 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7418 | count++; |
| 7419 | |
| 7420 | len = vty_out (vty, "%s", peer->host); |
| 7421 | len = 16 - len; |
| 7422 | if (len < 1) |
| 7423 | vty_out (vty, "%s%*s", VTY_NEWLINE, 16, " "); |
| 7424 | else |
| 7425 | vty_out (vty, "%*s", len, " "); |
| 7426 | |
hasso | 3d515fd | 2005-02-01 21:30:04 +0000 | [diff] [blame] | 7427 | vty_out (vty, "4 "); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7428 | |
Pradosh Mohapatra | af309fa | 2015-11-09 20:21:47 -0500 | [diff] [blame] | 7429 | vty_out (vty, "%5u %7d %7d %8d %4d %4d ", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7430 | peer->as, |
| 7431 | peer->open_in + peer->update_in + peer->keepalive_in |
| 7432 | + peer->notify_in + peer->refresh_in + peer->dynamic_cap_in, |
| 7433 | peer->open_out + peer->update_out + peer->keepalive_out |
| 7434 | + peer->notify_out + peer->refresh_out |
| 7435 | + peer->dynamic_cap_out, |
Pradosh Mohapatra | af309fa | 2015-11-09 20:21:47 -0500 | [diff] [blame] | 7436 | 0, 0, |
| 7437 | peer->sync[afi][safi]->update.count + |
| 7438 | peer->sync[afi][safi]->withdraw.count); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7439 | |
| 7440 | vty_out (vty, "%8s", |
| 7441 | peer_uptime (peer->uptime, timebuf, BGP_UPTIME_LEN)); |
| 7442 | |
| 7443 | if (peer->status == Established) |
| 7444 | { |
| 7445 | vty_out (vty, " %8ld", peer->pcount[afi][safi]); |
| 7446 | } |
| 7447 | else |
| 7448 | { |
| 7449 | if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN)) |
| 7450 | vty_out (vty, " Idle (Admin)"); |
| 7451 | else if (CHECK_FLAG (peer->sflags, PEER_STATUS_PREFIX_OVERFLOW)) |
| 7452 | vty_out (vty, " Idle (PfxCt)"); |
| 7453 | else |
| 7454 | vty_out (vty, " %-11s", LOOKUP(bgp_status_msg, peer->status)); |
| 7455 | } |
| 7456 | |
| 7457 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7458 | } |
| 7459 | } |
| 7460 | |
| 7461 | if (count) |
| 7462 | vty_out (vty, "%sTotal number of neighbors %d%s", VTY_NEWLINE, |
| 7463 | count, VTY_NEWLINE); |
| 7464 | else |
| 7465 | vty_out (vty, "No %s neighbor is configured%s", |
| 7466 | afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE); |
| 7467 | return CMD_SUCCESS; |
| 7468 | } |
| 7469 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7470 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 7471 | bgp_show_summary_vty (struct vty *vty, const char *name, |
| 7472 | afi_t afi, safi_t safi) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7473 | { |
| 7474 | struct bgp *bgp; |
| 7475 | |
| 7476 | if (name) |
| 7477 | { |
| 7478 | bgp = bgp_lookup_by_name (name); |
| 7479 | |
| 7480 | if (! bgp) |
| 7481 | { |
| 7482 | vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); |
| 7483 | return CMD_WARNING; |
| 7484 | } |
| 7485 | |
| 7486 | bgp_show_summary (vty, bgp, afi, safi); |
| 7487 | return CMD_SUCCESS; |
| 7488 | } |
| 7489 | |
| 7490 | bgp = bgp_get_default (); |
| 7491 | |
| 7492 | if (bgp) |
| 7493 | bgp_show_summary (vty, bgp, afi, safi); |
| 7494 | |
| 7495 | return CMD_SUCCESS; |
| 7496 | } |
| 7497 | |
| 7498 | /* `show ip bgp summary' commands. */ |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 7499 | DEFUN (show_ip_bgp_summary, |
| 7500 | show_ip_bgp_summary_cmd, |
| 7501 | "show ip bgp summary", |
| 7502 | SHOW_STR |
| 7503 | IP_STR |
| 7504 | BGP_STR |
| 7505 | "Summary of BGP neighbor status\n") |
| 7506 | { |
| 7507 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 7508 | } |
| 7509 | |
| 7510 | DEFUN (show_ip_bgp_instance_summary, |
| 7511 | show_ip_bgp_instance_summary_cmd, |
| 7512 | "show ip bgp view WORD summary", |
| 7513 | SHOW_STR |
| 7514 | IP_STR |
| 7515 | BGP_STR |
| 7516 | "BGP view\n" |
| 7517 | "View name\n" |
| 7518 | "Summary of BGP neighbor status\n") |
| 7519 | { |
| 7520 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 7521 | } |
| 7522 | |
| 7523 | DEFUN (show_ip_bgp_ipv4_summary, |
| 7524 | show_ip_bgp_ipv4_summary_cmd, |
| 7525 | "show ip bgp ipv4 (unicast|multicast) summary", |
| 7526 | SHOW_STR |
| 7527 | IP_STR |
| 7528 | BGP_STR |
| 7529 | "Address family\n" |
| 7530 | "Address Family modifier\n" |
| 7531 | "Address Family modifier\n" |
| 7532 | "Summary of BGP neighbor status\n") |
| 7533 | { |
| 7534 | if (strncmp (argv[0], "m", 1) == 0) |
| 7535 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 7536 | |
| 7537 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 7538 | } |
| 7539 | |
| 7540 | DEFUN (show_ip_bgp_instance_ipv4_summary, |
| 7541 | show_ip_bgp_instance_ipv4_summary_cmd, |
| 7542 | "show ip bgp view WORD ipv4 (unicast|multicast) summary", |
| 7543 | SHOW_STR |
| 7544 | IP_STR |
| 7545 | BGP_STR |
| 7546 | "BGP view\n" |
| 7547 | "View name\n" |
| 7548 | "Address family\n" |
| 7549 | "Address Family modifier\n" |
| 7550 | "Address Family modifier\n" |
| 7551 | "Summary of BGP neighbor status\n") |
| 7552 | { |
| 7553 | if (strncmp (argv[1], "m", 1) == 0) |
| 7554 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 7555 | else |
| 7556 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 7557 | } |
| 7558 | |
| 7559 | DEFUN (show_ip_bgp_vpnv4_all_summary, |
| 7560 | show_ip_bgp_vpnv4_all_summary_cmd, |
| 7561 | "show ip bgp vpnv4 all summary", |
| 7562 | SHOW_STR |
| 7563 | IP_STR |
| 7564 | BGP_STR |
| 7565 | "Display VPNv4 NLRI specific information\n" |
| 7566 | "Display information about all VPNv4 NLRIs\n" |
| 7567 | "Summary of BGP neighbor status\n") |
| 7568 | { |
| 7569 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 7570 | } |
| 7571 | |
| 7572 | DEFUN (show_ip_bgp_vpnv4_rd_summary, |
| 7573 | show_ip_bgp_vpnv4_rd_summary_cmd, |
| 7574 | "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary", |
| 7575 | SHOW_STR |
| 7576 | IP_STR |
| 7577 | BGP_STR |
| 7578 | "Display VPNv4 NLRI specific information\n" |
| 7579 | "Display information for a route distinguisher\n" |
| 7580 | "VPN Route Distinguisher\n" |
| 7581 | "Summary of BGP neighbor status\n") |
| 7582 | { |
| 7583 | int ret; |
| 7584 | struct prefix_rd prd; |
| 7585 | |
| 7586 | ret = str2prefix_rd (argv[0], &prd); |
| 7587 | if (! ret) |
| 7588 | { |
| 7589 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 7590 | return CMD_WARNING; |
| 7591 | } |
| 7592 | |
| 7593 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 7594 | } |
| 7595 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7596 | DEFUN (show_bgp_ipv4_safi_summary, |
| 7597 | show_bgp_ipv4_safi_summary_cmd, |
| 7598 | "show bgp ipv4 (unicast|multicast) summary", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7599 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7600 | BGP_STR |
| 7601 | "Address family\n" |
| 7602 | "Address Family modifier\n" |
| 7603 | "Address Family modifier\n" |
| 7604 | "Summary of BGP neighbor status\n") |
| 7605 | { |
| 7606 | if (strncmp (argv[0], "m", 1) == 0) |
| 7607 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 7608 | |
| 7609 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 7610 | } |
| 7611 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7612 | DEFUN (show_bgp_instance_ipv4_safi_summary, |
| 7613 | show_bgp_instance_ipv4_safi_summary_cmd, |
| 7614 | "show bgp view WORD ipv4 (unicast|multicast) summary", |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 7615 | SHOW_STR |
| 7616 | BGP_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7617 | "BGP view\n" |
| 7618 | "View name\n" |
| 7619 | "Address family\n" |
| 7620 | "Address Family modifier\n" |
| 7621 | "Address Family modifier\n" |
| 7622 | "Summary of BGP neighbor status\n") |
| 7623 | { |
| 7624 | if (strncmp (argv[1], "m", 1) == 0) |
| 7625 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 7626 | else |
| 7627 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 7628 | } |
| 7629 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7630 | DEFUN (show_bgp_ipv4_vpn_summary, |
| 7631 | show_bgp_ipv4_vpn_summary_cmd, |
| 7632 | "show bgp ipv4 vpn summary", |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 7633 | SHOW_STR |
| 7634 | BGP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7635 | "IPv4\n" |
| 7636 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7637 | "Summary of BGP neighbor status\n") |
| 7638 | { |
| 7639 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 7640 | } |
| 7641 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7642 | /* `show ip bgp summary' commands. */ |
| 7643 | DEFUN (show_bgp_ipv6_vpn_summary, |
| 7644 | show_bgp_ipv6_vpn_summary_cmd, |
| 7645 | "show bgp ipv6 vpn summary", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7646 | SHOW_STR |
| 7647 | BGP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7648 | "IPv6\n" |
| 7649 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7650 | "Summary of BGP neighbor status\n") |
| 7651 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7652 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7653 | } |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7654 | |
| 7655 | DEFUN (show_bgp_ipv4_encap_summary, |
| 7656 | show_bgp_ipv4_encap_summary_cmd, |
| 7657 | "show bgp ipv4 encap summary", |
| 7658 | SHOW_STR |
| 7659 | BGP_STR |
| 7660 | "IPv4\n" |
| 7661 | "Display ENCAP NLRI specific information\n" |
| 7662 | "Summary of BGP neighbor status\n") |
| 7663 | { |
| 7664 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); |
| 7665 | } |
| 7666 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7667 | DEFUN (show_bgp_ipv6_encap_summary, |
| 7668 | show_bgp_ipv6_encap_summary_cmd, |
| 7669 | "show bgp ipv6 encap summary", |
| 7670 | SHOW_STR |
| 7671 | BGP_STR |
| 7672 | "IPv6\n" |
| 7673 | "Display ENCAP NLRI specific information\n" |
| 7674 | "Summary of BGP neighbor status\n") |
| 7675 | { |
| 7676 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
| 7677 | } |
| 7678 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7679 | DEFUN (show_bgp_instance_summary, |
| 7680 | show_bgp_instance_summary_cmd, |
| 7681 | "show bgp view WORD summary", |
| 7682 | SHOW_STR |
| 7683 | BGP_STR |
| 7684 | "BGP view\n" |
| 7685 | "View name\n" |
| 7686 | "Summary of BGP neighbor status\n") |
| 7687 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7688 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7689 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7690 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 7691 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7692 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7693 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 7694 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7695 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7696 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN); |
| 7697 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7698 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7699 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP); |
| 7700 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7701 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7702 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7703 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 7704 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7705 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7706 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); |
| 7707 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7708 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7709 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); |
| 7710 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7711 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7712 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 7713 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7714 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7715 | } |
| 7716 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7717 | DEFUN (show_bgp_instance_ipv4_summary, |
| 7718 | show_bgp_instance_ipv4_summary_cmd, |
| 7719 | "show bgp view WORD ipv4 summary", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7720 | SHOW_STR |
| 7721 | BGP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7722 | IP_STR |
| 7723 | "Address Family modifier\n" |
| 7724 | "Address Family modifier\n" |
| 7725 | "BGP view\n" |
| 7726 | "View name\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7727 | "Summary of BGP neighbor status\n") |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7728 | { |
| 7729 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7730 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7731 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 7732 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7733 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7734 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 7735 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7736 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7737 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN); |
| 7738 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7739 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7740 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7741 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7742 | return CMD_SUCCESS; |
| 7743 | } |
| 7744 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7745 | DEFUN (show_bgp_instance_ipv6_summary, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7746 | show_bgp_instance_ipv6_summary_cmd, |
| 7747 | "show bgp view WORD ipv6 summary", |
| 7748 | SHOW_STR |
| 7749 | BGP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7750 | IPV6_STR |
| 7751 | "Address Family modifier\n" |
| 7752 | "Address Family modifier\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7753 | "BGP view\n" |
| 7754 | "View name\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7755 | "Summary of BGP neighbor status\n") |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7756 | { |
| 7757 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7758 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7759 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 7760 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7761 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7762 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); |
| 7763 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7764 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7765 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); |
| 7766 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7767 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7768 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); |
| 7769 | |
| 7770 | return CMD_SUCCESS; |
| 7771 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7772 | |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 7773 | DEFUN (show_bgp_ipv6_safi_summary, |
| 7774 | show_bgp_ipv6_safi_summary_cmd, |
| 7775 | "show bgp ipv6 (unicast|multicast) summary", |
| 7776 | SHOW_STR |
| 7777 | BGP_STR |
| 7778 | "Address family\n" |
| 7779 | "Address Family modifier\n" |
| 7780 | "Address Family modifier\n" |
| 7781 | "Summary of BGP neighbor status\n") |
| 7782 | { |
| 7783 | if (strncmp (argv[0], "m", 1) == 0) |
| 7784 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 7785 | |
| 7786 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 7787 | } |
| 7788 | |
| 7789 | DEFUN (show_bgp_instance_ipv6_safi_summary, |
| 7790 | show_bgp_instance_ipv6_safi_summary_cmd, |
| 7791 | "show bgp view WORD ipv6 (unicast|multicast) summary", |
| 7792 | SHOW_STR |
| 7793 | BGP_STR |
| 7794 | "BGP view\n" |
| 7795 | "View name\n" |
| 7796 | "Address family\n" |
| 7797 | "Address Family modifier\n" |
| 7798 | "Address Family modifier\n" |
| 7799 | "Summary of BGP neighbor status\n") |
| 7800 | { |
| 7801 | if (strncmp (argv[1], "m", 1) == 0) |
| 7802 | return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); |
| 7803 | |
| 7804 | return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 7805 | } |
| 7806 | |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 7807 | /* old command */ |
| 7808 | DEFUN (show_ipv6_bgp_summary, |
| 7809 | show_ipv6_bgp_summary_cmd, |
| 7810 | "show ipv6 bgp summary", |
| 7811 | SHOW_STR |
| 7812 | IPV6_STR |
| 7813 | BGP_STR |
| 7814 | "Summary of BGP neighbor status\n") |
| 7815 | { |
| 7816 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 7817 | } |
| 7818 | |
| 7819 | /* old command */ |
| 7820 | DEFUN (show_ipv6_mbgp_summary, |
| 7821 | show_ipv6_mbgp_summary_cmd, |
| 7822 | "show ipv6 mbgp summary", |
| 7823 | SHOW_STR |
| 7824 | IPV6_STR |
| 7825 | MBGP_STR |
| 7826 | "Summary of BGP neighbor status\n") |
| 7827 | { |
| 7828 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 7829 | } |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7830 | |
| 7831 | /* variations of show bgp [...] summary */ |
| 7832 | |
| 7833 | /* This one is for the 0-keyword variant */ |
| 7834 | DEFUN (show_bgp_summary, |
| 7835 | show_bgp_summary_cmd, |
| 7836 | "show bgp summary", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7837 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7838 | BGP_STR |
| 7839 | "Summary of BGP neighbor status\n") |
| 7840 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7841 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7842 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7843 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 7844 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7845 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7846 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 7847 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7848 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7849 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 7850 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7851 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7852 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); |
| 7853 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7854 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7855 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7856 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 7857 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7858 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7859 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 7860 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7861 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7862 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
| 7863 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7864 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7865 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 7866 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7867 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7868 | } |
| 7869 | |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 7870 | ALIAS (show_bgp_summary, |
| 7871 | show_bgp_ipv6_summary_cmd, |
| 7872 | "show bgp ipv6 summary", |
| 7873 | SHOW_STR |
| 7874 | BGP_STR |
| 7875 | "Address family\n" |
| 7876 | "Summary of BGP neighbor status\n") |
| 7877 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7878 | DEFUN (show_bgp_summary_1w, |
| 7879 | show_bgp_summary_1w_cmd, |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7880 | "show bgp (ipv4|ipv6|unicast|multicast|vpn|encap) summary", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7881 | SHOW_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7882 | BGP_STR |
| 7883 | IP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7884 | IP6_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7885 | "Address Family modifier\n" |
| 7886 | "Address Family modifier\n" |
| 7887 | "Address Family modifier\n" |
| 7888 | "Address Family modifier\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7889 | "Summary of BGP neighbor status\n") |
| 7890 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7891 | if (strcmp (argv[0], "ipv4") == 0) { |
| 7892 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7893 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7894 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 7895 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7896 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7897 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 7898 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7899 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7900 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 7901 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7902 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7903 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); |
| 7904 | return CMD_SUCCESS; |
| 7905 | } |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 7906 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7907 | if (strcmp (argv[0], "ipv6") == 0) { |
| 7908 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7909 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7910 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 7911 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7912 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7913 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 7914 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7915 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7916 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
| 7917 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7918 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7919 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
| 7920 | return CMD_SUCCESS; |
| 7921 | } |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 7922 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7923 | if (strcmp (argv[0], "unicast") == 0) { |
| 7924 | vty_out(vty, "IPv4 Unicast Summary:%s", VTY_NEWLINE); |
| 7925 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7926 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7927 | vty_out(vty, "%s", VTY_NEWLINE); |
| 7928 | vty_out(vty, "IPv6 Unicast Summary:%s", VTY_NEWLINE); |
| 7929 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7930 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7931 | return CMD_SUCCESS; |
| 7932 | } |
| 7933 | if (strcmp (argv[0], "multicast") == 0) { |
| 7934 | vty_out(vty, "IPv4 Multicast Summary:%s", VTY_NEWLINE); |
| 7935 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7936 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7937 | vty_out(vty, "%s", VTY_NEWLINE); |
| 7938 | vty_out(vty, "IPv6 Multicast Summary:%s", VTY_NEWLINE); |
| 7939 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7940 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7941 | return CMD_SUCCESS; |
| 7942 | } |
| 7943 | if (strcmp (argv[0], "vpn") == 0) { |
| 7944 | vty_out(vty, "IPv4 VPN Summary:%s", VTY_NEWLINE); |
| 7945 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7946 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7947 | vty_out(vty, "%s", VTY_NEWLINE); |
| 7948 | vty_out(vty, "IPv6 VPN Summary:%s", VTY_NEWLINE); |
| 7949 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7950 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7951 | return CMD_SUCCESS; |
| 7952 | } |
| 7953 | if (strcmp (argv[0], "encap") == 0) { |
| 7954 | vty_out(vty, "IPv4 Encap Summary:%s", VTY_NEWLINE); |
| 7955 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7956 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7957 | vty_out(vty, "%s", VTY_NEWLINE); |
| 7958 | vty_out(vty, "IPv6 Encap Summary:%s", VTY_NEWLINE); |
| 7959 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7960 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7961 | return CMD_SUCCESS; |
| 7962 | } |
| 7963 | vty_out(vty, "Unknown keyword: %s%s", argv[0], VTY_NEWLINE); |
| 7964 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7965 | } |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7966 | |
| 7967 | |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 7968 | |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 7969 | const char * |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7970 | afi_safi_print (afi_t afi, safi_t safi) |
| 7971 | { |
| 7972 | if (afi == AFI_IP && safi == SAFI_UNICAST) |
| 7973 | return "IPv4 Unicast"; |
| 7974 | else if (afi == AFI_IP && safi == SAFI_MULTICAST) |
| 7975 | return "IPv4 Multicast"; |
| 7976 | else if (afi == AFI_IP && safi == SAFI_MPLS_VPN) |
Lou Berger | 9da04bc | 2016-01-12 13:41:55 -0500 | [diff] [blame] | 7977 | return "VPN-IPv4 Unicast"; |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 7978 | else if (afi == AFI_IP && safi == SAFI_ENCAP) |
| 7979 | return "ENCAP-IPv4 Unicast"; |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7980 | else if (afi == AFI_IP6 && safi == SAFI_UNICAST) |
| 7981 | return "IPv6 Unicast"; |
| 7982 | else if (afi == AFI_IP6 && safi == SAFI_MULTICAST) |
| 7983 | return "IPv6 Multicast"; |
Lou Berger | 9da04bc | 2016-01-12 13:41:55 -0500 | [diff] [blame] | 7984 | else if (afi == AFI_IP6 && safi == SAFI_MPLS_VPN) |
| 7985 | return "VPN-IPv6 Unicast"; |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 7986 | else if (afi == AFI_IP6 && safi == SAFI_ENCAP) |
| 7987 | return "ENCAP-IPv6 Unicast"; |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7988 | else |
| 7989 | return "Unknown"; |
| 7990 | } |
| 7991 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7992 | /* Show BGP peer's information. */ |
| 7993 | enum show_type |
| 7994 | { |
| 7995 | show_all, |
| 7996 | show_peer |
| 7997 | }; |
| 7998 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7999 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8000 | bgp_show_peer_afi_orf_cap (struct vty *vty, struct peer *p, |
| 8001 | afi_t afi, safi_t safi, |
| 8002 | u_int16_t adv_smcap, u_int16_t adv_rmcap, |
| 8003 | u_int16_t rcv_smcap, u_int16_t rcv_rmcap) |
| 8004 | { |
| 8005 | /* Send-Mode */ |
| 8006 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_smcap) |
| 8007 | || CHECK_FLAG (p->af_cap[afi][safi], rcv_smcap)) |
| 8008 | { |
| 8009 | vty_out (vty, " Send-mode: "); |
| 8010 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_smcap)) |
| 8011 | vty_out (vty, "advertised"); |
| 8012 | if (CHECK_FLAG (p->af_cap[afi][safi], rcv_smcap)) |
| 8013 | vty_out (vty, "%sreceived", |
| 8014 | CHECK_FLAG (p->af_cap[afi][safi], adv_smcap) ? |
| 8015 | ", " : ""); |
| 8016 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8017 | } |
| 8018 | |
| 8019 | /* Receive-Mode */ |
| 8020 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap) |
| 8021 | || CHECK_FLAG (p->af_cap[afi][safi], rcv_rmcap)) |
| 8022 | { |
| 8023 | vty_out (vty, " Receive-mode: "); |
| 8024 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap)) |
| 8025 | vty_out (vty, "advertised"); |
| 8026 | if (CHECK_FLAG (p->af_cap[afi][safi], rcv_rmcap)) |
| 8027 | vty_out (vty, "%sreceived", |
| 8028 | CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap) ? |
| 8029 | ", " : ""); |
| 8030 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8031 | } |
| 8032 | } |
| 8033 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8034 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8035 | bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi) |
| 8036 | { |
| 8037 | struct bgp_filter *filter; |
| 8038 | char orf_pfx_name[BUFSIZ]; |
| 8039 | int orf_pfx_count; |
| 8040 | |
| 8041 | filter = &p->filter[afi][safi]; |
| 8042 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8043 | vty_out (vty, " For address family: %s%s", afi_safi_print (afi, safi), |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8044 | VTY_NEWLINE); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8045 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8046 | if (p->af_group[afi][safi]) |
| 8047 | vty_out (vty, " %s peer-group member%s", p->group->name, VTY_NEWLINE); |
| 8048 | |
| 8049 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) |
| 8050 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV) |
| 8051 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_OLD_RCV) |
| 8052 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) |
| 8053 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV) |
| 8054 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV)) |
| 8055 | vty_out (vty, " AF-dependant capabilities:%s", VTY_NEWLINE); |
| 8056 | |
| 8057 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) |
| 8058 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV) |
| 8059 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) |
| 8060 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV)) |
| 8061 | { |
| 8062 | vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s", |
| 8063 | ORF_TYPE_PREFIX, VTY_NEWLINE); |
| 8064 | bgp_show_peer_afi_orf_cap (vty, p, afi, safi, |
| 8065 | PEER_CAP_ORF_PREFIX_SM_ADV, |
| 8066 | PEER_CAP_ORF_PREFIX_RM_ADV, |
| 8067 | PEER_CAP_ORF_PREFIX_SM_RCV, |
| 8068 | PEER_CAP_ORF_PREFIX_RM_RCV); |
| 8069 | } |
| 8070 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) |
| 8071 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_OLD_RCV) |
| 8072 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) |
| 8073 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV)) |
| 8074 | { |
| 8075 | vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s", |
| 8076 | ORF_TYPE_PREFIX_OLD, VTY_NEWLINE); |
| 8077 | bgp_show_peer_afi_orf_cap (vty, p, afi, safi, |
| 8078 | PEER_CAP_ORF_PREFIX_SM_ADV, |
| 8079 | PEER_CAP_ORF_PREFIX_RM_ADV, |
| 8080 | PEER_CAP_ORF_PREFIX_SM_OLD_RCV, |
| 8081 | PEER_CAP_ORF_PREFIX_RM_OLD_RCV); |
| 8082 | } |
| 8083 | |
| 8084 | sprintf (orf_pfx_name, "%s.%d.%d", p->host, afi, safi); |
| 8085 | orf_pfx_count = prefix_bgp_show_prefix_list (NULL, afi, orf_pfx_name); |
| 8086 | |
| 8087 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_PREFIX_SEND) |
| 8088 | || orf_pfx_count) |
| 8089 | { |
| 8090 | vty_out (vty, " Outbound Route Filter (ORF):"); |
| 8091 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_PREFIX_SEND)) |
| 8092 | vty_out (vty, " sent;"); |
| 8093 | if (orf_pfx_count) |
| 8094 | vty_out (vty, " received (%d entries)", orf_pfx_count); |
| 8095 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8096 | } |
| 8097 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_WAIT_REFRESH)) |
| 8098 | vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE); |
| 8099 | |
| 8100 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT)) |
| 8101 | vty_out (vty, " Route-Reflector Client%s", VTY_NEWLINE); |
| 8102 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT)) |
| 8103 | vty_out (vty, " Route-Server Client%s", VTY_NEWLINE); |
| 8104 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG)) |
| 8105 | vty_out (vty, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE); |
| 8106 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS)) |
| 8107 | vty_out (vty, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE); |
| 8108 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF)) |
| 8109 | vty_out (vty, " NEXT_HOP is always this router%s", VTY_NEWLINE); |
| 8110 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_AS_PATH_UNCHANGED)) |
| 8111 | vty_out (vty, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE); |
| 8112 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED)) |
| 8113 | vty_out (vty, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE); |
| 8114 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MED_UNCHANGED)) |
| 8115 | vty_out (vty, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE); |
| 8116 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY) |
| 8117 | || CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)) |
| 8118 | { |
| 8119 | vty_out (vty, " Community attribute sent to this neighbor"); |
| 8120 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY) |
| 8121 | && CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)) |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8122 | vty_out (vty, "(both)%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8123 | else if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)) |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8124 | vty_out (vty, "(extended)%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8125 | else |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8126 | vty_out (vty, "(standard)%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8127 | } |
| 8128 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_DEFAULT_ORIGINATE)) |
| 8129 | { |
| 8130 | vty_out (vty, " Default information originate,"); |
| 8131 | |
| 8132 | if (p->default_rmap[afi][safi].name) |
| 8133 | vty_out (vty, " default route-map %s%s,", |
| 8134 | p->default_rmap[afi][safi].map ? "*" : "", |
| 8135 | p->default_rmap[afi][safi].name); |
| 8136 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_DEFAULT_ORIGINATE)) |
| 8137 | vty_out (vty, " default sent%s", VTY_NEWLINE); |
| 8138 | else |
| 8139 | vty_out (vty, " default not sent%s", VTY_NEWLINE); |
| 8140 | } |
| 8141 | |
| 8142 | if (filter->plist[FILTER_IN].name |
| 8143 | || filter->dlist[FILTER_IN].name |
| 8144 | || filter->aslist[FILTER_IN].name |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8145 | || filter->map[RMAP_IN].name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8146 | vty_out (vty, " Inbound path policy configured%s", VTY_NEWLINE); |
| 8147 | if (filter->plist[FILTER_OUT].name |
| 8148 | || filter->dlist[FILTER_OUT].name |
| 8149 | || filter->aslist[FILTER_OUT].name |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8150 | || filter->map[RMAP_OUT].name |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8151 | || filter->usmap.name) |
| 8152 | vty_out (vty, " Outbound path policy configured%s", VTY_NEWLINE); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8153 | if (filter->map[RMAP_IMPORT].name) |
| 8154 | vty_out (vty, " Import policy for this RS-client configured%s", VTY_NEWLINE); |
| 8155 | if (filter->map[RMAP_EXPORT].name) |
| 8156 | vty_out (vty, " Export policy for this RS-client configured%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8157 | |
| 8158 | /* prefix-list */ |
| 8159 | if (filter->plist[FILTER_IN].name) |
| 8160 | vty_out (vty, " Incoming update prefix filter list is %s%s%s", |
| 8161 | filter->plist[FILTER_IN].plist ? "*" : "", |
| 8162 | filter->plist[FILTER_IN].name, |
| 8163 | VTY_NEWLINE); |
| 8164 | if (filter->plist[FILTER_OUT].name) |
| 8165 | vty_out (vty, " Outgoing update prefix filter list is %s%s%s", |
| 8166 | filter->plist[FILTER_OUT].plist ? "*" : "", |
| 8167 | filter->plist[FILTER_OUT].name, |
| 8168 | VTY_NEWLINE); |
| 8169 | |
| 8170 | /* distribute-list */ |
| 8171 | if (filter->dlist[FILTER_IN].name) |
| 8172 | vty_out (vty, " Incoming update network filter list is %s%s%s", |
| 8173 | filter->dlist[FILTER_IN].alist ? "*" : "", |
| 8174 | filter->dlist[FILTER_IN].name, |
| 8175 | VTY_NEWLINE); |
| 8176 | if (filter->dlist[FILTER_OUT].name) |
| 8177 | vty_out (vty, " Outgoing update network filter list is %s%s%s", |
| 8178 | filter->dlist[FILTER_OUT].alist ? "*" : "", |
| 8179 | filter->dlist[FILTER_OUT].name, |
| 8180 | VTY_NEWLINE); |
| 8181 | |
| 8182 | /* filter-list. */ |
| 8183 | if (filter->aslist[FILTER_IN].name) |
| 8184 | vty_out (vty, " Incoming update AS path filter list is %s%s%s", |
| 8185 | filter->aslist[FILTER_IN].aslist ? "*" : "", |
| 8186 | filter->aslist[FILTER_IN].name, |
| 8187 | VTY_NEWLINE); |
| 8188 | if (filter->aslist[FILTER_OUT].name) |
| 8189 | vty_out (vty, " Outgoing update AS path filter list is %s%s%s", |
| 8190 | filter->aslist[FILTER_OUT].aslist ? "*" : "", |
| 8191 | filter->aslist[FILTER_OUT].name, |
| 8192 | VTY_NEWLINE); |
| 8193 | |
| 8194 | /* route-map. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8195 | if (filter->map[RMAP_IN].name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8196 | vty_out (vty, " Route map for incoming advertisements is %s%s%s", |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8197 | filter->map[RMAP_IN].map ? "*" : "", |
| 8198 | filter->map[RMAP_IN].name, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8199 | VTY_NEWLINE); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8200 | if (filter->map[RMAP_OUT].name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8201 | vty_out (vty, " Route map for outgoing advertisements is %s%s%s", |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8202 | filter->map[RMAP_OUT].map ? "*" : "", |
| 8203 | filter->map[RMAP_OUT].name, |
| 8204 | VTY_NEWLINE); |
| 8205 | if (filter->map[RMAP_IMPORT].name) |
| 8206 | vty_out (vty, " Route map for advertisements going into this RS-client's table is %s%s%s", |
| 8207 | filter->map[RMAP_IMPORT].map ? "*" : "", |
| 8208 | filter->map[RMAP_IMPORT].name, |
| 8209 | VTY_NEWLINE); |
| 8210 | if (filter->map[RMAP_EXPORT].name) |
| 8211 | vty_out (vty, " Route map for advertisements coming from this RS-client is %s%s%s", |
| 8212 | filter->map[RMAP_EXPORT].map ? "*" : "", |
| 8213 | filter->map[RMAP_EXPORT].name, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8214 | VTY_NEWLINE); |
| 8215 | |
| 8216 | /* unsuppress-map */ |
| 8217 | if (filter->usmap.name) |
| 8218 | vty_out (vty, " Route map for selective unsuppress is %s%s%s", |
| 8219 | filter->usmap.map ? "*" : "", |
| 8220 | filter->usmap.name, VTY_NEWLINE); |
| 8221 | |
| 8222 | /* Receive prefix count */ |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 8223 | vty_out (vty, " %ld accepted prefixes%s", p->pcount[afi][safi], VTY_NEWLINE); |
| 8224 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8225 | /* Maximum prefix */ |
| 8226 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX)) |
| 8227 | { |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 8228 | vty_out (vty, " Maximum prefixes allowed %ld%s%s", p->pmax[afi][safi], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8229 | CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING) |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 8230 | ? " (warning-only)" : "", VTY_NEWLINE); |
| 8231 | vty_out (vty, " Threshold for warning message %d%%", |
| 8232 | p->pmax_threshold[afi][safi]); |
| 8233 | if (p->pmax_restart[afi][safi]) |
| 8234 | vty_out (vty, ", restart interval %d min", p->pmax_restart[afi][safi]); |
| 8235 | vty_out (vty, "%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8236 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8237 | |
| 8238 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8239 | } |
| 8240 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8241 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8242 | bgp_show_peer (struct vty *vty, struct peer *p) |
| 8243 | { |
| 8244 | struct bgp *bgp; |
| 8245 | char buf1[BUFSIZ]; |
| 8246 | char timebuf[BGP_UPTIME_LEN]; |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8247 | afi_t afi; |
| 8248 | safi_t safi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8249 | |
| 8250 | bgp = p->bgp; |
| 8251 | |
| 8252 | /* Configured IP address. */ |
| 8253 | vty_out (vty, "BGP neighbor is %s, ", p->host); |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 8254 | vty_out (vty, "remote AS %u, ", p->as); |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 8255 | vty_out (vty, "local AS %u%s%s, ", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8256 | p->change_local_as ? p->change_local_as : p->local_as, |
| 8257 | CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ? |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 8258 | " no-prepend" : "", |
| 8259 | CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS) ? |
| 8260 | " replace-as" : ""); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8261 | vty_out (vty, "%s link%s", |
| 8262 | p->as == p->local_as ? "internal" : "external", |
| 8263 | VTY_NEWLINE); |
| 8264 | |
| 8265 | /* Description. */ |
| 8266 | if (p->desc) |
| 8267 | vty_out (vty, " Description: %s%s", p->desc, VTY_NEWLINE); |
| 8268 | |
| 8269 | /* Peer-group */ |
| 8270 | if (p->group) |
| 8271 | vty_out (vty, " Member of peer-group %s for session parameters%s", |
| 8272 | p->group->name, VTY_NEWLINE); |
| 8273 | |
| 8274 | /* Administrative shutdown. */ |
| 8275 | if (CHECK_FLAG (p->flags, PEER_FLAG_SHUTDOWN)) |
| 8276 | vty_out (vty, " Administratively shut down%s", VTY_NEWLINE); |
| 8277 | |
| 8278 | /* BGP Version. */ |
| 8279 | vty_out (vty, " BGP version 4"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8280 | vty_out (vty, ", remote router ID %s%s", |
| 8281 | inet_ntop (AF_INET, &p->remote_id, buf1, BUFSIZ), |
| 8282 | VTY_NEWLINE); |
| 8283 | |
| 8284 | /* Confederation */ |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 8285 | if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION) |
| 8286 | && bgp_confederation_peers_check (bgp, p->as)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8287 | vty_out (vty, " Neighbor under common administration%s", VTY_NEWLINE); |
| 8288 | |
| 8289 | /* Status. */ |
| 8290 | vty_out (vty, " BGP state = %s", |
| 8291 | LOOKUP (bgp_status_msg, p->status)); |
| 8292 | if (p->status == Established) |
| 8293 | vty_out (vty, ", up for %8s", |
| 8294 | peer_uptime (p->uptime, timebuf, BGP_UPTIME_LEN)); |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8295 | else if (p->status == Active) |
| 8296 | { |
| 8297 | if (CHECK_FLAG (p->flags, PEER_FLAG_PASSIVE)) |
| 8298 | vty_out (vty, " (passive)"); |
| 8299 | else if (CHECK_FLAG (p->sflags, PEER_STATUS_NSF_WAIT)) |
| 8300 | vty_out (vty, " (NSF passive)"); |
| 8301 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8302 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8303 | |
| 8304 | /* read timer */ |
| 8305 | vty_out (vty, " Last read %s", peer_uptime (p->readtime, timebuf, BGP_UPTIME_LEN)); |
| 8306 | |
| 8307 | /* Configured timer values. */ |
| 8308 | vty_out (vty, ", hold time is %d, keepalive interval is %d seconds%s", |
| 8309 | p->v_holdtime, p->v_keepalive, VTY_NEWLINE); |
| 8310 | if (CHECK_FLAG (p->config, PEER_CONFIG_TIMER)) |
| 8311 | { |
| 8312 | vty_out (vty, " Configured hold time is %d", p->holdtime); |
| 8313 | vty_out (vty, ", keepalive interval is %d seconds%s", |
| 8314 | p->keepalive, VTY_NEWLINE); |
| 8315 | } |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8316 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8317 | /* Capability. */ |
| 8318 | if (p->status == Established) |
| 8319 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8320 | if (p->cap |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8321 | || p->afc_adv[AFI_IP][SAFI_UNICAST] |
| 8322 | || p->afc_recv[AFI_IP][SAFI_UNICAST] |
| 8323 | || p->afc_adv[AFI_IP][SAFI_MULTICAST] |
| 8324 | || p->afc_recv[AFI_IP][SAFI_MULTICAST] |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8325 | || p->afc_adv[AFI_IP6][SAFI_UNICAST] |
| 8326 | || p->afc_recv[AFI_IP6][SAFI_UNICAST] |
| 8327 | || p->afc_adv[AFI_IP6][SAFI_MULTICAST] |
| 8328 | || p->afc_recv[AFI_IP6][SAFI_MULTICAST] |
Lou Berger | 9da04bc | 2016-01-12 13:41:55 -0500 | [diff] [blame] | 8329 | || p->afc_adv[AFI_IP6][SAFI_MPLS_VPN] |
| 8330 | || p->afc_recv[AFI_IP6][SAFI_MPLS_VPN] |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 8331 | || p->afc_adv[AFI_IP6][SAFI_ENCAP] |
| 8332 | || p->afc_recv[AFI_IP6][SAFI_ENCAP] |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 8333 | || p->afc_adv[AFI_IP][SAFI_ENCAP] |
| 8334 | || p->afc_recv[AFI_IP][SAFI_ENCAP] |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8335 | || p->afc_adv[AFI_IP][SAFI_MPLS_VPN] |
| 8336 | || p->afc_recv[AFI_IP][SAFI_MPLS_VPN]) |
| 8337 | { |
| 8338 | vty_out (vty, " Neighbor capabilities:%s", VTY_NEWLINE); |
| 8339 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 8340 | /* AS4 */ |
| 8341 | if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV) |
| 8342 | || CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV)) |
| 8343 | { |
| 8344 | vty_out (vty, " 4 Byte AS:"); |
| 8345 | if (CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV)) |
| 8346 | vty_out (vty, " advertised"); |
| 8347 | if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV)) |
| 8348 | vty_out (vty, " %sreceived", |
| 8349 | CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV) ? "and " : ""); |
| 8350 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8351 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8352 | /* Dynamic */ |
| 8353 | if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV) |
| 8354 | || CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV)) |
| 8355 | { |
| 8356 | vty_out (vty, " Dynamic:"); |
| 8357 | if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV)) |
| 8358 | vty_out (vty, " advertised"); |
| 8359 | if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV)) |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8360 | vty_out (vty, " %sreceived", |
| 8361 | CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV) ? "and " : ""); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8362 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8363 | } |
| 8364 | |
| 8365 | /* Route Refresh */ |
| 8366 | if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV) |
| 8367 | || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV) |
| 8368 | || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV)) |
| 8369 | { |
| 8370 | vty_out (vty, " Route refresh:"); |
| 8371 | if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV)) |
| 8372 | vty_out (vty, " advertised"); |
| 8373 | if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV) |
| 8374 | || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV)) |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8375 | vty_out (vty, " %sreceived(%s)", |
| 8376 | CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV) ? "and " : "", |
| 8377 | (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) |
| 8378 | && CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)) ? |
| 8379 | "old & new" : CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) ? "old" : "new"); |
| 8380 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8381 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8382 | } |
| 8383 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8384 | /* Multiprotocol Extensions */ |
| 8385 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 8386 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 8387 | if (p->afc_adv[afi][safi] || p->afc_recv[afi][safi]) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8388 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8389 | vty_out (vty, " Address family %s:", afi_safi_print (afi, safi)); |
| 8390 | if (p->afc_adv[afi][safi]) |
| 8391 | vty_out (vty, " advertised"); |
| 8392 | if (p->afc_recv[afi][safi]) |
| 8393 | vty_out (vty, " %sreceived", p->afc_adv[afi][safi] ? "and " : ""); |
| 8394 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8395 | } |
| 8396 | |
| 8397 | /* Gracefull Restart */ |
| 8398 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV) |
| 8399 | || CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8400 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8401 | vty_out (vty, " Graceful Restart Capabilty:"); |
| 8402 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8403 | vty_out (vty, " advertised"); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8404 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)) |
| 8405 | vty_out (vty, " %sreceived", |
| 8406 | CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV) ? "and " : ""); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8407 | vty_out (vty, "%s", VTY_NEWLINE); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8408 | |
| 8409 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8410 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8411 | int restart_af_count = 0; |
| 8412 | |
| 8413 | vty_out (vty, " Remote Restart timer is %d seconds%s", |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8414 | p->v_gr_restart, VTY_NEWLINE); |
| 8415 | vty_out (vty, " Address families by peer:%s ", VTY_NEWLINE); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8416 | |
| 8417 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 8418 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 8419 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_RESTART_AF_RCV)) |
| 8420 | { |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8421 | vty_out (vty, "%s%s(%s)", restart_af_count ? ", " : "", |
| 8422 | afi_safi_print (afi, safi), |
| 8423 | CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_RESTART_AF_PRESERVE_RCV) ? |
| 8424 | "preserved" : "not preserved"); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8425 | restart_af_count++; |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8426 | } |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8427 | if (! restart_af_count) |
| 8428 | vty_out (vty, "none"); |
| 8429 | vty_out (vty, "%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8430 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8431 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8432 | } |
| 8433 | } |
| 8434 | |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8435 | /* graceful restart information */ |
| 8436 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV) |
| 8437 | || p->t_gr_restart |
| 8438 | || p->t_gr_stale) |
| 8439 | { |
| 8440 | int eor_send_af_count = 0; |
| 8441 | int eor_receive_af_count = 0; |
| 8442 | |
| 8443 | vty_out (vty, " Graceful restart informations:%s", VTY_NEWLINE); |
| 8444 | if (p->status == Established) |
| 8445 | { |
| 8446 | vty_out (vty, " End-of-RIB send: "); |
| 8447 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 8448 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 8449 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_EOR_SEND)) |
| 8450 | { |
| 8451 | vty_out (vty, "%s%s", eor_send_af_count ? ", " : "", |
| 8452 | afi_safi_print (afi, safi)); |
| 8453 | eor_send_af_count++; |
| 8454 | } |
| 8455 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8456 | |
| 8457 | vty_out (vty, " End-of-RIB received: "); |
| 8458 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 8459 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 8460 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_EOR_RECEIVED)) |
| 8461 | { |
| 8462 | vty_out (vty, "%s%s", eor_receive_af_count ? ", " : "", |
| 8463 | afi_safi_print (afi, safi)); |
| 8464 | eor_receive_af_count++; |
| 8465 | } |
| 8466 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8467 | } |
| 8468 | |
| 8469 | if (p->t_gr_restart) |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 8470 | vty_out (vty, " The remaining time of restart timer is %ld%s", |
| 8471 | thread_timer_remain_second (p->t_gr_restart), VTY_NEWLINE); |
| 8472 | |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8473 | if (p->t_gr_stale) |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 8474 | vty_out (vty, " The remaining time of stalepath timer is %ld%s", |
| 8475 | thread_timer_remain_second (p->t_gr_stale), VTY_NEWLINE); |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8476 | } |
| 8477 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8478 | /* Packet counts. */ |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8479 | vty_out (vty, " Message statistics:%s", VTY_NEWLINE); |
| 8480 | vty_out (vty, " Inq depth is 0%s", VTY_NEWLINE); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 8481 | vty_out (vty, " Outq depth is %lu%s", (unsigned long) p->obuf->count, VTY_NEWLINE); |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8482 | vty_out (vty, " Sent Rcvd%s", VTY_NEWLINE); |
| 8483 | vty_out (vty, " Opens: %10d %10d%s", p->open_out, p->open_in, VTY_NEWLINE); |
| 8484 | vty_out (vty, " Notifications: %10d %10d%s", p->notify_out, p->notify_in, VTY_NEWLINE); |
| 8485 | vty_out (vty, " Updates: %10d %10d%s", p->update_out, p->update_in, VTY_NEWLINE); |
| 8486 | vty_out (vty, " Keepalives: %10d %10d%s", p->keepalive_out, p->keepalive_in, VTY_NEWLINE); |
| 8487 | vty_out (vty, " Route Refresh: %10d %10d%s", p->refresh_out, p->refresh_in, VTY_NEWLINE); |
| 8488 | vty_out (vty, " Capability: %10d %10d%s", p->dynamic_cap_out, p->dynamic_cap_in, VTY_NEWLINE); |
| 8489 | vty_out (vty, " Total: %10d %10d%s", p->open_out + p->notify_out + |
| 8490 | p->update_out + p->keepalive_out + p->refresh_out + p->dynamic_cap_out, |
| 8491 | p->open_in + p->notify_in + p->update_in + p->keepalive_in + p->refresh_in + |
| 8492 | p->dynamic_cap_in, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8493 | |
| 8494 | /* advertisement-interval */ |
| 8495 | vty_out (vty, " Minimum time between advertisement runs is %d seconds%s", |
| 8496 | p->v_routeadv, VTY_NEWLINE); |
| 8497 | |
| 8498 | /* Update-source. */ |
| 8499 | if (p->update_if || p->update_source) |
| 8500 | { |
| 8501 | vty_out (vty, " Update source is "); |
| 8502 | if (p->update_if) |
| 8503 | vty_out (vty, "%s", p->update_if); |
| 8504 | else if (p->update_source) |
| 8505 | vty_out (vty, "%s", |
| 8506 | sockunion2str (p->update_source, buf1, SU_ADDRSTRLEN)); |
| 8507 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8508 | } |
| 8509 | |
| 8510 | /* Default weight */ |
| 8511 | if (CHECK_FLAG (p->config, PEER_CONFIG_WEIGHT)) |
| 8512 | vty_out (vty, " Default weight %d%s", p->weight, |
| 8513 | VTY_NEWLINE); |
| 8514 | |
| 8515 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8516 | |
| 8517 | /* Address Family Information */ |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8518 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 8519 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 8520 | if (p->afc[afi][safi]) |
| 8521 | bgp_show_peer_afi (vty, p, afi, safi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8522 | |
| 8523 | vty_out (vty, " Connections established %d; dropped %d%s", |
| 8524 | p->established, p->dropped, |
| 8525 | VTY_NEWLINE); |
| 8526 | |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 8527 | if (! p->dropped) |
| 8528 | vty_out (vty, " Last reset never%s", VTY_NEWLINE); |
| 8529 | else |
| 8530 | vty_out (vty, " Last reset %s, due to %s%s", |
| 8531 | peer_uptime (p->resettime, timebuf, BGP_UPTIME_LEN), |
| 8532 | peer_down_str[(int) p->last_reset], VTY_NEWLINE); |
paul | 848973c | 2003-08-13 00:32:49 +0000 | [diff] [blame] | 8533 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8534 | if (CHECK_FLAG (p->sflags, PEER_STATUS_PREFIX_OVERFLOW)) |
| 8535 | { |
| 8536 | vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 8537 | |
| 8538 | if (p->t_pmax_restart) |
| 8539 | vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds%s", |
| 8540 | p->host, thread_timer_remain_second (p->t_pmax_restart), |
| 8541 | VTY_NEWLINE); |
| 8542 | else |
| 8543 | vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s", |
| 8544 | p->host, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8545 | } |
| 8546 | |
Stephen Hemminger | f5a4827 | 2011-03-24 17:30:21 +0000 | [diff] [blame] | 8547 | /* EBGP Multihop and GTSM */ |
Jorge Boncompte [DTI2] | 6d85b15 | 2012-05-07 16:52:54 +0000 | [diff] [blame] | 8548 | if (p->sort != BGP_PEER_IBGP) |
Stephen Hemminger | f5a4827 | 2011-03-24 17:30:21 +0000 | [diff] [blame] | 8549 | { |
| 8550 | if (p->gtsm_hops > 0) |
| 8551 | vty_out (vty, " External BGP neighbor may be up to %d hops away.%s", |
| 8552 | p->gtsm_hops, VTY_NEWLINE); |
| 8553 | else if (p->ttl > 1) |
| 8554 | vty_out (vty, " External BGP neighbor may be up to %d hops away.%s", |
| 8555 | p->ttl, VTY_NEWLINE); |
| 8556 | } |
Pradosh Mohapatra | 5d804b4 | 2013-09-12 03:37:07 +0000 | [diff] [blame] | 8557 | else |
| 8558 | { |
| 8559 | if (p->gtsm_hops > 0) |
| 8560 | vty_out (vty, " Internal BGP neighbor may be up to %d hops away.%s", |
| 8561 | p->gtsm_hops, VTY_NEWLINE); |
| 8562 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8563 | |
| 8564 | /* Local address. */ |
| 8565 | if (p->su_local) |
| 8566 | { |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8567 | vty_out (vty, "Local host: %s, Local port: %d%s", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8568 | sockunion2str (p->su_local, buf1, SU_ADDRSTRLEN), |
| 8569 | ntohs (p->su_local->sin.sin_port), |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8570 | VTY_NEWLINE); |
| 8571 | } |
| 8572 | |
| 8573 | /* Remote address. */ |
| 8574 | if (p->su_remote) |
| 8575 | { |
| 8576 | vty_out (vty, "Foreign host: %s, Foreign port: %d%s", |
| 8577 | sockunion2str (p->su_remote, buf1, SU_ADDRSTRLEN), |
| 8578 | ntohs (p->su_remote->sin.sin_port), |
| 8579 | VTY_NEWLINE); |
| 8580 | } |
| 8581 | |
| 8582 | /* Nexthop display. */ |
| 8583 | if (p->su_local) |
| 8584 | { |
| 8585 | vty_out (vty, "Nexthop: %s%s", |
| 8586 | inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ), |
| 8587 | VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8588 | vty_out (vty, "Nexthop global: %s%s", |
| 8589 | inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ), |
| 8590 | VTY_NEWLINE); |
| 8591 | vty_out (vty, "Nexthop local: %s%s", |
| 8592 | inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, BUFSIZ), |
| 8593 | VTY_NEWLINE); |
| 8594 | vty_out (vty, "BGP connection: %s%s", |
| 8595 | p->shared_network ? "shared network" : "non shared network", |
| 8596 | VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8597 | } |
| 8598 | |
Timo Teräs | ef75770 | 2015-04-29 09:43:04 +0300 | [diff] [blame] | 8599 | /* TCP metrics. */ |
| 8600 | if (p->status == Established && p->rtt) |
| 8601 | vty_out (vty, "Estimated round trip time: %d ms%s", |
| 8602 | p->rtt, VTY_NEWLINE); |
| 8603 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8604 | /* Timer information. */ |
| 8605 | if (p->t_start) |
| 8606 | vty_out (vty, "Next start timer due in %ld seconds%s", |
| 8607 | thread_timer_remain_second (p->t_start), VTY_NEWLINE); |
| 8608 | if (p->t_connect) |
| 8609 | vty_out (vty, "Next connect timer due in %ld seconds%s", |
| 8610 | thread_timer_remain_second (p->t_connect), VTY_NEWLINE); |
| 8611 | |
| 8612 | vty_out (vty, "Read thread: %s Write thread: %s%s", |
| 8613 | p->t_read ? "on" : "off", |
| 8614 | p->t_write ? "on" : "off", |
| 8615 | VTY_NEWLINE); |
| 8616 | |
| 8617 | if (p->notify.code == BGP_NOTIFY_OPEN_ERR |
| 8618 | && p->notify.subcode == BGP_NOTIFY_OPEN_UNSUP_CAPBL) |
| 8619 | bgp_capability_vty_out (vty, p); |
| 8620 | |
| 8621 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8622 | } |
| 8623 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8624 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8625 | bgp_show_neighbor (struct vty *vty, struct bgp *bgp, |
| 8626 | enum show_type type, union sockunion *su) |
| 8627 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 8628 | struct listnode *node, *nnode; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8629 | struct peer *peer; |
| 8630 | int find = 0; |
| 8631 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 8632 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8633 | { |
| 8634 | switch (type) |
| 8635 | { |
| 8636 | case show_all: |
| 8637 | bgp_show_peer (vty, peer); |
| 8638 | break; |
| 8639 | case show_peer: |
| 8640 | if (sockunion_same (&peer->su, su)) |
| 8641 | { |
| 8642 | find = 1; |
| 8643 | bgp_show_peer (vty, peer); |
| 8644 | } |
| 8645 | break; |
| 8646 | } |
| 8647 | } |
| 8648 | |
| 8649 | if (type == show_peer && ! find) |
| 8650 | vty_out (vty, "%% No such neighbor%s", VTY_NEWLINE); |
| 8651 | |
| 8652 | return CMD_SUCCESS; |
| 8653 | } |
| 8654 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8655 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 8656 | bgp_show_neighbor_vty (struct vty *vty, const char *name, |
| 8657 | enum show_type type, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8658 | { |
| 8659 | int ret; |
| 8660 | struct bgp *bgp; |
| 8661 | union sockunion su; |
| 8662 | |
| 8663 | if (ip_str) |
| 8664 | { |
| 8665 | ret = str2sockunion (ip_str, &su); |
| 8666 | if (ret < 0) |
| 8667 | { |
| 8668 | vty_out (vty, "%% Malformed address: %s%s", ip_str, VTY_NEWLINE); |
| 8669 | return CMD_WARNING; |
| 8670 | } |
| 8671 | } |
| 8672 | |
| 8673 | if (name) |
| 8674 | { |
| 8675 | bgp = bgp_lookup_by_name (name); |
| 8676 | |
| 8677 | if (! bgp) |
| 8678 | { |
| 8679 | vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); |
| 8680 | return CMD_WARNING; |
| 8681 | } |
| 8682 | |
| 8683 | bgp_show_neighbor (vty, bgp, type, &su); |
| 8684 | |
| 8685 | return CMD_SUCCESS; |
| 8686 | } |
| 8687 | |
| 8688 | bgp = bgp_get_default (); |
| 8689 | |
| 8690 | if (bgp) |
| 8691 | bgp_show_neighbor (vty, bgp, type, &su); |
| 8692 | |
| 8693 | return CMD_SUCCESS; |
| 8694 | } |
| 8695 | |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 8696 | /* "show ip bgp neighbors" commands. */DEFUN (show_ip_bgp_neighbors, |
| 8697 | show_ip_bgp_neighbors_cmd, |
| 8698 | "show ip bgp neighbors", |
| 8699 | SHOW_STR |
| 8700 | IP_STR |
| 8701 | BGP_STR |
| 8702 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8703 | { |
| 8704 | return bgp_show_neighbor_vty (vty, NULL, show_all, NULL); |
| 8705 | } |
| 8706 | |
| 8707 | ALIAS (show_ip_bgp_neighbors, |
| 8708 | show_ip_bgp_ipv4_neighbors_cmd, |
| 8709 | "show ip bgp ipv4 (unicast|multicast) neighbors", |
| 8710 | SHOW_STR |
| 8711 | IP_STR |
| 8712 | BGP_STR |
| 8713 | "Address family\n" |
| 8714 | "Address Family modifier\n" |
| 8715 | "Address Family modifier\n" |
| 8716 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8717 | |
| 8718 | ALIAS (show_ip_bgp_neighbors, |
| 8719 | show_ip_bgp_vpnv4_all_neighbors_cmd, |
| 8720 | "show ip bgp vpnv4 all neighbors", |
| 8721 | SHOW_STR |
| 8722 | IP_STR |
| 8723 | BGP_STR |
| 8724 | "Display VPNv4 NLRI specific information\n" |
| 8725 | "Display information about all VPNv4 NLRIs\n" |
| 8726 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8727 | |
| 8728 | ALIAS (show_ip_bgp_neighbors, |
| 8729 | show_ip_bgp_vpnv4_rd_neighbors_cmd, |
| 8730 | "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors", |
| 8731 | SHOW_STR |
| 8732 | IP_STR |
| 8733 | BGP_STR |
| 8734 | "Display VPNv4 NLRI specific information\n" |
| 8735 | "Display information for a route distinguisher\n" |
| 8736 | "VPN Route Distinguisher\n" |
| 8737 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8738 | |
| 8739 | ALIAS (show_ip_bgp_neighbors, |
| 8740 | show_bgp_ipv6_neighbors_cmd, |
| 8741 | "show bgp ipv6 neighbors", |
| 8742 | SHOW_STR |
| 8743 | BGP_STR |
| 8744 | "Address family\n" |
| 8745 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8746 | |
| 8747 | DEFUN (show_ip_bgp_neighbors_peer, |
| 8748 | show_ip_bgp_neighbors_peer_cmd, |
| 8749 | "show ip bgp neighbors (A.B.C.D|X:X::X:X)", |
| 8750 | SHOW_STR |
| 8751 | IP_STR |
| 8752 | BGP_STR |
| 8753 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8754 | "Neighbor to display information about\n" |
| 8755 | "Neighbor to display information about\n") |
| 8756 | { |
| 8757 | return bgp_show_neighbor_vty (vty, NULL, show_peer, argv[argc - 1]); |
| 8758 | } |
| 8759 | |
| 8760 | ALIAS (show_ip_bgp_neighbors_peer, |
| 8761 | show_ip_bgp_ipv4_neighbors_peer_cmd, |
| 8762 | "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)", |
| 8763 | SHOW_STR |
| 8764 | IP_STR |
| 8765 | BGP_STR |
| 8766 | "Address family\n" |
| 8767 | "Address Family modifier\n" |
| 8768 | "Address Family modifier\n" |
| 8769 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8770 | "Neighbor to display information about\n" |
| 8771 | "Neighbor to display information about\n") |
| 8772 | |
| 8773 | ALIAS (show_ip_bgp_neighbors_peer, |
| 8774 | show_ip_bgp_vpnv4_all_neighbors_peer_cmd, |
| 8775 | "show ip bgp vpnv4 all neighbors A.B.C.D", |
| 8776 | SHOW_STR |
| 8777 | IP_STR |
| 8778 | BGP_STR |
| 8779 | "Display VPNv4 NLRI specific information\n" |
| 8780 | "Display information about all VPNv4 NLRIs\n" |
| 8781 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8782 | "Neighbor to display information about\n") |
| 8783 | |
| 8784 | ALIAS (show_ip_bgp_neighbors_peer, |
| 8785 | show_ip_bgp_vpnv4_rd_neighbors_peer_cmd, |
| 8786 | "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D", |
| 8787 | SHOW_STR |
| 8788 | IP_STR |
| 8789 | BGP_STR |
| 8790 | "Display VPNv4 NLRI specific information\n" |
| 8791 | "Display information about all VPNv4 NLRIs\n" |
| 8792 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8793 | "Neighbor to display information about\n") |
| 8794 | |
| 8795 | ALIAS (show_ip_bgp_neighbors_peer, |
| 8796 | show_bgp_ipv6_neighbors_peer_cmd, |
| 8797 | "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)", |
| 8798 | SHOW_STR |
| 8799 | BGP_STR |
| 8800 | "Address family\n" |
| 8801 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8802 | "Neighbor to display information about\n" |
| 8803 | "Neighbor to display information about\n") |
| 8804 | |
| 8805 | DEFUN (show_ip_bgp_instance_neighbors, |
| 8806 | show_ip_bgp_instance_neighbors_cmd, |
| 8807 | "show ip bgp view WORD neighbors", |
| 8808 | SHOW_STR |
| 8809 | IP_STR |
| 8810 | BGP_STR |
| 8811 | "BGP view\n" |
| 8812 | "View name\n" |
| 8813 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8814 | { |
| 8815 | return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL); |
| 8816 | } |
| 8817 | |
| 8818 | ALIAS (show_ip_bgp_instance_neighbors, |
| 8819 | show_bgp_instance_ipv6_neighbors_cmd, |
| 8820 | "show bgp view WORD ipv6 neighbors", |
| 8821 | SHOW_STR |
| 8822 | BGP_STR |
| 8823 | "BGP view\n" |
| 8824 | "View name\n" |
| 8825 | "Address family\n" |
| 8826 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8827 | |
| 8828 | DEFUN (show_ip_bgp_instance_neighbors_peer, |
| 8829 | show_ip_bgp_instance_neighbors_peer_cmd, |
| 8830 | "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)", |
| 8831 | SHOW_STR |
| 8832 | IP_STR |
| 8833 | BGP_STR |
| 8834 | "BGP view\n" |
| 8835 | "View name\n" |
| 8836 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8837 | "Neighbor to display information about\n" |
| 8838 | "Neighbor to display information about\n") |
| 8839 | { |
| 8840 | return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]); |
| 8841 | } |
| 8842 | |
| 8843 | /* Show BGP's AS paths internal data. There are both `show ip bgp |
| 8844 | paths' and `show ip mbgp paths'. Those functions results are the |
| 8845 | same.*/ |
| 8846 | DEFUN (show_ip_bgp_paths, |
| 8847 | show_ip_bgp_paths_cmd, |
| 8848 | "show ip bgp paths", |
| 8849 | SHOW_STR |
| 8850 | IP_STR |
| 8851 | BGP_STR |
| 8852 | "Path information\n") |
| 8853 | { |
| 8854 | vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE); |
| 8855 | aspath_print_all_vty (vty); |
| 8856 | return CMD_SUCCESS; |
| 8857 | } |
| 8858 | |
| 8859 | DEFUN (show_ip_bgp_ipv4_paths, |
| 8860 | show_ip_bgp_ipv4_paths_cmd, |
| 8861 | "show ip bgp ipv4 (unicast|multicast) paths", |
| 8862 | SHOW_STR |
| 8863 | IP_STR |
| 8864 | BGP_STR |
| 8865 | "Address family\n" |
| 8866 | "Address Family modifier\n" |
| 8867 | "Address Family modifier\n" |
| 8868 | "Path information\n") |
| 8869 | { |
| 8870 | vty_out (vty, "Address Refcnt Path\r\n"); |
| 8871 | aspath_print_all_vty (vty); |
| 8872 | |
| 8873 | return CMD_SUCCESS; |
| 8874 | } |
| 8875 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8876 | DEFUN (show_bgp_neighbors, |
| 8877 | show_bgp_neighbors_cmd, |
| 8878 | "show bgp neighbors", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8879 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8880 | BGP_STR |
| 8881 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8882 | { |
| 8883 | return bgp_show_neighbor_vty (vty, NULL, show_all, NULL); |
| 8884 | } |
| 8885 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8886 | DEFUN (show_bgp_neighbors_peer, |
| 8887 | show_bgp_neighbors_peer_cmd, |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8888 | "show bgp neighbors (A.B.C.D|X:X::X:X)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8889 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8890 | BGP_STR |
| 8891 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8892 | "Neighbor to display information about\n" |
| 8893 | "Neighbor to display information about\n") |
| 8894 | { |
| 8895 | return bgp_show_neighbor_vty (vty, NULL, show_peer, argv[argc - 1]); |
| 8896 | } |
| 8897 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8898 | DEFUN (show_bgp_instance_neighbors, |
| 8899 | show_bgp_instance_neighbors_cmd, |
| 8900 | "show bgp view WORD neighbors", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8901 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8902 | BGP_STR |
| 8903 | "BGP view\n" |
| 8904 | "View name\n" |
| 8905 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8906 | { |
| 8907 | return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL); |
| 8908 | } |
| 8909 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8910 | DEFUN (show_bgp_instance_neighbors_peer, |
| 8911 | show_bgp_instance_neighbors_peer_cmd, |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8912 | "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8913 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8914 | BGP_STR |
| 8915 | "BGP view\n" |
| 8916 | "View name\n" |
| 8917 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8918 | "Neighbor to display information about\n" |
| 8919 | "Neighbor to display information about\n") |
| 8920 | { |
| 8921 | return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]); |
| 8922 | } |
paul | bb46e94 | 2003-10-24 19:02:03 +0000 | [diff] [blame] | 8923 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8924 | ALIAS (show_bgp_instance_neighbors_peer, |
paul | bb46e94 | 2003-10-24 19:02:03 +0000 | [diff] [blame] | 8925 | show_bgp_instance_ipv6_neighbors_peer_cmd, |
| 8926 | "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)", |
| 8927 | SHOW_STR |
| 8928 | BGP_STR |
| 8929 | "BGP view\n" |
| 8930 | "View name\n" |
| 8931 | "Address family\n" |
| 8932 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8933 | "Neighbor to display information about\n" |
| 8934 | "Neighbor to display information about\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 8935 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8936 | /* Show BGP's AS paths internal data. There are both `show ip bgp |
| 8937 | paths' and `show ip mbgp paths'. Those functions results are the |
| 8938 | same.*/ |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8939 | DEFUN (show_bgp_ipv4_paths, |
| 8940 | show_bgp_ipv4_paths_cmd, |
| 8941 | "show bgp paths", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8942 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8943 | BGP_STR |
| 8944 | "Path information\n") |
| 8945 | { |
| 8946 | vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE); |
| 8947 | aspath_print_all_vty (vty); |
| 8948 | return CMD_SUCCESS; |
| 8949 | } |
| 8950 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8951 | #include "hash.h" |
| 8952 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8953 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8954 | community_show_all_iterator (struct hash_backet *backet, struct vty *vty) |
| 8955 | { |
| 8956 | struct community *com; |
| 8957 | |
| 8958 | com = (struct community *) backet->data; |
David Lamparter | eed3c48 | 2015-03-03 08:51:53 +0100 | [diff] [blame] | 8959 | vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, com->refcnt, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8960 | community_str (com), VTY_NEWLINE); |
| 8961 | } |
| 8962 | |
| 8963 | /* Show BGP's community internal data. */ |
| 8964 | DEFUN (show_ip_bgp_community_info, |
| 8965 | show_ip_bgp_community_info_cmd, |
| 8966 | "show ip bgp community-info", |
| 8967 | SHOW_STR |
| 8968 | IP_STR |
| 8969 | BGP_STR |
| 8970 | "List all bgp community information\n") |
| 8971 | { |
| 8972 | vty_out (vty, "Address Refcnt Community%s", VTY_NEWLINE); |
| 8973 | |
| 8974 | hash_iterate (community_hash (), |
| 8975 | (void (*) (struct hash_backet *, void *)) |
| 8976 | community_show_all_iterator, |
| 8977 | vty); |
| 8978 | |
| 8979 | return CMD_SUCCESS; |
| 8980 | } |
| 8981 | |
| 8982 | DEFUN (show_ip_bgp_attr_info, |
| 8983 | show_ip_bgp_attr_info_cmd, |
| 8984 | "show ip bgp attribute-info", |
| 8985 | SHOW_STR |
| 8986 | IP_STR |
| 8987 | BGP_STR |
| 8988 | "List all bgp attribute information\n") |
| 8989 | { |
| 8990 | attr_show_all (vty); |
| 8991 | return CMD_SUCCESS; |
| 8992 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 8993 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8994 | static int |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8995 | bgp_write_rsclient_summary (struct vty *vty, struct peer *rsclient, |
| 8996 | afi_t afi, safi_t safi) |
| 8997 | { |
| 8998 | char timebuf[BGP_UPTIME_LEN]; |
| 8999 | char rmbuf[14]; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 9000 | const char *rmname; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9001 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 9002 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9003 | int len; |
| 9004 | int count = 0; |
| 9005 | |
| 9006 | if (CHECK_FLAG (rsclient->sflags, PEER_STATUS_GROUP)) |
| 9007 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 9008 | for (ALL_LIST_ELEMENTS (rsclient->group->peer, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9009 | { |
| 9010 | count++; |
| 9011 | bgp_write_rsclient_summary (vty, peer, afi, safi); |
| 9012 | } |
| 9013 | return count; |
| 9014 | } |
| 9015 | |
| 9016 | len = vty_out (vty, "%s", rsclient->host); |
| 9017 | len = 16 - len; |
| 9018 | |
| 9019 | if (len < 1) |
| 9020 | vty_out (vty, "%s%*s", VTY_NEWLINE, 16, " "); |
| 9021 | else |
| 9022 | vty_out (vty, "%*s", len, " "); |
| 9023 | |
hasso | 3d515fd | 2005-02-01 21:30:04 +0000 | [diff] [blame] | 9024 | vty_out (vty, "4 "); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9025 | |
Milan Kocian | cb4fc59 | 2014-12-01 12:48:25 +0000 | [diff] [blame] | 9026 | vty_out (vty, "%10u ", rsclient->as); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9027 | |
| 9028 | rmname = ROUTE_MAP_EXPORT_NAME(&rsclient->filter[afi][safi]); |
| 9029 | if ( rmname && strlen (rmname) > 13 ) |
| 9030 | { |
| 9031 | sprintf (rmbuf, "%13s", "..."); |
| 9032 | rmname = strncpy (rmbuf, rmname, 10); |
| 9033 | } |
| 9034 | else if (! rmname) |
| 9035 | rmname = "<none>"; |
| 9036 | vty_out (vty, " %13s ", rmname); |
| 9037 | |
| 9038 | rmname = ROUTE_MAP_IMPORT_NAME(&rsclient->filter[afi][safi]); |
| 9039 | if ( rmname && strlen (rmname) > 13 ) |
| 9040 | { |
| 9041 | sprintf (rmbuf, "%13s", "..."); |
| 9042 | rmname = strncpy (rmbuf, rmname, 10); |
| 9043 | } |
| 9044 | else if (! rmname) |
| 9045 | rmname = "<none>"; |
| 9046 | vty_out (vty, " %13s ", rmname); |
| 9047 | |
| 9048 | vty_out (vty, "%8s", peer_uptime (rsclient->uptime, timebuf, BGP_UPTIME_LEN)); |
| 9049 | |
| 9050 | if (CHECK_FLAG (rsclient->flags, PEER_FLAG_SHUTDOWN)) |
| 9051 | vty_out (vty, " Idle (Admin)"); |
| 9052 | else if (CHECK_FLAG (rsclient->sflags, PEER_STATUS_PREFIX_OVERFLOW)) |
| 9053 | vty_out (vty, " Idle (PfxCt)"); |
| 9054 | else |
| 9055 | vty_out (vty, " %-11s", LOOKUP(bgp_status_msg, rsclient->status)); |
| 9056 | |
| 9057 | vty_out (vty, "%s", VTY_NEWLINE); |
| 9058 | |
| 9059 | return 1; |
| 9060 | } |
| 9061 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 9062 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 9063 | bgp_show_rsclient_summary (struct vty *vty, struct bgp *bgp, |
| 9064 | afi_t afi, safi_t safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9065 | { |
| 9066 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 9067 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9068 | int count = 0; |
| 9069 | |
| 9070 | /* Header string for each address family. */ |
Milan Kocian | cb4fc59 | 2014-12-01 12:48:25 +0000 | [diff] [blame] | 9071 | static char header[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State"; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9072 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 9073 | for (ALL_LIST_ELEMENTS (bgp->rsclient, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9074 | { |
| 9075 | if (peer->afc[afi][safi] && |
| 9076 | CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT)) |
| 9077 | { |
| 9078 | if (! count) |
| 9079 | { |
| 9080 | vty_out (vty, |
| 9081 | "Route Server's BGP router identifier %s%s", |
| 9082 | inet_ntoa (bgp->router_id), VTY_NEWLINE); |
| 9083 | vty_out (vty, |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 9084 | "Route Server's local AS number %u%s", bgp->as, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9085 | VTY_NEWLINE); |
| 9086 | |
| 9087 | vty_out (vty, "%s", VTY_NEWLINE); |
| 9088 | vty_out (vty, "%s%s", header, VTY_NEWLINE); |
| 9089 | } |
| 9090 | |
| 9091 | count += bgp_write_rsclient_summary (vty, peer, afi, safi); |
| 9092 | } |
| 9093 | } |
| 9094 | |
| 9095 | if (count) |
| 9096 | vty_out (vty, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE, |
| 9097 | count, VTY_NEWLINE); |
| 9098 | else |
| 9099 | vty_out (vty, "No %s Route Server Client is configured%s", |
| 9100 | afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE); |
| 9101 | |
| 9102 | return CMD_SUCCESS; |
| 9103 | } |
| 9104 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 9105 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 9106 | bgp_show_rsclient_summary_vty (struct vty *vty, const char *name, |
| 9107 | afi_t afi, safi_t safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9108 | { |
| 9109 | struct bgp *bgp; |
| 9110 | |
| 9111 | if (name) |
| 9112 | { |
| 9113 | bgp = bgp_lookup_by_name (name); |
| 9114 | |
| 9115 | if (! bgp) |
| 9116 | { |
| 9117 | vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); |
| 9118 | return CMD_WARNING; |
| 9119 | } |
| 9120 | |
| 9121 | bgp_show_rsclient_summary (vty, bgp, afi, safi); |
| 9122 | return CMD_SUCCESS; |
| 9123 | } |
| 9124 | |
| 9125 | bgp = bgp_get_default (); |
| 9126 | |
| 9127 | if (bgp) |
| 9128 | bgp_show_rsclient_summary (vty, bgp, afi, safi); |
| 9129 | |
| 9130 | return CMD_SUCCESS; |
| 9131 | } |
| 9132 | |
| 9133 | /* 'show bgp rsclient' commands. */ |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 9134 | DEFUN (show_ip_bgp_rsclient_summary, |
| 9135 | show_ip_bgp_rsclient_summary_cmd, |
| 9136 | "show ip bgp rsclient summary", |
| 9137 | SHOW_STR |
| 9138 | IP_STR |
| 9139 | BGP_STR |
| 9140 | "Information about Route Server Clients\n" |
| 9141 | "Summary of all Route Server Clients\n") |
| 9142 | { |
| 9143 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 9144 | } |
| 9145 | |
| 9146 | DEFUN (show_ip_bgp_instance_rsclient_summary, |
| 9147 | show_ip_bgp_instance_rsclient_summary_cmd, |
| 9148 | "show ip bgp view WORD rsclient summary", |
| 9149 | SHOW_STR |
| 9150 | IP_STR |
| 9151 | BGP_STR |
| 9152 | "BGP view\n" |
| 9153 | "View name\n" |
| 9154 | "Information about Route Server Clients\n" |
| 9155 | "Summary of all Route Server Clients\n") |
| 9156 | { |
| 9157 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 9158 | } |
| 9159 | |
| 9160 | DEFUN (show_ip_bgp_ipv4_rsclient_summary, |
| 9161 | show_ip_bgp_ipv4_rsclient_summary_cmd, |
| 9162 | "show ip bgp ipv4 (unicast|multicast) rsclient summary", |
| 9163 | SHOW_STR |
| 9164 | IP_STR |
| 9165 | BGP_STR |
| 9166 | "Address family\n" |
| 9167 | "Address Family modifier\n" |
| 9168 | "Address Family modifier\n" |
| 9169 | "Information about Route Server Clients\n" |
| 9170 | "Summary of all Route Server Clients\n") |
| 9171 | { |
| 9172 | if (strncmp (argv[0], "m", 1) == 0) |
| 9173 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 9174 | |
| 9175 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 9176 | } |
| 9177 | |
| 9178 | DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary, |
| 9179 | show_ip_bgp_instance_ipv4_rsclient_summary_cmd, |
| 9180 | "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary", |
| 9181 | SHOW_STR |
| 9182 | IP_STR |
| 9183 | BGP_STR |
| 9184 | "BGP view\n" |
| 9185 | "View name\n" |
| 9186 | "Address family\n" |
| 9187 | "Address Family modifier\n" |
| 9188 | "Address Family modifier\n" |
| 9189 | "Information about Route Server Clients\n" |
| 9190 | "Summary of all Route Server Clients\n") |
| 9191 | { |
| 9192 | if (strncmp (argv[1], "m", 1) == 0) |
| 9193 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 9194 | |
| 9195 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 9196 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9197 | |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 9198 | DEFUN (show_bgp_instance_ipv4_safi_rsclient_summary, |
| 9199 | show_bgp_instance_ipv4_safi_rsclient_summary_cmd, |
| 9200 | "show bgp view WORD ipv4 (unicast|multicast) rsclient summary", |
| 9201 | SHOW_STR |
| 9202 | BGP_STR |
| 9203 | "BGP view\n" |
| 9204 | "View name\n" |
| 9205 | "Address family\n" |
| 9206 | "Address Family modifier\n" |
| 9207 | "Address Family modifier\n" |
| 9208 | "Information about Route Server Clients\n" |
| 9209 | "Summary of all Route Server Clients\n") |
| 9210 | { |
| 9211 | safi_t safi; |
| 9212 | |
| 9213 | if (argc == 2) { |
| 9214 | safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; |
| 9215 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, safi); |
| 9216 | } else { |
| 9217 | safi = (strncmp (argv[0], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; |
| 9218 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, safi); |
| 9219 | } |
| 9220 | } |
| 9221 | |
| 9222 | ALIAS (show_bgp_instance_ipv4_safi_rsclient_summary, |
| 9223 | show_bgp_ipv4_safi_rsclient_summary_cmd, |
| 9224 | "show bgp ipv4 (unicast|multicast) rsclient summary", |
| 9225 | SHOW_STR |
| 9226 | BGP_STR |
| 9227 | "Address family\n" |
| 9228 | "Address Family modifier\n" |
| 9229 | "Address Family modifier\n" |
| 9230 | "Information about Route Server Clients\n" |
| 9231 | "Summary of all Route Server Clients\n") |
| 9232 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9233 | DEFUN (show_bgp_rsclient_summary, |
| 9234 | show_bgp_rsclient_summary_cmd, |
| 9235 | "show bgp rsclient summary", |
| 9236 | SHOW_STR |
| 9237 | BGP_STR |
| 9238 | "Information about Route Server Clients\n" |
| 9239 | "Summary of all Route Server Clients\n") |
| 9240 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9241 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9242 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9243 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 9244 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9245 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9246 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 9247 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9248 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9249 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 9250 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9251 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9252 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); |
| 9253 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9254 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9255 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9256 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 9257 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9258 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9259 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 9260 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9261 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9262 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
| 9263 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9264 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9265 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 9266 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9267 | return CMD_SUCCESS; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9268 | } |
| 9269 | |
| 9270 | DEFUN (show_bgp_instance_rsclient_summary, |
| 9271 | show_bgp_instance_rsclient_summary_cmd, |
| 9272 | "show bgp view WORD rsclient summary", |
| 9273 | SHOW_STR |
| 9274 | BGP_STR |
| 9275 | "BGP view\n" |
| 9276 | "View name\n" |
| 9277 | "Information about Route Server Clients\n" |
| 9278 | "Summary of all Route Server Clients\n") |
| 9279 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9280 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9281 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9282 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 9283 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9284 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9285 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 9286 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9287 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9288 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN); |
| 9289 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9290 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9291 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP); |
| 9292 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9293 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9294 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9295 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 9296 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9297 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9298 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); |
| 9299 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9300 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9301 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); |
| 9302 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9303 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9304 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 9305 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9306 | return CMD_SUCCESS; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9307 | } |
| 9308 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9309 | DEFUN (show_bgp_ipv6_rsclient_summary, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9310 | show_bgp_ipv6_rsclient_summary_cmd, |
| 9311 | "show bgp ipv6 rsclient summary", |
| 9312 | SHOW_STR |
| 9313 | BGP_STR |
| 9314 | "Address family\n" |
| 9315 | "Information about Route Server Clients\n" |
| 9316 | "Summary of all Route Server Clients\n") |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9317 | { |
| 9318 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9319 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9320 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 9321 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9322 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9323 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 9324 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9325 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9326 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
| 9327 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9328 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9329 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9330 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9331 | return CMD_SUCCESS; |
| 9332 | } |
| 9333 | |
| 9334 | DEFUN (show_bgp_instance_ipv6_rsclient_summary, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9335 | show_bgp_instance_ipv6_rsclient_summary_cmd, |
| 9336 | "show bgp view WORD ipv6 rsclient summary", |
| 9337 | SHOW_STR |
| 9338 | BGP_STR |
| 9339 | "BGP view\n" |
| 9340 | "View name\n" |
| 9341 | "Address family\n" |
| 9342 | "Information about Route Server Clients\n" |
| 9343 | "Summary of all Route Server Clients\n") |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9344 | { |
| 9345 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9346 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9347 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 9348 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9349 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9350 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); |
| 9351 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9352 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9353 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); |
| 9354 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9355 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9356 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); |
| 9357 | |
| 9358 | return CMD_SUCCESS; |
| 9359 | } |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 9360 | |
| 9361 | DEFUN (show_bgp_instance_ipv6_safi_rsclient_summary, |
| 9362 | show_bgp_instance_ipv6_safi_rsclient_summary_cmd, |
| 9363 | "show bgp view WORD ipv6 (unicast|multicast) rsclient summary", |
| 9364 | SHOW_STR |
| 9365 | BGP_STR |
| 9366 | "BGP view\n" |
| 9367 | "View name\n" |
| 9368 | "Address family\n" |
| 9369 | "Address Family modifier\n" |
| 9370 | "Address Family modifier\n" |
| 9371 | "Information about Route Server Clients\n" |
| 9372 | "Summary of all Route Server Clients\n") |
| 9373 | { |
| 9374 | safi_t safi; |
| 9375 | |
| 9376 | if (argc == 2) { |
| 9377 | safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; |
| 9378 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, safi); |
| 9379 | } else { |
| 9380 | safi = (strncmp (argv[0], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; |
| 9381 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, safi); |
| 9382 | } |
| 9383 | } |
| 9384 | |
| 9385 | ALIAS (show_bgp_instance_ipv6_safi_rsclient_summary, |
| 9386 | show_bgp_ipv6_safi_rsclient_summary_cmd, |
| 9387 | "show bgp ipv6 (unicast|multicast) rsclient summary", |
| 9388 | SHOW_STR |
| 9389 | BGP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9390 | IPV6_STR |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 9391 | "Address Family modifier\n" |
| 9392 | "Address Family modifier\n" |
| 9393 | "Information about Route Server Clients\n" |
| 9394 | "Summary of all Route Server Clients\n") |
| 9395 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9396 | /* Redistribute VTY commands. */ |
| 9397 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9398 | DEFUN (bgp_redistribute_ipv4, |
| 9399 | bgp_redistribute_ipv4_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9400 | "redistribute " QUAGGA_IP_REDIST_STR_BGPD, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9401 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9402 | QUAGGA_IP_REDIST_HELP_STR_BGPD) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9403 | { |
| 9404 | int type; |
| 9405 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9406 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9407 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9408 | { |
| 9409 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9410 | return CMD_WARNING; |
| 9411 | } |
| 9412 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 9413 | } |
| 9414 | |
| 9415 | DEFUN (bgp_redistribute_ipv4_rmap, |
| 9416 | bgp_redistribute_ipv4_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9417 | "redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9418 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9419 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9420 | "Route map reference\n" |
| 9421 | "Pointer to route-map entries\n") |
| 9422 | { |
| 9423 | int type; |
| 9424 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9425 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9426 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9427 | { |
| 9428 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9429 | return CMD_WARNING; |
| 9430 | } |
| 9431 | |
| 9432 | bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[1]); |
| 9433 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 9434 | } |
| 9435 | |
| 9436 | DEFUN (bgp_redistribute_ipv4_metric, |
| 9437 | bgp_redistribute_ipv4_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9438 | "redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9439 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9440 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9441 | "Metric for redistributed routes\n" |
| 9442 | "Default metric\n") |
| 9443 | { |
| 9444 | int type; |
| 9445 | u_int32_t metric; |
| 9446 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9447 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9448 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9449 | { |
| 9450 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9451 | return CMD_WARNING; |
| 9452 | } |
| 9453 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 9454 | |
| 9455 | bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric); |
| 9456 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 9457 | } |
| 9458 | |
| 9459 | DEFUN (bgp_redistribute_ipv4_rmap_metric, |
| 9460 | bgp_redistribute_ipv4_rmap_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9461 | "redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9462 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9463 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9464 | "Route map reference\n" |
| 9465 | "Pointer to route-map entries\n" |
| 9466 | "Metric for redistributed routes\n" |
| 9467 | "Default metric\n") |
| 9468 | { |
| 9469 | int type; |
| 9470 | u_int32_t metric; |
| 9471 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9472 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9473 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9474 | { |
| 9475 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9476 | return CMD_WARNING; |
| 9477 | } |
| 9478 | VTY_GET_INTEGER ("metric", metric, argv[2]); |
| 9479 | |
| 9480 | bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[1]); |
| 9481 | bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric); |
| 9482 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 9483 | } |
| 9484 | |
| 9485 | DEFUN (bgp_redistribute_ipv4_metric_rmap, |
| 9486 | bgp_redistribute_ipv4_metric_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9487 | "redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9488 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9489 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9490 | "Metric for redistributed routes\n" |
| 9491 | "Default metric\n" |
| 9492 | "Route map reference\n" |
| 9493 | "Pointer to route-map entries\n") |
| 9494 | { |
| 9495 | int type; |
| 9496 | u_int32_t metric; |
| 9497 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9498 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9499 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9500 | { |
| 9501 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9502 | return CMD_WARNING; |
| 9503 | } |
| 9504 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 9505 | |
| 9506 | bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric); |
| 9507 | bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[2]); |
| 9508 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 9509 | } |
| 9510 | |
| 9511 | DEFUN (no_bgp_redistribute_ipv4, |
| 9512 | no_bgp_redistribute_ipv4_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9513 | "no redistribute " QUAGGA_IP_REDIST_STR_BGPD, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9514 | NO_STR |
| 9515 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9516 | QUAGGA_IP_REDIST_HELP_STR_BGPD) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9517 | { |
| 9518 | int type; |
| 9519 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9520 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9521 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9522 | { |
| 9523 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9524 | return CMD_WARNING; |
| 9525 | } |
| 9526 | |
| 9527 | return bgp_redistribute_unset (vty->index, AFI_IP, type); |
| 9528 | } |
| 9529 | |
Daniel Walton | c0a4cc7 | 2015-11-09 20:22:00 -0500 | [diff] [blame^] | 9530 | ALIAS (no_bgp_redistribute_ipv4, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9531 | no_bgp_redistribute_ipv4_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9532 | "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9533 | NO_STR |
| 9534 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9535 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9536 | "Route map reference\n" |
| 9537 | "Pointer to route-map entries\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9538 | |
Daniel Walton | c0a4cc7 | 2015-11-09 20:22:00 -0500 | [diff] [blame^] | 9539 | ALIAS (no_bgp_redistribute_ipv4, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9540 | no_bgp_redistribute_ipv4_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9541 | "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9542 | NO_STR |
| 9543 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9544 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9545 | "Metric for redistributed routes\n" |
| 9546 | "Default metric\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9547 | |
Daniel Walton | c0a4cc7 | 2015-11-09 20:22:00 -0500 | [diff] [blame^] | 9548 | ALIAS (no_bgp_redistribute_ipv4, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9549 | no_bgp_redistribute_ipv4_rmap_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9550 | "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9551 | NO_STR |
| 9552 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9553 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9554 | "Route map reference\n" |
| 9555 | "Pointer to route-map entries\n" |
| 9556 | "Metric for redistributed routes\n" |
| 9557 | "Default metric\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9558 | |
Daniel Walton | c0a4cc7 | 2015-11-09 20:22:00 -0500 | [diff] [blame^] | 9559 | ALIAS (no_bgp_redistribute_ipv4, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9560 | no_bgp_redistribute_ipv4_metric_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9561 | "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9562 | NO_STR |
| 9563 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9564 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9565 | "Metric for redistributed routes\n" |
| 9566 | "Default metric\n" |
| 9567 | "Route map reference\n" |
| 9568 | "Pointer to route-map entries\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 9569 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9570 | DEFUN (bgp_redistribute_ipv6, |
| 9571 | bgp_redistribute_ipv6_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9572 | "redistribute " QUAGGA_IP6_REDIST_STR_BGPD, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9573 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9574 | QUAGGA_IP6_REDIST_HELP_STR_BGPD) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9575 | { |
| 9576 | int type; |
| 9577 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9578 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9579 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9580 | { |
| 9581 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9582 | return CMD_WARNING; |
| 9583 | } |
| 9584 | |
| 9585 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 9586 | } |
| 9587 | |
| 9588 | DEFUN (bgp_redistribute_ipv6_rmap, |
| 9589 | bgp_redistribute_ipv6_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9590 | "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9591 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9592 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9593 | "Route map reference\n" |
| 9594 | "Pointer to route-map entries\n") |
| 9595 | { |
| 9596 | int type; |
| 9597 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9598 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9599 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9600 | { |
| 9601 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9602 | return CMD_WARNING; |
| 9603 | } |
| 9604 | |
| 9605 | bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[1]); |
| 9606 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 9607 | } |
| 9608 | |
| 9609 | DEFUN (bgp_redistribute_ipv6_metric, |
| 9610 | bgp_redistribute_ipv6_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9611 | "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9612 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9613 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9614 | "Metric for redistributed routes\n" |
| 9615 | "Default metric\n") |
| 9616 | { |
| 9617 | int type; |
| 9618 | u_int32_t metric; |
| 9619 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9620 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9621 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9622 | { |
| 9623 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9624 | return CMD_WARNING; |
| 9625 | } |
| 9626 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 9627 | |
| 9628 | bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric); |
| 9629 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 9630 | } |
| 9631 | |
| 9632 | DEFUN (bgp_redistribute_ipv6_rmap_metric, |
| 9633 | bgp_redistribute_ipv6_rmap_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9634 | "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9635 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9636 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9637 | "Route map reference\n" |
| 9638 | "Pointer to route-map entries\n" |
| 9639 | "Metric for redistributed routes\n" |
| 9640 | "Default metric\n") |
| 9641 | { |
| 9642 | int type; |
| 9643 | u_int32_t metric; |
| 9644 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9645 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9646 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9647 | { |
| 9648 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9649 | return CMD_WARNING; |
| 9650 | } |
| 9651 | VTY_GET_INTEGER ("metric", metric, argv[2]); |
| 9652 | |
| 9653 | bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[1]); |
| 9654 | bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric); |
| 9655 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 9656 | } |
| 9657 | |
| 9658 | DEFUN (bgp_redistribute_ipv6_metric_rmap, |
| 9659 | bgp_redistribute_ipv6_metric_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9660 | "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9661 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9662 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9663 | "Metric for redistributed routes\n" |
| 9664 | "Default metric\n" |
| 9665 | "Route map reference\n" |
| 9666 | "Pointer to route-map entries\n") |
| 9667 | { |
| 9668 | int type; |
| 9669 | u_int32_t metric; |
| 9670 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9671 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9672 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9673 | { |
| 9674 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9675 | return CMD_WARNING; |
| 9676 | } |
| 9677 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 9678 | |
| 9679 | bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric); |
| 9680 | bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[2]); |
| 9681 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 9682 | } |
| 9683 | |
| 9684 | DEFUN (no_bgp_redistribute_ipv6, |
| 9685 | no_bgp_redistribute_ipv6_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9686 | "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9687 | NO_STR |
| 9688 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9689 | QUAGGA_IP6_REDIST_HELP_STR_BGPD) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9690 | { |
| 9691 | int type; |
| 9692 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9693 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9694 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9695 | { |
| 9696 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9697 | return CMD_WARNING; |
| 9698 | } |
| 9699 | |
| 9700 | return bgp_redistribute_unset (vty->index, AFI_IP6, type); |
| 9701 | } |
| 9702 | |
Daniel Walton | c0a4cc7 | 2015-11-09 20:22:00 -0500 | [diff] [blame^] | 9703 | ALIAS (no_bgp_redistribute_ipv6, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9704 | no_bgp_redistribute_ipv6_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9705 | "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9706 | NO_STR |
| 9707 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9708 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9709 | "Route map reference\n" |
| 9710 | "Pointer to route-map entries\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9711 | |
Daniel Walton | c0a4cc7 | 2015-11-09 20:22:00 -0500 | [diff] [blame^] | 9712 | ALIAS (no_bgp_redistribute_ipv6, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9713 | no_bgp_redistribute_ipv6_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9714 | "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9715 | NO_STR |
| 9716 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9717 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9718 | "Metric for redistributed routes\n" |
| 9719 | "Default metric\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9720 | |
Daniel Walton | c0a4cc7 | 2015-11-09 20:22:00 -0500 | [diff] [blame^] | 9721 | ALIAS (no_bgp_redistribute_ipv6, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9722 | no_bgp_redistribute_ipv6_rmap_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9723 | "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9724 | NO_STR |
| 9725 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9726 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9727 | "Route map reference\n" |
| 9728 | "Pointer to route-map entries\n" |
| 9729 | "Metric for redistributed routes\n" |
| 9730 | "Default metric\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9731 | |
Daniel Walton | c0a4cc7 | 2015-11-09 20:22:00 -0500 | [diff] [blame^] | 9732 | ALIAS (no_bgp_redistribute_ipv6, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9733 | no_bgp_redistribute_ipv6_metric_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9734 | "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9735 | NO_STR |
| 9736 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9737 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9738 | "Metric for redistributed routes\n" |
| 9739 | "Default metric\n" |
| 9740 | "Route map reference\n" |
| 9741 | "Pointer to route-map entries\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 9742 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9743 | int |
| 9744 | bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi, |
| 9745 | safi_t safi, int *write) |
| 9746 | { |
| 9747 | int i; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9748 | |
| 9749 | /* Unicast redistribution only. */ |
| 9750 | if (safi != SAFI_UNICAST) |
| 9751 | return 0; |
| 9752 | |
| 9753 | for (i = 0; i < ZEBRA_ROUTE_MAX; i++) |
| 9754 | { |
| 9755 | /* Redistribute BGP does not make sense. */ |
| 9756 | if (bgp->redist[afi][i] && i != ZEBRA_ROUTE_BGP) |
| 9757 | { |
| 9758 | /* Display "address-family" when it is not yet diplayed. */ |
| 9759 | bgp_config_write_family_header (vty, afi, safi, write); |
| 9760 | |
| 9761 | /* "redistribute" configuration. */ |
ajs | f52d13c | 2005-10-01 17:38:06 +0000 | [diff] [blame] | 9762 | vty_out (vty, " redistribute %s", zebra_route_string(i)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9763 | |
| 9764 | if (bgp->redist_metric_flag[afi][i]) |
Jorge Boncompte [DTI2] | ddc943d | 2012-04-13 13:46:07 +0200 | [diff] [blame] | 9765 | vty_out (vty, " metric %u", bgp->redist_metric[afi][i]); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9766 | |
| 9767 | if (bgp->rmap[afi][i].name) |
| 9768 | vty_out (vty, " route-map %s", bgp->rmap[afi][i].name); |
| 9769 | |
| 9770 | vty_out (vty, "%s", VTY_NEWLINE); |
| 9771 | } |
| 9772 | } |
| 9773 | return *write; |
| 9774 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 9775 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9776 | /* BGP node structure. */ |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9777 | static struct cmd_node bgp_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9778 | { |
| 9779 | BGP_NODE, |
| 9780 | "%s(config-router)# ", |
| 9781 | 1, |
| 9782 | }; |
| 9783 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9784 | static struct cmd_node bgp_ipv4_unicast_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9785 | { |
| 9786 | BGP_IPV4_NODE, |
| 9787 | "%s(config-router-af)# ", |
| 9788 | 1, |
| 9789 | }; |
| 9790 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9791 | static struct cmd_node bgp_ipv4_multicast_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9792 | { |
| 9793 | BGP_IPV4M_NODE, |
| 9794 | "%s(config-router-af)# ", |
| 9795 | 1, |
| 9796 | }; |
| 9797 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9798 | static struct cmd_node bgp_ipv6_unicast_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9799 | { |
| 9800 | BGP_IPV6_NODE, |
| 9801 | "%s(config-router-af)# ", |
| 9802 | 1, |
| 9803 | }; |
| 9804 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9805 | static struct cmd_node bgp_ipv6_multicast_node = |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9806 | { |
| 9807 | BGP_IPV6M_NODE, |
| 9808 | "%s(config-router-af)# ", |
| 9809 | 1, |
| 9810 | }; |
| 9811 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9812 | static struct cmd_node bgp_vpnv4_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9813 | { |
| 9814 | BGP_VPNV4_NODE, |
| 9815 | "%s(config-router-af)# ", |
| 9816 | 1 |
| 9817 | }; |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 9818 | |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 9819 | static struct cmd_node bgp_vpnv6_node = |
| 9820 | { |
| 9821 | BGP_VPNV6_NODE, |
| 9822 | "%s(config-router-af-vpnv6)# ", |
| 9823 | 1 |
| 9824 | }; |
| 9825 | |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 9826 | static struct cmd_node bgp_encap_node = |
| 9827 | { |
| 9828 | BGP_ENCAP_NODE, |
| 9829 | "%s(config-router-af-encap)# ", |
| 9830 | 1 |
| 9831 | }; |
| 9832 | |
| 9833 | static struct cmd_node bgp_encapv6_node = |
| 9834 | { |
| 9835 | BGP_ENCAPV6_NODE, |
| 9836 | "%s(config-router-af-encapv6)# ", |
| 9837 | 1 |
| 9838 | }; |
| 9839 | |
paul | 1f8ae70 | 2005-09-09 23:49:49 +0000 | [diff] [blame] | 9840 | static void community_list_vty (void); |
| 9841 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9842 | void |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 9843 | bgp_vty_init (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9844 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9845 | /* Install bgp top node. */ |
| 9846 | install_node (&bgp_node, bgp_config_write); |
| 9847 | install_node (&bgp_ipv4_unicast_node, NULL); |
| 9848 | install_node (&bgp_ipv4_multicast_node, NULL); |
| 9849 | install_node (&bgp_ipv6_unicast_node, NULL); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9850 | install_node (&bgp_ipv6_multicast_node, NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9851 | install_node (&bgp_vpnv4_node, NULL); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 9852 | install_node (&bgp_vpnv6_node, NULL); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 9853 | install_node (&bgp_encap_node, NULL); |
| 9854 | install_node (&bgp_encapv6_node, NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9855 | |
| 9856 | /* Install default VTY commands to new nodes. */ |
| 9857 | install_default (BGP_NODE); |
| 9858 | install_default (BGP_IPV4_NODE); |
| 9859 | install_default (BGP_IPV4M_NODE); |
| 9860 | install_default (BGP_IPV6_NODE); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9861 | install_default (BGP_IPV6M_NODE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9862 | install_default (BGP_VPNV4_NODE); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 9863 | install_default (BGP_VPNV6_NODE); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 9864 | install_default (BGP_ENCAP_NODE); |
| 9865 | install_default (BGP_ENCAPV6_NODE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9866 | |
| 9867 | /* "bgp multiple-instance" commands. */ |
| 9868 | install_element (CONFIG_NODE, &bgp_multiple_instance_cmd); |
| 9869 | install_element (CONFIG_NODE, &no_bgp_multiple_instance_cmd); |
| 9870 | |
| 9871 | /* "bgp config-type" commands. */ |
| 9872 | install_element (CONFIG_NODE, &bgp_config_type_cmd); |
| 9873 | install_element (CONFIG_NODE, &no_bgp_config_type_cmd); |
| 9874 | |
| 9875 | /* Dummy commands (Currently not supported) */ |
| 9876 | install_element (BGP_NODE, &no_synchronization_cmd); |
| 9877 | install_element (BGP_NODE, &no_auto_summary_cmd); |
| 9878 | |
| 9879 | /* "router bgp" commands. */ |
| 9880 | install_element (CONFIG_NODE, &router_bgp_cmd); |
| 9881 | install_element (CONFIG_NODE, &router_bgp_view_cmd); |
| 9882 | |
| 9883 | /* "no router bgp" commands. */ |
| 9884 | install_element (CONFIG_NODE, &no_router_bgp_cmd); |
| 9885 | install_element (CONFIG_NODE, &no_router_bgp_view_cmd); |
| 9886 | |
| 9887 | /* "bgp router-id" commands. */ |
| 9888 | install_element (BGP_NODE, &bgp_router_id_cmd); |
| 9889 | install_element (BGP_NODE, &no_bgp_router_id_cmd); |
| 9890 | install_element (BGP_NODE, &no_bgp_router_id_val_cmd); |
| 9891 | |
| 9892 | /* "bgp cluster-id" commands. */ |
| 9893 | install_element (BGP_NODE, &bgp_cluster_id_cmd); |
| 9894 | install_element (BGP_NODE, &bgp_cluster_id32_cmd); |
| 9895 | install_element (BGP_NODE, &no_bgp_cluster_id_cmd); |
| 9896 | install_element (BGP_NODE, &no_bgp_cluster_id_arg_cmd); |
| 9897 | |
| 9898 | /* "bgp confederation" commands. */ |
| 9899 | install_element (BGP_NODE, &bgp_confederation_identifier_cmd); |
| 9900 | install_element (BGP_NODE, &no_bgp_confederation_identifier_cmd); |
| 9901 | install_element (BGP_NODE, &no_bgp_confederation_identifier_arg_cmd); |
| 9902 | |
| 9903 | /* "bgp confederation peers" commands. */ |
| 9904 | install_element (BGP_NODE, &bgp_confederation_peers_cmd); |
| 9905 | install_element (BGP_NODE, &no_bgp_confederation_peers_cmd); |
| 9906 | |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 9907 | /* "maximum-paths" commands. */ |
| 9908 | install_element (BGP_NODE, &bgp_maxpaths_cmd); |
| 9909 | install_element (BGP_NODE, &no_bgp_maxpaths_cmd); |
| 9910 | install_element (BGP_NODE, &no_bgp_maxpaths_arg_cmd); |
| 9911 | install_element (BGP_IPV4_NODE, &bgp_maxpaths_cmd); |
| 9912 | install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_cmd); |
| 9913 | install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_arg_cmd); |
Ayan Banerjee | b8d1f71 | 2015-11-09 20:14:54 -0500 | [diff] [blame] | 9914 | install_element (BGP_IPV6_NODE, &bgp_maxpaths_cmd); |
| 9915 | install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_cmd); |
| 9916 | install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_arg_cmd); |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 9917 | install_element (BGP_NODE, &bgp_maxpaths_ibgp_cmd); |
| 9918 | install_element (BGP_NODE, &no_bgp_maxpaths_ibgp_cmd); |
| 9919 | install_element (BGP_NODE, &no_bgp_maxpaths_ibgp_arg_cmd); |
| 9920 | install_element (BGP_IPV4_NODE, &bgp_maxpaths_ibgp_cmd); |
| 9921 | install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_ibgp_cmd); |
| 9922 | install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_ibgp_arg_cmd); |
Ayan Banerjee | b8d1f71 | 2015-11-09 20:14:54 -0500 | [diff] [blame] | 9923 | install_element (BGP_IPV6_NODE, &bgp_maxpaths_ibgp_cmd); |
| 9924 | install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_ibgp_cmd); |
| 9925 | install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_ibgp_arg_cmd); |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 9926 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9927 | /* "timers bgp" commands. */ |
| 9928 | install_element (BGP_NODE, &bgp_timers_cmd); |
| 9929 | install_element (BGP_NODE, &no_bgp_timers_cmd); |
| 9930 | install_element (BGP_NODE, &no_bgp_timers_arg_cmd); |
| 9931 | |
| 9932 | /* "bgp client-to-client reflection" commands */ |
| 9933 | install_element (BGP_NODE, &no_bgp_client_to_client_reflection_cmd); |
| 9934 | install_element (BGP_NODE, &bgp_client_to_client_reflection_cmd); |
| 9935 | |
| 9936 | /* "bgp always-compare-med" commands */ |
| 9937 | install_element (BGP_NODE, &bgp_always_compare_med_cmd); |
| 9938 | install_element (BGP_NODE, &no_bgp_always_compare_med_cmd); |
| 9939 | |
| 9940 | /* "bgp deterministic-med" commands */ |
| 9941 | install_element (BGP_NODE, &bgp_deterministic_med_cmd); |
| 9942 | install_element (BGP_NODE, &no_bgp_deterministic_med_cmd); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 9943 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 9944 | /* "bgp graceful-restart" commands */ |
| 9945 | install_element (BGP_NODE, &bgp_graceful_restart_cmd); |
| 9946 | install_element (BGP_NODE, &no_bgp_graceful_restart_cmd); |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 9947 | install_element (BGP_NODE, &bgp_graceful_restart_stalepath_time_cmd); |
| 9948 | install_element (BGP_NODE, &no_bgp_graceful_restart_stalepath_time_cmd); |
| 9949 | install_element (BGP_NODE, &no_bgp_graceful_restart_stalepath_time_val_cmd); |
Philippe Guibert | 4afa3dd | 2016-05-24 16:52:02 +0200 | [diff] [blame] | 9950 | install_element (BGP_NODE, &bgp_graceful_restart_restart_time_cmd); |
| 9951 | install_element (BGP_NODE, &no_bgp_graceful_restart_restart_time_cmd); |
| 9952 | install_element (BGP_NODE, &no_bgp_graceful_restart_restart_time_val_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9953 | |
| 9954 | /* "bgp fast-external-failover" commands */ |
| 9955 | install_element (BGP_NODE, &bgp_fast_external_failover_cmd); |
| 9956 | install_element (BGP_NODE, &no_bgp_fast_external_failover_cmd); |
| 9957 | |
| 9958 | /* "bgp enforce-first-as" commands */ |
| 9959 | install_element (BGP_NODE, &bgp_enforce_first_as_cmd); |
| 9960 | install_element (BGP_NODE, &no_bgp_enforce_first_as_cmd); |
| 9961 | |
| 9962 | /* "bgp bestpath compare-routerid" commands */ |
| 9963 | install_element (BGP_NODE, &bgp_bestpath_compare_router_id_cmd); |
| 9964 | install_element (BGP_NODE, &no_bgp_bestpath_compare_router_id_cmd); |
| 9965 | |
| 9966 | /* "bgp bestpath as-path ignore" commands */ |
| 9967 | install_element (BGP_NODE, &bgp_bestpath_aspath_ignore_cmd); |
| 9968 | install_element (BGP_NODE, &no_bgp_bestpath_aspath_ignore_cmd); |
| 9969 | |
hasso | 6811845 | 2005-04-08 15:40:36 +0000 | [diff] [blame] | 9970 | /* "bgp bestpath as-path confed" commands */ |
| 9971 | install_element (BGP_NODE, &bgp_bestpath_aspath_confed_cmd); |
| 9972 | install_element (BGP_NODE, &no_bgp_bestpath_aspath_confed_cmd); |
| 9973 | |
Pradosh Mohapatra | 2fdd455 | 2013-09-07 07:02:36 +0000 | [diff] [blame] | 9974 | /* "bgp bestpath as-path multipath-relax" commands */ |
| 9975 | install_element (BGP_NODE, &bgp_bestpath_aspath_multipath_relax_cmd); |
| 9976 | install_element (BGP_NODE, &no_bgp_bestpath_aspath_multipath_relax_cmd); |
| 9977 | |
paul | 848973c | 2003-08-13 00:32:49 +0000 | [diff] [blame] | 9978 | /* "bgp log-neighbor-changes" commands */ |
| 9979 | install_element (BGP_NODE, &bgp_log_neighbor_changes_cmd); |
| 9980 | install_element (BGP_NODE, &no_bgp_log_neighbor_changes_cmd); |
| 9981 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9982 | /* "bgp bestpath med" commands */ |
| 9983 | install_element (BGP_NODE, &bgp_bestpath_med_cmd); |
| 9984 | install_element (BGP_NODE, &bgp_bestpath_med2_cmd); |
| 9985 | install_element (BGP_NODE, &bgp_bestpath_med3_cmd); |
| 9986 | install_element (BGP_NODE, &no_bgp_bestpath_med_cmd); |
| 9987 | install_element (BGP_NODE, &no_bgp_bestpath_med2_cmd); |
| 9988 | install_element (BGP_NODE, &no_bgp_bestpath_med3_cmd); |
| 9989 | |
| 9990 | /* "no bgp default ipv4-unicast" commands. */ |
| 9991 | install_element (BGP_NODE, &no_bgp_default_ipv4_unicast_cmd); |
| 9992 | install_element (BGP_NODE, &bgp_default_ipv4_unicast_cmd); |
| 9993 | |
| 9994 | /* "bgp network import-check" commands. */ |
| 9995 | install_element (BGP_NODE, &bgp_network_import_check_cmd); |
| 9996 | install_element (BGP_NODE, &no_bgp_network_import_check_cmd); |
| 9997 | |
| 9998 | /* "bgp default local-preference" commands. */ |
| 9999 | install_element (BGP_NODE, &bgp_default_local_preference_cmd); |
| 10000 | install_element (BGP_NODE, &no_bgp_default_local_preference_cmd); |
| 10001 | install_element (BGP_NODE, &no_bgp_default_local_preference_val_cmd); |
| 10002 | |
Dinesh Dutt | 083e5e2 | 2015-11-09 20:21:54 -0500 | [diff] [blame] | 10003 | /* bgp ibgp-allow-policy-mods command */ |
| 10004 | install_element (BGP_NODE, &bgp_rr_allow_outbound_policy_cmd); |
| 10005 | install_element (BGP_NODE, &no_bgp_rr_allow_outbound_policy_cmd); |
| 10006 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10007 | /* "neighbor remote-as" commands. */ |
| 10008 | install_element (BGP_NODE, &neighbor_remote_as_cmd); |
| 10009 | install_element (BGP_NODE, &no_neighbor_cmd); |
| 10010 | install_element (BGP_NODE, &no_neighbor_remote_as_cmd); |
| 10011 | |
| 10012 | /* "neighbor peer-group" commands. */ |
| 10013 | install_element (BGP_NODE, &neighbor_peer_group_cmd); |
| 10014 | install_element (BGP_NODE, &no_neighbor_peer_group_cmd); |
| 10015 | install_element (BGP_NODE, &no_neighbor_peer_group_remote_as_cmd); |
| 10016 | |
| 10017 | /* "neighbor local-as" commands. */ |
| 10018 | install_element (BGP_NODE, &neighbor_local_as_cmd); |
| 10019 | install_element (BGP_NODE, &neighbor_local_as_no_prepend_cmd); |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 10020 | install_element (BGP_NODE, &neighbor_local_as_no_prepend_replace_as_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10021 | install_element (BGP_NODE, &no_neighbor_local_as_cmd); |
| 10022 | install_element (BGP_NODE, &no_neighbor_local_as_val_cmd); |
| 10023 | install_element (BGP_NODE, &no_neighbor_local_as_val2_cmd); |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 10024 | install_element (BGP_NODE, &no_neighbor_local_as_val3_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10025 | |
Paul Jakma | 0df7c91 | 2008-07-21 21:02:49 +0000 | [diff] [blame] | 10026 | /* "neighbor password" commands. */ |
| 10027 | install_element (BGP_NODE, &neighbor_password_cmd); |
| 10028 | install_element (BGP_NODE, &no_neighbor_password_cmd); |
| 10029 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10030 | /* "neighbor activate" commands. */ |
| 10031 | install_element (BGP_NODE, &neighbor_activate_cmd); |
| 10032 | install_element (BGP_IPV4_NODE, &neighbor_activate_cmd); |
| 10033 | install_element (BGP_IPV4M_NODE, &neighbor_activate_cmd); |
| 10034 | install_element (BGP_IPV6_NODE, &neighbor_activate_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10035 | install_element (BGP_IPV6M_NODE, &neighbor_activate_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10036 | install_element (BGP_VPNV4_NODE, &neighbor_activate_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10037 | install_element (BGP_VPNV6_NODE, &neighbor_activate_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10038 | install_element (BGP_ENCAP_NODE, &neighbor_activate_cmd); |
| 10039 | install_element (BGP_ENCAPV6_NODE, &neighbor_activate_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10040 | |
| 10041 | /* "no neighbor activate" commands. */ |
| 10042 | install_element (BGP_NODE, &no_neighbor_activate_cmd); |
| 10043 | install_element (BGP_IPV4_NODE, &no_neighbor_activate_cmd); |
| 10044 | install_element (BGP_IPV4M_NODE, &no_neighbor_activate_cmd); |
| 10045 | install_element (BGP_IPV6_NODE, &no_neighbor_activate_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10046 | install_element (BGP_IPV6M_NODE, &no_neighbor_activate_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10047 | install_element (BGP_VPNV4_NODE, &no_neighbor_activate_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10048 | install_element (BGP_VPNV6_NODE, &no_neighbor_activate_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10049 | install_element (BGP_ENCAP_NODE, &no_neighbor_activate_cmd); |
| 10050 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_activate_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10051 | |
| 10052 | /* "neighbor peer-group set" commands. */ |
| 10053 | install_element (BGP_NODE, &neighbor_set_peer_group_cmd); |
| 10054 | install_element (BGP_IPV4_NODE, &neighbor_set_peer_group_cmd); |
| 10055 | install_element (BGP_IPV4M_NODE, &neighbor_set_peer_group_cmd); |
| 10056 | install_element (BGP_IPV6_NODE, &neighbor_set_peer_group_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10057 | install_element (BGP_IPV6M_NODE, &neighbor_set_peer_group_cmd); |
paul | a58545b | 2003-07-12 21:43:01 +0000 | [diff] [blame] | 10058 | install_element (BGP_VPNV4_NODE, &neighbor_set_peer_group_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10059 | install_element (BGP_VPNV6_NODE, &neighbor_set_peer_group_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10060 | install_element (BGP_ENCAP_NODE, &neighbor_set_peer_group_cmd); |
| 10061 | install_element (BGP_ENCAPV6_NODE, &neighbor_set_peer_group_cmd); |
paul | a58545b | 2003-07-12 21:43:01 +0000 | [diff] [blame] | 10062 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10063 | /* "no neighbor peer-group unset" commands. */ |
| 10064 | install_element (BGP_NODE, &no_neighbor_set_peer_group_cmd); |
| 10065 | install_element (BGP_IPV4_NODE, &no_neighbor_set_peer_group_cmd); |
| 10066 | install_element (BGP_IPV4M_NODE, &no_neighbor_set_peer_group_cmd); |
| 10067 | install_element (BGP_IPV6_NODE, &no_neighbor_set_peer_group_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10068 | install_element (BGP_IPV6M_NODE, &no_neighbor_set_peer_group_cmd); |
paul | a58545b | 2003-07-12 21:43:01 +0000 | [diff] [blame] | 10069 | install_element (BGP_VPNV4_NODE, &no_neighbor_set_peer_group_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10070 | install_element (BGP_VPNV6_NODE, &no_neighbor_set_peer_group_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10071 | install_element (BGP_ENCAP_NODE, &no_neighbor_set_peer_group_cmd); |
| 10072 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_set_peer_group_cmd); |
paul | a58545b | 2003-07-12 21:43:01 +0000 | [diff] [blame] | 10073 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10074 | /* "neighbor softreconfiguration inbound" commands.*/ |
| 10075 | install_element (BGP_NODE, &neighbor_soft_reconfiguration_cmd); |
| 10076 | install_element (BGP_NODE, &no_neighbor_soft_reconfiguration_cmd); |
| 10077 | install_element (BGP_IPV4_NODE, &neighbor_soft_reconfiguration_cmd); |
| 10078 | install_element (BGP_IPV4_NODE, &no_neighbor_soft_reconfiguration_cmd); |
| 10079 | install_element (BGP_IPV4M_NODE, &neighbor_soft_reconfiguration_cmd); |
| 10080 | install_element (BGP_IPV4M_NODE, &no_neighbor_soft_reconfiguration_cmd); |
| 10081 | install_element (BGP_IPV6_NODE, &neighbor_soft_reconfiguration_cmd); |
| 10082 | install_element (BGP_IPV6_NODE, &no_neighbor_soft_reconfiguration_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10083 | install_element (BGP_IPV6M_NODE, &neighbor_soft_reconfiguration_cmd); |
| 10084 | install_element (BGP_IPV6M_NODE, &no_neighbor_soft_reconfiguration_cmd); |
paul | a58545b | 2003-07-12 21:43:01 +0000 | [diff] [blame] | 10085 | install_element (BGP_VPNV4_NODE, &neighbor_soft_reconfiguration_cmd); |
| 10086 | install_element (BGP_VPNV4_NODE, &no_neighbor_soft_reconfiguration_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10087 | install_element (BGP_VPNV6_NODE, &neighbor_soft_reconfiguration_cmd); |
| 10088 | install_element (BGP_VPNV6_NODE, &no_neighbor_soft_reconfiguration_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10089 | install_element (BGP_ENCAP_NODE, &neighbor_soft_reconfiguration_cmd); |
| 10090 | install_element (BGP_ENCAP_NODE, &no_neighbor_soft_reconfiguration_cmd); |
| 10091 | install_element (BGP_ENCAPV6_NODE, &neighbor_soft_reconfiguration_cmd); |
| 10092 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_soft_reconfiguration_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10093 | |
| 10094 | /* "neighbor attribute-unchanged" commands. */ |
| 10095 | install_element (BGP_NODE, &neighbor_attr_unchanged_cmd); |
| 10096 | install_element (BGP_NODE, &neighbor_attr_unchanged1_cmd); |
| 10097 | install_element (BGP_NODE, &neighbor_attr_unchanged2_cmd); |
| 10098 | install_element (BGP_NODE, &neighbor_attr_unchanged3_cmd); |
| 10099 | install_element (BGP_NODE, &neighbor_attr_unchanged4_cmd); |
| 10100 | install_element (BGP_NODE, &neighbor_attr_unchanged5_cmd); |
| 10101 | install_element (BGP_NODE, &neighbor_attr_unchanged6_cmd); |
| 10102 | install_element (BGP_NODE, &neighbor_attr_unchanged7_cmd); |
| 10103 | install_element (BGP_NODE, &neighbor_attr_unchanged8_cmd); |
| 10104 | install_element (BGP_NODE, &neighbor_attr_unchanged9_cmd); |
| 10105 | install_element (BGP_NODE, &neighbor_attr_unchanged10_cmd); |
| 10106 | install_element (BGP_NODE, &no_neighbor_attr_unchanged_cmd); |
| 10107 | install_element (BGP_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 10108 | install_element (BGP_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 10109 | install_element (BGP_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 10110 | install_element (BGP_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 10111 | install_element (BGP_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 10112 | install_element (BGP_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 10113 | install_element (BGP_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 10114 | install_element (BGP_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 10115 | install_element (BGP_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 10116 | install_element (BGP_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 10117 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged_cmd); |
| 10118 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged1_cmd); |
| 10119 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged2_cmd); |
| 10120 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged3_cmd); |
| 10121 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged4_cmd); |
| 10122 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged5_cmd); |
| 10123 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged6_cmd); |
| 10124 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged7_cmd); |
| 10125 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged8_cmd); |
| 10126 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged9_cmd); |
| 10127 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged10_cmd); |
| 10128 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged_cmd); |
| 10129 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 10130 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 10131 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 10132 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 10133 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 10134 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 10135 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 10136 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 10137 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 10138 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 10139 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged_cmd); |
| 10140 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged1_cmd); |
| 10141 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged2_cmd); |
| 10142 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged3_cmd); |
| 10143 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged4_cmd); |
| 10144 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged5_cmd); |
| 10145 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged6_cmd); |
| 10146 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged7_cmd); |
| 10147 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged8_cmd); |
| 10148 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged9_cmd); |
| 10149 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged10_cmd); |
| 10150 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged_cmd); |
| 10151 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 10152 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 10153 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 10154 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 10155 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 10156 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 10157 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 10158 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 10159 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 10160 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 10161 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged_cmd); |
| 10162 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged1_cmd); |
| 10163 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged2_cmd); |
| 10164 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged3_cmd); |
| 10165 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged4_cmd); |
| 10166 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged5_cmd); |
| 10167 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged6_cmd); |
| 10168 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged7_cmd); |
| 10169 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged8_cmd); |
| 10170 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged9_cmd); |
| 10171 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged10_cmd); |
| 10172 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged_cmd); |
| 10173 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 10174 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 10175 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 10176 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 10177 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 10178 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 10179 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 10180 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 10181 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 10182 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged10_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10183 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged_cmd); |
| 10184 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged1_cmd); |
| 10185 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged2_cmd); |
| 10186 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged3_cmd); |
| 10187 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged4_cmd); |
| 10188 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged5_cmd); |
| 10189 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged6_cmd); |
| 10190 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged7_cmd); |
| 10191 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged8_cmd); |
| 10192 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged9_cmd); |
| 10193 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged10_cmd); |
| 10194 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged_cmd); |
| 10195 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 10196 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 10197 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 10198 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 10199 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 10200 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 10201 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 10202 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 10203 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 10204 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged10_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10205 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged_cmd); |
| 10206 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged1_cmd); |
| 10207 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged2_cmd); |
| 10208 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged3_cmd); |
| 10209 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged4_cmd); |
| 10210 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged5_cmd); |
| 10211 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged6_cmd); |
| 10212 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged7_cmd); |
| 10213 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged8_cmd); |
| 10214 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged9_cmd); |
| 10215 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged10_cmd); |
| 10216 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged_cmd); |
| 10217 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 10218 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 10219 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 10220 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 10221 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 10222 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 10223 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 10224 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 10225 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 10226 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 10227 | |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10228 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged_cmd); |
| 10229 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged1_cmd); |
| 10230 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged2_cmd); |
| 10231 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged3_cmd); |
| 10232 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged4_cmd); |
| 10233 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged5_cmd); |
| 10234 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged6_cmd); |
| 10235 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged7_cmd); |
| 10236 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged8_cmd); |
| 10237 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged9_cmd); |
| 10238 | install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged10_cmd); |
| 10239 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged_cmd); |
| 10240 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 10241 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 10242 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 10243 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 10244 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 10245 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 10246 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 10247 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 10248 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 10249 | install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 10250 | |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10251 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged_cmd); |
| 10252 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged1_cmd); |
| 10253 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged2_cmd); |
| 10254 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged3_cmd); |
| 10255 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged4_cmd); |
| 10256 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged5_cmd); |
| 10257 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged6_cmd); |
| 10258 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged7_cmd); |
| 10259 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged8_cmd); |
| 10260 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged9_cmd); |
| 10261 | install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged10_cmd); |
| 10262 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged_cmd); |
| 10263 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 10264 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 10265 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 10266 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 10267 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 10268 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 10269 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 10270 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 10271 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 10272 | install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 10273 | |
| 10274 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged_cmd); |
| 10275 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged1_cmd); |
| 10276 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged2_cmd); |
| 10277 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged3_cmd); |
| 10278 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged4_cmd); |
| 10279 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged5_cmd); |
| 10280 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged6_cmd); |
| 10281 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged7_cmd); |
| 10282 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged8_cmd); |
| 10283 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged9_cmd); |
| 10284 | install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged10_cmd); |
| 10285 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged_cmd); |
| 10286 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 10287 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 10288 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 10289 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 10290 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 10291 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 10292 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 10293 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 10294 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 10295 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 10296 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 10297 | /* "nexthop-local unchanged" commands */ |
| 10298 | install_element (BGP_IPV6_NODE, &neighbor_nexthop_local_unchanged_cmd); |
| 10299 | install_element (BGP_IPV6_NODE, &no_neighbor_nexthop_local_unchanged_cmd); |
| 10300 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10301 | /* "transparent-as" and "transparent-nexthop" for old version |
| 10302 | compatibility. */ |
| 10303 | install_element (BGP_NODE, &neighbor_transparent_as_cmd); |
| 10304 | install_element (BGP_NODE, &neighbor_transparent_nexthop_cmd); |
| 10305 | |
| 10306 | /* "neighbor next-hop-self" commands. */ |
| 10307 | install_element (BGP_NODE, &neighbor_nexthop_self_cmd); |
| 10308 | install_element (BGP_NODE, &no_neighbor_nexthop_self_cmd); |
| 10309 | install_element (BGP_IPV4_NODE, &neighbor_nexthop_self_cmd); |
| 10310 | install_element (BGP_IPV4_NODE, &no_neighbor_nexthop_self_cmd); |
| 10311 | install_element (BGP_IPV4M_NODE, &neighbor_nexthop_self_cmd); |
| 10312 | install_element (BGP_IPV4M_NODE, &no_neighbor_nexthop_self_cmd); |
| 10313 | install_element (BGP_IPV6_NODE, &neighbor_nexthop_self_cmd); |
| 10314 | install_element (BGP_IPV6_NODE, &no_neighbor_nexthop_self_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10315 | install_element (BGP_IPV6M_NODE, &neighbor_nexthop_self_cmd); |
| 10316 | install_element (BGP_IPV6M_NODE, &no_neighbor_nexthop_self_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10317 | install_element (BGP_VPNV4_NODE, &neighbor_nexthop_self_cmd); |
| 10318 | install_element (BGP_VPNV4_NODE, &no_neighbor_nexthop_self_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10319 | install_element (BGP_VPNV6_NODE, &neighbor_nexthop_self_cmd); |
| 10320 | install_element (BGP_VPNV6_NODE, &no_neighbor_nexthop_self_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10321 | install_element (BGP_ENCAP_NODE, &neighbor_nexthop_self_cmd); |
| 10322 | install_element (BGP_ENCAP_NODE, &no_neighbor_nexthop_self_cmd); |
| 10323 | install_element (BGP_ENCAPV6_NODE, &neighbor_nexthop_self_cmd); |
| 10324 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_nexthop_self_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10325 | |
| 10326 | /* "neighbor remove-private-AS" commands. */ |
| 10327 | install_element (BGP_NODE, &neighbor_remove_private_as_cmd); |
| 10328 | install_element (BGP_NODE, &no_neighbor_remove_private_as_cmd); |
| 10329 | install_element (BGP_IPV4_NODE, &neighbor_remove_private_as_cmd); |
| 10330 | install_element (BGP_IPV4_NODE, &no_neighbor_remove_private_as_cmd); |
| 10331 | install_element (BGP_IPV4M_NODE, &neighbor_remove_private_as_cmd); |
| 10332 | install_element (BGP_IPV4M_NODE, &no_neighbor_remove_private_as_cmd); |
| 10333 | install_element (BGP_IPV6_NODE, &neighbor_remove_private_as_cmd); |
| 10334 | install_element (BGP_IPV6_NODE, &no_neighbor_remove_private_as_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10335 | install_element (BGP_IPV6M_NODE, &neighbor_remove_private_as_cmd); |
| 10336 | install_element (BGP_IPV6M_NODE, &no_neighbor_remove_private_as_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10337 | install_element (BGP_VPNV4_NODE, &neighbor_remove_private_as_cmd); |
| 10338 | install_element (BGP_VPNV4_NODE, &no_neighbor_remove_private_as_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10339 | install_element (BGP_VPNV6_NODE, &neighbor_remove_private_as_cmd); |
| 10340 | install_element (BGP_VPNV6_NODE, &no_neighbor_remove_private_as_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10341 | install_element (BGP_ENCAP_NODE, &neighbor_remove_private_as_cmd); |
| 10342 | install_element (BGP_ENCAP_NODE, &no_neighbor_remove_private_as_cmd); |
| 10343 | install_element (BGP_ENCAPV6_NODE, &neighbor_remove_private_as_cmd); |
| 10344 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_remove_private_as_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10345 | |
| 10346 | /* "neighbor send-community" commands.*/ |
| 10347 | install_element (BGP_NODE, &neighbor_send_community_cmd); |
| 10348 | install_element (BGP_NODE, &neighbor_send_community_type_cmd); |
| 10349 | install_element (BGP_NODE, &no_neighbor_send_community_cmd); |
| 10350 | install_element (BGP_NODE, &no_neighbor_send_community_type_cmd); |
| 10351 | install_element (BGP_IPV4_NODE, &neighbor_send_community_cmd); |
| 10352 | install_element (BGP_IPV4_NODE, &neighbor_send_community_type_cmd); |
| 10353 | install_element (BGP_IPV4_NODE, &no_neighbor_send_community_cmd); |
| 10354 | install_element (BGP_IPV4_NODE, &no_neighbor_send_community_type_cmd); |
| 10355 | install_element (BGP_IPV4M_NODE, &neighbor_send_community_cmd); |
| 10356 | install_element (BGP_IPV4M_NODE, &neighbor_send_community_type_cmd); |
| 10357 | install_element (BGP_IPV4M_NODE, &no_neighbor_send_community_cmd); |
| 10358 | install_element (BGP_IPV4M_NODE, &no_neighbor_send_community_type_cmd); |
| 10359 | install_element (BGP_IPV6_NODE, &neighbor_send_community_cmd); |
| 10360 | install_element (BGP_IPV6_NODE, &neighbor_send_community_type_cmd); |
| 10361 | install_element (BGP_IPV6_NODE, &no_neighbor_send_community_cmd); |
| 10362 | install_element (BGP_IPV6_NODE, &no_neighbor_send_community_type_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10363 | install_element (BGP_IPV6M_NODE, &neighbor_send_community_cmd); |
| 10364 | install_element (BGP_IPV6M_NODE, &neighbor_send_community_type_cmd); |
| 10365 | install_element (BGP_IPV6M_NODE, &no_neighbor_send_community_cmd); |
| 10366 | install_element (BGP_IPV6M_NODE, &no_neighbor_send_community_type_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10367 | install_element (BGP_VPNV4_NODE, &neighbor_send_community_cmd); |
| 10368 | install_element (BGP_VPNV4_NODE, &neighbor_send_community_type_cmd); |
| 10369 | install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_cmd); |
| 10370 | install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_type_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10371 | install_element (BGP_VPNV6_NODE, &neighbor_send_community_cmd); |
| 10372 | install_element (BGP_VPNV6_NODE, &neighbor_send_community_type_cmd); |
| 10373 | install_element (BGP_VPNV6_NODE, &no_neighbor_send_community_cmd); |
| 10374 | install_element (BGP_VPNV6_NODE, &no_neighbor_send_community_type_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10375 | install_element (BGP_ENCAP_NODE, &neighbor_send_community_cmd); |
| 10376 | install_element (BGP_ENCAP_NODE, &neighbor_send_community_type_cmd); |
| 10377 | install_element (BGP_ENCAP_NODE, &no_neighbor_send_community_cmd); |
| 10378 | install_element (BGP_ENCAP_NODE, &no_neighbor_send_community_type_cmd); |
| 10379 | install_element (BGP_ENCAPV6_NODE, &neighbor_send_community_cmd); |
| 10380 | install_element (BGP_ENCAPV6_NODE, &neighbor_send_community_type_cmd); |
| 10381 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_send_community_cmd); |
| 10382 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_send_community_type_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10383 | |
| 10384 | /* "neighbor route-reflector" commands.*/ |
| 10385 | install_element (BGP_NODE, &neighbor_route_reflector_client_cmd); |
| 10386 | install_element (BGP_NODE, &no_neighbor_route_reflector_client_cmd); |
| 10387 | install_element (BGP_IPV4_NODE, &neighbor_route_reflector_client_cmd); |
| 10388 | install_element (BGP_IPV4_NODE, &no_neighbor_route_reflector_client_cmd); |
| 10389 | install_element (BGP_IPV4M_NODE, &neighbor_route_reflector_client_cmd); |
| 10390 | install_element (BGP_IPV4M_NODE, &no_neighbor_route_reflector_client_cmd); |
| 10391 | install_element (BGP_IPV6_NODE, &neighbor_route_reflector_client_cmd); |
| 10392 | install_element (BGP_IPV6_NODE, &no_neighbor_route_reflector_client_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10393 | install_element (BGP_IPV6M_NODE, &neighbor_route_reflector_client_cmd); |
| 10394 | install_element (BGP_IPV6M_NODE, &no_neighbor_route_reflector_client_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10395 | install_element (BGP_VPNV4_NODE, &neighbor_route_reflector_client_cmd); |
| 10396 | install_element (BGP_VPNV4_NODE, &no_neighbor_route_reflector_client_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10397 | install_element (BGP_VPNV6_NODE, &neighbor_route_reflector_client_cmd); |
| 10398 | install_element (BGP_VPNV6_NODE, &no_neighbor_route_reflector_client_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10399 | install_element (BGP_ENCAP_NODE, &neighbor_route_reflector_client_cmd); |
| 10400 | install_element (BGP_ENCAP_NODE, &no_neighbor_route_reflector_client_cmd); |
| 10401 | install_element (BGP_ENCAPV6_NODE, &neighbor_route_reflector_client_cmd); |
| 10402 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_reflector_client_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10403 | |
| 10404 | /* "neighbor route-server" commands.*/ |
| 10405 | install_element (BGP_NODE, &neighbor_route_server_client_cmd); |
| 10406 | install_element (BGP_NODE, &no_neighbor_route_server_client_cmd); |
| 10407 | install_element (BGP_IPV4_NODE, &neighbor_route_server_client_cmd); |
| 10408 | install_element (BGP_IPV4_NODE, &no_neighbor_route_server_client_cmd); |
| 10409 | install_element (BGP_IPV4M_NODE, &neighbor_route_server_client_cmd); |
| 10410 | install_element (BGP_IPV4M_NODE, &no_neighbor_route_server_client_cmd); |
| 10411 | install_element (BGP_IPV6_NODE, &neighbor_route_server_client_cmd); |
| 10412 | install_element (BGP_IPV6_NODE, &no_neighbor_route_server_client_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10413 | install_element (BGP_IPV6M_NODE, &neighbor_route_server_client_cmd); |
| 10414 | install_element (BGP_IPV6M_NODE, &no_neighbor_route_server_client_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10415 | install_element (BGP_VPNV4_NODE, &neighbor_route_server_client_cmd); |
| 10416 | install_element (BGP_VPNV4_NODE, &no_neighbor_route_server_client_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10417 | install_element (BGP_VPNV6_NODE, &neighbor_route_server_client_cmd); |
| 10418 | install_element (BGP_VPNV6_NODE, &no_neighbor_route_server_client_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10419 | install_element (BGP_ENCAP_NODE, &neighbor_route_server_client_cmd); |
| 10420 | install_element (BGP_ENCAP_NODE, &no_neighbor_route_server_client_cmd); |
| 10421 | install_element (BGP_ENCAPV6_NODE, &neighbor_route_server_client_cmd); |
| 10422 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_server_client_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10423 | |
| 10424 | /* "neighbor passive" commands. */ |
| 10425 | install_element (BGP_NODE, &neighbor_passive_cmd); |
| 10426 | install_element (BGP_NODE, &no_neighbor_passive_cmd); |
| 10427 | |
| 10428 | /* "neighbor shutdown" commands. */ |
| 10429 | install_element (BGP_NODE, &neighbor_shutdown_cmd); |
| 10430 | install_element (BGP_NODE, &no_neighbor_shutdown_cmd); |
| 10431 | |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 10432 | /* Deprecated "neighbor capability route-refresh" commands.*/ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10433 | install_element (BGP_NODE, &neighbor_capability_route_refresh_cmd); |
| 10434 | install_element (BGP_NODE, &no_neighbor_capability_route_refresh_cmd); |
| 10435 | |
| 10436 | /* "neighbor capability orf prefix-list" commands.*/ |
| 10437 | install_element (BGP_NODE, &neighbor_capability_orf_prefix_cmd); |
| 10438 | install_element (BGP_NODE, &no_neighbor_capability_orf_prefix_cmd); |
| 10439 | install_element (BGP_IPV4_NODE, &neighbor_capability_orf_prefix_cmd); |
| 10440 | install_element (BGP_IPV4_NODE, &no_neighbor_capability_orf_prefix_cmd); |
| 10441 | install_element (BGP_IPV4M_NODE, &neighbor_capability_orf_prefix_cmd); |
| 10442 | install_element (BGP_IPV4M_NODE, &no_neighbor_capability_orf_prefix_cmd); |
| 10443 | install_element (BGP_IPV6_NODE, &neighbor_capability_orf_prefix_cmd); |
| 10444 | install_element (BGP_IPV6_NODE, &no_neighbor_capability_orf_prefix_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10445 | install_element (BGP_IPV6M_NODE, &neighbor_capability_orf_prefix_cmd); |
| 10446 | install_element (BGP_IPV6M_NODE, &no_neighbor_capability_orf_prefix_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10447 | |
| 10448 | /* "neighbor capability dynamic" commands.*/ |
| 10449 | install_element (BGP_NODE, &neighbor_capability_dynamic_cmd); |
| 10450 | install_element (BGP_NODE, &no_neighbor_capability_dynamic_cmd); |
| 10451 | |
| 10452 | /* "neighbor dont-capability-negotiate" commands. */ |
| 10453 | install_element (BGP_NODE, &neighbor_dont_capability_negotiate_cmd); |
| 10454 | install_element (BGP_NODE, &no_neighbor_dont_capability_negotiate_cmd); |
| 10455 | |
| 10456 | /* "neighbor ebgp-multihop" commands. */ |
| 10457 | install_element (BGP_NODE, &neighbor_ebgp_multihop_cmd); |
| 10458 | install_element (BGP_NODE, &neighbor_ebgp_multihop_ttl_cmd); |
| 10459 | install_element (BGP_NODE, &no_neighbor_ebgp_multihop_cmd); |
| 10460 | install_element (BGP_NODE, &no_neighbor_ebgp_multihop_ttl_cmd); |
| 10461 | |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 10462 | /* "neighbor disable-connected-check" commands. */ |
| 10463 | install_element (BGP_NODE, &neighbor_disable_connected_check_cmd); |
| 10464 | install_element (BGP_NODE, &no_neighbor_disable_connected_check_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10465 | install_element (BGP_NODE, &neighbor_enforce_multihop_cmd); |
| 10466 | install_element (BGP_NODE, &no_neighbor_enforce_multihop_cmd); |
| 10467 | |
| 10468 | /* "neighbor description" commands. */ |
| 10469 | install_element (BGP_NODE, &neighbor_description_cmd); |
| 10470 | install_element (BGP_NODE, &no_neighbor_description_cmd); |
| 10471 | install_element (BGP_NODE, &no_neighbor_description_val_cmd); |
| 10472 | |
| 10473 | /* "neighbor update-source" commands. "*/ |
| 10474 | install_element (BGP_NODE, &neighbor_update_source_cmd); |
| 10475 | install_element (BGP_NODE, &no_neighbor_update_source_cmd); |
| 10476 | |
| 10477 | /* "neighbor default-originate" commands. */ |
| 10478 | install_element (BGP_NODE, &neighbor_default_originate_cmd); |
| 10479 | install_element (BGP_NODE, &neighbor_default_originate_rmap_cmd); |
| 10480 | install_element (BGP_NODE, &no_neighbor_default_originate_cmd); |
| 10481 | install_element (BGP_NODE, &no_neighbor_default_originate_rmap_cmd); |
| 10482 | install_element (BGP_IPV4_NODE, &neighbor_default_originate_cmd); |
| 10483 | install_element (BGP_IPV4_NODE, &neighbor_default_originate_rmap_cmd); |
| 10484 | install_element (BGP_IPV4_NODE, &no_neighbor_default_originate_cmd); |
| 10485 | install_element (BGP_IPV4_NODE, &no_neighbor_default_originate_rmap_cmd); |
| 10486 | install_element (BGP_IPV4M_NODE, &neighbor_default_originate_cmd); |
| 10487 | install_element (BGP_IPV4M_NODE, &neighbor_default_originate_rmap_cmd); |
| 10488 | install_element (BGP_IPV4M_NODE, &no_neighbor_default_originate_cmd); |
| 10489 | install_element (BGP_IPV4M_NODE, &no_neighbor_default_originate_rmap_cmd); |
| 10490 | install_element (BGP_IPV6_NODE, &neighbor_default_originate_cmd); |
| 10491 | install_element (BGP_IPV6_NODE, &neighbor_default_originate_rmap_cmd); |
| 10492 | install_element (BGP_IPV6_NODE, &no_neighbor_default_originate_cmd); |
| 10493 | install_element (BGP_IPV6_NODE, &no_neighbor_default_originate_rmap_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10494 | install_element (BGP_IPV6M_NODE, &neighbor_default_originate_cmd); |
| 10495 | install_element (BGP_IPV6M_NODE, &neighbor_default_originate_rmap_cmd); |
| 10496 | install_element (BGP_IPV6M_NODE, &no_neighbor_default_originate_cmd); |
| 10497 | install_element (BGP_IPV6M_NODE, &no_neighbor_default_originate_rmap_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10498 | |
| 10499 | /* "neighbor port" commands. */ |
| 10500 | install_element (BGP_NODE, &neighbor_port_cmd); |
| 10501 | install_element (BGP_NODE, &no_neighbor_port_cmd); |
| 10502 | install_element (BGP_NODE, &no_neighbor_port_val_cmd); |
| 10503 | |
| 10504 | /* "neighbor weight" commands. */ |
| 10505 | install_element (BGP_NODE, &neighbor_weight_cmd); |
| 10506 | install_element (BGP_NODE, &no_neighbor_weight_cmd); |
| 10507 | install_element (BGP_NODE, &no_neighbor_weight_val_cmd); |
| 10508 | |
| 10509 | /* "neighbor override-capability" commands. */ |
| 10510 | install_element (BGP_NODE, &neighbor_override_capability_cmd); |
| 10511 | install_element (BGP_NODE, &no_neighbor_override_capability_cmd); |
| 10512 | |
| 10513 | /* "neighbor strict-capability-match" commands. */ |
| 10514 | install_element (BGP_NODE, &neighbor_strict_capability_cmd); |
| 10515 | install_element (BGP_NODE, &no_neighbor_strict_capability_cmd); |
| 10516 | |
| 10517 | /* "neighbor timers" commands. */ |
| 10518 | install_element (BGP_NODE, &neighbor_timers_cmd); |
| 10519 | install_element (BGP_NODE, &no_neighbor_timers_cmd); |
| 10520 | |
| 10521 | /* "neighbor timers connect" commands. */ |
| 10522 | install_element (BGP_NODE, &neighbor_timers_connect_cmd); |
| 10523 | install_element (BGP_NODE, &no_neighbor_timers_connect_cmd); |
| 10524 | install_element (BGP_NODE, &no_neighbor_timers_connect_val_cmd); |
| 10525 | |
| 10526 | /* "neighbor advertisement-interval" commands. */ |
| 10527 | install_element (BGP_NODE, &neighbor_advertise_interval_cmd); |
| 10528 | install_element (BGP_NODE, &no_neighbor_advertise_interval_cmd); |
| 10529 | install_element (BGP_NODE, &no_neighbor_advertise_interval_val_cmd); |
| 10530 | |
| 10531 | /* "neighbor version" commands. */ |
| 10532 | install_element (BGP_NODE, &neighbor_version_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10533 | |
| 10534 | /* "neighbor interface" commands. */ |
| 10535 | install_element (BGP_NODE, &neighbor_interface_cmd); |
| 10536 | install_element (BGP_NODE, &no_neighbor_interface_cmd); |
| 10537 | |
| 10538 | /* "neighbor distribute" commands. */ |
| 10539 | install_element (BGP_NODE, &neighbor_distribute_list_cmd); |
| 10540 | install_element (BGP_NODE, &no_neighbor_distribute_list_cmd); |
| 10541 | install_element (BGP_IPV4_NODE, &neighbor_distribute_list_cmd); |
| 10542 | install_element (BGP_IPV4_NODE, &no_neighbor_distribute_list_cmd); |
| 10543 | install_element (BGP_IPV4M_NODE, &neighbor_distribute_list_cmd); |
| 10544 | install_element (BGP_IPV4M_NODE, &no_neighbor_distribute_list_cmd); |
| 10545 | install_element (BGP_IPV6_NODE, &neighbor_distribute_list_cmd); |
| 10546 | install_element (BGP_IPV6_NODE, &no_neighbor_distribute_list_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10547 | install_element (BGP_IPV6M_NODE, &neighbor_distribute_list_cmd); |
| 10548 | install_element (BGP_IPV6M_NODE, &no_neighbor_distribute_list_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10549 | install_element (BGP_VPNV4_NODE, &neighbor_distribute_list_cmd); |
| 10550 | install_element (BGP_VPNV4_NODE, &no_neighbor_distribute_list_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10551 | install_element (BGP_VPNV6_NODE, &neighbor_distribute_list_cmd); |
| 10552 | install_element (BGP_VPNV6_NODE, &no_neighbor_distribute_list_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10553 | install_element (BGP_ENCAP_NODE, &neighbor_distribute_list_cmd); |
| 10554 | install_element (BGP_ENCAP_NODE, &no_neighbor_distribute_list_cmd); |
| 10555 | install_element (BGP_ENCAPV6_NODE, &neighbor_distribute_list_cmd); |
| 10556 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_distribute_list_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10557 | |
| 10558 | /* "neighbor prefix-list" commands. */ |
| 10559 | install_element (BGP_NODE, &neighbor_prefix_list_cmd); |
| 10560 | install_element (BGP_NODE, &no_neighbor_prefix_list_cmd); |
| 10561 | install_element (BGP_IPV4_NODE, &neighbor_prefix_list_cmd); |
| 10562 | install_element (BGP_IPV4_NODE, &no_neighbor_prefix_list_cmd); |
| 10563 | install_element (BGP_IPV4M_NODE, &neighbor_prefix_list_cmd); |
| 10564 | install_element (BGP_IPV4M_NODE, &no_neighbor_prefix_list_cmd); |
| 10565 | install_element (BGP_IPV6_NODE, &neighbor_prefix_list_cmd); |
| 10566 | install_element (BGP_IPV6_NODE, &no_neighbor_prefix_list_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10567 | install_element (BGP_IPV6M_NODE, &neighbor_prefix_list_cmd); |
| 10568 | install_element (BGP_IPV6M_NODE, &no_neighbor_prefix_list_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10569 | install_element (BGP_VPNV4_NODE, &neighbor_prefix_list_cmd); |
| 10570 | install_element (BGP_VPNV4_NODE, &no_neighbor_prefix_list_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10571 | install_element (BGP_VPNV6_NODE, &neighbor_prefix_list_cmd); |
| 10572 | install_element (BGP_VPNV6_NODE, &no_neighbor_prefix_list_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10573 | install_element (BGP_ENCAP_NODE, &neighbor_prefix_list_cmd); |
| 10574 | install_element (BGP_ENCAP_NODE, &no_neighbor_prefix_list_cmd); |
| 10575 | install_element (BGP_ENCAPV6_NODE, &neighbor_prefix_list_cmd); |
| 10576 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_prefix_list_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10577 | |
| 10578 | /* "neighbor filter-list" commands. */ |
| 10579 | install_element (BGP_NODE, &neighbor_filter_list_cmd); |
| 10580 | install_element (BGP_NODE, &no_neighbor_filter_list_cmd); |
| 10581 | install_element (BGP_IPV4_NODE, &neighbor_filter_list_cmd); |
| 10582 | install_element (BGP_IPV4_NODE, &no_neighbor_filter_list_cmd); |
| 10583 | install_element (BGP_IPV4M_NODE, &neighbor_filter_list_cmd); |
| 10584 | install_element (BGP_IPV4M_NODE, &no_neighbor_filter_list_cmd); |
| 10585 | install_element (BGP_IPV6_NODE, &neighbor_filter_list_cmd); |
| 10586 | install_element (BGP_IPV6_NODE, &no_neighbor_filter_list_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10587 | install_element (BGP_IPV6M_NODE, &neighbor_filter_list_cmd); |
| 10588 | install_element (BGP_IPV6M_NODE, &no_neighbor_filter_list_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10589 | install_element (BGP_VPNV4_NODE, &neighbor_filter_list_cmd); |
| 10590 | install_element (BGP_VPNV4_NODE, &no_neighbor_filter_list_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10591 | install_element (BGP_VPNV6_NODE, &neighbor_filter_list_cmd); |
| 10592 | install_element (BGP_VPNV6_NODE, &no_neighbor_filter_list_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10593 | install_element (BGP_ENCAP_NODE, &neighbor_filter_list_cmd); |
| 10594 | install_element (BGP_ENCAP_NODE, &no_neighbor_filter_list_cmd); |
| 10595 | install_element (BGP_ENCAPV6_NODE, &neighbor_filter_list_cmd); |
| 10596 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_filter_list_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10597 | |
| 10598 | /* "neighbor route-map" commands. */ |
| 10599 | install_element (BGP_NODE, &neighbor_route_map_cmd); |
| 10600 | install_element (BGP_NODE, &no_neighbor_route_map_cmd); |
| 10601 | install_element (BGP_IPV4_NODE, &neighbor_route_map_cmd); |
| 10602 | install_element (BGP_IPV4_NODE, &no_neighbor_route_map_cmd); |
| 10603 | install_element (BGP_IPV4M_NODE, &neighbor_route_map_cmd); |
| 10604 | install_element (BGP_IPV4M_NODE, &no_neighbor_route_map_cmd); |
| 10605 | install_element (BGP_IPV6_NODE, &neighbor_route_map_cmd); |
| 10606 | install_element (BGP_IPV6_NODE, &no_neighbor_route_map_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10607 | install_element (BGP_IPV6M_NODE, &neighbor_route_map_cmd); |
| 10608 | install_element (BGP_IPV6M_NODE, &no_neighbor_route_map_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10609 | install_element (BGP_VPNV4_NODE, &neighbor_route_map_cmd); |
| 10610 | install_element (BGP_VPNV4_NODE, &no_neighbor_route_map_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10611 | install_element (BGP_VPNV6_NODE, &neighbor_route_map_cmd); |
| 10612 | install_element (BGP_VPNV6_NODE, &no_neighbor_route_map_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10613 | install_element (BGP_ENCAP_NODE, &neighbor_route_map_cmd); |
| 10614 | install_element (BGP_ENCAP_NODE, &no_neighbor_route_map_cmd); |
| 10615 | install_element (BGP_ENCAPV6_NODE, &neighbor_route_map_cmd); |
| 10616 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_map_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10617 | |
| 10618 | /* "neighbor unsuppress-map" commands. */ |
| 10619 | install_element (BGP_NODE, &neighbor_unsuppress_map_cmd); |
| 10620 | install_element (BGP_NODE, &no_neighbor_unsuppress_map_cmd); |
| 10621 | install_element (BGP_IPV4_NODE, &neighbor_unsuppress_map_cmd); |
| 10622 | install_element (BGP_IPV4_NODE, &no_neighbor_unsuppress_map_cmd); |
| 10623 | install_element (BGP_IPV4M_NODE, &neighbor_unsuppress_map_cmd); |
| 10624 | install_element (BGP_IPV4M_NODE, &no_neighbor_unsuppress_map_cmd); |
| 10625 | install_element (BGP_IPV6_NODE, &neighbor_unsuppress_map_cmd); |
| 10626 | install_element (BGP_IPV6_NODE, &no_neighbor_unsuppress_map_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10627 | install_element (BGP_IPV6M_NODE, &neighbor_unsuppress_map_cmd); |
| 10628 | install_element (BGP_IPV6M_NODE, &no_neighbor_unsuppress_map_cmd); |
paul | a58545b | 2003-07-12 21:43:01 +0000 | [diff] [blame] | 10629 | install_element (BGP_VPNV4_NODE, &neighbor_unsuppress_map_cmd); |
Lou Berger | 82dd707 | 2016-01-12 13:41:57 -0500 | [diff] [blame] | 10630 | install_element (BGP_VPNV4_NODE, &no_neighbor_unsuppress_map_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10631 | install_element (BGP_VPNV6_NODE, &neighbor_unsuppress_map_cmd); |
Lou Berger | 82dd707 | 2016-01-12 13:41:57 -0500 | [diff] [blame] | 10632 | install_element (BGP_VPNV6_NODE, &no_neighbor_unsuppress_map_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10633 | install_element (BGP_ENCAP_NODE, &neighbor_unsuppress_map_cmd); |
| 10634 | install_element (BGP_ENCAP_NODE, &no_neighbor_unsuppress_map_cmd); |
| 10635 | install_element (BGP_ENCAPV6_NODE, &neighbor_unsuppress_map_cmd); |
| 10636 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_unsuppress_map_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10637 | |
| 10638 | /* "neighbor maximum-prefix" commands. */ |
| 10639 | install_element (BGP_NODE, &neighbor_maximum_prefix_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 10640 | install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10641 | install_element (BGP_NODE, &neighbor_maximum_prefix_warning_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 10642 | install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 10643 | install_element (BGP_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 10644 | install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10645 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_cmd); |
| 10646 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_val_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 10647 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 10648 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 10649 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 10650 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 10651 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10652 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 10653 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10654 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_warning_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 10655 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 10656 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 10657 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10658 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_cmd); |
| 10659 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_val_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 10660 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 10661 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 10662 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 10663 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 10664 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10665 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 10666 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10667 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_warning_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 10668 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 10669 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 10670 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10671 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_cmd); |
| 10672 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_val_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 10673 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 10674 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 10675 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 10676 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 10677 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10678 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 10679 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10680 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_warning_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 10681 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 10682 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 10683 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10684 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_cmd); |
| 10685 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_val_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 10686 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 10687 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 10688 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 10689 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 10690 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10691 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_cmd); |
| 10692 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_cmd); |
| 10693 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_warning_cmd); |
| 10694 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
| 10695 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 10696 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
| 10697 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_cmd); |
| 10698 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_val_cmd); |
| 10699 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 10700 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 10701 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 10702 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 10703 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10704 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 10705 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10706 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_warning_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 10707 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 10708 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 10709 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10710 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_cmd); |
| 10711 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_val_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 10712 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 10713 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 10714 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 10715 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 10716 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10717 | |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10718 | install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_cmd); |
| 10719 | install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_threshold_cmd); |
| 10720 | install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_warning_cmd); |
| 10721 | install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
| 10722 | install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 10723 | install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
| 10724 | install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_cmd); |
| 10725 | install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_val_cmd); |
| 10726 | install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 10727 | install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 10728 | install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 10729 | install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 10730 | install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
| 10731 | |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10732 | install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_cmd); |
| 10733 | install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_cmd); |
| 10734 | install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_warning_cmd); |
| 10735 | install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
| 10736 | install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 10737 | install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
| 10738 | install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_cmd); |
| 10739 | install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_val_cmd); |
| 10740 | install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 10741 | install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 10742 | install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 10743 | install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 10744 | install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
| 10745 | |
| 10746 | install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_cmd); |
| 10747 | install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_cmd); |
| 10748 | install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_warning_cmd); |
| 10749 | install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
| 10750 | install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 10751 | install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
| 10752 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_cmd); |
| 10753 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_val_cmd); |
| 10754 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 10755 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 10756 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 10757 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 10758 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
| 10759 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10760 | /* "neighbor allowas-in" */ |
| 10761 | install_element (BGP_NODE, &neighbor_allowas_in_cmd); |
| 10762 | install_element (BGP_NODE, &neighbor_allowas_in_arg_cmd); |
| 10763 | install_element (BGP_NODE, &no_neighbor_allowas_in_cmd); |
| 10764 | install_element (BGP_IPV4_NODE, &neighbor_allowas_in_cmd); |
| 10765 | install_element (BGP_IPV4_NODE, &neighbor_allowas_in_arg_cmd); |
| 10766 | install_element (BGP_IPV4_NODE, &no_neighbor_allowas_in_cmd); |
| 10767 | install_element (BGP_IPV4M_NODE, &neighbor_allowas_in_cmd); |
| 10768 | install_element (BGP_IPV4M_NODE, &neighbor_allowas_in_arg_cmd); |
| 10769 | install_element (BGP_IPV4M_NODE, &no_neighbor_allowas_in_cmd); |
| 10770 | install_element (BGP_IPV6_NODE, &neighbor_allowas_in_cmd); |
| 10771 | install_element (BGP_IPV6_NODE, &neighbor_allowas_in_arg_cmd); |
| 10772 | install_element (BGP_IPV6_NODE, &no_neighbor_allowas_in_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10773 | install_element (BGP_IPV6M_NODE, &neighbor_allowas_in_cmd); |
| 10774 | install_element (BGP_IPV6M_NODE, &neighbor_allowas_in_arg_cmd); |
| 10775 | install_element (BGP_IPV6M_NODE, &no_neighbor_allowas_in_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10776 | install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_cmd); |
| 10777 | install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_arg_cmd); |
| 10778 | install_element (BGP_VPNV4_NODE, &no_neighbor_allowas_in_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10779 | install_element (BGP_VPNV6_NODE, &neighbor_allowas_in_cmd); |
| 10780 | install_element (BGP_VPNV6_NODE, &neighbor_allowas_in_arg_cmd); |
| 10781 | install_element (BGP_VPNV6_NODE, &no_neighbor_allowas_in_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10782 | install_element (BGP_ENCAP_NODE, &neighbor_allowas_in_cmd); |
| 10783 | install_element (BGP_ENCAP_NODE, &neighbor_allowas_in_arg_cmd); |
| 10784 | install_element (BGP_ENCAP_NODE, &no_neighbor_allowas_in_cmd); |
| 10785 | install_element (BGP_ENCAPV6_NODE, &neighbor_allowas_in_cmd); |
| 10786 | install_element (BGP_ENCAPV6_NODE, &neighbor_allowas_in_arg_cmd); |
| 10787 | install_element (BGP_ENCAPV6_NODE, &no_neighbor_allowas_in_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10788 | |
| 10789 | /* address-family commands. */ |
| 10790 | install_element (BGP_NODE, &address_family_ipv4_cmd); |
| 10791 | install_element (BGP_NODE, &address_family_ipv4_safi_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10792 | install_element (BGP_NODE, &address_family_ipv6_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10793 | install_element (BGP_NODE, &address_family_ipv6_safi_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10794 | install_element (BGP_NODE, &address_family_vpnv4_cmd); |
| 10795 | install_element (BGP_NODE, &address_family_vpnv4_unicast_cmd); |
| 10796 | |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10797 | install_element (BGP_NODE, &address_family_vpnv6_cmd); |
| 10798 | install_element (BGP_NODE, &address_family_vpnv6_unicast_cmd); |
| 10799 | |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10800 | install_element (BGP_NODE, &address_family_encap_cmd); |
| 10801 | install_element (BGP_NODE, &address_family_encapv4_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10802 | install_element (BGP_NODE, &address_family_encapv6_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10803 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10804 | /* "exit-address-family" command. */ |
| 10805 | install_element (BGP_IPV4_NODE, &exit_address_family_cmd); |
| 10806 | install_element (BGP_IPV4M_NODE, &exit_address_family_cmd); |
| 10807 | install_element (BGP_IPV6_NODE, &exit_address_family_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 10808 | install_element (BGP_IPV6M_NODE, &exit_address_family_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10809 | install_element (BGP_VPNV4_NODE, &exit_address_family_cmd); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 10810 | install_element (BGP_VPNV6_NODE, &exit_address_family_cmd); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 10811 | install_element (BGP_ENCAP_NODE, &exit_address_family_cmd); |
| 10812 | install_element (BGP_ENCAPV6_NODE, &exit_address_family_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10813 | |
| 10814 | /* "clear ip bgp commands" */ |
| 10815 | install_element (ENABLE_NODE, &clear_ip_bgp_all_cmd); |
| 10816 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_cmd); |
| 10817 | install_element (ENABLE_NODE, &clear_ip_bgp_as_cmd); |
| 10818 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_cmd); |
| 10819 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_cmd); |
| 10820 | install_element (ENABLE_NODE, &clear_ip_bgp_external_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10821 | install_element (ENABLE_NODE, &clear_bgp_all_cmd); |
| 10822 | install_element (ENABLE_NODE, &clear_bgp_instance_all_cmd); |
| 10823 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_cmd); |
| 10824 | install_element (ENABLE_NODE, &clear_bgp_peer_cmd); |
| 10825 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_cmd); |
| 10826 | install_element (ENABLE_NODE, &clear_bgp_peer_group_cmd); |
| 10827 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_cmd); |
| 10828 | install_element (ENABLE_NODE, &clear_bgp_external_cmd); |
| 10829 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_cmd); |
| 10830 | install_element (ENABLE_NODE, &clear_bgp_as_cmd); |
| 10831 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10832 | |
| 10833 | /* "clear ip bgp neighbor soft in" */ |
| 10834 | install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_in_cmd); |
| 10835 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_in_cmd); |
| 10836 | install_element (ENABLE_NODE, &clear_ip_bgp_all_in_cmd); |
| 10837 | install_element (ENABLE_NODE, &clear_ip_bgp_all_in_prefix_filter_cmd); |
| 10838 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_in_prefix_filter_cmd); |
| 10839 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_in_cmd); |
| 10840 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_in_cmd); |
| 10841 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_in_prefix_filter_cmd); |
| 10842 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_in_cmd); |
| 10843 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_in_cmd); |
| 10844 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_in_prefix_filter_cmd); |
| 10845 | install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_in_cmd); |
| 10846 | install_element (ENABLE_NODE, &clear_ip_bgp_external_in_cmd); |
| 10847 | install_element (ENABLE_NODE, &clear_ip_bgp_external_in_prefix_filter_cmd); |
| 10848 | install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_in_cmd); |
| 10849 | install_element (ENABLE_NODE, &clear_ip_bgp_as_in_cmd); |
| 10850 | install_element (ENABLE_NODE, &clear_ip_bgp_as_in_prefix_filter_cmd); |
| 10851 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_in_cmd); |
| 10852 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd); |
| 10853 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_in_cmd); |
| 10854 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd); |
| 10855 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd); |
| 10856 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_in_cmd); |
| 10857 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_in_cmd); |
| 10858 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd); |
| 10859 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd); |
| 10860 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_in_cmd); |
| 10861 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd); |
| 10862 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_in_cmd); |
| 10863 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_in_cmd); |
| 10864 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd); |
| 10865 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_in_cmd); |
| 10866 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_in_cmd); |
| 10867 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd); |
| 10868 | install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_in_cmd); |
| 10869 | install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_in_cmd); |
| 10870 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_in_cmd); |
| 10871 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_in_cmd); |
| 10872 | install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_in_cmd); |
| 10873 | install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_in_cmd); |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 10874 | install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_soft_in_cmd); |
| 10875 | install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_in_cmd); |
| 10876 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_soft_in_cmd); |
| 10877 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_in_cmd); |
| 10878 | install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_in_cmd); |
| 10879 | install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_in_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10880 | install_element (ENABLE_NODE, &clear_bgp_all_soft_in_cmd); |
| 10881 | install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_in_cmd); |
| 10882 | install_element (ENABLE_NODE, &clear_bgp_all_in_cmd); |
| 10883 | install_element (ENABLE_NODE, &clear_bgp_all_in_prefix_filter_cmd); |
| 10884 | install_element (ENABLE_NODE, &clear_bgp_peer_soft_in_cmd); |
| 10885 | install_element (ENABLE_NODE, &clear_bgp_peer_in_cmd); |
| 10886 | install_element (ENABLE_NODE, &clear_bgp_peer_in_prefix_filter_cmd); |
| 10887 | install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_in_cmd); |
| 10888 | install_element (ENABLE_NODE, &clear_bgp_peer_group_in_cmd); |
| 10889 | install_element (ENABLE_NODE, &clear_bgp_peer_group_in_prefix_filter_cmd); |
| 10890 | install_element (ENABLE_NODE, &clear_bgp_external_soft_in_cmd); |
| 10891 | install_element (ENABLE_NODE, &clear_bgp_external_in_cmd); |
| 10892 | install_element (ENABLE_NODE, &clear_bgp_external_in_prefix_filter_cmd); |
| 10893 | install_element (ENABLE_NODE, &clear_bgp_as_soft_in_cmd); |
| 10894 | install_element (ENABLE_NODE, &clear_bgp_as_in_cmd); |
| 10895 | install_element (ENABLE_NODE, &clear_bgp_as_in_prefix_filter_cmd); |
| 10896 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_in_cmd); |
| 10897 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_in_cmd); |
| 10898 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_in_prefix_filter_cmd); |
| 10899 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_in_cmd); |
| 10900 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_in_cmd); |
| 10901 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_in_prefix_filter_cmd); |
| 10902 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_in_cmd); |
| 10903 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_in_cmd); |
| 10904 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd); |
| 10905 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_in_cmd); |
| 10906 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_in_cmd); |
| 10907 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_in_prefix_filter_cmd); |
| 10908 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_in_cmd); |
| 10909 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_cmd); |
| 10910 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_prefix_filter_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10911 | |
| 10912 | /* "clear ip bgp neighbor soft out" */ |
| 10913 | install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_out_cmd); |
| 10914 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_out_cmd); |
| 10915 | install_element (ENABLE_NODE, &clear_ip_bgp_all_out_cmd); |
| 10916 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_out_cmd); |
| 10917 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_out_cmd); |
| 10918 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_out_cmd); |
| 10919 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_out_cmd); |
| 10920 | install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_out_cmd); |
| 10921 | install_element (ENABLE_NODE, &clear_ip_bgp_external_out_cmd); |
| 10922 | install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_out_cmd); |
| 10923 | install_element (ENABLE_NODE, &clear_ip_bgp_as_out_cmd); |
| 10924 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_out_cmd); |
| 10925 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd); |
| 10926 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_out_cmd); |
| 10927 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_out_cmd); |
| 10928 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_out_cmd); |
| 10929 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd); |
| 10930 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_out_cmd); |
| 10931 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_out_cmd); |
| 10932 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_out_cmd); |
| 10933 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_out_cmd); |
| 10934 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_out_cmd); |
| 10935 | install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_out_cmd); |
| 10936 | install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_out_cmd); |
| 10937 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_out_cmd); |
| 10938 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_out_cmd); |
| 10939 | install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_out_cmd); |
| 10940 | install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_out_cmd); |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 10941 | install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_soft_out_cmd); |
| 10942 | install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_out_cmd); |
| 10943 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_soft_out_cmd); |
| 10944 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_out_cmd); |
| 10945 | install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_out_cmd); |
| 10946 | install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_out_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10947 | install_element (ENABLE_NODE, &clear_bgp_all_soft_out_cmd); |
| 10948 | install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_out_cmd); |
| 10949 | install_element (ENABLE_NODE, &clear_bgp_all_out_cmd); |
| 10950 | install_element (ENABLE_NODE, &clear_bgp_peer_soft_out_cmd); |
| 10951 | install_element (ENABLE_NODE, &clear_bgp_peer_out_cmd); |
| 10952 | install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_out_cmd); |
| 10953 | install_element (ENABLE_NODE, &clear_bgp_peer_group_out_cmd); |
| 10954 | install_element (ENABLE_NODE, &clear_bgp_external_soft_out_cmd); |
| 10955 | install_element (ENABLE_NODE, &clear_bgp_external_out_cmd); |
| 10956 | install_element (ENABLE_NODE, &clear_bgp_as_soft_out_cmd); |
| 10957 | install_element (ENABLE_NODE, &clear_bgp_as_out_cmd); |
| 10958 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_out_cmd); |
| 10959 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_out_cmd); |
| 10960 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_out_cmd); |
| 10961 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_out_cmd); |
| 10962 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_out_cmd); |
| 10963 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_out_cmd); |
| 10964 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_out_cmd); |
| 10965 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_out_cmd); |
| 10966 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_out_cmd); |
| 10967 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_out_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10968 | |
| 10969 | /* "clear ip bgp neighbor soft" */ |
| 10970 | install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_cmd); |
| 10971 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_cmd); |
| 10972 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_cmd); |
| 10973 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_cmd); |
| 10974 | install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_cmd); |
| 10975 | install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_cmd); |
| 10976 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_cmd); |
| 10977 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_cmd); |
| 10978 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_cmd); |
| 10979 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_cmd); |
| 10980 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_cmd); |
| 10981 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_cmd); |
| 10982 | install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_cmd); |
| 10983 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_cmd); |
| 10984 | install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_cmd); |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 10985 | install_element (ENABLE_NODE, &clear_ip_bgp_all_encap_soft_cmd); |
| 10986 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_encap_soft_cmd); |
| 10987 | install_element (ENABLE_NODE, &clear_ip_bgp_as_encap_soft_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10988 | install_element (ENABLE_NODE, &clear_bgp_all_soft_cmd); |
| 10989 | install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_cmd); |
| 10990 | install_element (ENABLE_NODE, &clear_bgp_peer_soft_cmd); |
| 10991 | install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_cmd); |
| 10992 | install_element (ENABLE_NODE, &clear_bgp_external_soft_cmd); |
| 10993 | install_element (ENABLE_NODE, &clear_bgp_as_soft_cmd); |
| 10994 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_cmd); |
| 10995 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_cmd); |
| 10996 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_cmd); |
| 10997 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_cmd); |
| 10998 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10999 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 11000 | /* "clear ip bgp neighbor rsclient" */ |
| 11001 | install_element (ENABLE_NODE, &clear_ip_bgp_all_rsclient_cmd); |
| 11002 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_rsclient_cmd); |
| 11003 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_rsclient_cmd); |
| 11004 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_peer_rsclient_cmd); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 11005 | install_element (ENABLE_NODE, &clear_bgp_all_rsclient_cmd); |
| 11006 | install_element (ENABLE_NODE, &clear_bgp_instance_all_rsclient_cmd); |
| 11007 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_rsclient_cmd); |
| 11008 | install_element (ENABLE_NODE, &clear_bgp_ipv6_instance_all_rsclient_cmd); |
| 11009 | install_element (ENABLE_NODE, &clear_bgp_peer_rsclient_cmd); |
| 11010 | install_element (ENABLE_NODE, &clear_bgp_instance_peer_rsclient_cmd); |
| 11011 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_rsclient_cmd); |
| 11012 | install_element (ENABLE_NODE, &clear_bgp_ipv6_instance_peer_rsclient_cmd); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 11013 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11014 | /* "show ip bgp summary" commands. */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11015 | install_element (VIEW_NODE, &show_bgp_summary_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11016 | install_element (RESTRICTED_NODE, &show_bgp_summary_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11017 | |
| 11018 | install_element (VIEW_NODE, &show_bgp_summary_1w_cmd); |
| 11019 | install_element (RESTRICTED_NODE, &show_bgp_summary_1w_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11020 | |
| 11021 | install_element (VIEW_NODE, &show_bgp_ipv4_safi_summary_cmd); |
| 11022 | install_element (VIEW_NODE, &show_bgp_instance_ipv4_safi_summary_cmd); |
| 11023 | install_element (VIEW_NODE, &show_bgp_instance_ipv4_summary_cmd); |
| 11024 | |
| 11025 | install_element (VIEW_NODE, &show_bgp_ipv4_vpn_summary_cmd); |
| 11026 | install_element (VIEW_NODE, &show_bgp_ipv4_encap_summary_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11027 | install_element (VIEW_NODE, &show_bgp_ipv6_vpn_summary_cmd); |
| 11028 | install_element (VIEW_NODE, &show_bgp_ipv6_encap_summary_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11029 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11030 | install_element (VIEW_NODE, &show_bgp_instance_summary_cmd); |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 11031 | install_element (VIEW_NODE, &show_bgp_ipv6_safi_summary_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11032 | install_element (VIEW_NODE, &show_bgp_instance_ipv6_summary_cmd); |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 11033 | install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_summary_cmd); |
Donald Sharp | 68b45cc | 2016-03-11 14:27:13 -0500 | [diff] [blame] | 11034 | |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 11035 | install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_summary_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11036 | install_element (RESTRICTED_NODE, &show_bgp_instance_ipv4_summary_cmd); |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 11037 | install_element (RESTRICTED_NODE, &show_bgp_instance_ipv4_safi_summary_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11038 | |
| 11039 | install_element (RESTRICTED_NODE, &show_bgp_ipv4_vpn_summary_cmd); |
| 11040 | install_element (RESTRICTED_NODE, &show_bgp_ipv4_encap_summary_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11041 | install_element (RESTRICTED_NODE, &show_bgp_ipv6_vpn_summary_cmd); |
| 11042 | install_element (RESTRICTED_NODE, &show_bgp_ipv6_encap_summary_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11043 | |
Paul Jakma | 62687ff | 2008-08-23 14:27:06 +0100 | [diff] [blame] | 11044 | install_element (RESTRICTED_NODE, &show_bgp_instance_summary_cmd); |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 11045 | install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_summary_cmd); |
Paul Jakma | 62687ff | 2008-08-23 14:27:06 +0100 | [diff] [blame] | 11046 | install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_summary_cmd); |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 11047 | install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_safi_summary_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11048 | |
| 11049 | /* "show ip bgp neighbors" commands. */ |
paul | bb46e94 | 2003-10-24 19:02:03 +0000 | [diff] [blame] | 11050 | install_element (VIEW_NODE, &show_bgp_instance_neighbors_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11051 | |
| 11052 | install_element (VIEW_NODE, &show_bgp_neighbors_cmd); |
| 11053 | install_element (VIEW_NODE, &show_bgp_neighbors_peer_cmd); |
| 11054 | install_element (VIEW_NODE, &show_bgp_instance_neighbors_peer_cmd); |
| 11055 | install_element (RESTRICTED_NODE, &show_bgp_neighbors_peer_cmd); |
| 11056 | install_element (RESTRICTED_NODE, &show_bgp_instance_neighbors_peer_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11057 | install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_cmd); |
| 11058 | install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd); |
| 11059 | install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11060 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 11061 | /* "show ip bgp rsclient" commands. */ |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 11062 | install_element (VIEW_NODE, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd); |
| 11063 | install_element (VIEW_NODE, &show_bgp_ipv4_safi_rsclient_summary_cmd); |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 11064 | install_element (RESTRICTED_NODE, &show_bgp_instance_ipv4_safi_rsclient_summary_cmd); |
| 11065 | install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_rsclient_summary_cmd); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 11066 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 11067 | install_element (VIEW_NODE, &show_bgp_rsclient_summary_cmd); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 11068 | install_element (VIEW_NODE, &show_bgp_instance_rsclient_summary_cmd); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11069 | install_element (RESTRICTED_NODE, &show_bgp_rsclient_summary_cmd); |
| 11070 | install_element (RESTRICTED_NODE, &show_bgp_instance_rsclient_summary_cmd); |
Donald Sharp | 68b45cc | 2016-03-11 14:27:13 -0500 | [diff] [blame] | 11071 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11072 | install_element (VIEW_NODE, &show_bgp_ipv6_rsclient_summary_cmd); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 11073 | install_element (VIEW_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd); |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 11074 | install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd); |
| 11075 | install_element (VIEW_NODE, &show_bgp_ipv6_safi_rsclient_summary_cmd); |
Paul Jakma | 62687ff | 2008-08-23 14:27:06 +0100 | [diff] [blame] | 11076 | install_element (RESTRICTED_NODE, &show_bgp_ipv6_rsclient_summary_cmd); |
Paul Jakma | 62687ff | 2008-08-23 14:27:06 +0100 | [diff] [blame] | 11077 | install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd); |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 11078 | install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd); |
| 11079 | install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_rsclient_summary_cmd); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 11080 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11081 | /* "show ip bgp paths" commands. */ |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 11082 | install_element (VIEW_NODE, &show_bgp_ipv4_paths_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11083 | |
| 11084 | /* "show ip bgp community" commands. */ |
| 11085 | install_element (VIEW_NODE, &show_ip_bgp_community_info_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11086 | |
| 11087 | /* "show ip bgp attribute-info" commands. */ |
| 11088 | install_element (VIEW_NODE, &show_ip_bgp_attr_info_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11089 | |
| 11090 | /* "redistribute" commands. */ |
| 11091 | install_element (BGP_NODE, &bgp_redistribute_ipv4_cmd); |
| 11092 | install_element (BGP_NODE, &no_bgp_redistribute_ipv4_cmd); |
| 11093 | install_element (BGP_NODE, &bgp_redistribute_ipv4_rmap_cmd); |
| 11094 | install_element (BGP_NODE, &no_bgp_redistribute_ipv4_rmap_cmd); |
| 11095 | install_element (BGP_NODE, &bgp_redistribute_ipv4_metric_cmd); |
| 11096 | install_element (BGP_NODE, &no_bgp_redistribute_ipv4_metric_cmd); |
| 11097 | install_element (BGP_NODE, &bgp_redistribute_ipv4_rmap_metric_cmd); |
| 11098 | install_element (BGP_NODE, &bgp_redistribute_ipv4_metric_rmap_cmd); |
| 11099 | install_element (BGP_NODE, &no_bgp_redistribute_ipv4_rmap_metric_cmd); |
| 11100 | install_element (BGP_NODE, &no_bgp_redistribute_ipv4_metric_rmap_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11101 | install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_cmd); |
| 11102 | install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_cmd); |
| 11103 | install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_cmd); |
| 11104 | install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_cmd); |
| 11105 | install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_cmd); |
| 11106 | install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_cmd); |
| 11107 | install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_metric_cmd); |
| 11108 | install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_rmap_cmd); |
| 11109 | install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_metric_cmd); |
| 11110 | install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_rmap_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11111 | |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 11112 | /* ttl_security commands */ |
| 11113 | install_element (BGP_NODE, &neighbor_ttl_security_cmd); |
| 11114 | install_element (BGP_NODE, &no_neighbor_ttl_security_cmd); |
| 11115 | |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 11116 | /* "show bgp memory" commands. */ |
| 11117 | install_element (VIEW_NODE, &show_bgp_memory_cmd); |
Paul Jakma | 62687ff | 2008-08-23 14:27:06 +0100 | [diff] [blame] | 11118 | install_element (RESTRICTED_NODE, &show_bgp_memory_cmd); |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 11119 | |
Michael Lambert | e0081f7 | 2008-11-16 20:12:04 +0000 | [diff] [blame] | 11120 | /* "show bgp views" commands. */ |
| 11121 | install_element (VIEW_NODE, &show_bgp_views_cmd); |
| 11122 | install_element (RESTRICTED_NODE, &show_bgp_views_cmd); |
Donald Sharp | 68b45cc | 2016-03-11 14:27:13 -0500 | [diff] [blame] | 11123 | |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 11124 | /* non afi/safi forms of commands */ |
| 11125 | install_element (VIEW_NODE, &show_ip_bgp_summary_cmd); |
| 11126 | install_element (VIEW_NODE, &show_ip_bgp_instance_summary_cmd); |
| 11127 | install_element (VIEW_NODE, &show_ip_bgp_ipv4_summary_cmd); |
| 11128 | install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); |
| 11129 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_summary_cmd); |
| 11130 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd); |
| 11131 | install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd); |
| 11132 | install_element (RESTRICTED_NODE, &show_ip_bgp_summary_cmd); |
| 11133 | install_element (RESTRICTED_NODE, &show_ip_bgp_instance_summary_cmd); |
| 11134 | install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_summary_cmd); |
| 11135 | install_element (RESTRICTED_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); |
| 11136 | install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_summary_cmd); |
| 11137 | install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd); |
| 11138 | install_element (RESTRICTED_NODE, &show_bgp_ipv6_summary_cmd); |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 11139 | install_element (VIEW_NODE, &show_ip_bgp_neighbors_cmd); |
| 11140 | install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_cmd); |
| 11141 | install_element (VIEW_NODE, &show_ip_bgp_neighbors_peer_cmd); |
| 11142 | install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd); |
| 11143 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd); |
| 11144 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd); |
| 11145 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd); |
| 11146 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd); |
| 11147 | install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_cmd); |
| 11148 | install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_peer_cmd); |
| 11149 | install_element (RESTRICTED_NODE, &show_ip_bgp_neighbors_peer_cmd); |
| 11150 | install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd); |
| 11151 | install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd); |
| 11152 | install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd); |
| 11153 | install_element (RESTRICTED_NODE, &show_ip_bgp_instance_neighbors_peer_cmd); |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 11154 | install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_cmd); |
| 11155 | install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_peer_cmd); |
| 11156 | install_element (RESTRICTED_NODE, &show_bgp_ipv6_neighbors_peer_cmd); |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 11157 | install_element (VIEW_NODE, &show_ipv6_bgp_summary_cmd); |
| 11158 | install_element (VIEW_NODE, &show_ipv6_mbgp_summary_cmd); |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 11159 | install_element (VIEW_NODE, &show_ip_bgp_rsclient_summary_cmd); |
| 11160 | install_element (VIEW_NODE, &show_ip_bgp_instance_rsclient_summary_cmd); |
| 11161 | install_element (VIEW_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd); |
| 11162 | install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd); |
| 11163 | install_element (RESTRICTED_NODE, &show_ip_bgp_rsclient_summary_cmd); |
| 11164 | install_element (RESTRICTED_NODE, &show_ip_bgp_instance_rsclient_summary_cmd); |
| 11165 | install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd); |
| 11166 | install_element (RESTRICTED_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd); |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 11167 | install_element (VIEW_NODE, &show_ip_bgp_paths_cmd); |
| 11168 | install_element (VIEW_NODE, &show_ip_bgp_ipv4_paths_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11169 | /* Community-list. */ |
| 11170 | community_list_vty (); |
| 11171 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 11172 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11173 | #include "memory.h" |
| 11174 | #include "bgp_regex.h" |
| 11175 | #include "bgp_clist.h" |
| 11176 | #include "bgp_ecommunity.h" |
| 11177 | |
| 11178 | /* VTY functions. */ |
| 11179 | |
| 11180 | /* Direction value to string conversion. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 11181 | static const char * |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11182 | community_direct_str (int direct) |
| 11183 | { |
| 11184 | switch (direct) |
| 11185 | { |
| 11186 | case COMMUNITY_DENY: |
| 11187 | return "deny"; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11188 | case COMMUNITY_PERMIT: |
| 11189 | return "permit"; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11190 | default: |
| 11191 | return "unknown"; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11192 | } |
| 11193 | } |
| 11194 | |
| 11195 | /* Display error string. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 11196 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11197 | community_list_perror (struct vty *vty, int ret) |
| 11198 | { |
| 11199 | switch (ret) |
| 11200 | { |
| 11201 | case COMMUNITY_LIST_ERR_CANT_FIND_LIST: |
Denis Ovsienko | b729294 | 2010-12-08 18:51:37 +0300 | [diff] [blame] | 11202 | vty_out (vty, "%% Can't find community-list%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11203 | break; |
| 11204 | case COMMUNITY_LIST_ERR_MALFORMED_VAL: |
| 11205 | vty_out (vty, "%% Malformed community-list value%s", VTY_NEWLINE); |
| 11206 | break; |
| 11207 | case COMMUNITY_LIST_ERR_STANDARD_CONFLICT: |
| 11208 | vty_out (vty, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE); |
| 11209 | break; |
| 11210 | case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT: |
| 11211 | vty_out (vty, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE); |
| 11212 | break; |
| 11213 | } |
| 11214 | } |
| 11215 | |
| 11216 | /* VTY interface for community_set() function. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 11217 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 11218 | community_list_set_vty (struct vty *vty, int argc, const char **argv, |
| 11219 | int style, int reject_all_digit_name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11220 | { |
| 11221 | int ret; |
| 11222 | int direct; |
| 11223 | char *str; |
| 11224 | |
| 11225 | /* Check the list type. */ |
| 11226 | if (strncmp (argv[1], "p", 1) == 0) |
| 11227 | direct = COMMUNITY_PERMIT; |
| 11228 | else if (strncmp (argv[1], "d", 1) == 0) |
| 11229 | direct = COMMUNITY_DENY; |
| 11230 | else |
| 11231 | { |
| 11232 | vty_out (vty, "%% Matching condition must be permit or deny%s", |
| 11233 | VTY_NEWLINE); |
| 11234 | return CMD_WARNING; |
| 11235 | } |
| 11236 | |
| 11237 | /* All digit name check. */ |
| 11238 | if (reject_all_digit_name && all_digit (argv[0])) |
| 11239 | { |
| 11240 | vty_out (vty, "%% Community name cannot have all digits%s", VTY_NEWLINE); |
| 11241 | return CMD_WARNING; |
| 11242 | } |
| 11243 | |
| 11244 | /* Concat community string argument. */ |
| 11245 | if (argc > 1) |
| 11246 | str = argv_concat (argv, argc, 2); |
| 11247 | else |
| 11248 | str = NULL; |
| 11249 | |
| 11250 | /* When community_list_set() return nevetive value, it means |
| 11251 | malformed community string. */ |
| 11252 | ret = community_list_set (bgp_clist, argv[0], str, direct, style); |
| 11253 | |
| 11254 | /* Free temporary community list string allocated by |
| 11255 | argv_concat(). */ |
| 11256 | if (str) |
| 11257 | XFREE (MTYPE_TMP, str); |
| 11258 | |
| 11259 | if (ret < 0) |
| 11260 | { |
| 11261 | /* Display error string. */ |
| 11262 | community_list_perror (vty, ret); |
| 11263 | return CMD_WARNING; |
| 11264 | } |
| 11265 | |
| 11266 | return CMD_SUCCESS; |
| 11267 | } |
| 11268 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11269 | /* Communiyt-list entry delete. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 11270 | static int |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11271 | community_list_unset_vty (struct vty *vty, int argc, const char **argv, |
| 11272 | int style) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11273 | { |
| 11274 | int ret; |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11275 | int direct = 0; |
| 11276 | char *str = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11277 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11278 | if (argc > 1) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11279 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11280 | /* Check the list direct. */ |
| 11281 | if (strncmp (argv[1], "p", 1) == 0) |
| 11282 | direct = COMMUNITY_PERMIT; |
| 11283 | else if (strncmp (argv[1], "d", 1) == 0) |
| 11284 | direct = COMMUNITY_DENY; |
| 11285 | else |
| 11286 | { |
| 11287 | vty_out (vty, "%% Matching condition must be permit or deny%s", |
| 11288 | VTY_NEWLINE); |
| 11289 | return CMD_WARNING; |
| 11290 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11291 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11292 | /* Concat community string argument. */ |
| 11293 | str = argv_concat (argv, argc, 2); |
| 11294 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11295 | |
| 11296 | /* Unset community list. */ |
| 11297 | ret = community_list_unset (bgp_clist, argv[0], str, direct, style); |
| 11298 | |
| 11299 | /* Free temporary community list string allocated by |
| 11300 | argv_concat(). */ |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11301 | if (str) |
| 11302 | XFREE (MTYPE_TMP, str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11303 | |
| 11304 | if (ret < 0) |
| 11305 | { |
| 11306 | community_list_perror (vty, ret); |
| 11307 | return CMD_WARNING; |
| 11308 | } |
| 11309 | |
| 11310 | return CMD_SUCCESS; |
| 11311 | } |
| 11312 | |
| 11313 | /* "community-list" keyword help string. */ |
| 11314 | #define COMMUNITY_LIST_STR "Add a community list entry\n" |
| 11315 | #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n" |
| 11316 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11317 | DEFUN (ip_community_list_standard, |
| 11318 | ip_community_list_standard_cmd, |
| 11319 | "ip community-list <1-99> (deny|permit) .AA:NN", |
| 11320 | IP_STR |
| 11321 | COMMUNITY_LIST_STR |
| 11322 | "Community list number (standard)\n" |
| 11323 | "Specify community to reject\n" |
| 11324 | "Specify community to accept\n" |
| 11325 | COMMUNITY_VAL_STR) |
| 11326 | { |
| 11327 | return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 0); |
| 11328 | } |
| 11329 | |
| 11330 | ALIAS (ip_community_list_standard, |
| 11331 | ip_community_list_standard2_cmd, |
| 11332 | "ip community-list <1-99> (deny|permit)", |
| 11333 | IP_STR |
| 11334 | COMMUNITY_LIST_STR |
| 11335 | "Community list number (standard)\n" |
| 11336 | "Specify community to reject\n" |
| 11337 | "Specify community to accept\n") |
| 11338 | |
| 11339 | DEFUN (ip_community_list_expanded, |
| 11340 | ip_community_list_expanded_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11341 | "ip community-list <100-500> (deny|permit) .LINE", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11342 | IP_STR |
| 11343 | COMMUNITY_LIST_STR |
| 11344 | "Community list number (expanded)\n" |
| 11345 | "Specify community to reject\n" |
| 11346 | "Specify community to accept\n" |
| 11347 | "An ordered list as a regular-expression\n") |
| 11348 | { |
| 11349 | return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 0); |
| 11350 | } |
| 11351 | |
| 11352 | DEFUN (ip_community_list_name_standard, |
| 11353 | ip_community_list_name_standard_cmd, |
| 11354 | "ip community-list standard WORD (deny|permit) .AA:NN", |
| 11355 | IP_STR |
| 11356 | COMMUNITY_LIST_STR |
| 11357 | "Add a standard community-list entry\n" |
| 11358 | "Community list name\n" |
| 11359 | "Specify community to reject\n" |
| 11360 | "Specify community to accept\n" |
| 11361 | COMMUNITY_VAL_STR) |
| 11362 | { |
| 11363 | return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 1); |
| 11364 | } |
| 11365 | |
| 11366 | ALIAS (ip_community_list_name_standard, |
| 11367 | ip_community_list_name_standard2_cmd, |
| 11368 | "ip community-list standard WORD (deny|permit)", |
| 11369 | IP_STR |
| 11370 | COMMUNITY_LIST_STR |
| 11371 | "Add a standard community-list entry\n" |
| 11372 | "Community list name\n" |
| 11373 | "Specify community to reject\n" |
| 11374 | "Specify community to accept\n") |
| 11375 | |
| 11376 | DEFUN (ip_community_list_name_expanded, |
| 11377 | ip_community_list_name_expanded_cmd, |
| 11378 | "ip community-list expanded WORD (deny|permit) .LINE", |
| 11379 | IP_STR |
| 11380 | COMMUNITY_LIST_STR |
| 11381 | "Add an expanded community-list entry\n" |
| 11382 | "Community list name\n" |
| 11383 | "Specify community to reject\n" |
| 11384 | "Specify community to accept\n" |
| 11385 | "An ordered list as a regular-expression\n") |
| 11386 | { |
| 11387 | return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 1); |
| 11388 | } |
| 11389 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11390 | DEFUN (no_ip_community_list_standard_all, |
| 11391 | no_ip_community_list_standard_all_cmd, |
| 11392 | "no ip community-list <1-99>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11393 | NO_STR |
| 11394 | IP_STR |
| 11395 | COMMUNITY_LIST_STR |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11396 | "Community list number (standard)\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11397 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11398 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11399 | } |
| 11400 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11401 | DEFUN (no_ip_community_list_expanded_all, |
| 11402 | no_ip_community_list_expanded_all_cmd, |
| 11403 | "no ip community-list <100-500>", |
| 11404 | NO_STR |
| 11405 | IP_STR |
| 11406 | COMMUNITY_LIST_STR |
| 11407 | "Community list number (expanded)\n") |
| 11408 | { |
| 11409 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED); |
| 11410 | } |
| 11411 | |
| 11412 | DEFUN (no_ip_community_list_name_standard_all, |
| 11413 | no_ip_community_list_name_standard_all_cmd, |
| 11414 | "no ip community-list standard WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11415 | NO_STR |
| 11416 | IP_STR |
| 11417 | COMMUNITY_LIST_STR |
| 11418 | "Add a standard community-list entry\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11419 | "Community list name\n") |
| 11420 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11421 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11422 | } |
| 11423 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11424 | DEFUN (no_ip_community_list_name_expanded_all, |
| 11425 | no_ip_community_list_name_expanded_all_cmd, |
| 11426 | "no ip community-list expanded WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11427 | NO_STR |
| 11428 | IP_STR |
| 11429 | COMMUNITY_LIST_STR |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11430 | "Add an expanded community-list entry\n" |
| 11431 | "Community list name\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11432 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11433 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11434 | } |
| 11435 | |
| 11436 | DEFUN (no_ip_community_list_standard, |
| 11437 | no_ip_community_list_standard_cmd, |
| 11438 | "no ip community-list <1-99> (deny|permit) .AA:NN", |
| 11439 | NO_STR |
| 11440 | IP_STR |
| 11441 | COMMUNITY_LIST_STR |
| 11442 | "Community list number (standard)\n" |
| 11443 | "Specify community to reject\n" |
| 11444 | "Specify community to accept\n" |
| 11445 | COMMUNITY_VAL_STR) |
| 11446 | { |
| 11447 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD); |
| 11448 | } |
| 11449 | |
| 11450 | DEFUN (no_ip_community_list_expanded, |
| 11451 | no_ip_community_list_expanded_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11452 | "no ip community-list <100-500> (deny|permit) .LINE", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11453 | NO_STR |
| 11454 | IP_STR |
| 11455 | COMMUNITY_LIST_STR |
| 11456 | "Community list number (expanded)\n" |
| 11457 | "Specify community to reject\n" |
| 11458 | "Specify community to accept\n" |
| 11459 | "An ordered list as a regular-expression\n") |
| 11460 | { |
| 11461 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED); |
| 11462 | } |
| 11463 | |
| 11464 | DEFUN (no_ip_community_list_name_standard, |
| 11465 | no_ip_community_list_name_standard_cmd, |
| 11466 | "no ip community-list standard WORD (deny|permit) .AA:NN", |
| 11467 | NO_STR |
| 11468 | IP_STR |
| 11469 | COMMUNITY_LIST_STR |
| 11470 | "Specify a standard community-list\n" |
| 11471 | "Community list name\n" |
| 11472 | "Specify community to reject\n" |
| 11473 | "Specify community to accept\n" |
| 11474 | COMMUNITY_VAL_STR) |
| 11475 | { |
| 11476 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD); |
| 11477 | } |
| 11478 | |
| 11479 | DEFUN (no_ip_community_list_name_expanded, |
| 11480 | no_ip_community_list_name_expanded_cmd, |
| 11481 | "no ip community-list expanded WORD (deny|permit) .LINE", |
| 11482 | NO_STR |
| 11483 | IP_STR |
| 11484 | COMMUNITY_LIST_STR |
| 11485 | "Specify an expanded community-list\n" |
| 11486 | "Community list name\n" |
| 11487 | "Specify community to reject\n" |
| 11488 | "Specify community to accept\n" |
| 11489 | "An ordered list as a regular-expression\n") |
| 11490 | { |
| 11491 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED); |
| 11492 | } |
| 11493 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 11494 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11495 | community_list_show (struct vty *vty, struct community_list *list) |
| 11496 | { |
| 11497 | struct community_entry *entry; |
| 11498 | |
| 11499 | for (entry = list->head; entry; entry = entry->next) |
| 11500 | { |
| 11501 | if (entry == list->head) |
| 11502 | { |
| 11503 | if (all_digit (list->name)) |
| 11504 | vty_out (vty, "Community %s list %s%s", |
| 11505 | entry->style == COMMUNITY_LIST_STANDARD ? |
| 11506 | "standard" : "(expanded) access", |
| 11507 | list->name, VTY_NEWLINE); |
| 11508 | else |
| 11509 | vty_out (vty, "Named Community %s list %s%s", |
| 11510 | entry->style == COMMUNITY_LIST_STANDARD ? |
| 11511 | "standard" : "expanded", |
| 11512 | list->name, VTY_NEWLINE); |
| 11513 | } |
| 11514 | if (entry->any) |
| 11515 | vty_out (vty, " %s%s", |
| 11516 | community_direct_str (entry->direct), VTY_NEWLINE); |
| 11517 | else |
| 11518 | vty_out (vty, " %s %s%s", |
| 11519 | community_direct_str (entry->direct), |
| 11520 | entry->style == COMMUNITY_LIST_STANDARD |
| 11521 | ? community_str (entry->u.com) : entry->config, |
| 11522 | VTY_NEWLINE); |
| 11523 | } |
| 11524 | } |
| 11525 | |
| 11526 | DEFUN (show_ip_community_list, |
| 11527 | show_ip_community_list_cmd, |
| 11528 | "show ip community-list", |
| 11529 | SHOW_STR |
| 11530 | IP_STR |
| 11531 | "List community-list\n") |
| 11532 | { |
| 11533 | struct community_list *list; |
| 11534 | struct community_list_master *cm; |
| 11535 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11536 | cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11537 | if (! cm) |
| 11538 | return CMD_SUCCESS; |
| 11539 | |
| 11540 | for (list = cm->num.head; list; list = list->next) |
| 11541 | community_list_show (vty, list); |
| 11542 | |
| 11543 | for (list = cm->str.head; list; list = list->next) |
| 11544 | community_list_show (vty, list); |
| 11545 | |
| 11546 | return CMD_SUCCESS; |
| 11547 | } |
| 11548 | |
| 11549 | DEFUN (show_ip_community_list_arg, |
| 11550 | show_ip_community_list_arg_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11551 | "show ip community-list (<1-500>|WORD)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11552 | SHOW_STR |
| 11553 | IP_STR |
| 11554 | "List community-list\n" |
| 11555 | "Community-list number\n" |
| 11556 | "Community-list name\n") |
| 11557 | { |
| 11558 | struct community_list *list; |
| 11559 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11560 | list = community_list_lookup (bgp_clist, argv[0], COMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11561 | if (! list) |
| 11562 | { |
Denis Ovsienko | b729294 | 2010-12-08 18:51:37 +0300 | [diff] [blame] | 11563 | vty_out (vty, "%% Can't find community-list%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11564 | return CMD_WARNING; |
| 11565 | } |
| 11566 | |
| 11567 | community_list_show (vty, list); |
| 11568 | |
| 11569 | return CMD_SUCCESS; |
| 11570 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 11571 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 11572 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 11573 | extcommunity_list_set_vty (struct vty *vty, int argc, const char **argv, |
| 11574 | int style, int reject_all_digit_name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11575 | { |
| 11576 | int ret; |
| 11577 | int direct; |
| 11578 | char *str; |
| 11579 | |
| 11580 | /* Check the list type. */ |
| 11581 | if (strncmp (argv[1], "p", 1) == 0) |
| 11582 | direct = COMMUNITY_PERMIT; |
| 11583 | else if (strncmp (argv[1], "d", 1) == 0) |
| 11584 | direct = COMMUNITY_DENY; |
| 11585 | else |
| 11586 | { |
| 11587 | vty_out (vty, "%% Matching condition must be permit or deny%s", |
| 11588 | VTY_NEWLINE); |
| 11589 | return CMD_WARNING; |
| 11590 | } |
| 11591 | |
| 11592 | /* All digit name check. */ |
| 11593 | if (reject_all_digit_name && all_digit (argv[0])) |
| 11594 | { |
| 11595 | vty_out (vty, "%% Community name cannot have all digits%s", VTY_NEWLINE); |
| 11596 | return CMD_WARNING; |
| 11597 | } |
| 11598 | |
| 11599 | /* Concat community string argument. */ |
| 11600 | if (argc > 1) |
| 11601 | str = argv_concat (argv, argc, 2); |
| 11602 | else |
| 11603 | str = NULL; |
| 11604 | |
| 11605 | ret = extcommunity_list_set (bgp_clist, argv[0], str, direct, style); |
| 11606 | |
| 11607 | /* Free temporary community list string allocated by |
| 11608 | argv_concat(). */ |
| 11609 | if (str) |
| 11610 | XFREE (MTYPE_TMP, str); |
| 11611 | |
| 11612 | if (ret < 0) |
| 11613 | { |
| 11614 | community_list_perror (vty, ret); |
| 11615 | return CMD_WARNING; |
| 11616 | } |
| 11617 | return CMD_SUCCESS; |
| 11618 | } |
| 11619 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 11620 | static int |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11621 | extcommunity_list_unset_vty (struct vty *vty, int argc, const char **argv, |
| 11622 | int style) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11623 | { |
| 11624 | int ret; |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11625 | int direct = 0; |
| 11626 | char *str = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11627 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11628 | if (argc > 1) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11629 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11630 | /* Check the list direct. */ |
| 11631 | if (strncmp (argv[1], "p", 1) == 0) |
| 11632 | direct = COMMUNITY_PERMIT; |
| 11633 | else if (strncmp (argv[1], "d", 1) == 0) |
| 11634 | direct = COMMUNITY_DENY; |
| 11635 | else |
| 11636 | { |
| 11637 | vty_out (vty, "%% Matching condition must be permit or deny%s", |
| 11638 | VTY_NEWLINE); |
| 11639 | return CMD_WARNING; |
| 11640 | } |
| 11641 | |
| 11642 | /* Concat community string argument. */ |
| 11643 | str = argv_concat (argv, argc, 2); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11644 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11645 | |
| 11646 | /* Unset community list. */ |
| 11647 | ret = extcommunity_list_unset (bgp_clist, argv[0], str, direct, style); |
| 11648 | |
| 11649 | /* Free temporary community list string allocated by |
| 11650 | argv_concat(). */ |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11651 | if (str) |
| 11652 | XFREE (MTYPE_TMP, str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11653 | |
| 11654 | if (ret < 0) |
| 11655 | { |
| 11656 | community_list_perror (vty, ret); |
| 11657 | return CMD_WARNING; |
| 11658 | } |
| 11659 | |
| 11660 | return CMD_SUCCESS; |
| 11661 | } |
| 11662 | |
| 11663 | /* "extcommunity-list" keyword help string. */ |
| 11664 | #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n" |
| 11665 | #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n" |
| 11666 | |
| 11667 | DEFUN (ip_extcommunity_list_standard, |
| 11668 | ip_extcommunity_list_standard_cmd, |
| 11669 | "ip extcommunity-list <1-99> (deny|permit) .AA:NN", |
| 11670 | IP_STR |
| 11671 | EXTCOMMUNITY_LIST_STR |
| 11672 | "Extended Community list number (standard)\n" |
| 11673 | "Specify community to reject\n" |
| 11674 | "Specify community to accept\n" |
| 11675 | EXTCOMMUNITY_VAL_STR) |
| 11676 | { |
| 11677 | return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 0); |
| 11678 | } |
| 11679 | |
| 11680 | ALIAS (ip_extcommunity_list_standard, |
| 11681 | ip_extcommunity_list_standard2_cmd, |
| 11682 | "ip extcommunity-list <1-99> (deny|permit)", |
| 11683 | IP_STR |
| 11684 | EXTCOMMUNITY_LIST_STR |
| 11685 | "Extended Community list number (standard)\n" |
| 11686 | "Specify community to reject\n" |
| 11687 | "Specify community to accept\n") |
| 11688 | |
| 11689 | DEFUN (ip_extcommunity_list_expanded, |
| 11690 | ip_extcommunity_list_expanded_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11691 | "ip extcommunity-list <100-500> (deny|permit) .LINE", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11692 | IP_STR |
| 11693 | EXTCOMMUNITY_LIST_STR |
| 11694 | "Extended Community list number (expanded)\n" |
| 11695 | "Specify community to reject\n" |
| 11696 | "Specify community to accept\n" |
| 11697 | "An ordered list as a regular-expression\n") |
| 11698 | { |
| 11699 | return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 0); |
| 11700 | } |
| 11701 | |
| 11702 | DEFUN (ip_extcommunity_list_name_standard, |
| 11703 | ip_extcommunity_list_name_standard_cmd, |
| 11704 | "ip extcommunity-list standard WORD (deny|permit) .AA:NN", |
| 11705 | IP_STR |
| 11706 | EXTCOMMUNITY_LIST_STR |
| 11707 | "Specify standard extcommunity-list\n" |
| 11708 | "Extended Community list name\n" |
| 11709 | "Specify community to reject\n" |
| 11710 | "Specify community to accept\n" |
| 11711 | EXTCOMMUNITY_VAL_STR) |
| 11712 | { |
| 11713 | return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 1); |
| 11714 | } |
| 11715 | |
| 11716 | ALIAS (ip_extcommunity_list_name_standard, |
| 11717 | ip_extcommunity_list_name_standard2_cmd, |
| 11718 | "ip extcommunity-list standard WORD (deny|permit)", |
| 11719 | IP_STR |
| 11720 | EXTCOMMUNITY_LIST_STR |
| 11721 | "Specify standard extcommunity-list\n" |
| 11722 | "Extended Community list name\n" |
| 11723 | "Specify community to reject\n" |
| 11724 | "Specify community to accept\n") |
| 11725 | |
| 11726 | DEFUN (ip_extcommunity_list_name_expanded, |
| 11727 | ip_extcommunity_list_name_expanded_cmd, |
| 11728 | "ip extcommunity-list expanded WORD (deny|permit) .LINE", |
| 11729 | IP_STR |
| 11730 | EXTCOMMUNITY_LIST_STR |
| 11731 | "Specify expanded extcommunity-list\n" |
| 11732 | "Extended Community list name\n" |
| 11733 | "Specify community to reject\n" |
| 11734 | "Specify community to accept\n" |
| 11735 | "An ordered list as a regular-expression\n") |
| 11736 | { |
| 11737 | return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 1); |
| 11738 | } |
| 11739 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11740 | DEFUN (no_ip_extcommunity_list_standard_all, |
| 11741 | no_ip_extcommunity_list_standard_all_cmd, |
| 11742 | "no ip extcommunity-list <1-99>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11743 | NO_STR |
| 11744 | IP_STR |
| 11745 | EXTCOMMUNITY_LIST_STR |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11746 | "Extended Community list number (standard)\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11747 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11748 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11749 | } |
| 11750 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11751 | DEFUN (no_ip_extcommunity_list_expanded_all, |
| 11752 | no_ip_extcommunity_list_expanded_all_cmd, |
| 11753 | "no ip extcommunity-list <100-500>", |
| 11754 | NO_STR |
| 11755 | IP_STR |
| 11756 | EXTCOMMUNITY_LIST_STR |
| 11757 | "Extended Community list number (expanded)\n") |
| 11758 | { |
| 11759 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED); |
| 11760 | } |
| 11761 | |
| 11762 | DEFUN (no_ip_extcommunity_list_name_standard_all, |
| 11763 | no_ip_extcommunity_list_name_standard_all_cmd, |
| 11764 | "no ip extcommunity-list standard WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11765 | NO_STR |
| 11766 | IP_STR |
| 11767 | EXTCOMMUNITY_LIST_STR |
| 11768 | "Specify standard extcommunity-list\n" |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11769 | "Extended Community list name\n") |
| 11770 | { |
| 11771 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD); |
| 11772 | } |
| 11773 | |
| 11774 | DEFUN (no_ip_extcommunity_list_name_expanded_all, |
| 11775 | no_ip_extcommunity_list_name_expanded_all_cmd, |
| 11776 | "no ip extcommunity-list expanded WORD", |
| 11777 | NO_STR |
| 11778 | IP_STR |
| 11779 | EXTCOMMUNITY_LIST_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11780 | "Specify expanded extcommunity-list\n" |
| 11781 | "Extended Community list name\n") |
| 11782 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11783 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11784 | } |
| 11785 | |
| 11786 | DEFUN (no_ip_extcommunity_list_standard, |
| 11787 | no_ip_extcommunity_list_standard_cmd, |
| 11788 | "no ip extcommunity-list <1-99> (deny|permit) .AA:NN", |
| 11789 | NO_STR |
| 11790 | IP_STR |
| 11791 | EXTCOMMUNITY_LIST_STR |
| 11792 | "Extended Community list number (standard)\n" |
| 11793 | "Specify community to reject\n" |
| 11794 | "Specify community to accept\n" |
| 11795 | EXTCOMMUNITY_VAL_STR) |
| 11796 | { |
| 11797 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD); |
| 11798 | } |
| 11799 | |
| 11800 | DEFUN (no_ip_extcommunity_list_expanded, |
| 11801 | no_ip_extcommunity_list_expanded_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11802 | "no ip extcommunity-list <100-500> (deny|permit) .LINE", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11803 | NO_STR |
| 11804 | IP_STR |
| 11805 | EXTCOMMUNITY_LIST_STR |
| 11806 | "Extended Community list number (expanded)\n" |
| 11807 | "Specify community to reject\n" |
| 11808 | "Specify community to accept\n" |
| 11809 | "An ordered list as a regular-expression\n") |
| 11810 | { |
| 11811 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED); |
| 11812 | } |
| 11813 | |
| 11814 | DEFUN (no_ip_extcommunity_list_name_standard, |
| 11815 | no_ip_extcommunity_list_name_standard_cmd, |
| 11816 | "no ip extcommunity-list standard WORD (deny|permit) .AA:NN", |
| 11817 | NO_STR |
| 11818 | IP_STR |
| 11819 | EXTCOMMUNITY_LIST_STR |
| 11820 | "Specify standard extcommunity-list\n" |
| 11821 | "Extended Community list name\n" |
| 11822 | "Specify community to reject\n" |
| 11823 | "Specify community to accept\n" |
| 11824 | EXTCOMMUNITY_VAL_STR) |
| 11825 | { |
| 11826 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD); |
| 11827 | } |
| 11828 | |
| 11829 | DEFUN (no_ip_extcommunity_list_name_expanded, |
| 11830 | no_ip_extcommunity_list_name_expanded_cmd, |
| 11831 | "no ip extcommunity-list expanded WORD (deny|permit) .LINE", |
| 11832 | NO_STR |
| 11833 | IP_STR |
| 11834 | EXTCOMMUNITY_LIST_STR |
| 11835 | "Specify expanded extcommunity-list\n" |
| 11836 | "Community list name\n" |
| 11837 | "Specify community to reject\n" |
| 11838 | "Specify community to accept\n" |
| 11839 | "An ordered list as a regular-expression\n") |
| 11840 | { |
| 11841 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED); |
| 11842 | } |
| 11843 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 11844 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11845 | extcommunity_list_show (struct vty *vty, struct community_list *list) |
| 11846 | { |
| 11847 | struct community_entry *entry; |
| 11848 | |
| 11849 | for (entry = list->head; entry; entry = entry->next) |
| 11850 | { |
| 11851 | if (entry == list->head) |
| 11852 | { |
| 11853 | if (all_digit (list->name)) |
| 11854 | vty_out (vty, "Extended community %s list %s%s", |
| 11855 | entry->style == EXTCOMMUNITY_LIST_STANDARD ? |
| 11856 | "standard" : "(expanded) access", |
| 11857 | list->name, VTY_NEWLINE); |
| 11858 | else |
| 11859 | vty_out (vty, "Named extended community %s list %s%s", |
| 11860 | entry->style == EXTCOMMUNITY_LIST_STANDARD ? |
| 11861 | "standard" : "expanded", |
| 11862 | list->name, VTY_NEWLINE); |
| 11863 | } |
| 11864 | if (entry->any) |
| 11865 | vty_out (vty, " %s%s", |
| 11866 | community_direct_str (entry->direct), VTY_NEWLINE); |
| 11867 | else |
| 11868 | vty_out (vty, " %s %s%s", |
| 11869 | community_direct_str (entry->direct), |
| 11870 | entry->style == EXTCOMMUNITY_LIST_STANDARD ? |
| 11871 | entry->u.ecom->str : entry->config, |
| 11872 | VTY_NEWLINE); |
| 11873 | } |
| 11874 | } |
| 11875 | |
| 11876 | DEFUN (show_ip_extcommunity_list, |
| 11877 | show_ip_extcommunity_list_cmd, |
| 11878 | "show ip extcommunity-list", |
| 11879 | SHOW_STR |
| 11880 | IP_STR |
| 11881 | "List extended-community list\n") |
| 11882 | { |
| 11883 | struct community_list *list; |
| 11884 | struct community_list_master *cm; |
| 11885 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11886 | cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11887 | if (! cm) |
| 11888 | return CMD_SUCCESS; |
| 11889 | |
| 11890 | for (list = cm->num.head; list; list = list->next) |
| 11891 | extcommunity_list_show (vty, list); |
| 11892 | |
| 11893 | for (list = cm->str.head; list; list = list->next) |
| 11894 | extcommunity_list_show (vty, list); |
| 11895 | |
| 11896 | return CMD_SUCCESS; |
| 11897 | } |
| 11898 | |
| 11899 | DEFUN (show_ip_extcommunity_list_arg, |
| 11900 | show_ip_extcommunity_list_arg_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11901 | "show ip extcommunity-list (<1-500>|WORD)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11902 | SHOW_STR |
| 11903 | IP_STR |
| 11904 | "List extended-community list\n" |
| 11905 | "Extcommunity-list number\n" |
| 11906 | "Extcommunity-list name\n") |
| 11907 | { |
| 11908 | struct community_list *list; |
| 11909 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11910 | list = community_list_lookup (bgp_clist, argv[0], EXTCOMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11911 | if (! list) |
| 11912 | { |
Denis Ovsienko | b729294 | 2010-12-08 18:51:37 +0300 | [diff] [blame] | 11913 | vty_out (vty, "%% Can't find extcommunity-list%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11914 | return CMD_WARNING; |
| 11915 | } |
| 11916 | |
| 11917 | extcommunity_list_show (vty, list); |
| 11918 | |
| 11919 | return CMD_SUCCESS; |
| 11920 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 11921 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11922 | /* Return configuration string of community-list entry. */ |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 11923 | static const char * |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11924 | community_list_config_str (struct community_entry *entry) |
| 11925 | { |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 11926 | const char *str; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11927 | |
| 11928 | if (entry->any) |
| 11929 | str = ""; |
| 11930 | else |
| 11931 | { |
| 11932 | if (entry->style == COMMUNITY_LIST_STANDARD) |
| 11933 | str = community_str (entry->u.com); |
| 11934 | else |
| 11935 | str = entry->config; |
| 11936 | } |
| 11937 | return str; |
| 11938 | } |
| 11939 | |
| 11940 | /* Display community-list and extcommunity-list configuration. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 11941 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11942 | community_list_config_write (struct vty *vty) |
| 11943 | { |
| 11944 | struct community_list *list; |
| 11945 | struct community_entry *entry; |
| 11946 | struct community_list_master *cm; |
| 11947 | int write = 0; |
| 11948 | |
| 11949 | /* Community-list. */ |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11950 | cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11951 | |
| 11952 | for (list = cm->num.head; list; list = list->next) |
| 11953 | for (entry = list->head; entry; entry = entry->next) |
| 11954 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11955 | vty_out (vty, "ip community-list %s %s %s%s", |
| 11956 | list->name, community_direct_str (entry->direct), |
| 11957 | community_list_config_str (entry), |
| 11958 | VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11959 | write++; |
| 11960 | } |
| 11961 | for (list = cm->str.head; list; list = list->next) |
| 11962 | for (entry = list->head; entry; entry = entry->next) |
| 11963 | { |
| 11964 | vty_out (vty, "ip community-list %s %s %s %s%s", |
| 11965 | entry->style == COMMUNITY_LIST_STANDARD |
| 11966 | ? "standard" : "expanded", |
| 11967 | list->name, community_direct_str (entry->direct), |
| 11968 | community_list_config_str (entry), |
| 11969 | VTY_NEWLINE); |
| 11970 | write++; |
| 11971 | } |
| 11972 | |
| 11973 | /* Extcommunity-list. */ |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11974 | cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11975 | |
| 11976 | for (list = cm->num.head; list; list = list->next) |
| 11977 | for (entry = list->head; entry; entry = entry->next) |
| 11978 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 11979 | vty_out (vty, "ip extcommunity-list %s %s %s%s", |
| 11980 | list->name, community_direct_str (entry->direct), |
| 11981 | community_list_config_str (entry), VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11982 | write++; |
| 11983 | } |
| 11984 | for (list = cm->str.head; list; list = list->next) |
| 11985 | for (entry = list->head; entry; entry = entry->next) |
| 11986 | { |
| 11987 | vty_out (vty, "ip extcommunity-list %s %s %s %s%s", |
| 11988 | entry->style == EXTCOMMUNITY_LIST_STANDARD |
| 11989 | ? "standard" : "expanded", |
| 11990 | list->name, community_direct_str (entry->direct), |
| 11991 | community_list_config_str (entry), VTY_NEWLINE); |
| 11992 | write++; |
| 11993 | } |
| 11994 | return write; |
| 11995 | } |
| 11996 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 11997 | static struct cmd_node community_list_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11998 | { |
| 11999 | COMMUNITY_LIST_NODE, |
| 12000 | "", |
| 12001 | 1 /* Export to vtysh. */ |
| 12002 | }; |
| 12003 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 12004 | static void |
| 12005 | community_list_vty (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 12006 | { |
| 12007 | install_node (&community_list_node, community_list_config_write); |
| 12008 | |
| 12009 | /* Community-list. */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 12010 | install_element (CONFIG_NODE, &ip_community_list_standard_cmd); |
| 12011 | install_element (CONFIG_NODE, &ip_community_list_standard2_cmd); |
| 12012 | install_element (CONFIG_NODE, &ip_community_list_expanded_cmd); |
| 12013 | install_element (CONFIG_NODE, &ip_community_list_name_standard_cmd); |
| 12014 | install_element (CONFIG_NODE, &ip_community_list_name_standard2_cmd); |
| 12015 | install_element (CONFIG_NODE, &ip_community_list_name_expanded_cmd); |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 12016 | install_element (CONFIG_NODE, &no_ip_community_list_standard_all_cmd); |
| 12017 | install_element (CONFIG_NODE, &no_ip_community_list_expanded_all_cmd); |
| 12018 | install_element (CONFIG_NODE, &no_ip_community_list_name_standard_all_cmd); |
| 12019 | install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_all_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 12020 | install_element (CONFIG_NODE, &no_ip_community_list_standard_cmd); |
| 12021 | install_element (CONFIG_NODE, &no_ip_community_list_expanded_cmd); |
| 12022 | install_element (CONFIG_NODE, &no_ip_community_list_name_standard_cmd); |
| 12023 | install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_cmd); |
| 12024 | install_element (VIEW_NODE, &show_ip_community_list_cmd); |
| 12025 | install_element (VIEW_NODE, &show_ip_community_list_arg_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 12026 | |
| 12027 | /* Extcommunity-list. */ |
| 12028 | install_element (CONFIG_NODE, &ip_extcommunity_list_standard_cmd); |
| 12029 | install_element (CONFIG_NODE, &ip_extcommunity_list_standard2_cmd); |
| 12030 | install_element (CONFIG_NODE, &ip_extcommunity_list_expanded_cmd); |
| 12031 | install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard_cmd); |
| 12032 | install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard2_cmd); |
| 12033 | install_element (CONFIG_NODE, &ip_extcommunity_list_name_expanded_cmd); |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 12034 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_all_cmd); |
| 12035 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_all_cmd); |
| 12036 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_all_cmd); |
| 12037 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_all_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 12038 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_cmd); |
| 12039 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_cmd); |
| 12040 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_cmd); |
| 12041 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_cmd); |
| 12042 | install_element (VIEW_NODE, &show_ip_extcommunity_list_cmd); |
| 12043 | install_element (VIEW_NODE, &show_ip_extcommunity_list_arg_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 12044 | } |